findNodeByName (opcua)

Find nodes by name

Syntax

FoundNodes = findNodeByName(NodeList,NodeName)
FoundNodes = findNodeByName(NodeList,NodeName,'-once')
FoundNodes = findNodeByName(NodeList,NodeName,'-partial')
FoundNodes = findNodeByName(NodeList,NodeName,'-once','-partial')

Description

FoundNodes = findNodeByName(NodeList,NodeName) searches the descendants of NodeList for all nodes whose Name property matches NodeName. The search among all nodes, including NodeList, is not case sensitive.

FoundNodes = findNodeByName(NodeList,NodeName,'-once') stops searching when one node has been found.

FoundNodes = findNodeByName(NodeList,NodeName,'-partial') finds all nodes that start with NodeName.

FoundNodes = findNodeByName(NodeList,NodeName,'-once','-partial') finds only the first partial match.

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

Examples

Find the ServerCapabilities node from the server node.

UaClient = opcua('localhost',51210);
connect(UaClient);
serverNode = findNodeByName(UaClient.Namespace,'Server','-once');
capabilitiesNode = findNodeByName(serverNode,'ServerCapabilities')
capabilitiesNode = 
OPC UA Node object:
                      Name: ServerCapabilities
               Description: Describes capabilities supported by the server.
            NamespaceIndex: 0
                Identifier: 2268
                  NodeType: Object

                    Parent: Server
                  Children: 14 nodes.

See Also

Functions

Introduced in R2015b