Protocol MODBUS-RTU2TCP
Caution
- This Router App is not compatible with the v4 platform.
Router App Description
The Router App enables conversion of Modbus RTU messages received via a serial line into Modbus TCP messages, which are then sent via TCP to a specified Modbus server. This is useful for applications where a computer collects data from devices such as boilers. Data in Modbus RTU format is sent to the Advantech router via RS-485, converted to Modbus TCP format, and forwarded via the Internet to the Modbus server and then to SCADA.

With the Router App enabled, the router acts as an RS-485 Modbus slave ā all data must be sent to the router by a computer or cascade display.
The Router App can store received data on a USB flash drive if a TCP network connection (Internet) is not available at the time. Data is resent in the correct order once the connection is re-established.
MODBUS RTU and MODBUS TCP Protocol
Conversion between MODBUS RTU and MODBUS TCP protocols is provided by the Router App. The MODBUS RTU protocol runs on a serial line using the RS-232 or RS-485/422 expansion port.
Both protocols share a common part ā the Protocol Data Unit (PDU). They differ in the Application Data Unit (ADU). A PDU received on the serial line has the destination unit address as a header and a checksum at the end.

When sending a MODBUS ADU over TCP/IP, an MBAP header is used for identification. TCP port 502 is reserved for MODBUS TCP ADU.

Configuration
The Router App web interface is accessible by clicking the Router App name on the Router Apps page of the router's web interface. The menu on the left contains two items: Config opens the configuration page, and Return goes back to the router's web interface.

| Item | Description |
|---|---|
| Enable | Enables conversion of MODBUS RTU protocol to MODBUS TCP/IP protocol. |
| Expansion port | Port on which the MODBUS RTU connection is established: ⢠PORT1 ā MODBUS RTU connection on PORT 1. ⢠PORT2 ā MODBUS RTU connection on PORT 2. See the General page or the Expansion Port 1 / Expansion Port 2 pages in the router interface for the position of the serial interface. |
| Baudrate | Serial interface communication speed. Range: 300 to 115200. |
| Data Bits | Number of data bits in serial communication: 7 or 8. |
| Parity | Control parity bit in serial communication: ⢠none ā No parity. ⢠even ā Even parity. ⢠odd ā Odd parity. |
| Stop Bits | Number of stop bits in serial communication: 1 or 2. |
| Split Timeout | Time interval used to delimit a message. If the gap between two received characters exceeds this value (in milliseconds), a message is assembled from all received data and sent. |
| Server Address | IP address of the TCP server to which data is forwarded. |
| TCP Port | TCP port of the server. Port 502 is set by default for MODBUS ADU. |
| Reply Timeout | Time interval in which a response is expected. If no response is received, one of the following error codes is sent: ⢠0A ā Transmission path unavailable: the gateway cannot allocate an internal path from the input to the output port (likely overloaded or misconfigured). ⢠0B ā Target device not responding: the device may be unavailable. |
| Enable Cache on USB memory stick | Enables storing messages that could not be delivered to the TCP side. Each Modbus message is saved as a separate file. Up to 65,536 messages can be stored. The router app periodically attempts to resend the oldest message; if successful, subsequent messages are resent in order. |
Configuration form items
Click Apply to apply all configuration changes.