Skip to main content

Information Model

In OPC UA, all "visible data" on the server is organized into a node tree called Address Space. The client does not access memory directly; it accesses nodes in the address space.

Further Reading

Address Space: Three Core Directories​

OPC Foundation The server's address space must contain three root directories:

Root (i=84)
├── Objects (i=85) ← business data / Server status / custom nodes all live here
├── Types (i=86) ← ObjectType / VariableType / DataType / ReferenceType definitions
└── Views (i=87) ← view (subset) definitions, rarely used

The Server node (i=2253) is located under "Objects" and contains ServerStatus/ServerCapabilities/ ServerArray/, etc NamespaceArray.

NodeId​

Each node has a globally unique NodeId, consisting of a namespace index + identifier:

NodeId format:                       Example
i=N (ns=0, numeric) i=2258 → CurrentTime
ns=N;i=M (namespace N, numeric) ns=2;i=1001
ns=N;s=... (string) ns=2;s=Temperature
ns=N;g={...} (GUID) ns=3;g={550e8400-...}
ns=N;b=base64 (ByteString) ns=4;b=YWJjZA==
  • ns=0 is the standard OPC Foundation namespace; clients can hard-code it (i=2258 always represents CurrentTime)
  • ns=1+ is a server-side custom namespace; the client uses the collection Namespaces lookup NamespaceUri↔ Index mapping

NamespaceArray​

On the server side, NamespaceArray (i=2255) lists all namespaces URI:

[0] http://opcfoundation.org/UA/
[1] urn:server:hostname (server-local)
[2] urn:my-company:plc1
[3] http://my-company.com/UA/

Once the client connects, it loads automatically SDKNamespaceArray; you ua.Namespaces.GetIndex("urn:my-company:plc1") can retrieve the index for URI that instance using. Note: NamespaceIndex Unstable (This may change when the server restarts), but it is stable NamespaceUri—so production code should not hard-code ns=2; it must be looked up first.

Attributes​

Each node has a set of standard attributes, which are defined OPC Foundation AttributeId as follows:

AttributeIdMeaningApplicable NodeClass
1 (NodeId)Node IDAll
2 (NodeClass)Node TypeAll
3 (BrowseName)Browse NameAll
4 (DisplayName)Display NameAll
5 (Description)DescriptionAll
13 (Value)The value of a variableVariable
14 (DataType)Data TypesVariable, VariableType
17 (AccessLevel)Access LevelVariable
21 (Executable)Is it executable?Method

Read / Write Default operation Attribute 13 (Value), but it can also read NodeId / DisplayName / DataType or any other attribute.

A Complete Example​

Objects (i=85)
└── Calculator (ns=2;s=Calculator)
NodeClass: Object
BrowseName: 2:Calculator
DisplayName: Calculator

├── Add (ns=2;s=Calculator.Add)
│ NodeClass: Method
│ InputArguments: [a:Int32, b:Int32]
│ OutputArguments: [sum:Int32]
│
└── LastResult (ns=2;s=Calculator.LastResult)
NodeClass: Variable
DataType: Int32
AccessLevel: CurrentRead | CurrentWrite
Value: 7

The client can:

  • Browse("ns=2;s=Calculator") → List the two child nodes, Add and LastResult
  • Read("ns=2;s=Calculator.LastResult") → Get a 7
  • Call("ns=2;s=Calculator", "ns=2;s=Calculator.Add", 3, 4) → Returns 7

Why was it designed this way?​

By packaging "data" as "nodes with metadata (DataType/Description/Unit/Range)," clients can browse and discover the data without needing to know the data format in advance. This is the fundamental difference OPC UA from traditional "address = register number" protocols such S7 as Modbus.