From 7bf31ac256f337b916cae2ccb1e359891d50a8ca Mon Sep 17 00:00:00 2001 From: smathis Date: Tue, 13 May 2025 14:44:24 +0200 Subject: [PATCH] Allow enabling / disabling the motor regardless of the status returned by the poll --- src/turboPmacAxis.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/turboPmacAxis.cpp b/src/turboPmacAxis.cpp index 9e631d5..c22f32b 100644 --- a/src/turboPmacAxis.cpp +++ b/src/turboPmacAxis.cpp @@ -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