diff --git a/sinqMotor b/sinqMotor index 8689c79..7a0de4e 160000 --- a/sinqMotor +++ b/sinqMotor @@ -1 +1 @@ -Subproject commit 8689c79f19a5a7b3522868d8bf353f8a1ceb41ea +Subproject commit 7a0de4e9d95423907f9ff8e5dc0a2c661e68f557 diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index 4f80de3..e1f6c92 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -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); }