LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

switch case structure to true on click, then back to false after time

What I am trying to do is have a case structure switch to the true case when the user presses a button.  The case structure will switch, which begins a time elapse, which then trigers several more cases.  When the elapse is done, I want the case to switch back to false, and stay there until the user again clicks the button. 

 

Currently, the booleen is in switch mode on press, so when the time has elapsed, the case switches back and forth several times before stopping.  Attached are pictures of true and false cases.

 

 

Download All
0 Kudos
Message 1 of 3
(3,364 Views)
Got it.  Brain fart.
0 Kudos
Message 2 of 3
(3,340 Views)
This sounds like you should consider using a state machine. The basic structure of a state machine is a case structure inside a while loop. The states can be defined as strings or a typedefed ENUM. You can use a simple shift register on the while loop to pass the the next state into the state machine or use could use a queue (my prefered method). If you need to process user requests as well then I would suggest using a producer consumer architecture. Your producer would be an event structure inside a while loop which catches the user events and the consumer would be your state machine. In this architecture it is best to use a queue for your state machine.


Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 3 of 3
(3,337 Views)