USR IOT USR-N520 User manual

1 / 69
User Manual
File Version: V1.0.4

2 / 69
Contents
1. Quick Start.......................................................................................................................................................................4
1.1. Hardware Testing Environment........................................................................................................................ 4
1.2. Network Test Environment................................................................................................................................ 4
1.3. Default Parameter ............................................................................................................................................ 5
1.4. Data Transmission Test..................................................................................................................................... 5
2. Overview..........................................................................................................................................................................7
2.1. Brief Introduction.................................................................................................................................................7
2.2. Features............................................................................................................................................................... 7
2.3. Basic Parameter................................................................................................................................................. 8
2.4. Dimension............................................................................................................................................................ 8
2.5. Indicators and Dial switch................................................................................................................................. 9
2.6. DB9 Pin Definition............................................................................................................................................ 11
3. Product Function..........................................................................................................................................................12
3.1. Socket A Communication................................................................................................................................ 12
3.1.1. TCP Client Model.................................................................................................................................. 12
4.1.1 TCP Client Mode.................................................................................................................................... 12
3.1.2. TCP Server Mode................................................................................................................................. 15
3.1.3. UDP Client Mode.................................................................................................................................. 16
3.1.4. UDP Server Mode.................................................................................................................................18
3.1.5. TCP and UDP Comparison................................................................................................................. 19
3.1.6. HTTPD Client.........................................................................................................................................19
3.2. Socket B Communication................................................................................................................................21
3.3. USR-VCOM Application.................................................................................................................................. 23
3.4. Modbus Gateway..............................................................................................................................................24
3.4.1. Transmit modbus protocol in transparent mode.............................................................................. 24
3.4.2. Modbus RTU to Modbus TCP.............................................................................................................24
3.4.3. Modbus Active Query Function...........................................................................................................26
3.4.4. Modbus Polling Function..................................................................................................................... 29
3.5. Value-added Functions....................................................................................................................................32
3.5.1. DHCP...................................................................................................................................................... 32
3.5.2. DNS......................................................................................................................................................... 32
3.5.3. Self-Defined Heartbeat Function........................................................................................................32
3.5.4. Self-Defined Registration Package Function................................................................................... 34
3.5.5. Web to serial.......................................................................................................................................... 36
3.5.6. Customized Webpage..........................................................................................................................39
3.5.7. Network Printing Function................................................................................................................... 39
3.5.8. Serial Port Packaging Mechanism.....................................................................................................41
3.5.9. Flow Calculation....................................................................................................................................42
3.5.10. Synchronous baud rate (RFC2217)................................................................................................ 42
3.5.11. KeepAlive............................................................................................................................................. 44
3.5.12. Device ID..............................................................................................................................................44

3 / 69
3.5.13. Webpage Port......................................................................................................................................44
3.5.14. Revise MAC.........................................................................................................................................44
3.5.15. Firmware Upgrade..............................................................................................................................44
3.5.16. Hardware Flow Control RTS/CTS & XON/XoFF........................................................................... 44
3.5.17. Reload.................................................................................................................................................. 44
4. Setting Protocol............................................................................................................................................................45
4.1. Network Setting Protocol.................................................................................................................................45
4.1.1. Set Parameter Process........................................................................................................................45
4.1.2. Setting Command Content..................................................................................................................45
4.1.3. Commands’ Return Content................................................................................................................49
4.2. Serial Setting Protocol..................................................................................................................................... 50
4.2.1. AT Command......................................................................................................................................... 50
4.2.2. Enter AT Command Mode................................................................................................................... 52
4.2.3. AT Command details............................................................................................................................ 52
5. Parameter Configuration............................................................................................................................................ 56
5.1 Software Configuration..................................................................................................................................... 56
5.2 Webpage Configuration....................................................................................................................................63
5.3 Serial Configuration...........................................................................................................................................68
6. Contact ..................................................................................................................................................................... 69

4 / 69
1. Quick Start
Double serial port server USR-N520 is used to realize data transparent transmission between TCP/UDP
data package and RS232/RS485/RS422 interface. Three in one serial port communicating code, support
common RS232/RS485/RS422 serial interfaces.
Any question during testing, please submit it on our technical support center: http://h.usriot.com
1.1. Hardware Testing Environment
Connect the COM port of USR-N520 with PC’s via serial cable(or USB to serial cable).
Connect network interface between USR-N520 and PC via RJ45 cable.
Then supply power for USR-N520 with our AC adapter
The below picture will show you the connection.
Hardware Connection
Notes:
AC adapter and connection cable are provided by USR IOT.
RS232 is involved, no connection for RS485.
PCs in above picture is the same one.
1.2. Network Test Environment
Please check PC setting after hardware connection.
1) Disable PC Firewall and anti-virus software.
2) Disable the network card nothing to do with testing and just leave one local connection.
3) As for USR-N520 connect with PC directly, should set static IP for PC, which in the same network

