Skip to content

Commit

Permalink
Improved implementation of checking if a struct is present.
Browse files Browse the repository at this point in the history
  • Loading branch information
msfur committed Oct 8, 2024
1 parent 4acaef1 commit b6e6fac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pyads/symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,10 +252,10 @@ def add_device_notification(
"""

if attr is None:
if self.plc_type is not None:
attr = NotificationAttrib(length=sizeof(self.plc_type))
elif self.structure_def is not None:
if self.structure_def is not None:
attr = NotificationAttrib(length=self._structure_size)
else:
attr = NotificationAttrib(length=sizeof(self.plc_type))

handles = self._plc.add_device_notification(
(self.index_group, self.index_offset), attr, callback, user_handle
Expand Down

0 comments on commit b6e6fac

Please sign in to comment.