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

Adds a tag namespace filter parameter to LogixDriver for targeted/selective Tag parsing #312

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

benersuay
Copy link

Introduces a new constructor argument tag_namespace_filter to LogixDriver class.

Similar to program/task filtering, this filter applies to all tags that start with a string of user's choice; only tags that start with the provided filter get parsed and created in LogixDriver during initialization.

This filtering can prevent byte parsing errors in applications where there are thousands of tags that may not be relevant for communicating with pycomm3 (e.g. tags that are used on the PLC for internal logic handling purposes).

Before this namespace filter, all tags need to be added to a particular program to be filtered (program attribute is not exposed to the constructor either unfortunately), whereas this PR enables filtering simply by tags' names initial common string.

For example setting tag_namespace_filter = MyFavoriteSetOfTags in an environment where MyFavoriteSetOfTags.Struct1, MyFavoriteSetOfTags.Struct2 etc. exist would enable pycomm3 to only parse Struct1 and Struct2 ignoring all other, potentially irrelevant, tags from being created and parsed during initialization.

@benersuay
Copy link
Author

@ottowayi any feedback on this?

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.

1 participant