实时数据采集是工业控制中极为重要的环节。在某项目中,以Visual Studio为开发工具,上位机对可编程逻辑控制器( PLC)进行数据实时采集使用了两种方案:一种是采用基于消息机制的WM_TIMER定时器,另一种是微软提供的多媒体定时器。阐述了两种定时器的实现方法及其优缺点,可在具体应用中适当选择。最后设计实验对两种定时器进行了十分直观的对比。%Real-time data collection is extremely important in industrial control link .In a project,development tools in Visual Studio,PC acquires real-time data on PLC using the two programs:One is WM_TIMER timer based on the messages mecha-nism,Another is Microsoft's multimedia timer.This paper describes the advantages and disadvantages of both methods ,which can be appropriately selected Depending on the application .Finally,we carried out pretty straightforward contrast on the two timers through the design of experiments .
展开▼