Hello again!
The number of iterations possible in a repeat-until loop depends on a number of factors:
- The main loop time (in your case 20 ms)
- How much of the main loop time has already been spent before arriving at the repeat-until loop
- How much time each iteration in the repeat-until loop takes.
You can use the difference between multiple instances of the “Get Time ?s” Component to find out the answers to the last 2 items in the list above.
However, the recommendation is to not assume a specific number of iterations.
Instead it is recommended to simply resume any incomplete work from the previous loop in the next loop.
For example, if you are making some kind of long-running calculation over an array of values, then simply use a component such as the “Loop Counter Level” in order to keep track of where to continue working when resuming.
Note: If a fixed number of iterations per main loop is absolutely necessary, then the best option is to use a for-loop within a Structured Text POU. (For-loops should be used with some care since long-running loops that are only executed intermittently could have undesired effects on real-time behavior.)
Best regards
Nilla
PLUS+1 Helpdesk