摘要
串行通信作为一种灵活、方便、可靠的通信方式,广泛应用于计算机与其他设备之间的通信以及工业控制系统中,是计算机与外部设备进行数据通信时经常使用的方式之一。本文介绍了MSComm控件实现串口通信的基础知识,并且研究了利用MSComm控件实现串口通信的关键技术问题,指出MSComm控件实现PC间串口通信的一般步骤,在VC++6.0环境下利用MSComm实现PC与PC之间的串口通信,最后通过一个实例给出了MSComm控件在VC++6.0串口通信中的应用。无论在工业控制中PC和单片机之间的通信,还是在2台PC之间的串口通信,都具有相同的原理。只要掌握其中的通信本质,就能灵活地实现串口通信,串口控制。
As a flexible,convenient and reliable communication,serial port communication has been used in the communication between the computer and other equipment and industrial control system.It is usually used in the data communication between the computer and other equipment.This paper not only introduces the basic knowledge of the MSComm control in the realization of the serial port communication,studies the key technology issues in the realization of serial port communication by use of MSComm control but also points out the ordinary steps in the realization of the serial communication between one PC and the other one by means of MSComm control and the serial port communication between two PCs in the VC++6.0 environment.Finally,it gives an example of the application of MSComm control in the VC++6.0 environment.No matter the communication between the PC and MCU in the industrial control system and the serial port communication between the two PCs,it implys the same theory.As long as we master its essence,we can get the serial port communication and the serial control flexibly.
出处
《电子测试》
2010年第5期73-76,共4页
Electronic Test