摘要
针对工业上的需求,文中基于Modbus协议设计了一种嵌入式智能传输数据的仪表,CPU采用C8051F系列的微处理器,上下位机通过RS-485总线进行通讯。下位机采用C语言来编程,通过ADC和脉宽调制功能实现数据的采集和变换;上位机采用C#来开发Modbus协议通信软件,采用主线程和辅线程机制来实现Modbus协议通信,将数据显示在界面上,同时绘制数据的动态曲线图,方便观察数据,系统整体实用性较高。
According to industrial needs,this paper designed an embedded intelligent data transmission instrument based on Modbus protocol.The CPU adopted C8051F series microprocessor,the upper and lower computer realized communication through the RS-485 bus.The lower computer adopted C programming language,through the ADC and pulse width modulation function to realize data collection and conversion,PC used C# to develop Modbus protocol communication software,used the main mechanism of urban-rural benefit readjustment and process to realize data communication based on Modbus protocol.It displays data in the host computer interface,while draws data on the dynamic graph,it is a convenient and practical system as a whole.
出处
《仪表技术与传感器》
CSCD
北大核心
2011年第6期26-28,共3页
Instrument Technique and Sensor
基金
辽宁省教育厅2009-2010科学技术研究项目(2009A083)