Modbus TCP: The Industrial Ethernet Protocol
Modbus TCP/IP is the Ethernet version of the Modbus protocol, standardized in 1999. It retains the master/slave model and the register structure (Holding, Input, Coil, Discrete Input) of Modbus RTU, but transmits them over TCP/IP port 502. As a result, Modbus TCP integrates seamlessly into enterprise IT networks while remaining compatible with the existing Modbus ecosystem.
Its advantages over Modbus RTU:
- Speed: 100 Mbit/s vs. 115 kbps max for RS-485
- Open topology: no limit of 32 nodes on a linear bus
- Multi-master: multiple clients can query the same slave
- Distance: standard Ethernet up to 100 m, fiber for long distances
Modbus TCP to Cloud Connection Architecture
The gateway acts as a Modbus TCP client (master) for local devices and as an MQTT client for the cloud. It sits between the OT network and the cloud network.
| Layer | Equipment / Protocol |
|---|---|
| Field (devices) | Controllers, drives, meters with Ethernet ports |
| Industrial LAN | Ethernet switch, OT VLAN |
| Gateway | Eziwan Gateway (Modbus TCP client + MQTT client) |
| Cloud Transport | MQTT over TLS 1.3 / 4G LTE or Ethernet WAN |
| Cloud | AWS IoT Core, Azure IoT Hub, Eziwan Cloud |
| Application | Dashboard, alerts, REST API, reporting |
Reading Modbus TCP Registers: Supported Data Types
The gateway queries all types of Modbus TCP registers defined by the standard:
16-bit Registers:
- Holding Registers (FC03) — read/write, process values (setpoints, parameters)
- Input Registers (FC04) — read-only, real-time measurements (current, voltage, flow rate)
Discrete Bits:
- Coils (FC01/FC05) — read/write, logic outputs (relays, controls)
- Discrete Inputs (FC02) — read-only, logic inputs (statuses, faults)
Encoded data types:
- INT16, UINT16 (1 register)
- INT32, UINT32, FLOAT32 IEEE 754 (2 registers, Big Endian or Little Endian)
- INT64, DOUBLE (4 registers)
- ASCII STRING
Sending MQTT Messages to AWS IoT, Azure IoT Hub, or Eziwan
Once the logs have been read, the gateway publishes the metrics to the target MQTT broker. The three major platforms are supported:
AWS IoT Core
- Connection via MQTT over TLS on port 8883
- Authentication using an AWS X.509 certificate
- IoT rules to DynamoDB, S3, Lambda, or QuickSight
Azure IoT Hub
- Connection via AMQP or MQTT TLS
- Device Twin for remote configuration
- Stream Analytics for real-time processing
Eziwan Cloud
- Zero-touch setup, no infrastructure to manage
- Preconfigured dashboard with industrial units
- SMS/email alerts in less than 30 seconds
Polling and Optimization of the Sampling Rate
The choice of polling frequency affects both data freshness and mobile data usage.
| Measurement Type | Recommended Frequency |
|---|---|
| Electrical quantities (P, Q, I, U) | 1 to 10 s |
| Process temperatures | 30 s to 5 min |
| Levels, flow rates | 1 to 5 min |
| Discrete states (alarms) | 1 to 5 s |
| Meters (energy, volume) | 5 to 15 min |
The gateway can also be configured in on-change mode: a value is transmitted only if it changes by a configurable amount (deadband), which significantly reduces the volume of data.
Multi-site Monitoring: The Centralized Architecture
Across a network of several industrial sites, the same architecture is replicated:
- One gateway per site, each polling its local Modbus TCP devices
- All gateways publish to the same cloud-based MQTT broker (or to separate topics for each site)
- A single monitoring interface centralizes all sites
- Alerts are configured globally with site-specific escalation
This centralized architecture with local gateways is the standard for multi-site industrial remote monitoring.