dOPC Client Toolkit
Close
dOPCDA.TdOPCItem
dOPCDA_TdOPCItemdOPCDA_TdOPCItem

class for an OPCItem 

 

TdOPCItem = class(TdOPCItemData);
class TdOPCItem : public TdOPCItemData;

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). 

Here an example how to add an ItemId to a OPC group:

G.OPCItems.AddItem('Random.String');

In OPC UA, every entity in the address space is a unique node. 

Each node has a NodeId object, which is has 3 properties:

Property
NamespaceIndex
The namespace index as a number. Default is 0.
IdentifierType
The data type of the identifier. Default is string
Identifier
The identifier for a node.

Following Identifier types are supported:

IdentifierType
character
number
i
string
s
globally unique identifier (GUID)
g
opaque value (ByteString)
b

To convert a NodeId object to a string based ItemId you have to use following format: 

ItemId := ns=<NamespaceIndex>;<Identifiertype>=<Identifier> 

Examples: 

G.OPCItems.AddItem('ns=0;i=2256'); // NodeId with IdentifierType i = number and NamespaceIndex = 0 

G.OPCItems.AddItem('ns=5;s=Random1'); // NodeId with IdentifierType s = string and NamespaceIndex = 5

Associated with each item is, amongst other things, a Value, Quality and a TimeStamp.

Kassl GmbH Copyright © 2019. All rights reserved.