Quick start
1. Demo products
Solidot Modbus TCP Coupler XB6S-MT2002 + serial Communication module XB6S-C01SP
2. Application scenario
Transparent Transmission of data from RS232/RS422 serial devices to a Modbus TCP network via Free port input/output mode
3. Configuration result
The data sent and received by the serial device is mapped directly to Modbus TCP registers and can be read and written by the host computer
In industrial environments, the following requirement comes up frequently: you have an RS232 or RS422 serial device (such as a barcode scanner, sensor or meter) and want to connect its data to a Modbus TCP network so that the host computer system can read and write it directly. The Solidot serial Communication module XB6S-C01SP offers a variety of communication modes, effectively building a Transparent Transmission bridge between the serial port ↔ Modbus TCP.
This document uses the combination of the Modbus TCP Coupler XB6S-MT2002 + serial Communication module XB6S-C01SP as an example to demonstrate the complete workflow of Free port input/output mode, from configuration to verification.

1. Hardware preparation and wiring
Before starting configuration, first make sure the hardware is connected correctly.
hardware used in this example:
● XB6S-MT2002 (with web configuration interface)
● XB6S-C01SP (mounted under the Coupler)
● USB-to-RS232 serial cable (for simulating a serial device)
● One computer (connected to the Coupler via Ethernet cable)
wiring method:
Connect the computer to the Coupler's Ethernet port via an Ethernet cable, and connect the USB-to-RS232 serial cable to the serial port terminals of the XB6S-C01SP.
The specific wiring is shown in the figure below:

2. Accessing the Coupler web configuration interface
XB6S-MT2002 supports direct parameter configuration via a browser, with no additional software required.
After connecting the computer to the Coupler via an Ethernet cable, open a browser and enter the Coupler's default IP address in the address bar: 192.168.1.120, to access the web configuration interface.

note:
Make sure the computer's IP address is in the same network segment as the Coupler (192.168.1.x); otherwise, the configuration page cannot be accessed.
3. Configuring XB6S-C01SP Free port mode
This is the core step of this document. The reason for each parameter setting is explained one by one below.
1. Accessing the module parameters page
In the web configuration interface, click the XB6S-C01SP module to access its parameter configuration page. The parameters for this example are shown below:

Important:
Set the Communication error Behavior to "Hold". This step must be performed first.
In Free port mode, if the configured Byte Count to read does not match the Byte Count actually received, the module reports a communication error. If the error behavior is set to the default "Clear", the data is immediately flushed when the error occurs, so the data is lost before you can read it. When set to "Hold", the last valid data remains in the register even if an error occurs, and is not cleared.
2. Configuring the control Node code
Under Node 1 → parameter 1, set the control Node code to 0 x 21.
This value means: select the Free port input/output mode with control word. "With control word" means the host computer can use the control word to trigger data transmission and reception, rather than the module deciding on its own. 0 x 21 is the fixed code for this mode; simply enter it directly.

3. Configuring the input and output bytes
Configure the number of input bytes in Node 2 → parameter 1, and the number of output bytes in Node 3 → parameter 1. The number of input and output bytes depends on the actual data volume of your serial device. This example uses 16 bytes each for input and output.

Here, "input" and "output" are described from the perspective of the Coupler:
● input = data sent from the serial device to the Coupler (Upstream, received by the Coupler)
● output = data sent from the Coupler to the serial device (Downstream, sent by the Coupler)
4. Submitting and downloading
After the device parameters are configured, click Submit and download; the Coupler saves and applies the new configuration:

IV. Data address mapping and read/write
After configuration is complete, you need to know the address of the data in Modbus TCP in order to read and write it correctly.
Viewing the data address
On the configuration information page of the Coupler web interface, you can view the data start address of the XB6S-C01SP module:

Upstream and Downstream data structure
In Free port input/output mode, the data is divided into two parts, Upstream and Downstream —
Upstream data (serial port → Modbus TCP): data sent from the serial device is mapped to the Modbus TCP input registers; the host computer obtains the serial data by reading these registers. The data structure is as follows:

Downstream data (Modbus TCP → serial port): the host computer writes to the Modbus TCP Holding registers, and the data is sent to the serial device via the serial port. The data structure is as follows:

V. Test and verification
Use Modbus Poll + a serial port tool to simulate the complete transmit/receive link and confirm whether the configuration takes effect.
Test tools
● Modbus Poll software: acts as the Modbus TCP master to read and write the Coupler registers
● serial debugging tool: simulates the serial device sending and receiving data via a USB-to-RS232 serial cable
Modbus Poll read/write configuration
In Modbus Poll, set up a read connection and a write connection separately, pointing to the coupler IP address and the corresponding register address:
Read settings

Write settings

Trigger mode: level trigger
In this example, the control mode is set to level trigger, which means that after the control word is enabled, the module continuously sends and receives serial data. If your application requires on-demand triggering (for example, sending only one frame each time), you can select rising edge trigger mode.

Verifying the results
Send data in the serial tool, and you can see the corresponding register values update in the Modbus Poll read window; conversely, write data in Modbus Poll, and the serial tool receives the corresponding content. Bidirectional transparent transmission verification passed.
6. Additional Notes and FAQs
About communication error behavior: In Free port input/output mode, it is strongly recommended to set it to "Hold". If it is set to "Clear", then when the serial data frame length is not fixed, an exception is almost certain to be triggered, causing data loss.
About Byte Count configuration: The number of input and output bytes should be greater than or equal to the maximum length of a single frame of data from your actual serial device. If configured too small, data will be truncated; if configured too large, functionality is not affected, but more register space is occupied.
About trigger mode selection:
● level trigger: After the control word is set to 1, sending and receiving continue, suitable for scenarios requiring real-time transparent transmission (such as continuous reporting by sensors)
● Rising Edge Trigger: A frame is sent each time the control word goes from 0 to 1, suitable for on-demand sending scenarios (such as issuing commands to a device)
Free port input/output mode vs Modbus RTU mode: If your serial device itself supports the Modbus RTU protocol, it is recommended to use the module's Modbus RTU gateway mode first, as configuration is simpler. Free port input/output mode is suitable for serial devices using non-standard or custom protocols.