Documentation

DataType

Client item's data type

Description

DataType indicates the data type of the item as stored in the daitem object in the MATLAB® workspace. You can specify the data type when the item is created using the additem function. If you do not specify a data type, or if the requested data type is rejected by the server, the canonical (native) data type is used. If the client associated with the item is not connected, the data type is set to 'unknown' until the client is connected.

The OPC server uses this data type to store the item value. The CanonicalDataType property of a daitem object provides information on the canonical data type of that item on the server.

OPC communication uses COM Variant data types to send information between the server and client. These are automatically translated to an equivalent MATLAB data type for the COM Variant types defined below. Any data type not included in this list is returned as 'unknown'.

OPC Toolbox™ Data Type

COM Data Type

MATLAB Data Type

double

VT_R8

double

char

VT_BSTR

char

single

VT_R4

single

uint8

VT_UI1

uint8

uint16

VT_UI2

uint16

uint32

VT_UI4

uint32

uint64

VT_UI8

uint64

int8

VT_I1

int8

int16

VT_I2

int16

int32

VT_I4

int32

int64

VT_I8

int64

currency

VT_CY

double

date

VT_DATE

double

logical

VT_BOOL

logical

double

VT_EMPTY

Empty array ([])

Characteristics

Access

Read-only while logging

Applies to

daitem

Data type

string

Values

[{'unknown'} | 'double' | 'char' | 'single' | 'uint8' | 'uint16' | 'uint32' | 'uint64' | 'int8' | 'int16' | 'int32' | 'int64' | 'currency' | 'date' | 'logical']

See Also

Functions

additem

Properties

CanonicalDataType

Was this topic helpful?