RS485 MODBUS RTU communication protocol

1. RS485 interface standard

      RS485 is developed from RS232 and RS422, which makes up for the shortcomings of poor anti-interference ability, short communication distance and low speed, and increases the multi-point and two-way communication ability, that is, it allows multiple transmitters to be connected to the same main line, and at the same time increases the The drive capability and collision protection features of the transmitter extend the bus common-mode range.

      RS485 can be used in two ways: two-wire and four-wire, and the two-wire system can realize true multi-point two-way communication. Its main features are as follows:

      (1) The interface signal level of RS485 is lower than that of RS231-C, which is not easy to damage the chip of the interface circuit, and the level is compatible with TTL level, which is convenient for TTL circuit connection.

      (2) The maximum data transmission rate of RS485 is 10Mbps. The length of the balanced twisted pair is inversely proportional to the transmission rate. At a rate of 100kbps, it is possible to use the specified longest cable length, and the highest transmission rate can be obtained only in a very short distance.

      (3) The RS485 interface adopts a combination of a balanced driver and a differential receiver, which has strong anti-common mode interference ability, that is, good anti-noise interference, so the communication distance is long. The maximum transmission distance is about 1200m, and it can actually reach 3000m.

      (4) The RS485 interface allows up to 128 transceivers to be connected on the bus, which has multi-station capability. At the same time, two terminating resistors are required, and their resistance is required to be equal to the characteristic impedance of the transmission cable. Terminating resistors may not be connected when transmitting within a short distance of 300m.

2. MODBUS RTU protocol

        This protocol has become a general industrial standard, through which serial communication can be realized between the controller and the controller, and between the controller and other devices through the network (Ethernet). RTU stands for Remote Terminal Unit, and each 8-bit message contains two hexadecimal characters. Under the same baud rate, this method transmits a larger amount of data than ASCII.

 

3. Reference

         (1) Li Jiangquan. Typical example of Visual Basic.NET serial communication and measurement and control application [M]. Electronic Industry Press, 2012.

         (2) Cui Jing, Xu Xiaoguang, Ni Kang, et al. C# programming to realize Modbus communication protocol [J]. Journal of Xinxiang University, 2014, 41(8):30-33.

         (3) List of Modbus function codes: https://wenku.baidu.com/view/693da73782c4bb4cf7ec4afe04a1b0717fd5b3c9.html

 Huairen and simple, but the truth is the truth.

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325027296&siteId=291194637