Main Content

getAllChildren

Recursively retrieve all children of OPC UA server node

Syntax

AllChildNodes = getAllChildren(StartNode)

Description

AllChildNodes = getAllChildren(StartNode) returns all children of a given node as a vector of Node objects, including all children recursively.

Note

This function is memory intensive. Use it only when necessary. Alternatively, consider accessing the Children property of the node, or searching with browseNamespace, findNodeByName, or findNodeById.

Examples

This example shows how to return all children of the server node.

UaClient = opcua('localhost',51210);
connect(UaClient);
serverNode = UaClient.Namespace(1);
allServerNodes = getAllChildren(serverNode);
whos allServerNodes
  Name                Size             Bytes  Class          Attributes

  allServerNodes      1x349             2896  opc.ua.Node  

Version History

Introduced in R2015b