Open umarsaid opened 6 years ago
you can fork the repo, commit your changes and pull request. or you can attach your update here, i'll try to make pull request to make this library better
I am also seeing this same issue - every 8th coil is not working.
Umarsaid, is there any way at all for you to post or forward me the updated library you mention that you fixed? My programming skills are still improving and I'm having trouble reading through the library to identify where the issue is. Thank you very much in advance for your help!!!!
Please would you change these lines 329 and 380 in modbus.cpp
from
while (numregs--) { i = (totregs - numregs) / 8;
to
while (numregs) { i = (totregs - numregs) / 8; numregs--;
by my findings only this decrement order need to be changed.
Peter - THANK YOU - I tried this and it looks like it works! I am very grateful for your help. This is definitely something very important to my projects. I really appreciate this!
Thank you Peter !! I met the same issue with the writeMultipleCoils function. I did the same change at line 499 with numoutputs and it works now.
while (numoutputs) { i = (totoutputs - numoutputs) / 8; numoutputs--;
Thank you Peter !! I met the same issue with the writeMultipleCoils function. I did the same change at line 499 with numoutputs and it works now.
while (numoutputs) { i = (totoutputs - numoutputs) / 8; numoutputs--;
Thank you, you are the best
Please would you change these lines 329 and 380 in modbus.cpp from
while (numregs--) { i = (totregs - numregs) / 8;
towhile (numregs) { i = (totregs - numregs) / 8; numregs--;
by my findings only this decrement order need to be changed.
Thank you, you are the best
I found some bugs in the library. You reading Ists and Coils for 8 registers, the 8th register will always be 0. Also, when we write multiple holding registers, the last value will be lost.
I have fix the bug in my local copy. I want to submit the bug but I do not know how.