LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Making a repeating iterative cycle only occur once

Solved!
Go to solution

I am having trouble with one of my programs.  I am trying to program an instrument that came with an example program that is a repeating iterative cycle.  There are three steps in it (0,1,2). The way I understand it is step 0 executes, and when finished, it moves on to step 1.  If step 1 is unsuccessful, step 1 will repeat until it is successful.  Once successful, it will move on to step 2.  When step 2 completes it goes back to step 0 and repeats.  All this just for taking 1 measurement each cycle.  I want this program to only take a single measurement, then stop.  I do not want it to repeat itself.  At first I thought this would be really simple, however I have been playing with the program for hours and have not figured out how to make the program work without repeating the cycle.  I was hoping someone could look at the example program and help me out with this.  The program is in the attached files

0 Kudos
Message 1 of 3
(2,418 Views)
Solution
Accepted by topic author CrashMcLars1

Place a boolean TRUE constant in case 2. wire it to the termination condition of the while loop. (to also retain the stop button, use an OR function to connect both to the loop termination)

Message 2 of 3
(2,414 Views)

Ah, simple yet brilliant! Thanks a lot! I don't know why I couldn't think of any way to do that.  I was trying to come up with overly complicated solutions.

0 Kudos
Message 3 of 3
(2,397 Views)