没有合适的资源?快使用搜索试试~ 我知道了~
基于C--的RS232通信协议模拟终端毕业论文.doc
0 下载量 112 浏览量
2023-07-10
13:06:14
上传
评论
收藏 796KB DOC 举报
温馨提示
试读
47页
基于C--的RS232通信协议模拟终端毕业论文.doc
资源推荐
资源详情
资源评论
基于 C++的 RS232 通信
协议模拟终端
Analog Terminal For RS232 Communication
Protocol Based On C++
学 院:
专 业 班 级:
学 号:
学 生 姓 名:
指 导 教 师:
2013 年 06 月
密级:公开
I
摘 要
随着科技的迅猛发展,通信技术已经成为社会经济、环境、生活、工作、学习不可
缺少的一部分。通信的方式多种多样,以何种方式实现通信主要取决于通信设备。在工
业控制系统和实验室中,由于串行通信具有实现简单、使用灵活方便等优点,串行通信
是计算机与外部设备进行数据通信时经常使用的方式之一。
围绕串行通信技术,本文主要介绍了串行通信接口——RS232 标准串口,阐述了
RS232 串行通信基本原理和 CRC 校验,通过 VC 界面编程实现串行通信。传输过程中
通过 CRC 对数据进行校验。
在研究 RS232 串行通信原理中,主要介绍了 RS232 标准协议、串口以及串口通信
原理。详细的分析了几种主要的通信参数。按照其工作原理及 RS232 串口的标准协议最
终采用串行全双工的方式实现其通信,本文中的接口使用的是计算机上的 USB 口。
在软件实现方面,本设计在比较了多种方法之后,最终选择了基于 C++的 MFC 应
用程序。利用 MSComm ActiveX 串行通信控件来实现串行通信。文中详细地介绍了 VC
下的 Windows 平台先进的 ActiveX 控件技术,即 MSComm 控件等。最终实现了两台 PC
间的串行通信。
串行通信以其成本低、结构简单等优点被人们广泛应用。用 RS-232 协议实现两台 PC
机间的串行通信为以后实现更加复杂的设备间通信奠定了基础。
关键词:RS232 标准;串行通信;C++;CRC 校验
II
Abstract
With the rapid development of science and technology, communication
technology has become an indispensable part of social economy, environment, living
and learning. There are many kinds of communication modes. The selection of
communication mode mainly depends on the communication equipment. In industrial
control systems and laboratory, serial communication is widely used in computer and
external equipment due to the simple and flexible advantage.
Around serial communication technology, this paper mainly introduces the serial
communication interface - RS232 serial port, and expounds the basic principle of
RS232 serial communication and CRC check .It is completed to realize serial
communication by VC programming. It can check the data during the process of
transmission through the CRC.
In the study of RS232 serial communication principle, this design mainly
introduces the principle of serial communication, serial port and RS232 protocol,and
analyzes communication parameters in detail. Considering RS232 serial port and
working principle, this design adopts serial full-duplex mode to realize
communication. In the article, the interface is the USB port on the PC.
In the aspect of software realization, after several methods are compared,this
design selects the MFC application program which is based on C++ .The design
realize the serial communication by using MSComm ActiveX serial communication
control. This article introduces the ActiveX control technology--MSComm control.
Finally, the design realizes serial communication between two computers.
Because of the advantages of low cost and simple structure, serial
communication is widely used by people. Realization of serial communication
between two PC machines is the foundation of realizing more complex
communication.
Keywords:RS232 protocol; Serial Communications; C++; CRC Cyclic
Redundancy Check
I
目 录
摘 要 .....................................................................................................................................I
Abstract ......................................................................................................................................II
第 1 章 绪论...............................................................................................................................1
1.1 课题的研究意义..........................................................................................................1
1.2 研究现状及发展趋势..................................................................................................2
1.2.1 RS232 串行通信的研究现状............................................................................2
1.2.2 RS232 串行通信的发展趋势............................................................................2
1.3 本文主要的研究内容..................................................................................................2
第 2 章串行通信基本原理.........................................................................................................4
2.1 RS232 通信协议...........................................................................................................4
2.1.1 RS232 标准........................................................................................................4
2.1.2 RS232 接口........................................................................................................4
2.2 串行通信......................................................................................................................5
2.2.1 串行通信基本原理...........................................................................................5
2.2.2 串行通信参数...................................................................................................6
2.2.3 串行通信的分类.......................................................................................................7
2.3 串口的调制..................................................................................................................8
2.3.1 串口连接...........................................................................................................8
2.3.2 串口调试...........................................................................................................9
2.4 本章小结....................................................................................................................10
第 3 章 CRC 校验 ...................................................................................................................11
3.1 CRC 校验原理 ...........................................................................................................11
3.1.1 CRC 校验码的基本原理 ................................................................................11
3.1.2 CRC 校验码权的形式 ....................................................................................12
3.2 CRC 校验的实现 .......................................................................................................13
3.3 本章小结.....................................................................................................................13
第 4 章 软件的实现及其测试.................................................................................................14
4.1 开发工具概述............................................................................................................14
4.1.1 Windows 编程与 MFC....................................................................................14
4.1.2 串行通信控件 MSComm...............................................................................14
4.2 程序的主要功能........................................................................................................15
4.3 程序运行平台............................................................................................................17
II
4.4 详细设计.....................................................................................................................17
4.4.1 建立工程.........................................................................................................17
4.4.2 界面功能实现.................................................................................................18
4.4.3 模块分析.........................................................................................................21
4.4.4 程序测试.........................................................................................................34
4.5 本章小结....................................................................................................................39
第 5 章 结论.............................................................................................................................40
参 考 文 献.............................................................................................................................41
致 谢...................................................................................................................................43
剩余46页未读,继续阅读
资源评论
Mmnnnbb123
- 粉丝: 695
- 资源: 8万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于STM32单片机空气监测系统设计源码+详细文档+配套全部资料(毕业设计).zip
- rdf0412-kcu116-pcie-c-2019-1.zip(XILINX KCU116 源码)
- 基于C#语言的winform界面火车票订票系统(源码+实验报告)
- 【华为OD部分真题及讲解】华为OD部分真题及讲解
- 基于Python+Django的京东商品比价系统源码+全部资料(毕业设计).zip
- G460 G560 Z460 Z560的最新BIOS 2.18版(无白名单)
- MetaJUI v0.4
- 基于Python+Django的京东商品比价系统源码+全部资料(毕业设计).zip
- linux常用命令大全
- 立体相机标定-使用OpenCV+Cpp对立体相机进行标定-calibration-附项目源码+流程教程-优质项目实战.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功