If several Modbus RTU devices are connected to different serial ports of a gateway, what should the TCP connection architecture be? Is it possible use a single connection or is a separate connection for each serial port required?

Most gateways provide flexible TCP connection settings to access several Modbus RTU devices connected to different serial ports of a gateway.

There are three different methods based on the routing mechanism:

  1. Connecting a serial port to a unique TCP port
  2. Connecting a serial port to a unique IP address
  3. Using a routing table

Most gateways provide flexible TCP connection settings to access several Modbus RTU devices connected to different serial ports of a gateway.

There are three different methods based on the routing mechanism:

  1. Connecting a serial port to a unique TCP port
  2. Connecting a serial port to a unique IP address
  3. Using a routing table

Connecting a serial port to a unique TCP port

It is the most popular method of planning a gateway topology. In the gateway configuration, each serial port will be connected to a separate TCP port. For example, 4001 is serial port 1, 4002 is serial port 2, and so on. If you want to connect Modbus RTU devices to serial port 1, then establish a Modbus TCP connection with 4001. The gateway will send Modbus TCP packets between TCP port 4001 and serial port 1.

In this topology, the SCADA driver must create several Modbus TCP connections.

Connecting a serial port to a unique IP address

This option is very similar to option 1, but the gateway uses different IP addresses to identify serial ports.

For example, 192.168.2.1 - to serial port 1, 192.168.2.2 - to serial port 2, and so on. If you want to connect Modbus RTU devices to serial port 1, then establish a Modbus TCP connection with 502. The gateway will send Modbus TCP packets between 192.168.2.1:502 and serial port 1. In this topology, the SCADA driver must also create several Modbus TCP connections. Although the topology requires several IP addresses, some Modbus TCP clients allow using TCP port 502 only. In this case, option 1 doest not suit you, and you will have to use option 2.

Using a routing table

In this topology, the routing is used for communication with several devices. For a request to be sent to the correct serial port, it is required to configure the gateway and routing direction correctly. For instance, serial port 1 processes all Modbus packages that have slave devices’ IDs from 1 to 10, serial port 2 processes all Modbus packages that have slave devices’ Ids from 11 to 20, and so on.

As only one connection is used in the topology, communication will be slower than options 1 and 2. However, with budgetary and technical limitations, a single connection may be an appropriate alternative if sufficient performance is provided.

Note:

If you connect several devices to a single serial port or bind multiple serial ports to a single TCP connection, the Modbus polling time will increase. In order to increase the polling rate, more TCP connections are required, so you need to consider the capabilities of SCADA.

We use cookies to enhance your browsing experience, serve personalized ads or content, and analyze our traffic. By clicking "Accept All", you consent to our use of cookies. Cookie Policy.