Real-Time Measurement and Control

cancel
Showing results for 
Search instead for 
Did you mean: 

Stopwatch that activates and deactivates based on input signal

Hi,
I'm really new to Labview programming, and I'm slowly learning the basics. I'm trying to make a stopwatch that response to an input signal.

The problem is this:
Given a continuous input signal Y (volt). Most of the time, the signal is 0. Sometimes (user input on sensor change the signal), the signal has values from 5-10. When y > 7, the timer start. And then when y becomes < 7 again, the timer stop and output the time the signal stays high than 7. This repeats forever.

Summary: start stopwatch when signal is > 7, stop when signal < 7. Output the measured time.

 

I can make the stopwatch activate/deactivate with a button, but I don't know how to do it with a signal

I need a block that can be both a control and an indicator (so I can do block = !block to perform boolean switch), but I can't find it and I think it doesn't exist. So I can't do it that way.

 

How can I solve the problem I described? Thank you.

 

0 Kudos
Message 1 of 2
(2,284 Views)

May you please share the vi? 

Why can't you just use comparison functions and based on output start the timer? 

Also, I'd recommend to use FGV timer. 

https://forums.ni.com/t5/Example-Code/FGV-Timer-SubVI/ta-p/3499484

0 Kudos
Message 2 of 2
(1,757 Views)