Added disconnect handling to sinqMotor
This commit is contained in:
@@ -245,6 +245,10 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
// Clear the communication
|
||||
setAxisParamChecked(this, motorStatusCommsError, false);
|
||||
|
||||
// Assume the motor is initially connected. During the poll, this value will
|
||||
// be set to false if the motor is not connected.
|
||||
setAxisParamChecked(this, motorConnected, true);
|
||||
|
||||
/*
|
||||
The poll function is just a wrapper around doPoll and handles mainly the
|
||||
callParamCallbacks() function. This wrapper is used to make sure
|
||||
@@ -252,6 +256,11 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
||||
*/
|
||||
poll_status = doPoll(moving);
|
||||
|
||||
// Motor is not connected
|
||||
if (poll_status == asynDisconnected) {
|
||||
setAxisParamChecked(this, motorConnected, false);
|
||||
}
|
||||
|
||||
/*
|
||||
If the poll did not succeed OR if an error message is waiting, something
|
||||
went wrong and the motor has a status problem. Otherwise, delete the error
|
||||
|
||||
Reference in New Issue
Block a user