Allow enabling / disabling the motor regardless of the status returned by the poll

This commit is contained in:
2025-05-13 14:44:24 +02:00
parent 47e72d65a9
commit 7bf31ac256

View File

@ -1271,14 +1271,17 @@ asynStatus turboPmacAxis::enable(bool on) {
// Status of parameter library operations
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
// 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