LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

data to be passed if condition is true

Solved!
Go to solution
does labview have a VI that allows data to be passed only if the condition is true , consider it like having one case in case structure
0 Kudos
Message 1 of 6
(6,843 Views)

hi,

yes, just as you said... one case in a case structure, you may also look at comparaison palette, there is this triangle thing I use a lot with T/F options..

N

0 Kudos
Message 2 of 6
(6,842 Views)

The 'triangle' thing is called the Select function and it passes data in both the true and false cases.

 

 connoisseur,

 

Could you explain exactly what you want to do and what you want to pass data to? Typically, whatever you are passing the data to would be inside a case statement.

0 Kudos
Message 3 of 6
(6,831 Views)

connoisseur wrote:
does labview have a VI that allows data to be passed only if the condition is true , consider it like having one case in case structure

 

 
What is the definition of "passed"? Maybe you should also clarify what should happen if the condition is false.
 
Obviously, you need two cases.
  • In the true case you "pass" the data, whatever that means. Be it sending data across the network, feeding a queue, or wiring out of the right side of the case structure.
  • In the false case you do nothing. All blank. (If there is an output tunnel on the right and the data is an array, you could output an empty array. If the data is a string, output an empty string, if the data is a scalar, output NaN.)
 
Can you explain in a few more words what you actually are trying to achieve? Maybe a practical example?
0 Kudos
Message 4 of 6
(6,828 Views)

hi, thanks for the reply

 

I am looking for something which works as a switch

 

I am making a use case for a camera, and i want the attributes of an image(a cluster of different data types) to be saved(as a text file)

only when a boolean switch is pressed.

 

I achieved that.

 

Now I am having an issue, the data gets saved numerous times as I press the switch(boolean). iN REAL TIME AS i PRESS THE SWITCH , the data keeps on coming and saving. As I leave the switch it does not, naturally.

 

Is there a way I could only allow data to be stored only once? only one cluster and then the data is not stored irrespective of the data still being recieved.

 

0 Kudos
Message 5 of 6
(6,821 Views)
Solution
Accepted by connoisseur
Change the mechanical action of the switch to latch action (e.g. latch when released). This way it will turn only TRUE until it is read once by the code and will automatically revert to FALSE until you press it the next time.
Message 6 of 6
(6,807 Views)