Fixed wrong limits after power cycle
This commit is contained in:
+16
-3
@@ -793,9 +793,22 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
|
||||
}
|
||||
}
|
||||
|
||||
// Update the enable PV
|
||||
setAxisParamChecked(this, motorEnableRBV,
|
||||
readyToBeSwitchedOn() && switchedOn());
|
||||
/*
|
||||
If the motor just got enabled, we need to initialize it, because some
|
||||
parameters like the limits on the motor controllers are lost during a power
|
||||
cycle and are rewritten from the masterMacs "meta-controller" when enabling.
|
||||
*/
|
||||
int wasEnabled = 0;
|
||||
int isEnabled = readyToBeSwitchedOn() && switchedOn();
|
||||
|
||||
getAxisParamChecked(this, motorEnableRBV, &wasEnabled);
|
||||
if (isEnabled && !wasEnabled) {
|
||||
rwStatus = init();
|
||||
if (rwStatus != asynSuccess) {
|
||||
return rwStatus;
|
||||
}
|
||||
}
|
||||
setAxisParamChecked(this, motorEnableRBV, isEnabled);
|
||||
|
||||
if (*moving) {
|
||||
// If the axis is moving, evaluate the movement direction
|
||||
|
||||
Reference in New Issue
Block a user