The components of a NodeId are described the Table 10.
Name |
Data Type |
Description |
Namespace |
UInt16 |
The index for a namespace URI. An index of 0 is used for OPC UA defined NodeIds. |
IdentifierType |
Enumeration |
The format and data type of the identifier. The value may be one of the following: NUMERIC - the value is an UInteger; STRING - the value is String; GUID - the value is a Guid; OPAQUE- the value is a ByteString; |
Value |
UInt32 or String or Guid or ByteString |
The 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 11. Table 11 through Table 14 describe the structure of each possible format (they exclude the byte which indicates the format).
Table 11 – NodeId DataEncoding values
Name |
Value |
Description |
Two Byte |
0x00 |
A numeric value that fits into the two-byte representation. |
Four Byte |
0x01 |
A numeric value that fits into the four-byte representation. |
Numeric |
0x02 |
A numeric value that does not fit into the two or four byte representations. |
String |
0x03 |
A String value. |
Guid |
0x04 |
A Guid value. |
ByteString |
0x05 |
An opaque (ByteString) value. |
NamespaceUri Flag |
0x80 |
See discussion of ExpandedNodeId in 5.2.2.10. |
ServerIndex Flag |
0x40 |
See discussion of ExpandedNodeId in 5.2.2.10. |
The standard NodeId DataEncoding has the structure shown in Table 12. The standard DataEncoding is used for all formats that do not have an explicit format defined.
Table 12 – Standard NodeId Binary DataEncoding
Name |
Data Type |
Description |
||||||||
Namespace |
UInt16 |
The 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.
The Two Byte NodeId DataEncoding has the structure shown in Table 13.
Table 13 – Two Byte NodeId Binary DataEncoding
Name |
Data Type |
Description |
Identifier |
Byte |
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.
The Four Byte NodeId DataEncoding has the structure shown in Table 14.
Table 14 – Four Byte NodeId Binary DataEncoding
Name |
Data Type |
Description |
Namespace |
Byte |
The Namespace shall be in the range 0 to 255. |
Identifier |
UInt16 |
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 = 1 025 is shown in Figure 9.