You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When trying to set auto_update to a struct symbol, I receive following error:
File "/home/.../app/adapters/ads_client.py", line 93, in init_variables
symbol.auto_update = True
^^^^^^^^^^^^^^^^^^
File "/home/.../lib/python3.11/site-packages/pyads/symbol.py", line 364, in auto_update
self._auto_update_handle = self.add_device_notification(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/.../lib/python3.11/site-packages/pyads/symbol.py", line 252, in add_device_notification
attr = NotificationAttrib(length=sizeof(self.plc_type))
^^^^^^^^^^^^^^^^^^^^^
TypeError: this type has no size
I guess it has something to do, that a struct symbol has no plc_type. I think there should be a query if it is a structure or a native type like this:
if attr is None:
if self.is_structure:
size_of_struct = pyads.size_of_structure(self.structure_def)
attr = NotificationAttrib(length=size_of_struct)
else:
attr = NotificationAttrib(length=sizeof(self.plc_type))
The text was updated successfully, but these errors were encountered:
msfur
linked a pull request
Oct 8, 2024
that will
close
this issue
When trying to set auto_update to a struct symbol, I receive following error:
I guess it has something to do, that a struct symbol has no plc_type. I think there should be a query if it is a structure or a native type like this:
The text was updated successfully, but these errors were encountered: