Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Questions about Alternate Syntax using DAQmx

Solved!
Go to solution

Hello all,

my group has started using an alternative syntax for DAQmx Functions. Here's part of our original code:

 

nitWFM->AOChannels.CreateVoltageChannel("Dev1/ao0", _T(""), dMinimum, dMaximum, DAQmxAOVoltageUnitsVolts);
nitWFM->AOChannels.CreateVoltageChannel("Dev1/ao1", _T(""), dMinimum, dMaximum, DAQmxAOVoltageUnitsVolts);
nitWFM->AOChannels.CreateVoltageChannel("Dev1/ao2", _T(""), dMinimum, dMaximum, DAQmxAOVoltageUnitsVolts);
nitWFM->AOChannels.CreateVoltageChannel("Dev1/ao3", _T(""), dMinimum, dMaximum, DAQmxAOVoltageUnitsVolts);

 

which became:

 

DAQmxCreateAIVoltageChan(nitWFM,"Dev1/ao0","",DAQmx_Val_Cfg_Default,dMinimum, dMaximum,DAQmx_Val_Volts,NULL));
DAQmxCreateAIVoltageChan(nitWFM,"Dev1/ao1","",DAQmx_Val_Cfg_Default,dMinimum, dMaximum,DAQmx_Val_Volts,NULL));
DAQmxCreateAIVoltageChan(nitWFM,"Dev1/ao2","",DAQmx_Val_Cfg_Default,dMinimum, dMaximum,DAQmx_Val_Volts,NULL));
DAQmxCreateAIVoltageChan(nitWFM,"Dev1/ao3","",DAQmx_Val_Cfg_Default,dMinimum, dMaximum,DAQmx_Val_Volts,NULL));

 

we changed it to accommodate for a function that seemed to only work for us in one syntax (DAQmxSetWriteAttribute (nitWFM, DAQmx_Write_RegenMode, DAQmx_Val_DoNotAllowRegen))

 

My question is, what is the alternative syntax for the following lines?:

nitWFM->Control(DAQmxTaskVerify);

CNiDAQmxAnalogMultiChannelWriter writer(nitWFM->Stream);

 

because keeping them this way resulted in an error.

 

Your responses are much appreciated.

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

Hello,

 

The first function can be found in the C Reference Help by going to Start»All Programs»National Instruments»NI-DAQ»Text Based Code Support»NI-DAQmx C Reference Help and expanding the NI-DAQmx C Functions»Task Configuration/Control»Advanced»DAQmxTaskControl. This explains this function and the syntax to use. 

 

Regards,

 

Justin

Justin
National Instruments
Product Support Engineer - Conditioned Measurements
0 Kudos
Message 2 of 2
(5,499 Views)