Digital output waveform of NI-PCIe-6259 is taking 3microseconds even when through PCIe frquency is 10MHz
#include
#include
#include
#define DAQmxErrChk(functionCall) if( DAQmxFailed(error=(functionCall)) ) goto Error; else
int main(void)
{
int error=0;
TaskHandle taskHandle=0;
int32 data=1;
char errBuff[2048]={‘\0’};
int32 written;
/*********************************************/
// DAQmx Configure Code
/*********************************************/
DAQmxErrChk (DAQmxCreateTask(“”,&taskHandle));
DAQmxErrChk (DAQmxCreateDOChan(taskHandle,”Dev1/port0/line24″,””,DAQmx_Val_ChanForAllLines));
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
while(1){
/*********************************************/
// DAQmx Write Code
/*********************************************/
DAQmxErrChk (DAQmxWriteDigitalU32(taskHandle,1,1,10,DAQmx_Val_GroupByChannel,&data,&written,NULL));
data=~data;
}
Error:
if( DAQmxFailed(error) )
DAQmxGetExtendedErrorInfo(errBuff,2048);
if( taskHandle!=0 ) {
/*********************************************/
// DAQmx Stop Code
/*********************************************/
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
}
if( DAQmxFailed(error) )
printf(“DAQmx Error: %s\n”,errBuff);
printf(“End of program, press Enter key to quit\n”);
getchar();
return 0;
}
I’m using Linux Ubuntu 22.04LTS, I’m running the code.
when i toggle the data without any delay and plot the digital waveform in oscilloscope, i find that pulse width is around 3 microseconds as it should be 0.1microseconds according to board spec of 10 MHz
please help me in this case as fast as possible
Regards
Uzumaki
Read more here: Source link
