LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a boolean possess both a switch and latched mechanical action?

Solved!
Go to solution

I have a boolean that when true writes a text file until it turns false (Switch when pressed). However, I would also like this boolean to reset a time indicator to zero when the boolean is initially pressed as true. As of right now if the boolean is wired to the time indicator, the time remains at 0.0 when it is true. But for the time, I need it to act as a latch when pressed. How can I go about fixing this?

 

Thanks

0 Kudos
Message 1 of 6
(3,044 Views)
Solution
Accepted by topic author Tflax

You might consider using the boolean to cause an event.  Then, put all the stuff you want to do in the event...even detecting if this is the first press of the button...

 

Hope that helps.

 

Hummer1

Message 2 of 6
(3,041 Views)

For the latching action task you actually want to detect the False to True transition.  Use a shift register to retain the previous value of the boolean.  Compare the current value to the previous value.  When Current = True and Previous = False, then reset the timer.

 

Lynn 

0 Kudos
Message 3 of 6
(3,039 Views)

Or you could just use the latch action and put all that other stuff in the event structure...

 

 

0 Kudos
Message 4 of 6
(3,034 Views)
Which is what he just said...right.!
0 Kudos
Message 5 of 6
(3,033 Views)

johnsold wrote:

[...]Use a shift register to retain the previous value of the boolean.  Compare the current value to the previous value.  When Current = True and Previous = False, then reset the timer.

 

Lynn 


 

Or, you could use the Boolean Trigger VI from OpenG.

           

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Message 6 of 6
(3,003 Views)