LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmx Counter Input Measurements

Hi I am wondering if there is a way to create one Counter Input Frequency channel to measure frequency, duty cycle, period and pulses all at once?  Do I have to create a separate channel for each one?  Thanks.

0 Kudos
Message 1 of 2
(784 Views)

Yes, kind of, but you'll have to do some (trivial) math on the raw readings.

 

If using a newer device that supports "Pulse Measurement" mode, that'll be the easiest starting point.  With older devices you'd need to do semi-period measurement *and* should then also explicitly set the polarity of the "starting edge".

 

With semi-period measurement, specify units=seconds and starting edge=rising.  When you read your array of measurements, I'd highly recommend that you always retrieve an even # of them.  The array of data will alternate between high times and low times, so each length=2 subset gives you everything you need to calculate what you want.   (With Pulse Measurement mode, reads return high time and low time as a clustered and identified pair, making things even easier).

 

period = high_time + low_time

frequency = 1 / period

pulse width = high_time

duty cycle = high_time / period

 

 

-Kevin P

 

 

 

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
Message 2 of 2
(775 Views)