dOPC Client Toolkit
Close
ua.client.uaStrToNodeId

Converts a string to a NodeId.

function uaStrToNodeId(Source: string): uaNodeId;
uaNodeId uaStrToNodeId(AnsiString Source);

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
number
character
number
0
i
string
1
s
globally unique identifier (GUID)
2
g
opaque value
3
b

 

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

ns=;= Examples: 

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

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

Kassl GmbH Copyright © 2019. All rights reserved.