dOPC Client Toolkit
Close
dOPCDA.TdOPCGroup.AsyncWrite

AsyncWrite performs an asynchronous write 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 AsyncWrite(aItemList: TdOPCItemList = nil): boolean;
__fastcall boolean AsyncWrite(TdOPCItemList aItemList = null);

The values are returned via the OnDataChange or the OnWriteError event. The result will be True on successful execution, otherwise False. Writing to the physical device is not affected by the Active state of the group or item.

procedure TForm1.WriteValues; var ItemList: TdOPCItemList; begin ItemList := TdOPCItemList.Create(OPCServer.OPCGroups[i]); //we want to write new values to all Items of the first Group for i := 0 to ItemList.Count-1 do ItemList[i].WantValue := random(100); OPCServer.OPCGroups[i].AsyncWrite(ItemList); //write values to OPC server ItemList.Free; end; procedure TForm1.OPCServerWriteError(Sender: TObject; ItemList: TdOPCItemList); begin ItemList.CheckOPCErrors('Write Items...',false); //show errors end;
Kassl GmbH Copyright © 2024. All rights reserved.