dOPC Client Toolkit Help file
TdOPCGroup.AsyncWrite Method
C++
public: __fastcall boolean AsyncWrite(
    TdOPCItemList aItemList = nil
);
C#
public boolean AsyncWrite(
    TdOPCItemList aItemList
);
Visual Basic
Public Function AsyncWrite(
    aItemList As TdOPCItemList = nil
) As boolean

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.

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;
What do you think about this topic? Send feedback!
Copyright © 2001-2014 Kassl GmbH (http://www.kassl.de). All rights reserved.