LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Is there any one knows how to use labview 6.0 to make a "continue" function like the one in C language?

I am using labview 6.0 and i like to know is there any one knows how to stop the current iteration in while loop or for loop and continue to do the next iteration,just like the "continue" statement in C or C++ language?
0 Kudos
Message 1 of 8
(2,711 Views)
Hi,

You will not be able to do it using the for loop because the for loop always wants to complete the full number of iterations. Therefore you will have to use a while loop and have a condition where you can change the state of the boolean connected to the condition terminal of the while loop.

Hope this helps
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 2 of 8
(2,711 Views)
Hi,
you can orginize all the inner actions of your while loop into the SubVI. Then use the Functios/Application Control/Stop.vi in this SubVI to stop the current interation in any point you want. This will stop your SubVI and you will automatically goto the next iteration in your while loop.

Good luck.

Oleg Chutko.
0 Kudos
Message 3 of 8
(2,711 Views)
One comment...
As I understand you can use my solution both for For and While loops.

Oleg Chutko.
0 Kudos
Message 4 of 8
(2,711 Views)
Simple test here in LV6 confims that you can't do this. Not in a useful
sense anyway. "Stop" doesn't stop execution simply of the current VI, it
also kills all VIs above it. It would hence be difficult to argue that this
approach is in any way similar to "continue".

What version of Labview have you tested this on and can you post a
demonstration?

--
Craig Graham
Physicist/Labview Programmer
Lancaster University, UK

"Oleg" wrote in message
news:506500000005000000E45B0000-1011517314000@exchange.ni.com...
> Hi,
> you can orginize all the inner actions of your while loop into the
> SubVI. Then use the Functios/Application Control/Stop.vi in this SubVI
> to stop the current interation in any point you want. This will stop
> your SubVI and yo
u will automatically goto the next iteration in your
> while loop.
0 Kudos
Message 5 of 8
(2,711 Views)
Hm... I'm sorry for incorrect answer. I' haven't checked this and it was my mistake.

Oleg Chutko.
0 Kudos
Message 7 of 8
(2,711 Views)
> Is there any one knows how to use labview 6.0 to make a "continue"
> function like the one in C language?
>
> I am using labview 6.0 and i like to know is there any one knows how
> to stop the current iteration in while loop or for loop and continue
> to do the next iteration,just like the "continue" statement in C or
> C++ language?
>

Make the code that you may want to skip conditional. Compute the
condition, wire it to a case structure, and place the code in the case.
If you don't want to see this, put the case and inner code into a
subVI and give the operation a good name.

Continue is a control flow statement alot like a goto. It isn't
necessary and causes bad things to happen to the dataflow in your program.

Greg McKaskle
0 Kudos
Message 6 of 8
(2,711 Views)
,

What exactly are you trying to accomplish here?
0 Kudos
Message 8 of 8
(2,711 Views)