Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQmxErrChk and Regeneration

Solved!
Go to solution

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?

0 Kudos
Message 1 of 2
(5,717 Views)
Solution
Accepted by topic author masterron1

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!

Caleb Harris

National Instruments | http://www.ni.com/support
0 Kudos
Message 2 of 2
(5,687 Views)