01-09-2011 02:37 AM
Hellow ,
i'm tying to create a sin waveform and i don't know if the way to create this wave is similar to creating analog normal analong volt output
this is what i did :
int AnalogOutputSin (double *freq,double *amp,char chan[256] ,double *offset)
{
int error=0;
TaskHandle taskHandle=0;
char errBuff[2048]={'\0'};
float64 freqCast;
float64 ampCast,offsetCast;
freqCast = *freq;
ampCast = *amp;
offsetCast = *offset;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAOFuncGenChan (taskHandle, chan, "", DAQmx_Val_Sine, freqCast, ampCast, offsetCast));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
/*********************************************/
// DAQmx Write Code
/*********************************************/
????????
DAQmxClearTask(taskHandle);
Error:
if( DAQmxFailed(error) )
{
DAQmxGetExtendedErrorInfo(errBuff,2048);
/*********************************************/
// DAQmx Stop Code
/*********************************************/
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
}
if( DAQmxFailed(error) )
MessagePopup("DAQmx Error",errBuff);
return 0;
}
i dont know what tio write in the DAQmx Write Code section i looked for some examples but didnt find any.....
01-10-2011 11:51 AM
Duplicate post. Please refer to this forum.