Main Content

findNodeByName

Find OPC UA server 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:

   Node Information:
                      Name: 'ServerCapabilities'
               Description: 'Describes capabilities supported by the server.'
            NamespaceIndex: 0
                Identifier: 2268
                  NodeType: 'Object'

   Hierarchy Information:
                    Parent: Server
                  Children: 14

Version History

Introduced in R2015b

See Also

Functions