LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I speedup DAQ transfers

I inherited a 256 channels parametric tester and now I am looking into reducing execution time. My primary target is the DAQ transfer (92% execution time).
The existing software uses the following calls:
1) aquire data:
nidaqAICreateTask(,kNidaqWaveformCapture,...),
nidaqAIConfigBuffer(),
nidaqAIConfigChannelLimits(),
nidaqAIStart(), nidaqAIRead(), nidaqAIStop(),
nidaqAIDestroyTask().
2) setup clocks/triggers:
GPCTR_Set_Application(daq,ND_COUNTER_0,ND_PULSE_TRAIN_GNR),
GPCTR_Set_Application(daq,ND_COUNTER_1,ND_SINGLE_PULSE_GNR),
GPCTR_Change_Parameter(daq,ND_COUNTER_0,ND_SOURCE,ND_INTERNAL_20_MHZ),
GPCTR_Change_Parameter(daq,ND_COUNTER_0,ND_COUNT_1,((1/180)/50ns)/2),
GPCTR_Change_Parameter(daq,ND_COUNTER_0,ND_COUNT_2,55556),

GPCTR_Change_Parameter(daq,ND_COUNTER_0,ND_GATE,ND_OTHER_GPCTR_OUTPUT),
GPCTR_Change_Parameter(daq,ND_COUNTER_1,ND_SOURCE,ND_INTERNAL_20_MHZ),
GPCTR_Change_Parameter(daq,ND_COUNTER_1,ND_COUNT_1,2),
GPCTR_Change_Parameter(daq,ND_COUNTER_1,ND_COUNT_2,scanTime),
GPCTR_Control() to start, stop and reset the clocks.

Questions:
1) Does nidaqAIRead() perform a DMA transfer?
2) If not, what changes should I make to accomplish it?
3) Would NI-DAQmx 7.3 implementation speed-up the transfer? I cannot try it now because PXI-6533 and PXI-6704 are not yet supported, but I am willing to wait. I was told that the next NI-DAQmx version (scheduled sometime next year) will support these devices.

Platform info:
1) Hardware: PXI-1011, PXI-6052E, PXI-6533, PXI-6704, SCXI-1102C (8 cards) on Windows 2000
2) Software: LabWindows/CVI 7.1, Traditional NI-DAQ 7.3
0 Kudos
Message 1 of 3
(3,423 Views)
Dear AndySwimmer,

To address your first question, yes nidaqAIRead() performs a DMA transfer, especially if it is the only operation you are doing. The DAQ driver specifies DMA for each operation (AI, AO, DIO) until no more DMA channels are available. At that point, it would produce an error and you would have to switch one of the transfers to use Interrupts.

To your third question, I do not think the NI-DAQmx implementation would speed-up the transfer unless you consider the overhead in memory from the function calls. There are less function calls for sure in DAQmx. Once again, I don't think there would be much benefit.

I wonder, is the program performing the "acquire data" call more than once? If it is, there is a possibility you can use the nidaqAI
CreateTask() and nidaqAIDestroyTask() outside of this routine. Once the input task is stopped with nidaqAIStop() you can reconfigure using nidaqAIConfigBuffer(), therefore inside the "acquire data" routine you would only have:

nidaqAIConfigBuffer(),
nidaqAIConfigChannelLimits(),
nidaqAIStart(), nidaqAIRead(), nidaqAIStop()

Before calling the routine you would create the task and after all the routines have been called you could destroy the task. Once again, this would only benefit you if you call "acquire data" more than once.

Let me know if you have any further questions or if this does not resolve your issue.

Thanks again and have a great day!

Chad AE
Applications Engineer - National Instruments
Message 2 of 3
(3,423 Views)
Hi Chad,

The program is performing the "acquire data" multiple times (tens of thousands). The nidaqAICreateTask(), nidaqAIConfigBuffer() (for maximum # of scans) and nidaqAIDestroyTask() are indeed used outside of this routine. However, nidaqAIStop() and nidaqAIStart() are used everytime nidaqAIConfigChannelLimits() is called (at least once for each nidaqAIRead()).
I will move nidaqAIStop() and nidaqAIStart() inside the "acquire data" routine just as you suggested.

Thanks for your help.
Andy
PS: Is there a User Manual for the EasyIO library?
I only have the EasyIO function reference help from the LabWindows/CVI function panel.
0 Kudos
Message 3 of 3
(3,423 Views)