03-26-2007 04:17 PM
int
error=0;int32 sampsPerChanRead;
bool
thread;TaskHandle taskHandle=0;
// Analog OutputTaskHandle taskHandle1=0;
// Analog InputTaskHandle taskHandle2=0;
// Digital Inputfloat64 data[10000];
float64 Range[3] ={1.5,4.0,9.9};
float64 temp[2000];
float64 trianglewave[1000];
float64 FlowData[1000];
char
errBuff[2048]={'\0'};char
output[1000];CPaintDC dc(
this);CString str = "top";
char
tempstr[10];int32 written;
int
i=0; /*********************************************/ // Initialize Card /*********************************************/DAQmxResetDevice ("/Dev1/");
for(;i<1000;i++)data[i] = 4.9*(
double)i/4000.0; /*********************************************/ /*/ DAQmx Configure Code/*********************************************/
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateAOVoltageChan(taskHandle,"Dev1/ai0","",-5.0,5.0,DAQmx_Val_Volts,NULL));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"",1000,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
/*********************************************/ /*/ DAQmx Write Code/*********************************************/
DAQmxErrChk (DAQmxWriteAnalogF64(taskHandle,1000,0,10.0,DAQmx_Val_GroupByChannel,data,&written,NULL));
/*********************************************/ /*/ DAQmx Start Code/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
03-26-2007 05:30 PM