I have a stacked sequence which runs 2 different tests continuously. Lets call them test1 and test2. So it's a 2 stage stacked sequence within a while loop. I have a button that says "Start Test1", which jumps into the while loop and executes test1, test2, test1, test2, etc. I want to add another button that says "Start Test2" which would start test2 first and then test1. So it would basically be changing the order of my stacked sequence to start executing test2 code first instead of test1 code (test2, test1, test2, test1, etc).
Is there an easy way to do this? Thanks for any help!
It has been a while since I used LabVIEW but here goes... I would try to replace the Stacked Sequence with a Case Structure. The Case Structure should have a Test1 case and a Test2 case; it would still be place inside of your while loop.
The input to the Case Structure should be a 1 when you want to run Test1 first (or a 2 to run Test2 first). After Test1 is ran, it would output a 2 by feeding this value back to its input using a Shift Register in the while loop (shown here). Similarly, the Test2 case would output a 1 once it is done and feed this back via the Shift Register.
Per Yair's comment, my suggestion here is a common design pattern known as a State Machine, which, when drawn out, will look like a flow chart of your program. NI's tutorial is written up here which in fact involves a case structure nested within a while loop. Hope it helps!