Skip to main content

Exploring a sub tree

The OPC UA Explore node can be used to explore a sub tree of the address space starting from a given node.

Example Flow

[ Inject ] → [ OPC UA Explore ] → [ Debug ]

explore a node of a OPCUA server, and get the structure of the node and its children.

Explore action

you can either

  • Inject your OPC UA address (NodeId) by the nodeId or topic property of an injected message or
  • use the nodeId attribute defined in the OpcUa-Explore node itself.

Input

The explore operation is triggered when the node receive an input message.

The nodeId to explore can be specified in the following ways, in priority order:

:msg.nodeId (string): the nodeId to explore

or if msg.nodeId is not defined:

:parameter.nodeId (string): the nodeId to read defined in the node configuration itself.

Output

:msg.payload (Object): the structure of the node and its children.

output type

  • you can control the value that will be stored on the leaf of the returned object.

  • It can be either

Leaf Output Typemsg:outputTypeDescription
ValueValuethe variable value
DataValueDataValuethe variable value with additional information
VariantVariantthe variable value with additional information
StatusCodeStatusCodethe status code of the variable
NodeIdNodeIdthe nodeId of the variable ( with namespace index)
NodeId with UriNSUNodeIdthe nodeId of the variable ( with namespace urn)
BrowsePathBrowsePaththe browse Path of the variable, starting from the Object Folder , with indexed namspace
Aliased BrowsePathAliasedBrowsePaththe browse Path of the variable, starting from the Object Folder , with aliased namspace
  • if msg.outputType is defined, then it takes precedence on the outputType attribute defined in the node configuration itself.

exclude empty flag

if (msg.excludeEmpty === true) then the node will not return empty nodes in the output structure.

follow organizes reference

  • If this flag is set to true, the node will also follow the organizes reference and return the children of the referenced node. (Origanizes, HasPropoerty and HasComponent references)
  • If this flag is set to false, the node will return the children of the input node only. (HasPropoerty and HasComponent references)

notes:

  • Once the explorer hits a variables node, it reads the associated value (Value, DataValue, Variant, StatusCode, NodeId, NodeId with Uri, BrowsePath, Aliased BrowsePath) and stores it in the leaf of the returned object. It will not explore the children of the variable node any further.

  • If the explorer hits a folder node, it will explore the children of the folder node and store them in the returned object, only if the follow Organizes reference flag is set to true.

  • you can browse the children nodes of a Variable node , by specifying the Variable node as an input.

Example

{
"payload": "ns=1;s=Temperature",
"outputType": "Value"
}

reading subtree structure

if the injected msg.payload is an object, the OPCUARead node will read the subtree structure of the node.

For instance:

{
"nodeId": "/Server/ServerStatus",
"outputType": "Value"
}

will return the following structure:

{
"payload": {
"StartTime": "2025-01-19T17:09:44.579Z",
"CurrentTime": "2025-01-21T20:24:17.285Z",
"State": 0,
"BuildInfo": {
"ProductUri": "NodeOPCUA-Server-for-CTT",
"ManufacturerName": "NodeOPCUA : MIT Licence ( see http://node-opcua.github.io/)",
"ProductName": "NodeOPCUA-Server",
"SoftwareVersion": "2.140.0",
"BuildNumber": "1234",
"BuildDate": "2020-02-01T00:00:00.000Z"
},
"SecondsTillShutdown": 0,
"ShutdownReason": {}
}
}
{
"nodeId": "/Server/ServerStatus",
"outputType": "NodeId"
}

will return the following structure:

{
"payload": {
"StartTime": "ns=0;i=2257",
"CurrentTime": "ns=0;i=2258",
"State": "ns=0;i=2259",
"BuildInfo": "ns=0;i=2260",
"SecondsTillShutdown": "ns=0;i=2992",
"ShutdownReason": "ns=0;i=2993"
}
}
{
"nodeId": "/Server/ServerStatus/BuildInfo",
"outputType": "AliasedBrowsePath"
}

will return the following structure:

{
"payload": {
"ProductUri": "/Server.ServerStatus.BuildInfo.ProductUri",
"ManufacturerName": "/Server.ServerStatus.BuildInfo.ManufacturerName",
"ProductName": "/Server.ServerStatus.BuildInfo.ProductName",
"SoftwareVersion": "/Server.ServerStatus.BuildInfo.SoftwareVersion",
"BuildNumber": "/Server.ServerStatus.BuildInfo.BuildNumber",
"BuildDate": "/Server.ServerStatus.BuildInfo.BuildDate"
}
}