mirror of
https://github.com/Binary-Coalescence/motorDSM.git
synced 2025-08-04 21:55:40 -05:00
Added home position status to poll.
This commit is contained in:
@@ -291,6 +291,8 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
|
|
||||||
// TODO: Will need to add some more error handling for the motor return codes.
|
// TODO: Will need to add some more error handling for the motor return codes.
|
||||||
|
|
||||||
|
setIntegerParam(pC_->motorStatusProblem_, 0);
|
||||||
|
|
||||||
// Read the drive power on status
|
// Read the drive power on status
|
||||||
sprintf(pC_->outString_, "GPS");
|
sprintf(pC_->outString_, "GPS");
|
||||||
comStatus = pC_->writeReadController();
|
comStatus = pC_->writeReadController();
|
||||||
@@ -345,11 +347,13 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
break;
|
break;
|
||||||
case 10: // End of travel error
|
case 10: // End of travel error
|
||||||
setIntegerParam(pC_->motorStatusProblem_, 1);
|
setIntegerParam(pC_->motorStatusProblem_, 1);
|
||||||
|
/*
|
||||||
if (position > 0) {
|
if (position > 0) {
|
||||||
setIntegerParam(pC_->motorStatusHighLimit_, 1);
|
setIntegerParam(pC_->motorStatusHighLimit_, 1);
|
||||||
} else {
|
} else {
|
||||||
setIntegerParam(pC_->motorStatusLowLimit_, 1);
|
setIntegerParam(pC_->motorStatusLowLimit_, 1);
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
break;
|
break;
|
||||||
case 11: // Ramp move error
|
case 11: // Ramp move error
|
||||||
setIntegerParam(pC_->motorStatusProblem_, 1);
|
setIntegerParam(pC_->motorStatusProblem_, 1);
|
||||||
@@ -365,6 +369,8 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
// The response string is of the form "0: Current position in encoder counts: 1000"
|
// The response string is of the form "0: Current position in encoder counts: 1000"
|
||||||
sscanf (pC_->inString_, "%d: %[^:]: %lf", &replyStatus, replyString, &position);
|
sscanf (pC_->inString_, "%d: %[^:]: %lf", &replyStatus, replyString, &position);
|
||||||
setDoubleParam(pC_->motorPosition_, position);
|
setDoubleParam(pC_->motorPosition_, position);
|
||||||
|
setIntegerParam(pC_->motorStatusAtHome_, (position == 0) ? 1:0); // home limit switch
|
||||||
|
setIntegerParam(pC_->motorStatusHome_, (position == 0) ? 1:0); // at home position
|
||||||
|
|
||||||
// Read the current motor integral gain (range 1-1000)
|
// Read the current motor integral gain (range 1-1000)
|
||||||
sprintf(pC_->outString_, "GGN");
|
sprintf(pC_->outString_, "GGN");
|
||||||
@@ -374,8 +380,6 @@ asynStatus MD90Axis::poll(bool *moving)
|
|||||||
sscanf (pC_->inString_, "%d: %[^:]: %d", &replyStatus, replyString, &replyValue);
|
sscanf (pC_->inString_, "%d: %[^:]: %d", &replyStatus, replyString, &replyValue);
|
||||||
setDoubleParam(pC_->motorIGain_, replyValue);
|
setDoubleParam(pC_->motorIGain_, replyValue);
|
||||||
|
|
||||||
setIntegerParam(pC_->motorStatusProblem_, 0);
|
|
||||||
|
|
||||||
skip:
|
skip:
|
||||||
setIntegerParam(pC_->motorStatusProblem_, comStatus ? 1:0);
|
setIntegerParam(pC_->motorStatusProblem_, comStatus ? 1:0);
|
||||||
callParamCallbacks();
|
callParamCallbacks();
|
||||||
|
Reference in New Issue
Block a user