摘要
串口是常用的计算机与外部串行设备之间的数据传输通道.由于串行通信方便易行,所以应用广泛.详细分析了用VC++实现PC与单片机等设备串行通信的方法,包括单线程通信、多线程下实现串行通信及如何在单线程中建立自定义的通信类等,用Windows提供的相应文件I/O函数与通信函数,编制出了符合不同需要的通信程序,并给出了关键代码.
CommPort is the data transmission channel between PC and the outside serial equipment. Its simplicity and convenience make it widely used. This paper gives a detailed analysis of the method, including sing-wire and multi-wire communications. Different procedures are compiled to meet the various needs, based on the I/O function and communications function, provides by Windows.
出处
《西安文理学院学报(自然科学版)》
2005年第2期73-76,共4页
Journal of Xi’an University(Natural Science Edition)
关键词
串行通信
多线程
MSCOMM
serial communications
multi-communications
MSComm