pyhys / minimalmodbus

Easy-to-use Modbus RTU and Modbus ASCII implementation for Python.
Apache License 2.0
308 stars 145 forks source link

Add support for broadcast address 0 #50

Closed j123b567 closed 3 years ago

j123b567 commented 4 years ago

Address 0 is special broadcast address. All units can read the request but no unit should response.

Solves #43

If address 0 is used, no reponse is expected so no Exceptions are reported if there is no response. It is also important to ensure, that message is really transmitted before we can send another message so it is done by the serial.flush(). I have tested this on Linux and with USB/serial converter based on FT232R and the serial.flush() was enough.

codecov-io commented 4 years ago

Codecov Report

Merging #50 into master will decrease coverage by 0.31%. The diff coverage is 16.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #50      +/-   ##
==========================================
- Coverage   98.03%   97.71%   -0.32%     
==========================================
  Files           3        3              
  Lines        2797     2806       +9     
  Branches      382      386       +4     
==========================================
  Hits         2742     2742              
- Misses         31       36       +5     
- Partials       24       28       +4     
Impacted Files Coverage Δ
minimalmodbus.py 97.67% <16.66%> (-0.99%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update c082085...95e96ce. Read the comment docs.

pyhys commented 3 years ago

Thanks, it is now part of release 2.0.0. I mentioned you in the AUTHORS file.