Open mohitkumaragarwal opened 2 years ago
Dont know how to reproduce, for the test i used the Freeopc client gui and example server milo-opc, everything worked perfectly.
This issue was reported in 20222 and it was fixed at that time. I am not sure why is it still open as it was already fixed.
Hi, We have a OPC UA Server which implements OPC 40451-1 Tightening Specification. It has a structured data type called ResultDataType which has a sub-structure as a field.
While connecting to the OPC UA Server, it throws the following error, but it works with other OPC UA clients like UA Expert and DotNet based UA Clients. Can you please suggest if there is any support issue for structured types?
uaclient.uaclient - INFO - Connecting to opc.tcp://10.46.19.106:40451 with parameters None, None, None, None') asyncua.client.client - WARNING - Requested session timeout to be 3600000ms, got 120000ms instead') uaclient.mainwindow - WARNING - showing error: %s') uawidgets.utils - ERROR - Unknown datatype for field: StructureField(Name='Tags', Description=LocalizedText(Locale=None, Text='The optional Tags is a list of identifiers associated to the given result. Examples: {VIN, XYZ1234}, {PardId, E54YJH}, {SocketNumber, 5}, etc.'), DataType=NodeId(Identifier=3003, NamespaceIndex=4, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=1, ArrayDimensions=[0], MaxStringLength=0, IsOptional=True) in structure:ResultDataType, please report') Traceback (most recent call last): File "C:\Python310\lib\site-packages\uawidgets\utils.py", line 21, in wrapper result = func(self, args) File "C:\Python310\lib\site-packages\uaclient\mainwindow.py", line 354, in connect self.uaclient.connect(uri) File "C:\Python310\lib\site-packages\uaclient\uaclient.py", line 126, in connect self.client.load_data_type_definitions() File "C:\Python310\lib\site-packages\asyncua\sync.py", line 94, in wrapper result = self.tloop.post(aio_func(args, **kwargs)) File "C:\Python310\lib\site-packages\asyncua\sync.py", line 52, in post return futur.result() File "C:\Python310\lib\concurrent\futures_base.py", line 446, in result return self.get_result() File "C:\Python310\lib\concurrent\futures_base.py", line 391, in get_result raise self._exception File "C:\Python310\lib\site-packages\asyncua\client\client.py", line 676, in load_data_type_definitions return await load_data_type_definitions(self, node, overwrite_existing=overwrite_existing) File "C:\Python310\lib\site-packages\asyncua\common\structures104.py", line 324, in load_data_type_definitions env = await _generate_object(dts.name, dts.sdef, data_type=dts.data_type) File "C:\Python310\lib\site-packages\asyncua\common\structures104.py", line 242, in _generate_object code = make_structure_code(data_type, name, sdef) File "C:\Python310\lib\site-packages\asyncua\common\structures104.py", line 192, 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='Tags', Description=LocalizedText(Locale=None, Text='The optional Tags is a list of identifiers associated to the given result. Examples: {VIN, XYZ1234}, {PardId, E54YJH}, {SocketNumber, 5}, etc.'), DataType=NodeId(Identifier=3003, NamespaceIndex=4, NodeIdType=<NodeIdType.FourByte: 1>), ValueRank=1, ArrayDimensions=[0], MaxStringLength=0, IsOptional=True) in structure:ResultDataType, please report uaclient.mainwindow - WARNING - showing error: %s')