Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

measure pulse width of signals generated by DAQ

Solved!
Go to solution

Eventually, I would like to:
    Start a counter pulse width measurement and analog out at the same instant.
    Stop the pulse width measurement with an external digital signal.

My current plan is to use a digital out on the DAQ to synchronize a digital input and the counter start input.  The digital input will be a start trigger for the analog output.  This works, except for the counter.

While trying to implement this, I tried a simpler test of just generating a digital pulse with the DAQ and wiring that to the counter inputs.  That doesn't work, even though it looks fine on an oscilloscope.  Then, without changing the software at all, I connect a function generator to my  counter inputs, and it measures pulse widths flawlessly.

I'm actually implementing this with a Python wrapper around the DAQmx C API, but I recreated it in LabVIEW, and it behaves the same.  VI attached.  I have the latest DAQmx drivers.

 

I accidentally posted this in a LabVIEW forum, plus I managed to post with a coworker's account.  I figure 2 screw ups like that warrant another post.  Sorry.  Old post is http://forums.ni.com/ni/board/message?board.id=170&message.id=389856.

Download All
0 Kudos
Message 1 of 2
(4,231 Views)
Solution
Accepted by topic author jpkotta

Solution:  I needed to set the counter channel with implicit timing.  Also, the sampsPerChanToAcquire must be at least 2, otherwise there is an error.  I still don't understand why it worked with an external pulse source though.

 

DAQmxCfgImplicitTiming(task_handle, DAQmx_Val_FiniteSamps, 2)

0 Kudos
Message 2 of 2
(4,225 Views)