@jonask99 wrote:
I understand the principle idea of the constant 50 ms wait and the separate delay. However, I do not fully understand the feedback node construction. Could you please explain what is going on there?
The output of the wait is a 32bit tick count and the difference between successive calls (the feedback node retains the value from the previous iteration) it the time it actually took. In principle, the code could be simplified and you could just accumulate the 50ms wait in the shift register. My version is slightly safer because if the wait is set very short or the loop contains complicated code (e.g. involving communication with an instrument), the iteration might occasionally take longer than the wait. measuring the actual loop time is more robust.