Troubleshooting
S7-200 MBUS_MSG reads time out when writes work on port 0
Short answer
When MBUS_MSG writes complete but reads time out on the S7-200 master, the RS-485 pair, the converter and the MBUS_CTRL settings are already proven, so the fault is inside the read transaction: run the PC software as a slave at the called address, cover the requested holding registers in its map, set RW=0 on the read, and match parity at both ends. A correct exchange then finishes in about 28 ms against the 1000 ms timeout.

On this page
- Why do Modbus reads time out while the writes complete?
- What does the MBUS_MSG Error output tell you first?
- Why does the programming link drop when the CPU goes to Run?
- Do the MBUS_CTRL and simulator serial settings match?
- Is the PC simulator running as a slave at the address the PLC calls?
- Does the simulator's holding-register map cover 40001 to 40002?
- What should a correct read of 40001 to 40002 look like on the wire?
- Is the value you want in the CPU's VW10 or in the slave's register?
- What is the fastest order of checks for this fault?
- Questions asked
On a bench where an S7-200 CPU-224 runs as the Modbus master, finished writes and timed-out reads share the same port 0, the same converter and the same MBUS_CTRL settings — and that is the diagnosis. A completed write proves frames travel out and a confirmation travels back, so the RS-485 pair, the RS-232/RS-485 converter and the serial framing all work. What fails is the read transaction itself: the PC software's operating mode and slave address, the holding-register map behind the requested range, the direction bit in the MBUS_MSG call, or the reply content. This article runs the checks in the order that separates those causes, decodes what a correct read of holding registers 40001 to 40002 must look like on the wire, and ends with the decision for each observation the simulator's communication display can give you.
Why do Modbus reads time out while the writes complete? #
A completed write proves that port 0, the RS-485 pair, the converter and the MBUS_CTRL settings all carry frames, so the fault sits inside the read transaction itself: the simulator's slave role and address, its holding-register map, or the reply it builds.
A write is stronger evidence than it first looks, because a Modbus write also earns a response — the slave confirms the write, and that confirmation came back through the same converter to the master. The read differs only in what the reply must contain, which narrows the suspects to four: the simulator's operating mode, its slave address, its holding-register map over the requested range, and the direction the MBUS_MSG call actually performs. The earlier test with the CPU answering as a slave passed frames in both directions through this same converter, so leave the wiring alone and work from the slave side inward.
What does the MBUS_MSG Error output tell you first? #
Record the nonzero value on the Error output of MBUS_MSG after a failed read and look it up in the S7-200 Modbus master library's error table before changing any setting; the code tells you whether no valid reply arrived or a reply arrived and was rejected.
Both MBUS_CTRL and MBUS_MSG finish each call with Done and Error outputs. Two families of code matter for this fault: one means the master never received an acceptable reply, which points at the slave's silence — role, address, empty map — and the other means a reply arrived but failed inspection, which points at framing or timing. Write both outputs down before and after every change; a fault that moves from a timeout code to an exception code is progress even while the read still fails, because the slave has started answering.
Why does the programming link drop when the CPU goes to Run? #
The SM0.7 bit hands port 0 to PPI while the mode switch sits in Terminal and to the Modbus master library once you turn to Run, so the programming session ending at that moment is the port changing protocol, not a communication fault.
Download the project while the switch is in Terminal, note the Done and Error outputs, then turn to Run and let the selection logic give the port to the master library. From that moment port 0 speaks nothing but Modbus RTU, so watch the link from the far end — the simulator's communication or protocol display — instead of trying to stay online through the same port. If owning one RS-485 port between a PC and Modbus is new ground, why an S7-200 cannot share one RS-485 port with a PC and Modbus works through that conflict in detail.
Do the MBUS_CTRL and simulator serial settings match? #
Set the simulator to the same framing MBUS_CTRL drives: Baud=9600, Parity=2, which the S7-200 Modbus master library defines as even parity, and Timeout=1000, which is milliseconds in this library and gives the slave up to one second to answer.
Match the remaining framing choices — data bits and stop bits — in the simulator's port setup; a mismatch corrupts every character and looks exactly like a dead slave. If parity is the doubt, change both ends to no parity at the same time and repeat one read: frames that then decode prove the path, and you can put even parity back on both ends afterward. Never change one end alone, because a one-sided parity change manufactures the framing errors you are hunting. With these settings the transaction arithmetic in the wire section below uses only a small fraction of the master's wait, so a timeout here is never a tight budget — it is a missing reply.
Is the PC simulator running as a slave at the address the PLC calls? #
The PLC as master and the PC software as master leave nobody to answer, so the simulator must run in slave mode with its slave address set to the value MBUS_MSG puts on the wire, for example 2, before any read can complete.
Two masters on one pair produce two streams of unanswered requests; the earlier PLC-as-slave test worked because the roles were then correct — PC master, CPU answering — and reversing the CPU's role means reversing the PC's. Close every other program that can drive the COM port, start the simulator in slave mode, set its slave address to match the request — 2 in this example — and open its communication display. A correct setup shows exactly one request arrive addressed to that slave and one response leave within milliseconds. Requests that never appear point at the wrong COM port or the wrong address; requests that arrive without a response point at the register map in the next section.
Does the simulator's holding-register map cover 40001 to 40002? #
A read of holding registers 40001 to 40002 completes only when the slave actually holds registers at wire addresses 0 and 1; an empty map usually returns silence and a timeout, while a strict slave returns Modbus exception 02 for the same gap.
Create the table before triggering the read, and confirm which table you filled: holding registers answer function 03 and input registers answer function 04, and the holding-register versus input-register comparison explains which table a given value belongs in. Slave behavior then splits. A strict slave answers an impossible range with a Modbus exception — the same behavior a real PLC slave shows when a read crosses a gap in its map, as the article on Modbus exception 02 when a read crosses a register map gap describes — and that exception is progress, because the master now receives an answer and reports it instead of timing out. A permissive simulator may simply drop the out-of-range request, which keeps the timeout alive and looks identical to a wrong slave address.
What should a correct read of 40001 to 40002 look like on the wire? #
Expect the master to send the eight bytes 02 03 00 00 00 02 plus two CRC bytes and the slave to answer 02 03 04, four data bytes, and two CRC bytes — nine bytes in all.
Worked example, decoded against the simulator's communication display:
- Request
02 03 00 00 00 02plus two CRC bytes: 02 is the slave address, 03 is the Read Holding Registers function, 00 00 is starting address 0 — register 40001 — and 00 02 is a quantity of two registers. That is 6 bytes of message before the CRC, 8 bytes on the wire. - Response
02 03 04then four data bytes then two CRC bytes: 2 registers × 2 bytes per register = 4 data bytes, and 3 header bytes + 4 data bytes + 2 CRC bytes = 9 bytes total. - Time check at 9600 baud with even parity, 11 bits per RTU character: the request costs 8 × 11 = 88 bits ÷ 9600 bit/s ≈ 9.2 ms, the reply costs 9 × 11 = 99 bits ≈ 10.3 ms, and the two 3.5-character silences that frame the messages add 2 × 3.5 × 11 = 77 bits ≈ 8.0 ms. The whole transaction fits in about 28 ms, under 3 percent of the one-second timeout the master allows.
So a visible request that draws no valid reply within that budget is never tight timing; it is a missing or wrong reply. If the display shows the exact exchange above, byte for byte, and MBUS_MSG still reports a timeout, then and only then does the converter's transmit turnaround become the suspect — a release too slow or a held pair truncates the reply — and the fix is a different known converter, not new PLC logic.
Is the value you want in the CPU's VW10 or in the slave's register? #
VW10 holding the value 10 lives in the CPU's own V memory, so the simulator can never read it over the wire; a write with RW=1 sends that word out, and a read with RW=0 pulls the slave's register value into the CPU buffer that DataPtr names.
The bench in this fault mixed the two directions at once: the message was configured to write while the intent was to read, and the test value in VW10 was expected to appear in the simulator, which no simulator setting can arrange. Decide the direction from where the value must exist first:
| Set on MBUS_MSG | The value exists first in | The value ends up in |
|---|---|---|
| RW=0, a read | the slave's holding-register table | the CPU buffer that DataPtr names, after Done |
| RW=1, a write | the CPU buffer that DataPtr names | the slave's holding-register table |
For the diagnostic read, aim DataPtr at a two-register buffer with Count=2; when Done pulses and Error stays at zero, that buffer holds the registers the slave returned, ready for the program to use.
What is the fastest order of checks for this fault? #
Work from the symptom inward: confirm the error code, then the port handover, then the framing, then the simulator's slave identity, then its register map, then the wire bytes, and correct the message direction last, only when the wire shows a write going out where a read was intended.
Run the checks in this order:
- Note the Error value on MBUS_MSG and read it in the library's error table.
- Open the simulator's communication display and trigger one read; a request that never appears sends you back to the port handover and the slave role, a request that appears without a reply sends you to the map.
- Confirm slave mode, the called slave address, and framing identical to MBUS_CTRL at both ends.
- Confirm the holding-register table reaches the requested addresses, and that you filled the holding-register table rather than the input table.
- Decode the exchange against the reference frames; a byte-perfect exchange that still times out convicts the converter's turnaround.
- Confirm the message itself: RW=0 for a read, Count=2, DataPtr on a two-register buffer.
- Re-run and expect Done, Error at zero, and the value in the buffer within a few tens of milliseconds.
The decision, case by case: writes that complete and reads that time out are never a wiring or baud problem on this bench — fix the slave side and the message content. On the bench from the question — one CPU-224 as master, a PC slave at the called address, identical parity at both ends, the full second of wait — the working configuration is: simulator in slave mode at the addressed number, a holding-register map that covers the requested range, and the read message as a two-register read into the buffer DataPtr names. Before pointing the same master at the eleven production slaves, keep the write message disabled until one read completes cleanly, because a write pushed through a wrong map changes real output registers — the discipline behind safe Modbus writes to PLC output registers from SCADA applies to a PLC master the same way.
Questions asked
Can the USB/PPI programming cable carry the Modbus test traffic?
No. The USB/PPI cable exists for programming: the PC side is a USB device and the PLC side speaks PPI, while PC Modbus simulators open a plain COM port, so no Modbus frames pass through it. Download the project with the cable, then run the test traffic through an RS-232 port and an RS-232/RS-485 converter into port 0.
Must MBUS_CTRL run every scan, and can two MBUS_MSG calls overlap?
Call MBUS_CTRL unconditionally every scan so the library keeps servicing port 0, and start a new MBUS_MSG only after the previous one reports Done. The library runs one message at a time; a second call made while the first is still busy comes back as an error rather than waiting in a queue.
How does register 40001 in the simulator setup map to the address on the wire?
The first digit names the table: a five-digit register number beginning with 4 means holding registers. Subtract 40001 from it to get the address the wire carries, so 40001 becomes 0 and 40002 becomes 1, and a request for two registers from the start carries a quantity of 2. Tools that ask for raw addresses want 0; tools that use the five-digit convention want 40001.
The read now completes, but the value in the CPU looks wrong. What changed?
A completed read with Error at zero means the buffer at DataPtr holds the slave's reply, so the value arrived; check how it was entered and how it is read out. Each 16-bit register arrives high byte first, so a decimal 10 entered in the simulator sits in the buffer as hexadecimal 000A, and two consecutive registers occupy four bytes in the order the request declared.
How can I watch the link while the program runs if port 0 belongs to Modbus?
On a one-port CPU such as the CPU-224 you cannot: SM0.7 has already given the port to the master library in Run, so your window on the traffic is the simulator's communication display. A two-port CPU such as the CPU-226 leaves port 1 free, so the same program can run the master on port 0 and stay online through port 1.

