06-04-2009 09:34 AM
I'm uing PCI-6025E board and checked MAX can count DMI counter connected in /Dev1/PFI3 of ctr0.
But when I use DAQmxReadCounterU32 function in example code, it returns 0 of 'read' integer value but doesn't show the number of counting.
The example code is:
--------------------------------------------------------------------------------------
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateCICountEdgesChan(taskHandle,"Dev1/ctr0","",DAQmx_Val_Rising,0,DAQmx_Val_CountUp));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"/Dev1/PFI3",1000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
while(1) {
DAQmxErrChk (DAQmxReadCounterU32(taskHandle,-1,10.0,data,100,&read,NULL));
printf("\rAcquired %d samples",read);
fflush(stdout);
}
----------------------------------------------------------------------------------------
I set the second parameter of DAQmxReadCounterU32() as -1 to read infinite DMI counting.
How can I read the DMI counting just like MAX does?
Thanks,
06-05-2009 05:37 PM