Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

Auto stop at Nth continuous square cycles whose amplitude exceeds a threshold

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

0 Kudos
Message 1 of 4
(5,862 Views)

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.

0 Kudos
Message 2 of 4
(5,853 Views)

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

 

0 Kudos
Message 3 of 4
(5,847 Views)

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.

0 Kudos
Message 4 of 4
(5,829 Views)