首页 | 本学科首页   官方微博 | 高级检索  
     

应用VC++开发串行通信
引用本文:吴锐,魏启.应用VC++开发串行通信[J].石油仪器,2003,17(6):44-47.
作者姓名:吴锐  魏启
作者单位:西安石油勘探仪器总厂
摘    要:VC 串口通讯程序在WIN32下通常不直接对端口进行操作,在W1N32中所有的设备都被看成是文件,串行口也不例外。文章详细介绍了文件I/O函数提供的打开和关闭通信资源句柄及读写操作的基本接口(CreateFile、ReadFile、WriteFile等),举例说明了在VC 环境下如何通过Windows API通信函数实现对串口的操作。新的文件VO函数支持重叠式输入输出,使线程可从费时的VO操作中解放出来,极大地提高了程序的运行效率。

关 键 词:VC++  文件  串行通信  读写操作  打开  句柄  WIN32  VO  关闭  运行效率
修稿时间:2003年7月16日

Development of asynchronous communication using VC++
Wu Rui and Wei Qi.Development of asynchronous communication using VC++[J].Petroleum Instruments,2003,17(6):44-47.
Authors:Wu Rui and Wei Qi
Affiliation:Wu Rui and Wei Qi
Abstract:It is not commended to directly access the COM port in WIN32 serial communication. All devices in WIN32 are regarded as files,which naturally include the COM port. The new I/O function,such as CreateFile,ReadFile and WriteFile,are introduced in detail here,and giving an application example to use windows API communication function to access COM port in VC++. These I/O function support overlapped operator,such makes the application example thread have enough time to process its task and not waiting for I/O operation. The Asynchronous method greatly improves executing efficiency.
Keywords:Asynchronous Communication  buffer  VC++6  0  Win API  MFC 32 application  
本文献已被 CNKI 维普 万方数据 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号