LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Do case once while true

Hi,
 
I have a problem that i think has a simple solution.
 
I've got a case structure with a button attached to it. The button has the "switch until released" action assigned to it.
 
What i want is that everything inside the case structure runs only once until the button is released. Then, when the button is pressed again, the case structure has to run only once again.
 
I've attached an VI to make the situation more clear.
 
 
Thanks in advance!
 
Regards,
Tim from the Netherlands
 
 
0 Kudos
Message 1 of 7
(4,949 Views)
Have you thought about using an event structure instead of a case structure?
 
Good Luck
 
Eric
0 Kudos
Message 2 of 7
(4,943 Views)

Tim,

Try this...the timer & LED are in there so you can see what's going on...

Mike

 

0 Kudos
Message 3 of 7
(4,930 Views)
Here's what an event structure would look like.  I would recommend looking at the help menu w/ examples for the event structures to get a better understanding of their functionality.
0 Kudos
Message 4 of 7
(4,918 Views)

Thanks for the fast reply's everyone!

I now know how event structures work. I finally managed to get my VI working thanks to wd8ivl's solution.

Thanks a lot!

0 Kudos
Message 5 of 7
(4,912 Views)
Why do you need all of that code when you could simply change the mechanical action to a latch type and if you knwo how an event structure works, that's even better.
0 Kudos
Message 6 of 7
(4,906 Views)
I needed it because the VI i am going to usi it in, has a boolean wich stays true for a period of time.
In that period i need to log only one occurance to my spreadsheet log.
0 Kudos
Message 7 of 7
(4,892 Views)