opcua-client-gui
opcua-client-gui copied to clipboard
connect OPCUA Server ERROR:raise RuntimeError(f"Unknown datatype for field: {sfield} in structure:{struct_name}, please report")
ERROR:raise RuntimeError(f"Unknown datatype for field: {sfield} in structure:{struct_name}, please report")
full log: uaclient.uaclient - INFO - Connecting to opc.tcp://localhost:48010 with parameters None, None, None, None') uaclient.mainwindow - WARNING - showing error: %s') uawidgets.utils - ERROR - Unknown datatype for field: StructureField(Name='Value', Description=LocalizedText(Locale=None, Text=None), DataType=NodeId(Identifier=40016, NamespaceIndex=10, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=-1, ArrayDimensions=[], MaxStringLength=0, IsOptional=False) in structure:MessageData, please report') Traceback (most recent call last): File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\uawidgets\utils.py", line 21, in wrapper result = func(self, *args) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\uaclient\mainwindow.py", line 354, in connect self.uaclient.connect(uri) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\uaclient\uaclient.py", line 126, in connect self.client.load_data_type_definitions() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\sync.py", line 94, in wrapper result = self.tloop.post(aio_func(*args, **kwargs)) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\sync.py", line 52, in post return futur.result() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 432, in result return self.__get_result() File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\concurrent\futures_base.py", line 384, in __get_result raise self._exception File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\client\client.py", line 685, in load_data_type_definitions return await load_data_type_definitions(self, node, overwrite_existing=overwrite_existing) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\common\structures104.py", line 356, in load_data_type_definitions env = await _generate_object(dts.name, dts.sdef, data_type=dts.data_type) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\common\structures104.py", line 274, in _generate_object code = make_structure_code(data_type, name, sdef) File "C:\Users\Administrator\AppData\Local\Programs\Python\Python37\lib\site-packages\asyncua\common\structures104.py", line 199, in make_structure_code raise RuntimeError(f"Unknown datatype for field: {sfield} in structure:{struct_name}, please report") RuntimeError: Unknown datatype for field: StructureField(Name='Value', Description=LocalizedText(Locale=None, Text=None), DataType=NodeId(Identifier=40016, NamespaceIndex=10, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=-1, ArrayDimensions=[], MaxStringLength=0, IsOptional=False) in structure:MessageData, please report uaclient.mainwindow - WARNING - showing error: %s')
@oroulet @CuriousCrook what datatype from log,please guid me how to connect。
I once had a similar error, but didn't have time to investigate it further at the time. At that time it seemed that the client would not support custom structures within structures.
Do you have the possibility to reproduce the problem with the Python server? If you have a NodeSet2.xml for the problematic types, you could load it in a sample server and connect the GUI client to it. If the error is then reproducible, that would be super handy for us to investigate the problem further.
@CuriousCrook thank U for reply,uaexpert can connect UA Server success by this models。 models XML INFO,this datetypes include on opcua C/C++, my server by C/C++ SDK dev。 OS:Win 10 Interl5/X64
I fix a lot of problems with structs in this pull request: https://github.com/FreeOpcUa/opcua-asyncio/pull/901 maybe you can test it.
I fix a lot of problems with structs in this pull request: FreeOpcUa/opcua-asyncio#901 maybe you can test it. asyncua/ua/uatypes.py file is 最新的 asyncua/common/structures104.py allpath is C:\Users\Administrator\AppData\Local\Programs\Python\Python37\Lib\site-packages\asyncua\common\structures104.py, I made a replacement。
@schroeder
python 3.7.0rc1 OS win10 64 48010 server :C++ OPCua opcua-asyncio:0.9.94

The fix is not released yet. You must clone asyncua from current master and install it via
pip install .
e/opcuapythonTest/opcua-client-gui
507 pip uninstall asyncua opcua-client 508 pip install . 510 opcua-client same err: uaclient.uaclient - INFO - Connecting to opc.tcp://localhost:48010 with parameters None, None, None, None') uaclient.mainwindow - WARNING - showing error: %s') uawidgets.utils - ERROR - Unknown datatype for field: StructureField(Name='Value', Description=LocalizedText(Locale=None, Text=None), DataType=NodeId(Identifier=40016, NamespaceIndex=10, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=-1, ArrayDimensions=[], MaxStringLength=0, IsOptional=False) in structure:MessageData, please report') Traceback (most recent call last): File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\uawidgets\utils.py", line 21, in wrapper result = func(self, *args) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\uaclient\mainwindow.py", line 354, in connect self.uaclient.connect(uri) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\uaclient\uaclient.py", line 126, in connect self.client.load_data_type_definitions() File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\sync.py", line 94, in wrapper result = self.tloop.post(aio_func(*args, **kwargs)) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\sync.py", line 52, in post return futur.result() File "c:\users\administrator\appdata\local\programs\python\python37\lib\concurrent\futures_base.py", line 432, in result return self.__get_result() File "c:\users\administrator\appdata\local\programs\python\python37\lib\concurrent\futures_base.py", line 384, in __get_result raise self._exception File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\client\client.py", line 685, in load_data_type_definitions return await load_data_type_definitions(self, node, overwrite_existing=overwrite_existing) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\common\structures104.py", line 356, in load_data_type_definitions env = await _generate_object(dts.name, dts.sdef, data_type=dts.data_type) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\common\structures104.py", line 274, in _generate_object code = make_structure_code(data_type, name, sdef) File "c:\users\administrator\appdata\local\programs\python\python37\lib\site-packages\asyncua\common\structures104.py", line 199, in make_structure_code raise RuntimeError(f"Unknown datatype for field: {sfield} in structure:{struct_name}, please report") RuntimeError: Unknown datatype for field: StructureField(Name='Value', Description=LocalizedText(Locale=None, Text=None), DataType=NodeId(Identifier=40016, NamespaceIndex=10, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=-1, ArrayDimensions=[], MaxStringLength=0, IsOptional=False) in structure:MessageData, please report uaclient.mainwindow - WARNING - showing error: %s')
@schroeder
You don't need to update opcua-client, you need to install the current master from asyncio: https://github.com/FreeOpcUa/opcua-asyncio.git
You don't need to update opcua-client, you need to install the current master from asyncio: https://github.com/FreeOpcUa/opcua-asyncio.git
realy realy cannot connect,python not support C/CXX some base type