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 Type | MATLAB Data Type | Notes |
---|---|---|
Boolean | Logical | |
Byte | uint8 | |
ByteString (*) | uint8 vector | Arrays converted to cell array of uint8 |
DateTime (*) | Datetime | |
Double | Double | |
ExpandedNodeId (*) | Structure | Fields: NodeId , NaspaceUri ,
ServerIndex |
Float | Single | |
Guid (*) | Character vector | Arrays converted to cell array of encoded character vectors |
Int16 | int16 | |
Int32 | int32 | |
Int64 | int64 | |
LocalizedText | Character vector | Arrays converted to cell array of character vectors |
NodeId (*) | Character vector | Arrays converted to cell array of encoded character vectors |
QualifiedName (*) | Character vector | Arrays converted to cell array of encoded character vectors |
SByte | int8 | |
String | Character vector | Arrays converted to cell array of character vectors |
Structure (*) | Structure | |
Time (*) | Datetime | Arrays not supported |
UInt16 | uint16 | |
UInt32 | uint32 | |
UInt64 | uint64 | |
XmlElement (*) | Character vector | Arrays 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 (*).