Avoid unnecessary polling if the axis is disconnected.
This commit is contained in:
@@ -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?
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user