OPC标准中数据的获取方式有定时主动查询和订阅两种,采用订阅方式,客户端无需等待,有利于程序效率的提高。本文剖析了OPC COM-DA以及OPC XML-DA中订阅方式的实现机制并做了比较。OPC COM-DA与OPC XML-DA各有优点,在工程中我们可以根据实际需要,选择合适的实现方式。
In the OPC specification,there are two types of device read requests:synchronous reads and subscription reads. Subscription reads are more efficient than synchronous reads,because the OPC client does not have to waste time polling the OPC server for changed data and waiting for data to come back from a request.This paper makes a deep analysis on the subscription mechanism of OPC COM-DA and OPC XML-DA.We can implement our projects with OPC COM-DA or OPC XML- DA,according to the requirement.