Open NNTin opened 5 years ago
Not being able to import NodeSet2 is completely normal. It is already imported. Concerning the other one either it is a bug or it requires another nodeset before
Thanks for clarifying regarding NodeSet2.
How would I import Opc.Ua.Fdi5.NodeSet2.xml?
In SiOME I would first import Opc.Ua.Di.NodeSet2.xml and then Opc.Ua.Fdi5.NodeSet2.xml.
When I do:
self.server.import_xml("Z:/Tin/python/xml/Opc.Ua.Di.NodeSet2.xml")
self.server.import_xml("Z:/Tin/python/xml/Opc.Ua.Fdi5.NodeSet2.xml")
I'm getting: The parent node id does not to refer to a valid node.(BadParentNodeIdInvalid)
Di.NodeSet2 is built on top of NodeSet2. Fdi5.Nodeset2 is built on top of Di.NodeSet2.
Is there a different method for importing multiple xmls?
the code above is correct, might be a bug in importer.... you are welcome to try to find out. Unfortumately the code is hard to understand...If someone has ideas to improve it , it would be great...
Hallo @NNTin, I am implementing the OPC UA Server and for that I want to import the XML file into it. When I import, I am also facing the same issue - "raise UaStatusCodeError(self.value) opcua.ua.uaerrors._auto.BadNodeIdExists: The requested node id is already used by another node.(BadNodeIdExists)".
Did you find any solution for this so far? Thank you
BadNodeExist is clearly an issue with your setup or the XML file itself, not python-opcua code
My error code was different. The solution to my error was to import both models into SiOME and then export it as a single xml file.
I don't know if this solves your problem. Best of luck!
edit:
The error we share was solved by this comment:
Not being able to import NodeSet2 is completely normal. It is already imported.
As in I didn't need to import NodeSet2.
Sorry, I pasted the message wrong. Its "raise UaStatusCodeError(self.value) opcua.ua.uaerrors._auto.BadParentNodeIdInvalid: The parent node id does not to refer to a valid node.(BadParentNodeIdInvalid)"
I just found and fixed two bugs in apcua-asyncio. they should be backported to python-opcua
https://github.com/FreeOpcUa/opcua-asyncio/commit/4b85a3f12242a59faf2cec01150e2124e7875d37 and https://github.com/FreeOpcUa/opcua-asyncio/commit/681bcd6230d936aa838a44f7eee09d76eef1713b
Can someone do it?
BUT we now add a default reference type when no reference type is specified. I have no idea what the defalt should be. I used HasComponent, it might be wrong...
Hello guys,
I am also getting the same error as yours : raise UaStatusCodeError(self.value) opcua.ua.uaerrors._auto.BadParentNodeIdInvalid: "The parent node id does not to refer to a valid node."(BadParentNodeIdInvalid)
i am trying to import all these files. custom_nodeset.xml was created using siemens SiOME modelling editor. here is the code :
How did you guys solve this error? your comments and advice would be appreciated.
See #1475 . Switch to asyncua
See #1475 . Switch to asyncua
i tried but the error remain same
Sorry, I pasted the message wrong. Its "raise UaStatusCodeError(self.value) opcua.ua.uaerrors._auto.BadParentNodeIdInvalid: The parent node id does not to refer to a valid node.(BadParentNodeIdInvalid)"
did you find the solution because i am getting the same error ?
the error tells you that the parent already exist! the nodeset ia already part of the default addreassspace.
edit:
you should use asyncua instead of this repo its depricated!
I took the server-minmal.py example and added the following line between line 12 and 13:
server.import_xml("absolute-path-of-my-xml-file.xml")
It works when importing Opc.Ua.Di.NodeSet2.xml.
But when I import Opc.Ua.Fdi5.NodeSet2.xml I am getting the following error:
When I remove the troubling node from the xml the error changes to:
failure adding node NodeData(nodeid:NumericNodeId(ns=1;i=2))
When removing that again it changes to:
failure adding node NodeData(nodeid:NumericNodeId(ns=1;i=92))
and so on.
When I import Opc.Ua.NodeSet2.xml I am getting the following error:
I've been trying to figure out how I can import those xml files. I'm glad over any help.