Main Content

getIndexFromName

R2026b

Return indices of OPC data matching specified names

    Description

    ind = getIndexFromName(dObj,nodeName) returns the index or indices corresponding to the specified node names in the UA data object array dObj.

    example

    Examples

    collapse all

    Load the OPC UA example data file, which contains an array of UA data objects uaDataSample. Find the indices of 'Counter' and 'Sawtooth', two nodes in the array.

    load opcSampleUaData;
    ind = getIndexFromName(uaDataSample,{'Counter','Sawtooth'})
    ind =
    
         1     3

    Input Arguments

    collapse all

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

    OPC UA node name, specified as a character vector or cell array of character vectors.

    Output Arguments

    collapse all

    Index of the data object that corresponds to the specified node name, returned as a scalar or a vector.

    Version History

    Introduced in R2015b

    See Also

    Functions