ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

do nothing

I keep encountering situations in my code where I'd like to do something "IF" a certain condition is met.  However, if that condition is not met, I don't want to do anything.  My problem arises when I (in the positive IF case) am in some type of loop and I want to act upon an item that is part of a shift register or is in a tunnel.  If I'm in the FALSE case, I don't want to add to my array, or increment a counter, etc.  How do I implement a "Do nothing" yet satisfy my tunnels?
0 Kudos
Message 1 of 3
(10,144 Views)
You can use a shift register and a Build Array function to selectively add items to your Resource Names array.  Here is a screenshot of how I modified your code to accomplish this:
 
 
In the False case of the Case Structure, the 1D array just gets passed through without modification. 
 
I hope this helps...this is a very common techique to selectively build arrays of items in a case structure inside a loop.
 
-D

Message Edited by Darren on 08-08-2006 10:39 AM

Message 2 of 3
(10,141 Views)

When I saw the title to this thread, I figured it was right up my alley.  I was right.

Here is a vi that does nothing:

Message Edited by tbob on 08-08-2006 10:35 AM

- tbob

Inventor of the WORM Global
0 Kudos
Message 3 of 3
(10,118 Views)