Main Content

findNodeById

Find OPC UA server nodes by namespace index and identifier

    Description

    foundNode = findNodeById(nodeList,nsInd,id) searches nodeList for a node whose NamespaceIndex and Identifier properties match nsInd and id, respectively.

    This function might query the server for further descendants (children) of nodeList.

    example

    Examples

    collapse all

    Create an OPC UA client object and connect to an OPC UA server on the localhost. Find the ServerCapabilities node in the server namespace identified by Index 0, Identifier 2268.

    uaClient = opcua("localhost",51210);
    connect(uaClient);
    capabilitiesNode = findNodeById(uaClient.Namespace,0,2268)
    capabilitiesNode = 
    
    OPC UA Node:
    
       Node Information:
                          Name: 'ServerCapabilities'
                   Description: 'Describes capabilities supported by the server.'
                NamespaceIndex: 0
                    Identifier: 2268
                      NodeType: 'Object'
    
       Hierarchy Information:
                        Parent: Server
                      Children: 14

    Input Arguments

    collapse all

    List of nodes, specified as an array of node objects. For information on node object functions and properties, see OPC UA Node.

    Namespace index, specified as an integer.

    Namespace identifier, specified as character vector, string, or integer.

    Output Arguments

    collapse all

    Matching node, returned as a node object.

    Version History

    Introduced in R2015b

    expand all

    See Also

    Functions