Skip to content
TRRequest a quote

Modbus RTU Errors: Step-by-Step Troubleshooting

Timeouts, CRC errors or dropouts on a Modbus RTU line? A symptom table and a field checklist in order: physical, settings, protocol.

Published: · Author: Mekatrio team

A Modbus RTU line is often reported as “it works but drops out now and then”. Most problems usually come from three places: the physical line, the settings at both ends, and protocol details. In this article we go through these three layers in order. The aim is to check systematically from cheap to expensive instead of guessing.

Start with the symptom

The table below is a starting point; it is not a definitive diagnosis, it shows you where to begin.

Symptom Likely causes Where to look first
No response at all (timeout) A/B reversed, wrong baud or parity, wrong slave address, common not connected Wiring, device settings
CRC error Parity/stop bit mismatch, noise, termination missing or excessive Parity setting, line ends
Some devices respond, some do not Same address, star connection, one device with different settings Address list, topology
Random dropouts Shield/ground problem, proximity to motor and drive cables, timeout too short, poll too fast Cable routing, master timeout
Response arrives but value is wrong Register address off by 1, wrong function code, data type/order Device register map

1. Physical layer

First question the cable itself. Part of the fault you would spend hours looking for in software is at the terminal block.

  • A/B (D0/D1) may be reversed. Manufacturers use the labels differently; two terminals marked “A” on the same line may be the opposite of each other. If no response comes at all, the first thing to try is swapping the two wires. It does no harm.
  • Termination. There must be one termination at each of the two ends of the line only; none on devices in the middle. The Modbus serial line specification says 150 ohm; in the field, 120 ohm is commonly used to match the cable impedance. Check the cable manufacturer’s impedance and choose accordingly. With none, reflections cause trouble; with three, excess load does.
  • Topology. The main line must be a daisy chain, and branches must be kept short. A star connection creates reflections on long arms and is not recommended. No termination on a branch.
  • Common. The common (signal reference) conductor must be connected between all devices; if the third wire is left unconnected, the line works “sometimes”. The connection to protective earth is made at a single point for the whole line, usually on the master side.
  • Shield. Use shielded twisted pair; the shield is connected to protective earth at one end. A shield grounded at both ends, or not grounded at all, is a common cause of random dropouts. Do not run the line parallel to motor and drive cables; if you have to cross them, cross at right angles.
  • Two masters / two bias points. There must be a single master on the line. If fail-safe bias is needed, it is applied at a single point for the whole line; bias must not be left on in other devices.
  • Cat5 and similar cables. The specification warns about this cable; do not use crossed patch cables on an RS-485 line, as they can damage the device.

2. Settings

If the physical line is sound, move on to the settings at both ends. They must be the same on all devices and on the master.

  • Baud. The specification makes 9600 and 19200 mandatory; 19200 is the default. A device running at a different baud rate will not respond.
  • Parity and stop bit. An RTU character is 11 bits: 1 start, 8 data, 1 parity, 1 stop. In the specification the default is 8E1 (even parity), and if parity is not used, 8N2 (2 stop bits) is required. If one is set to 8E1 and the other to 8N2, a character sent by one side turns into a framing error for the other. This mismatch is one of the most frequent causes of CRC errors and timeouts. If you see an “8N1” option in a device menu, be sure to confirm what the other side expects.
  • Slave address. The valid range is 1-247; 0 is for broadcast. Two devices with the same address respond at the same time, the line is corrupted, and the symptom is “works sometimes”. Write the address list in a table and tick them off one by one.
  • Device count. Do not confuse the address limit with the physical line limit: addresses go up to 247, while on a line without a repeater 32 devices are always allowed. More than that depends on the load value of the receivers and has to be calculated per project.

3. Protocol

Look here if communication is established but the value is wrong or some requests go unanswered.

  • Register addressing offset. Some device documents give the register number 1-based (for example 40001 notation), while some master software works with the 0-based protocol address. So the value you read may turn out to be the value of the neighboring register. Test with a known value (for example the device serial number or a fixed parameter) whether there is a difference of 1 between the address in the document and the address sent in the request.
  • Function code. Holding register (03) and input register (04) are different areas. The device may publish a particular piece of data in only one of them.
  • Timeout and poll time. The duration of a read is roughly calculated as follows: number of request and response bytes x 11 bits / baud, plus two silent intervals, plus the device’s processing time. Example: when reading 10 registers with 03, an 8-byte request and a 25-byte response make 33 bytes, which is 363 bits. At 9600 baud, line time alone is about 38 ms; with processing time and silence it reaches the order of 50 ms per device. If twenty devices are polled in sequence, the cycle is about one second. If you set the timeout below this calculation, or the poll above the line capacity, you get a feeling of dropouts.
  • 3.5-character silence. RTU frames are separated by a silence of at least 3.5 characters; a gap between characters within a frame exceeding 1.5 characters invalidates the frame. At 9600 baud, 3.5 characters is about 4 ms; at 19200 it is about 2 ms. Above 19200 the specification recommends a fixed value (750 microseconds for 1.5 characters, 1.75 ms for 3.5 characters). On PC masters using a USB-RS485 converter, operating system latency can break this interval; a pause within a frame or a short gap between frames occurs this way.

4. Tools

  • USB-RS485 converter and Modbus analyzer software. Connecting to the line passively or as a separate master and seeing the raw frames immediately shows the difference between “no response” and “response arriving corrupted”.
  • Oscilloscope. With the line idle, look at the differential level. An undefined idle level indicates missing bias. Seeing reflection and ringing at the start and end of a frame also tells you whether the termination is in the right place.
  • Multimeter. With power off, the resistance between the ends roughly verifies the number of terminations (two ends, two resistors).

5. Method: one change, keep a record

If you change the address, the baud rate and the cable on the line all at once, you cannot know what fixed it. Make one change at a time and note the result. If possible, keep error counters on the master side (timeout, CRC) and record them with timestamps; only this way can you see whether a random dropout coincides with an event such as a motor starting.

Checklist

  • A/B connection verified, reversed if necessary
  • Line terminated at its two ends only, no star connection
  • Common connected, shield grounded at one end
  • Same baud and parity/stop bit on all devices (8E1 or 8N2)
  • Each device’s slave address is unique and listed
  • 0/1-based offset in register address tested with a known value
  • Function code consistent with the device documentation
  • Timeout and poll time calculated, suitable for the number of devices
  • Line traffic seen with an analyzer, idle level measured
  • Changes made one at a time and recorded

Most Modbus errors are not rare faults but an ordinary setting or wiring slip. If you proceed without breaking the order, field problems usually narrow down in a few steps. If you would like to review your line together, see our Industrial automation page.

Tags

Want to discuss this for your project?