Simplified paramLib access and show error messages for one poll cycle
Simplified getting and setting paramLib entries via a macro and created a mechanism within poll() which makes sure that error messages are shown for at least one poll cycle. Also moved MAXBUF_ to the SinqController level.
This commit is contained in:
@@ -490,17 +490,12 @@ asynStatus sinqController::checkComTimeoutWatchdog(int axisNo,
|
||||
|
||||
asynStatus sinqController::checkComTimeoutWatchdog(sinqAxis *axis) {
|
||||
|
||||
char motorMessage[200] = {0};
|
||||
char errorMessage[MAXBUF_] = {0};
|
||||
|
||||
asynStatus status =
|
||||
checkComTimeoutWatchdog(axis->axisNo(), motorMessage, 200);
|
||||
checkComTimeoutWatchdog(axis->axisNo(), errorMessage, MAXBUF_);
|
||||
if (status == asynError) {
|
||||
status = axis->setStringParam(motorMessageText_, motorMessage);
|
||||
if (status != asynSuccess) {
|
||||
return paramLibAccessFailed(status, "motorMessageText_",
|
||||
axis->axisNo(), __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(axis, motorMessageText, motorMessage);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
@@ -543,17 +538,12 @@ asynStatus sinqController::checkMaxSubsequentTimeouts(int timeoutNo, int axisNo,
|
||||
asynStatus sinqController::checkMaxSubsequentTimeouts(int timeoutNo,
|
||||
sinqAxis *axis) {
|
||||
|
||||
char motorMessage[200] = {0};
|
||||
char motorMessage[MAXBUF_] = {0};
|
||||
|
||||
asynStatus status = checkMaxSubsequentTimeouts(timeoutNo, axis->axisNo(),
|
||||
motorMessage, 200);
|
||||
motorMessage, MAXBUF_);
|
||||
if (status == asynError) {
|
||||
status = axis->setStringParam(motorMessageText_, motorMessage);
|
||||
if (status != asynSuccess) {
|
||||
return paramLibAccessFailed(status, "motorMessageText_",
|
||||
axis->axisNo(), __PRETTY_FUNCTION__,
|
||||
__LINE__);
|
||||
}
|
||||
setAxisParamChecked(axis, motorMessageText, motorMessage);
|
||||
}
|
||||
return status;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user