1 Commits
1.4.1 ... 1.4.2

Author SHA1 Message Date
21a73717a5 Fixed handshake detection and reset bugs
Some checks failed
Test And Build / Lint (push) Failing after 4s
Test And Build / Build (push) Successful in 7s
2025-08-14 17:16:14 +02:00
2 changed files with 13 additions and 12 deletions

View File

@@ -357,7 +357,10 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
if (timedOut) {
setAxisParamChecked(this, motorMessageText,
"Timed out while waiting for a handshake");
"Timed out while waiting for a handshake. "
"Please call the support.");
poll_status = asynError;
}
pC_->read(axisNo_, 86, response);
@@ -377,14 +380,10 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
pMasterMacsA_->waitForHandshake = false;
pMasterMacsA_->targetReachedUninitialized = false;
} else {
// Still waiting for the handshake - try again in the next busy
// poll. This is already part of the movement procedure.
*moving = true;
setAxisParamChecked(this, motorStatusMoving, *moving);
setAxisParamChecked(this, motorStatusDone, !(*moving));
return asynSuccess;
return poll_status;
}
}
@@ -403,6 +402,9 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
return rw_status;
}
// If we wait for a handshake, but the motor was moving in its last poll
// cycle and has reached its target, it is not moving. Otherwise it is
// considered moving, even if we're still waiting for the handshake.
if (pMasterMacsA_->targetReachedUninitialized) {
*moving = false;
} else {
@@ -679,7 +681,6 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
if (pl_status != asynSuccess) {
return pl_status;
}
return poll_status;
}
@@ -805,8 +806,8 @@ asynStatus masterMacsAxis::doReset() {
asynStatus status = asynSuccess;
// Reset the controller ("node reset")
status = pC_->write(axisNo_, 16, "");
// Reset any errors
status = pC_->write(axisNo_, 17, "");
if (status != asynSuccess) {
setAxisParamChecked(this, motorStatusProblem, true);
}
@@ -822,9 +823,9 @@ asynStatus masterMacsAxis::nodeReset() {
asynStatus status = asynSuccess;
// Reset any errors in the controller. Since the node reset results in a
// Reset the controller ("node reset"). Since the node reset results in a
// power cycle, we use the corresponding timeout.
status = pC_->write(axisNo_, 17, "", PowerCycleTimeout);
status = pC_->write(axisNo_, 16, "", PowerCycleTimeout);
if (status != asynSuccess) {
setAxisParamChecked(this, motorStatusProblem, true);
}