Avoid unnecessary polling if the axis is disconnected.
Test And Build / Lint (push) Failing after 5s
Test And Build / Build (push) Successful in 8s

This commit is contained in:
2026-07-15 16:29:29 +02:00
parent c95c11b089
commit c2b1735f13
2 changed files with 12 additions and 7 deletions
+9
View File
@@ -425,6 +425,15 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
// Perform the rest of the poll, but remember if sth. failed in the
// init.
poll_status = init();
// If the axis is not connected, we don't need to continue with the poll
if (poll_status == asynDisconnected) {
// moving is uninitialized from asynMotorController, so we need to
// make sure it has a reasonable value if the axis is disconnected.
// Obviously, we assume that the disconnected axis is not moving.
*moving = false;
return poll_status;
}
}
// Are we currently waiting for a handshake?
+3 -7
View File
@@ -340,11 +340,8 @@ asynStatus masterMacsController::writeRead(int axisNo, int tcpCmd,
"Connection timeout. Please call the support.");
break;
case asynDisconnected:
snprintf(drvMessageText, sizeof(drvMessageText),
"Axis is not connected.");
break;
case asynDisabled:
snprintf(drvMessageText, sizeof(drvMessageText), "Axis is disabled.");
break;
case asynError:
// Do nothing - error message drvMessageText has already been set.
@@ -465,10 +462,9 @@ asynStatus masterMacsController::parseResponse(
break;
} else if (fullResponse[i] == '\x15') {
/*
NAK
This indicates that the axis is not connected. This is not an error!
*/
// NAK
// This indicates that the axis is not connected. This is not an
// error!
snprintf(drvMessageText, MAXBUF_, "Axis not connected.");
// Motor was connected before -> Update the paramLib entry and PV