Troubleshooting
Fixing Machine SCADA Expert Modbus TCP reads to a TM221
Short answer
Matching IP and port do not prove the read path is right: with MOTCP selected, Machine SCADA Expert must use that driver's station and address syntax, and the number after 4X must resolve to MW0. Rebuild the station and I/O address from the MOTCP manual example, then prove it with known values in MW0 and MW1: the wrong convention reads MW1, exactly one register off.
On this page
When Machine SCADA Expert 2020 refuses to read TM221 memory over Modbus TCP and the IP address and station port already match, the network is the last thing to blame. Two drivers in this software can reach a TM221 over Modbus TCP, MOTCP and SCHNE, and they do not share station or address syntax. The 4X:1 address entered for MW0 is valid only under the convention of the driver actually assigned to the device. Stay with MOTCP, rebuild the station and I/O address from that driver manual example, and expect the fix to be a notation change, not an IP change.
What matching IP and port actually proves #
Matching numbers on both ends prove you typed the same endpoint twice; they say nothing about the Modbus application layer on top. Modbus TCP carries each request over a TCP session on port 502, the port the specification assigns, so read the number configured in the TM221 Ethernet setup in the Machine Expert - Basic project and use exactly that in the station. Then test the session itself from the SCADA host: open a TCP connection to that address and port with a socket test or the driver communication status. A session that opens clears the network and leaves the station driver settings and the tag address as the only suspects. A session that never opens is the whole problem — wrong interface, the service not running, or a blocked port — and no address change will fix it.
One controller, two drivers, two conventions #
MOTCP speaks generic Modbus TCP; SCHNE is the Schneider-oriented driver, and both reach this controller. They differ where it hurts: station configuration and the I/O address format. A station string that is correct for one is meaningless to the other, so the first check in the device properties is which driver the device is actually assigned to. The reported project uses MOTCP, so commit to it: from this point every station field and every address comes from the MOTCP documentation, whose worked example is the baseline to copy field by field. If the device is ever re-created with SCHNE, rebuild the addresses rather than editing them, because a one-character syntax difference fails as completely as a wrong IP.
The 4X reference and the one-register trap #
The Modbus specification defines holding registers as 16-bit words read with function code 03. The classic 4X notation numbers them from 40001, while the request on the wire carries a zero-based register address, so the same word always has two names. On Modicon-style memory, MW0 is the first holding register: reference 40001, offset 0. The conversion is one step, reference = 40001 + MW index, so MW5 is reference 40006, which is offset 5.
That is the trap in 4X:1. If the number after 4X is a one-based reference, position 1 is 40001, which is MW0. If the driver counts offsets from zero, position 1 is MW1 and the tag reads one register high. The exact string MOTCP expects, including how the station number attaches to it, is in the driver manual example; build it from there and never nudge the number by one to experiment, because a wrong convention often returns a plausible value instead of an error. A related failure looks different: a read that reaches past the mapped register range comes back as exception 02 rather than a shifted value, the fault traced in why a Modbus read crossing a register map gap returns exception 02.
Worked example, illustrative values: put MW0 = 1000 and MW1 = 2000 in the controller and read one tag addressed 4X:1.
- The tag shows 1000: 4X:1 resolved to 40001 = MW0, the convention is one-based, the address is correct.
- The tag shows 2000: 4X:1 resolved to offset 1 = MW1, the convention is zero-based, so address MW0 with the offset-0 form the manual shows.
- The tag shows 0 or nothing: the notation does not fit the driver at all; rebuild the whole station and address from the manual example.
Point the station at what is really listening #
The reported setup runs the SCADA against a simulated TM221 program, not the physical controller, and a running simulation proves the logic, not that a Modbus TCP server is answering on an Ethernet interface. Confirm which address the simulated service actually listens on and put that in the station; with both tools on one PC, how to simulate a Modbus TCP SCADA link on one PC is the fastest way to separate a driver fault from an endpoint fault. Against the physical TM221, take the address from the PLC project Ethernet configuration. Decision: if the same station and address work against a known-good server but not against your target, the endpoint is the fault; if the endpoint answers and the read still fails, the driver syntax is.
A read test that settles it #
Safety note first: forcing MW values to known numbers is a write into a live controller, so do it with the machine in a state where those words cannot command motion or outputs.
- Set MW0 = 1000 and MW1 = 2000 in the PLC or simulator.
- Configure one test tag in Machine SCADA Expert with the station and address exactly as the MOTCP manual example shows for a holding register.
- Display that tag on a spare screen object and let the driver poll it.
- Change MW0 to 1500 once. With a 1 s update period the display follows on the next poll, within about a second; if it does not follow, the tag is not reading the word you think it is.
- Repeat step 4 once on the final production object, because a working test tag proves the driver and the address, not that the screen object is assigned to that device.
Decision by symptom #
| Symptom | Real fault | Commit to this fix |
|---|---|---|
| No TCP session to the address and port | Endpoint: wrong interface, service not running, blocked port | Fix the endpoint; addresses are irrelevant until the session opens |
| Session opens, no data or exception 02 | Station or address notation does not fit MOTCP | Rebuild station and I/O address from the MOTCP manual example |
| Tag reads a value, but it is the MW1 value | The 4X number counts offsets from zero | Shift the register number by exactly one so it resolves to MW0 |
| Test tag works, production screen does not | Screen object bound to another device or a stale address | Reassign the object to the verified device and tag |
| Works against the physical TM221, not the simulation | Simulated service not reachable from the station | Point the station at the interface the simulation exposes |
For the reported configuration — MOTCP selected, IP and port matching, 4X:1 for MW0, no reads — run the checks in that order. The endpoint test takes a minute, and the station-and-address rebuild is where this class of fault lands.
Questions asked
Can SCHNE settings be reused for a MOTCP connection to a TM221?
No. Both drivers can reach the controller, but their station configuration and I/O address syntax are different, so values that work in one are not valid in the other. Keep MOTCP as selected and rebuild the station and address from the MOTCP manual example, then prove the result with the MW0 and MW1 read test.
Does 4X:1 always read MW0?
Only if the driver's number after 4X is a one-based reference. MW0 is the first holding register, reference 40001, protocol offset 0. If MOTCP counts offsets from zero instead, position 1 lands on MW1 and the tag reads one register high. Run the known-value test: set MW0 and MW1 to different values and see which one appears.
Which Modbus function code reads MW0 on the TM221?
Function code 03, read holding registers, because MW words are holding registers on this controller. MW0 is reference 40001 in the 4X convention and register address 0 in the request itself; the conversion between the two is a single subtraction, so a mismatch shows up as a one-register shift, not an error.
Is TCP port 502 required for the station?
502 is the port the Modbus TCP specification assigns, and the TM221 side is configured from the PLC project's Ethernet settings, so that is the number to expect on both ends. If the project uses another port, the station must use that same number; matching numbers on both sides is what matters.
Why test against MW0 and MW1 instead of one register?
Two registers with different known values expose the off-by-one directly: if the tag shows MW1's value, the address convention counts offsets, and you shift it by exactly one register. One register alone cannot distinguish a correct read from a neighboring-register read.