基于STM32的MODBUS协议分析仪

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

目录

前言 (1)

1.绪论 (2)

1.1概述 (2)

1.2课题的意义 (3)

1.2.1课题的研究和应用 (4)

1.3研究内容和设计方法 (5)

1.3.1研究方向和内容 (5)

1.3.2设计的步骤 (6)

1.3.3软硬件设计方案 (7)

2.系统设计基础 (8)

2.1通讯方案的选择 (8)

2.2所用芯片的简单介绍 (9)

2.2.1温湿度传感器 (9)

2.2.2单片机 (9)

2.2.3显示屏 (10)

2.2.4与上位机的串行通讯及下载调试 (10)

3.硬件电路设计 (11)

3.1单片机模块 (11)

3.2电源模块 (13)

3.3OLED模块 (14)

3.4程序调试下载模块 (14)

3.5串口通信模块 (15)

3.6温湿度模块 (16)

4.软件设计 (17)

4.1串口通信模块 (17)

4.2数据帧处理模块 (18)

5.系统调试 (21)

5.1硬件调试 (21)

5.1.1单片机电路板的调试 (21)

5.2软件调试 (23)

5.2.1调试平台 (23)

5.2.2调试问题 (23)

5.2.3调试结果 (24)

6.总结与展望 (25)

6.1结论 (25)

6.2研究对象的未来发展期望 (26)

参考文献 (27)

致谢 (28)

附录 (29)

摘要

随着社会的进步,互联网和通信技术的发展将传感器、嵌入式设备和智能控制系统紧密地联系在了一起,另一方面,工业现场协议也被广泛地应用。其中MODBUS协议被越来越广泛地接受和应用。它具有简单便携的远程监控操作,在工业现场中具备适用于多种通讯设备之间、多种传播介质之上的网络连接能力。而本论文将在STM32F103C8T6单片机平台上,通过载入了MODBUS协议的温湿度传感器,来实现温度湿度数据的采集,最终通过OLED显示屏显示出来当前环境下的温湿度。同时利用MODBUS-RTU通信接口实现与上位机的通信,其中使用到组态王软件进行PC端模拟,将测量出的温湿度数据通过串口上传到PC端,进行数据的界面显示和曲线分析。

关键词:MODBUS协议;RS485;STM32F103C8T6单片机;温湿度数据;通信

Abstract

In modern society, on the one hand, the development of Internet and communication technology has closely linked sensors, embedded devices and intelligent control systems.

On the other hand, industrial field protocols are also widely used. Among them, MODBUS protocol is more and more widely accepted and applied because of its simple and portable remote monitoring, control operation and network connection capability that is applicable to a variety of communication devices and over a variety of transmission media in industrial field.

This paper will be on the STM32F103C8T6 microcontroller platform, through the load of the MODBUS protocol temperature and humidity sensor, to achieve the temperature and humidity data collection, and finally through the OLED display screen to display the temperature and humidity under the current environment.

At the same time, the modbus-rtu communication interface is used to realize the communication with the upper computer. Among them, the king view software is used for PC terminal simulation, and the measured temperature and humidity data is uploaded to the PC terminal through the serial port for data interface display and curve analysis.

Keywords:MODBUS protocol;RS485;STM32F103C8T6SCM;temperature and humidity data;communication

基于STM32的MODBUS协议分析仪

的设计与实现

前言

现如今,在国家政策的大力支持下,电子信息技术和网络通信得到了极大的发展,集成硬件的开发和传感遥控的使用使得远程监控运用起来更加方便。渐渐地,很多工业协议也开始应用于各种工业设备中,在计算机、物联网等控制领域取得了突破性成果。但是,由于需要监控的设备及其相关的信息也越来越多,使得自动化监控和远程控制变得具有挑战性。目前工业远程控制系统有待完善,人们更多地希望能通过网络发送设备控制命令实现对现场环境及设备的参数远程监控,采集设备数据信息并进行实时处理。

Modbus协议因为其协议结构简单、适应多种传播媒介的特点得到工业上的广泛推广。同时,单片机在工业自动化领域已经有较大的发展,STM32单片机功耗低、片上资源丰富、下载和移植方便、驱动代码简单、经济实用,是能更加便携的应用到协议分析仪上的不二之选,所以本课题研究是通过单片机与协议的结合实现对数据的分析与监控。

相关文档
最新文档