Hello,
So you have a for loop that you'd like to suspend execution in right? You could use a while loop instead, with a case structure in it with only two cases; use a boolean input to the case selector. The idea is that one case will be whatever your current for loop code contains (let's call it the "usual" case, and the other case will be your "suspend" case. Then when you want to "suspend" the loop, you can just change the state of the boolean wired to the case selector programatically, and the for loop will finish executing it's current iteration, and then begin executing the suspend case. You can change the boolean back whenever you like to start executing your usual case again. Now, there are a couple things to take note of here. First, since you originally had a for loop, I presume you only want to execute your usual case a predetermined number of times. Thus, in your usual case you should keep a "counting" value that increments anytime the usual case executes. Then you can use that "counting" value to stop your while loop after you have executed your usual case the predetermined number of times. As a final consideration, you may want to put a wait statement (wait or wait until next ms multiple) in the suspend case, otherwise your while loop will be executing that case (during suspension) as quickly as possible. Even putting a 0 ms wait will kindly allow a thread swap.
Ok, I hope this helps!
Best Regards,
JLS