- 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
This commit is contained in:
@ -335,7 +335,11 @@ static void PoldiStart(pPolterdi self, SConnection * pCon)
|
|||||||
for (i = 0; i < iLength; i++) {
|
for (i = 0; i < iLength; i++) {
|
||||||
fTime2[i] = fTime[i] / 2.;
|
fTime2[i] = fTime[i] / 2.;
|
||||||
}
|
}
|
||||||
sprintf(pBueffel, "%d", iLength);
|
if(iLength > 2){
|
||||||
|
sprintf(pBueffel, "%d", iLength);
|
||||||
|
} else {
|
||||||
|
sprintf(pBueffel, "%d", 1);
|
||||||
|
}
|
||||||
NXDupdate(hdict, "timebin", pBueffel);
|
NXDupdate(hdict, "timebin", pBueffel);
|
||||||
NXDputalias(hfil, hdict, "dtime", fTime2);
|
NXDputalias(hfil, hdict, "dtime", fTime2);
|
||||||
free(fTime2);
|
free(fTime2);
|
||||||
|
43
tabledrive.c
43
tabledrive.c
@ -367,18 +367,21 @@ static float calculateNextStep(pTableDrive self)
|
|||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
static int runToNextStep(pTableDrive self, SConnection * pCon, float value)
|
static int runToNextStep(pTableDrive self, SConnection * pCon, float value)
|
||||||
{
|
{
|
||||||
int status, test;
|
int status;
|
||||||
tdMotor moti;
|
tdMotor moti;
|
||||||
float target;
|
float target;
|
||||||
|
long motID;
|
||||||
|
|
||||||
|
self->groupID = GetTaskGroupID(pServ->pTasker);
|
||||||
status = LLDnodePtr2First(self->motorTable);
|
status = LLDnodePtr2First(self->motorTable);
|
||||||
while (status != 0) {
|
while (status != 0) {
|
||||||
LLDnodeDataTo(self->motorTable, &moti);
|
LLDnodeDataTo(self->motorTable, &moti);
|
||||||
target = findTarget(moti, value);
|
target = findTarget(moti, value);
|
||||||
test = MotorRun(moti.pMot, pCon, target);
|
motID = StartDriveTask(moti.pMot,pCon,moti.motorName,target);
|
||||||
if (test != OKOK) {
|
if(motID < 0){
|
||||||
return test;
|
return HWFault;
|
||||||
}
|
}
|
||||||
|
AddTaskToGroup(pServ->pTasker,motID,self->groupID);
|
||||||
status = LLDnodePtr2Next(self->motorTable);
|
status = LLDnodePtr2Next(self->motorTable);
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
@ -391,18 +394,11 @@ static int checkRunning(pTableDrive self, SConnection * pCon)
|
|||||||
int test;
|
int test;
|
||||||
tdMotor moti;
|
tdMotor moti;
|
||||||
|
|
||||||
status = LLDnodePtr2First(self->motorTable);
|
if(isTaskGroupRunning(pServ->pTasker,self->groupID)){
|
||||||
while (status != 0) {
|
return HWBusy;
|
||||||
LLDnodeDataTo(self->motorTable, &moti);
|
}
|
||||||
test = moti.pMot->pDrivInt->CheckStatus(moti.pMot, pCon);
|
|
||||||
if (test != HWIdle && test != OKOK) {
|
|
||||||
return test;
|
|
||||||
}
|
|
||||||
status = LLDnodePtr2Next(self->motorTable);
|
|
||||||
}
|
|
||||||
return HWIdle;
|
return HWIdle;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*------------------------------------------------------------------------*/
|
/*------------------------------------------------------------------------*/
|
||||||
static void showPositions(pTableDrive self, SConnection * pCon,
|
static void showPositions(pTableDrive self, SConnection * pCon,
|
||||||
char *pBueffel, int buffLen)
|
char *pBueffel, int buffLen)
|
||||||
@ -529,11 +525,13 @@ static int startASDS(pTableDrive self, SConnection * pCon, int target)
|
|||||||
int status;
|
int status;
|
||||||
char name[132];
|
char name[132];
|
||||||
float targetValue;
|
float targetValue;
|
||||||
|
long motID;
|
||||||
|
|
||||||
if (self == NULL || self->motorTable < 0) {
|
if (self == NULL || self->motorTable < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self->groupID = GetTaskGroupID(pServ->pTasker);
|
||||||
status = LLDnodePtr2First(self->motorTable);
|
status = LLDnodePtr2First(self->motorTable);
|
||||||
while (status != 0) {
|
while (status != 0) {
|
||||||
LLDnodeDataTo(self->motorTable, &moti);
|
LLDnodeDataTo(self->motorTable, &moti);
|
||||||
@ -545,10 +543,12 @@ static int startASDS(pTableDrive self, SConnection * pCon, int target)
|
|||||||
} else {
|
} else {
|
||||||
targetValue = findTarget(moti, self->targetPosition);
|
targetValue = findTarget(moti, self->targetPosition);
|
||||||
}
|
}
|
||||||
status = MotorRun(moti.pMot, pCon, targetValue);
|
motID = StartDriveTask(moti.pMot,pCon,moti.motorName,targetValue);
|
||||||
if (status != OKOK) {
|
if(motID < 0){
|
||||||
return status;
|
return HWFault;
|
||||||
}
|
}
|
||||||
|
AddTaskToGroup(pServ->pTasker,motID,self->groupID);
|
||||||
|
|
||||||
}
|
}
|
||||||
status = LLDnodePtr2Next(self->motorTable);
|
status = LLDnodePtr2Next(self->motorTable);
|
||||||
}
|
}
|
||||||
@ -562,11 +562,13 @@ static int startOthers(pTableDrive self, SConnection * pCon)
|
|||||||
int status;
|
int status;
|
||||||
char name[132];
|
char name[132];
|
||||||
float targetValue;
|
float targetValue;
|
||||||
|
long motID;
|
||||||
|
|
||||||
if (self == NULL || self->motorTable < 0) {
|
if (self == NULL || self->motorTable < 0) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self->groupID = GetTaskGroupID(pServ->pTasker);
|
||||||
status = LLDnodePtr2First(self->motorTable);
|
status = LLDnodePtr2First(self->motorTable);
|
||||||
while (status != 0) {
|
while (status != 0) {
|
||||||
LLDnodeDataTo(self->motorTable, &moti);
|
LLDnodeDataTo(self->motorTable, &moti);
|
||||||
@ -574,10 +576,11 @@ static int startOthers(pTableDrive self, SConnection * pCon)
|
|||||||
strtolower(name);
|
strtolower(name);
|
||||||
if (strstr(name, "ds") == NULL && strstr(name, "as") == NULL) {
|
if (strstr(name, "ds") == NULL && strstr(name, "as") == NULL) {
|
||||||
targetValue = findTarget(moti, self->targetPosition);
|
targetValue = findTarget(moti, self->targetPosition);
|
||||||
status = MotorRun(moti.pMot, pCon, targetValue);
|
motID = StartDriveTask(moti.pMot,pCon,moti.motorName,targetValue);
|
||||||
if (status != OKOK) {
|
if(motID < 0){
|
||||||
return status;
|
return HWFault;
|
||||||
}
|
}
|
||||||
|
AddTaskToGroup(pServ->pTasker,motID,self->groupID);
|
||||||
}
|
}
|
||||||
status = LLDnodePtr2Next(self->motorTable);
|
status = LLDnodePtr2Next(self->motorTable);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,7 @@ typedef struct {
|
|||||||
int debug;
|
int debug;
|
||||||
tdMotor oriMotor;
|
tdMotor oriMotor;
|
||||||
int oriInvalid;
|
int oriInvalid;
|
||||||
|
long groupID;
|
||||||
} TableDrive, *pTableDrive;
|
} TableDrive, *pTableDrive;
|
||||||
|
|
||||||
/*-------------------------------------------------------------------------*/
|
/*-------------------------------------------------------------------------*/
|
||||||
|
Reference in New Issue
Block a user