Larger than expected delay between Modbus commands

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Post Reply
Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Larger than expected delay between Modbus commands

Post 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 1977 times
Any help with this would be most appreciated.

Thanks
Attachments
Flowcode1.fcfx
(10.73 KiB) Downloaded 93 times

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Re: Larger than expected delay between Modbus commands

Post by Zane »

Hi Ben,

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

Thanks

User avatar
LeighM
Matrix Staff
Posts: 2120
Joined: Tue Jan 17, 2012 10:07 am
Contact:

Re: Larger than expected delay between Modbus commands

Post 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.

Zane
Flowcode v5 User
Posts: 199
Joined: Thu Sep 10, 2009 10:57 pm
Location: New Zealand
Contact:

Re: Larger than expected delay between Modbus commands

Post 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

Post Reply