Usconverters USC520 User manual

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 1 / 52 Copyrights © U.S. Converters
User Manual for
USC520:
Serial Ethernet Converter (RS232, RS485, RS422)
Industrial Panel Mount, 2 Ports File Version: V1.0.4
USC540:
Serial Ethernet Converter (RS232, RS485, RS422)
Industrial Panel Mount, 4 Ports

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 2 / 52 Copyrights © U.S. Converters
Contents
2. Overview.........................................................................................................................................................4
2.1. Brief Introduction..................................................................................................................................5
2.2. Features...............................................................................................................................................5
2.3. Basic Parameter...................................................................................................................................6
2.4. Dimension............................................................................................................................................6
2.5. Indicators and DIP switches.................................................................................................................7
2.6. DB9 Pin Definition................................................................................................................................9
3. Product Function..........................................................................................................................................10
3.1. Socket A Communication...................................................................................................................11
3.1.1. TCP Client Model.....................................................................................................................11
4.1.1 TCP Client Mode.......................................................................................................................11
3.1.2. TCP Server Mode....................................................................................................................12
3.1.3. UDP Client Mode.....................................................................................................................12
3.1.4. UDP Server Mode....................................................................................................................12
3.1.5. TCP and UDP Comparison......................................................................................................13
3.1.6. HTTPD Client...........................................................................................................................13
3.2. Socket B Communication...................................................................................................................14
3.4. Modbus Gateway...............................................................................................................................16
3.4.1. Transmit modbus protocol in transparent mode......................................................................16
3.4.2. Modbus RTU to Modbus TCP..................................................................................................17
3.4.3. ModbusActive Query Function................................................................................................18
3.4.4. Modbus Polling Function.........................................................................................................20
3.5. Extra functions ...................................................................................................................................23
3.5.1. DHCP.......................................................................................................................................23
3.5.2. DNS .........................................................................................................................................23
3.5.3. Self-Defined Heartbeat Function.............................................................................................24
3.5.4. Self-Defined Registration Package Function ..........................................................................25
3.5.5. Web to serial............................................................................................................................27
3.5.7. Network Printing Function .......................................................................................................28
3.5.8. Serial Port Packaging Mechanism ..........................................................................................30
3.5.9. Flow Calculation ......................................................................................................................30
3.5.10. Synchronous baud rate (RFC2217) ......................................................................................31
3.5.11. KeepAlive...............................................................................................................................32
3.5.12. Device ID ...............................................................................................................................32
3.5.13. Webpage Port........................................................................................................................32
3.5.14. Revise MAC...........................................................................................................................32
3.5.15. Firmware Upgrade.................................................................................................................33
3.5.16. Hardware Flow Control RTS/CTS & XON/XoFF...................................................................33

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 3 / 52 Copyrights © U.S. Converters
3.5.17. Reset......................................................................................................................................33
4. Setting Protocol............................................................................................................................................33
4.1. Network Setting Protocol ...................................................................................................................33
4.1.1. Set Parameter Process ...........................................................................................................33
4.1.2. Setting Command Content......................................................................................................34
4.1.3. Commands’ Return Content....................................................................................................38
4.2. Serial Setting Protocol .......................................................................................................................39
4.2.1. AT Command...........................................................................................................................39
4.2.2. Enter AT Command Mode .......................................................................................................41
4.2.3. AT Command details ...............................................................................................................41
5. Parameter Configuration..............................................................................................................................45
5.1 Software Configuration .......................................................................................................................45

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 4 / 52 Copyrights © U.S. Converters
1.1. Default Parameters
User name admin
Password admin
IP address 192.168.0.7
Mask 255.255.255.0
Gateway 192.168.0.1
Work Mode of Port 1 TCP Server
Local Port of Port 1 23
Work Mode of port 2 TCP Server
Local port of port 2 26
Baud Rate 115200
Parity bit/Data bit/Stop bit None/8/1

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 5 / 52 Copyrights © U.S. Converters
2. Overview
2.1. Brief Introduction
USC520/USC540 is used to transmit data transparently between TCP/UDP data packets and a
RS232/RS485/RS422 interface. It has an ARM processor, low power, fast speed, high stability and two/four
serial ports which can work as RS232, RS485 or RS422 serial interface which compiles 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

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 6 / 52 Copyrights © U.S. Converters
22. Support one channel Web socket, realize bidirectional transparent transmission between web page
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 Parameters
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. Dimensions

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 7 / 52 Copyrights © U.S. Converters
2.5. Indicators and DIP switches
Indicator Description
①Power Indicate power. On when power is supplied
②Work Indicate working status. It blinks when N520/N540
works well. If it is on or off for a period, N520/N540
works improperly, you should power cycle to restart.
③TX1 Blinks when port 1 sends data
④RX1 Blinks when port 1 receive data
⑤TX2 Blinks when port 2 sends data
⑥RX2 Blinks when port 2 receive data

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 8 / 52 Copyrights © U.S. Converters
For RS232 port, DIP switches are down, such as the below picture.
For RS485 port, DIP switches are up, such as the below picture.
For RS422 port, DIP switches on the left are up, DIP switch on the light are down,

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 9 / 52 Copyrights © U.S. Converters
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-

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 10 / 52 Copyrights © U.S.
Converters
3. Product Function
The following is function diagram of USC520/USC540
USC520/USC540 Function Diagram
Each serial port corresponds to two sockets: socket A and socket B. Socket B can be enabled or disabled.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 11 / 52 Copyrights © U.S.
Converters
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 ‘disconnected’ and active.
Connection is still active although USC520/USC540 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 USC520/USC540 disconnect from
former connection and reconnect.
3) It will connect to same source port when USC520/USC540 try to connect server and local port is not
“0”.
4) It supports Synchronous baud rate (Similar RCF2217), which can revise USC520/USC540’s serial
parameter as baud rate accordingly. This function should be combined with USR-VCOM.
5) Under the same LAN, USC520/USC540 must be in the same network segment then can
communicate. If not, USC520/USC540 must be set with right one.
6) Support USR Cloud.
7) Support Modbus TCP function.
8) USC520/USC540 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) USC520/USC540 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 USC520/USC540 re-connection request.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 12 / 52 Copyrights © U.S.
Converters
3.1.2. TCP Server Mode
1) Different from UDP, in this mode, connection has status of disconnected and active. Connection is
still active although USC520/USC540 does not send data.
2) USC520/USC540 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 USC520/USC540 at
the same time once serial port received data.
3) It supports USR Synchronous baud rate (Similar RCF2217), which can revise USC520/USC540
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, USC520/USC540 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.
3.1.3. UDP Client Mode
1) It subjects to UDP protocol, no connection, just only sending data.
2) USC520/USC540 only communicates 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
USC520/USC540.
3.1.4. UDP Server Mode
1) Based on normal UDP, it doesn't verify source IP address. Every time USC520/USC540 receives
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.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 13 / 52 Copyrights © U.S.
Converters
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 USC520/USC540 to HTTP server or gain data from HTTP server.
USC520/USC540 can handle complex HTTP protocol so user just do programming for serial, and not need to
worry about HTTP.
When USC520/USC540 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 USC520/USC540, user need to analyze the
packets.
Test Example:
1) Entry http://192.168.0.7 (N520’s IP) to open its web page
1. SetUSC520/USC540 as HTTPD Client.
2. Set HTTPD packet Header.
<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
2) Save the parameters and restart USC520/USC540.
3) Open serial port to send data, then the data can be submitted onto our web page server.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 14 / 52 Copyrights © U.S.
Converters
HTTPD Client Test Screenshot
3.2. Socket B Communication
USC520/USC540 support double socket communication mode, socket A and socket B. One serial port
corresponding to two socket communication mode can be realized through setting the parameter of socket B.
But socket B is only used for transparent transmission and only worked as TCP client or UDP client.
Set USC520/USC540 as double socket communication mode, the data of serial port will be transparently
transmitted to socket A and socket B at one time. When data comes from socket A and socket B
simultaneously, USC520/USC540 will transmit the data of socket A to serial port firstly, and then transmit the
data of socket B once the data of socketA finished.
Communication example:
1. Set the parameter of socket A and socket B by web page
2. Set up socketA and socket B by “USR-TCP232-Test.exe”, and open serial port which connects to server.
3. Click “Send” on the software, data will be transmitted from socketA and socket B to serial port.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 15 / 52 Copyrights © U.S.
Converters

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 16 / 52 Copyrights © U.S.
Converters
3.3. Modbus Gateway
3.3.1. Transmit modbus protocol in transparent mode
USC520/USC540 supports the transmission of modbus protocol in transparent mode
3.3.2. Modbus RTU to Modbus TCP
USC520/USC540 support Modbus RTU to Modbus TCP, settings as below:
1. Open USR-TCP232-M4,E45 Setup Software, set USC520/USC540 as TCP server or TCP client.
2. Select “ModbusTCP” on the red color
3. Click to save the parameter
Modbus TCP Configuration

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 17 / 52 Copyrights © U.S.
Converters
4. Check and verify Modbus RTU to Modbus TCP through modbus Poll and Modbus Slave
5. Setting modbus software is as below:
6. Click OK once configuration finished, update the data of modbus slave and modbus data will also be
updated.

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 18 / 52 Copyrights © U.S.
Converters
3.3.3. Modbus Active Query Function
Modbus active query function can be realized through the serial heartbeat packet function of
USC520/USC540.
1. Open serial heartbeat packet function via web page, query command is heartbeat packet data, example:
2. Set modbus slave software, refer to the following:

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 19 / 52 Copyrights © U.S.
Converters
3. Return result for query command is as drawing:

USC520 / USC540 User Manual www.usconverters.com
U.S. Converters LLC 20 / 52 Copyrights © U.S.
Converters
3.3.4. Modbus Polling Function
USC520/USC540 support modbus polling function under TCP server mode. Set USC520/USC540 as
Modbus Poll, support multiple host polling to check parameter.
1. Multiple host polling is realized through virtual com.
①Set parameter of USC520/USC540 via web page, make sure to select ModbusTCP Poll and set
overtime
②Open virtual com software to setup serval ports and connects to USC520/USC540
This manual suits for next models
4
Table of contents
Other Usconverters Media Converter manuals