0% found this document useful (0 votes)
63 views130 pages

USR M100 User Manual - V1.0.1

Uploaded by

Darshit Vyas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views130 pages

USR M100 User Manual - V1.0.1

Uploaded by

Darshit Vyas
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 130

USR-DR404 AT 指令集

USR-M100 Industrial Edge I/O Gateway

Modular Remote Terminal Unit(RTU)


User Manual V1.0.0

Build a Smarter IoT world, Your Trustworthy Partner

1
User Manual

Content
1. Introduction ..................................................................................................................................................................... 5
1.1. Overview ................................................................................................................................................................ 5

1.2. Features................................................................................................................................................................. 5

2. Get started ..................................................................................................................................................................... 6


2.1. Installation .............................................................................................................................................................. 6

2.1.1. DIN-Rail mounting .......................................................................................................................................... 6

2.1.2. Wall mounting ............................................................................................................................................... 7

2.2. Serial port.............................................................................................................................................................. 7

2.3. I/O interfaces ......................................................................................................................................................... 7

2.3.1. I/O specifications ........................................................................................................................................... 9

2.3.2. I/O wiring...................................................................................................................................................... 9

2.3.3. Modbus address mapping table ................................................................................................................... 10

2.4. Power supply ....................................................................................................................................................... 11

2.5. Ethernet RJ45 interface ........................................................................................................................................ 11

2.6. LED indicators ..................................................................................................................................................... 11

2.7. Factory default settings ........................................................................................................................................ 12

2.8. Quick test ............................................................................................................................................................ 12

2.8.1. Download the software ................................................................................................................................ 12

2.8.2. Hardware connection .................................................................................................................................. 13

2.8.3. Network configuration(Step1) .................................................................................................................. 14

2.8.4. Data transmission test(Step2 and 3) ........................................................................................................ 16

2.9. Reload factory settings button .............................................................................................................................. 17

2.10. Technical support and assistance ........................................................................................................................ 17

3. Configuration and parameter details .............................................................................................................................. 18


3.1. Web interface ...................................................................................................................................................... 18

3.1.1. Status .......................................................................................................................................................... 18

3.1.2. IP settings ................................................................................................................................................... 19

3.1.3. Serial port settings ...................................................................................................................................... 21

3.1.4. Websocket server ........................................................................................................................................ 23

3.1.5. MQTT gateway ............................................................................................................................................ 23

3.1.6. Edge computing .......................................................................................................................................... 26

3.1.7. IO settings ................................................................................................................................................... 29

3.1.8. Cloud service .............................................................................................................................................. 31

3.1.9. System setup .............................................................................................................................................. 31

 System setting......................................................................................................................................... 31

 management ........................................................................................................................................... 32

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
3.2. Configuration software ......................................................................................................................................... 33

3.2.1. Discovering your gateway ............................................................................................................................ 33

3.2.2. Network setting........................................................................................................................................... 33

3.2.3. Reboot the device ....................................................................................................................................... 34

3.2.4. Restore to factory default settings ............................................................................................................... 34

3.2.5. Open web server ........................................................................................................................................ 35

4. Operation modes .......................................................................................................................................................... 35


4.1. TCP Server ........................................................................................................................................................... 35

4.1.1. Properties .................................................................................................................................................... 35

4.1.2. Multihost setting .......................................................................................................................................... 37

4.2. TCP Client ........................................................................................................................................................... 37

4.2.1. Properties.................................................................................................................................................... 37

4.2.2. SSL/TLS ..................................................................................................................................................... 39

4.2.3. Transient connection ................................................................................................................................... 39

4.3. UDP Server ......................................................................................................................................................... 40

4.3.1. Properties ................................................................................................................................................... 40

4.4. UDP Client........................................................................................................................................................... 41

4.4.1. Properties ................................................................................................................................................... 41

4.4.2. UDP multicast ............................................................................................................................................. 42

4.5. HTTP Client ......................................................................................................................................................... 44

4.5.1. Properties ................................................................................................................................................... 44

4.5.2. HTTPS ........................................................................................................................................................ 45

4.6. Websocket server ................................................................................................................................................ 45

5. Virtual COM port........................................................................................................................................................... 47


5.1. TCP Server Application with Virtual COM .............................................................................................................. 49

5.2. TCP Client Application with Virtual COM ............................................................................................................... 51

5.3. Enable RFC2217 through Virtual COM ................................................................................................................... 53

5.3.1. PUSR customized RFC2217 protocol ............................................................................................................. 55

6. Modbus TCP/RTU gateway ............................................................................................................................................ 56


6.1. Ethernet masters with serial slaves........................................................................................................................ 56

6.2. Serial master with Ethernet slave .......................................................................................................................... 57

6.3. Serial master with serial slaves ............................................................................................................................. 59

6.4. Serial master via virtual COM with serial slaves ..................................................................................................... 60

6.5. Modbus poll with serial heartbeat packet .............................................................................................................. 63

7. Advanced features ........................................................................................................................................................ 64


7.1. Packing mechanism .............................................................................................................................................. 64

7.2. Heartbeat packet ................................................................................................................................................. 65

7.3. Registration packet .............................................................................................................................................. 66

7.4. Socket B .............................................................................................................................................................. 67

7.5. Rs485 bus detection ............................................................................................................................................ 67

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
7.6. Serial Printer setting............................................................................................................................................. 68

7.7. NTP ..................................................................................................................................................................... 70

7.8. SNMP .................................................................................................................................................................. 71

8. MQTT gateway ............................................................................................................................................................. 72


8.1. Basic settings ....................................................................................................................................................... 72

8.2. Publishing a message .......................................................................................................................................... 75

8.2.1. MQTT.fx tool introduction ............................................................................................................................ 75

8.2.2. Transparent transmission ............................................................................................................................ 77

8.2.3. Topic distribution ........................................................................................................................................ 79

8.2.4. Custom mode ............................................................................................................................................. 81

8.3. Subscribe to a topic............................................................................................................................................. 83

9. Edge computing ........................................................................................................................................................... 85


9.1. Add modbus slave device ..................................................................................................................................... 85

9.2. Add modbus data points ...................................................................................................................................... 86

9.2.1. Register type and offset ............................................................................................................................... 86

9.2.2. Raw data types and byte order .................................................................................................................... 86

9.2.3. Data points configuration ............................................................................................................................ 87

9.3. Export and import configuration ........................................................................................................................... 89

9.4. Data report.......................................................................................................................................................... 91

9.4.1. Communication channel............................................................................................................................... 91

9.4.2. Report method............................................................................................................................................ 92

9.4.3. Payload-Json template ................................................................................................................................ 93

9.4.4. Test............................................................................................................................................................ 95

9.5. Data query/control ............................................................................................................................................... 97

9.5.1. Json ............................................................................................................................................................ 97

9.5.2. Modbus slave address and register mapping ............................................................................................. 100

9.5.3. Modbus TCP ............................................................................................................................................. 102

9.5.4. Modbus RTU ............................................................................................................................................. 104

10. IO channels ............................................................................................................................................................... 107


10.1. IO function........................................................................................................................................................ 107

10.1.1. Web interface ........................................................................................................................................... 107

10.2. Modbus TCP query/control ............................................................................................................................... 108

10.2.1. DI status query ......................................................................................................................................... 109

10.2.2. AI status query ........................................................................................................................................ 111

10.2.3. DO query/control..................................................................................................................................... 112

10.3. Modbus RTU query/control ............................................................................................................................... 113

10.3.1. DI status query ......................................................................................................................................... 114

10.3.2. AI status query ........................................................................................................................................ 115

10.3.3. DO control/query..................................................................................................................................... 115

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
10.4. MQTT query/control ......................................................................................................................................... 116

10.4.1. DI status query ......................................................................................................................................... 118

10.4.2. AI status query ........................................................................................................................................ 119

10.4.3. DO control/query..................................................................................................................................... 119

10.5. DO Timing trigger control ................................................................................................................................. 120

10.6. Edging computing and linkage control .............................................................................................................. 120

10.6.1. Add IO module ......................................................................................................................................... 121

10.6.2. Add IO data points................................................................................................................................... 121

10.6.3. IO status report ....................................................................................................................................... 122

10.6.4. IO query/control ...................................................................................................................................... 123

10.6.5. Linkage control........................................................................................................................................ 126

 Local follow logic ................................................................................................................................... 127

 Threshold trigger ................................................................................................................................... 128

11. AWS IoT service ......................................................................................................................................................... 129


12. PUSR cloud service .................................................................................................................................................... 129
13. Warranty ................................................................................................................................................................... 129
14. Contact Us ................................................................................................................................................................ 129
15. Disclaimer ................................................................................................................................................................. 129
16. Revision History ......................................................................................................................................................... 129

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual
1. Introduction

1.1. Overview
The USR-M100 is an intelligent IoT I/O gateway with comprehensive functions like on-board I/O support and RS-485/232/Ethernet

interface, is an advanced modular RTU product with a unique hardware and software design, making it an ideal solution for a variety

of industrial data acquisition applications.

The USR-M100 has a unique mechanical design that reduces the amount of time required for installation and removal, simplifying

deployment and maintenance. In addition, the USR-M100 supports Modbus RTU Master protocol for retrieving field site serial data

from serial meters and also supports OT/IT protocol conversion.

With the ability to convert between multiple protocols, USR-M100 can convert the collected I/O and serial data to protocols suitable

for different upper-level software. For example, cloud service via MQTT, SCADA via Modbus TCP, web server via HTTP, and more.

This two-in-one design reduces system complexity, the amount of space required in the network topology, and overall installation

time. You can also connect your legacy devices to Ethernet, thereby increasing the lifetime of the devices since you can continue

using the devices’ original protocols.

1.2. Features
 High-performance CPU processing ability,using 32-bit Arm Cortex-M7 core CPU, up to 400MHz frequency

 Provides remote serial access over the Internet for industrial serial devices

 10/100Mbps Ethernet port and support Auto MDI/MDIX

 Built-in 15KV ESD serial port protection

 Supports a wide industrial operating temperature,-40℃~85℃

 Baud rate: 0.6~230.4 Kbps, and any baud rate setting, support None, Odd, Even, Mark, Space Parity bit

 Flexible serial port data framing packing, which can satisfy user’s various demands for data packets segmentation

 Versatile operation modes: TCP Server, TCP Client, UDP, HTTP client, Websocket server

 Support virtual COM USR-VCOM(windows)

 Modbus Ethernet-to-Serial support (Modbus/TCP, Modbus/RTU) for seamless integration of serial Modbus devices

 Provides rich configuration access, including: Windows configuration tool, and Web Browser

 Firmware upgrading via Web Browser and Windows configuration tool

 High security via certificate verification SSL/TLS encryption for serial data transmission,HTTPS,TCPS,MQTTS

 Support modbus RTU master,edge computing, modbus gateway,MQTT gateway

 Support SNMP V1/V2c

 Support on board I/O for analog input(2 AI), digital input(2 DI), digital output(SSR relay,2 DO), expandable with I/O modules

 Support 2 RS485 serial port, the first one can also be RS232

 Cloud support: MQTT via AWS IOT, Microsoft Azure, Thingsboard, Alibaba Cloud, EMQX, Tuya,Cumulocity IoT and so on

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual
2. Get started
Since the USR-M100 is connected through a TCP/IP network, you may need to know some basic facts about networking in order to

connect the server correctly. Specifications and dimensions are not provided in this manual. Please refer to datasheet for more

information.

2.1. Installation
You can choose whether to plug in the other peripheral ports at this point or do it later depending on the actual location of the device

or level of comfort for performing such operation.

2.1.1. DIN-Rail mounting


The USR-M100 has a unique mechanical design that reduces the amount of time required for installation and removal. In fact,

screwdrivers and other tools are not required for any part of the hardware installation, including mounting the device on a DIN-rail,

as well as connecting the wiring for both communication and I/O signal acquisition. Furthermore, no tools are required to remove the

USR-M100 from a DIN-rail. Removing all of the modules from a DIN-rail is also easy using the latch and release tab.

 Position the rear panel of the device directly in front of the DIN-Rail, making sure that the top of the clip hooks over the top of

the DIN-Rail , as shown in Fig.1. Push up the the release tab towards the bottom of the DIN-Rail until the the mounting clip snaps

into place.

Fig. 1 DIN-Rail mounting and wall mounting


 If you want to remove the device from DIN-Rail. Pull down the release tab with your finger and then remove the module from

the DIN-Rail.

 NOTE: Disconnect all connections, including Ethernet, serial, and power cables, from the device before removing the device

from the DIN rail.

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual
2.1.2. Wall mounting
The wall mounting option provides better shock and vibration resistance than the DIN-Rail vertical mount.

 Locate the installation site and place the device against the wall. Use the wall mount plates as a guide to mark the locations of

the screw holes.

 Drill two holes over the 4 marked locations on the wall. Insert the wall sinks into the walls.

 Insert the screws(M3 size) into the wall sinks then tighten the screw to enhance stability, see the following Fig.1.

2.2. Serial port


The USR-M100 supports 2 serial ports, 1 RS232/485 and 1 RS485, and adopts Spring-type terminal. The serial port pin assignments

