12-13-2006 03:41 PM
12-14-2006 09:13 AM
I know this once was, and maybe still is, an issue with E-series boards under traditional NI-DAQ. I only program LabVIEW, but it appears to me that you had the right idea by trying to specify Gate polarity. Way back I was trying to do this with E-series boards too, and I found that it simply didn't matter what I specified for Gate polarity, the values would start buffering on the first transition of *any* polarity. So it just came down to 50-50 chance.
The work-around I found was for cases where I could start my acquisition before the duty cycle signal started. In such cases, I would parallel wire the signal to a digital input pin and simply query the initial state. You can't get good hardware level timing between this digital input query and the counter measurement, so this method really can't be used to measure a continuously-running duty cycle signal. Later I just ran the app using a counter from a 6602 board which *did* respect my specified Gate polarity as the starting polarity.
I don't know if you're using traditional NI-DAQ or DAQmx, though the syntax inclines me to suspect traditional. If you haven't tried DAQmx yet, you might give it a try. I don't know for sure if it'll work, but I'd give it better odds than traditional NI-DAQ.
Note: the expected behavior for "Low-to-High" polarity setting should be an initial value representing time from starting the counter task until the first Low-to-High Gate edge occurs (whether or not any High-to-Low edges occur in between). All subsequent values would be ordered as High Time, Low Time, High Time, Low Time, ...
-Kevin P.
12-14-2006 09:33 AM
12-14-2006 09:59 AM
One other simple trick if the duty cycle changes slowly. Configure one counter to measure high pulse widths and the other to measure low pulse widths. If you're careful, you can start the tasks up at nearly the same time. The data won't quite be the truth since the arrays won't be perfectly aligned with respect to time, but you might get "good enough" results.
Also, I never tried doing an unbuffered semi-period measurement. Perhaps for unbuffered measurement, the polarity setting might be respected?
Good luck,
-Kevin P.
08-12-2011 06:17 AM
hello every body, please i have a question in this context , can i mesue the '' duty cycle "" with (((NI usb-6210 ))), i need a response please , i need it to do my graduate project , thanks of all
08-15-2011 11:18 AM
Hi Satouani,
The USB device that you have has two counters. You can use the counters to measure duty cycle. Please refer to the following example: Measure Duty Cycle - Buffered - Finite.
Best Regards,
Jignesh