(强烈推荐)毕业论文设计基于C++的RS232通信协议模拟终端 联系客服

发布时间 : 星期六 文章(强烈推荐)毕业论文设计基于C++的RS232通信协议模拟终端更新完毕开始阅读ac777d5fa66e58fafab069dc5022aaea998f4181

(此文档为word格式,下载后您可任意编辑修改!)

基于C++的RS232通信

协议模拟终端

Analog Terminal The RS232 Communication

Protocol Based On C++

I

2013 年 06 月

摘 要

随着科技的迅猛发展,通信技术已经成为社会经济、环境、生活、工作、学习不可缺少的一部分。通信的方式多种多样,以何种方式实现通信主要取决于通信设备。在工业控制系统和实验室中,由于串行通信具有实现简单、使用灵活方便等优点,串行通信是计算机与外部设备进行数据通信时经常使用的方式之一。

围绕串行通信技术,本文主要介绍了串行通信接口——RS232标准串口,阐述了RS232串行通信基本原理和CRC校验,通过VC界面编程实现串行通信。传输过程中通过CRC对数据进行校验。

在研究RS232串行通信原理中,主要介绍了RS232标准协议、串口以及串口通信原理。详细的分析了几种主要的通信参数。按照其工作原理及RS232串口的标准协议最终采用串行全双工的方式实现其通信,本文中的接口使用的是计算机上的USB口。

在软件实现方面,本设计在比较了多种方法之后,最终选择了基于C++的MFC应用程序。利用 MSComm ActiveX 串行通信控件来实现串行通信。文中详细地介绍了VC下的Windows平台先进的 ActiveX 控件技术,即MSComm控件等。最终实现了两台PC间的串行通信。

串行通信以其成本低、结构简单等优点被人们广泛应用。用RS-232协议实现两台PC机间的串行通信为以后实现更加复杂的设备间通信奠定了基础。

关键词:RS232标准;串行通信;C++;CRC校验

Abstract

With the rapid development of science and technology, communication technology 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.Finally, realize serial communication through VC programming. During the process of transmission through the CRC to check the data.

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 adopted to serial full-duplex mode to realize communication.In this article ,the interface is the USB port on the PC.

In the aspect of software realization,this design select the MFC application program based on C++ after several methods are compared.To realize the serial communication by using MSComm ActiveX serial communication control.This article introduces the ActiveX control technology--MSComm control.Finally,the design realize 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 machine is the foundation of realizing more complex communication.

Keywords: motor; RS232protocol; Serial Communications; C++; CRC Cyclic