- Added an edge function to peakcenter for NARZISS
- Fixed ei interrupt bug in tasdrive.c - Made eiger A2 driving work - Added force start facility to devexec for POLDI HV
This commit is contained in:
23
eigera2.c
23
eigera2.c
@ -148,11 +148,12 @@ static int eigera2CheckLimits(void *data, float val,
|
|||||||
static long eigera2SetValue(void *data, SConnection *pCon, float val){
|
static long eigera2SetValue(void *data, SConnection *pCon, float val){
|
||||||
eigera2 self = NULL;
|
eigera2 self = NULL;
|
||||||
float d2r, d2l;
|
float d2r, d2l;
|
||||||
|
int status;
|
||||||
|
|
||||||
self = (eigera2)data;
|
self = (eigera2)data;
|
||||||
|
|
||||||
if(self->state != IDLE){
|
if(self->state != IDLE){
|
||||||
SCWrite(pCon,"ERROR: Eiger A2 still busy...", eError);
|
SCWrite(pCon,"ERROR: Eiger A2 still busy...", eLogError);
|
||||||
return HWFault;
|
return HWFault;
|
||||||
}
|
}
|
||||||
self->a2Target = val;
|
self->a2Target = val;
|
||||||
@ -161,7 +162,12 @@ static long eigera2SetValue(void *data, SConnection *pCon, float val){
|
|||||||
setNewMotorTarget(self->motorList,A2R,d2r);
|
setNewMotorTarget(self->motorList,A2R,d2r);
|
||||||
setNewMotorTarget(self->motorList,A2L,d2l);
|
setNewMotorTarget(self->motorList,A2L,d2l);
|
||||||
self->state = RUNNING;
|
self->state = RUNNING;
|
||||||
return self->listDriv->SetValue(&self->motorList, pCon, 27.);
|
status = self->listDriv->SetValue(&self->motorList, pCon, 27.);
|
||||||
|
if(status != OKOK){
|
||||||
|
self->listDriv->Halt(&self->motorList);
|
||||||
|
self->state = WAITSTOP;
|
||||||
|
}
|
||||||
|
return status;
|
||||||
}
|
}
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
GetValue is supposed to read a motor position
|
GetValue is supposed to read a motor position
|
||||||
@ -211,7 +217,7 @@ static int eigera2CheckStatus(void *data, SConnection *pCon){
|
|||||||
* position after a stop.
|
* position after a stop.
|
||||||
*/
|
*/
|
||||||
status = self->listDriv->CheckStatus(&self->motorList,pCon);
|
status = self->listDriv->CheckStatus(&self->motorList,pCon);
|
||||||
if(status == HWFault || status == HWIdle){
|
if(status == HWIdle){
|
||||||
SCWrite(pCon,"WARNING: driving slits into position after stop", eWarning);
|
SCWrite(pCon,"WARNING: driving slits into position after stop", eWarning);
|
||||||
self->state = WAITSLIT;
|
self->state = WAITSLIT;
|
||||||
self->a2Target = eigera2GetValue(data,pCon);
|
self->a2Target = eigera2GetValue(data,pCon);
|
||||||
@ -222,10 +228,12 @@ static int eigera2CheckStatus(void *data, SConnection *pCon){
|
|||||||
self->listDriv->SetValue(&self->motorList, pCon, 27.);
|
self->listDriv->SetValue(&self->motorList, pCon, 27.);
|
||||||
return HWBusy;
|
return HWBusy;
|
||||||
}
|
}
|
||||||
return status;
|
return HWBusy;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
extern int MOLIEigerStatus(void *data, SConnection * pCon); /* motorlist.c */
|
||||||
|
|
||||||
/*----------------------------------------------------------------
|
/*----------------------------------------------------------------
|
||||||
returns NULL on failure, a new datastructure else
|
returns NULL on failure, a new datastructure else
|
||||||
------------------------------------------------------------------*/
|
------------------------------------------------------------------*/
|
||||||
@ -246,6 +254,7 @@ static eigera2 eigera2MakeObject(){
|
|||||||
}
|
}
|
||||||
self->motorList = LLDcreate(sizeof(MotControl));
|
self->motorList = LLDcreate(sizeof(MotControl));
|
||||||
self->listDriv = makeMotListInterface();
|
self->listDriv = makeMotListInterface();
|
||||||
|
self->listDriv->CheckStatus = MOLIEigerStatus;
|
||||||
|
|
||||||
pDriv = FindDrivable(pServ->pSics,A2);
|
pDriv = FindDrivable(pServ->pSics,A2);
|
||||||
assert(pDriv != NULL);
|
assert(pDriv != NULL);
|
||||||
@ -451,6 +460,12 @@ int DrivableAction(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(strcmp(argv[1],"reset") == 0){
|
||||||
|
selfe = (eigera2)pData;
|
||||||
|
selfe->state = IDLE;
|
||||||
|
SCSendOK(pCon);
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
pDum = (pDummy)pData;
|
pDum = (pDummy)pData;
|
||||||
pDriv = (pIDrivable) pDum->pDescriptor->GetInterface(pDum,DRIVEID);
|
pDriv = (pIDrivable) pDum->pDescriptor->GetInterface(pDum,DRIVEID);
|
||||||
|
@ -140,7 +140,7 @@ static void writeChopper(NXhandle hfil, NXdict hdict, SConnection * pCon)
|
|||||||
|
|
||||||
node = FindHdbNode(NULL,"/sics/choco/chopper/nspee", NULL);
|
node = FindHdbNode(NULL,"/sics/choco/chopper/nspee", NULL);
|
||||||
if(node != NULL){
|
if(node != NULL){
|
||||||
fVal = (float)node->value.v.doubleValue;
|
fVal = atof(node->value.v.text);
|
||||||
NXDputalias(hfil,hdict,"crottarget",&fVal);
|
NXDputalias(hfil,hdict,"crottarget",&fVal);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user