Some cleanup, force reload encoder before enable
This commit is contained in:
@@ -816,7 +816,7 @@ asynStatus SeleneController::writeFloat64(asynUser *pasynUser, epicsFloat64 valu
|
||||
|
||||
asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
int function = pasynUser->reason;
|
||||
asynStatus status = asynError;
|
||||
asynStatus status = asynSuccess;
|
||||
pmacV3Axis *pAxis = NULL;
|
||||
char command[64] = {0};
|
||||
char response[64] = {0};
|
||||
@@ -831,9 +831,13 @@ asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
|
||||
/* Set the parameter and readback in the parameter library. This may be
|
||||
* overwritten when we read back the status at the end, but that's OK */
|
||||
status = pAxis->setIntegerParam(function, value);
|
||||
pAxis->setIntegerParam(function, value);
|
||||
|
||||
if (function == enableAxis_) {
|
||||
if(value == 1) {
|
||||
sprintf(command, "M%2.2d=15\n", pAxis->axisNo_);
|
||||
lowLevelWriteRead(pAxis->axisNo_, command, response);
|
||||
}
|
||||
sprintf(command, "M%2.2d14=%d\n", pAxis->axisNo_, value);
|
||||
asynPrint(this->pasynUserSelf, ASYN_TRACE_FLOW,
|
||||
"%s: Enable axis on controller %s, axis %d enable=%d\n",
|
||||
@@ -845,7 +849,7 @@ asynStatus pmacV3Controller::writeInt32(asynUser *pasynUser, epicsInt32 value) {
|
||||
|
||||
// Execute the command.
|
||||
if (command[0] != 0 && status == asynSuccess) {
|
||||
status = lowLevelWriteRead(pAxis->axisNo_, command, response);
|
||||
lowLevelWriteRead(pAxis->axisNo_, command, response);
|
||||
}
|
||||
|
||||
return pmacController::writeInt32(pasynUser, value);
|
||||
|
||||
Reference in New Issue
Block a user