Dear colleagues,
I want some code to be executed on each controller cycle. This is what I have in mind:
MODULE SomeModule
PROC MyProc()
WHILE TRUE DO
! do something important
DoSomething;
! here I want to wait until the next controller cycle, how can I do that?
WaitUntilNextControllerCycle;
ENDWHILE
ENDPROC
ENDMODULE
The thing is that I can’t find a way in RAPID to wait for the next controller cycle; does it exist?
I could use WaitTime, but then a) it is not synchronized to the controller cycle; b) the time of the WHILE cycle will be equal to the wait interval + the execution time of DoSomething, but I want DoSomething to be executed at regular intervals.