LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I Improve the acquisition rate with usb-6008 and daqmx?

Solved!
Go to solution

Hello,

I'm trying to acquire some analog voltage data with a USB-6008. I am running Labview 8.5 student on an HP laptop with 1.33Ghz cpu and 736MB RAM, apparently. I have tried using Daq assistant, and the Daqmx low-level functions. My best results have come from using a task defined in MAX for my analog input, and using the 'Daqmx read' function set to 'single sample 1D double ' in a while loop. I insert the returned values in an array which builds within the while loop, and then when I finish I check the number of samples in the array. In the test VI attached, I also use the Get date/time function before and after the while loop. Using this method, the best sample rate I have achieved is around 40samples/second. I have attached a VI below that illustrates this concept. In my actual application, the DAQ code executes in a timed while loop with 1ms period, parallel to other code that controls the apparatus I am gathering data from. The sampling rate is roughly the same for my test VI below and my application program.

 

The datasheet for the 6008 gives the maximum sample rate as 10kHz. I would be happy with 2-2.5kHz, or as fast as possible; I'm sure I can achieve somewhat more than 40Hz. My first idea was hardware-related, but the 6008 can't do hardware-timed acquisitions.

My question is: How can I implement a faster sampling of analog voltages from a USB-6008 in LAbview? If I can't, is there any other way I can sample the data more quickly? 

Thanks,

-SK-

 

0 Kudos
Message 1 of 4
(3,457 Views)
Solution
Accepted by topic author -SK-

To the best of my knowledge, the USB 6008 can do hardware timed acquisition. Just remember that it is a multiplexed device, so if you add 8 channels then the maximum rate you can set is 10k/8

 

If you are new to LabVIEW I would suggest that you try this example program first

 

<Labview folder>\examples\DAQmx\Analog In\Measure Voltage.llb\Acq&Graph Voltage-Int Clk.vi

 

Amit

0 Kudos
Message 2 of 4
(3,449 Views)

I agree with Amit.

 

Also, you should probably approach this by creating a NiDAQmx task and using a Timing vi to specify multiple samples for a Finite number of samples, and wiring a Rate to these.

 

I use a USB-6009 at multiple kHz without any problem. But it looks like you are creating a software timed loop. You have to let the 6009 do its own timing if you want to go faster than dozens of Hz or want to avoid occasional long gaps because of PC latency under Windows. Your Read vi is not for causing the measurement to happen, it's to transfer data from the buffer for the 6009 into the rest of your program.

0 Kudos
Message 3 of 4
(3,414 Views)

Thank you for the replies. I had tried that example before, but I had received an error message, something to the effect of 'the hardware does not support this action'. I guess I didn't do it right.

-SK-

0 Kudos
Message 4 of 4
(3,401 Views)