How to Configure Modbus ASCII to Modbus ASCII over TCP on RobustOS Devices?

How to Configure Modbus ASCII to Modbus ASCII over TCP on RobustOS Devices?

Overview

When you have a Modbus ASCII slave device that needs to be accessed by a Modbus ASCII master over a TCP/IP network, you can use a Robustel gateway to act as a transparent bridge. The gateway will encapsulate the serial Modbus ASCII data into TCP packets, allowing the master to communicate with the slave device as if it were directly connected. This guide will walk you through setting up the Robustel gateway as a TCP server for transparent serial data transmission.

What You'll Need

Hardware List:

  • 1 x Robustel Gateway (e.g., R2011, R3000 Series) with a serial port (RS232 or RS485).
  • 1 x Modbus ASCII Slave Device (or a PC equipped with Modbus Slave software and a serial cable.)
  • 1 x PC for configuration and testing
  • 1 x Power Supply for the router
  • 1 x Ethernet Cable

Software/Firmware:

  • Modbus testing software (optional, for testing):
    • Modbus TCP Client (e.g., Modbus Poll)
    • Modbus ASCII Slave simulator (e.g., Modbus Slave) - This can be used for testing if you do not have a physical Modbus ASCII device available.

Prerequisites:

  • Ensure your PC is connected to the gateway's LAN port via an Ethernet cable.
  • Log in to the Router's web interface. The default IP address is typically http://192.168.0.1.

Step-by-Step Configuration Guide

Step1: Configure the Serial port type

If your Robustel OS device does not support this function, please skip this step.

  1. Navigate to Interface -> Serial Port.
  2. Click on the Port Type tab.
  3. Under the General Settings section, Select serial port type as needed.
  4. Click Submit
  5. click Save & Apply.

Step 2: Configure the Gateway's Serial Port

  1. Navigate to Interface -> Serial Port.
  2. Click on the Serial Port tab.
  3. In the Serial Port Settings table, identify the serial port you are using (e.g., COM1) and click the edit icon (✎) on the right.
  4. In the pop-up configuration window, first configure the Serial Port Application Settings.
    • Toggle Enable to ON.
    • Set the Baud Rate, Data Bits, Stop Bits, and Parity to match the exact settings of your connected Modbus ASCII slave device.
  1. Next, scroll down to the Server Setting section.
    • Set Application Mode to Transparent.
    • Set Protocol to TCP Server.
    • Leave the Local IP field blank. This allows the server to listen on all available gateway IP addresses (LAN and WAN).
    • Define a Local Port for the TCP connection. This is the port your Modbus master will connect to (e.g., 502, 10000).
  1. Click Submit to save the changes for the serial port.
  2. Finally, click Save & Apply at the top right of the main page to apply all pending changes.

Verification & Testing

After configuration, you need to test if the Modbus master can communicate with the slave device through the router.

  1. Setup the ASCII Slave: Connect your Modbus ASCII slave device to the router's configured serial port. If using simulation software like Modbus Slave on a PC, connect the PC's COM port to the router's serial port, use the software's default slave ID, function codes, and registers. (Note: The Baud Rate, Data Bits, Stop Bits, and Parity values here must be the same as those configured on the router.).

  1. Setup the TCP Client: Run Modbus Poll on a PC connected to the router's LAN or WAN.
    • Go to Connection -> Connect.
    • Connetion: Select Modbus RTU/ASCII Over TCP/IP.
    • Mode: Select ASCII
    • Enter the Router's IP Address, (e.g., its LAN IP 192.168.0.1 or its WAN IP). In the example, the IP address used is the IP from the WiFi connection.
    • Enter the Server Port you configured (e.g., 502).
    • Click OK.


  1. Check for Success: Once you connect, Modbus Poll should successfully read the register values from the Modbus Slave. Any data write from the master should also be reflected on the slave. This confirms that the router is correctly performing the transparent serial-to-TCP conversion.

Troubleshooting / FAQ

  • Q1: My Modbus master (client) cannot connect to the router.
    • A1:
    • Physical Connections: Double-check that your Ethernet and serial cables are securely connected.
    • IP Address and Port: Ensure you are using the correct IP address (router's LAN or WAN) and the exact port number you configured in the Server Setting.
    • Firewall: Check the router's firewall settings under Network > Firewall to ensure it's not blocking the port you configured. Also, check the firewall on your PC.
    • Network Status: If connecting via the WAN IP, go to Status > System Information on the router's web interface to confirm it has an active internet connection.
  • Q2: I can connect, but the master shows errors and cannot read/write data.
    • A2:
    • Serial Parameters: This issue is almost always caused by a mismatch in serial communication settings. Go back to Interface > Serial Port and verify that the Baud Rate, Data Bits, Parity, and Stop Bits are identical to the settings on your physical Modbus ASCII slave device.
    • Application Mode: Confirm that the Application Mode is set to Transparent. Any other mode (like Modbus Gateway) will interpret the data instead of passing it through, causing communication to fail.
  • Q3: Which IP address should I use in my Modbus master software?
    • A3: Because the Local IP was left blank during configuration, the TCP server on the router listens on all its active interfaces.
    • For a device on the same local network, use the router's LAN IP (e.g., 192.168.0.1).
    • For a remote device over the internet, use the router's WAN IP. You can find this IP address on the Status page. Note that for cellular connections, you may need a SIM card with a public IP address.

Revision History

Version

Date

Author

Changes

1.0

2025-09-27

Jens Zhou

Initial document creation.