Skip to main content
INDUSTRIAL PROTOCOLS · GATEWAYS

What Is a Modbus Gateway?

A Modbus gateway converts between Modbus RTU or ASCII on a serial line, usually RS-485, and Modbus TCP on Ethernet. It lets a SCADA system, PLC or edge computer on the network read and write serial meters, drives and controllers as if they were Modbus TCP devices, using the address byte in each request to reach the right device.

01

How a Modbus gateway works

A Modbus gateway is a protocol converter between the serial and Ethernet versions of Modbus. Energy meters, drives, temperature controllers and older PLCs often speak Modbus RTU over RS-485, while SCADA software, newer PLCs and edge computers expect Modbus TCP. The gateway sits between the two, usually on a DIN rail in the panel.

When a Modbus TCP client sends a request, the gateway removes the TCP header, reads the target address, rebuilds the message as an RTU frame with its CRC checksum and sends it down the serial line. When the device replies, the gateway checks the CRC, wraps the answer back into a TCP response and returns it to the client. The function codes and register addresses stay the same in both directions; only the framing changes.

Modbus now calls the requesting side the client and the responding side the server, replacing the older master and slave terms. Gateway settings often still use the old names.

02

Addressing serial devices through a gateway

Every Modbus TCP message includes a one-byte device identifier, often labelled UID or slave ID, in its MBAP header. A device with its own Ethernet port usually ignores it, but a gateway uses it to pick the serial device: UID 5 goes to the device set to address 5 on the RS-485 bus. Serial addresses run from 1 to 247, with 0 reserved for broadcast writes, so one gateway IP address can stand for a whole bus of devices.

Address range is not the only limit. A standard RS-485 segment supports 32 standard loads, so larger buses need low-load transceivers or repeaters. And because RS-485 is half duplex, the gateway can send only one request at a time, so every device on the bus shares the same polling time.

03

Gateway operating modes

Most gateways support more than one way of working, and choosing the right one solves most commissioning problems.

  • //
    TCP client to serial server. The usual case: SCADA or an edge computer on Ethernet polls serial meters and controllers through the gateway.
  • //
    Serial client to TCP servers. An existing serial master, such as an old PLC or RTU, keeps polling while the devices behind the gateway move to Modbus TCP.
  • //
    Cached or agent mode. The gateway polls the serial devices itself and stores the values, then answers TCP requests from memory. Responses are faster, and several clients can read the same bus without queuing.
  • //
    Transparent mode. The gateway passes Modbus RTU frames inside TCP without converting them. The client must then speak RTU over TCP, which is not the same as Modbus TCP.
04

Modbus gateway vs serial device server vs gateway computer

Three kinds of hardware can bring serial Modbus devices onto a network. They differ in how much of the protocol they understand and what else they can do.

Feature Dedicated Modbus gateway Serial device server Gateway computer
What it converts Modbus RTU or ASCII to Modbus TCP, and back Raw serial bytes to a TCP or UDP stream Any protocol its software supports
Understands Modbus Yes, rebuilds each frame No, passes bytes through Yes, in software
Client on the network sees Standard Modbus TCP on port 502 Modbus RTU frames inside TCP, or a virtual COM port Modbus TCP, OPC UA, MQTT or a database
Other protocols Fixed by model, such as EtherNet/IP or BACnet None Several at once
Local logic and storage Limited caching None Scripts, buffering, a historian, containers
Set-up Web page or utility Web page plus a driver on the host Operating system and gateway software

A dedicated gateway suits a single, fixed conversion in a panel. A computer suits sites that also need to publish data upstream, for example as MQTT or OPC UA, which our OPC UA vs MQTT guide covers. Our industrial IoT gateways are computers of that kind, most with RS-485 COM ports beside Ethernet and cellular options, and several of our DIN rail PCs are specified for protocol gateway software, with COM ports, wide DC inputs and fanless cooling for the cabinet.

FAQ · 01
What is the difference between Modbus RTU and Modbus TCP?
Modbus RTU sends compact binary frames with a CRC checksum over a serial line, usually RS-485, with one client polling up to 247 devices. Modbus TCP carries the same function codes and registers over Ethernet on port 502, drops the CRC because TCP checks the data, and adds a header with a transaction ID and a device identifier.
Read the full FAQ —
05

Setting up a Modbus gateway

Most problems on a new gateway come from a handful of settings.

  • //
    Match the serial frame. Baud rate, parity and stop bits must match every device on the bus. Modbus RTU defaults to 19200 baud with even parity, but many devices ship at 9600.
  • //
    Set the timeouts in order. The client’s TCP timeout must be longer than the gateway’s serial response timeout multiplied by its retries, or the client gives up before the gateway does.
  • //
    Map device addresses deliberately. Decide whether the gateway passes each UID straight through or translates them, especially where two buses use the same addresses.
  • //
    Limit the clients. Several SCADA servers polling one slow bus will queue behind each other, so use cached mode or one aggregating client.
06

Quick answers on Modbus gateways

Modbus gateways: common questions

Is Modbus TCP the same as Ethernet?

No. Ethernet is the physical network. Modbus TCP is an application protocol that runs over TCP/IP on Ethernet, on port 502, alongside any other traffic on the same network.

Is RS-485 the same as Modbus?

No. RS-485 is the electrical interface, a differential pair that can be shared by many devices. Modbus RTU is a protocol that commonly runs over it; RS-485 also carries BACnet MS/TP, PROFIBUS DP and DNP3.

Can a Modbus gateway connect to EtherNet/IP or BACnet?

Some can. Multi-protocol gateways map Modbus registers to EtherNet/IP tags or BACnet objects, and these are usually sold as protocol gateways. A gateway computer can do the same in software.

How do I send Modbus data to MQTT?

Poll, then publish. A gateway or edge computer polls the Modbus registers, adds names and scaling, and publishes the values to an MQTT broker, often only when they change. That needs software on the gateway rather than a simple RTU-to-TCP converter.

How many devices can one Modbus gateway handle?

Up to 247 addresses per serial port. In practice an RS-485 segment carries about 32 standard loads, and polling time grows with every device, so large sites split devices across several ports or gateways.

We supply industrial IoT gateways and DIN rail PCs with the operating system, COM port modes and your gateway software installed and configured as standard. Send us your device list, serial settings and the systems that need the data, and we will specify the hardware to match.