File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -162,7 +162,14 @@ def _create_symbol_from_info(self) -> None:
162162 info = adsGetSymbolInfo (self ._plc ._port , self ._plc ._adr , self .name )
163163
164164 self .index_group = info .iGroup
165- self .index_offset = info .iOffs
165+ if self .index_group == 0xF019 :
166+ # For function block properties with monitoring = call
167+ # get symbol using handle instead
168+ self .index_group = constants .ADSIGRP_SYM_VALBYHND
169+ self .index_offset = self ._plc .get_handle (self .name )
170+ else :
171+ self .index_offset = info .iOffs
172+
166173 if info .comment :
167174 self .comment = info .comment
168175
@@ -230,6 +237,8 @@ def __repr__(self) -> str:
230237 def __del__ (self ) -> None :
231238 """Destructor"""
232239 self .clear_device_notifications ()
240+ if self .index_group == constants .ADSIGRP_SYM_VALBYHND :
241+ self ._plc .release_handle (self .index_offset )
233242
234243 def add_device_notification (
235244 self ,
You can’t perform that action at this time.
0 commit comments