详细信息
多线程CSerialPort类的多串口通信实现 被引量:4
Realizing the multi-serial port communication based on the multithread Cserialport class
文献类型:期刊文献
中文题名:多线程CSerialPort类的多串口通信实现
英文题名:Realizing the multi-serial port communication based on the multithread Cserialport class
作者:王艳伟[1] 程放[1] 周玉成[1]
第一作者:王艳伟
机构:[1]中国林业科学研究院木材工业研究所
年份:2012
卷号:23
期号:2
起止页码:1-4
中文期刊名:木材加工机械
外文期刊名:Wood Processing Machinery
收录:北大核心:【北大核心2011】;
基金:农业科技成果转化基金项目(2010GB24320612)
语种:中文
中文关键词:多线程机制;CSerialPort类;多串口通信;VS2010
外文关键词:multithread mechanism; Cserialport class; multi-serial port communication; VS2010
分类号:TS642;TP311
摘要:RS-232串口通信的优点是硬件线路简单、灵活方便,以致在很多控制领域有广泛应用。本文对工业通信中广为流行的多线程CSerialPort类,剖析Windows环境下编程的多线程以及同步/异步操作I/O通信端口等。针对实际应用中该类的缺陷和不便,从ASCII文本和二进制数据兼容、修改串口接收字符函数等方面对其进行必要改进。最后基于VS2010平台下,用改进后的CSerialPort类给出开发多串口通信程序的实例,对单个串口连接多个设备的问题,提出可用的解决方案。
The advantage of RS-232 serial communication is simple hardware circuit, flexible and convenient, so it is widely used in many fields. This paper stated the very popular multithread CSerialPort class in industry communication, analyzed the multithread, synchronous or asynchronous I/O communication ports in the range of Windows program. Aiming at the defect and inconvenience of this class in practical application, from ASCII text and binary data compatibility, changing the serial receiving char function and other aspects and making the necessary improvement. Finally based on the stage of VS2010, giving a practical program example of Multi-serial port communication with the changed CSerialPort class about single serial port linking multi equipment, puting forward the available method.
参考文献:
正在载入数据...