CMB27 / ModbusRTUSlave

This is an Arduino library that implements the slave/server logic of the Modbus RTU protocol.
MIT License
71 stars 21 forks source link

Added optional delay between request and response #41

Closed parthkalgaonkar closed 1 month ago

parthkalgaonkar commented 3 months ago
CMB27 commented 3 months ago

I have not experienced an issue with this. Below is a screenshot of the timings I usually get.

ModbusAnalysisScreenshot

Can you give me more information on your setup: devices used, baud rate, and anything else that may be relevant? Thanks,

parthkalgaonkar commented 3 months ago

Here's my setup

CMB27 commented 3 months ago

My impression is that the problem is on the Raspberry Pi Zero side. It sounds like it doesn't have very tight timing control of the DE pin of the RS-485 transceiver.

parthkalgaonkar commented 3 months ago

Yes that is accurate. RTS pin toggle has to be done via ioctl calls from user space. This adds a ton of latency

CMB27 commented 2 months ago

Sorry for the delayed response. I am okay with the feature add, but I do want a few changes before merging.

CMB27 commented 2 months ago

I would also like an updated README with a section describing the setResponseDelay function.