Real-Time Measurement and Control

Showing results for 
Search instead for 
Did you mean: 

cDAQ DAQmx Analog Output Waveform change of data is very slow

Hello there,

I am using a cDAQ 9189 with a NI 9263 outputting analog voltage waveforms (sine waves). The software we are using is self-written in C++ using the DAQmx C library.


The user of the software is supposed to change some parameters of the sine wave. The update of that should be as fast as possible. But with the way, I implemented it needs several seconds to take the new values over. I am using the following code to initialize and write to the AO port:

DAQmxCfgSampClkTiming(oscillationTask,"",numSamples*f,DAQmx_Val_Rising,DAQmx_Val_ContSamps, numSamples);
//Create data
int numSamples = 1000;
int phaseN = 0;
int i = phaseN;
QVector<float64> dataRef = QVector<float64> (numSamples);
int PI =3.1415926535;
double offset = 0.;
                dataRef[i-phaseN] = amp*sin((double)i*2.*PI/numSamples)+offset;
//Write data
    float64     data[100000];
    memcpy(data, dataRef.constData(), numSamples*sizeof(float64));

//When I want to change something I use again:
//It is executed super fast but takes several seconds to see a change at the output

The last function is used for changing the waveform during runtime. It is working fine but needs several seconds to see a change at the analog output. Do somebody maybe have an idea how to optimize this?






0 Kudos
Message 1 of 3

Hi florian.vollrath,


I know this post has been open for a little while. You may have more success reposting this in the Multifunction DAQ forums, as this is forum is for Real-Time systems like cRIO and LabVIEW FPGA.

Connor W.
Applications Engineering
National Instruments
0 Kudos
Message 2 of 3

Thanks for the hint, I just did Smiley Happy

0 Kudos
Message 3 of 3