Modbus is an application layer information transmission protocol that includes three kinds of data packets: ASCII, RTU, and TCP. The protocol itself does not define the physical layer, but only defines the information structure that the controller can recognize and use, regardless of its communication method.
When Modbus is transmitted through the serial port, it can choose RTU or ASCII, which specifies the message, data structure, command and response, and requires inspection of the data. ASCII type uses LRC check, RTU type uses 16-bit CRC check. TCP is transported in Ethernet, and since TCP is a reliable connection-oriented protocol, no checking is required.
5G industrial gateway supports conversion between Modbus RTU/ASCII and Modbus TCP protocols
The 5G industrial gateway is able to switch between Modbus RTU/ASCII and Modbus TCP. Compared with RTU, Modbus TCP is restricted by RS485 and has the following advantages:
1. The existing Ethernet network can be used, eliminating the wiring of RS485.
2. It can support multiple hosts to access Modbus instruments at the same time.
The Difference Between Modbus RTU and Modbus TCP
1. The slave address is no longer primary and is ignored most of the time. The slave address is replaced by the IP address to a certain extent
2. Checking the CRC is not so important and can even be ignored. Because there is already a check in the TCP packet, Modbus TCP simply cancels the CRC check, so as to avoid doing a “wheel” again.
To transmit the Modbus data to Ethernet, the TCP method is used to pass the TCP502 interface. The physical layer, data link, network and transport layer of the protocol all use the TCP protocol. Only at the application level, the Modbus is modified and then encapsulated; after the receiver decapsulates the TCP packet, it restores the original Modbus frame, and then The specification of the Modbus protocol analyzes it, and then encapsulates the obtained packet into TCP and sends it back to the sender. The TCP method does not use a data format like a serial link, it removes extra addresses and checks, and adds headers.