Glossary · Address space

DataType

In OPC UA, a DataType is the NodeClass that defines the type of a Variable's value. DataType nodes form a hierarchy rooted at BaseDataType covering the 25 built-in types plus server-defined structures, enumerations and unions. A Variable's DataType attribute references the DataType node its value must conform to.

Built-in types

Identifiers 1 to 25 in namespace 0 are the built-in types: Boolean, SByte, Byte, Int16, UInt16, Int32, UInt32, Int64, UInt64, Float, Double, String, DateTime, Guid, ByteString, XmlElement, NodeId, ExpandedNodeId, StatusCode, QualifiedName, LocalizedText, Structure, DataValue, BaseDataType and DiagnosticInfo. Everything a server can send is ultimately one of these, encoded per Part 6. A Variant is the container that carries any of them, plus arrays and matrices.

The abstract spine

BaseDataType at i=24 is abstract, as are Number at i=26, Integer at i=27, UInteger at i=28, Structure at i=22 and Enumeration at i=29. A Variable whose DataType attribute names an abstract type is telling you the concrete type may vary per value - you must inspect the Variant, not assume. That is common on generic gateway nodes and it is legal; it is also why blind casts fail.

Server-defined types

Structures, enumerations and unions defined by a companion specification or a vendor are DataType nodes in a non-zero namespace, subtypes of Structure, Enumeration or Union. Since 1.04 each carries a DataTypeDefinition attribute describing its fields, so a client can decode it at runtime without a compiled stub or a legacy type dictionary. Without that decode, values arrive as opaque ExtensionObjects.

Example

The DataType hierarchy as it matters for decoding

BaseDataType                     (i=24, abstract)
 +- Number                       (i=26, abstract)
 |   +- Integer                  (i=27, abstract)
 |   |   +- SByte i=2, Int16 i=4, Int32 i=6, Int64 i=8
 |   |   +- UInteger             (i=28, abstract)
 |   |       +- Byte i=3, UInt16 i=5, UInt32 i=7, UInt64 i=9
 |   +- Float i=10, Double i=11
 +- String i=12, DateTime i=13, Guid i=14, ByteString i=15
 +- NodeId i=17, StatusCode i=19, QualifiedName i=20, LocalizedText i=21
 +- Enumeration                  (i=29, abstract)
 |   +- ServerState, NodeClass, MachineryItemState_Enum, ...
 +- Structure                    (i=22, abstract)
     +- Range, EUInformation, Argument, ...
     +- ns=4;i=3002 MyRecipeType   <- vendor structure, needs DataTypeDefinition
The mistake people make: Reading a Variable's DataType attribute, seeing a NodeId, and stopping there. If that NodeId names an abstract type such as Number or Structure, or a vendor structure in a non-zero namespace, you still do not know how to decode the value. Resolve the DataType node, walk HasSubtype to the concrete type, and read its DataTypeDefinition before you write parsing code.

Defined in: Part 3 - Address Space Model, DataType NodeClass and the built-in types; Part 6 - Mappings for their encodings.

Last verified 7 September 2026 against OPC UA 1.05.07. OPC UA Connect is an educational resource and is not affiliated with the OPC Foundation.

Free download
OPC UA Server Acceptance Test Pack
A 40-check acceptance test you run against a vendor's server before commissioning sign-off. Weighted scoring, three hard gates, and a one-page verdict for the supplier meeting.
Get the free test pack →
Free, no course, no login