TCP Server Mode
The parameter values for setting TW100 to TCP Server Mode are as follows:
- Operation Mode: Server Mode
- Communication Parameter
- Local Port: 5000
With these settings, TW100 opens a TCP Server Socket with the local port number and waits for a connection from a TCP Client.
An example of a setting screen using the configuration tool is as follows.
This is the setup screen for sending data assigned to UART Channel 1 through TCP/IP. When the Operation mode is set to “Server mode”, it is configured as a TCP Server mode and waits for a TCP connection.
Once the TCP connection is established, the data coming in from UART Channel 1 is transmitted through the TCP/IP network via this connection. Conversely, data incoming from the TCP connection is transmitted to UART Channel 1.
Let’s check the actual operation now. We’ll use the Hercules TCP/IP communication test tool mentioned earlier.
First, run Hercules and attempt a TCP connection. Use the values set above.
Hercules TCP Client setting
- First, run Hercules and try to establish a TCP connection. Use the values set earlier.
- Select the TCP Client tab, enter the TCP Server address and port information,
- And press the Connect button to complete.
Now you can verify that the data sent will be received by TW100xx UART Channel 1. The reverse case also works well.
It is recommended to apply the same process to UART Channel 2, 3, and 4 for testing.
It’s possible to assign the same port number, but this makes it difficult to determine which UART Channel is connected to the TCP Client. Therefore, it is recommended to give each a different server port number.