03-04-2011 02:53 PM - edited 03-04-2011 02:54 PM
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.
Solved! Go to Solution.
03-07-2011 06:09 PM
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