Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

looking for VC++ analog input DMA example

I am looking for sample code that illustrates the sequence of NI-DAQMX library function calls used for continuous recording in DMA mode. I am using Microsoft Visual C++ (2002), running under WinXP PRO, NI DAC6225 A/D card. Areas of particular interest are:

1) how the DMA buffer is initialized
2) knowing when and what part of the DMA buffer to extract data

I would appreciate if anyone can provide C/C++ sample source code that illustrates how to use DMA mode to continuous record analog (input) data.

Ian
0 Kudos
Message 1 of 2
(3,123 Views)
Hello Ian,

All of the examples located in C:\Program Files\National Instruments\NI-DAQ\Examples\VisualC should use DMA mode by default. There is a property you can use to control which mechanism is used (DMA or interrupts). Just open up the DAQmx C Reference Help file and do a search on "DMA". The DAQmx driver should handle all the buffering for you, so all you have to worry about is configuring the proper timing parameters and how many samples you want to read from the buffer. You'll notice that the DAQmxReadAnalogF64 function has a parameter for how many samples to read for channel. That is really the only direct interaction with the buffer. I hope this helps!
Eric
DE For Life!
0 Kudos
Message 2 of 2
(3,110 Views)