Modbus Overrun Counters: Capture the Evidence Before Clearing the Flag
An overrun counter returns to zero after a diagnostic reset, but the communications problem soon returns. Clearing a counter removes evidence; it does not establish that the receiver can now process incoming characters reliably. Capture the operating conditions and observation window before considering an authorised clear.

Key takeaways: Compare measured intervals, not isolated counter values. A cleared overrun flag proves a diagnostic operation, not a repaired communication path.
1. Identify the correct diagnostic
The Modbus application protocol defines a serial Diagnostics function 08 subfunction for returning the bus character overrun count. Its separate Clear Overrun Counter and Flag operation is subfunction 20 decimal, or 0x0014. Do not confuse that subfunction with standalone function 20 decimal, Read File Record.
An overrun concerns the receiver losing incoming characters when they cannot be retained or processed, including possible hardware malfunction. It is a different diagnostic from a communication error count. Confirm which counter the exact device exposes and consult its firmware-specific manual before interpreting a tool's abbreviated label.
2. Establish a comparable observation window
Record the device identity, firmware, serial format, traffic pattern and diagnostic time. Capture the existing count and the known reset history. A large lifetime count and a small count accumulated over a short incident window cannot be compared as if they measure the same conditions.
Use ProSense networking and gateway solutions to scope the communication route and available diagnostic access. Identify which component owns the reported counter: the field device, gateway and host may each have different buffers and observations. A clean counter at one point does not prove that another receiver saw no loss.

3. Preserve evidence before an authorised clear
Save a sanitised trace and the surrounding device-status evidence through the approved site process. Establish the operational consequences of diagnostics before issuing anything that changes counters or state. Do not broadcast clears across operating equipment simply to make a maintenance screen look healthy.
In a hypothetical isolated test, an integrator records two overruns during a ten-minute baseline. A later traffic pattern produces repeated increases during the same observation duration. That comparison supports investigating the changed conditions; it does not prove a specific baud rate, cable or device is at fault. Record other changes so the result remains interpretable.
Practical verification checklist
Identify the counter and the component reporting it.
Capture its value, reset history and timed operating window.
Investigate one change at a time in an approved test setting.
Retain before-and-after evidence for any authorised clear.
4. Verify the cause remains resolved
Test one proposed correction at a time on an approved isolated unit or simulator. Compare equivalent observation windows and capture the actual communication outcome, not only a reset count. Include the workload that reproduced the fault and check whether expected responses and fresh application values now arrive.
If the selected device's documentation permits clearing the counter, keep the pre-clear evidence and record the exact time and operator authorisation. Repeat the observation after the clear. A zero value read immediately afterwards offers little evidence about performance under the workload that originally produced the incident.
Observation | Interpretation |
Zero after clear | The count was reset; performance is unproven. |
Count rises again | Compare traffic and elapsed observation time. |
Another receiver is clean | Its counter describes a different observation point. |
5. Recommended related solutions
Discuss route visibility and gateway requirements through ProSense networking and gateway solutions. Use ProSense automation solutions to scope host workload, polling behaviour, unavailable-data handling and commissioning criteria. Verify support for the exact diagnostic function on the proposed equipment; a generic Modbus label is insufficient.
Provide the counter definition, pre-clear reading, observation duration, traffic conditions and sanitised trace when requesting an application assessment. Keep communication maintenance separate from independently engineered safety functions. Competent personnel must assess access, isolation and consequences for the actual plant before diagnostic changes.
Practical FAQs
Is subfunction 20 the same as function 20?
No. The enclosing function and subfunction identify different protocol operations.
Does clearing repair a receiver?
No. Verify the underlying cause and communication outcome separately.
Technical reference
Protocol definitions are from the primary reference. Hypothetical tests, diagnostic checklists and handover recommendations are original engineering guidance; confirm the selected device or endpoint contract.
Need help with your application?
Discuss your industrial integration with ProSense Solutions. Provide a sanitised trace, the actual interface or device documentation, required outcome and commissioning constraints.
.png)


