- Many improvements to the MasterMACS driver
- Slowing down the pmac driver - Fixing a bug in the Nanotec driver which caused an IOC crash when the motor sends bad data
This commit is contained in:
@@ -377,7 +377,7 @@ asynStatus NanotecAxis::poll(bool *moving)
|
||||
asynStatus comStatus;
|
||||
char command[COMLEN], reply[COMLEN];
|
||||
char *pPtr;
|
||||
int posVal, statVal;
|
||||
int posVal, statVal, count = 0;
|
||||
double lowLim, highLim;
|
||||
|
||||
|
||||
@@ -393,11 +393,12 @@ asynStatus NanotecAxis::poll(bool *moving)
|
||||
if(comStatus) goto skip;
|
||||
|
||||
pPtr = strchr(reply,'C');
|
||||
pPtr++;
|
||||
if(pPtr){
|
||||
posVal = atoi(pPtr);
|
||||
} else {
|
||||
errlogPrintf("Invalid response %s for #C received for axis %d\n", reply, axisNo_);
|
||||
pPtr++;
|
||||
count = sscanf(pPtr,"%d", &posVal);
|
||||
}
|
||||
if(pPtr == NULL || count < 1) {
|
||||
errlogPrintf("Invalid response %s for #C received for axis %d, address %d\n", reply, axisNo_, busAddress);
|
||||
return asynError;
|
||||
}
|
||||
|
||||
@@ -412,11 +413,12 @@ asynStatus NanotecAxis::poll(bool *moving)
|
||||
if(comStatus) goto skip;
|
||||
|
||||
pPtr = strchr(reply,'$');
|
||||
pPtr++;
|
||||
if(pPtr) {
|
||||
statVal = atoi(pPtr);
|
||||
} else {
|
||||
errlogPrintf("Invalid response %s for #$ received for axis %d\n", reply, axisNo_);
|
||||
pPtr++;
|
||||
count = sscanf(pPtr, "%d", &statVal);
|
||||
}
|
||||
if(pPtr == NULL || count < 1) {
|
||||
errlogPrintf("Invalid response %s for #$ received for axis %d busAddress %d\n", reply, axisNo_, busAddress);
|
||||
return asynError;
|
||||
}
|
||||
//errlogPrintf("Axis %d, reply %s, statVal = %d\n",
|
||||
|
||||
Reference in New Issue
Block a user