Manual of TCP Server mode and TCP Client Mode

Overview

This manual is to introduce TCP Server mode and TCP Client mode.

 

1.Introduction

1.1.TCP Server mode

Module works in TCP Server mode will listen network connections and build network connections, commonly be used for communication with TCP clients on a LAN. According to the TCP protocol, TCP Server has connection/disconnection status differences to ensure reliable data transmission. TCP Server mode supports Keep-Alive function.

 

Module works in TCP Server mode will listen local port which user set and build connection after receiving connection request. Serial data will be sent to all TCP Client devices which connect to module simultaneously.

 

Data transmission diagram as follow:

 

TCP SERVER MODE

Figure 1 TCP Server mode

 

1.2.TCP Client mode

TCP Client provides Client connections for TCP network services. TCP Client device will connect to server to realize data transmission between the serial port device and server. According to the TCP protocol, TCP Client has connection/disconnection status differences to ensure reliable data transmission.TCP Client mode supports Keep-Alive function.

 

Module works in TCP Client mode needs connect to TCP Server and needs set the parameter: Remote IP/Port. module works in TCP Client won’t accept other connection request except target server and will access server with random local port if configuring local port to 0.

 

 

Data transmission diagram as follow:

 

TCP client mode

 

Figure 2 TCP Client mode

 

2.Configuration and test

We take USR-TCP232-410S as an example to configure and test. We configure 410S by Web Server and test data transmission by software USR-TCP232-Test.exe

52.png

Figure 3 USR-TCP232-Test

 

2.1.TCP Server mode

When user configures module to work in TCP Server mode, user needs to configure parameters as follows:

  • Work mode
  • Local port

 Configure 410S by Web Server as follow (410S connects to same router as PC which tests data transmission, and to communicate with PC, 410S’IP has been changed to 192.168.5.200 to in same network segment as PC):

 

 

TCP Server mode configuration

 

Figure 4 TCP Server mode configuration

 

 

Test data transmission by USR-TCP232-Test-V1.3.exe as follow:

 

TCP Server mode data transmission

Figure 5 TCP Server mode data transmission

 

2.2.TCP Client mode

When user configures module to work in TCP Client mode, user needs to configure parameters as follows:

  • Work mode
  • Remote IP
  • Remote port

 

 

Configure 410S by Web Server as follow:

 

 

TCP Client mode configuration

Figure 6 TCP Client mode configuration

 

Remote Server Addr is TCP Server address(Here is PC’s IP: 192.168.5.18).

 

 

Test data transmission by USR-TCP232-Test-V1.3.exe as follow:

 

TCP Client mode data transmission

Figure 7 TCP Client mode data transmission