are shown in Fig.2. When connecting up Modbus devices via an RS485 network they should be daisy chained together, and a dual

twisted pair cable are recommended.The connections should be kept the same throughout the network: positive to positive, and

negative to negative. These may sometimes be labeled up as A and B. The maximum length of the serial network cannot exceed

1200m regardless of boosters and repeaters.

Fig. 2 USR-M100 interfaces

2.3. I/O interfaces


USR-M100 is equipped with two 11-pin Terminal blocks that are used for I/O interfaces. The pin assignments of terminal block are

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual
shown in table 1. The PIN assignments are also marked on the device’s nameplate, in order to avoid confusion.

Table 1 Terminal pin assignments

Terminal block1 Definition Terminal block2 Definition

DO1 NC Relay Output 1 normal close A COM 2 RS485 A

DO1 COM Relay Output 1 Common B COM 2 RS485 B

DO1 NO Relay Output 1 Normal open G COM 2 Ground

DO2 NC Relay Output 2 normal close DI1 DC Digital Input 1

DO2 COM Relay Output 2 Common COM Digital Input 1 Common

DO2 NO Relay Output 2 normal open DI2 DC Digital Input 2

TX COM 1 RS232 TX COM Digital Input 2 Common

RX COM 1 RS232 RX AI1 Analog Input 1

G COM 1 Ground COM Analog Input 1 Common

A COM 1 RS485 A AI2 Analog Input 2

B COM 1 RS485 B COM Analog Input 2 Common

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual
2.3.1. I/O specifications

Table 2 I/O specification

Inputs

DI channels 2

Input Type Dry/Wet contact

Wet contact On: 9 to 36 VDC

Off: 0 to 2 VDC
Digital inputs
Dry contact On: close

Off: open

Range 9-36V DC

Input filter time Software configurable,10~65535ms

Quantity 2

Type Differential input

Analog inputs Resolution 16 bit

Range 4~20mA current

Accuracy 1% FSR

Outputs

Quantity 2

Type

Form C SSR Relay

AC Contact Current 10A / 277V AC at resistive load, NO

Rating 5A / 250V AC at resistive load, NC


Digital outputs
DC Contact Current 10A / 28V DC at resistive load

Rating

Operating time 10 ms max.

Release time 5ms max.

Mechanical Endurance 10000000 operations

2.3.2. I/O wiring


The left picture in Fig.3 shows an example of digital input (DI) dry contact in which the digital input channel is controlled by a switch

that is wired to the COM pin of the DI port. An external DC power(9~36V) is supplied this external circuit via the wiring of DI pin and

the switch. The position of switch and power supply can be interchanged.

The right picture in Fig.3 shows an example of digital input (DI) wet contact in which the digital input channel.

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual
Fig. 3 Dry/Wet contact wiring

Fig. 4 DI wire connection

Fig. 5 DO wire connection

Fig. 6 AI wire connection


NOTE:

–All DI channels should be configured to dry contact or wet contact in the same time

–wire range:28~16 AWG(0.2~0.1 mm2), strip length 10mm

2.3.3. Modbus address mapping table


The internal register map of USR-M100 field controller node is the data map of digital input and output and analog input module.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
Table 3 IO modbus address
Data points Slave ID Start address Register Function Attribute Data type Default status

address code

DO 1 100 0000 00001 0x1,0x5,0xF Write/read Uint8 NC

DO 2 100 0001 00002 0x1,0x5,0xF Write/read Uint8 NC

DI 1 100 0000 10001 0x2 read Uint8 0

DI 2 100 0001 10002 0x2 read Uint8 0

AI 1 100 0000 30001 0x4 read float32(ABCD) 0

AI 2 100 0001 30003 0x4 read float32(ABCD) 0

2.4. Power supply


The USR-M100 I/O gateway provides 2-pin power supply input terminal. The power supply support anti-reverse protection. Power

supply range: 9~36VDC.

2.5. Ethernet RJ45 interface


The 10Base-T/100Base-TX adaptive Ethernet RJ45 interface supports automatic MDI/MDIX connection, refer to Fig.7 below for the pin

distribution of the RJ45 interface.

Link LED: green color. Lights(steady on) when the module is connected to a network.

Activity LED: orange color. Blinks when network data is transmitted through the port.

Fig. 7 RJ45 with light

Table 4 Ethernet pin assignments

Pin number Signal name

1 Send data+(TD+)

2 Send data-(TD-)

3 Receive data+(RD+)

6 Receive data-(RD-)

4,5,7,8 Unused

2.6. LED indicators


The USR-M100 smart RTU provides LED indicators to monitor the device working status with a comprehensive simplified

troubleshooting, the LED indicator behaviors are defined below.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
Table 5 LED indicators

LED name status description

POW Steady on Power supply is normal

Off No power supply or abnormal power supply

WORK Blinking Power is on and the device is ready. System is booted up

and running

NET Blinking Ethernet WAN connection

Steady on 4G LTE network connection

off No network

DATA Blinking Serial port is transmitting data

DO1 Steady on Light on, the channel output is activated

DO2 Steady on Light on, the channel output is activated

DI1 Steady on Light on, the channel is activated by input signal

DI2 Steady on Light on, the channel is activated by input signal

2.7. Factory default settings


The USR-M100 remote IO module comes with the following default settings.

Table 6 Default parameters

Parameter Default Values

User Name admin

Password admin

Device IP address 192.168.0.7

Subnet Mask 255.255.255.0

Gateway IP 192.168.0.1

COM port 115200,None,8,1

COM operation mode TCP server,23

MQTT Disable

Edge computing Disable

2.8. Quick test


USR-M100 has a built-in Web server, which provides a convenient way to access and configure the remote IO module. Users can use

Edge , Firefox or Google browser to access it. This chapter is a quick introduction to the USR-M100 smart IO gateway. It is

recommended that users read this chapter and follow the instructions once for the system, and you will have a basic understanding

of the product. For specific function details and instructions, please refer to the subsequent chapters.

2.8.1. Download the software


Download the setting software from PUSR’s website:

https://www.pusr.com/support/downloads/H7-version-set-up-software.html

https://www.pusr.com/support/downloads/usr-tcp232-test-V13.html

You may find it in the download section under your product page. Run the software when the installation has been completed as

shown in Fig.8 and Fig.9.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
It is strongly recommended for the users to set the Network Parameters through configuration tool first. Other device-specific

configurations can later be carried out via user-friendly Web-Interface.

Fig. 8 Windows configuration tool

Fig. 9 Test assistant

2.8.2. Hardware connection


For fast networking of USR-M100 smart RTU, you need to prepare a PC, a router, a network cable, a serial cable, and a DC12V/1A

power supply. The hardware connection is shown in Fig.10. To establish a TCP / IP network all devices must be connected to the same

network either locally or via gateway connections.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 10 Hardware connection


 Connect the power line with the USR-M100 power input. If the power is properly supplied, the “PWR” LED will show a solid red

color. After the system is ready, the “WORK” LED will blink.

 Connect one end of the Ethernet cable to the M100’s 10/100M Ethernet port and the other end of the cable to the same Ethernet

network(same router or switch).

 Connect a serial data cable(USB to RS232 or RS485) between the USR-M100 and PC. Screwless push-in type connection for

simple and easy connection.

Fig. 11 Push in type connector

2.8.3. Network configuration(Step1)


The Broadcast Search function is used to locate all USR-M100 gateways that are connected to the same LAN as your computer. Since

the Broadcast Search function searches by MAC address and not IP address, all M100 connected to the LAN will be located,

regardless of whether or not they are part of the same subnet as the host.

Click Search to search for USR-M100 gateways. When your unit appears in the search results, you can click device to select it and

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
change the IP type to DHCH, save your change. Wait for 5s and search it again.

Fig. 12 IP network setting


When accessing the M100 gateway through the Web, the IP address of the M100 gateway and the PC must be in the same network

segment. After changing the IP address of the M100 gateway, you can access the Web page of the M100 gateway through browser

and perform related configuration operations on it. The user name and initial password are both "admin".After entering the user name

and password, click "OK" and the server will authenticate. After success, you will enter the main page of the Web server, as shown

in Fig.13.

Fig. 13 The main interface of the Web server


The IP address of the PC must be modified to ensure that it is in the same local area network as the IP of the M100 gateway if you

want to connect M100 to PC directly via a net cable. The default IP address of M100 IO gateway is: 192.168.0.7. Set the PC's IP address

as: 192.168.0.X (X is any valid value from 2 to 253 except 7). The specific Windows system operation page is shown in Fig.14. you can

access the Web page of the USR-M100 gateway through browser as mentioned above.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 14 IP setting of PC

2.8.4. Data transmission test(Step2 and 3)


You can select an operation mode in socket setting page, but for now we use default parameters to test, i.e TCP server. Now

USR-TCP232-Test works as TCP client, you need configure the server IP and port, that is 172.16.14.73:23 of USR-M100 gateway, the

IP address of PC is 172.16.14.15.

In the serial port setting module, you can configure communication parameters for the serial ports RS485, as shown in the figure

below. When configuring a serial network you need to set the following within each device-Baud rate,Parity,Stop bits,Data bits and

keep serial port parameters consistent in the same network. We now configure the COM Settings to operate as required for the M100

devices. Go to the Uart1 Settings tab for confirming values of parameters.

Fig.15 shows an example of parameters setting to test transparent transmission.

Fig. 15 Transparent transmission test

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
2.9. Reload factory settings button
Press the “Reload” button (inside a small hole) on the back panel for 3-15 seconds and then release or follow the procedure in

Section 3.1.9, to restore the USR-M100 gateway to the factory default settings.

2.10. Technical support and assistance


Please visit the USR IoT website: https://www.pusr.com where you can find the latest information about the product.

Contact your distributor, sales representative, or PUSR's support center:

http://h.usriot.com/index.php?c=frontTicket&m=sign for technical support if you need additional assistance. Please have the following

information ready before you submit a ticket:

– Product model

– Description of your peripheral attachments

– Description of your software (firmware version, application,function description,etc.)

– A complete description of the issue and steps to reproduce

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
3. Configuration and parameter details

3.1. Web interface


The USR-M100’s user-friendly web configuration tool was designed specifically to make configuration and reconfiguration easy; no

reconfiguration effort is required for the unchanged modules.

Every USR-M100 Industrial IO gateway is equipped with a built-in web server in the firmware. Therefore, the device can be accessed

by using a web browser for configuring by entering the device’s IP address in the URL field of your web browser. An authentication

will be required and you will have to enter the username (Default value is “admin”) and password (Default value is “admin”) for

accessing the web interface as shown in Fig. 16. This approach (web interface) for configuring your device is the most user-friendly.

Please go to its corresponding section for a detailed explanation.

Fig. 16 Authentication Required for Accessing Web Interface

3.1.1. Status
After entering the correct user name and password and the authentication is successful, you will enter the main page of the Web,

as shown in Fig.13.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
Fig. 17 Overview
The function of the device status part is to display some specific information of the current device, including system, network, serial

port, mqtt gateway and Edge computing status.

Table 7 Overview status list

Parameter Item Description

Model name The name of the gateway, which can be customized by the user on the "Miscellaneous settings" page.

Firmware version The current software version of the gateway.

Type The current hardware version of the gateway.

Running time Total time after the device start work. It will starts from 0 after reboot.

OS Operating system.

MAC address The MAC address of the gateway.

Current network type Which interface to access the internet, default WAN interface, that is ethernet port.

Current IP address The IP address of the gateway.

Port status The working status of checked serial port. Select the serial port currently to be displayed

Conn Status A(ETH): connection status of socket A.

IDLE:Initialization status

LISTEN:When the module works as TCP Server, it is listening for connection access

CONNECTING:Works as TCP client, the module is establishing a connection to the TCP Server

CONNECTED:Works as TCP server, the TCP connection to TCP server of the module has been

established

CONNECTED(n):Number of TCP clients connected to the module

ERROR:The module is abnormally disconnected

Tx Count A(ETH): To count how many bytes be send to internet.

Rx Count A(ETH): To count how many bytes received from internet.

MQTT Whether MQTT is enable

Connection status Shows the connection status to the MQTT broker.

CONNECTING:the Smart I/O Controller is connecting to the MQTT broker

CONNECTED:the Smart I/O Controller is connected to an MQTT broker

ERROR:The module is abnormally disconnected due to invalid MQTT protocol version, invalid client ID,

unavailable broker, invalid client credentials or unknown reasons

Edge computing Whether Edge computing is enable

Connection status Connection status of Edge computing.

CONNECTING:the module is establishing a socket or mqtt connection

CONNECTED:the socket or mqtt connection has been established

ERROR:The module is abnormally disconnected

3.1.2. IP settings
You must assign a valid IP address to the USR-M100 before it will work in your network environment. The IP address must be unique

within the network. If the device is connected to the Internet and should connect to other servers over the Internet to get some

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
services such as Network Time Protocol (NTP) server, you will need to configure the DNS server in order to be able to resolve the host

name of the NTP server. The detailed description of the configuration parameters on this interface is shown in table 8.

Fig. 18 Network web page

Table 8 Network configuration list

Parameter Item Description

IP obtaining type Click the drop-down menu to select the IP Address Setting mode: Static or DHCP. If you choose DHCP,

