02-25-2011 05:15 PM
Hello,
I wished to inquire about the DAQmxErrChk function. What is it used for and how can it be used to control regeneration? I have observed the following syntax:
DAQmxErrChk (DAQmxSetWriteAttribute (genTaskHandle, DAQmx_Write_RegenMode, DAQmx_Val_DoNotAllowRegen));
Provided I rename genTaskHandle to my own task name (nitWFM), whould there be anything I would need to do to set DoNotAllowRegeneration? Does it matter how I define the task? Where I observed this code there was the following for task definition:
DAQmxErrChk (DAQmxCreateTask("",&genTaskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan (genTaskHandle, channels, "", -10.0, 10.0, DAQmx_Val_Volts, NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming (genTaskHandle, "", rate, DAQmx_Val_Rising, DAQmx_Val_ContSamps,
SAMPLESNB));
In my code the task is defined as such:
std::auto_ptr<CNiDAQmxTask> nitWFM;
nitWFM = std::auto_ptr<CNiDAQmxTask>(new CNiDAQmxTask());
Would defining my task like this enable me to still change the Regenation via the above line?
Solved! Go to Solution.
03-02-2011 10:26 AM
masterron1:
The DAQmxErrChk function is used to check the status code when calling DAQmx functions (see example here).
If you'd like to change the regeneration settings, there is a regeneration mode property you can set, called "DAQmxSetWriteRegenMode."
For more info on the regeneration properties, see the NI-DAQmx C Reference Help. You can get to it from your Start Menu in "Programs --> National Instruments --> NI-DAQ --> Text-Based Code Support."
Go to the search tab and enter "Regeneration" to get the full list of topics. The first result should have what you need.
Hope that helps!