Skip to content
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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dgl-cw
Copy link
Contributor

@dgl-cw dgl-cw commented Aug 24, 2021

Suggestion to fix #261

@stlehmann
Copy link
Owner

@dgl-cw thank you for your contribution. @RobertoRoos would you mind review the changes as you implemented the symbol handling?

Copy link
Contributor

@RobertoRoos RobertoRoos left a 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:
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Owner

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

Copy link
Owner

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.

Copy link
Owner

@stlehmann stlehmann left a 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.

@stlehmann
Copy link
Owner

@dgl-cw did you manage to create some test cases for your suggested code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for monitored properties
3 participants