When using address 0, no slave should reposne, so there is no answer expected (no need to wait for timeout etc.)
How to implement correctly this behavior in minimalmodbus?
After investigating the source code little bit, I must change the source itself. In function _perform_command, I set number_of_bytes_to_read = 0 when the address is broadcast. This generates exception minimalmodbus.NoResponseError without any timeout which is good compromise for me, but what is the correct solution for this?
If there is no good solution for this now, I can create pull-request, but currently, I don't know the target behavior which will fit to library ideas, e.g. what to return.
When using address
0
, no slave should reposne, so there is no answer expected (no need to wait for timeout etc.)How to implement correctly this behavior in minimalmodbus?
After investigating the source code little bit, I must change the source itself. In function
_perform_command
, I setnumber_of_bytes_to_read = 0
when the address is broadcast. This generates exceptionminimalmodbus.NoResponseError
without any timeout which is good compromise for me, but what is the correct solution for this?If there is no good solution for this now, I can create pull-request, but currently, I don't know the target behavior which will fit to library ideas, e.g. what to return.