04-19-2010 11:57 AM
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
Solved! Go to Solution.
04-21-2010 02:40 AM
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
04-21-2010 01:12 PM
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):
However, I still don't know what you need to do exactly. What happens once the timer hits 30 seconds?
Best Regards,
04-22-2010 01:31 AM
Hey John,
You are very right. Sorry for missleading answer. It was actually so simple, directly in multifunction DAQ user manual
shame on me,
stefo
04-22-2010 01:31 PM
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
04-22-2010 02:06 PM
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:
Best Regards,
04-28-2010 03:23 PM
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
04-28-2010 04:21 PM
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,
05-01-2010 05:26 PM
05-01-2010 06:02 PM
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!!