the rest of the options will be greyed out or disabled.

DNS type Click the drop-down menu to select the DNS mode: auto or manual. If you choose auto, the DNS options

will be greyed out or disabled.

IP address IP address is a 32-bit address assigned to devices connected to the Internet. The IP address consists of

two fields: the network number field (Net-id) and host number field (host-id). In order to facilitate the

management of IP addresses,IP addresses are divided into five categories: Class A, B, and C addresses

are unicast addresses, Class D addresses are multicast addresses, Class E addresses are reserved

addresses for future special purposes. The IP addresses currently in large numbers belong to three types

of addresses: A, B, and C.

Subnet mask The mask is a 32-bit number corresponding to an IP address. Some of these numbers are 1, and the

others are 0. The mask can divide the IP address into two parts: the subnet address and the host address.

The part of the IP address corresponding to the 1 bit in the mask is the subnet address, and the other bits

are the host address. The mask for class A addresses is 255.0.0.0, the mask for class B addresses is

255.255.0.0, the mask for class C addresses is 255.255.255.0.

Gateway The default gateway in the host is usually called the default route. The default route (Default route) is the

route chosen by the router when no other route exists for the destination address in the IP packet. All

packets whose destination is not in the router's routing table will use the default route.

DNS The IP address of the DNS server. DNS Server part is where you can specify the IP Address of your

Preferred DNS (Domain Name Server) and Alternate DNS. When the device uses a static IP address, the

user is required to fill in this item, 8.8.8.8(Google) will be a good choice. If a specific DNS server is not

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
used, the default gateway IP address is generally sufficient.

The configuration will save to flash memory after clicking Save button. All configurations take effect after a system reboot.

3.1.3. Serial port settings


The serial port module includes: serial port parameter configuration, network parameter configuration. The main function of the

gateway is to carry out two-way transparent transmission of standard serial bus data (RS-232, RS-485) and standard Ethernet data

supporting TCP/IP protocol to solve common serial equipment Networking problems on the Internet. The Port configuration page can

configure the parameters of the serial port and socket, as shown in Fig.19. Details on work mode connectivity protocols and its

settings of USR-M100 gateway are given in Chapter 4 Operation modes, this section will only focus on the part of parameter

description. The description of the configuration parameters on this interface is shown in table 9 and table 10.

Fig. 19 Serial port configuration web page

Table 9 Serial settings list

Parameter Item Description

Baud rate This sets the port’s data transfer speed. Choices are from 600—230400. Set this to match the baud rate

setting of the connected device. Default is 115200.

Data bits This sets the number of bits used to transmit one character of data. Choices are: 7 and 8. Set this to

match the data bit setting of the connected device. Default is 8 (which is the default for the majority of

serial devices).

Parity bits This bit checks the integrity of the transmitted data. Choices are: None, Odd, Even, Space, Mark. Set this

to match the parity setting of the connected device. Default is None (which is the default for the majority

of serial devices).

Stop bits This indicates that a character has been transmitted. Set this to match the stop bit setting of the

connected device. Choices are: 1 and 2. Default is 1 (which is the default for the majority of serial devices).

Flow control This allows you to choose how the data flow will be controlled. Choices are: None(No Flow Control), or

Xon/Xoff (Software Flow Control). Set this to match the flow control setting of the connected device.

Default is None. If Xon/Xoff is selected, the Xon and Xoff characters are 0x11 for Xon and 0x13 for Xoff.

Note that these are hexadecimal numbers of ASCII characters (i.e., 0x11 = ‘1’ and 0x13 = ‘3’).

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
Packing time Click the option to sent pack immediately by interval.

Packing length Click the option to sent pack immediately by size.

The configuration will save to flash memory after clicking Save button. All configurations take effect after a system reboot.

Fig. 20 Socket configuration web page

Table 10 Operation modes settings list

Parameter Item Description

Working mode USR-M100 gateway supports 5 different operation Modes which are TCP Server, TCP Client, and

UDP,HTTP client and websocket. The operation Mode describes the role of the device and the

connection between the device and other remote devices in the network which would like to

communicate with serial device on M100’s COM port.

Maximum socket no.(TCP This option specifies the maximum number of remote devices/clients (with maximum of 16 clients) that

server only) can be connected to the serial device on this COM port.

Local port This option specifies the port number that the TCP/UDP server should listen to. It is also used by the

remote TCP/UDP client to connect to the TCP/UDP server. The default local port is 23. You can enter

different port numbers in this option.

Remoter server addr. Please specify the IP address of the TCP/UDP server program on the remote host in this field. This should

match the IP settings of the TCP/UDP server program.

Remote port Please specify the port number of the TCP/UDP server program on the remote host in this field. Once

again, this should match the IP setting of the TCP/UDP server program.

Timeout The default is disable. If you want to keep connection continually, you can disable it. Data idle Time is the

reconnection(TCP/UDP time period for which the device waits for data. If the USR-M100 gateway does not receive data during

client) established idle time(timeout), the USR-M100 gateway will disconnect temporarily. When the data comes

in, it will reconnect automatically. Users do not need to reconnect.

Modbus polling This option is selected when multiple modbus maters from Ethernet are polling the same serial port.

Each serial port supports up to 16 simultaneous TCP connections allowing hosts to simultaneously

transmit/receive data to/from the same serial port, USR-M100 gateway processes the data in the order

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
arrived. The M100 gateway determines the end of the serial acknowledgement through a response

timeout.

Response timeout If the Modbus device does not receive a response within the time specified here, the communication

times out. Valid settings are from 10 – 9999ms.

Modbus TCP exception This option is used to enable modbus exception checking. If selected, error messages (TCP exception

(modbusTCP enabled) codes) are generated if a problem (such as a message timeout) should occur during Modbus operations.

SSL protocol Choose TLS/SSL data encryption protocol version

Socket B Socket B supports 2 different operation Modes which are TCP Client, and UDP client, this socket is closed

by default.

The configuration will save to flash memory after clicking Save button. All configurations take effect after a system reboot.

3.1.4. Websocket server


This function is that the gateway acts as a WebSocket server, and transparently transmits the data received by the serial to the

webpage in hexadecimal. The WebSocket server can also send data to the serial device at any time. It can also print log information.

Pleas refer to system setting.

Fig. 21 Websocket server

3.1.5. MQTT gateway


If you enable MQTT Broker as your northbound connection, the M100 gateway will be configured as MQTT Client. In Client mode, you

can setup MQTT broker basic settings, general topic settings, TLS secure transmission, last will message, and advanced settings.

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual

Fig. 22 MQTT connection profiles

Table 11 MQTT basic setting

Parameter Item Description

Enable MQTT Turns MQTT gateway on or off.

MQTT Version Select the mqtt protocol version. V3.1 and V3.1.1 are supported.

Client ID The client ID defined the identifier of the USR-M100 Gateway.

The IDs of the various MQTT clients have to be unique for the respective MQTT Broker. If two MQTT

clients are using an identical ID, the connections of theses clients to the MQTT Broker are

disconnected. For an individual client, there is no way to find out whether a specific client ID is already

used by another client or not.

Server address IP address or hostname of an MQTT broker.

Remote Port Port number of the MQTT broker.

Keep alive interval The Keep Alive is a time interval measured in seconds. It is the maximum time interval that the broker

permits between when a client finishes sending one MQTT packet and starts to send the next.

Re-connection time Automatic reconnection when there are not data flow in the MQTT session in the setting time. If the

time is set 0, this function does not take effect.

Re-connection interval Automatic reconnection interval after a fail network connection.

Clean session Valid only for Qos1 and Qos2. When the clean session is checked, the client does not want a persistent

session. If the client disconnects for any reason, all information and messages that are queued from a

previous persistent session are lost.

When the clean session is unchecked, the broker creates a persistent session for the client. All

information and messages are preserved until the next time that the client requests a clean session.

User name Username for authentication to the MQTT broker.

Password Password for authentication to the MQTT broker.

Last will The last will message is part of the Last Will and Testament (LWT) feature of MQTT. The will message

notifies other clients when a client disconnects ungracefully.

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
SSL/TLS If you use a TLS connection, click the SSL/TLS tab, select Enable SSL/TLS, and then set

the Protocol parameter to TLSv1.2

Fig. 23 Topic to publish

Table 12 Publish message setting

Parameter Item Description

Transmission mode Transparent transmission, just as its name implies,the gateway does not process any data, forward the

data directly.

Topic distribution,in this mode users should define a topic name when configuring the topic. After

receiving serial port data, the device pushes it to the associated topics based on the topic name. Topic

