LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

boolean switch til released button's state to stay high long enough to be read

I think the event structure in LV 6.1 would do this for me but I only have 6i.

I want to display some text in an indicator for as long as a button is pushed down and then have the program continue when the button is released. The program is in a continuous loop so sometimes the button action is not caught if it is not held down for long enough.

any ideas? I ciould use some help since i have been stuck with this for some time.

Thanks,
Chris
0 Kudos
Message 1 of 3
(2,696 Views)
Here's a short VI to show how to do it. The trick is setting the mechanical action of the pushbutton. The only thing to remember is that the switch will only have an effect when it's read, so if the loop takes 2 seconds to execute, the switch will only be read every 2 seconds.

One way around this is situation to put the button and its display in a seperate loop that passes its state to the main loop through a global. This way the text will appear right away and the global can cause the main loop to pause until the button is released. See example 2.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Download All
0 Kudos
Message 2 of 3
(2,696 Views)
I do not really get what you mean. What you mean is you want to display text in the front panel as long as the button is pushed down and when you release you want to continue with your program. Am i right? If it is so, you may need one while loop and inside while loop you may need case structure. Then in the case structure, you display your text in true case and in the false case insert your program. And then there should be on Boolean control to control your case. In the front panel, you left click your mouse
>>>>Mechanical Action
>>>>>>>Switch until released
I think it will work. I attach one file for you.

Saw Naing Aye
Download All
0 Kudos
Message 3 of 3
(2,696 Views)