Note: RS485 serial port of USR-TCP232-410 can be connected to 32 devices utmost, and the number in bus protocol of the 485 is 200-plus. However, the actual connection should be determined by the loading of the device.
1.Background explanation
2. Hardware requirement
(1)One USR-TCP232-410 serial to ethernet converter
(2)2 or more 485 devices (the 485 device in the case is USR-SENS-WSD)
A computer
(3) An interchanger or router (it can also be directly connect to computer port, but it should be noted that the ip of 410 module should be in the same network segment with computer. It can be referred to https://www.usr.cn/Download/208.html). The way in the document is tested when 410 is connected to router.
A reticle
3. Software requirement
(1) USR-TCP232-410 serial to ethernet converter setting software can be downloaded from https://www.usr.cn/Download/90.html
(2) Software Modbuspoll
4. Hardware connection
(1)The way to connect 485: A-A, B-B or A-positive, B-negative
5.Parameter settings
(1)Port 0 of 410 is 232 serial, and port 1 is 485 serial. Only 485 ports are used in this communication method.
(2)Network parameter
a. Default IP address is static IP. In order to avoid conflict with devices in LAN, it needs to be modified to DHCP/ be acquired dynamically. If you want to keep static IP, then 410 should be set in the same network segment as router with no conflict in IP.
b. If 410 is directly connect to computer internet access, then it cannot be modified to DHCP/ be acquired dynamically. It needs to modify the IP address of 410 to the same network segment as he computer. As the default address of 410 is 192.168.0.7, the OP of computer should also be set as 192.168.0.XXX.
(1) Serial parameter: serial parameter needs to match that of the device when setting. As for the temperature and humidity device whose setting is 9600 baud rate, 8 NONE data bit, 1 stop bit, its 410 should be set in the same values.
(2) Modbuspoll uses Modbus TCP protocol in the communication, so it needs to start Modbues RTU function when setting the parameters of 410. (at present, the products supporting Modbus TCP to Modbus RTU include USR-TCP232-410, USR-WIFI232-D2 and USR-WIFI232-630).
DHCP gets IP address from the placement of router
Default setting is static, and the IP needs to be modified to DHCP/ be acquired dynamically to avoid conflict.
6.The way to connect
(1)Open Mosbuspoll, and click Filenew to create new file or click icon below File to create a new page. If there is already a page after starting the software, you may pass the step.
(2) After opening the new page, click ConnectionConnection Setup and then change the connection mode to TCP/IP. Fill in the IP address as the one gained from router placement by 410, and port is the local port of 410.
(1) After creating the page, choose Setup Read/write Definition to add device number and set the address of temperature and humidity module 1.
(2) Slave IP is the address of slave of Modbus device to be accessed
(3) Function is the function code of register and the 4 most frequently used Functions are as follows:
No. |
Function |
MCGS |
Case of Address |
1 |
01 Read Coils |
0 output register |
00001 |
2 |
02 Read Discrete Inputs |
1 input relay |
10001 |
3 |
03 Read Holding Registers |
4 output register |
40001 |
4 |
04 Read Input Registers |
3 input register |
30001 |
(1)Address is the original address of register, and the default number is 1, corresponding to the register address of MCGS.
(2) Quantity is the consecutive number of register, and the default value is 10
(3) Scan Rate is the cycle of data reading whose unit is MS, and default value is 1000ms
(4) Read/Write Enabled is whether read the choice consecutively, and it will consecutively read when selected
(5) Read/Write Once is to read on click
Number of the device address
(6) Modbus RTI device command
Read the data of temperature and humidty
Command frame
Response frame
When the data of humidity returned is 0×01C8 or 456, it means the relevant humidity is 45.6 % now, and the data of temperature returned is 0×00ED or 237, which means the relevant humidity is 23.7℃ now
Click OK after complete setting and then you can read the list of register defined and the temperature and humidity data read from the temperature and humidity device 1.
Open Mosbuspoll, and click Filenew to create new file or click icon below File to create a new page. Set the temperature and humidity module 2 in the same way as that of module 1
Address of the device
Click OK after complete setting and then you can read the list of register defined and the temperature and humidity data read from the temperature and humidity device 2.