MCPcopy Create free account
hub / github.com/FreeOpcUa/python-opcua / get_parent

Method get_parent

opcua/common/node.py:443–454  ·  view source on GitHub ↗

returns parent of the node. A Node may have several parents, the first found is returned. This method uses reverse references, a node might be missing such a link, thus we will not find its parent.

(self)

Source from the content-addressed store, hash-verified

441 return path
442
443 def get_parent(self):
444 """
445 returns parent of the node.
446 A Node may have several parents, the first found is returned.
447 This method uses reverse references, a node might be missing such a link,
448 thus we will not find its parent.
449 """
450 refs = self.get_references(refs=ua.ObjectIds.HierarchicalReferences, direction=ua.BrowseDirection.Inverse)
451 if len(refs) > 0:
452 return Node(self.server, refs[0].NodeId)
453 else:
454 return None
455
456 def get_child(self, path):
457 """

Calls 2

get_referencesMethod · 0.95
NodeClass · 0.85