Allow enabling / disabling the motor regardless of the status returned by the poll
This commit is contained in:
@ -1271,14 +1271,17 @@ asynStatus turboPmacAxis::enable(bool on) {
|
|||||||
// Status of parameter library operations
|
// Status of parameter library operations
|
||||||
asynStatus pl_status = asynSuccess;
|
asynStatus pl_status = asynSuccess;
|
||||||
|
|
||||||
bool moving = false;
|
|
||||||
rw_status = doPoll(&moving);
|
|
||||||
if (rw_status != asynSuccess) {
|
|
||||||
return rw_status;
|
|
||||||
}
|
|
||||||
|
|
||||||
// =========================================================================
|
// =========================================================================
|
||||||
|
|
||||||
|
/*
|
||||||
|
Continue regardless of the status returned by the poll; we just want to
|
||||||
|
find out whether the motor is currently moving or not. If the poll
|
||||||
|
function fails before it can determine that, it is assumed that the motor
|
||||||
|
is not moving.
|
||||||
|
*/
|
||||||
|
bool moving = false;
|
||||||
|
doPoll(&moving);
|
||||||
|
|
||||||
// If the axis is currently moving, it cannot be disabled. Ignore the
|
// If the axis is currently moving, it cannot be disabled. Ignore the
|
||||||
// command and inform the user. We check the last known status of the axis
|
// command and inform the user. We check the last known status of the axis
|
||||||
// instead of "moving", since status -6 is also moving, but the motor can
|
// instead of "moving", since status -6 is also moving, but the motor can
|
||||||
|
Reference in New Issue
Block a user