Energy meters stop updating on the BMS graphics, a VFD shows “comm fail”, or a chiller’s values look like nonsense. Modbus is simple, which is why it is everywhere — and why most of its faults come down to a handful of causes: wiring, serial settings, addresses, register mapping and polling. This guide covers both Modbus RTU on RS-485 and Modbus TCP on Ethernet.
Read the symptom
| What you see | Look first at |
|---|---|
| Every device on one RS-485 trunk times out | The gateway or master port, its serial settings, the trunk wiring near the master |
| One device times out, others fine | That device’s address, serial settings, power, or its drop of the cable |
| Devices drop in and out | Termination, biasing, cable routing near power cables, polling too fast, timeouts too short |
| An exception code is returned | The request itself: function code, register address or count (see exception codes) |
| Values arrive but are wrong | Register offset, data type, word order or scaling (see addressing and data types) |
A timeout and an exception are different. A timeout means no valid reply came back at all. An exception means the device heard the request and refused it — which proves the wiring and settings are working.
Read-only first
Modbus RTU (RS-485) checks
- Match the serial settings everywhere. Every device on a trunk must use the same baud rate, data bits, parity and stop bits as the master. 9600 and 19200 baud are common. The Modbus serial specification’s default is even parity; when no parity is used it calls for two stop bits, but many devices are shipped as 8 data bits, no parity, one stop bit. Check each device’s menu rather than assuming.
- Make every address unique. Slave addresses run from 1 to 247; 0 is broadcast. Two devices with the same address corrupt each other’s replies. A replaced meter often arrives set to address 1.
- Check polarity. Terminal names differ between makers (A/B, D+/D−, sometimes reversed meaning). If a single device never replies and everything else matches, swapping its two data wires is a reasonable test.
- Wire a daisy chain. RS-485 is designed as one line from device to device, with short stubs. Star wiring and long branches cause reflections and intermittent faults.
- Terminate the ends, bias once. A 120 Ω terminator belongs at each of the two physical ends of the trunk only. Bias (fail-safe) resistors hold the line in a known state when nobody is transmitting; they are usually fitted once, often at the master or gateway. Check whether the gateway or a device already has them switched in.
- Connect the reference and the screen properly. Use twisted-pair cable, connect the common (0 V) conductor where the devices provide a terminal for it, and earth the screen at one point only. Keep the trunk away from VFD output cables and power wiring.
- Respect the limits. A standard RS-485 segment supports 32 unit loads and is commonly rated to about 1,200 m at lower baud rates. Longer runs or more devices need repeaters.
Polling speed matters on serial trunks. At 9600 baud, a few devices polled for a few registers each can take most of a second:
- Each character is 11 bits (start, 8 data, parity, stop): 9600 ÷ 11 ≈ 873 characters per second, about 1.15 ms each.
- Reading 10 holding registers: request 8 bytes, reply 5 + 20 = 25 bytes, total 33 characters.
- Add the 3.5-character silent gap after each frame: 33 + 7 = 40 character times ≈ 46 ms.
- Add the device’s own response time (often tens of milliseconds) and the master’s delay between polls.
So one trunk at 9600 baud manages roughly ten such reads per second at best. Thirty meters with five register blocks each will not all update every second; slow the poll rate or split the trunk.
Also check the master’s response timeout: too short and slow devices are marked failed even though they answer.
Modbus TCP checks
- Prove the network path. Ping the device or gateway from the BMS server. Then test the Modbus port (502 unless changed) with
Test-NetConnection <IP> -Port 502in PowerShell. Ping working but the port failing means a firewall or a device with Modbus TCP disabled. - Check the IP plan. Wrong subnet masks, missing gateways and duplicate addresses are common on BMS networks built in stages. The subnet planner helps check them.
- Set the unit ID correctly. Through a Modbus TCP-to-RTU gateway, the unit ID selects which serial slave behind the gateway answers, so it must equal that device’s RTU address. Native Modbus TCP devices usually expect a fixed unit ID such as 1 or 255; check the device manual.
- Check connection limits. Many small devices accept only a few simultaneous TCP connections. If a commissioning laptop, an energy-monitoring system and the BMS all poll the same meter, one of them may be refused.
Wrong values: addressing and data types
If the device replies but the value is wrong, compare the BMS point against the device’s register map.
- Off by one. Register maps often use reference numbers such as 40001, meaning holding register at protocol address 0, read with function code 03. Some software wants 40001, some wants 0, some wants 1. If every value looks like its neighbour’s, shift the address by one.
- Wrong table. Holding registers (4xxxx) are read with function code 03; input registers (3xxxx) with 04; coils (0xxxx) with 01; discrete inputs (1xxxx) with 02. Reading the right number from the wrong table returns the wrong data or exception 02.
- 32-bit values across two registers. Floats and long integers use two consecutive registers, and makers disagree about which register holds the high word. A voltage that should read 230.5 but shows a tiny value such as −2.4 × 10−41 (230.5 read with its two words swapped) usually needs the word order changed.
- Scaling and sign. A register showing 2305 may mean 230.5 V with a scale of 0.1. A value of 65,535 that should be −1 means the point is set as unsigned instead of signed.
- Map version. Firmware updates sometimes change register maps. Check the map matches the device’s firmware version.
Exception codes
| Code | Name | Usual meaning on site |
|---|---|---|
| 01 | Illegal function | The device does not support that function code (for example reading input registers from a device that has only holding registers). |
| 02 | Illegal data address | The register does not exist: wrong offset, wrong table, or a block that runs past the end of the map. |
| 03 | Illegal data value | A value in the request is not allowed, often a register count that is too large. |
| 04 | Server device failure | The device hit an internal error while handling the request. |
| 06 | Server device busy | The device is busy; retry later or poll less often. |
| 0A (10) | Gateway path unavailable | The gateway has no route configured for that unit ID. |
| 0B (11) | Gateway target failed to respond | The gateway asked the serial device and got no answer: go back to the RTU checks for that device. |
Isolate with a test master
When the BMS, a gateway and a trunk full of devices are all suspects, take the BMS out of the picture.
- Connect a laptop directly. Use a USB-to-RS-485 converter (or the network, for Modbus TCP) and a Modbus master test tool.
- Poll one known register on one device. Use read-only function codes, the device’s documented settings and a generous timeout.
- Interpret the result. If the laptop reads it, the device and that cable are fine: look at the gateway or BMS configuration. If the laptop cannot, the fault is the device, its settings or the cable. Move the laptop along the trunk to narrow it down.
- Restore and record. Reconnect everything as it was, then write down the settings that worked and update the points list.
