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

实现基于Visual C+ +7.0的多线程串口通信
引用本文:李东晓 李晓明 等. 实现基于Visual C+ +7.0的多线程串口通信[J]. 电力自动化设备, 2002, 22(9): 13-16
作者姓名:李东晓 李晓明 等
作者单位:武汉大学,电力工程系,湖北,武汉,430072
摘    要:串口通信程序多是用微软提供的MSComm控件实现的,但MSComm控件实现方法很难加入多线程技术提高程序的执行效率,尤其对微机与多台智能设备之间同时进行通信,这种方法的单线程局限性就更明显。为此,深入介绍了32位串口通信的结构体和WindowsAPI函数及多线程编程技术,,并结合面向对象的编程思想,将WindowsAPI函数、结构体及多线程技术进行了封装,形成新的串口通信类CCommunication,该类可以实现MSComm控件的所有功能,用该类开发的程序比用MSComm控件开发的程序的执行速度快。应用该类可很方便地实现基于Visual C 7.0多线程串口通信,且具有通用性好,使用性强等优点。

关 键 词:VisualC++7.0 多线程 串口通信 MSComm控件 面向对象 程序设计
文章编号:1006-6047(2002)09-0013-04

Implementation of multithread serial communication with Visual C+ +7.0
LI Dong xiao,LI Xiao ming,XIAO Kun,ZHANG Fa zhong,PENG Jia yin. Implementation of multithread serial communication with Visual C+ +7.0[J]. Electric Power Automation Equipment, 2002, 22(9): 13-16
Authors:LI Dong xiao  LI Xiao ming  XIAO Kun  ZHANG Fa zhong  PENG Jia yin
Abstract:Most serial communication programs are developed with MSComm control supplied by Microsoft,but Multithread technology could not be easily added into it.The defect is more noteworthy in multi CPU communication.The structs and Windows API functions of 32?bit serial communication and the multithread programming technique are introduced.According to the OOP,the structs and functions are encapsulated to form a new class CCommunication.It can realize all the functions produced by MSComm control,and the efficiency of the program developed with it is better than that with the MSComm control.The multithread serial communication programming based on Visual C++7.0 becomes easier with better transplantability and practicability.
Keywords:Visual C++7.0  Windows API  struct  multithread  serial communication  
本文献已被 CNKI 维普 万方数据 等数据库收录!
点击此处可从《电力自动化设备》浏览原始摘要信息
点击此处可从《电力自动化设备》下载全文
设为首页 | 免责声明 | 关于勤云 | 加入收藏

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