Any question during testing, please submit it on our technical support center: http://h.usriot.com 1.1. Hardware Testing Environment Hardware Connection USR-N540 connects to PC by serial port and RJ45 Port. Then power on USR-N540 with our AC adapter.The below picture will show you the connection. Notes: ...
Default work mode of port 3 TCP Server Default local port of port 3 Default work mode of port4 TCP Server Default local port of port 4 Baud Rate 115200 Parity bit/Data bit/Stop bit None/8/1 Jinan USR IOT Technology Limited 5 / 73 inquiry@usriot.com...
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-N540’ COM->USR-N540 Ethernet port->PC Network; Data from network to serial is: PC Network->N540’ Ethernet port->N540 COM-> PC’s COM.
2. Overview 2.1. Brief Introduction USR-N540 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 four serial port can work as RS232 or RS485 or RS422 serial interface which comfort to industrial standard.
TCP Server connection At max connected 8 Net buffer Send:16Kbyte; receive:16Kbyte Serial port buffer Send: 2Kbyte; receive: 2Kbyte Average transport delay <10ms Set software USR-VCOM, USR-Cloud, parameters setting software others Certification CE,FCC, ROHS Jinan USR IOT Technology Limited 8 / 73 inquiry@usriot.com...
N540 setting serial port can using webpage or dial switch. When choosing the dial switch mode in webpage, the dial switch is on work; when setting serial port into customize mode, webpage is on work, the webpage is more priority than the dial switch. Jinan USR IOT Technology Limited 10 / 73 inquiry@usriot.com...
Page 11
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, Jinan USR IOT Technology Limited 11 / 73 inquiry@usriot.com...
For RS485 port, pin 3 works as “B(-)”, Pin 7 works as “A+” For RS422 port Definition RX+, pin of receives data 2.7. DB9 Pin-board We provide DB9 pin-board for user to use terminal connection. Jinan USR IOT Technology Limited 12 / 73 inquiry@usriot.com...
Each serial port corresponds to two socket: socket A and socket B. Socket B can be opened or closed. Notes: USR-N540 supports double sockets. It means one serial port corresponds to two sockets. Socket A: Supports TCP client, TCP server, UDP client, UDP server, Httpd client...
USR-N540 disconnect from former connection and reconnect. It will connect to same source port when USR-N540 try to connect server and local port is not “0”. It supports USR Synchronous baud rate (Similar RCF2217), which can revise USR-N540’s serial parameter as baud rate accordingly.
Page 15
USR-N540 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-N540’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-N540 re-connection request.
Page 16
TCP Client Test Screen shot ③ USR-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. Jinan USR IOT Technology Limited 16 / 73 inquiry@usriot.com...
USR-N540 does not send data. USR-N540 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-N540 at the same time once serial port received data.
It subjects to UDP protocol, no connection, just only sending data. USR-N540 only communicate with destination port of IP. Otherwise, the data cannot be received. Under this mode, destination Address is 255.255.255.255, then it can make UDP broadcast and receive broadcast data.
Page 19
20108. ② Open USR-TCP232-TEST Software: set USR-N540 as UDP Client, destination port: 20108. ③ Click “Send” at serial side. Remote IP and port becomes USR-N540’s after receiving the data. Then click “Send” in network part and send data to COM.
USR-N540 User Manual www.usriot.com 3.1.4. UDP Server Mode Jinan USR IOT Technology Limited 21 / 73 inquiry@usriot.com...
Page 22
USR-N540 User Manual www.usriot.com Base on normal UDP, it doesn't verify source IP address. Every time USR-N540 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.
Page 23
USR-N540 User Manual www.usriot.com P Server Test Screenshot UDP Server Test Screenshot Jinan USR IOT Technology Limited 23 / 73 inquiry@usriot.com...
USR-N540 can handle complex HTTP protocol so user just do programming for serial, and not need to worry about HTTP. When USR-N540 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-N540, user need to analyze the packets.
Page 25
Host is means requested IP address/ domain. Enter twice 2) Save the parameters and restart USR-N540. 3) Open serial port to send data, then the data can be submitted onto our webpage server. Jinan USR IOT Technology Limited 25 / 73...
Set USR-N540 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, USR-N540 will transmit the data of socket A to serial port firstly, and then transmit the data of socket B once the data of socket A finished.
Page 27
Set up socket A and socket B by “USR-TCP232-Test.exe”, and open serial port which connects to server. Click “Send” on the software, data will be transmitted from socket A and socket B to serial port. Jinan USR IOT Technology Limited 27 / 73...
It solve the transmission problem of traditional device PC software working as COM. USR-VCOM (Virtual com software) support receiving data from set COM and send serial data out as network. How to connect USR-N540 with Virtual COM: Set USR-N540 as TCP server Open USR-VCOM software, click “Add COM’...
Page 29
USR-N540 User Manual www.usriot.com Remote IP and port is the same one with USR-N540 Remarks: Can write the name of device Click “OK’ to check whether connection is built. “Connected” sow ready for data transmission. USR-VCOM Add a COM USR-VCOM Build Connection...
3.5.2. Modbus RTU to Modbus TCP USR-N540 support Modbus RTU to Modbus TCP, setting method as below: Open USR-TCP232-M4,E45 Setup Software, set USR-N540 as TCP server or TCP client. Select “ModbusTCP” on the red color Click to save the parameter Modbus TCP Configuration 4.
6. Click OK once configuration finished, update the data of modbus slave and modbus data will also be updated. 3.5.3. Modbus Active Query Function Modbus active query function can be realized through the serial heartbeat packet function of USR-N540. 1. Open serial heartbeat packet function via web page, query command is heartbeat packet data, example:...
Page 32
USR-N540 User Manual www.usriot.com 2. Set modbus slave software, refer to the following: Jinan USR IOT Technology Limited 32 / 73 inquiry@usriot.com...
Page 33
USR-N540 User Manual www.usriot.com 3. Return result for query command is as drawing: Jinan USR IOT Technology Limited 33 / 73 inquiry@usriot.com...
1. Multiple host polling is realized through virtual com. ① Set parameter of USR-N540 via web page, make sure to select Modbus TCP Poll and set time Jinan USR IOT Technology Limited 34 / 73...
Page 35
USR-N540 User Manual www.usriot.com ② Open virtual com software to setup serial ports and connects to USR-N540 Jinan USR IOT Technology Limited 35 / 73 inquiry@usriot.com...
Page 36
USR-N540 User Manual www.usriot.com ③ Open modbus slave software, choose the serial port which connected with USR-N540. Run modbus Poll software and make port-forwarding with this serial port. ④ The value of modbus poll will also be changed when you revise the value of modbus slave.
Page 37
USR-N540 User Manual www.usriot.com ② Open modbus slave software, choose the serial port which connected with USR-N540. Run modbus polling software to select network mode and connect with USR-N540. ③ The value of modbus poll will also be changed when you revise the value of modbus slave.
Page 38
If polling interval is too shot and baud rate is too low for the process of polling command which might lead to conflict between command circle and polling time. Jinan USR IOT Technology Limited 38 / 73...
Local port: The port of device, Remote port: Cloud software’s port Device ID: It is assigned to device by cloud software Communications Code: Pass word generated after adding the device to cloud software Jinan USR IOT Technology Limited 39 / 73 inquiry@usriot.com...
3.7. Value-added Functions 3.7.1. DHCP DHCP is obtaining IP address automatically. USR-N540 IP obtaining have 2 types: DHCP and static IP. It is static IP192.168.0.7 by default. DHCP is effective after change to DHCP and restart. When USR-N540 connects to router or device assigning IP, it require IP address from host within network, which takes about 5-15 seconds.Then you can search N540’s IP address.
Page 41
USR-N540 User Manual www.usriot.com Network heartbeat packet: It used for maintaining connection. Only valid at the mode of TCP client and UDP client. Beat time: Set the heartbeat packet time Jinan USR IOT Technology Limited 41 / 73 inquiry@usriot.com...
3.7.4. Registration Package Packet Function USR-N540 supports self-defined registration package function and also supports to send self-defined registration package after connection establishment, meanwhile, it supports to send registration package when sending data. Network registration packet includes: Establish a connection to send the registry packet, data carrying or both.
Page 43
USR-N540 User Manual www.usriot.com ② Testing result: Jinan USR IOT Technology Limited 43 / 73 inquiry@usriot.com...
2. Open webpage and click “web to serial”. It pops up “connect success” then can send/receive data. Open USR-TCP232-TEST Software, configure serial parameter and click “Open”. 3. Click “send ASCII data”, COM can receive data. Click “Send” in TEST Software, webpage can receive data. Web to Serial Webpage Jinan USR IOT Technology Limited 44 / 73 inquiry@usriot.com...
Page 45
Web to serial needs user’s webpage programming ability. Design webpage, request own device’s data and process data then reveal the results on webpage. According to chapter4.1.17 Customized Webpage, can download revised Jinan USR IOT Technology Limited 45 / 73 inquiry@usriot.com...
3. Send data function function send() 3.7.6. Customized Webpage User can make revision as LOGO/NAME on the basis of USR-N540’s webpage to realize the personalized applications. 1. Download Upgrade http://www.usriot.com/e45-m4-seriesk3-self-defined-webpage/ (Different firmware version with different tool, please contact sales@usriot.com) 3.
① Configure the parameter, set work mode as “TCP Server”, local port number “9100”, and have to choose “Net Buffer” and “PRINT”. Others do not need to be chosen. ② Set Printer Driver Jinan USR IOT Technology Limited 47 / 73 inquiry@usriot.com...
Page 48
USR-N540 User Manual www.usriot.com Click next and input the USR-N540’IP address,then keep clicking next til finished ③ Serial port connects to the printer, open a word file to print Jinan USR IOT Technology Limited 48 / 73 inquiry@usriot.com...
Flow Calculation When USR-N540 receives data from network and then send to serial port, as the limit of serial port speed, user have to control the flow, if not the problem of data overflow on serial port side will occur. So data flow is required to calculated when sending data from network to serial port.
① If there is no overflow, m bytes data must be transmitted within n seconds, then the transmitting time of M bytes data: If n >2T, then data will not overflow, USR-N540 can work normally. Just need keep n>T under baud rate 9600. 3.7.10. Synchronous baud rate (RFC2217) For encryption during data transmission, devices change data bytes, baud rate, parity and so on.
2. When serial parameter changes is needed, it send RFC 2217 packet. USR-N540 receive the command from network and revise serial parameter accordingly, do not transmit the RFC2217 command transparently. 3.7.11. Keep-Alive When USR-N540’s network is abnormal, it can judge the status in time and disconnect. And connect to server once network recovers. 3.7.12. Device ID The function have 2 types: send ID once connection and send ID once sending data.
USR-N540 User Manual www.usriot.com 3.7.13. Webpage Port USR-N540 has built-in webpage server and the port is 80. Also the port can be revised and visit the web via revised port. 3.7.14. Revise MAC User can check software’s MAC address. USR-N540 MAC is Globally Unique. Also it support customized MAC.
USR-N540 User Manual www.usriot.com Reload 4. Setting Protocol USR-N540 includes two protocol: network setting protocol and serial port setting protocol. 4.1. Network Setting Protocol 4.1.1. Set Parameter Process Build SOCKET: Build UDP SOCKET, destination IP: 55.255.255.255, destination port: 1901. Low is in front.
Page 54
Send (16 bytes):FF 13 04 AC CF 23 66 66 67 61 64 6D 69 6E 00 61 64 6D 69 6E 00 FA Some commands detailed annotation ① Basic setting parameter command Jinan USR IOT Technology Limited 54 / 73 inquiry@usriot.com...
Page 55
00 FF FF FF 55 53 52 2D 54 43 50 32 33 32 2D 45 34 35 00 00 61 64 6D 69 6E 00 61 64 6D 69 6E 00 02 01 00 00 AC CF 23 66 66 67 00 48 54 54 50 2F 31 2E 1C ② Port settings parameter command Port parameter: Jinan USR IOT Technology Limited 55 / 73 inquiry@usriot.com...
Page 57
FF 01 02 45, if user name and password are wrong, 45 = 'E' Return results of read command Description: Return all parameter of USR-N540 network. 193 bytes in total, no parity, no protocol, return parameter directly. Returned content: 193 (basic parameter+serial parameter+serial parameter) Return results of save settings command...
Query MAC USERMAC Set customize MAC RELD Restore to factory setting WANN Query/set parameters of WAN port Query/set DNS WEBU Query/set username and password of webpage WEBPORT Query/set port of webpage Jinan USR IOT Technology Limited 58 / 73 inquiry@usriot.com...
Page 59
Query/set head information of the Httpd client UARTn HTPHEADn HTPCHDn Query/set delete head of UARTn HEARTENn Query/set enable/disable heartbeat package HEARTTPn Query/set type of heartbeat package HEARTDTn Query/set content of heartbeat package Jinan USR IOT Technology Limited 59 / 73 inquiry@usriot.com...
3. Disable network card nothing to do with this testing. Download [USR-TCP232-M4&E45] Setup software here: https://www.usriot.com/support/downloads/usr-vcom-virtual-serial-software.html Search device and all USR-N540 device within LAN can be found. It includes IP, name, MAC and version. Jinan USR IOT Technology Limited 60 / 73...
Page 61
1. Click ‘Device’ on the top of the program and then check user name/password via ‘User config’. If it is correct, it reveals USR-N540 information. If not, it pops up retype window, click “Confirm”. User name and password is admin by default.
Page 62
USR-N540 User Manual www.usriot.com Software Configuration-Password 2. Basic parameter configuration Click “Full Show” and all basic parameter is revealed. Set the parameter as needs and click “Base Save” then can set successfully. Jinan USR IOT Technology Limited 62 / 73 inquiry@usriot.com...
Page 63
USR-N540 User Manual www.usriot.com Software Configuration --Full Show Jinan USR IOT Technology Limited 63 / 73 inquiry@usriot.com...
Page 64
User name: Authentication Code for revising parameter to avoid other users within same LAN revising it. Password: same as user name. Device Name: USR-N540 ’s name an be revised. MAC address: USR-N540 ’ MAC IP address type: Static and DHCP ...
Page 65
Destination IP/Port: IP connected when USR-N540 works as client (TCP Client/HTTPD Client/UDP Client) Local Port: port USR-N540 to connect. Advice to set it to “0’’ when USR-N540 works under TCP Client for connection with Random port. TCP Server Type: No.
USR-N540 User Manual www.usriot.com During firmware upgrade, USR-N540 connects to PC directly. PC Upgrade via Wi-Fi is prohibited. Firmware Upgrade 5.2. Webpage Configuration User can login web-page by N540’s IP address. Example: Open browser and type in USR-N540 ’ IP (192.168.0.7 by default).
Page 67
USR-N540 User Manual www.usriot.com Webpage Log In Jinan USR IOT Technology Limited 67 / 73 inquiry@usriot.com...
Page 68
Count of data sending: how many data sent from powered Count of data receiving: how many data received from powered USR-N540 connection status: check whether connection is built. 2. Local IP Config Save configuration after revising the parameters. Then restart. Webpage Configuration-Local IP Configuration IP setting 3.
Page 69
Disconnect time: Only for TCP client. If the network failure causes the link to break, the device will actively connect to the server within fixed time Print: Function for network printing ModbusTCP Poll: Function for Modbus Polling Jinan USR IOT Technology Limited 69 / 73 inquiry@usriot.com...
Page 70
Click “web to serial ” and “connect success” pops up. Confirm then send data. Web to Serial 5. Misc Config This part refers to the parameters of the device itself. User can modify them according to the application. Module Name: USR-N540 ( User can modify it) Websocket port Webserver port:80...
Page 71
Buffer data before connected: whether serial and network data are cached if disconnection. Reset timeout: how long USR-N540 reset when no data from COM or Network. Set to “0” then no rest. 6. Reboot Save all data then click restart to take effect.
Address: Floor 11,Building1,No.1166 Xinluo Street,Gaoxin Distric,Jinan,Shandong,250101 China Tel: 86-531-55507297, 86-531-88826739 Web: http://www.usriot.com Support : http://h.usriot.com Email: sales@usriot.com 7. Disclaimer This document provide the information of USR-N540 products, it hasn’t been granted any intellectual property license Jinan USR IOT Technology Limited 72 / 73 inquiry@usriot.com...
V1.0.7 Modify the instr of HTTPD 2019-5-9 V1.1.0 Using new hardware type, cover picture, correct the faults of the DB9 2019-5-22 V1.1.1 Modify the wrong picture of the client 2019-5-30 V1.1.2 Modify the dimension diagram Jinan USR IOT Technology Limited 73 / 73 inquiry@usriot.com...
Need help?
Do you have a question about the USR-N540 and is the answer not in the manual?
Questions and answers