Page 1 of 1

Larger than expected delay between Modbus commands

Posted: Tue Nov 13, 2018 7:38 am
by Zane
Hi Ben,

I am using the Modbus master component to communicate with a slave i/o device. The component functions appear to work fine with the data being sent and received as expected. However from when one command is sent to the module to another being sent, there is a larger than expected delay.

I am aware of the delay created by the "silent interval" but it also seems that the "UART receive timeout" and the "timeout count" are also contributing to this delay. With the "UART receive timeout" set to 220 mS and the "timeout count" set to 2, there is a 1 second delay from receiving the data until the next command is sent out. Reducing the timeout and the timeout counts, the delay decreases.

Looking at the screen shot there is only approximately 6mS delay between the last of the data being received by the slave module until its response is sent to the master. Since the master is being sent back a response, the timeout delay should not run its full length, but it looks like it is.

The green is the transmitted data to the slave and the blue is the received data from the slave
Capture.JPG
Capture.JPG (66.35 KiB) Viewed 3649 times
Any help with this would be most appreciated.

Thanks

Re: Larger than expected delay between Modbus commands

Posted: Wed Nov 14, 2018 11:31 pm
by Zane
Hi Ben,

Wondering if you have been able to look at this yet.

Thanks

Re: Larger than expected delay between Modbus commands

Posted: Thu Nov 15, 2018 8:53 am
by LeighM
Hi,
Have you tried reducing the UART receive timeout?
I've found in practice that 20 works for most devices, and as low as 10 for some.
As you note, there seems to be some extra waiting for characters, but it's just the way the component works at present.
It will hopefully get reviewed at some point, after other priorities.

Re: Larger than expected delay between Modbus commands

Posted: Thu Nov 15, 2018 11:09 am
by Zane
Hi Leigh,

Thanks for your reply. I have done some additional testing and found that with each data transaction, the correct data was being sent and received with no timeouts so proving that the delay was not a result of a timeout situation.

I noticed it was not working as expected so have let you know. I have reduced the timeout delay, adjusting the values to get the results i need and will do the job i need it to.

Keep us informed with any updates.

Thanks