Understand the difference between Modbus TCP and Modbus RTU: transport layer, speed, wiring, addressing, use cases, and when each protocol is the right choice.
ModbusSimulator supports both TCP and RTU — free 30-day trial
Modbus is a serial communication protocol developed in 1979. Over the decades it has evolved into two primary variants used in industrial automation today:
The application layer — register model, function codes, data types — is identical between both variants. What differs is the transport layer, wiring, addressing, and performance characteristics.
| Parameter | Modbus TCP | Modbus RTU |
|---|---|---|
| Transport | TCP/IP over Ethernet | Serial (RS-485, RS-232, RS-422) |
| Standard port | 502 (configurable) | Physical COM port (e.g., COM1, /dev/ttyS0) |
| Typical speed | 100 Mbps / 1 Gbps (Ethernet) | 9600 – 115200 bps (configurable) |
| Round-trip latency (10 registers) | <5 ms (LAN) | ~60 ms at 9600 bps · ~5 ms at 115200 bps |
| Max cable distance | 100 m (Cat5e/Cat6); unlimited with switches | RS-485: 1,200 m at 9600 bps · shorter at higher baud |
| Max devices per bus | Unlimited (each has own IP) | 247 slave IDs; typically 30–50 practical |
| Multiple masters | ✅ Yes (multiple TCP clients) | ❌ No (single master only) |
| Error detection | TCP checksum (no CRC in payload) | CRC-16 on every message |
| Framing overhead | 6-byte MBAP header + PDU | Address (1B) + PDU + CRC (2B) |
| Device addressing | IP address + Unit ID (usually 255 or 0) | Unit ID 1–247 on shared bus |
| Wiring required | Standard Ethernet (Cat5e/Cat6, fiber, Wi-Fi) | RS-485 twisted pair (120 Ω); termination resistors |
| Typical applications | Modern PLCs, SCADA via Ethernet, cloud-connected devices | Legacy sensors, meters, drives; long-distance field wiring |
| Noise immunity | Good (standard Ethernet shielding) | Excellent (RS-485 differential signaling) |
| Connection type | Persistent TCP connection (or new per request) | Point-to-point or multi-drop bus |
| Testing without hardware | ModbusSimulator TCP Simulator | ModbusSimulator RTU Slave |
Choose Modbus TCP when:
Modbus TCP Device ID (Unit ID) is usually set to 1 for direct device connections or 255 for broadcast when no specific ID is required. When connecting through a serial gateway, the Unit ID routes to the specific RTU device on the serial bus.
Choose Modbus RTU when:
Many installations mix both protocols. A common scenario: field devices (sensors, meters, drives) are wired via RS-485 RTU, while the SCADA system communicates over Ethernet TCP. A Modbus RTU-to-TCP gateway bridges these two worlds:
The Unit ID in the TCP request identifies which RTU slave on the serial bus should respond. This is why TCP Unit IDs matter even when using an Ethernet gateway.
ModbusSimulator handles both protocols in a single application:
Run ModbusSimulator's slave mode as a TCP server on 127.0.0.1:502. Your SCADA, HMI, or master application connects to this address and reads/writes registers as if talking to a real PLC. Set any register values, inject exception responses, configure response delays — all without physical hardware.
For RTU testing without serial hardware, install com0com (free virtual COM port driver for Windows). This creates a virtual COM port pair — e.g., COM10 and COM11. Run ModbusSimulator's slave on COM10 and your master application on COM11. The pair behaves like a real RS-485 loop.
To test the full RTU-to-TCP conversion stack, run ModbusSimulator's RTU slave on COM10, connect a virtual gateway on COM11, and have your SCADA connect via TCP. This simulates the exact production setup without any hardware.
| Frame Element | Modbus TCP | Modbus RTU |
|---|---|---|
| Transaction ID | 2 bytes (echo by slave) | Not present |
| Protocol ID | 2 bytes (always 0x0000) | Not present |
| Length field | 2 bytes | Not present (implied by baud timing) |
| Unit ID | 1 byte | 1 byte (slave address) |
| Function Code | 1 byte | 1 byte |
| Data | N bytes | N bytes |
| Error check | None (TCP handles it) | CRC-16 (2 bytes) |
| Total overhead | 7 bytes header | 3 bytes (addr + CRC) |
The function codes and register data are identical between TCP and RTU — only the framing differs. This is why converting between the two is straightforward and why a single tool like ModbusSimulator can handle both.
Modbus TCP runs over Ethernet (TCP/IP, port 502) with a 6-byte MBAP header and no CRC. Modbus RTU runs over serial connections (RS-485/RS-232) with CRC-16 error checking. Both use the same register model and function codes — the difference is purely in the transport layer.
Modbus TCP is significantly faster for most applications. Ethernet runs at 100 Mbps+, giving round-trip times under 5 ms on a LAN. Modbus RTU at 9600 bps takes ~60 ms to read 10 registers; at 115200 bps, about 5 ms. For high-speed polling or many devices, TCP is the better choice.
Not directly — they use different transports. A Modbus RTU-to-TCP gateway converts between the two. The SCADA system connects to the gateway via TCP; the gateway polls RTU devices over RS-485 and returns responses via TCP. The Unit ID in the TCP request identifies which RTU slave to query.
Use ModbusSimulator's slave mode to run a Modbus TCP server on your PC at 127.0.0.1:502. Configure register values to simulate a real PLC, then connect your SCADA or master application to it. Full 30-day free trial available at /download.
Install com0com (free virtual COM port driver for Windows) to create a virtual COM port pair. Run ModbusSimulator's RTU slave on COM10 and your master on COM11. Both communicate over a virtual serial link — no physical RS-485 adapter required.
Yes. ModbusSimulator supports Modbus TCP, RTU, ASCII, and UDP in both master and slave modes — all in a single $59 license. Run a TCP slave and an RTU slave simultaneously on the same PC for complex testing scenarios.
ModbusSimulator supports both protocols — 30-day free trial on Windows 10/11
No credit card · No registration · Windows 10/11 64-bit