FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.04k stars 345 forks source link

When copy_node is used, BrowseName is not updated #1611

Open hirschenberger opened 3 months ago

hirschenberger commented 3 months ago

I have a template object that I want to clone multiple times to create my device nodes.

I have the following server code snippet:

        await self.server.import_xml(os.path.join(self.model_filepath, "../my_model.xml"))

        node = await copy_node(await self.server.nodes.objects.get_child(["3:DeviceSet", "3:MyDeviceSet"]), 
                               await self.server.nodes.objects.get_child(["3:DeviceSet", "3:MyDeviceSet","6:Template"]), 
                               ua.NodeId(0, 6), 
                               True)
        await node[0].write_attribute(ua.attribute_ids.AttributeIds.DisplayName, ua.DataValue(ua.Variant(ua.LocalizedText("Device A"))))
        await node[0].write_attribute(ua.attribute_ids.AttributeIds.BrowseName, ua.DataValue(ua.Variant(ua.QualifiedName("Device A", 6))))

My model loads correctly and the Template node is displayed with it's initial display and browsename. But the copy of my template does also still have this name displayed in the UaExpert client address space on the right, although the values are different in the attributes view on the left.

I also tried the python opensource client and it shows the same behaviour. Why do these two views converge when I update the attributes?