02-26-2009 10:45 AM
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.
Solved! Go to Solution.
02-26-2009 07:47 PM
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)