mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -05:00
Updated to read md90 moving status.
This commit is contained in:
@@ -269,6 +269,8 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
double position;
|
double position;
|
||||||
asynStatus comStatus;
|
asynStatus comStatus;
|
||||||
|
|
||||||
|
// TODO: Will need to add some more error handling for the motor return codes.
|
||||||
|
|
||||||
// Read the current motor position
|
// Read the current motor position
|
||||||
sprintf(pC_->outString_, "GEE");
|
sprintf(pC_->outString_, "GEE");
|
||||||
comStatus = pC_->writeReadController();
|
comStatus = pC_->writeReadController();
|
||||||
@@ -279,11 +281,12 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
setDoubleParam(pC_->motorPosition_, position);
|
setDoubleParam(pC_->motorPosition_, position);
|
||||||
|
|
||||||
// Read the moving status of this motor
|
// Read the moving status of this motor
|
||||||
sprintf(pC_->outString_, "#%02dX", axisNo_);
|
sprintf(pC_->outString_, "STA");
|
||||||
comStatus = pC_->writeReadController();
|
comStatus = pC_->writeReadController();
|
||||||
if (comStatus) goto skip;
|
if (comStatus) goto skip;
|
||||||
// The response string is of the form "#01X=1"
|
// The response string is of the form "0: Current status value: 0"
|
||||||
done = (pC_->inString_[5] == '0') ? 1:0;
|
sscanf (pC_->inString_, "%d: %[^:]: %lf", &replyStatus, replyString, &replyValue);
|
||||||
|
done = (replyValue == '2') ? 0:1;
|
||||||
setIntegerParam(pC_->motorStatusDone_, done);
|
setIntegerParam(pC_->motorStatusDone_, done);
|
||||||
*moving = done ? false:true;
|
*moving = done ? false:true;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user