Main Content

readModified

Read modified data from an OPC HDA server

    Description

    DObj = readModified(HdaClient,ItmList,StartTime,EndTime) reads modified data from the items defined by ItmList, stored on the OPC HDA server connected to OPC HDA Client HdaClient, between StartTime (inclusive) and EndTime (exclusive).

    DObj contains only data items that have been modified, replaced, or deleted on the OPC HDA server; that is, only data values that return a quality of 'Extra Data' during a readRaw operation. If a value has been modified multiple times, all values for that time are returned.

    Some servers do not support this function.

    example

    Examples

    collapse all

    Create an OPC HDA client and connect the client to the server.

    hdaObj = opchda('localhost','MyHDAServer.1');
    connect(hdaObj);

    Read modified data from the last day, for two items.

    DObj = readModified(hdaObj,{'Random.Real8','Random.Real4'},datetime("now")-days(1),datetime("now"));

    Input Arguments

    collapse all

    OPC HDA client, specified as an OPC HDA client object.

    Example: opchda()

    HDA items, specified as a character vector, string, or supporting array of either.

    Example: {'Random.Real8','Random.Real4'}

    Data Types: char | string | cell

    Time boundaries, specified as datetime values returned by datetime function.

    Example: datetime(2018,11,23)

    Data Types: datetime

    Output Arguments

    collapse all

    Raw OPC HDA data returned as an array of OPC HDA data objects, with one element per item.

    Version History

    Introduced in R2011a

    See Also

    Functions