Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Triggered Data Acquisition with USB 6008

Hello,
 
I am currently using a USB-6008 with LabWindows/CVI. I have an external TTL signal that is being routed into the 6008's counter channel (PFI0) and I would like to be able to use this signal to trigger data collection for the analog input channels. Here is sort of a general summary of the code I am using:
 
DAQmxBaseCreateTask("",&tH2);
DAQmxBaseCreateAIVoltageChan(tH2,"Dev1/ai0:3", ...etc... );
DAQmxBaseCfgDigEdgeStartTrig (tH2, "Dev1/PFI0", DAQmx_Val_Rising);
DAQmxBaseStartTask(tH2);
 
From what I understand, each rising edge on the TTL signal should result in the current analog input values being written to the 6008's buffer. Then, calling DAQmxBaseReadAnalogF64() should allow me to collect all of the data in the buffer. The problem is that every time I call DAQmxBaseReadAnalogF64(), I only retrieve two readings from each channel, regardless of how long I wait. A longer delay between calls should result in more data being acquired from the buffer, correct? I've also tried using DAQmxBaseCfgSampClkTiming() in place of DAQmxBaseCfgDigEdgeStartTrig(), but I ran into the same problem.
 
I'm wondering if I am approaching this the wrong way, or if there is something that I don't fully understand. Any help would be very much appreciated.
 
Thanks in advance,
 
Eric
0 Kudos
Message 1 of 3
(2,818 Views)

Hi Eric-

Is it possible that you are specifying "-1" as the number of samples to read with each DAQmxBaseReadAnalogF64()?  The behavior you describe (2 samples being returned) seems to point to the behavior that is often seen with that setting that was incorrectly documented in some early versions of NI-DAQmx Base.  I would encourage you to upgrade to NI-DAQmx (which fully supports your device) and check out the CVI example that installs with that driver at C:\Program Files\National Instruments\CVI80\samples\DAQmx\Analog In\Measure Voltage\Cont Acq-Ext Clk-Dig Start

Hopefully this helps-

Message Edited by Tom W [DE] on 07-24-2006 01:47 PM

Tom W
National Instruments
0 Kudos
Message 2 of 3
(2,809 Views)

Hi Tom,

I was indeed specifying '-1' as the number of samples to read. I've switched everything over to DAQmx and it seems to be behaving more nicely. Thanks for the help.

Eric

0 Kudos
Message 3 of 3
(2,792 Views)