LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using NI 6013 DAQ timers to measure varying pulse widths

I am using an NI 6013 Multifunction DAQ board and I want to measure the pulse widths in a digital input signal. The input has 2 positive pulses with a gap in between. The pulse duration is in the range of around 500 ms.

The attached file shows the pulse pattern at the digital input. Need to measure the 3 pulse periods as indicated.

Using the Counter timer in the DAQ board, how do I measure the pulse widths accrately. I need to measure the width of the 1st positive pulse, the 2nd positive pulse and the negative pulse in between the positive pulses.

I am using LabVIEW to write the programs. Any examples thatmeasures the first and subsequent positive and neagtive pulse widths would be really helpful.
0 Kudos
Message 1 of 4
(2,917 Views)
Eapen,
We have an example of Semi-period Measurement (measuring high and low pulses) online. Simply go to www.ni.com. Then click: NI Developer Zone >> Development Library >> Measurement Hardware >> Counter/Timer >> Pulse Width & Frequency Measurements. Since the PCI-6013 has the DAQ-STC chip, try the example called "DAQ-STC: Measuring Various Types of Pulse Periods." Good luck with your application.
0 Kudos
Message 2 of 4
(2,917 Views)
Hello Sarah,

Thank you very much for the link. I tried to run the vi "Meas Buffered Pulse-Period(DAQ-STC) which is the vi under the topic "Measuring Various Types of Pulse Periods". However it does not give me reliable results. I run the VI first and it loops for the measuremnt to happen. Then I apply the gate input, and the VI finishes and gives the readings.

The following is the configuration I used.
Device: 1
Counter: 0
Time base: 20MHz
Config mode: measure buffered semi-periods
gate source: gate of the counter
gate signal: x(don't care)
gate mode: rising edge

I am not too sure what the "counts per buffer" is. Is it the number of periods to measure and write into the buffer. I set this to 1 first, since the input that I am applying at the
gate of the counter is only one positive pulse of about 350 ms. This did not give me any consistent value, sometimes the count reads 1 or 2 and sometimes very high number. If I set the counts per buffer to say 3, it still reads 3 values into the buffer, which I think is not correct, as the gate gets only 1 positive pulse.

I also tried another input at the gate this time 2 positive pulses(each of ~350ms) with a gap in between of ~450ms. I set the counts per buffer to 3 as there are 3 periods to read. Again the readings don't make sense. It appears that it is just taking 3 reading without waiting for changes in the gate input.

Is it possible that the gate input is affected by nosie and gets triggered at unwanted points and causing the measuremnets to be taken without waiting for the actual pulse to complete. How can this be prevented. How sensitive are the gate inputs to noise?

Hope you have some suggestions.

Rgds
Eapen
0 Kudos
Message 3 of 4
(2,917 Views)
Eapen,
Using a time base of 100kHz, gate source: no change, and gate mode: rising edge, I was able to get the appropriate values. For more information on the VI, go to File >> VI Properties >> Documentation. Have a great day!
0 Kudos
Message 4 of 4
(2,917 Views)