摘要
通过Modbus RTU/ASCII协议和Modbus TCP协议的相互转换,实现以太网设备和串行设备间的无缝通信.网关设计采用模块化方法,lwIP数据的收发和Modbus协议的转换使用多进程并行工作的模式.通过建立多个缓冲区存储Modbus消息,有效地解决了消息收发速度和处理速度不匹配的问题,保证所有的消息都能得到处理,大大地提高了吞吐量.
A Modbus server gateway is designed based on uC/OS-Ⅱ and lwIP. By the conversion of Modbus RTU/ASCII and Modbus TCP protocols, Modbus equipments over serial line and TCP/IP can communicate seamlessly and easily. Composed of several modules, the gateway creates multi-thread to deal with the receiving and sending of 1wIP and the switching between Modbus RTU/ASCII and Modbus TCP. It also sets up a number of buffers to store Modbus frames. This mechanism effectively solves the problem that network packet collecting speed does not match the processing speed, ensures that all the Modbus frame can be processed sooner or later, and increases the data throughput greatly.
出处
《河海大学常州分校学报》
2007年第4期91-94,113,共5页
Journal of Hohai University Changzhou