Main Content

OPC UA Server Data Types

OPC UA servers store data retrieved from sensors, actuators and other data sources, in Variable Nodes. The Value of each Variable Node is stored and retrieved as a specific Server Data Type, and may be a single value, or an array of values of that data type. The ServerDataType property of an opc.ua.Node object describes the OPC UA data type used by the server to store the node Value.

When you read data from the server, the value is translated into a corresponding MATLAB® data type.

The OPC UA Standard defines simple data types, and Structures which consist of fields containing other data types. Vendors and standards organizations may define extended Data Types, but these are all collections of standard data types, and these collections can be retrieved as multiple Nodes containing Standard Data Types.

The following table describes the OPC UA Standard Data Types, and how these are represented in MATLAB. Any ServerDataType value not shown here cannot be read by Industrial Communication Toolbox™.

OPC UA Data TypeMATLAB Data TypeNotes
BooleanLogical 
Byteuint8 
ByteString (*)uint8 vectorArrays converted to cell array of uint8
DateTime (*)Datetime 
DoubleDouble 
ExpandedNodeId (*)StructureFields: NodeId, NaspaceUri, ServerIndex
FloatSingle 
Guid (*)Encoded character vectorArrays converted to cell array of character vectors
Int16int16 
Int32int32 
Int64int64 
LocalizedTextCharacter vectorArrays converted to cell array of character vectors
NodeId (*)Encoded character vectorArrays converted to cell array of character vectors
QualifiedName (*)Encoded character vectorArrays converted to cell array of character vectors
SByteint8 
StringCharacter vectorArrays converted to cell array of character vectors
Structure (*)Structure 
Time (*)DatetimeArrays not supported.
UInt16uint16 
UInt32uint32 
UInt64uint64 
XmlElement (*)Character vectorArrays converted to cell array of character vectors

When writing values to an OPC UA server, the value is translated to the equivalent OPC UA Data Type as long as the value is specified as the MATLAB data type described above. You cannot write OPC UA Data Types marked (*).

External Websites