Main Content

OPC UA Server Data Types

OPC UA servers store data retrieved from sensors, actuators and other data sources, in variable nodes. Each variable node stores and retrieves data as a specific server data type, either as a single value or an array of values. The ServerDataType property of an OPC UA node object describes the OPC UA data type in which the server stores the node Value.

The OPC UA Standard defines simple data types and structures which consist of fields containing other data types. Vendors and standards organizations can define custom data types using these standard types. These custom data types are represented on the server as multiple nodes, each containing a standard data type.

When you read data from the server, MATLAB® translates the value into the corresponding MATLAB data type. When you write data to the server, specify the values in the MATLAB data type that corresponds to the OPC UA data type.

This table lists the OPC UA Standard data types and their corresponding MATLAB data types.

OPC UA Data TypeMATLAB Data TypeReadWriteNotes
BooleanLogical 
Byteuint8 
ByteStringuint8 vector Arrays are returned as cell arrays of uint8 values.
DateTimeDatetimeNumeric values written are interpreted as MATLAB datetime.
DoubleDouble 
ExpandedNodeIdStructure  
FloatSingle 
GuidCharacter vector Arrays are returned as cell arrays of encoded character vectors.
Int16int16 
Int32int32 
Int64int64 
LocalizedTextCharacter vectorArrays are returned as cell arrays of character vectors.
NodeIdCharacter vector Arrays are returned as cell arrays of encoded character vectors.
QualifiedNameCharacter vector Arrays are returned as cell arrays of encoded character vectors.
SByteint8 
StringCharacter vectorArrays are returned as cell arrays of character vectors.
UInt16uint16 
UInt32uint32 
UInt64uint64 
XmlElementCharacter vector Arrays are returned as cell arrays of character vectors.

See Also

Functions

External Websites