Updated sinqMotor for new msgPrintControl mechanism with minimum repetitions

This commit is contained in:
mathis_s committed 2026-09-17 16:27:23 +02:00
1 parent ce6b9443c2
commit a8d8a7dbaf
2 files changed
+25 -14

No files matched your search

+24 -13
View File
@@ -582,21 +582,32 @@ asynStatus masterMacsAxis::doPoll(bool *moving) {
since this information is not reliable.
*/
if (communicationError()) {
if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUser())) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line "
"%d\nCommunication error.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->getMsgPrintControl().getSuffix());
// Ignore the first four communication errors.
keyError.options_ = {.maxRepetitions = 8, .minRepetitions = 4};
if (pC_->getMsgPrintControl().repetitionCount(keyError) >
keyError.options_.minRepetitions) {
if (pC_->getMsgPrintControl().shouldBePrinted(keyError, true,
pC_->pasynUser())) {
asynPrint(pC_->pasynUser(), ASYN_TRACE_ERROR,
"Controller \"%s\", axis %d => %s, line "
"%d\nCommunication error between MACS and motor "
"controller.%s\n",
pC_->portName, axisNo_, __PRETTY_FUNCTION__, __LINE__,
pC_->getMsgPrintControl().getSuffix());
}
setAxisParamChecked(
this, motorMessageText,
"Communication error between MACS and controller. Try "
"resetting "
"the axis. If the error persists, call the support.");
poll_status = asynError;
} else {
pC_->getMsgPrintControl().incrementRepetitionCount(keyError);
}
setAxisParamChecked(
this, motorMessageText,
"Communication error between MACS and controller. Try resetting "
"the axis. If the error persists, call the support.");
poll_status = asynError;
} else {
// This buffer must be initialized to zero because we build the