Glossary · Address space

HasSubtype

In OPC UA, HasSubtype is the hierarchical ReferenceType that builds type hierarchies: it points from a supertype to a subtype, with the inverse name SubtypeOf. It is identifier i=45 in namespace 0 and applies to ObjectTypes, VariableTypes, ReferenceTypes and DataTypes alike.

Inheritance made of references

A subtype inherits every instance declaration of its supertype and may add its own, or tighten an Optional declaration to Mandatory. It may not remove anything or widen a DataType. Because inheritance is expressed as ordinary references between ordinary nodes, a client can read the full type hierarchy of an unknown server by browsing HasSubtype down from BaseObjectType at i=58, BaseVariableType at i=62, BaseDataType at i=24 and References at i=31.

Why you have to walk it

Nearly every practical question about types is an ancestry question. Is this instance a MachineryItem? Does this DataType derive from Structure or from Enumeration? Is this reference a hierarchical one? None can be answered by a single NodeId comparison, and all are answered by following HasSubtype inverse until you hit the type you care about, or the root. Services accept an IncludeSubtypes flag precisely so the server can do this walk for you.

Where it appears in real models

Companion specifications are layered by HasSubtype: Robotics types derive from IA types, which derive from DI types, which derive from core UA types. Reading that chain tells you which model's semantics apply to a node and which optional nodes to expect. It also tells you what a client that only understands DI can still make sense of on a Robotics server.

Example

A layered companion-specification type chain, read by browsing HasSubtype inverse

BaseObjectType                          (i=58, ns=0)
 +- TopologyElementType                  (DI)
     +- DeviceType                        (DI)
         +- MachineryItemType             (Machinery)
             +- MachineType               (Machinery)
                 +- MotionDeviceSystemType (Robotics)

Browse( nodeId = MotionDeviceSystemType,
        direction = Inverse,
        referenceType = i=45,   // HasSubtype
        includeSubtypes = false )
  -> MachineType

Repeat until i=58. Every layer's mandatory nodes apply to the instance.
The mistake people make: Filtering on an exact type and missing every vendor subtype. A Browse with IncludeSubtypes false, or an equality check against one HasTypeDefinition target, will not see instances of a derived type - so a client tested against a reference server reports nothing against the real machine. Set IncludeSubtypes true, or walk HasSubtype yourself.

Defined in: Part 3 - Address Space Model, standard ReferenceTypes and type hierarchies.

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