TCP Server Mode for NPort
Moxa Technical Support Teamsupport@moxa.com

Contents
1What is TCP Server Mode? ......................................................................................... 2

2Configuring the NPort DE-211, NPort DE-311, and NPort DE-311M for TCP ServerMode ......................................................................................................................... 3

3Configuring the NPort 5000, NPort W2150, and NPort W2250 for TCP Server Mode . 4

4Configuring the NPort 6000, NPort 2150 Plus/A/-W4 and NPort 2250 Plus/A/-W4for TCP Server Mode .................................................................................................. 5

5Testing TCP Server Mode for the NPort ..................................................................... 6

6Cable Wiring .............................................................................................................. 6Copyright © 2023 Moxa Inc.

Released on Jun 2, 2023

About Moxa
Moxa is a leading provider of edge connectivity, industrial computing, and network infrastructure
solutions for enabling connectivity for the Industrial Internet of Things. With 35 years of industry
experience, Moxa has connected more than 82 million devices worldwide and has a distribution andservice network that reaches customers in more than 80 countries. Moxa delivers lasting businessvalue by empowering industry with reliable networks and sincere service for industrialcommunications infrastructures. Information about Moxa’s solutions is available at www.moxa.com.
How to Contact Moxa
Tel:
Fax:

1-714-528-6777
1-714-528-6778

Moxa Tech Note

TCP Server Mode for NPort

This Tech Note applies to the following NPort device server models:

1•

NPort DE-211•

NPort DE-311•

NPort DE-311M•

NPort 5100 Series•

NPort 5200 Series•

NPort 5400 Series•

NPort 5600 Series•

NPort IA5150•

NPort IA5250•

NPort 6000 Series•

NPort W2150•

NPort 2150 Plus/A/-W4•

NPort 2250•

NPort 2250 Plus/A/-W4•

NPort W2150A-W4/W2250A-W4 Series

What is TCP Server Mode?
In TCP Server mode, the serial port on the NPort is assigned a port number which must
not conflict with any other serial port on the NPort. The host computer initiates contact
with the NPort, establishes the connection, and receives data from the serial device.
Depending on the specific NPort model, TCP Server mode can support either 1, 4, or 8
simultaneous connections, enabling multiple hosts to collect data from the same serial
device at the same time. The entire system should connect like this:Copyright © 2023 Moxa Inc.

Page 2 of 6Moxa Tech Note

2TCP Server Mode for NPort

Configuring the NPort DE-211, NPort DE-311,and NPort DE-311M for TCP Server Mode
Before performing the following steps, restore the NPort's default settings by holding
down the reset button for 10 seconds.
1. Turn the NPort on. The Ready LED should turn green.
2. Make sure that DIP switch 1 is set to OFF (DE-211 and DE-311).
3. Modify the DIP switch settings for serial communication as required for your device.
4. Make sure that the NPort and the host PC are properly connected to the network.
5. Adjust the NPort's IP settings as necessary so that it is in the same network as yourPC. You may also need to modify the host PC's IP configuration. Make sure you canping the NPort from your host PC.
Remember, the IP addresses of the NPort and the PC must be on the same subnet. If
one IP address is modified, you may need to modify the other IP address.
6. On the host PC, connect to the NPort's Telnet console by entering telnet <NPort's IPaddress> at the command prompt. For example, if your NPort's IP address is192.168.127.254, enter telnet 192.168.127.254 at the command prompt.
7. In the Telnet console under [OP_mode], set Application to TCP Server. Under Moresettings, enter the TCP client's IP address and listening port. If no IP address isentered for Destination IP addr., data will be accepted from any TCP clientprogram.
8. In the main menu under [Serialport], adjust the communication parameters asnecessary for your serial device, such as 115200, N, 8, 1.
9. In the main menu, select [Restart] to restart the NPort with the new settings
activated.

Copyright © 2023 Moxa Inc.

Page 3 of 6Moxa Tech Note3

TCP Server Mode for NPort

