dOPC Client Toolkit
Close
dOPCDA.TdOPCGroup.SyncRead

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.

function SyncRead(aItemList: TdOPCItemList = nil; ReadFromCache: boolean = true): boolean;
__fastcall boolean SyncRead(TdOPCItemList aItemList = null, boolean ReadFromCache = true);

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;
Kassl GmbH Copyright © 2024. All rights reserved.