- Made the HRPT temperature log lmd200 work

- Added a special el734hp which scales with 1000 for SANSLI
- Added another error to the magnet driver: magnet broken
This commit is contained in:
koennecke
2008-05-08 09:29:48 +00:00
parent 358c121b30
commit 5e96ae6939
7 changed files with 155 additions and 35 deletions

View File

@ -23,6 +23,9 @@
#include "hardsup/el755_errcodes.h"
#include "hardsup/sinq_prototypes.h"
#define CAPSIZED -8090
#define ABS(x) (x < 0 ? -(x) : (x))
/*-----------------------------------------------------------------------*/
typedef struct {
void *pData;
@ -31,6 +34,7 @@
int iChannel;
int iIndex;
int iLastError;
int iCapCount;
} EL755Driv, *pEL755Driv;
/*---------------------------------------------------------------------------*/
@ -49,6 +53,22 @@
{
return 0;
}
/**
* This here is a check for the condition when the current breaks down.
* This situation is characterized by the fSoll being something and the
* fPos being 0.
*/
if(ABS(*fPos) < .1 && ABS(fSoll) > .1 ){
pMe->iCapCount++;
if(pMe->iCapCount > 3){
pMe->iLastError = CAPSIZED;
return 0;
}
}
else
{
pMe->iCapCount = 0;
}
return 1;
}
/*----------------------------------------------------------------------------*/
@ -62,6 +82,7 @@
assert(pMe);
iRet = EL755_SetCurrent(&(pMe->pData),fVal);
pMe->iCapCount = 0;
if(iRet != 1)
{
return 0;
@ -84,6 +105,9 @@
EL755_ErrInfo(&pPtr,iCode,&i1,&i2);
switch(*iCode)
{
case CAPSIZED:
strncpy(error,"Powersupply has capsized, try lower current", iErrLen);
break;
case EL755__TURNED_OFF:
strncpy(error,"EL755__TURNED_OF",iErrLen);
break;
@ -215,6 +239,7 @@
switch(iError)
{
case CAPSIZED:
case EL755__TURNED_OFF:
case EL755__TOO_MANY:
case EL755__TOO_LARGE: