Added error status checking to home routine.

This commit is contained in:
2024-08-06 12:46:22 -05:00
parent bf680d0c6f
commit 5e36582ecc

View File

@@ -230,8 +230,10 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
// The MD-90 will start the home routine in the direction of the last move
// Here we first make a small move to set the desired direction before homing
if (!status) {
sprintf(pC_->outString_, "SNS %d", SMALL_NSTEPS);
status = pC_->writeReadController();
}
if (!status) {
status = parseReply(functionName, pC_->inString_);
}
@@ -241,18 +243,21 @@ asynStatus MD90Axis::home(double minVelocity, double maxVelocity, double acceler
} else {
sprintf(pC_->outString_, "ESB");
}
if (!status) {
status = pC_->writeReadController();
}
if (!status) {
status = parseReply(functionName, pC_->inString_);
}
if (!status) {
// Wait for the move to complete, then home
sleepTime = SLEEP_MARGIN * SMALL_NSTEPS * COUNTS_PER_STEP / maxVelocity;
std::this_thread::sleep_for(std::chrono::seconds(sleepTime));
sprintf(pC_->outString_, "HOM");
status = pC_->writeReadController();
}
if (!status) {
status = parseReply(functionName, pC_->inString_);
}