From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Edge counting Problem- M series DAQ -continuous Aquisition

i have to measure some high frequncies of several KHz frequency ~10K upto 20K. the signals  are having large rising times and fast falling times.please see the attachment.

i'm using both the counter inputs of a PCI 6229 card. i tried to measure the pulse width of the signal but it didnt work. so now i would like to count the edges of the signal and then calculate the frequency. the signal i measure is connected to the gate of the counter.At the source, ai sample clock (sampling rate configured for analog inputs) is internally routed. i'm starting the analog input task before the counter starts, but still i couldnt get a measured valued. please see the vi also.

 

what voltage is selected to count a 1 and what for 0? i have read from the datasheet that all the voltages below 0,8 are considered as 0. is it right?? in my code do i need to consider this also???

 

any suggestion would be appreciated.

 

thanks.

Kudos always welcome for helpful posts 🙂
Download All
0 Kudos
Message 1 of 3
(2,642 Views)

Hi RENN,

 

the counter on an M-series DAQ devices is designed to work with digital signals only.

Analog signals (as in your case) will only work in special cases (when the TTL specifications are met). As the slew rate of the rising edge is far too slow, this won't work.

 

I would recommend to apply some external signal conditioning like e.g. a Schmitt Trigger.

 

Regards,
Bernd

Message 2 of 3
(2,597 Views)

For pulse and frequency measurements:  The PCI-6229 has analog inputs.  Use an AI channel to capture the waveform.  Then you can use the Pulse Measurement function to find the period and frequency.  Since your falling edge is much faster than the rising edge, use the low pulse selection as shown below.  You can set the voltage levels for high, mid, low, according to your actual waveform.  See the snippet below.  You will need to fill in the specifics for the DAQmx functions and add Error In and Error Out.  Hmmm, the reference levels cluster elements (hi, mid, low, absolute/percent) did not show up.  More problems with code snippet.

For reference levels, you can select percent enum and set hi=90, mid=50, lo=10, or you could select absolute and enter values in volts, hi=3.7, mid=2.5, lo=0.5.  try both to see which one works best.

 

20003i47C0D56A15946CF6

 

To count a number of pulses in a certain timeframe, you could use the same DAQmx method to acquire the signals, then process the waveform's Y data to count each negative going pulse.

 

 

 

- tbob

Inventor of the WORM Global
Message 3 of 3
(2,579 Views)