检索规则说明:AND代表“并且”;OR代表“或者”;NOT代表“不包含”;(注意必须大写,运算符两边需空一格)
检 索 范 例 :范例一: (K=图书馆学 OR K=情报学) AND A=范并思 范例二:J=计算机应用与软件 AND (U=C++ OR U=Basic) NOT M=Visual
机构地区:[1]中国林业科学研究院木材工业研究所,北京100091
出 处:《木材加工机械》2012年第2期1-4,共4页Wood Processing Machinery
基 金:农业科技成果转化基金项目(2010GB24320612)
摘 要: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.
关 键 词:多线程机制 CSERIALPORT类 多串口通信 VS2010
分 类 号:TS642[轻工技术与工程] TP311[自动化与计算机技术—计算机软件与理论]
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在载入数据...
正在链接到云南高校图书馆文献保障联盟下载...
云南高校图书馆联盟文献共享服务平台 版权所有©
您的IP:18.225.72.113