Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Fast Analog and Digital sampling

Hello,
I am using Visual Studio.Net 2005 and DAQmx 8.3 to interface with the device USB-6008.

The analog line represents two signals, I know which of them is currently active by reading the digital line, and I need to store them both.
The data logging works fine apart from the slow speed, I am getting about 30 samples per second.

I am doing the following to obtain the data:

    while ((i < MAXSAMPLES) && (DIData[0] == DigitalReader.ReadSingleSampleMultiLine()[0]))
    {
        AIData[ord(DIData[0]), i] = AnalogReader.ReadSingleSample()[0];
        i++;
    }

Is there a faster way to acquire the data?

Ariel.

0 Kudos
Message 1 of 4
(3,440 Views)
Hi Ariel,

The way that you are currently acquiring the analog data with the ReadSingleSample method in a loop is entirely software timed.  The speed at which your PC can execute the read function is causing the limitation of 30 samples per second.  If you need a faster sampling rate I recommend setting up a hardware timed acquisition so that the internal timebase of the USB-6008 is used.  For your application you could continuously acquire data from the channel.  Depending on the state of the digital line, you could read the data to a different array or file.  I would recommend starting with one of the shipping examples for continuous acquisition located in the following directory:  C:\Documents and Settings\All Users\Documents\National Instruments\NI-DAQ\Examples\DotNET2.0\Analog In\Measure Voltage\ContAcqVoltageSamples_IntClk.

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 4
(3,414 Views)
Thanks for the reply,
The problem is that the digital line changes every approximately 50ms.

* If I’ll do the same for the Digital line, logging them both in parallel, are they going to be kept in sync?
This way I can sort the data on the PC.  

* Or is there a way to configure the device to start logging the data on falling and stop on raising (and visversa)?
The closest thing I could find is AcqVoltageSamples_IntClkDigRef but it shows only how to start the sampling

* Or in case you have a better suggestion please let me know.

Ariel.

Message Edited by tanffn on 06-03-2007 01:45 AM

0 Kudos
Message 3 of 4
(3,385 Views)
I’ve resolved the problem by sampling the digital input in an analog input (option 1), as the digital line has only static sampling..

Thnaks for the help,
Ariel.
0 Kudos
Message 4 of 4
(3,375 Views)