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

Move the connection to the constructor #2

Open
jodle001 opened this issue Apr 24, 2024 · 0 comments
Open

Move the connection to the constructor #2

jodle001 opened this issue Apr 24, 2024 · 0 comments

Comments

@jodle001
Copy link
Owner

Every time something is read or written it restarts the pyads connection which is unnecessary. So moving this to the constructor should be better.

with pyads.Connection(self.remote_ads, pyads.PORT_TC3PLC1, self.plc_ip) as plc:
var = plc.read_by_name(var_name, var_type)

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

No branches or pull requests

1 participant