Updated to read md90 home status.

This commit is contained in:
2024-05-23 15:47:39 -05:00
parent 67eee854c0
commit 1205814767

View File

@@ -265,7 +265,7 @@ asynStatus MD90Axis::poll(bool *moving)
double replyValue; double replyValue;
int done; int done;
int driveOn; int driveOn;
int limit; int home;
double position; double position;
asynStatus comStatus; asynStatus comStatus;
@@ -290,17 +290,14 @@ asynStatus MD90Axis::poll(bool *moving)
setIntegerParam(pC_->motorStatusDone_, done); setIntegerParam(pC_->motorStatusDone_, done);
*moving = done ? false:true; *moving = done ? false:true;
// Read the limit status // Read the home status
sprintf(pC_->outString_, "#%02dE", axisNo_); sprintf(pC_->outString_, "GHS");
comStatus = pC_->writeReadController(); comStatus = pC_->writeReadController();
if (comStatus) goto skip; if (comStatus) goto skip;
// The response string is of the form "#01E=1" // The response string is of the form "0: Home status: 1"
limit = (pC_->inString_[5] == '1') ? 1:0; sscanf (pC_->inString_, "%d: %[^:]: %lf", &replyStatus, replyString, &replyValue);
setIntegerParam(pC_->motorStatusHighLimit_, limit); home = (replyValue == '1') ? 1:0;
limit = (pC_->inString_[6] == '1') ? 1:0; setIntegerParam(pC_->motorStatusAtHome_, home);
setIntegerParam(pC_->motorStatusLowLimit_, limit);
limit = (pC_->inString_[7] == '1') ? 1:0;
setIntegerParam(pC_->motorStatusAtHome_, limit);
// Read the drive power on status // Read the drive power on status
sprintf(pC_->outString_, "#%02dW", axisNo_); sprintf(pC_->outString_, "#%02dW", axisNo_);