Closed spachner closed 10 years ago
Did you see this change: https://github.com/stephane/libmodbus/issues/144
Hi Stephane,
no, I didn’t see that the fix was already there. Unfortunately I only checked the source in http://libmodbus.org, both • Stable release is libmodbus v3.0.5 (2013-10-06) • Development release is libmodbus v3.1.1 (2013-10-06) do not contain that fix. Are the sources in http://libmodbus.org not maintained any more?
regards
Stefan
On 27.11.2013, at 17:57, Stéphane Raimbault notifications@github.com wrote:
Did you see this change: #144
— Reply to this email directly or view it on GitHub.
Yes there are but I don't release a new version of libmodbus on each commit on github!!
Does the fix in master works fine for you?
PS: I don't know why to try to read before calling FlushFileBuffers in your code...
As I wrote, FlushFileBuffers() only flushes the transmit buffer. My simple fix was reading everything in order to flush also the receive queue. The fix from #144 is much cleaner and I am going to use them. Nevertheless both methods work for me.
Stefan
PS: Thanks for your attention and for contributing this piece of software.
OK thank you.
_modbus_rtu_flush() should flush transmit AND receive buffer. On Windows only FlushFileBuffers() is called which only flushed the transmit buffer. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa364439(v=vs.85).aspx
I changed to this: