modbus-tk
modbus-tk copied to clipboard
The global lock can be replaced by `self.lock` in `Master.execute`
https://github.com/ljean/modbus-tk/blob/c168f7158abd16d487046eaecb2aa49bf863d9dd/modbus_tk/modbus.py#L137
In my project, I need to read more than a dozen PLCs and each Plc needs to read 60 address. When I read one PLC, it is not necessary for the other Plc to wait for lock.
In my test:
When use @threadsafe_function call execute
cost more than 20 seconds every time . Use with self.lock:
takes only cost less than 1 seconds