In industrial Modbus applications, the Modbus protocol is commonly used. In a Modbus protocol system, it is generally composed of one or more masters and one or more slaves, for example with a PLC and a Modbus sensor. In the MODBUS protocol, the Q&A method is used for data interaction, for example, the PLC sends a query command, and the sensor sends the data to the PLC after receiving it.
The common serial port end rate is generally 9600bps or 115200bps, in order to improve the communication rate of the host end, the general host side will pass the network port, take the modbus tcp protocol, and the terminal equipment (slave) generally through the serial port (RS485 mostly) through the modbus RTU protocol. Based on the current situation, if RS485 is used for communication, one master and one slave communicate, and the communication can be normal without pursuing the speed, but if it involves a master corresponding to a plurality of slaves, or a plurality of hosts corresponding to a slave, this will have a high delay (the communication frequency becomes high, the communication rate is low). For the timeliness of the system, generally in a complex MODBUS network (especially in which multiple hosts query slave data at the same time), multi-host communication will generally communicate through the network cable via the MODBUS TCP protocol, and the communication rate of the host will be greatly improved, which will involve the conversion of TCP protocol and RTU protocol.
Today, I would like to introduce to you the serial port server, which can provide serial port to network function, which can convert serial ports such as RS232 485 422 into network interfaces with TCP IP protocol, and realize the two-way transparent transmission of data between RS232 485 422 serial port and TCP IP network interface.
In this case, we take the single serial port server NA111 as an example, and show that the network debugging assistant "NetAssist" and the serial port debugging assistant "UARTASSIST" will be used, as well as the parameter configuration host computer "EBYTE Network Configuration Tool", which can be carried out on the official website**. The following materials need to be prepared:
1) Use the wire to connect the USB to RS485 debugger A B with the device A B respectively.
2) Connect the USB to the computer, open the serial port debugging assistant to see if you can find the corresponding serial slogan (if you can't find it, you need to install the corresponding serial port tool driver).
3) Connect the NA111 with the switching power supply (switching power supply V+ connected to device +, switching power supply V- connected to device-), switching power supply is powered, and the device power indicator lights up.
4) Use a network cable to connect the device to the computer.
5) Set the IP address of the computer to a static IP and turn off the firewall.
6) Double-click the "ebyte network configuration tool" on the upper computer of the running parameter configuration, click to search for the device, and the selected device can be seen after the search is completed.
7) Modify the IP address of the device so that the IP of the device and the IP of the computer are in the same network segment (the IP of the computer in this office is 192168.0.100, change the IP address of the device to 192168.0.113), other parameters can be modified according to the actual situation, and the default parameters are used here. Click the modbus parameter to change the modbus gateway to simple protocol conversion, enable tcp to rtu, save the configuration, and restart the device.
8) Open the serial port debugging assistant and the network debugging assistant, and connect according to the above parameters.
Network Parameters:
The serial port parameters are defaulted here:
The Network Debugging Assistant connection is as follows:
The Serial Debugging Assistant is connected as follows:
9) This is where the conversion verification can be done.