摘要
为合理、高效地应用Visual Studio中的串口通信方法,利用Win32 API函数Query Performance Counter和Query Performance Frequency设计出能比较精确测试、分析基于Visual Basic中的Active X控件、Visual C++中的Active X控件和Win32 API函数的3种Visual Studio平台上串行通信方法的实时性能测试系统。该系统的硬件由4台配置基本相同的PC和连接它们的RS-232C接口线构成,软件包括串行数据发送模块、基于以上方法的串行数据接收模块及相关分析模块。实验结果表明:API方法的通信响应速度比VC控件法、VB控件法分别快约175%、220%,数据接收速度分别快约8倍、9倍。
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 QueryPerformaneeCounter and QueryPerformaneeFrequency 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 AetiveX 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.
出处
《中国测试》
CAS
北大核心
2015年第2期124-128,共5页
China Measurement & Test
基金
教育部重点项目(Z2012015)
四川省教育厅重点项目(13ZA0025)
四川省人力资源和社会保障厅重点项目([2013]203)