What is Modbus RTU and Modbus TCP?
Modbus is an open, royalty-free request/response protocol published by Modicon (now Schneider Electric) in 1979 for its PLCs. Modbus RTU carries messages as compact binary frames over an RS-485 or RS-232 serial line; Modbus TCP carries the same data model over Ethernet and TCP/IP.
How does Modbus work?
A client (formerly called master) sends a request and the addressed server (slave) answers; servers never talk on their own. Data lives in four tables: coils (read/write bits), discrete inputs (read-only bits), input registers (read-only 16-bit) and holding registers (read/write 16-bit). The most used function codes are 01 (read coils), 02 (read discrete inputs), 03 (read holding registers), 04 (read input registers), 05/06 (write single coil/register) and 15/16 (write multiple coils/registers).
Example: the same request in RTU and TCP
Reading 2 holding registers starting at address 0 from device 1:
| Field | Modbus RTU | Modbus TCP |
|---|---|---|
| Header | — | 00 01 00 00 00 06 (transaction ID, protocol ID = 0, length) |
| Address / Unit ID | 01 | 01 |
| Function code | 03 | 03 |
| Start address | 00 00 | 00 00 |
| Quantity | 00 02 | 00 02 |
| Error check | CRC-16: C4 0B | None (handled by TCP) |
In RTU the CRC is sent low byte first, and frames must be separated by at least 3.5 character times of silence. In TCP the 7-byte MBAP header replaces the CRC and the standard port is 502.
RTU vs TCP
| Feature | Modbus RTU | Modbus TCP |
|---|---|---|
| Physical layer | RS-485 (mostly), RS-232 | Ethernet |
| Typical speed | 9600 – 115200 bit/s | 10/100 Mbit/s |
| Distance | ~1200 m on RS-485 at low baud rates | 100 m per copper segment |
| Device count | Addresses 1–247; typically 32 unit loads without repeaters | Limited by the IP network |
| Topology | Daisy-chain bus, 120 Ω termination at both ends | Star, via switches |
Common mistakes
- Off-by-one addressing: register "40001" in a manual is address 0 on the wire. A shifted read returns wrong but plausible values.
- Serial settings mismatch: baud, parity and stop bits (e.g. 9600 8N1 / 19200 8E1) must match on every device.
- Termination and topology: star wiring on RS-485, missing terminators or no common reference (GND) cause intermittent CRC errors.
- 32-bit values: floats and 32-bit integers span two registers and the word order differs between vendors.
- Timeouts: very short timeouts combined with aggressive polling lose responses from slower devices.
Where is it used in industry?
Sensors, transmitters, drives, energy meters and remote I/O usually speak Modbus RTU, while PLCs, HMIs and SCADA systems commonly use Modbus TCP. Gateways bridge the two.
Amazeng GDT Series Digital Transmitters support both Modbus RTU and Modbus TCP, and the Conio digital I/O module is controlled via Modbus RTU over RS-485. For practical steps see our Modbus protocol integration post, and for the cloud side see MQTT.
Related Terms
- What is a PLC (Programmable Logic Controller)?What is a PLC? The scan cycle, IEC 61131-3 languages, a response time calculation, 32-bit Modbus word order pitfalls and sensor integration.
- What is a Digital Transmitter and Why Use It?What is a digital transmitter? Why digitising a sensor signal at the source beats an analog 4-20mA line on resolution, noise and calibration.
- What is MQTT Protocol?How MQTT works: broker, publish/subscribe, topic structure and wildcards, QoS 0/1/2, retained messages, Last Will and common industrial IoT mistakes.
- What is Profinet?What Profinet is: IO Controller and IO Device roles, RT and IRT communication, the GSDML file, differences from Profibus and common commissioning mistakes.
- What is 4-20mA Current Loop?How a 4-20mA current loop works: scaling formula, loop resistance budget, live-zero fault detection and how it compares with 0-10V signals.