06-17-2013 06:43 PM
HI all,
I am getting high freq Sqaure waveforms into my DAQ card. The waveform starts at low amplitude but will undergo a jump that are of concern, I'd like to stop running LabView automatically when it's detected that there are N continuous square cycles whose amplitude exceeds a threshold y. I use a DAQ card having 2 counters, and frequency is within its limit.
Any help would be highly apprecciated. Thank you.
-Ian
06-18-2013 01:21 PM - edited 06-18-2013 01:24 PM
Hello,
Unfortunately you can't use a counter to count how many times a signal exceeds a threshold value unless the threshold corresponds to digital logic (5V TTL for example). It sounds like you are describing counting an analogue trigger with hysteresis. If you could be very descriptive about what your end goal is, it might be useful in order to provide the best possible advice.
http://www.ni.com/white-paper/4329/en/
I hope this helps,
Eric E.
06-18-2013 02:20 PM
Hi Eric,
Thanks a lot for your reply. It's like a double threshold problem. An analog signal (like square wave) is monitored, the amplitude of the signal will undertake an increase after an unknown period, the goal is to detect this increase rather quickly within N continuous square pulses whose amplitude exceeds a set threshold y. Note I'd like to count N based on the rising edge of each pulse only, not the entire cycle, after determining the amplitude of the rising edge is greater than y. I appreciate your help deeply.
-Ian
06-19-2013 03:39 PM
Hello,
You would need to use the data that you read in the analogue voltage task to trigger the stop button on the while loop around the DAQmx Read VI loop to stop. I believe your code would read something like this:
Once the data being read crosses my first threshold, look for the data to cross the next higher threshold. If it does, then update my counter by one. Once the data is below that first threshold, then you can start our 2nd threshold test again. With an "Equal?" comparison VI we can check if the counter is equal to a certain value (N). The output of the comparison will be wired to the while loop stop button.
I hope this helps,
Eric E.