nanoMODBUS icon indicating copy to clipboard operation
nanoMODBUS copied to clipboard

Fix small issue in Write File Record server response

Open indianaMitko62 opened this issue 6 months ago • 1 comments

According to the official MODBUS protocol documentation the normal response of a Write File Record request is an echo of the request. The whole request including the records data must be included in the response. This pull request makes sure the whole request is send as a response.

Link to the MODBUS documentation for reference: https://www.modbus.org/docs/Modbus_Application_Protocol_V1_1b3.pdf

indianaMitko62 avatar Jul 10 '25 13:07 indianaMitko62

At the moment the buffer index is set to the end of the PDU, so that send_msg() re-transmits the request as it was received, and it looks ok. What does the PR change?

debevv avatar Sep 22 '25 16:09 debevv

That's a very good question. I don't remember why I did that. Why does it work in both occasions, though?

indianaMitko62 avatar Dec 02 '25 15:12 indianaMitko62