Report if motor is deactivated or in emergency stop mode
This commit is contained in:
+11
-6
@@ -289,7 +289,7 @@ asynStatus turboPmacAxis::init() {
|
||||
asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
|
||||
// Return value for the poll
|
||||
asynStatus errorStatus = asynSuccess;
|
||||
asynStatus pollStatus = asynSuccess;
|
||||
|
||||
// Status of read-write-operations of ASCII commands to the controller
|
||||
asynStatus status = asynSuccess;
|
||||
@@ -446,6 +446,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
*moving = false;
|
||||
setAxisParamChecked(this, motorMessageText,
|
||||
"Deactivated. Please call the support.");
|
||||
pollStatus = asynError;
|
||||
break;
|
||||
case -4:
|
||||
// Emergency stop
|
||||
@@ -454,9 +455,8 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
if (pC_->getMsgPrintControl().shouldBePrinted(keyStatus, true,
|
||||
pC_->pasynUser())) {
|
||||
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
|
||||
"Controller \"%s\", axis %d => %s, line "
|
||||
"%d\nEmergency stop "
|
||||
"activated.%s\n",
|
||||
"Controller \"%s\", axis %d => %s, line %d\nEmergency "
|
||||
"stop activated.%s\n",
|
||||
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
|
||||
pC_->getMsgPrintControl().getSuffix());
|
||||
}
|
||||
@@ -464,6 +464,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
setAxisParamChecked(
|
||||
this, motorMessageText,
|
||||
"Emergency stop. Reset SPS or check emergency stop buttons.");
|
||||
pollStatus = asynError;
|
||||
break;
|
||||
case -3:
|
||||
// Disabled
|
||||
@@ -572,7 +573,11 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
}
|
||||
}
|
||||
|
||||
errorStatus = handleError(error, userMessage, sizeof(userMessage));
|
||||
asynStatus errorStatus =
|
||||
handleError(error, userMessage, sizeof(userMessage));
|
||||
if (errorStatus != asynSuccess) {
|
||||
pollStatus = errorStatus;
|
||||
}
|
||||
|
||||
if (*moving == false) {
|
||||
setAxisParamChecked(this, motorMoveToHome, false);
|
||||
@@ -594,7 +599,7 @@ asynStatus turboPmacAxis::doPoll(bool *moving) {
|
||||
if (status != asynSuccess) {
|
||||
return status;
|
||||
}
|
||||
return errorStatus;
|
||||
return pollStatus;
|
||||
}
|
||||
|
||||
asynStatus turboPmacAxis::handleError(int error, char *userMessage,
|
||||
|
||||
Reference in New Issue
Block a user