I normally use the PMCR system for Modbus RTU reads but have an absolute heap on this job I am working on (4 serial cards - stuff from everywhere) so have decided to use the function block method - it will be easier.
Attached is a file which is my method that I hope will work for a small part of the job. I have used a counter to step the reads and a bit counter to count the done bits and step the counter on to the next read. Not sure if this will work but assume that when a done bit turns on and the counter moves to the next read the done bit will turn off and then when the next read takes place that done bit will turn on and step the counter again.
If any of you have used this before would you mind checking my code please. If it will not work I do not want to be programming a heap of stuff that will not work.
Thanks for any comments.