Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

How to start a timer in labview when a signal crosses a threshold voltage

Solved!
Go to solution

Hello, 

 

Please could anyone help find a way to start a timer when an event occurs ?(like when a signal crosses a threshold voltage)

thus, I'd like to ask you help me deal with the following issue:

I am acquiring a signal from a data acquisition and comparing it with  a certain threshold value. Once the signal voltage crosses this value, a timer should start and will continue till 30 seconds IF the signal value PERSISTS beyond the threshold. The timer should be set back to zero if the signal voltage goes back below the threshold before a 30 seconds period.

 

Thanks in advance for your support,

 

 

Bill 

0 Kudos
Message 1 of 11
(8,702 Views)

Hi Bill,

 

If you wanted to just start on exceeding value, then some devices have analog trigger. 

 

If you need to count just and only in the time your signal is over some treshold, and you need to implement this on HW level, I believe this is not possible with DAQ boards (unless your signal is digital). For such a application, the easiest would be to use FPGA board. You could possibly reshape your signal (trigger) to TTL voltage logic with some external circuit (but you wouldn't be able to control voltage levels well programmatically). 

 

 

regards,

Stefo

Certified-LabVIEW-Developer_rgb.jpg

0 Kudos
Message 2 of 11
(8,681 Views)

Hi Bill,

 

You actually can count the time your signal is above a threshhold with DAQ boards that support analog triggering (the analog comparison event is a digital signal that you can measure with a counter):

 

2010-04-21_131057.png

 

 

However, I still don't know what you need to do exactly.  What happens once the timer hits 30 seconds?

 

 

Best Regards,

John Passiak
Message 3 of 11
(8,667 Views)

Hey John,

 

You are very right. Sorry for missleading answer. It was actually so simple, directly in multifunction DAQ user manual Smiley Surprised

 

 

shame on me,

stefo

Certified-LabVIEW-Developer_rgb.jpg

0 Kudos
Message 4 of 11
(8,654 Views)

Thanks John! That's exactly what I want to do. Please could you help me do that counter in labview? 

So after the 30 seconds above the threshold, i should get a boolean TRUE.

 

looking forward to hear you soon, 

 

 

Bill 

0 Kudos
Message 5 of 11
(8,637 Views)

Hi Bill,

 

Is the "boolean TRUE" just a software indicator of whether or not the value has been high for 30 seconds?  If so then the above option probably isn't necessary.  If you just do a software-timed read and a little bit of processing in the loop you can indicate when the signal has been above a threshhold for 30 seconds.  Here's a VI Snippet that does this:

 

SW_Counter.png

 

 

 

Best Regards,

John Passiak
0 Kudos
Message 6 of 11
(8,634 Views)

Hi John,

 

That's what I exactly want to do! Please could you send me the VI or let me know the name of the used components.

Sorry for the late reply and Thank very much! 

 

Bill 

0 Kudos
Message 7 of 11
(8,567 Views)
Solution
Accepted by Bill El Sayed

Hi Bill,

 

Which version of LabVIEW are you using?  If you're on 2009 you can actually save the .png file to your computer and just drag it into the block diagram of a blank VI.  Also attached is the same VI saved in LV 8.2 (the feedback node was replaced with a shift register during the downconversion).

 

 

Best Regards,

John Passiak
0 Kudos
Message 8 of 11
(8,560 Views)
THANKS a lot John!
0 Kudos
Message 9 of 11
(8,520 Views)

Please John can I ask you a favor? 

 

This VI is extremely helpful but I need now to modify it a little bit. is there a way to add one more condition to restart the timer?

So if the timer is ON and one value drops below 30, the timer should not restart but it should check one more condition.

This condition is : Check the average of few elements ( depends on the sampling rate).

* If the average is below 30 we should restart the timer,

* else (the average is above 30) we should keep the timer ON

 

Thanks very much!! 

0 Kudos
Message 10 of 11
(8,517 Views)