Modbus TCP, Modbus RTU or RS-485 — which do I have?
Look at the socket. An Ethernet socket — the square one a network cable clips into — usually means Modbus TCP. Two or three screw terminals labelled A, B and sometimes GND or SHLD mean Modbus RTU over RS-485. If the equipment has screw terminals but you are reaching it over the network, there is a gateway in between, and that gateway either translates properly (Modbus TCP) or just pipes bytes through (Modbus RTU over TCP). Telling those last two apart matters, because choosing the wrong one produces total silence, which looks exactly like equipment that is switched off.
The three you will meet
| Modbus TCP | Modbus RTU | RTU over TCP | |
|---|---|---|---|
| Physical | Ethernet | RS-485 twisted pair | Ethernet to a gateway, RS-485 beyond it |
| How you address it | IP address and port 502 | COM port, baud rate, unit ID | Gateway IP and port, plus unit ID |
| Devices per connection | Normally one | Up to 32 on a chain, by unit ID | Many, by unit ID |
| Speed | Fast | Slow: 9600 or 19200 baud is typical | As slow as the serial side |
| Error checking | TCP handles it | A CRC on every message | A CRC on every message |
How to tell by looking
- An RJ45 Ethernet socket, and a network settings menu with an IP address in it: Modbus TCP.
- Screw terminals labelled A and B (or D+ and D−, or TX+ and TX−), with a baud-rate setting somewhere in the menus: Modbus RTU over RS-485.
- Both: common on newer equipment. Use the Ethernet one.
- A small separate box with an Ethernet socket on one side and screw terminals on the other, often on a DIN rail in the panel: a gateway. The equipment is RTU; what the gateway presents to the network is the question.
Telling a translating gateway from a transparent one
A gateway labelled “Modbus TCP to Modbus RTU” usually translates: you speak Modbus TCP to it and it speaks RTU to the equipment. A box labelled “serial device server”, “serial to Ethernet” or “TCP transparent mode” usually does not: it forwards the bytes you send, so you have to send RTU-framed bytes yourself.
The practical answer is to try Modbus TCP, and if there is no reply at all, try Modbus RTU over TCP before concluding anything is broken. It costs one button press and resolves this more often than any other single check.
Easy Modbus has a Test connection action that tries both framings and tells you which one answered, then offers to switch the device over. This one problem is the reason that feature exists.
Things that only matter on the serial side
If the equipment is RS-485, several settings have to match on every device on the chain, and they are not discoverable:
- Baud rate — 9600 and 19200 are most common.
- Parity, data bits, stop bits — usually written as 8N1 or 8E1.
- Unit IDs — every device on the chain needs a different one. Two devices sharing an ID produces garbled replies that come and go.
- Termination — a resistor at each end of a long run. Missing termination shows up as intermittent failures that get worse the longer the cable.
- A and B not swapped — and vendors disagree about which wire is which, so swapping them is a normal troubleshooting step rather than an admission of defeat.
Serial Modbus is also much slower than it looks. At 9600 baud one request and reply takes tens of milliseconds, so reading forty values one at a time can take several seconds. Asking for a block of registers in one request rather than one at a time makes a large difference, and is worth doing.