cancel
Showing results for 
Search instead for 
Did you mean: 

Do case once while true

Highlighted
Timmerman
Member

Do case once while true

Message contains a hyperlink
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
 
 
6 REPLIES 6
arvin_labrat
Member

Re: Do case once while true

Have you thought about using an event structure instead of a case structure?
 
Good Luck
 
Eric
wd8ivl
Member

Re: Do case once while true

Message contains an attachment

Tim,

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

Mike

 

systems_eng
Member

Re: Do case once while true

Message contains an attachment
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.
Timmerman
Member

Re: Do case once while true

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!

Dennis_Knutson
Knight of NI

Re: Do case once while true

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.
Timmerman
Member

Re: Do case once while true

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.