Variable Types

OPC UA supports a number of data types for all sorts of cases. These variables are produced by one or more field devices such as sensors and actuators, then they are consumed by the OPC UA server. The OPC UA server then notifies subscribed OPC UA clients of these variables. The OPC UA clients then will consume all data produced by sensors and actuators through the OPC UA server.

Below, we have a table of current primitive variable types. Other variable types can be composed/derived from it.

ID Name Nullable Default Description
1 Boolean No false true or false
2 SByte No 0 integer [−128, ..., 127]
3 Byte No 0 integer [0, ..., 255]
4 Int16 No 0 integer [−32,768, ..., 32,767]
5 UInt16 No 0 integer [0, ..., 65,535]
6 Int32 No 0 integer [−2,147,483,648, ..., 2,147,483,647]
7 UInt32 No 0 integer [0, ..., 4,294,967,295]
8 Int64 No 0 integer [−9,223,372,036,854,775,808, ..., 9,223,372,036,854,775,807]
9 UInt64 No 0 integer [0, ..., 18,446,744,073,709,551,615]
10 Float No 0 IEEE single precision floating point value (32 bit)
11 Double No 0 IEEE double precision floating point value (64 bit)
12 String Yes null sequence of Unicode characters
13 DateTime Yes DateTime.MinValue An instance in time
14 Guid Yes All zeros A 16-byte value that can be used as a globally unique identifier
15 ByteString Yes null A sequence of octets
16 XmlElement Yes null A sequence of Unicode characters that is an XML element
17 NodeId Yes All fields set to default An identifier for a node in the address space of an OPC UA Server
18 ExpandedNodeId Yes All fields set to default A NodeId that allows the namespace URI to be specified instead of an index
19 StatusCode No Good A numeric identifier for an error or condition that is associated with a value or an operation
20 QualifiedName Yes All fields set to default A name qualified by a namespace
21 LocalizedText Yes All fields set to default Human readable text with an optional locale identifier
22 ExtensionObject Yes All fields set to default A structure that contains an application specific data type that may not be recognized by the receiver
23 DataValue Yes All fields set to default A data value with an associated status code and timestamps
24 Variant Yes Null A union of all of the types specified above
25 DiagnosticInfo Yes No fields specified A structure that contains detailed error and diagnostic information associated with a StatusCode