- Modified collective drive operations to run motors in individual tasks
- Added a processnode methos to scriptcontext. processnode waits for the scriptchain of a node to finish. - Fixed a bug in sicsget - Made histmemsec dim and rank manager privilege. To allow chnage at runtime. Is required for SANS - Fixed some issues with multicountersec, mostly relating to passing things through in a sensible way. - Updated motorsec.c to work with a client based driver SKIPPED: psi/polterwrite.c psi/tabledrive.c psi/tabledrive.h
This commit is contained in:
79
motorlist.c
79
motorlist.c
@ -6,6 +6,10 @@
|
||||
copyright: see file COPYRIGHT
|
||||
|
||||
Mark Koennecke, September 2005
|
||||
|
||||
modified to use the task system
|
||||
|
||||
Mark Koennecke, January 2014
|
||||
-----------------------------------------------------------------------*/
|
||||
#include "motorlist.h"
|
||||
#include "lld.h"
|
||||
@ -73,17 +77,18 @@ static int MOLICheckLimits(void *data, float val, char *error, int errlen)
|
||||
------------------------------------------------------------------*/
|
||||
static long MOLISetValue(void *data, SConnection * pCon, float val)
|
||||
{
|
||||
int self = 0, iRet, test;
|
||||
int self = 0, iRet;
|
||||
MotControl tuktuk;
|
||||
|
||||
|
||||
self = *(int *) data;
|
||||
|
||||
iRet = LLDnodePtr2First(self);
|
||||
while (iRet != 0) {
|
||||
LLDnodeDataTo(self, &tuktuk);
|
||||
test = tuktuk.pDriv->SetValue(tuktuk.data, pCon, tuktuk.target);
|
||||
if (test != 1) {
|
||||
return test;
|
||||
tuktuk.taskID = StartDriveTask(tuktuk.data,pCon,tuktuk.name,tuktuk.target);
|
||||
if (tuktuk.taskID < 0) {
|
||||
return HWFault;
|
||||
} else {
|
||||
tuktuk.running = 1;
|
||||
LLDnodeDataFrom(self, &tuktuk);
|
||||
@ -105,7 +110,7 @@ static long MOLISetValue(void *data, SConnection * pCon, float val)
|
||||
------------------------------------------------------------------*/
|
||||
static int MOLICheckStatus(void *data, SConnection * pCon)
|
||||
{
|
||||
int self = 0, iRet, status, result = HWIdle;
|
||||
int self = 0, iRet, status;
|
||||
MotControl tuktuk;
|
||||
|
||||
self = *(int *) data;
|
||||
@ -114,35 +119,17 @@ static int MOLICheckStatus(void *data, SConnection * pCon)
|
||||
while (iRet != 0) {
|
||||
LLDnodeDataTo(self, &tuktuk);
|
||||
if (tuktuk.running == 1) {
|
||||
status = tuktuk.pDriv->CheckStatus(tuktuk.data, pCon);
|
||||
switch (status) {
|
||||
case HWIdle:
|
||||
tuktuk.running = 0;
|
||||
status = isTaskIDRunning(pServ->pTasker,tuktuk.taskID);
|
||||
if(status == 1){
|
||||
return HWBusy;
|
||||
} else {
|
||||
tuktuk.running = 0;
|
||||
LLDnodeDataFrom(self, &tuktuk);
|
||||
break;
|
||||
case HWBusy:
|
||||
result = HWBusy;
|
||||
break;
|
||||
case HWFault:
|
||||
case HWPosFault:
|
||||
/**
|
||||
* It is questionable if one should not set a flag here
|
||||
* and keep polling: it is not clear if this error is a
|
||||
* communication problem or that the motor really
|
||||
* has stopped.
|
||||
*/
|
||||
return status;
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
this is a programming error and has to be fixed
|
||||
*/
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
iRet = LLDnodePtr2Next(self);
|
||||
}
|
||||
return result;
|
||||
return HWIdle;
|
||||
}
|
||||
/*---------------------------------------------------------
|
||||
A special version for EIGER. I am cautious: I have problems
|
||||
@ -151,39 +138,7 @@ static int MOLICheckStatus(void *data, SConnection * pCon)
|
||||
-----------------------------------------------------------*/
|
||||
int MOLIEigerStatus(void *data, SConnection * pCon)
|
||||
{
|
||||
int self = 0, iRet, status, result = HWIdle;
|
||||
MotControl tuktuk;
|
||||
|
||||
self = *(int *) data;
|
||||
|
||||
iRet = LLDnodePtr2First(self);
|
||||
while (iRet != 0) {
|
||||
LLDnodeDataTo(self, &tuktuk);
|
||||
if (tuktuk.running == 1) {
|
||||
status = tuktuk.pDriv->CheckStatus(tuktuk.data, pCon);
|
||||
switch (status) {
|
||||
case HWIdle:
|
||||
tuktuk.running = 0;
|
||||
LLDnodeDataFrom(self, &tuktuk);
|
||||
break;
|
||||
case HWBusy:
|
||||
result = HWBusy;
|
||||
break;
|
||||
case HWFault:
|
||||
case HWPosFault:
|
||||
tuktuk.running = 0;
|
||||
LLDnodeDataFrom(self, &tuktuk);
|
||||
break;
|
||||
default:
|
||||
/*
|
||||
this is a programming error and has to be fixed
|
||||
*/
|
||||
assert(0);
|
||||
}
|
||||
}
|
||||
iRet = LLDnodePtr2Next(self);
|
||||
}
|
||||
return result;
|
||||
return MOLICheckStatus(data,pCon);
|
||||
}
|
||||
|
||||
/*----------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user