基于VC++的串口通信飞行仿真数据传输
介绍了采用Visual C++6.0中的MSComm控件来实现串口通信的基 本原理,如何利用 Win32的底层API函数开发串口通信类 CserialPort, 与Microsoft Commuinications Control控件相比,采用该串口通信类对串 口设备操作时,能够在一定程度上避免对串口设备的“屏蔽” 。增加对串
口操作的透明度,提高串口传输数据的可靠性。针对 Visual C++6.0具有
功能强大,通信快速,实时性好等特点,介绍基于Visual C++的一种串口 通信原理及其实现方法,并针对控制系统众多界面下串口通信的多线程 等特点,结合实例阐述通信模块化等一些技巧。应用电脑对外界数据进 行直观的图形绘制。
Windows环境下地串口编程与 DOS环境下的串口编程有很大的不 同。Windows环境下的最大特点之一就是设备无关性,它通过设备驱动 程序将 Windows应用程序同不同的外部设备隔离。 Windows封装了
Windows的通信机制,这种方式称为通信 API,Windows程序员可以利 用Windows通信API进行编程,不用对硬件直接进行操作。这种体系被 称为Windows开放式服务体系。
Windows 9x/NT/2000中的API 一般都支持32位的操作,因此又称 为Win32 API。Windows操作系统是一个可抢占式的操作系统,所以 Windows应用程序常常有被别的程序抢占时间片的可能,因此 Win32通
信业不能用于实时通信。实时通信的质量与时间紧密相关。因此,不需 要许多协议层的交换式、非实时的通信可以采用Win32通信API来实现。 Win32通信API把串口操作和文件操作统一起来,使用类似的操作来实 现通信。
关键词:VC++嵌入式系统,,MSComm,Windows API, 串口通信, 模块化,图形,绘制.
ABSTRACT
This paper in troduces the Visual C + +6.0 of MSComm con trol to achieve the basic pri nciples of serial com muni catio n, how to use the un derly ing Win32 serial com muni catio n API fun cti on to develop type CserialPort, and Microsoft Commuinications Control control compared to using the serial com muni cati on type of Serial equipme nt operati on, to a certa in exte nt, the serial device to avoid the shieldIncrease the transparency of the operation of serial port, serial port to improve the reliability of data transmission. For Visual C + +6.0 with powerful rapid com muni cati ons, real-time
characteristics of a good to introduce the Visual C + + based on a principle of serial com muni catio n and its impleme ntatio n, and con trol system for the many serial com muni cati on in terface, such as multi-threadi ng characteristics, with examples such as the modular com muni cati on skillsApplicatio n of computer to the outside world in tuitive graphical data mapp ing.
Windows environment Shimoji serial programming and serial DOS program ming en vir onment are very differe nt from.Wi ndows en vir onment is one of the greatest characteristics of device-indepe
您可能关注的文档
最近下载
- 湖南工业大学《高等数学(II)》2025 - 2026学年第一学期期末试卷.docx VIP
- 人工智能在学前教育中的应用与探索论文.docx
- 初中道德与法治九年级上册核心素养知识清单(部编版).docx VIP
- 项目部组建方案及管理细则.docx VIP
- 第三章 国际贸易术语第三章国际贸易术语第三章 国际贸易术语第三章 国际贸易术语.ppt VIP
- 高新技术产品进出口统计目录.pdf VIP
- 苏教版六年级下册数学 3.1 解决问题的策略(1)课件.pptx VIP
- 湖南工业大学《高等数学(D)》2025 - 2026学年第一学期期末试卷.docx VIP
- 建筑制图与识图试卷及答案.pdf VIP
- CompactNSX塑壳断路器说明书用户手册.pdf VIP
原创力文档

文档评论(0)