diff --git a/asyncua/common/structures104.py b/asyncua/common/structures104.py index a67f8fe37..2d4daf940 100644 --- a/asyncua/common/structures104.py +++ b/asyncua/common/structures104.py @@ -213,6 +213,8 @@ class {struct_name}{base_class}: uatype = ua.basetype_by_datatype[sfield.DataType] elif sfield.DataType == data_type: uatype = struct_name + elif sfield.DataType != data_type and isinstance(sfield, ua.uaprotocol_auto.StructureField): + uatype = "uaprotocol_auto.StructureField" #field name is also a structure else: if log_error: _logger.error("Unknown datatype for field: %s in structure:%s, please report", sfield, struct_name) @@ -260,6 +262,7 @@ def {name}(self, value: {uatype}) -> None: else: for fname, uatype, default_value in fields: code += f" {fname}: {uatype} = {default_value}\n" + print(f"testprint: structure {fname} has Python class {code}") return code