What is different, how each is wired, and which one to choose
Tutorials › Modbus TCP vs RTU
Modbus comes in two variants you will meet constantly in the field: Modbus RTU over serial and Modbus TCP/IP over Ethernet. They carry the same data model - coils, discrete inputs, input registers and holding registers - and the same function codes. What differs is the transport: how the message is framed and physically moved between devices.
Both variants use the same Protocol Data Unit (PDU): a function code plus data. A master reads or writes the same registers either way. So if you can talk to a device over RTU, the register map is identical over TCP - only the connection changes.
Modbus RTU wraps the PDU with a 1-byte slave address at the front and a 2-byte CRC checksum at the end. Message boundaries are detected by silent gaps on the wire (about 3.5 character times).
Modbus TCP drops the CRC (TCP/IP already guarantees integrity) and adds a 7-byte MBAP header containing a transaction ID, protocol ID, length and unit ID. The unit ID replaces the RTU slave address and is often used when bridging to serial devices through a gateway.
| Aspect | Modbus RTU | Modbus TCP/IP |
|---|---|---|
| Physical layer | RS-485 / RS-232 | Ethernet |
| Topology | Multi-drop bus (daisy chain) | Star (switch) |
| Speed | Up to 115,200 baud | 10/100/1000 Mbps |
| Max devices | Up to 247 on a bus | Effectively unlimited |
| Distance | Up to ~1,200 m (RS-485) | ~100 m per segment |
| Error check | CRC-16 | TCP/IP |
| Masters | One master per bus | Multiple clients |
| Default port | Serial COM port | TCP 502 |
RTU almost always runs on RS-485, a two-wire (plus common) differential bus that lets many devices share one pair of wires over long distances. Terminate both ends with 120 Ω resistors and keep a consistent A/B polarity. TCP runs on ordinary Ethernet cabling to a switch - simpler to wire, but each device needs an IP address.
ModbusBB speaks Modbus TCP, RTU and ASCII, so you can connect to either kind of device from one tool - and even run its built-in simulator to mimic a device while you test. Download the free trial to try it.
Next: how 32-bit values span two registers and why byte order matters.