06-29-2010 06:01 PM
Hi, I am using a PCIe-6536 board to upload data from computer to another digital card. And I meet one trouble, which says,
"DAQmx Error: An internal error occurred
Status Code: -88700"
I include codes used here (neglecting variable initializing part), almost everything is in default setting. I am wondering if there is something wrong with the sequence of board initializing.
Could someone help me out? Thanks a lot in advance.
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,DEVPORT,"",DAQmx_Val_ChanForAllLines));
DAQmxErrChk (DAQmxTaskControl(taskHandle,DAQmx_Val_Task_Commit));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,CLOCKLINE,Rate,DAQmx_Val_Rising,DAQmx_Val_FiniteSamps,sample_num));
// I think error occurs in the below sentence, by adding debug sentence
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,sample_num,FALSE,Timeout,DAQmx_Val_GroupByScanNumber,DataArray,&written,NULL));
DAQmxErrChk (DAQmxStartTask(taskHandle));
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 ) {
DAQmxWaitUntilTaskDone(taskHandle,Timeout);
DAQmxGetWriteTotalSampPerChanGenerated(taskHandle,&generated);
printf("%d samples output successfully\n",generated);
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
}
if( DAQmxFailed(error) )
{
printf("DAQmx Error: %s\n",errBuff);
printf("Press ENTER to exit\n");
getchar();
exit(2);
}
printf("All output complete, Press Enter key to quit\n\n");
getchar();
06-30-2010 05:06 PM - edited 06-30-2010 05:06 PM
Howdy corcoted!
Try switching the order of the DAQmxWriteDigitalU32 and DAQmxStartTask functions. They should be in this order:
DAQmxErrChk(DAQmxStartTask(taskHandle));
DAQmxErrChk(DAQmxWriteDigitalU32(taskHandle,sample_num,FALSE,Timeout,DAQmx_Val_GroupByScanNumber,DataArray,&wri tten,NULL));
Regards,