Configuring the NPort 5000, NPort W2150, andNPort W2250 for TCP Server Mode
Before performing the following steps, restore the NPort's default settings by holding
down the reset button for 10 seconds.
1. Turn the NPort on. The Ready LED should turn green.
2. Make sure that the NPort and the host PC are properly connected to the network.
3. Adjust the NPort's IP settings as necessary so that it is in the same network as yourPC. You may also need to modify the host PC's IP configuration. Make sure you canping the NPort from your host PC.
Remember, the IP addresses of the NPort and the PC must be on the same subnet. If
one IP address is modified, you may need to modify the other IP address.
4. On the host PC, connect to the NPort's Telnet console by entering telnet <NPort's IP
address> at the command prompt. For example, if your NPort's IP address is192.168.127.254, enter telnet 192.168.127.254 at the command prompt.
5. In the Telnet console under (4) Operating Settings, select the serial port you wishto configure.
6. Select (1) Operating mode and (2) TCP Server Mode.
7. Select (a) to assign a local TCP listening port (4001 by default) and (b) to assign acommand port (966 by default).
8. In the main menu under (3) Serial settings, select the serial port you wish toconfigure. Adjust the communication parameters as necessary for your serial device,
such as 115200, N, 8, 1.
9. In the main menu, select (s) Save/Restart to restart the NPort with the newsettings activated.

Copyright © 2023 Moxa Inc.

Page 4 of 6

Moxa Tech Note

4TCP Server Mode for NPort

Configuring the NPort 6000, NPort 2150
Plus/A/-W4 and NPort 2250 Plus/A/-W4 for
TCP Server Mode
Before performing the following steps, restore the NPort's default settings by holding
down the reset button for 10 seconds.
Also, please note that for NPort Wireless Plus models, only one network interface (WLANor Ethernet) can be active at a time. To use the Ethernet interface, make sure thenetwork cable is plugged in before powering on the NPort. To use the WLAN interface,make sure the network cable is unplugged when the NPort is powered on.
1. Turn the NPort on. The Ready LED should turn green.
2. Make sure that the NPort and the host PC are properly connected to the network.
3. Adjust the NPort's IP settings as necessary so that it is in the same network as yourPC. You may also need to modify the host PC's IP configuration. Make sure you canping the NPort from your host PC.
Remember, the IP addresses of the NPort and the PC must be on the same subnet. If
one IP address is modified, you may need to modify the other IP address.
4. On the host PC, connect to the NPort's Telnet console by entering telnet <NPort's IPaddress> at the command prompt. For example, if your NPort's IP address is
192.168.127.254, enter telnet 192.168.127.254 at the command prompt.
5. In the Telnet console under [Port], select [Modes] and then select the serial port
you wish to configure. Under Application, select Socket and under Mode select TCP
Server.
6. Under Description/more settings, enter the TCP server listening port. (4001 bydefault) and command port (966 by default). For NPort 6000 servers, up to 8 TCP
clients can connect.
7. In the main menu, select [Port] and then [Line]. Adjust the communication
parameters as necessary for your serial device, such as 115200, N, 8, 1.
8. In the main menu, select [Restart] to restart the NPort with the new settings
activated.

Copyright © 2023 Moxa Inc.

Page 5 of 6

Moxa Tech Note5

TCP Server Mode for NPort

Testing TCP Server Mode for the NPort

1. Run a TCP client program on your PC.
2. Open a Telnet console to the NPort and configure the serial parameters as needed foryour device.
a. For the NPort DE-211, DE-311, or DE-311M, select [Serialport].
b. For the NPort 5000, select (3) Serial settings.
c.

For the NPort 6000, NPort 2150 Plus/A/-W4 and NPort 2250 Plus/A/-W4, select[Port] and then [Line].

d. For the NPort W2150 or NPort W2250, select (3) Serial Port Settings and then(2) Communication Parameters.
3. Send data from the serial device. The TCP client program should receive the data.

6

Cable Wiring

Copyright © 2023 Moxa Inc.

Page 6 of 6