Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import xml error #380

Open
zx-zx-zx opened this issue Jan 12, 2021 · 2 comments
Open

Import xml error #380

zx-zx-zx opened this issue Jan 12, 2021 · 2 comments

Comments

@zx-zx-zx
Copy link

Question 1:The following error occurred while adding the XML file(Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml):opcua.ua.uaerrors._auto.BadNodeIdExists: "The requested node id is already used by another node."(BadNodeIdExists)
cryptography is not installed, use of crypto disabled
cryptography is not installed, use of crypto disabled
uamodeler.model_manager - INFO - Starting server on opc.tcp://0.0.0.0:48400/freeopcua/uamodeler/')
uamodeler.server_manager - INFO - Starting python-opcua server')
opcua.server.server - WARNING - Endpoints other than open requested but private key and certificate are not set.')
opcua.server.binary_server_asyncio - WARNING - Listening on 0.0.0.0:48400')
IMPORT d:/我的文档/桌面/zxiang/OPC UA/open62541/deps/ua-nodeset/DI/Opc.Ua.Di.NodeSet2.xml
opcua.common.xmlparser - WARNING - Parsing value of type 'QualifiedName' not implemented')
IMPORT d:/我的文档/桌面/zxiang/OPC UA/open62541/deps/ua-nodeset/PlasticsRubber/GeneralTypes/1.02/Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml
opcua.common.xmlimporter - WARNING - failure adding node NodeData(nodeid:NumericNodeId(ns=1;i=6318))')
uawidgets.utils - ERROR - ('Error no extension class registered ', 'PIDParametersDataType', NumericNodeId(ns=2;i=3023))')
Traceback (most recent call last):
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\uawidgets\utils.py", line 21, in wrapper
result = func(self, *args)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\uamodeler\refnodesets_widget.py", line 42, in add_nodeset
self.import_nodeset(path)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\uamodeler\refnodesets_widget.py", line 50, in import_nodeset
self.server_mgr.import_xml(path)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\uamodeler\server_manager.py", line 68, in import_xml
return self._backend.import_xml(path)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\uamodeler\server_manager.py", line 112, in import_xml
return self._server.import_xml(path)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\server\server.py", line 510, in import_xml
return importer.import_xml(path, xmlstring)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 67, in import_xml
node = self._add_node_data(nodedata)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 86, in _add_node_data
node = self.add_variable(nodedata)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 207, in add_variable
attrs.Value = self._add_variable_value(obj,)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 291, in _add_variable_value
extobj = self._make_ext_obj(ext)
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 238, in _make_ext_obj
ext = self._get_ext_class(obj.objname)()
File "C:\Users\admin\AppData\Roaming\Python\Python39\site-packages\opcua\common\xmlimporter.py", line 233, in _get_ext_class
raise Exception("Error no extension class registered ", name, nodeid)
Exception: ('Error no extension class registered ', 'PIDParametersDataType', NumericNodeId(ns=2;i=3023))

Question 2:Can I export. BSD file,i need Opc.Ua.PlasticsRubber.GeneralTypes.Types.bsd

@destogl
Copy link
Member

destogl commented Jan 13, 2021

Hi @zx-zx-zx,

Q1: you are using some node ID which is already used by the system: Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml):opcua.ua.uaerrors._auto.BadNodeIdExists: "The requested node id is already used by another node."(BadNodeIdExists)
Solution: If you can, change your NodeId by e.g. change namespace

Q2: I don't think so. Try FreeOpcUa/opcua-modeler. the tool is created for such things.

@zx-zx-zx
Copy link
Author

Hi @zx-zx-zx,

Q1: you are using some node ID which is already used by the system: Opc.Ua.PlasticsRubber.GeneralTypes.NodeSet2.xml):opcua.ua.uaerrors._auto.BadNodeIdExists: "The requested node id is already used by another node."(BadNodeIdExists)
Solution: If you can, change your NodeId by e.g. change namespace

It's a standard specification document, and I can't change.

Q2: I don't think so. Try FreeOpcUa/opcua-modeler. the tool is created for such things.

But I didn't find the relevant function, can you tell me how to do it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants