dOPC Client Toolkit

Adds an OPC item node to an OPC Group.

function AddItem(ItemId: string; later: boolean = false): TdOPCItem; virtual;
virtual __fastcall TdOPCItem AddItem(AnsiString ItemId, boolean later = false);
The name of the item you want to add to the group. See also TdOPCItem
If "true" then the OPC item will be added to the client group but not to the OPC server. If you have added uses all items, use OPCAddAllItems to add items with one call to the OPC Server.

If you have a huge number of items it is recommeded to use
Later = true, to speed up and to minimize the communication between OPC client and server.

A OPC item also called ("variable","tag" or "node") represents a value in the underlying device or system. To identify OPC Items the TdOPCDAClient works with unique ItemIds. The ItemId is a string. To get e.g. data changes for an OPC item you have add the ItemId to a OPC group (see also TdOPCGroup).

var Group: TdOPCGroup; begin Group := dOPCClient.OPCGroups.Add('MyGroup',true,false); for i := 0 to 999 do // add 1000 OPC Items begin // Parameter "true" means: no direct add to the OPC server subscription (add later) Group.OPCItems.AddItem(format('ns=6;s=DataItem_%.4d',[i]), true); end; Group.OPCItems.OPCAddAllItems; // Now add all Items with one OPC call end;
Kassl GmbH Copyright © 2023. All rights reserved.