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) |
Every time something is read or written it restarts the pyads connection which is unnecessary. So moving this to the constructor should be better.
ros2_pyads/ros2_pyads/ros2_pyads/ads_com.py
Lines 55 to 56 in b2dab04