Modbus RTU and TCP: Two Variants, One Protocol
Modbus comes in two physical variants:
Modbus RTU — a serial variant using RS-485 or RS-232. Compact protocol (no header), frames with CRC-16. The master polls the slaves one by one on the shared bus. Data rate: 9,600 to 115,200 bps. Widely used in industrial installations since the 1980s.
Modbus TCP — Modbus encapsulated in TCP/IP. Same registers, same functions (FC01 through FC23), but over Ethernet via TCP port 502. No CRC (TCP handles integrity), multiple simultaneous connections possible, no distance limit on an IP network.
The Modbus RTU/TCP gateway bridges the two: it exposes RTU devices as TCP servers, or converts TCP requests into RTU requests, depending on the configured direction.
Operating Modes of a Modbus Gateway
Mode 1 (RTU → TCP): The gateway acts as a Modbus TCP server. It receives requests from TCP masters (SCADA, cloud-based monitoring) and translates them into Modbus RTU requests to the RS-485 devices.
Mode 2 (TCP → RTU): The gateway acts as a Modbus RTU master. It receives process data from an Ethernet PLC (Modbus TCP) and transmits it in Modbus RTU format to RS-485 slaves.
Address and Register Mapping
The gateway handles the mapping between Modbus RTU addresses (slave address 1–247 + register address) and TCP addresses (IP address + port 502 + unit ID). Typical configuration:
| RS-485 Device | Modbus RTU Address | Modbus TCP Access |
|---|---|---|
| Energy Meter | Slave 1, reg 40001–40030 | IP 192.168.1.50:502, Unit ID 1 |
| Drive | Slave 2, reg 40001–40050 | IP 192.168.1.50:502, Unit ID 2 |
| Temperature Sensor | Slave 3, reg 30001–30010 | IP 192.168.1.50:502, Unit ID 3 |
Modbus Gateway + Cloud: A Winning Combination
A Modbus RTU/TCP gateway alone exposes devices on the local Ethernet network. To send data to the cloud, an additional step is required: either SCADA software that reads Modbus TCP and publishes data via MQTT, or an IoT gateway that does both (RTU/TCP conversion + cloud upload via 4G).
The Eziwan Gateway does it all: it queries Modbus RTU devices directly via its RS-485 port and Modbus TCP devices via Ethernet, and publishes the data to the Eziwan Cloud via MQTT and VPN.
For more information: Modbus Cloud, RS-485 Cloud Gateway, and Industrial MQTT.