LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Generating Sin Wave with NI-6733

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.....

-----------------------------------------
Kobi Kalif
Software Engineer

0 Kudos
Message 1 of 2
(2,758 Views)

Duplicate post. Please refer to this forum.

Steven K.
National Instruments
Software Engineer
0 Kudos
Message 2 of 2
(2,738 Views)