10-18-2008 06:26 AM
I want to have a counter that stops if the number is achieved. I tried with a for loop, however when the number was achieved it immediatly jumped to 0 and started doing it all over agan. (it seems there is no break in the for loop).
How can I make while (i < 10) i++;
that actually stops totally when i = 10 ?
Solved! Go to Solution.
10-18-2008 07:37 AM - edited 10-18-2008 07:37 AM
You code actually does what you describe. It does stop at i = 10.
Your graph however only displays one point; the last one with a value of 10.
Right-click on the tunnel (blue square on the right of the While Loop) and select "Enable Indexing" and run it again.
You should see something similar to the chart below (I changed the x-axis scale to 10)
R
10-18-2008 08:05 AM - edited 10-18-2008 08:06 AM
i now shows i in the graph, however it does not stop when i reaches 10. It starts all over again. How can I make it stop looping, after it has reached 10?
10-18-2008 10:07 AM
10-18-2008 11:00 AM
In that way it counts to 10. Is there any way the same can be done in run continously mode?
10-18-2008 11:22 AM - edited 10-18-2008 11:22 AM
You have to click on the run button, not the run continuous.. And did you enable indexing?
R
10-18-2008 01:16 PM
antonedwin wrote:Is there any way the same can be done in run continously mode?
The "run continuously" is a debugging tool and is not meant to run a VI normally. A better name for that button might be "restart VI from the beginning whenever the program finishes". 😄