C++ Based OPC UA Client/Server/PubSub SDK
OpcUa_NodeId Struct Reference

An identifier for a node in the address space of an OPC UA Server. More...

#include <opcua_builtintypes.h>

Inherited by UaNodeIdPrivate.


union  Identifier
 The identifier for a Node in the AddressSpace of an OPC UA Server. More...

Public Attributes

OpcUa_UInt16 IdentifierType
 The format and data type of the identifier.
OpcUa_UInt16 NamespaceIndex
 The index for a namespace URI.

Detailed Description

An identifier for a node in the address space of an OPC UA Server.

A Server shall persist the NodeId of a Node, that is, it is not allowed to generate new NodeIds when rebooting. The server is not allowed to change the namespace index for a namespace URI as long as the server is not restarted, but new namespaces can be added. The namespace index for a namespace URI may change after a server restart.

Clients must be prepared for changes of the namespace index in a NodeId and must persist their own namespace table together with the stored NodeIds for a server.

The following three elements identify a Node within a Server:

Name Type Description
namespaceIndex UInt16 The index for a namespace URI used in an OPC UA server
identifierType enum The format and data type of the identifier
identifier * The identifier for a node in the address space of an OPC UA server

Namespace Index

The namespace is a URI that identifies the naming authority responsible for assigning the identifier element of the NodeId. Naming authorities include the local server, the underlying system, standards bodies and consortia. It is expected that most nodes will use the URI of the server or of the underlying system.

Using a namespace URI allows multiple OPC UA servers attached to the same underlying system to use the same identifier to identify the same object. This enables clients that connect to those Servers to recognise Objects that they have in common.

Namespace URIs are identified by numeric values in OPC UA services to permit more efficient transfer and processing (e.g. table lookups). The numeric values used to identify namespaces correspond to the index into the NamespaceArray. The NamespaceArray is a variable that is part of the Server object in the address space.

The URI for the OPC UA namespace is "http://opcfoundation.org/UA/". Its corresponding index in the namespace table is 0.

The Namespace URI is case sensitive.

Identifier Type

The IdentifierType element identifies the type of the NodeId, its format and its scope. The following IdentifierTypes are available:

Value Description
OpcUa_IdentifierType_Numeric Numeric value
OpcUa_IdentifierType_String String value
OpcUa_IdentifierType_Guid Globally Unique Identifier
OpcUa_IdentifierType_Opaque Namespace specific format in a ByteString

Identifier value

The identifier value element is used within the context of the first two elements to identify a node. Its data type and format is defined by the identifierType.

Numeric identifiers are typically used for static namespaces or for NodeIds in generated code. Such identifiers in generated code have typically defines generated which makes them easy to use and read in code.

String identifiers are typically used for nodes that are dynamically generated during system configuration. The string is either a path of nodes with a server specific delimiters or a server specific addressing schema contained in the string.

String identifiers are case sensitive. That is, clients shall consider them case sensitive. Servers are allowed to provide alternative NodeIds and using this mechanism severs can handle NodeIds as case insensitive.

Normally the scope of NodeIds is the server in which they are defined. For certain types of NodeIds, NodeIds can uniquely identify a Node within a system, or across systems (e.g. GUIDs). System-wide and globally-unique identifiers allow clients to track Nodes, such as work orders, as they move between OPC UA servers as they progress through the system.

Opaque identifiers are identifiers that are free-format byte strings that might or might not be human interpretable.

Identifier values of IdentifierType STRING are restricted to 4096 characters. Identifier values of IdentifierType OPAQUE are restricted to 4096 bytes.

A null NodeId has special meaning. For example, many services define special behaviour if a null NodeId is passed as a parameter. A null NodeId always has a NamespaceIndex equal to 0. A node in the address space cannot have a null NodeId. Each identifier type has a set of identifier values that represent a null NodeId:

Identifier Type Identifier
STRING A null or Empty String ("")
GUID A Guid initialised with zeros (e.g. 00000000-0000-0000-0000-000000)
OPAQUE A ByteString with Length=0

The documentation for this struct was generated from the following file: