基于VC的串口通信与图形绘制实现.doc

  1. 1、本文档共51页,可阅读全部内容。
  2. 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
基于VC的串口通信与图形绘制实现

基于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 introduces the Visual C + +6.0 of MSComm control to achieve the basic principles of serial communication, how to use the underlying Win32 serial communication API function to develop type CserialPort, and Microsoft Commuinications Control control compared to using the serial communication type of Serial equipment operation, to a certain extent, 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 communications, real-time characteristics of a good to introduce the Visual C + + based on a principle of serial communication and its implementation, and control system for the many serial communication interface, such as multi-threading characteristics, with examples such as the modular communication skillsApplication of computer to the outside world intuitive graphical data mapping. Windows environment Shimoji serial programming and serial DOS programming environment are very different from.Windows environment is one of the greatest characteristics of device-independent,it will be through the device driver with Windows application isol

文档评论(0)

pangzilva + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档