Search code examples
javaopc-uaaws-iot-greengrassnode-opcua

While browisng OPC-UA nodes, My code is iterating for tag nodes too weather if it has further nodes or not. How can I know If a node is a tagor not?


Here my code is for iterating the nodes, but its also iterating for the leaf node and checking for its child(which is the tag node), how can I directly know if the current node is tag node or not, without seeing for its child. below is my java code: '''

private void browseNode(String pName, OpcUaClient client, NodeId browseRoot)

'''


Solution

  • Nodes that are NodeClass.Variable have a Value attribute, which is probably what you would consider a "tag" Node.

    OPC UA allows Variable Nodes to have child Variable Nodes as well, though, so you can't necessarily stop browsing just because you hit a Variable Node.