diff --git a/sinqMotor b/sinqMotor index 7cad532..4a58251 160000 --- a/sinqMotor +++ b/sinqMotor @@ -1 +1 @@ -Subproject commit 7cad532a296d6bab35a7ffaa4ff91b4f29ddb5e4 +Subproject commit 4a582511730af4f4cc256aed58f8a03079094c82 diff --git a/src/masterMacsAxis.cpp b/src/masterMacsAxis.cpp index 91b26cf..72fe838 100644 --- a/src/masterMacsAxis.cpp +++ b/src/masterMacsAxis.cpp @@ -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