Modbus Multi-Station RTU to TCP Converter
Review the following information for setting up and configuring the Modbus Multi-Station RTU to TCP Converter driver.
Overview
The Litmus Edge Modbus Multi-Station RTU to TCP Converter driver:
- Opens a Modbus TCP server
- Listens for requests from clients
- Translates those requests into RTU requests on a multi-drop RS485 network
- Repackages the RTU replies as TCP replies.
Use this driver instead of the Modbus RTU Advanced driver when you want to reuse identical tag names across different station IDs. To do so, create multiple instances of the Modbus TCP driver and add tags to those driver instances. You cannot directly add tags to this driver.
Litmus Edge Compatible Series
Compatibility parameter | Compatible items |
|---|---|
Driver type | RTU client and TCP server |
Validated devices/series | Modbus RTU Stations Litmus Edge Modbus TCP driver |
Replaces Gen 1 driver(s) | N/A |
To set up and configure this device in Litmus Edge, you will need to do the following:
- Step 1: Set up and Configure the PLC Device
- Step 2: Set up the PLC Device in Litmus Edge DeviceHub
- Step 3: Set up Modbus TCP devices in Litmus Edge DeviceHub
Step 1: Set up and Configure the PLC Device
- Document the Modbus RTU station addresses for each connected device on the RS485 multi-drop network.
- Ensure your Modbus RTU stations and the Litmus Edge gateway's serial or USB port are properly connected to the serial network.
- Verify the serial communication parameters (baud rate, parity, stop bits) configured on the converter match your RTU devices.
- Note the TCP port number configured on the converter (typically 502 for Modbus TCP or a custom port). Open the port for communication on the System > Network > Firewall > Inbound Rules page.
Step 2: Set up the PLC Device in Litmus Edge DeviceHub
Configure the following parameters when you Connect a device with this driver. Update default values to the specific setup of your device.
Parameter | Value |
|---|---|
Type | Modbus |
Driver | Modbus Multi-Station RTU to TCP Converter |
Network Interface | 0.0.0.0 (or the IP Address to bind the TCP server to) |
Port | 502 (or custom port to bind the TCP server to) |
Max TCP Connections | 32 |
Device File | /dev/ttyS0 |
Baud Rate | 9600 |
Data Bits | 8 |
Parity | None |
Stop Bits | 1 |
Response Timeout | 1000 (ms) |
Retry Count | 2 |
Pause Between Requests | 10 (ms) |
Important: The converter processes requests from all stations and all TCP client connections one at a time because only one request can be on the RS485 network at a time. New requests never preempt an in-flight request: each request runs to completion, including all retries, before the next request starts. A station that does not respond therefore blocks all other stations for the full retry duration on every poll.
Tune Response Timeout and Retry Count based on your RTU network conditions:
- Increase the timeout when devices respond slowly, such as PLCs with long scan cycles or devices behind radio modems or serial gateways.
- Increase the retry count when the RS485 network experiences electrical noise that causes transient read failures. Retries let the converter recover from corrupted frames without returning an error to the client.
- Decrease the timeout or retry count when stations commonly go offline in your RTU network and you do not want large polling gaps for the stations that remain online. Each poll of an offline station occupies the serial network for the full retry sequence delaying all other stations. Do not reduce the timeout below 1000 ms or the retry count below 1.
Calculate and record the value from this formula: Number of Stations × ([Response Timeout × (Retry Count + 1)] + [Retry Count × Pause Between Requests])
Step 3: Set up Modbus TCP devices in Litmus Edge DeviceHub
See the Modbus TCP page. In the Modbus TCP driver settings, use the following values:
- Network address: Enter 127.0.0.1
- Response timeout: Enter a value greater than or equal to the timeout calculated with the formula in Step 2. Clients with shorter timeouts abandon requests that the converter still processes and the repeated resends compound the delay for all stations.
If a station is offline, remove it from polling until it is restored.