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 Type | MATLAB Data Type | Read | Write | Notes |
|---|---|---|---|---|
Boolean | Logical | ✔ | ✔ | |
Byte | uint8 | ✔ | ✔ | |
ByteString | uint8 vector | ✔ | Arrays are returned as cell arrays of uint8 values. | |
DateTime | Datetime | ✔ | ✔ | Numeric values written are interpreted as MATLAB datetime. |
Double | Double | ✔ | ✔ | |
ExpandedNodeId | Structure | ✔ | ||
Float | Single | ✔ | ✔ | |
Guid | Character vector | ✔ | Arrays are returned as cell arrays of encoded character vectors. | |
Int16 | int16 | ✔ | ✔ | |
Int32 | int32 | ✔ | ✔ | |
Int64 | int64 | ✔ | ✔ | |
LocalizedText | Character vector | ✔ | ✔ | Arrays are returned as cell arrays of character vectors. |
NodeId | Character vector | ✔ | Arrays are returned as cell arrays of encoded character vectors. | |
QualifiedName | Character vector | ✔ | Arrays are returned as cell arrays of encoded character vectors. | |
SByte | int8 | ✔ | ✔ | |
String | Character vector | ✔ | ✔ | Arrays are returned as cell arrays of character vectors. |
UInt16 | uint16 | ✔ | ✔ | |
UInt32 | uint32 | ✔ | ✔ | |
UInt64 | uint64 | ✔ | ✔ | |
XmlElement | Character vector | ✔ | Arrays are returned as cell arrays of character vectors. |
See Also
Functions
opcua|opcuanode|readValue|writeValue