摘要
介绍了ModbusRTU通信协议的原理及在智能设备中的实现方法。分析了该协议的数据帧格式,研究了位、两字节整数、长整数和浮点数等数据类型的表达方法;根据其消息响应机制,结合智能设备中微处理器的特点,从运算速度、程序量需求等方面对协议的具体实现进行了优化;最后使用组态王进行了通信试验,实现了典型智能设备的数据传输功能。经优化后的RTU协议实现方法具有占用资源少、通信效率高的优点,对于智能设备的通信系统设计具有良好的参考价值。
The paper introduced the principle of Modbus RTU communication protocol and its realization in intelligent instruments.The representation of several data types such as bit,two-byte integer,and long integer and floatingpoint data were studied based on the analysis of data frame format of the protocol.According to the message response mechanism and characteristics of the microprocessors in intelligent instruments,several methods were put forward to optimize the realization of the protocol in operation speed and the demand for the numbers of ROM.Tests show that data of typical intelligent devices can be transmitted to KingView successfully via Modbus RTU protocol.The optimized protocol implementation method is characterized as less resource occupation and high communication efficiency.It has good reference value to the design of communication system of intelligent devices.
作者
马秋芳
MA Qiu-fang(College of Big Data,Qingdao Huanghai University,Qingdao 266427,China)
出处
《仪表技术》
2019年第8期24-26,共3页
Instrumentation Technology
基金
山东省高等学校科技计划项目(J17KB153)