public: __fastcall boolean SyncRead( TdOPCItemList aItemList, boolean ReadFromCache = true );
public boolean SyncRead( TdOPCItemList aItemList, boolean ReadFromCache );
Public Function SyncRead( aItemList As TdOPCItemList, ReadFromCache As boolean = true ) As boolean
SyncRead performs a synchronous read of the value, quality and timestamp information for all items either in the group or, if it is not nil, in the parameter aItemList.
The result will be True on successful execution, otherwise False. The function runs to completion before returning. The data can be read from cache (ReadFromCache = true) with an accuracy within the UpdateRate and the DeadBand of the group. Otherwise the data can be read directly from the device (ReadFromCache = false) in which case an actual read of the physical device is performed. The exact implementation of cache and device reads is not defined by the OPC specification. When reading from cache, the data is only valid if both group and item are active. If either the group or the item is inactive, the Quality will indicate an out-of-service value (OPC_QUALITY_OUT_OF_SERVICE). Reading from the device is not affected by the Active state of the group or item.
var ItemList : TdOPCItemList; begin ItemList := TdOPCItemList.Create(OPCServer.OPCGroups[i]); // we want to read values of all Items of the first Group OPCServer.OPCGroups[i].SyncRead(ItemList,false); // read values from OPC server ItemList.CheckOPCErrors('Read Items...',false); // show errors ItemList.Free; end;
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH (http://www.kassl.de). All rights reserved.