name and payload are separated by comma. For example, topic name, {"message": "Hello from

USR-M100 gateway"} as serial data. Different topics are allowed to have the same topic name. In this

way, data is pushed to all topics with the same topic name.

Custom mode, add topic, Qos(0,1,2), retain(ON,OFF) message before payload. After receiving the serial

data, USR-M100 publishes the payload of the corresponding topic to cloud according to rules. This

method can be used to publish any topic at any time. For example, awsiot/test,0,ON,{"message": "Hello

from USR-M100 gateway"} as serial data.

TOPIC string An MQTT topic is a UTF-8 string that the broker uses to filter messages for each connected client. To

receive messages, the client must subscribe to the topic. A topic can have one or more topic levels.

Each topic level is separated by a slash (Topic Level Separator).

Binding Port The MQTT topic is bound to the serial port number of the device. Any data from the COM Port1 of the

gateway will send to all the TOPIC it bindings to.

Qos QoS 0: at most once. In this case, the client publishes a message to the broker only once.

QoS 1: at least once. In this case, when a client publishes a message to the broker, the client expects

the broker to acknowledge whether or not a client has received the message. If the publisher does not

receive acknowledgement from the broker within a preset time interval, it will republish the message

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
again and again until acknowledgment is received.

QoS 2: exactly once. The MQTT protocol uses the confirmation of confirmations to ensure that a

message is delivered exactly once.

Retained message By setting the Retain flag the MQTT Broker is instructed to save the most recent data value for the

topic. Data values without Retain flag are only transferred from the MQTT Broker to those MQTT

Subscribers that are registered at the broker and have subscribed to the appropriate topic in the

moment when sending the data to the broker.

IO control/Query Used to reply for IO status to server

Fig. 24 Topic to subscribe

Table 13 Subscribe message setting

Parameter Item Description

Transmission mode The data printed to the serial port can be set whether to carry the Topic

Topic string Same to Table 12

Binding port Same to Table 12

QoS Same to Table 12

IO control/Query Used to Query IO status from server

3.1.6. Edge computing


The M100 gateway supports southbound fieldbus protocols of Modbus RTU protocols. It also supports northbound MQTT/ Cloud

protocols of MQTT Broker, TCP/UDP/HTTP in socket, AWS IOT, and Alibaba Cloud IoT Platform. The M100 gateway fulfills a different

role on each of its sides. Each role is determined by your devices' settings. Therefore, set the role of each of your devices correctly.

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual

Fig. 25 Edge computing enabled

Fig. 26 Modbus slaves and datapoints configuration

Table 14 Modbus RTU poll configuration

Parameter Item Description

Device name The Modbus slave device identifier, which is unique for the current gateway. The device name must be

less than 30 characters in length, and can contain letters, digits, underscores (_).

COM Port Which serial port the modbus slave device connected to. Select an option from the drop-down list.

Slave address Slave ID. Each slave in a network is assigned a unique identifier ranging from 1 to 255. When the

master requests data from a slave, the first byte it sends is the Slave ID. When set to 0, the slave will

respond to requests addressed to any ID.

Polling interval The interval at which data is collected. Modbus is a communications protocol with half-duplex

transmission. Gateways send requests to collect data from devices. Therefore, you must specify the

data collection interval. The unit is millisecond.

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
If 60 milliseconds is required to collect the data of each property, the total time required to collect the

data of all properties is calculated as follows:

Total required time = Time required to collect the data of each property (60 ms) × Number of

properties for the slave device.

Modbus address mapping This function is usually combined with register mapping to realize a single modbus command query in

data query.

Merger collection This function is used when the register address of many data points are sequential

Table 15 Data point(node) configuration

Parameter Item Description

Data point name Identifier of the data point, which must be unique for the gateway. The name must be 1 to 30

characters in length and can contain letters, digits, and underscores (_).

Modbus function code The Modbus RTU master supports the following Modbus functions: 1 Read Coils, 2 Read Discrete

Inputs,3 Read Multiple Holding Registers, 4 Read Input Registers.

Register address The address of the register from which data will be read.

Data type Defines how read data will be stored. See table 22.

Response timeout If the Modbus device does not receive a response within the time specified here, the communication

times out. Valid settings are from 10 – 65535ms.

Data report The trigger of reporting data. Valid values:

On Change: The report is triggered if the collected data changes. You can use a tolerance to only log

the data point if the value changes more than X amount.

Interval: Collect the variable data at the poll interval and report the data at the specified report interval.

Timer: Collect the variable data at the poll interval and report the data at the regular time.

Register address mapping This function is usually combined with modbus address mapping to realize a single modbus command

query in data query.

Formula Modbus register store only whole numbers. For this reason a scale factor often needs to be applied.

For example a modbus register with a temperature value may read as 723 and a multiplier of 0.1 need

to be applied to get the correct value of 72.3 in the SCADA system,the formula is %s*0.1. If the data

type is a Float then the multiplier is not needed. This computation supports +, -, * and / operators.

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual

Fig. 27 Transport channel and formatting

Table 16 Data Query and report

Parameter Item Description

Communication channel Select the channel in the socket type. You can choose TCP/UDP or HTTP in socket A of each serial

port(socket1 or socket2), or MQTT you have added.

Data query Whether data query from remote server or cloud is enable.

Data set Whether data setting command from remote server or cloud is enable.

Query or set type You can choose Modbus RTU, Modbus TCP or JSON. Users can send the right format query command

from remote modbus master or MQTT publisher to the M100 gateway. The data is retrieved from the

device's cache of corresponding modbus instructions.

Query or set Topic Topic that used to query or set data from MQTT publisher.

Response Topic Topic that reply to the query or set data from MQTT publisher.

Data report The trigger of reporting data. Valid values:

On Change: The report is triggered if the collected data changes. You can use a tolerance to only log

the data point if the value changes more than X amount.

Interval: Collect the variable data at the poll interval and report the data at the specified report interval.

Timer: Collect the variable data at the poll interval and report the data at the regular time.

Report Topic Topic that used to report data to MQTT broker.

Failure padding Exception handling. Any data point did not get the response in response timeout will be filled with this

string as key value into the template.

Quotation mark Numeric values are quoted. It does not affect a string.

Json template The payload format. Users can custom which data points should report to the server.

3.1.7. IO settings
USR-M100 gateway can support a number of Digital Input (DI), Digital Output (DO-Relays ), Analog Input (AI) ports. There are a few

combinations of I/O extension board in develop. Because the I/O status of M100 is mainly displayed via Modbus protocol, the user has

Your Trustworthy Industrial IoT Partner 2 www.pusr.com


User Manual
to configure the Modbus settings if the user wants to use the Modbus protocol. Fig.29 shows the parameter that must be set for the

Modbus protocol that is the Modbus Slave ID.

Fig. 28 IO control

Fig. 29 IO function

Table 17 IO function

Parameter Item Description

Slave address This field allows the user to configure the Modbus identification (ID), The Modbus slave ID is set to the

default value of 100. It can be the integer number from 1 to 247.

Register The I/O status will be displayed at the starting address given in this field.

E.g. The DI status will be mapped to the address set here. The default starting address is 1 which will

be mapped to DI channel number 0. The successive DI channels will have the incremental Modbus

address based on this starting address, i.e. DI1 will have the Modbus address of 2.

Timer1-6 Currently, two actions are supported: device restart and DO control

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
Restart Hold Whether the DO output status remains after the restart

DO action configuration No action,default value.

Hold: keep the triggering status in the specified time, and back to the previous status, single trigger

Flip: keep the triggering status in the specified time and then flip, periodic trigger

DI filter time This field is the interval that the system will check for the DI status. The default value is 10 milliseconds

(ms).

3.1.8. Cloud service


Please refer to “USR-M100 Quick Start Guide with AWS IoT” for detail.

Please refer to “USR-M100 Quick Start Guide with PUSR cloud” for detail.

3.1.9. System setup


 System setting

This system setting tab includes several system level settings, such as device name, websocket, system log, user name and password.

Most of these settings are optional.

Fig. 30 System settings

Table 18 System settings list

Parameter Item Description

Host name The name of the device, up to 32 characters,can’t be null

Websocket port Websocket server listen port NO. Range 1-65535

Websocket direction Click the drop-down menu to select websocket mapping direction: UART or Log.

Webserver port Web server listen port NO. Range 1-65535

User name The user name of web console and can be modified. up to 16 characters,can’t be NULL

Password The password of web console and can be modified. up to 16 characters,can’t be NULL

UART cache Click the option to enable serial buffer. By default, USR-M100 will empty its serial buffer when a new TCP

connection is established. This means that the TCP application will not receive buffered serial data during

a TCP link breakage. To keep the serial data when there is no TCP connection and send out the buffered

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
serial data immediately after a TCP connection is established, you can disable this option.

Restarting without data This function is used for the gateway without any data transmission or reception for a long time, and the

gateway automatically restarts. If the restart time is set between 0 and 59 seconds, this function does not

take effect. Only when the time is set to be greater than or equal to 60 seconds, the restart function of

the device without data will take effect.

The configuration will save to flash memory after clicking Save button. All configurations take effect after a system reboot.

 management

In management page users can perform some system operations on the M100 gateway, including restarting, restoring factory

configuration, and upgrading. It is recommended that users use it with caution. Improper operation may damage the gateway.

Fig. 31 Module management

A. Restart
This function is used to restart the gateway by software. Before the gateway is completely restarted, the device does not work and

cannot forward any data packets. This restart is different from the hardware reset of power-on restart, but the gateway system

software is reset, just like the "warm restart" of the windows operating system. Once a new setting is changed, you can use the Save

function to accept the changes. You will need to reset the device to save the settings to flash memory. Click on "restart" Button, the

page pops up a prompt box, click "OK".

B. Restore factory defaults


This function is used to restore the gateway to the factory settings and automatically restart the gateway at the same time. Before

the gateway restarts successfully, the device does not work and cannot forward any data packets. This function is to restore the

factory default configuration value once the user sets the wrong parameter and causes the gateway to work abnormally. Click the

"Restore factory defaults" button, and a prompt box will pop up on the page. Click "OK".

C. Firmware upgrade
USR IoT continually upgrades its firmware to add new features and optimize performance. Please contact the sales to obtain the

latest version of the firmware. Before upgrading the firmware, please make sure that the device has a reliable power source that will

not be powered off or restarted during the firmware upgrading process(please be patient as this whole process might take up to 1

-2 minutes).

Copy the new firmware file to your local computer. Note that the firmware file is a binary file with “.bin” extension. Before updating

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
the firmware, make sure that your host’s Network domain is as same as the gateway.

Next, click “Select the file” button as shown in Figure to find and choose the new firmware file. Then, click "Flashing the firmware"

button to start the firmware upgrade process. After the progress bar in the page is read, the software upgrade is completed. Please

wait until the uploading process is finished (the amount of time varies depending on the equipment used).

Finally, the device will then proceed to restart itself. In most cases, you might require to re-configure your device.

3.2. Configuration software

3.2.1. Discovering your gateway


After you start configuration software, if the USR-M100 gateway is already connected to the same gateway as your PC, the device can

be accessed via broadcast packets. Users can search all the USR-M100 gateways on the network and show them on the Deivce List

Area of the utility. Please select the right Ethernet adapter(Device menu) if you did not see any gateway.

Fig. 32 Searching

3.2.2. Network setting


Sometime the USR-M100 gateway might not be in the same subnet as your PC, therefore, you will have to use this utility to locate

it in your environment. To configure each device, first click to select the desired device (default IP:192.168.0.7) in the list of

configuration utility, and then change the IP address to avoid any IP address conflict with other hosts on your LAN, save your change.

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual

Fig. 33 Changing network settings

3.2.3. Reboot the device


This function is available to allow you to reset the gateway. The function disconnects both the ethernet and serial connections. The

function also allows the gateway to save new configuration settings to flash memory. To reset the device:

1. Right-click a desired device to display the settings menu.

2. Select Reboot.

Press the Reboot button and the system will give a reset response.

Fig. 34 Reboot the device

3.2.4. Restore to factory default settings


The configuration utility provides the function to restore the gateway to factory default settings. If you really want to restore the

gateway to factory default settings, please click restore factory button to continue. As shown in Fig.34.

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
3.2.5. Open web server
Users can visit the web server of the gateway conveniently with configuration tool. Select the device you want to visit and right

click,then click External web config ,you will open the web server with default browser such as Google Chrome. As shown in Fig.34.

4. Operation modes
The USR-M100 gateway provides various operations: TCP Server/ Client mode, UDP mode, HTTP mode and Websocket mode. The

main difference between the TCP and UDP protocols is that TCP guarantees delivery of data by requiring the recipient to send an

acknowledgement to the sender. UDP does not require this type of verification, making it possible to offer speedier delivery. UDP also

allows unicast or multicast of data to only one IP or groups of IP addresses. Detailed descriptions of each operation are provided in

following sections. After choosing the proper operation mode in this chapter, refer to Chapter 3 for detailed configuration

parameter definitions.

4.1. TCP Server


4.1.1. Properties

In TCP server mode, the TCP connection is initiated from the host to the USR-M100 gateway. This operation mode supports a

maximum of 16 simultaneous connections for each serial port on the gateway from a single or multiple hosts. After the connection

is established between the gateway and the remote host computer (remote TCP client) , data can be transmitted in both directions.

The serial port on the device will forward requests from all remote connected hosts(Ethernet) to the serial device immediately and

reply to all remote connected hosts once it receives data from the serial device.

The default operation mode of USR-M100 is the TCP Server mode. Fig.35 shows an example of configuration setting for TCP Server

working mode under the Uart1 socket tab. You can configure other serial ports in the same way.

Fig. 35 TCP server work mode


Please follow the following steps to configure connection settings of the work mode for Uart1 port.

1. Click on the “Uart1” tab on the menu frame on the left side of Web UI to go to Uart1 page as shown in Fig.35.

2. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

3. Click on the Socket tab in this page, select TCP Server in the working mode options. The local ports of different serial ports must

be different. After receiving network data, the device determines which serial port the data is sent to based on the local port. For

example, the default port number of the first serial port (Uart1) is 23, the default port number of the second serial port (Uart2) is 26,

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
and so on.

4. After finishing configuring the working Mode, please scroll down to the bottom of the page and click on "Save & Apply" button

to save all the changes that you have made. All configurations take effect after a system reboot.

Fig.36 shows an example of test in this mode. By selecting the TCP Server work mode, a TCP client program on a remote host

computer should be prepared to connect to USR-M100. Server IP is IP address of USR-M100, server port is local port of USR-M100.

In this case, IP address of USR-M100 is 172.16.14.73.

Fig. 36 Host initiating TCP connection

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
4.1.2. Multihost setting

Fig. 37 Maximum socket connection


Maximum connection is usually used when the user needs to receive data from different hosts simultaneously. The factory default

allows 8 connection at a time. This option specifies the maximum number of remote devices/clients (with maximum of 16 clients) that

can be connected to the serial device on this COM port. And users can define the behavior when the connection established exceed

the maximum.

Kick: when the connection exceeds the maximum number, actively kick out the oldest connection(first in first kick out).

Keep: when the connection exceeds the maximum number, keep the old connection and reject new connections.

4.2. TCP Client


4.2.1. Properties

When the working mode of this device is TCP Client, the remote device must work in TCP Server mode, and its IP address and port

number must be configured, which can be configured in the corresponding options of the network connection. The local port number

can be ignored and no configuration is required. USR-M100 supports SSL (TLS v1.0 or v1.2) data encryption in this operating mode.

Fig.38 shows an example of configuration setting for TCP Client working mode under the Uart1 socket page. You can configure other

serial ports in the same way. There are additional connection settings that can be configured as shown in Fig.38.

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual

Fig. 38 TCP client work mode


Please follow the following steps to configure connection settings of the work mode for Uart1 port.

1. Click on the “Uart1” tab on the menu frame on the left side of Web UI to go to Uart1 page as shown in Fig.38.

2. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

3. Click on the Socket tab in this page, select TCP Client in the working mode options. Please specify the Destination IP address and

port number of the TCP server program on the remote host. This should match the IP settings of the TCP server program. The default

local port number is 0, M100 will assign a random TCP Port.

4. After finishing configuring the working Mode, please scroll down to the bottom of the page and click on "Save & Apply" button

to save all the changes that you have made. All configurations take effect after a system reboot.

Fig.39 shows an example of test in this mode. By selecting the TCP Client operation mode, a TCP server program on a remote host

computer should be prepared to accept a connection request from the device. In this case,Host IP address is 172.16.14.15.

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
Fig. 39 M100 initiating TCP connection

4.2.2. SSL/TLS

If SSL certificate authentication is enabled on the remote server, user need to configure SSL encryption parameters on M100. User

can select TLS1.0 or TLS1.2 version protocol. User can select None certificate Authentication, server certificate authentication and

bidirectional certificate authentication.

Fig. 40 SSL/TLS encryption

4.2.3. Transient connection

This connection, called transitory due to its short-lived nature. If the serial port or network port receives none data within the setting

time, the connection will be automatically disconnected. The gateway used to send serial device data back to a control room or a

cloud application need to open a remote connection before they can transfer the serial data. When the transmission is completed,

the gateway should immediately close the connection. Without support for flexible connection control, you would need to spend extra

time handling connections at the central site or cloud application.

TCP transient connection is used primarily to save server resources. Fig.41 shows an example of configuration setting for transient

connection in TCP Client working mode under the socket page.

Your Trustworthy Industrial IoT Partner 3 www.pusr.com


User Manual
Fig. 41 Transient connection

4.3. UDP Server

4.3.1. Properties
User Datagram Protocol (UDP) is a faster and more efficient transport protocol than TCP but it is a connectionless transport protocol,

it does not guarantee the delivery of network datagram. In UDP mode, you can unicast or multicast data from the serial device to one

or multiple host computers, and the serial device can also receive data from one or multiple host computers. Please beware that even

though UDP provides better efficiency in terms of response time and resource usage, it does not guarantee data delivery. It is

recommended to utilize UDP only with cyclic polling protocols where each request is repeated and independent, such as Modbus

Protocol.

When the working mode of the device is UDP server, the remote device must also work in UDP mode. You only need to specify the

Local Port that USR-M100 should listen to. In UDP server mode, serial port data is always sent to the last peer UDP device(IP and port)

that communicates with the USR-M100, and the USR-M100 can record the IP and port number only after the peer UDP device sends

data to the USR-M100 first.

Fig.42 shows an example of configuration setting for UDP Server mode under the Uart1 socket page. You can configure other serial

ports in the same way.

Fig. 42 UDP server work mode


Please follow the following steps to configure connection settings of the operation mode for Uart1 port.

1. Click on the “Uart1” tab on the menu frame on the left side of Web UI to go to Uart1 page as shown in Fig.42.

2. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

3. Click on the Socket tab in this page, select UDP Server in the working mode options.

4. Local Port specifies the local port number for UDP server mode on M100 which it will be listening to and it can be any number

between 1 and 65535. The local ports of different serial ports must be different. After receiving network data, the device determines

which serial port the data is sent to based on the local port.

5. After finishing configuring the working Mode, please scroll down to the bottom of the page and click on "Save & Apply" button

to save all the changes that you have made. All configurations take effect after a system reboot.

Serial port data is firstly sent to the preset destination IP/domain name and Destination port. After receiving a UDP packet, the system

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual
updates the destination IP address and port number, and sends the data back to the latest IP address and port number. In this case,

IP address of USR-M100 is 172.16.14.73, host IP address is 172.16.14.15.

Fig. 43 UDP transmission test

4.4. UDP Client

4.4.1. Properties
When the working mode of the device is UDP client, the remote device must also work in UDP mode. M100 supports remote IP

address and port verification. After verification is enabled(OFF), the M100 only communicates with the destination port of the

destination IP address. If the data is not from this channel, the M100 will discard the data. If verification is disabled(ON), M100 does

not filter the data of the destination IP address and destination port. Fig.44 shows an example of configuration setting for UDP Client

mode under the Uart1 socket page. You can configure other serial ports in the same way.

Fig. 44 UDP client work mode

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual
Please follow the following steps to configure connection settings of the UDP client mode for Uart1 port.

1. Click on the “Uart1” tab on the menu frame on the left side of Web UI to go to Uart1 page as shown in Fig.44.

2. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

3. Click on the Socket tab in this page, select UDP Client in the working mode options.

4. Please specify the Destination IP address and port number of the UDP program on the remote host. Local Port specifies the local

port number which socket A will be listening to and it can be any number between 1 and 65535. The local ports of different serial

ports must be different. After receiving network data, the device determines which serial port the data is sent to based on the local

port. Note that typically the port number that is larger than 1024 is recommended to avoid conflicting with the well-known port

numbers. You should match this setting with the remote UDP program. Note that this number is usually called destination port in the

remote UDP program.

5. After finishing configuring the working Mode, please scroll down to the bottom of the page and click on "Save & Apply" button

to save all the changes that you have made. All configurations take effect after a system reboot.

Fig.45 shows an example of test in this mode. In this case, IP address of USR-M100 is 172.16.14.73, host IP address is 172.16.14.15.

Fig. 45 UDP client test

4.4.2. UDP multicast


UDP also allows multicasting of data to groups of IP addresses. A multicast is a packet sent by one host to multiple hosts. In multicast

mode, each host that belongs to a specific multicast group will receive multicast packets for that group. For a host to be configured

as a multicast receiver over the Internet, the must inform the routers on its LAN. The Internet Group Management Protocol (IGMP)

is used to communicate group membership information between hosts and routers on a LAN. The USR-M100 Series supports IGMP

version 2.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 46 USR-M100 #1 UDP multicast setting

Fig. 47 USR-M100 #2 UDP multicast setting


Fig.48 shows an example of test in this mode with two M100s.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 48 UDP multicast transmission test

4.5. HTTP Client

4.5.1. Properties
When the operation mode of this device is Httpd Client, users need to specify the remote httpd server's address, port, method and

other parameters. The device will submit the serially received data to the httpd server in the form of GET or POST. At the same time,

the data sent by the httpd server can be transparently transmitted to the serial port.

Fig.49 shows an example of configuration setting for HTTP Client working mode under the Uart1 socket page. You can configure

other serial ports in the same way.

Fig. 49 HTTP client mode


Please follow the following steps to configure connection settings of the work mode for Uart1 port.

1. Click on the “Uart1” tab on the menu frame on the left side of Web UI to go to Uart1 page as shown in Fig.49.

2. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

3. Click on the Socket tab in this page, select Httpd Client in the working mode options.

4. The HTTPD method needs to fill in the correct URL path, and select the GET or POST method as needed.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual
5. Fill in the HTTPD request header as needed.

6. Fill in the HTTPD address, that is, the address of the HTTP server, which can be an IP address or a domain name (the ability to

connect to foreign countries is required).

7. Fill in the HTTPD port number. The default local port number is 0, M100 will assign a random TCP Port.

8. After finishing configuring the working Mode, please scroll down to the bottom of the page and click on "Save & Apply" button

to save all the changes that you have made. All configurations take effect after a system reboot.

4.5.2. HTTPS
If SSL certificate authentication is enabled on the remote server, user need to configure SSL encryption parameters on M100. User

can select TLS1.0 or TLS1.2 version protocol. User can select None certificate Authentication, server certificate authentication and

bidirectional certificate authentication.

Fig. 50 SSL/TLS encryption

4.6. Websocket server


When the operation mode of this device is WebSocket server, the user needs to specify the main parameters such as listening port,

forwarding direction. This function is that the gateway acts as a WebSocket server, and transparently transmits the data received by

the serial to the WebSocket client in hexadecimal format. The WebSocket server can also forward data to the serial device at any time.

This operation mode supports a maximum of 16 simultaneous connections for any serial port on the gateway from a single or multiple

hosts.

1. Click on the “system setting” tab on the menu frame on the left side of Web UI to go to system setting page as shown in Fig.51.

2. Fill in the WebSocket server listening port number,default 6432.

3. Select UART1 in websocket direction.

4. For Serial Settings on the Port configuration page, please go to Section 3.1.3.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 51 Websocket server setting


5. Click on the websocket to serial tab,browser will connect to the websocket server of M100 automatically.

Fig. 52 Browser as websocket client to connect M100


Fig.53 shows an example of test in this mode.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 53 Data transmission test

5. Virtual COM port


Traditional SCADA and data collection systems rely on serial ports (RS-232/485) to collect data from various kinds of instruments.

Virtual COM ports on host computer allows remote access of serial devices over TCP/IP network that works like local native COM

ports. Since USR-M100 gateway enable network operation of instruments equipped with an RS-232/485 communication port, your

SCADA and data collection system will be able to access all instruments connected to a standard TCP/IP network, regardless of

whether the instruments are used locally or at a remote site.

To enable Virtual COM on host computer, you will require a VCOM software to emulate the COM port. For Windows operating system,

a software utility called VCOM is supported by PUSR to be used for this purpose.

This function is useful with devices such POS terminals, Bar Code Readers, Serial printers, etc. since it allows you to use software that

was written for pure serial communication applications.

Download the software from PUSR’s website:

https://www.pusr.com/support/downloads/VCOM_Setup_exe.html

Execute the VCOM program, click quick-install to install program files in the default directory, or select an alternative location. The

Installing window reports the progress of the installation.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 54 Install wizard 1

Fig. 55 Install wizard 2


Once the installation of the package is finished a start screen displays. Click start to conclude the process and launch the VCOM

software.

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 56 VCOM overview

5.1. TCP Server Application with Virtual COM


Virtual COM on host computer allows remote access of serial devices over TCP/IP networks through Serial/IP Virtual COM

ports that work like local native COM ports. This section will provide the procedure to enable Virtual COM (VCOM) on Windows based

PC. Please follow the steps described here to configure your Virtual COM application.

1. If the gateway is running in TCP Server Mode (recommended), the VCOM utility on the host computer should be configured as

the TCP client connecting to the gateway. The characteristic of this mode is that the IP address of the host can be changed (usually

automatically assigned by the router), and the IP address of the gateway must be fixed.

Fig. 57 TCP server mode in USR-M100

Your Trustworthy Industrial IoT Partner 4 www.pusr.com


User Manual

Fig. 58 New Virtual COM connection


2. Select one COM port as the Virtual COM port before proceeding as shown in Fig.59. Note that if a COM port number is used by

other application or your operating system, you can not select it.

Fig. 59 Select one COM port


3. After selecting the virtual COM ports, please enter the IP Address of the gateway with the specified Port Number. The Port

Number here is the Local Listening Port for the gateway which is specified in the Local Port field of Fig.60. In this case, IP address

of USR-M100 is 172.16.14.12.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 60 Virtual COM port mapping


4. Click new to add the Virtual COM11. Click client COM11 on the left side of VCOM panel to check the status. If status become

connected, the process is completed.

Fig. 61 Virtual COM11 status

5.2. TCP Client Application with Virtual COM


1. If the gateway is running in TCP Client Mode, the VCOM utility on the host computer should be configured as the TCP server

waiting for a gateway to connect to the host computer. The feature of this mode is that the IP address of the computer cannot be

changed, but the IP address of the gateway can be changed (which can be automatically assigned by the router).

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 62 TCP client mode in USR-M100

Fig. 63 New Virtual COM connection


2. Select one COM port as the Virtual COM port before proceeding as shown in Fig.64. Note that if a COM port number is used by

other application or your operating system, you can not select it.

3. After selecting the virtual COM ports, please enter the specified Port Number. This Port Number is the Destination Port of the

gateway.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 64 Virtual COM port mapping


4. Click new to add the Virtual COM12. Click client COM12 on the left side of VCOM panel to check the status. If status become

connected, the process is completed.

Fig. 65 Virtual COM12 status

5.3. Enable RFC2217 through Virtual COM


Enabling this function allows users to use customized RFC2217 commands on the network to dynamically modify the serial port's

baud rate, data bits, stop bits, and parity bits. This function is only allowed when the working mode is TCP Server and TCP Client. Note

that this protocol is used to change the serial port parameters of USR-M100. In this case, IP address of USR-M100 is 172.16.14.34.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 66 RFC2217 enabled

Fig. 67 enable RFC2217 in VCOM


When we change serial parameters in Virtual COM port 1, we can see these parameters have took effect in serial port of USR-M100.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 68 Synchronizing serial port parameters

5.3.1. PUSR customized RFC2217 protocol

Table 19 Com Port Control commands

Name Header Baud rate Serial parameter definition Sum check

Length(bytes) 3 3 1 1

Big endian, Data bits/stop bits/parity Check sum of 4 bytes of

e.g. bits setting. baud rate and serial


Description Fixed
600(00 02 AS shown in the table 20 parameter definition, retain

58) below the least significant byte

115200,N,8,1 55 AA 55 01 C2 00 03 C6

9600, N,8,1 55 AA 55 00 25 80 03 A8

Table 20 Serial parameter definition

Bit Position Function Value Description

1:0 Data bits 10 7 Data bits

11 8 Data bits

2 Stop bits 0 1 Stop bits

1 2 Stop bits

3 Parity bit enable 0 disable the parity bit

1 Enable the parity bit

5:4 Parity bit type 00 ODD

01 EVEN

10 Mark

11 Space

7:6 undefinition 00 Please write 0

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual
6. Modbus TCP/RTU gateway
Modbus is one of the most popular automation protocols in the world, supporting traditional RS-232/485 devices and recently

developed Ethernet devices. Many industrial devices, such as PLCs, DCSs, HMIs, instruments, and meters, use Modbus as their

communication standard. In industrial applications, the most common protocol conversion is Modbus RTU to Modbus TCP conversion,

and it is usually required when legacy devices such as meters, mostly using Modbus RTU, need to be integrated with SCADA systems,

mostly using Modbus TCP.

Most modern PLCs and host computers support Modbus TCP over Ethernet. In order to access discrete Modbus RTU devices for data

collection and control, they can rely on the M100 Modbus gateway.

6.1. Ethernet masters with serial slaves


When the host computer or PLC is Modbus TCP Master, the Modbus TCP function must be enabled, the remote device must work

in Modbus RTU Slave mode. The M100(TCP Server mode) supports Modbus TCP with up to 16 simultaneous connections. The serial

interface supports both RS-232 and RS-485, selectable through software. Each serial port can be connected to one RS-232 serial

device, or to 32 RS-485 serial devices. When connected with more than one RS485 devices,please refer to section 7.5 for bus

collision detection.

Fig. 69 Ethernet masters with multiple serial slaves


The device supports multiple hosts to query data from the slave in Q&A mode. Please select modbus polling function as shown in

Fig.70. When USR-M100 gateway does not receive a response from the serial port after a response timeout, the device replies with

an acknowledgement and then processes the next host request.

When you need to use long frame data frequently or have high data transmission requirements, please adjust the baud rate and

lengthen the sending interval appropriately to prevent the slow serial port from causing messy codes or packet loss.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 70 Modbus TCP master settings


Open the Modbus Poll and Modbus Slave software, go to "Connect" -> "Connect", and the connection parameters are configured as

follows, in this case, IP address of USR-M100 is 172.16.14.12.

Fig. 71 Modbus emulator settings(Ethernet master and serial slave)

6.2. Serial master with Ethernet slave


Many HMI (Human Machine Interface) systems use a serial interface to connect to a discrete DCS (Data Control System). However,

many DCSs are now Ethernet-based and operate as a Modbus TCP server device. The M100 Modbus gateway can link a serial-based

HMI to distributed DCSs over an Ethernet network.

When the host computer or HMI is Modbus RTU Master, if the remote device work in Modbus TCP Slave mode, the ModbusTCP

function must be enabled. The M100(TCP Client mode) supports only one Modbus TCP slave.

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 72 Serial master with one Ethernet slave

Fig. 73 Modbus TCP slave settings


Open the Modbus Poll and Modbus Slave software, go to "Connect" -> "Connect", and the connection parameters are configured as

follows, in this case, IP address of USR-M100 is 172.16.14.12, host IP address is 172.16.14.15.

Fig. 74 Modbus emulator settings(serial master and Ethernet slave)

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual
6.3. Serial master with serial slaves
When the HMI is Modbus RTU Master, all M100 must enable or disable ModbusTCP function at the same time, the remote device

must work in Modbus RTU Slave mode. The M100 supports up to 16 simultaneous TCP connections.

Fig. 75 Serial master with multiple serial slaves


If there are more than one serial masters in RS485 network, users should select modbus poll function and configure response timeout

in Fig.76. please refer to section 7.5 for bus collision detection.

Fig. 76 Modbus RTU master settings

Your Trustworthy Industrial IoT Partner 5 www.pusr.com


User Manual

Fig. 77 Modbus RTU slave settings

Fig. 78 Modbus emulator settings(serial master and serial slave)

6.4. Serial master via virtual COM with serial slaves


When the host computer is Modbus RTU master, if we use VCOM, the Modbus TCP function must be disabled, the remote device

must work in Modbus RTU Slave mode.

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 79 New virtual COM port mapping

Fig. 80 Mapping a virtual COM port

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 81 Virtual COM port mapping details

Fig. 82 Serial device settings

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual
Fig. 83 Modbus emulator settings(serial master and serial slave)

6.5. Modbus poll with serial heartbeat packet


When the M100 is Modbus RTU Master, the serial device work in Modbus RTU Slave mode, the ModbusTCP function must be disabled.

M100 works in TCP server mode, it supports up to 16 TCP connections.

Fig. 84 Modbus RTU master Settings

Fig. 85 Serial heartbeat packet as modbus command

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 86 Modbus response transparently transmission

7. Advanced features

7.1. Packing mechanism


Serial to Network Packet Delimiter: Packet delimiter is a way of packing data in the serial communication. It is designed to keep

packets intact. USR-M100 provides two types of delimiter: Time Delimiter, Maximum Bytes Delimiter. Note that the following

delimiters (time, length) when they are selected are programmed in the OR logic. Meaning that if any of the two conditions were met,

the device would transmit the serial data in its buffer over the network.

Fig. 87 Data packing mechanism


Packet time: USR-M100 will transmit the serial data in its buffer when the specified time interval has reached and no more serial data

comes in. The default value is calculated automatically based on the baud rate. If the automatic value results in chopped data, the

timeout could be increased manually by specifying a larger value in the text box above. Note that the maximum interval is 255

milliseconds. This option is disabled by default.

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual
The optimal “Interval timeout” depends on the application, but it must be at least larger than one-character interval within the

specified baud rate. For example, assuming that the serial port is set to 1200 bps, 8 data bits, 1 stop bit, and no parity. In this case,

the total number of bits needed to send a character is 10 bits (included 1 start bit), and the time required to transfer one character

is (10 (bits)/1200 (bits/s))*1000 (ms/s) = 8.3 ms. Therefore, you should set the “Interval timeout” to be larger than 8.3 ms. Rounding

8.3 ms

to the next integer would give you 9 ms. Which can be set as your interval timeout.

Packet length: USR-M100 will transmit the serial data in its buffer when the specified length in the unit of bytes has reached. If you

would like USR-M100 to queue the data until it reaches a specific length,the data length can be configured for 1 to 1460 bytes. If the

data length (in bytes) matches the configured value, the data will be forced out. Set to 0 if you do not need to limit the length.

7.2. Heartbeat packet


Network heartbeat packet: The M100 gateway sends a heartbeat packet regularly to notify the server that it is active and maintains

a normal network connection with the server. This function is only allowed when the working mode is UDP and TCP Client.

Serial heartbeat packet: The M100 gateway notifies the serial device it is active via packet, and this packet can also be used to actively

capture sensor data.

Heartbeat packet only works in no data traffic in the setting direction. There are no data coming from serial port or internet in

heartbeat interval.

Fig. 88 Serial heartbeat packets

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 89 Network heartbeat packets

7.3. Registration packet


This function is only allowed when the working mode is UDP and TCP Client. The content of the registration packet can be up to 40

bytes long. Users can choose to display this content in hexadecimal format or ASCII format.

Once connected: The registration packet is only sent once when the network connection is established;

Prefix of DATA: The registration packet is filled in front of the serial port data every time the serial port sends data to the network;

Fig. 90 Registration packet type

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 91 Registration packet method

7.4. Socket B
Socket B supports TCP Client and UDP Client. Socket B and Socket A share the registration packet and heartbeat packet. When

Socket B initiates a connection, it uses a random local port number to connect to the target server.

Fig. 92 Socket B operating mode

7.5. Rs485 bus detection


If RS485 bus is in the receiving state, M100 can not output data to serial port to achieve the 485 bus anti-conflict function.

Idle time: the interval time when M100 is allowed to send data to RS485 bus after the receiver is idle. The value ranges from 0 to

65535 (ms). Default value: 10. This parameter is mandatory.

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 93 RS485 bus detection

7.6. Serial Printer setting


USR-M100 gateways transform any serial device into an Ethernet-capable device that can be used in a network. These gateways

allow serial devices such as a printer, control mechanisms or control systems to be used in a network without relying on the serial

port of a computer for connectivity. This way, any serial device can be connected to the network and the internet and accessed from

anywhere. Sharing a printer among coworkers in the same physical office can be implemented with a gateway that does not need

to offer security or authorization capabilities.

The M100 gateway, features a Serial Printer option which functions in similar fashion to the Serial Printer option in the (COM) Ports

dialog box. This option allows the associated TCP port to be identified as a serial printer connection. The connection does not

consume a user license, is restricted to output only, and filters out the end-of-document marker correctly. In this case, IP address of

USR-M100 is 172.16.14.12.

Fig. 94 Serial printer option

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 95 Serial printer setting wizard 1

Fig. 96 Serial printer setting wizard 1

Your Trustworthy Industrial IoT Partner 6 www.pusr.com


User Manual

Fig. 97 Serial printer setting wizard 1

Fig. 98 Serial printer setting wizard 1

7.7. NTP
If M100 is connected to the internet or to a local NTP server, the Date/time can be set automatically by enable NTP function. If this

option is chosen, the default value “cn.ntp.org.cn” should be shown in the NTP server field. User can select a proper Time Zone from

the dropdown box. If the M100 device is connected to the Internet and should get NTP server over the Internet, you will need to

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual
configure the DNS server in order to be able to resolve the host name of the NTP server.

Fig. 99 NTP settings

7.8. SNMP
The Simple Network Management Protocol (SNMP) is used by network management software to monitor devices in a network,

to retrieve network status information of the devices, and to configure network parameters of the devices.

To make the device’s information available for public viewing/editing, you can enable the SNMP function by checking the Enable box.

The supported SNMP Version:v1/v2c.The default SNMP Community Strings (or passphrases) is “admin”.

Fig. 100 Enable SNMP agent

Table 21 PUSR OID list


Item OID

IP address .1.3.6.1.2.1.4.20.1.1.172.16.14.12

Subnet mask .1.3.6.1.2.1.4.20.1.3.172.16.14.12

Gateway .1.3.6.1.2.1.4.21.1.1.172.16.14.12

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual
Firmware version .1.3.6.1.2.1.12.1.0

Hardware version .1.3.6.1.2.1.12.2.0

RAM usage .1.3.6.1.2.1.12.3.0

CPU usage .1.3.6.1.2.1.12.4.0

Preferred DNS .1.3.6.1.2.1.12.5.0

Alternate DNS .1.3.6.1.2.1.12.6.0

Fig. 101 SNMP test

8. MQTT gateway
Although the MQTT protocol has been around for nearly three decades, the design of the protocol makes it ideal for IIoT (Industrial

Internet of Things) applications, the latest trend in automation engineering. This is particularly true for applications that stress “active

notification,” in which devices provide data only when needed, as opposed to “passive notification,” in which devices are polled at

regular intervals. MQTT’s broker/client design eliminates the need for all devices in the system to be online at the same time. The

clients (i.e., “devices” or “things”) communicate directly with the broker, which plays the role of middleman to pass messages back

and forth between clients.

8.1. Basic settings


When configuring the Broker information,Client ID, Host, and Port are already filled in by default. You can also modify it by yourself

based on the actual Broker information. We will use Free Public MQTT Server provided by EMQX Cloud as the MQTT server address

for quick testing. You can configure KeepAlive, Clean Session, Auto Reconnect, MQTT Version, etc.

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 102 MQTT broker setting


If your broker has enabled user authentication, you can fill in the information of Username and Password in the configuration item.

Fig. 103 User credential


When you need to enable SSL/TLS authentication, you need to set the SSL/TLS configuration item. The two versions,TLS 1.0

and TLS 1.2 are provided. If SSL/TLS is selected, certificate configuration can be performed. If it is a one-way connection, you only

need to select your CA File. If it is a two-way authentication, you also need to select to configure Client Certificate File and Client key

file. Click the choose file button on the far right to select the certificates you have generated.

 Uploads a Certificate Authority (CA) file. A Certificate Authority (CA) is an entity that issues digital certificates. A digital certificate

certifies the ownership of a public key by the named subject of the certificate.

 Uploads a client certificate (cert) file. A certificate file is a type of digital certificate that is used by client systems to make

authenticated requests to a remote server.

 Uploads a private key file.

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 104 SSL/TLS connection


You can configure the Will Message. The values of Last-Will-QoS and Last-Will-Retain are filled with 0 and False by default. When

you enter the values of Last-Will-Topic and Last-Will-Payload, you can complete the configuration of Will Message.

Fig. 105 Last will message


After finishing configuring the basic settings, please scroll down to the bottom of the page and click on "Save & Apply" button to save

all the changes that you have made. All configurations take effect after a system reboot. In this case we only finish the follow

parameters setting.

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 106 EMQX broker connection


To view the status of the device, choose Status>Overview, the device is in the CONNECTED state, the connection to IoT Hub is

successful, and publishing and subscribing operations can be performed.

Fig. 107 MQTT connection status

8.2. Publishing a message

8.2.1. MQTT.fx tool introduction


MQTT.fx is a mainstream MQTT desktop client. Compatible with Windows, macOS, and Linux, it can quickly verify whether it is

possible to connect to IoT Hub and publish or subscribe to messages. MQTT.fx in this article refers to version 1.7.1 without special

instructions.

The main page is shown in the figure below. The top part is the MQTT Broker connection address bar and its connection

configuration. The following function Tabs include Publish column, Subscribe column, Scripts column, Broker Status column, Log

column for log information control.

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 108 MQTT.fx main page


First, the MQTT client and Broker need to establish a connection to communicate. Click the configuration icon on the right side of

the input box in the connection address bar to enter the specific connection configuration. Select the Profile Type as MQTT Broker.

Fill in broker.emqx.io for Broker Address and 1883 for Broker Port, as shown in the figure below:

Fig. 109 Connection Profiles


Click OK to confirm the configuration, return to the main interface, and click Connect. It can be seen that the indicator on the right

side turns to green, indicating that the current connection is successful, as shown in the following figure:

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 110 Successful connection

8.2.2. Transparent transmission


In the Publish field, select Publish topic1, enter the topic, bind to the Port1, select Qos 0, uncheck retained message. We use the

/PubTopic1 as an example to describe the process. After finishing configuring the Publish topic1, please scroll down to the bottom of

the page and click on "Save & Apply" button to save all the changes that you have made. All configurations take effect after a system

reboot.

Fig. 111 Add Publish topic


On MQTT.fx interface, click to enter the Subscribe Tab to enter /PubTopic1 in the topic box. Then, select a QoS level, click the

Subscribe button, and the list of subscribed topics will appear on the left. The current number of subscribed topics is 0, as shown

in the following figure:

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 112 Subscribe to the M100 topic


Launch serial debug assistant on PC, and open COM Port with the M100’s serial default settings as below:

Fig. 113 Serial debug assistant setting


Click send button. On the MQTT.fx page, you will receive a message from the cloud that was sent from the M100. For Payload

decoded by select “JSON Pretty Format Decoder” to show the message.

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 114 Receive message from M100

8.2.3. Topic distribution


In the Publish field, select Publish topic2, enter the topic, topic alias, bind to the Port1, select Qos 0, uncheck retained message. We

use the /PubTopic2 as an example to describe the process. After finishing configuring the Publish topic2, please scroll down to the

bottom of the page and click on "Save & Apply" button to save all the changes that you have made. All configurations take effect after

a system reboot.

Fig. 115 Topic distribution mode


On the MQTT.fx interface, click to enter the Subscribe Tab to enter /PubTopic2 in the topic box. Then, select a QoS level, click the

Subscribe button, and the list of subscribed topics will appear on the left. The current number of subscribed topics is 0, as shown

in the following figure:

Your Trustworthy Industrial IoT Partner 7 www.pusr.com


User Manual

Fig. 116 Subscribe to the M100 topic


Launch serial debug assistant on PC, and open COM Port with the M100’s serial default settings as below:

Fig. 117 Serial debug assistant setting


Enter the correct serial data format: topic alias,payload-test,{"message":"hello from M100"}, Click send button. On the MQTT.fx page,

you will receive a message from the cloud that was sent from the M100.

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 118 Receive message from M100

8.2.4. Custom mode


In the Publish field, select Custom mode, bind to the Port1. Click on "Save & Apply" button to save all the changes that you have made.

All configurations take effect after a system reboot.

Fig. 119 Custom mode


On the MQTT.fx, click to enter the Subscribe Tab to enter /PubTopic3 in the topic box. Then, select a QoS level, click the Subscribe

button, and the list of subscribed topics will appear on the left. The current number of subscribed topics is 0, as shown in the

following figure:

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 120 Subscribe to the M100 topic


Launch serial debug assistant on PC, and open COM Port with the M100’s serial default settings as below:

Fig. 121 Serial debug assistant setting


Enter the correct serial data format: topic,Qos,Retain,payload-/PubTopic3,0,ON,{"message":"hello from M100"}, Click send button. On

the MQTT.fx page, you will receive a message from the cloud that was sent from the M100.

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 122 Receive message from M100

8.3. Subscribe to a topic


In the Subscribe field, select Subscribe topic1, enter the topic, bind to the Port1, select Qos 0. We use the /SubTopic1 as an example

to describe the process. After finishing configuring the Subscribe topic1, please scroll down to the bottom of the page and click on

"Save & Apply" button to save all the changes that you have made. All configurations take effect after a system reboot.

Fig. 123 Add subscribe topic


On MQTT.fx interface, click to enter the Publish Tab to enter /SubTopic1 in the topic box, and enter the message of "hello world" in

the message input box, select a QoS level, and click Publish to publish the message, as shown in the following figure:

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 124 Publish message to M100


Click Publish to send the messages and return to the serial debug assistant. We can find that the serial port has received the message,

as shown in the following figure:

Fig. 125 Receive message from cloud

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual
9. Edge computing
The USR-M100 supports Modbus RTU Master for retrieving field site data from serial meters. After collecting data, users can convert

serial data to MQTT json format data, allowing users to get field site data. This two-in-one design reduces system complexity and the

amount of space required in the network topology, as well as overall installation time. In addition, you can extend the useful life of

legacy devices by connecting them to Ethernet and accessing the devices using a preferred protocol,TCP/UDP , HTTP , MQTT.

First,users need to enable edge computing function.

Fig. 126 Enable edge computing

9.1. Add modbus slave device


Connect serial device to the serial port of USR-M100 gateway, and then configure the slave parameter on the data acquisition tab.

Click add slave to add a device, click edit to configure the device.

Fig. 127 Add a slave device

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 128 Polling slave device configuration


In the slave property, enter the device name, bind to the Port1, enter the slave address and polling interval, enable merge collection

function, the description of the configuration parameters on this interface is shown in table 14. We use the temperature and humidity

THsensor as an example to describe the process. After finishing configuring the slave device, please scroll down to the bottom of the

page and click on "Save" button to save all the changes that you have made. All configurations take effect after a system reboot.

9.2. Add modbus data points

9.2.1. Register type and offset

Table 22 Typical Register Tables

Register type Address range Description

Coil points 00001 – 09999 Read, function code 0x1,0x5,0xF, bool values

Discrete inputs 10001 – 19999 Read only, function code 0x2, bool values

Input registers 30001 – 39999 Read only, function code 0x4, int,uint,float values

Holding registers 40001 – 49999 Read/Write, function code 0x3,0x6,0x10,int,uint,float values

The Modbus register addressing starts with register 0, but some device manufacturers start with the number 1 in the device

documentation. In this case, the number minus 1 should give the correct register address. Offsets can be represented in different

ways. Sometimes as Hex values and sometime the offset will also contain the register type. For example Offsets in the Holding

Register range might start with a 4 such as 411001, in the SCADA this would be entered as 11001.

9.2.2. Raw data types and byte order


A standard Modbus Holding Register or Input Register is a 16 bit (2 Byte) value. Often this is not enough so different equipment will

utilize multiple modbus registers to hold a larger value. Here is a list of Data Types supported in the M100 gateway.

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual
Table 23 Data types

Type Function code Objects count Note

Bool 1-2 1+ Bool

int8 3-4 1+ Integer 8 bit

uint8 3-4 1+ Unsigned integer 8 bit

int16 3-4 1 Integer 16 bit. Big-endian.high byte first

uint16 3-4 1 Unsigned integer 16 bit. Big-endian.

int32(ABCD) 3-4 2 Integer 32 bit. Big-endian.

int32(CDAB) 3-4 2 Integer 32 bit. Little-Endian byte swap

uint32(ABCD) 3-4 2 Unsigned integer 32 bit. Big-endian.

uint32(CDAB) 3-4 2 Unsigned integer 32 bit. Little-Endian byte swap.

float32(ABCD) 3-4 2 Float 32 bit. Big-endian.

float32(CDAB) 3-4 2 Float 32 bit. Little-Endian byte swap.

float64 3-4 4 Float 64 bit.

Note that these could be referred to in different ways. for example a 4 Byte Signed Integer might be referred to as a 32 bit Integer

in equipment documentation. For binary values we also need to know what “bit” of the register to look at for the binary value. For

this reason a single 16 bit modbus register could represent up to 16 individual binary data points. Sometimes the Data Type is inferred

by listing the number of registers. For example 2 registers might mean a 4 byte value.

9.2.3. Data points configuration


First select the slave device, click add nodes to add a data point, click edit to configure the data point, click delete to delete a data

point.

Fig. 129 Add modbus data point

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 130 Data point configuration


In the data point property, enter the node name, select modbus function code, enter the register address and response timeout,

select the right data type, input the calculation formula, the description of the configuration parameters on this interface is shown in

table 15. We use the temperature and humidity data points as an example to describe the process. After finishing configuring the data

points, please scroll down to the bottom of the page and click on "Save" button to save all the changes that you have made. All

configurations take effect after a system reboot.

Fig. 131 Sensor register reading


After the correct slave and data points configuration, the modbus polling command will print on the corresponding serial port

regularly, as shown in Fig.132.

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 132 Modbus polling command

9.3. Export and import configuration


There are three main reasons for using the Import and Export functions.

 Applying the same configuration to multiple units. The Import/Export configuration function is a convenient way to apply the

same settings to units located in different sites. You can export the configuration as a file and then import the configuration file

onto other units at any time.

 Backing up configurations for system recovery. The export function allows you to export configuration files that can be imported

onto other gateways to restore malfunctioning systems within minutes.

 Troubleshooting. Exported configuration files can help administrators to identify system problems that provide useful

information for Technical Service Team when maintenance visits are requested.

The export function saves all the configuration settings and parameters of the data acquisition in a *.csv file. To begin, click the Export

button.

Your Trustworthy Industrial IoT Partner 8 www.pusr.com


User Manual

Fig. 133 Export the configuration file

Fig. 134 Configuration file


Once the file is saved, it can be imported into your target unit to duplicate the same settings. Select the target unit first and click the

choose file button to import. Select the file you want to import, and then click the open button. The data points setting will display

on the webpage. After finishing importing the configuration file, please scroll down to the bottom of the page and click on "Save"

button to save all the changes that you have made. All configurations take effect after a system reboot.

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 135 Import the configuration file

9.4. Data report

9.4.1. Communication channel


Users can select TCP/UDP/HTTP in socketA of each serial port, MQTT Gateway, or AWS IOT service as the communication channel.

When select MQTT or AWS IOT channel, user need configure the MQTT broker parameters in MQTT Gateway tab or Cloud service

tab at first, and setting the report topic in the Fig.137.

Fig. 136 Communication channel select

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 137 MQTT data report setting

9.4.2. Report method


There are three ways to report the data acquired to the communication channel: on change, interval, timer. The description of the

configuration parameters on this interface is shown in table 16. After finishing parameter setting, please click on "Save" button to

save all the changes that you have made. All configurations take effect after a system reboot.

Fig. 138 Report on change

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 139 Interval and timer report

9.4.3. Payload-Json template


A JSON object contains zero, one, or more key-value pairs, also called properties. The object is surrounded by curly braces {}. Every

key-value pair is separated by a comma. The order of the key-value pair is irrelevant.

A JSON array contains zero, one, or more ordered elements, separated by a comma. The JSON array is surrounded by square

brackets [ ].

A key-value pair consists of a key and a value, separated by a colon (:). The key is a string, which identifies the key-value pair. The

value can be any of the following data types: string(surrounded by quotation marks (" ")),number,float,array(JSON array),object(JSON

object (can be nested)),boolean(true or false),empty.

Example 1

"THsensor1": {

"temperature": "temperature",

"humidity": "humidity"

},

"LUXsensor1": {

"illumination": "illumination"

},

"time": "sys_net_time"

Example 2

"service":[{

"sensor1": {

"temperature": "temperature1",

"humidity": "humidity1",

"user_define": "bedroom"

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual
},

"sensor2": {

"temperature": "temperature2",

"humidity": "humidity2",

"user_define": "living room"

},

"event_time": "sys_net_time"

}],

"device_id":"sys_mac"

We can use a tool to compact it. Below is a free online tool: https://jsonformatter.org/. Paste the message in the column on the left

and then, click Minify JSON. It will show a compact JSON format message in the column on the right. Click Copy to Clipboard.

Fig. 140 Json formatter


Paste the message in the Json template on the page and click on "Save&Apply" button to save all the changes that you have made.

All configurations take effect after a system reboot.

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual
Fig. 141 Json template setting
There are three type data point, user define, system,and register value in a Json template.

 System data points

The system data points defined by USR-M100 gateway is shown in table 24.

Table 24 System data points


System data points Description

sys_sn SN number

sys_mac MAC address

sys_ver Software version

sys_time GMT time

sys_unix_time Unix time

 Modbus register value data points

The node name configured in the section 9.2.3 is register value data points.

 User define

In addition to the above two types of data points, users can also define your own data points. Such as "user_define": "living room".

9.4.4. Test
We now use modbus slave software to simulate two modbus slave device. The connection and and parameters settings are show in

Fig.142. USB to RS485 converters are connecting PC with serial UART1 of USR-M100 gateway. We use MQTT.fx to connect to the

same broker and subscribe the report topic of USR-M100, we can see the message transmitted at the specified interval.

Fig. 142 Serial port parameters

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 143 Modbus slave simulation

Fig. 144 Data acquisition setting

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 145 Data report setting

Fig. 146 Message reported

9.5. Data query/control


There are three methods to actively query the data collected through the serial port from the communication channel: Json format,

Modbus TCP, Modbus RTU. Firstly, user need enable the data query function. We can query data by Json format in MQTT or HTTP

channel,and via modbus TCP or RTU format in TCP/UDP mode.

9.5.1. Json
When select MQTT or AWS IOT channel, user need configure the MQTT broker parameters in MQTT Gateway tab or Cloud service

tab at first, select Json query mode and setting the query topic in the Fig.147. In actual application, respond topic should be different

from report topic.

The query/control Json template object contains several fixed key-value, the specific meaning of key-value is listed in the table 25.

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual
The query/control Json contents are the following format:

{"rw_prot": {"Ver": "protocol version","dir": "transmission direction","id": "id","r_data": [{"name": "name of data points"],"w_data": [{"nam

e": "name of data points","value": "data"}]}

Tip: Users can query and control serial device’s data with one command. In one command, you can query the maximum of 5 data

points and control the maximum of 5 data points simultaneous.

Table 25 Description of Key-value in query/control


Key-value Description
rw_prot Protocol header
ver Protocol version, fixed value: 1.0.1
Data transmission direction
In query/control command, the option should be down.
dir
Means transmit data from network to serial device,
“down” must be lowercase.
User defined parameter. The id is same in query/control and response data.
Sometimes, the query/control data is high frequency, the response data may
id
be disordered. The program in network can confirm the relevant response
data by the id.
r_data The data load for querying data
w_data The data load for controlling data
name The name of data points described in 9.2.3 Data points configuration
Means the data need to be sent to the data points described in 9.2.3 Data
value points configuration.
In query data, this key-value can be ignored.
The response data contents are the following format:

{"rw_prot": {"Ver": "protocol version","dir": "transmission direction","id": "id","r_data": [{"name": "name of data points","value": "data","er

r": "error code"}],"w_data": [{"name": "name of data points","value": "data","err": "error code"}]}

Table 26 Description of Key-value in response data


Key-value Description
rw_prot Protocol header
ver Protocol version,fixed value: 1.0.1
Data transmission direction
In response data, the option should be up.
dir
Means transmit data from serial device to network,
“up” must be lowercase.
User defined parameter. The id is same in query/control and response data.
Sometimes, the query/control data is high frequency, the response data may be
id
disordered. The program in network can confirm the relevant response data by the
id.
r_data The data load for querying data
w_data The data load for controlling data
name The name of data points described in 9.2.3 Data points configuration
value The valid data of the data points
Error code,
err 0: The command can be operated by the USR-M100,
1: The command can’t be operated by the USR-M100.

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual
There are 3 response data for the unoperated command:

• The USR-M100 responses no data to the command,

• The USR-M100 will response data conforming to the error protocol if the ver/dir/id is not right,

• The USR-M100 will response data conforming to the error protocol if the contents of r_data and w_data are both wrong,

the USR-M100 will response data of the right one if only one of the r_data and w_data is wrong.

The error protocol format is the following:

{"rw_prot": {"Ver": "1.0.1","dir": "up","err":"1"}

Fig. 147 JSON query type


Users can send the following message to query data points added in chapter 9.2.3 Data points configuration.

{"rw_prot":

{"Ver": "1.0.1",

"dir": "down",

"id": "12345",

"r_data": [{"name": "temperature"},{"name":"humidity"}]

Your Trustworthy Industrial IoT Partner 9 www.pusr.com


User Manual

Fig. 148 Json query and response


Users can also send the following message to control data points added in chapter 9.2.3 Data points configuration

{"rw_prot":

{"Ver": "1.0.1",

"dir": "down",

"id": "12345",

"w_data": [{"name": "temperature","value":"15"},{"name":"humidity","value":"52"}]

Fig. 149 Json control and response

9.5.2. Modbus slave address and register mapping


This function is very useful in data query and only used in modbus TCP/RTU query mode. When user select Modbus TCP/RTU query

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
mode to get data, the M100 gateway will be confused if there are the same slave address in different serial port or same register

address in different slave devices. All slave devices and registers on a gateway are planned and managed in a unified manner.

For example, user can map slave address 1 in Port1 to slave 1 in M100 gateway, map slave address 1 in Port2 to slave 2 in M100

gateway.

Fig. 150 Same slave ID and register address

Fig. 151 Slave address mapping

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 152 Register address mapping

9.5.3. Modbus TCP


When select socket channel, user need configure parameters of the socket A of Uart1 in PORT tab at first, then select Modbus TCP

query type. We use slave address mapping and register mapping described in section 9.5.2 as here for illustration.

Fig. 153 Modbus TCP query type

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 154 Socket A parameters setting

Fig. 155 Modbus TCP simulator settings

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
Fig. 156 Modbus TCP response

Fig. 157 Modbus TCP control and response

9.5.4. Modbus RTU


When select socket channel, user need configure parameters of the socket A of Uart1 in PORT tab at first, then select Modbus RTU

query type. We use slave address mapping here for illustration.

Fig. 158 Modbus RTU query type

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 159 Modbus RTU simulator settings

Fig. 160 Modbus RTU response

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 161 Modbus RTU control and response

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10. IO channels
USR-M100 can support a number of Digital Input (DI), Relays (Rly), Analog Input (AI) ports. All modules are equipped with an in-built

web server, which allows for showing the module status and changing the configuration. To access the web server, open the browser

and enter the IP address of the module, default address for a new module (default IP address is 192.168.0.7). Please use the following

credentials:

Username:admin Password:admin (by default).

There are three methods to actively query the IO status from the communication channel: Modbus TCP, Modbus RTU and MQTT

modbus RTU. We can query IO status by modbus RTU format in MQTT or HTTP channel,and via modbus TCP or RTU format in

TCP/UDP mode.

10.1. IO function

10.1.1. Web interface


This page allows for entering the configuration parameters and showing the actual value of the inputs and outputs. To open this page,

please navigate to IO Function tab.

Fig. 162 IO status


Because the I/O status of USR-M100 is mainly displayed via Modbus protocol, the user has to configure the Modbus settings. Fig.161

shows the Modbus Slave ID that must be set for the Modbus protocol. Please refer to section 2.3.3 for details.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 163 IO configuration

10.2. Modbus TCP query/control


We choose socket A of Uart1 as the communication channel as an example to illustrate it. User can also choose socket B and other

Uart port.

Fig. 164 Socket setting for modbus TCP

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 165 Modbus TCP simulator settings

10.2.1. DI status query

Fig. 166 Slave ID and register address

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 167 Read DI values

Fig. 168 DI values

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10.2.2. AI status query

Fig. 169 Slave ID and register address

Fig. 170 Read AI values

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10.2.3. DO query/control

Fig. 171 Slave ID and register address

Fig. 172 Read DO status

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 173 Write DO

Fig. 174 DO Values

10.3. Modbus RTU query/control


We choose socket A of Uart1 as the communication channel as an example to illustrate it. User can also choose socket B and other

Uart port.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 175 Modbus RTU simulator settings

10.3.1. DI status query

Fig. 176 Read DI values

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10.3.2. AI status query

Fig. 177 Read AI values

10.3.3. DO control/query

Fig. 178 Read DO status

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 179 Write DO

Fig. 180 DO Values

10.4. MQTT query/control


When enable MQTT gateway or AWS IOT service, user need configure the MQTT broker parameters in MQTT Gateway tab or Cloud

service tab at first. Users can query or control IO ports by enabling IO control/query box on publish or subscribe tab. Note that the

query or response data is modbus RTU protocol.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 181 MQTT gateway settings

Fig. 182 Publish topic IO control/query

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 183 Subscribe topic IO control/query

10.4.1. DI status query

Fig. 184 DI query and response

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10.4.2. AI status query

Fig. 185 AI query and response

10.4.3. DO control/query

Fig. 186 DO query and response

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 187 DO control and response

10.5. DO Timing trigger control


USR-M100 support 6 timing tasks, users can do scheduled action for DO or device restart.

Fig. 188 Timing trigger control

10.6. Edging computing and linkage control


First,users need to enable edge computing function.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
10.6.1. Add IO module
Click add slave to add the IO port. In the slave property, enter the device name, bind to the IO, enter the polling interval. Click save.

Fig. 189 Add IO Port

10.6.2. Add IO data points


Click add nodes to add the IO data points. In the data point property, enter the node name, enter the response timeout. Click save.

Fig. 190 Add IO data points

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 191 Save the configuration


After finishing configuring the slave device, please scroll down to the bottom of the page and click on "Save" button to save all the

changes that you have made. All configurations take effect after a system reboot.

10.6.3. IO status report


Users can select TCP/UDP/HTTP in socket A of each serial port, MQTT Gateway, or AWS IOT service as the communication channel.

When select MQTT or AWS IOT channel, user need configure the MQTT broker parameters in MQTT Gateway tab or Cloud service

tab at first, and setting the report topic in the Fig.190. Here we use MQTT as an example.

Fig. 192 IO status report method

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 193 IO status report test

10.6.4. IO query/control
The query/control Json template object contains several fixed key-value, the specific meaning of key-value is listed in the table

26.

The query/control Json contents are the following format:

{"rw_prot": {"Ver": "protocol version","dir": "transmission direction","id": "id","r_data": [{"name": "name of data points"],"w_data": [{"na

me": "name of data points","value": "data"}]}

Tip: Users can query and control IO with one command. In one command, you can query the maximum of 5 data points and control

the maximum of 5 data points simultaneous.

Table 27 Description of Key-value for IO query/control

Key-value Description
rw_prot Protocol header
ver Protocol version,fixed value: 1.0.1
Data transmission direction
In query/control command, the option should be down.
dir
Means transmitting data from network to serial device,
“down” must be lowercase.
User defined parameter. The id is same in query/control and response data.
Sometimes, the query/control data is high frequency, the response data may
id
be disordered. The program in network can confirm the relevant response
data by the id.
r_data The data load for querying IO data.
w_data The data load for controlling IO data.
name The name of data points described in 10.6.2 Add IO data points
Means the data need to be sent to the data points described in 10.6.2 Add IO
value data points.
In query data, this key-value can be ignored.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual
The response data contents are the following format:

{"rw_prot": {"Ver": "protocol version","dir": "transmission direction","id": "id","r_data": [{"name": "name of data points","value": "data","er

r": "error code"}],"w_data": [{"name": "name of data points","value": "data","err": "error code"}]}

Table 28 Description of Key-value in IO response data


Key-value Description
rw_prot Protocol header
ver Protocol version,fixed value: 1.0.1
Data transmission direction
In response data, the option should be up.
dir
Means transmit data from serial device to network,
“up” must be lowercase.
User defined parameter. The id is same in query/control and response data.
Sometimes, the query/control data is high frequency, the response data may be
id
disordered. The program in network can confirm the relevant response data by the
id.
r_data The data load for querying data
w_data The data load for controlling data
name The name of data points described in 10.6.2 Add IO data points
value The valid data of the data points
Error code,
err 0: The command can be operated by the USR-M100,
1: The command can’t be operated by the USR-M100.
There are 3 response data for the unoperated command:

• The USR-M100 responses no data to the command,

• The USR-M100 will response data conforming to the error protocol if the ver/dir/id is not right,

• The USR-M100 will response data conforming to the error protocol if the contents of r_data and w_data are both wrong,

the USR-M100 will response data of the right one if only one of the r_data and w_data is wrong.

The error protocol format is the following:

{"rw_prot": {"Ver": "1.0.1","dir": "up","err":"1"}

Here we use MQTT as an example.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 194 IO status query


Query IO status:

{"rw_prot":

{"Ver": "1.0.1",

"dir": "down",

"id": "12345",

"r_data": [{"name": "DO1"},{"name":"DO2"},

{"name":"DI1"},{"name":"DI2"},

{"name":"AI2"}]

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 195 IO status query test

Fig. 196 DO control and response

10.6.5. Linkage control


When enable Edge computing function, users can set trigger conditions for Digital output control. There are two control logic:

follow logic and threshold trigger.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 197 Add event


 Local follow logic

There are forward follow and reverse follow, here we use forward follow as an example. The triggers can be DI ,DO.

Fig. 198 DI control DO


We can see that the DO1 NO close when DI level changes to 1 or on.

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

Fig. 199 Test result


 Threshold trigger

There are >,>=,<,<=,within threshold, out of threshold triggers, here we use within threshold as an example. The triggers can be

serial device data ,AI. Here we choose temperature data point as an example.

Fig. 200 Serial device data control DO

Your Trustworthy Industrial IoT Partner 1 www.pusr.com


User Manual

11. AWS IoT service


In order to reduce the length of this document, we have organized this section into a special document. Please refer to “USR-M100

Quick Start Guide with AWS IoT” for detail.

12. PUSR cloud service


In order to reduce the length of this document, we have organized this section into a special document. Please refer to “USR-M100

Quick Start Guide with PUSR cloud” for detail.

13. Warranty

14. Contact Us
Jinan USR IOT Technology Limited

Address : Floor 12 and 13, CEIBS Alumni Industrial Building, No. 3 Road of Maolingshan, Lixia District, Jinan, Shandong, China

Official website:https://www.pusr.com

Official shop:https://shop.usriot.com

Technical support: http://h.usriot.com/

Email : [email protected]

Tel : +86-531-88826739

Fax : +86-531-88826739-808

15. Disclaimer
The information in this document provided in connection with Jinan USR IoT technology ltd. and/or its affiliates’ products. No

license, express or implied, by estoppel or otherwise, to any intellectual property right is granted by this document or in connection

with the sale of USR IoT products. EXCEPT AS SET FORTH IN THE TERMS AND CONDITIONS AS SPECIFIED IN THE LICENSE

AGREEMENT FOR THIS PRODUCT, USR IoT AND/OR ITS AFFILIATES ASSUME NO LIABILITY WHATSOEVER AND DISCLAIMS ANY

EXPRESS, IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING, BUT NOT LIMITED TO, THE IMPLIED

WARRANTY OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON‐INFRINGEMENT. IN NO EVENT SHALL USR IoT

AND/OR ITS AFFILIATES BE LIABLE FOR ANY DIRECT, INDIRECT, CONSEQUENTIAL, PUNITIVE, SPECIAL OR INCIDENTAL DAMAGES

(INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF PROFITS, BUSINESS INTERRUPTION OR LOSS OF INFORMATION)

ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT, EVEN IF USR IoT AND/OR ITS AFFILIATES HAVE BEEN ADVISED

OF THE POSSIBILITY OF SUCH DAMAGES. USR IoT and/or its affiliates make no representations or warranties with respect to the

accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product

descriptions at any time without notice. USR IoT and/or its affiliates do not make any commitment to update the information

contained in this document.

16. Revision History


Version Date Author Description

1.0.0 2023.01.30 Dean,Gao Initial

Your Trustworthy Industrial IoT Partner 1 www.pusr.com

You might also like