LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a default boolean button?

Hi There,
I am trying to make a button which can function like this, the default value of the button is FALSE, when I click the button, it will change to TRUE, after the program(see attached code (TRUE case structure)) is finished, it will change to FALSE again until I click the button again. attached is a test code. The problem of this code is that the boolean button can not go back to the default FALSE value automaticlly, I have to click twice(turn off, turn on) so that it will work. any one has some suggestions about it? thanks, 
 
Mike
  

Message Edited by happybird on 08-23-2007 08:14 PM

0 Kudos
Message 1 of 4
(5,004 Views)

Inside your true case, put a flat sequence structure.  Do everything you want to do in the first frame.  In the second frame, write a false constant to a local variable of that boolean.

Message Edited by Ravens Fan on 08-23-2007 10:14 PM

0 Kudos
Message 2 of 4
(4,991 Views)

Right-click the boolean and change the mechanical action to e.g. "latch when released". It will turn TRUE until the code reads the value once, then change back to false.

(Your program does not make a lot of sense.  You definitely need a small wait inside the loop and maybe you should use an event structure isntead of a case structure. What are you actually trying to accomplish?Can you explain?)

Message 3 of 4
(4,988 Views)
It would probibly also be valuable for you to do some studying on the basics of LV (classes, books, etc.).

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

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

For help with grief and grieving.
0 Kudos
Message 4 of 4
(4,964 Views)