Quantcast
Channel: Measurement Studio for VC++ topics
Viewing all articles
Browse latest Browse all 654

Code does not continuously update data buffer

$
0
0

Hello friends. I have been working on a data acquisition software in C++ for an experiment at my university. I am working on a ni9239 module and have identified my problem with the code, but I do not yet know how to fix it. The problem is that my code does talk to the DAQ but only when the task is created. While the rest of my code is running (software that just prints out results) the DAQ code (I will place it below) does not update the buffer. When the program starts the active light flashes green but then does not again. This means to me that the program does talk to it, but does not update. The code states that the DAQ should update for the total time the program is running but it does not. Can anyone help me? 

 

(if this is the wrong place to ask this please let me know I was unsure)

 

Here is my code: 

 

DAQmxCreateTask("", &taskHandle);

 

DAQmxCreateAIVoltageChan(taskHandle, "cDAQ1Mod1/ai0:3", "", DAQmx_Val_Cfg_Default, -10.0, 10.0, DAQmx_Val_Volts, NULL); 


DAQmxCfgSampClkTiming(taskHandle, "", SampleRate, DAQmx_Val_Rising, DAQmx_Val_FiniteSamps, SampleRate * SampleTime);

 

DAQmxReadAnalogF64(taskHandle, SampleRate * SampleTime, 10.0, DAQmx_Val_GroupByScanNumber, data, 4 * SampleRate * SampleTime, &read, NULL);


DAQmxStartTask(taskHandle);


Viewing all articles
Browse latest Browse all 654

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>