PositionDeadband, dynamic limit detection, velocity mode
Integrated a readout function for the position deadband. Also read from the controller if the axis has dynamic limits and only poll the limits repeatedly if that is the case. Lastly, added support for the velocity mode (untested!).
This commit is contained in:
@@ -570,7 +570,45 @@ asynStatus masterMacsController::readInt32(asynUser *pasynUser,
|
||||
*value = 1;
|
||||
return asynSuccess;
|
||||
} else {
|
||||
return asynMotorController::readInt32(pasynUser, value);
|
||||
return sinqController::readInt32(pasynUser, value);
|
||||
}
|
||||
}
|
||||
|
||||
asynStatus masterMacsController::writeInt32(asynUser *pasynUser,
|
||||
epicsInt32 value) {
|
||||
// masterMacs can be disabled
|
||||
if (pasynUser->reason == motorSetMode()) {
|
||||
|
||||
// First call to the sinqController function. It checks whether it is
|
||||
// possible to set the mode and whether the given value is valid.
|
||||
asynStatus status = sinqController::writeInt32(pasynUser, value);
|
||||
if (status == asynSuccess) {
|
||||
|
||||
// Now write to the hardware
|
||||
char command[MAXBUF_];
|
||||
int axisNo;
|
||||
getAddress(pasynUser, &axisNo);
|
||||
|
||||
// Map the EPICS value to MasterMACS values (see
|
||||
// MasterMACS_manual.pdf).
|
||||
int adjustedValue = 0;
|
||||
if (value == 0) {
|
||||
adjustedValue = 1;
|
||||
} else if (value == 1) {
|
||||
adjustedValue = 3;
|
||||
} else {
|
||||
// This branch is unreachable, as it is is already checked
|
||||
// within sinqController::writeInt32 that value is either 0
|
||||
// or 1.
|
||||
return asynError;
|
||||
}
|
||||
|
||||
snprintf(command, sizeof(value), "%d", adjustedValue);
|
||||
return write(axisNo, 07, command);
|
||||
}
|
||||
return status;
|
||||
} else {
|
||||
return sinqController::writeInt32(pasynUser, value);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user