Troubleshooting
Why Modbus RTU sends to slave address 0 instead of your device
Short answer
Address 0 on a Modbus RTU bus is the broadcast address: slaves execute broadcast writes but never reply, so any client waiting for a response times out. If your capture shows 0 as the first byte, the request that actually executes carries the broadcast — verify the CRC, read the raw first byte, then fix the slave ID at the source that feeds that request.
On this page
Your capture is telling you the truth: the controller is transmitting a broadcast. Modbus RTU reserves slave address 0 for broadcast — every device on the bus hears the frame and no device is allowed to answer it — so a client waiting for a response always times out. The ID you entered never reaches the request that actually executes. Stop trusting the configuration screens and read the wire once: capture a single frame, check its CRC, read the raw first byte, and then change the slave ID at the one source that feeds the running request, whether that is a device entry, a custom device definition or a ladder block input. Work through the checks below in order; each one either clears a layer or hands you the fault.
Why address 0 gets no answer #
An RTU frame is one address byte, one function byte, the function's data bytes, then a two-byte CRC transmitted low byte first. Valid slave addresses run 1 through 247, and 0 is the broadcast address. The specification allows only write commands to be broadcast: every connected slave that accepts the function executes it, and none transmits a response, because a broadcast defines no reply. A client that sends 0 and waits for an answer is timing out by design, not because of wiring, baud rate or noise.
That gives the first decision, and it holds on every controller: a frame whose first raw byte is 00 is a broadcast, and no electrical fix makes a slave answer it. Read each field before you touch anything:
- Byte 0 — slave address: 1 through 247 selects one device; 0 broadcasts to all of them.
- Byte 1 — function code: what the client is asking the slave to do.
- Following bytes — the function's data: starting address, values, counts.
- Last two bytes — CRC-16, low byte on the wire first, the check that the frame arrived intact.
Capture one frame and read the first byte #
The USB-to-RS485 adapter test you already ran is the reference. It proves the module's wiring, slave ID, serial settings and register map against a known-good client, and it does not yet say anything about the controller. Build on it in this order:
- With the controller still disconnected, send one command from the adapter and save the raw hex of the request and its response, together with the adapter's serial settings.
- Stop the adapter's polling before reconnecting the controller. RS-485 has no arbitration; two transmitting clients collide and corrupt each other's frames, so the adapter stays a receiver only during the capture.
- Reconnect, run the ladder exactly as it runs in production, and capture one request from the controller.
- Validate the capture before believing it. RTU frames are separated by at least 3.5 character times of line silence — at 9600 baud with the standard 11-bit character (start, 8 data, parity, stop) that is 3.5 × 11 ÷ 9600 bit/s = 4.0 ms, fixed by the specification at 1.75 ms above 19200 baud — and the CRC of the captured frame must check out.
- Read the first byte yourself from the raw hex. An analyzer's decoded labels lie when its serial settings differ from the transmitter's.
At the terminals, match signal names rather than letters: RS-485 A and B naming is not standardized and some devices label the pair D0 and D1. A swapped pair shows up as CRC errors in both directions, which the table below separates from an address fault. And keep the client's response timeout above the module's documented response time — a longer timeout cannot repair a wrong destination address.
| What the capture shows | What it means | What to do next |
|---|---|---|
| No frames from the controller | The request never executes, or the client is bound to the wrong serial port | Watch the rung's enable condition and the port the client is assigned to |
| Frames with CRC or framing errors | Wiring or capture settings, not addressing yet | Match baud, parity, stop bits and A/B against the adapter reference |
| First byte 00 with a valid CRC | The executing request is a broadcast; no slave will reply | Trace the ID source of the running request |
| First byte equals the module's ID with a valid CRC | Addressing works | Move on to the function code and the register map |
Trace the slave ID the running request actually uses #
Your project holds the slave ID in more than one place at once: a device entry in the project resources window, a custom Modbus device defined alongside it, and the address input of the ladder communication block. Those are not duplicates of one setting. They belong to different request paths, and only the path that executes puts its ID on the wire. Editing an entry that no request reads changes nothing — which is the trap in this fault: you set the ID on the function-06 device, the bus still shows 0, and "the tool ignores my ID" is really "that field does not feed this request."
Find the path before you edit anything:
- Identify what starts the traffic: a resource-managed poll driven by the device entry, or a ladder block you trigger explicitly.
- Online, watch the executing block's enable, done and error outputs, and read the address value at the block input itself.
- Check the usual culprits: an unassigned address input left at its default, a 0 typed into the device entry, or another rung overwriting the variable.
- Change the value at that one location, download, confirm the controller is running the edited program, and recapture.
- Disable every other polling path while you test, or the frame you capture may belong to the request you are not editing.
The transmitted first byte is the only verdict. When it shows the module's ID, the address fault is closed, whatever the configuration screens still say.
Match the function code to the register map #
A correctly addressed request can still fail on its function or register number, so finish the diagnosis in that order. Function 06 writes one holding register, 05 writes one coil, 15 and 16 write blocks of coils and holding registers, 03 reads holding registers and 04 reads input registers. A general-purpose module with 16 inputs and 16 outputs often exposes those channels as coils and discrete inputs rather than holding registers, so a function 06 write is rejected even with perfect addressing. Read the module's register map and send the function that matches the data type.
One caution before you transmit again: a broadcast write executes on every device that accepts it, on that bus, immediately — the same reason a Modbus write can change PLC outputs without any rung in the ladder being involved. For testing, send a unicast read of function 03 or 04 to the module's own address first: it changes nothing, and it forces the module to prove it hears its own ID.
A slave that receives its own address but rejects the request answers with an exception: the function code with the top bit set — 0x86 for a failed 06 — followed by a reason code. Code 02, illegal data address, means the register number is outside the slave's map, the same failure covered in Modbus exception 02 when a read crosses a register map gap. Treat that response as progress: addressing is proven, and the fault has moved to the map.
Worked example: read one frame off the wire #
Take the reference capture from the adapter test — a read of two holding registers, addressed to slave 1, whose register address field is 0:
01 03 00 00 00 02 C4 0B
Field by field:
01— slave address 1.03— read holding registers.00 00— starting address 0.00 02— quantity: 2 registers.C4 0B— CRC, low byte on the wire first; the bytes encode 0x0BC4.
You can verify that CRC by hand. Start at 0xFFFF, XOR in each of the six content bytes in order, and after each byte shift the register right eight times, XOR-ing 0xA001 after every shift in which the low bit was 1. Carried through 01 03 00 00 00 02, the register ends at 0x0BC4, which is C4 0B on the wire, and the frame totals 1 + 1 + 4 + 2 = 8 bytes.
Now the fault case: the controller's capture starts 00 06 .... The verdict is already in byte 0. Address 0 makes it a broadcast, function 06 is a legal broadcast write, the specification defines no response to it, so the client's timeout is certain and nothing on the electrical layer can change that. Fix the ID at the source that feeds the executing request, and the same frame addressed to a module set for ID 5 becomes an ordinary unicast that the module must answer or reject with an exception. Recapture and expect 05 in byte 0. Anything else in that byte means the executing request is still not the one you edited.
Questions asked
Which addresses can a Modbus RTU device use?
Set each device to any address from 1 through 247 and keep the numbers unique on one bus. Address 0 is reserved for broadcast, and 248 through 255 are reserved by the specification, so a device left at any of those never takes part in normal polled traffic. After changing an address, power-cycle the device if its manual requires it.
Can a read be sent as a broadcast?
No. The specification restricts broadcast requests to write commands — 05, 06 and 15 are the classic broadcast writes. A broadcast defines no reply, so a read broadcast has nothing to return to. Diagnose addressing with an ordinary unicast read to the device's own address instead.
The slave answered with function code 134 — what does that mean?
134 is 0x86: your function 06 with the exception bit set. The slave received a frame addressed to it, parsed it, and rejected the request. The reason code that follows says which part failed: 02, illegal data address, means the register number is not in the slave's map, while 01 means illegal function and 03 means illegal data value. Addressing, at that point, is proven.
Can two Modbus RTU clients share one RS-485 bus?
RS-485 carries whatever the transmitters put on it; it has no arbitration. Two clients polling on their own schedules collide and corrupt each other's frames, so coordination has to come from the application. While you are capturing, leave the USB adapter as a passive receiver or power it down, and let the controller under test be the only active transmitter on the wire.