Main Content

table

R2026b

Convert OPC UA data object to a table

    Description

    dataTable = table(dObj) converts OPC UA data object into an M-by-2N+1 table, where M is the number of timestamps and N is the number of nodes in dObj.

    dObj must have the same time stamps for each of the nodes (elements of dObj), otherwise the function generates an error. Use tsunion, tsintersect, or resample to generate an OPC UA data object containing the same time stamp for all items in the object.

    Before conversion, elements of dObj that have the same name are combined, and empty elements are removed. As a result, N might be smaller than the number of elements in dObj.

    example

    Examples

    collapse all

    Load the OPC UA example data file, convert the uaDataVis object to have the same time stamps, and convert the result into a table.

    load opcSampleUaData;
    dUnion = tsunion(uaDataVis);
    dTab = table(dUnion);

    Input Arguments

    collapse all

    OPC UA data, specified as an array of OPC UA Data objects.

    Output Arguments

    collapse all

    OPC UA data values, returned as a table. dataTable contains an M-by-2N+1 table of data values, where M is the number of timestamps in dObj and N is the number of nodes in the array.

    The first column in the table is Timestamp, containing the datetime vector. The remaining columns are pairs: the node values and the node quality. The node value column is named after the node. The node quality column is named NodeName_Quality, containing the quality of each corresponding node value.

    Version History

    Introduced in R2015b

    See Also

    Functions