摘要
介绍了在VB环境中实现串行通信的技术,提出了一种解决不可见字符传输的方法。由于VB中ActiveX控件(MSComm.OCX)提供了使用RS—232进行通信的所有协议和标准的事件处理函数、过程、属性和方法,且巧妙地将复杂的Windows编程封装起来,从而使得编程简单,易于实现。以具体的测控系统中工业PC机与智能仪表间的串行通信给出了开发实例,同时针对通信过程中存在的不可见字符的传输问题,提出了重复一字节构成双字节进行传输的解决方法。实践证明,该方法是简便有效的。
Technique of serial communication realized by VB is introduced and a method for transmitting invisible characters is proposed. MSComm.OCX supplies event handling functions, processes, properties and methods for RS-232 serial communication protocol and standard and realizes the capsulation of program in Windows. Then the program is simplified. At last, a sample for the series communication between the industrial PC and intelligent instrument in measure & control system is explained. Aiming at the problem of invisible character transmitting, a solution by doubling a-byte-character is proposed. The method is proven simple and effective.
出处
《控制工程》
CSCD
2003年第5期441-443,共3页
Control Engineering of China