-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix function block properties #261 #262
base: master
Are you sure you want to change the base?
Conversation
@dgl-cw thank you for your contribution. @RobertoRoos would you mind review the changes as you implemented the symbol handling? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know about monitored variables, so I'm trusting this fix does it right.
@@ -162,7 +162,14 @@ def _create_symbol_from_info(self) -> None: | |||
info = adsGetSymbolInfo(self._plc._port, self._plc._adr, self.name) | |||
|
|||
self.index_group = info.iGroup | |||
self.index_offset = info.iOffs | |||
if self.index_group == 0xF019: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's move this value to a constant alongside ADSIGRP_SYM_VALBYHND
so the code is more readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what to call this constant, as it is not documented, but I can make something up, if there are no guidelines for that case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest something like ADSIGRP_SYM_MONITORDUMMY
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should also be a comment to the group definition explaining that it's undocumented and that it's used in the context of monitored variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dgl-cw nice work here. Of course we also need some kind of testing for this use-case.
@dgl-cw did you manage to create some test cases for your suggested code? |
Suggestion to fix #261