From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Choosing between two loops to execute

For example, let's say I created a VI with two loops...is there a function or way to allow only 1 of the loops to operate if a certain criteria is met?

 

So let's say if the number is greater than 10, loop 1 will execute but if the number is less than 10, loop 2 will execute.

 

I was thinking of something like a "if, else" kind of statement but I can't seem to find anything similiar to that in LabVIEW.

 

I didn't attach my VI because I haven't been able to figure out what functions to use yet. Any help would be greatly appreciated.

0 Kudos
Message 1 of 5
(2,319 Views)

This sounds like you need to use a case structure as in the picture below.

 

Run one case or the other.

 

 

 

     Rob

Message Edited by Robert Cole on 06-24-2009 04:45 PM
0 Kudos
Message 2 of 5
(2,311 Views)

Another way.

 

 

Now Using LabVIEW 2019SP1 and TestStand 2019
0 Kudos
Message 3 of 5
(2,308 Views)

I think you are approaching this from the wrong end.

 

Why not use a single loop containing a case structure with the two code alternatives? That would make much more sense. 😄

0 Kudos
Message 4 of 5
(2,298 Views)

If the requirement is to run both loops simultanously use two case structures with in a loop

 

otherwise you could use them in two different states with a statemachine architecture 

 

 

Sundar.

0 Kudos
Message 5 of 5
(2,280 Views)