您好,欢迎来到中国测试科技资讯平台!

首页> 《中国测试》期刊 >本期导读>Visual Studio中串行通信方法实时性能测试

Visual Studio中串行通信方法实时性能测试

3018    2015-04-02

免费

全文售价

作者:董圣友1, 肖继学1, 廖旋2, 程志3, 李海军1, 曾强1

作者单位:1. 西华大学机械工程与自动化学院, 四川 成都 610039;
2. 四川省工业设备安装公司, 四川 成都 610031;
3. 成都航天通信设备有限责任公司, 四川 成都 610051


关键词:串行通信;ActiveX控件;API函数;实时性


摘要:

为合理、高效地应用Visual Studio中的串口通信方法,利用Win32 API 函数QueryPerformanceCounter 和QueryPerformanceFrequency设计出能比较精确测试、分析基于Visual Basic中的ActiveX控件、Visual C++中的ActiveX控件和Win32 API函数的3种Visual Studio平台上串行通信方法的实时性能测试系统。该系统的硬件由4台配置基本相同的PC和连接它们的RS-232C接口线构成,软件包括串行数据发送模块、基于以上方法的串行数据接收模块及相关分析模块。实验结果表明:API方法的通信响应速度比VC控件法、VB控件法分别快约175%、220%,数据接收速度分别快约8倍、9倍。


Real-time performance test of the serial communication methods in Visual Studio integrated development environment

DONG Shengyou1, XIAO Jixue1, LIAO Xuan2, CHENG Zhi3, LI Haijun1, ZENG Qiang1

1. School of Mechanical Engineering and Automation, Xihua University, Chengdu 610039, China;
2. Sichuan Provincial Industrial Equipment Installation Co.,Chengdu 610031, China;
3. Chengdu Aerospace Communication Device Company Limited, Chengdu 610051, China

Abstract: ActiveX communication and API communication in Visual C++ environment and ActiveX communication in Visual Basic environment are the three serial communication methods in Visual Studio integrated development environment. In order to use the approaches in application appropriately and efficiently, such Win32 API functions as QueryPerformanceCounter and QueryPerformanceFrequency were utilized to design an experiment system that can be used to test and analyze the real-time performance of the three serial communication methods. The system was made up with 4 PC, which configures were same, and the RS-232C interfaces for the 4 PC to communicate in hardware. The system software included sending-data module, receiving-data module based on the three serial communication methods and relatively analyzing-data module. Results of experiment show that the communication of the API method responds faster than that of the ActiveX methods in Visual C++ and Visual Basic environments about 175%, 220%, respectively, and the API method receives data faster than them about 8 times, 9 times, respectively.

Keywords: serial communications;ActiceX control;API function;real-time performance

2015, 41(2): 124-128  收稿日期: 2014-3-28;收到修改稿日期: 2014-5-15

基金项目: 教育部重点项目(Z2012015);四川省教育厅重点项目(13ZA0025);四川省人力资源和社会保障厅重点项目([2013]203)

作者简介: 董圣友(1987-),男,河南商丘市人,硕士研究生,专业方向为单片机与嵌入式系统应用。

参考文献

[1] 张龙,曾国英,赵登峰,等. 机床振动信号数据采集系统设计[J]. 机床与液压,2012,40(15):71-73.
[2] 崔皆凡,木刚,万峻竹,等. 串行通信在永磁同步电机控制系统中的应用[J]. 电机与控制应用,2008,35(7):23-26.
[3] 姚飞昭,丁金华,宋鹏. 嵌入式Linux操作系统下的串行通信[J]. 大连工业大学学报,2008,27(3):270-273.
[4] 徐云,杨川. 基于串行通信的主从式虚拟仪器技术[J]. 仪器仪表学报,2003,24(3):291-294.
[5] 马斌,周文俊,黎文安,等. VB6.0用于TDS与IPC的冲击测量串行通信[J]. 高电压技术,2007,33(9):33-37.
[6] 李长林,高洁. Visual C++串口通信技术与典型实例[M].北京:清华大学出版社,2006:60-90.
[7] 廖旋,肖继学,殷巧,等. Visual C++串行通信实时性研究[J].西华大学学报,2012,31(6):65-68.
[8] 郭占社,孟永钢,苏才钧,等. 基于Windows的精确定时技术及其在工程中的应用[J]. 哈尔滨工业大学学报,2005,37(12):1717-1720.