5 / 69
segment with USR-N520, like 192.168.0.201.
PC Local Connection Configuration
1.3. Default Parameter
Default parameter is as below:
User name
admin
Password
admin
IP address
192.168.0.7
Subnet mask
255.255.255.0
Default gateway
192.168.0.1
Default work dode of port 1
TCP Server
Default local port of port 1
23
Default work mode of port 2
TCP Server
Default local port of port 2
26
Baud Rate
115200
Parity bit/Data bit/Stop bit
None/8/1
1.4. Data Transmission Test
Data transmission test is based on the default parameters, please refer to the following steps:
1) Open test software “USR-TCP232-Test.exe”, and do hardware connection according to Chapter 1.1

6 / 69
Hardware Testing Environment.
2) The right side is Network Settings: TCP Client, IP address: 192.168.0.7, port number: 23, click
“Connect” to build TCP connection.
The left side is Serial Settings: Baud Rate: 115200, Parity/Data bit/Stop bit: None/8/1,
Click “Open” to enable the COM.
Then we can test data transmission between COM and network.
Data from serial to network is: PC’ COM->USR-N520’ COM->USR-N520 Ethernet port->PC Network;
Data from network to serial is: PC Network->N520’ Ethernet port->N520 COM-> PC’s COM.
The below picture is for your reference:
Default Parameter Test

7 / 69
2. Overview
2.1. Brief Introduction
USR-N520 is used to transmit data transparently between TCP/UDP data packet and RS232/RS485/RS422
interface. It carries ARM processor, low power, fast speed, high stability and two serial port can work as
RS232 or RS485 or RS422 serial interface which comfort to industrial standard.
2.2. Features
1. ARM base on Cortex-M4 kernel, and reliable TCP/IP protocol stack
2. Industrial working temperature range from -40C ~85C
3. Auto-MDI/MDIX,RJ45 port with 10/100Mbps
4. Support TCP server, TCP client, UDP, UDP server and HTTPD client work mode
5. One port corresponding to two socket
6. Support network printing via IP address
7. Function of Modbus gateway, modbus RTU to modbus TCP, modbus multi-host Polling
8. Two serial port, each port can work as RS232 or RS485 or RS422 and work individually
9. Distinguish which serial port connect to device via port number
10. Support virtual serial port and provide corresponding software USR-VCOM
11. Serial baud rate from 600bps to 230.4K bps; Check bit of None,Odd,Even,Mark and Space
12. Support static IP, DHCP/DNS and search devices within network through UDP broadcast.
13. Provide serial and network setting protocol, TCP/IP socket example code such as VB, C++
Delphi,Android,IOS
14. Built-in web page; Customized web page is acceptable
15. Reload button,one key to restore default settings
16. RJ45 with Link/Data indicator light,built-in isolation transformer and 2 KV electromagnetic isolation
17. The global unique MAC address bought from IEEE, also user can define MAC address
18. Upgrade firmware via network
19. Support web port revise (80 by default)
20. Keepalive, detect dead links and reconnect rapidly
21. Support account and password, used to page log in and network settings safely
22. Support one channel Web socket,realize bidirectional transparent transmission between web page

8 / 69
and serial side
23. Power supply in two mode, DC adapter or 5.08-2 terminal pin
24. Communication indicator light of two serial port: RX/TX
25. UPD broadcast function, can receive/send data to all IP in the same network
2.3. Basic Parameter
Parameter
Value
Input Voltage
DC5~36V
Working Current
90mA@5V
Operating Temp.
-40~+85°C
Power
<1W
Storage Temp.
-45~105°C, 5~95%RH
2.4. Dimension

9 / 69
2.5. Indicators and Dial switch
<Indicator light>
Indicator
Description
①Power
Indicate power. It is on when power is supplied
②Work
Indicate working status. It twinkles when N520 works
well. If it is on or off for a period, N520 works
improperly, you should cut the power and restart.
③TX1
It twinkles when port 1 sends data

10 / 69
④RX1
It twinkles when port 1 receive data
⑤TX2
It twinkles when port 2 sends data
⑥RX2
It twinkles when port 2 receive data
<Dial Switch>
For RS232 port, dial switch are down, such as the below picture.
For RS485 port, dial switch are up, such as the below picture.
For RS422 port, dial switch on the left are up, dial switch on the light are down,
Table of contents
Other USR IOT Server manuals
























