5.2.2.9 NodeId

The components of a NodeId are described the Table 16.

Table 16 – NodeId components
NameData TypeDescription
NamespaceUInt16

The index for a namespace URI.

An index of 0 is used for OPC UA defined NodeIds.

IdentifierTypeEnumeration

The format and data type of the identifier.

The value may be one of the following:

NUMERIC - the value is an UInt32;

STRING - the value is String;

GUID - the value is a Guid;

OPAQUE - the value is a ByteString;

ValueUInt32 or String or Guid or ByteStringThe identifier for a node in the address space of an OPC UA Server.

The DataEncoding of a NodeId varies according to the contents of the instance. For that reason, the first byte of the encoded form indicates the format of the rest of the encoded NodeId. The possible DataEncoding formats are shown in Table 17. Table 17 through Table 20 describe the structure of each possible format (they exclude the byte which indicates the format).

Table 17 – NodeId DataEncoding values
NameValueDescription
Two Byte0x00A numeric value that fits into the two-byte representation.
Four Byte0x01A numeric value that fits into the four-byte representation.
Numeric0x02A numeric value that does not fit into the two or four byte representations.
String0x03A String value.
Guid0x04A Guid value.
ByteString0x05An opaque (ByteString) value.
NamespaceUri Flag0x80See discussion of ExpandedNodeId in 5.2.2.10.
ServerIndex Flag0x40See discussion of ExpandedNodeId in 5.2.2.10.

The standard NodeId DataEncoding has the structure shown in Table 18. The standard DataEncoding is used for all formats that do not have an explicit format defined.

Table 18 – Standard NodeId Binary DataEncoding
NameData TypeDescription
NamespaceUInt16The NamespaceIndex.
Identifier*

The identifier which is encoded according to the following rules:

An example of a String NodeId with Namespace = 1 and Identifier = "Hot水" is shown in Figure 7.

Figure 7 – A String NodeId

The Two Byte NodeId DataEncoding has the structure shown in Table 19.

Table 19 – Two Byte NodeId Binary DataEncoding
NameData TypeDescription
IdentifierByte

The Namespace is the default OPC UA namespace (i.e. 0).

The Identifier Type is ‘Numeric’.

The Identifier shall be in the range 0 to 255.

An example of a Two Byte NodeId with Identifier = 72 is shown in Figure 8.

Figure 8 – A Two Byte NodeId

The Four Byte NodeId DataEncoding has the structure shown in Table 20.

Table 20 – Four Byte NodeId Binary DataEncoding
NameData TypeDescription
NamespaceByteThe Namespace shall be in the range 0 to 255.
IdentifierUInt16

The Identifier Type is ‘Numeric’.

The Identifier shall be an integer in the range 0 to 65 535.

An example of a Four Byte NodeId with Namespace = 5 and Identifier = 1025 is shown in Figure 9.

Figure 9 – A Four Byte NodeId