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,

11 / 69
2.6. DB9 Pin Definition
For RS232 port, pin definition is as below
For RS485 port, pin 3 works as “B(-)”, Pin 7 works as “A+”
For RS422 port
Pin
Definition
2
RX, pin of receives data
3
TX
5
GND
7
RTS
8
CTS
Pin
Definition
2
RX+, pin of receives data
3
RX-
5
GND
7
TX+
8
TX-

12 / 69
3. Product Function
The following is function diagram of USR-N520
USR-N520 Function Diagram
Each serial port corresponds to two socket: socket A and socket B. Socket B can be opened or closed.
3.1. Socket A Communication
3.1.1. TCP Client Model
4.1.1 TCP Client Mode
1) Different from UDP mode, in this mode, connection has status of disconnection and remaining.

13 / 69
Connection is still remained although USR-N520 does not send data.
2) Identify disconnects. After connection built, it sends keepalive searching packet every 15 seconds.
Once there is an interrupt, it can be detected rapidly then make USR-N520 disconnect from former
connection and reconnect.
3) It will connect to same source port when USR-N520 try to connect server and local port is not “0”.
4) It supports USR Synchronous baud rate (Similar RCF2217), which can revise USR-N520’s serial
parameter as baud rate accordingly. This function should be combined with USR-VCOM.
5) Under the same LAN, USR-N520 must be in the same network segment then can communicate. If
not, USR-N520 must be set with right one.
6) Support USR Cloud.
7) Support Modbus TCP function.
8) USR-N520 work as TCP Client, it connects to TCP server, Destination IP and port should be cared.
The IP can be device with same LAN, also can be different LAN or cross public network. If it
connects to server cross public network, the server should have public IP.
9) USR-N520 work under TCP Client, It connects to the target IP/Port automatically,will not accept
other connection request.
10) As TCP Client, need to set USR-N510’s local port number to be “0 then it can visit server with
randomized port number, so that it can solve unsuccessful re-connection in case server judge
connection status abnormally and shield USR-N520 re-connection request.
11) Test Example
1Open “USR-TCP232-M4_E45 setup” software.
Set USR-N520 as TCP Client, Destination IP: 192.168.0.95. Destination port:20108.
Click “Save COM1”, and search USR-N520.
Then check if the parameters are correct when USR-N520 is found.
Configuration

14 / 69
2Open “USR-TCP232-TEST” software:
Need to connect to PC’s TCP Server, its IP: 192.168.0.95, Port number: 20108, Click “Listening”
TCP Client Test Screen shot
3USR-TCP232-TEST software:
Configure serial parameter. Click to open the port. Test software network part shows connection
message:192.168.0.7:49153(port# assigned randomly). Click “send”, you can gain data from each
side.

15 / 69
TCP Client Software Configuration
3.1.2. TCP Server Mode
1) Different from UDP, in this mode, connection has status of disconnection and remaining. Connection
is still remained although USR-N520 does not send data.
2) USR-N520 listens to local port set firstly, respond and build connection when there is a connection
request. Serial port will send data to all client which connected with USR-N520 at the same time
once serial port received data.
3) It supports USR Synchronous baud rate (Similar RCF2217), which can revise USR-N520 serial
parameter as baud rate accordingly. This function should be combined with USR-VCOM.
4) It support 8 clients connections at max. (32 clients will be improved in the following.)
5) Support Modbus TCP function.
6) Under TCP Server mode, USR-N520 listens to local port actively and will not monitor connected IP
and port. When the 9th client is connected, the oldest one will be ticked.
7) Test Example
1Set USR-N520 as TCP Server Mode, local port 23, same as default.
2Open ”USR-TCP232-TEST” Software, on the side of NetSettings:
Protocol: TCP Client
Server IP/Port: the same value as the default parameter of N520
3Click ”Connect” to test data transmission.

16 / 69
TCP Server Test Screenshot
3.1.3. UDP Client Mode
1) It subjects to UDP protocol, no connection, just only sending data.
2) USR-N520 only communicate with destination port of IP. Otherwise, the data cannot be received.
3) Under this mode, destination Address is 255.255.255.255, then it can make UDP broadcast and
receive broadcast data. Broadcast within segment as 192.168.0.255, it can be sent but cannot be
received currently.
4) Under UDP Client/ UDP Server mode, host PC allow data length 1460 bytes at max to USR-N520.
5) Test Example:
1Open USR-TCP232-M4, E45 Setup Software: build a UDP firstly. PC’s IP is 192.168.0.95. Port
to be listened is 20108.
2Open USR-TCP232-TEST Software: set USR-N520 as UDP Client, destination port: 20108.
3Click “Send” at serial side. Remote IP and port becomes USR-N520’s after receiving the data.
Then click “Send” in network part and send data to COM.

17 / 69
UDP Client Software Configuration
UDP Client Testing Screenshot

18 / 69
3.1.4. UDP Server Mode
1) Base on normal UDP, it doesn't verify source IP address. Every time USR-N520 receive one UDP
data packet, it changes destination IP to where data comes and it sends the data to the IP and port
which communicate latest.
2) Test Example:
1Open “USR-TCP232-M4_ E45 Setup” Software: Set USR-N520 as UDP Server, local port: 23.
2Open “USR-TCP232-TEST” Software twice. Set work mode as UDP, remote IP and port same with
USR-N520’.
Click “Send” then the COM receive data.
Click “Send” at serial side, only the software communicate latest can receive the data.
UDP Server Test Screenshot

19 / 69
UDP Server Test Screenshot
3.1.5. TCP and UDP Comparison
TCP
UDP
Advantages
Stable, no loss
Reliable connection mechanism
Resend after data sending fails
No Connection mechanism, simple, flexible
Suit for small packet and high frequency
Accurate data sending interval
Disadvantages
Long packet starting
Jam for small packet and high frequency
Inaccurate interval resulted from check
and resend mechanism
More less under bad network environment
3.1.6. HTTPD Client
It is used to transmit data from USR-N520 to HTTP server or gain data from HTTP server.
USR-N520 can handle complex HTTP protocol so user just do programming for serial, and not need to worry
about HTTP.
When USR-N520 sends data to HTTP server via serial port, it only needs to send the header of requested
data; All the returned data will be transmitted by USR-N520, user need to analyze the packets.

20 / 69
Test Example:
1) Entry http://192.168.0.7 (N520’s IP) to open its web page
1. SetUSR-N520 as HTTPD Client.
2. Set HTTPD packet Header.
HTTPD Client Web page Configuration Screen shot
<Note>:
HTTPD Client only support GET to request HTTPD Server. POST will be available in the following.
GET/ is fixed packet header.
1.php?data= is the visited/submitted the page
$ stands for data sent by serial (Serial port does not need to send “$”)
HTTP/1.1 is requested protocol.
Host is means requested IP address/ domain.
Enter twice
Table of contents
Other USR IOT Server manuals
Popular Server manuals by other brands

Multitech
Multitech FaxFinder FF240-IP Administrator's guide

Planet
Planet ICS-2100T Quick installation guide

Blackbe;rry
Blackbe;rry ENTERPRISE SERVER FOR IBM LOTUS DOMINO - - TECHNICAL NOTE FOR JAPANESE... manual

IPEX
IPEX PH232E-1 Series user manual

HIK VISION
HIK VISION iVMS-Blazer Pro/256/16H user manual

3One data
3One data NP3 T Series Quick installation manual