摘要:介绍了以FreeModbus协议找在嵌入式抢占实时操作系统μC/OS-l的STM32平台上,成功实现了Modbus协议的移植。通过详细分析FreeModbus协议花并编写STM32F103VET6微处理器的底层驱动,成功实现了工业Modbus协议RTU和ASCll两种模式的通信功能。测试结果表明,在实际工业生产控制和仪表开发中,应用Freemodbus协议,完全符合工业数据采集、实时控制和数据处理等厂级重复性和精确度要求,在一定程度上降低了工业仪表开发的周期及成本。
关键词:实时操作系统,uC/OS-ll,FreeModbus,Modbus协议,STM32
Abstract:This paper introduces FreeModbus stack transplanted to the STM32 platform which has been embedded in the preemptive real-time operating system uC/OS-ll,in order that the transplantation of the Modbus protocol is successfuly im-
plemented.The FreeModbus stack is analyzed in detail and STM32F103VET6 microprocessor underlying driver is writed,so that the two Modbus industrial communication function RTU and ASCll are successfully realized.
Keywords:time operating system,uC/OS-ll,.FreeModbus,Modbus协议,STM32