Counter/Timer

cancel
Showing results for 
Search instead for 
Did you mean: 

How to read external triggering count with DAQmxReadCounterU32?

ScreenHunter_01 Jun. 11 10.28.jpg

 

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,

I'm converting DAQ to DAQmx..from Parkoz.com
0 Kudos
Message 1 of 2
(3,817 Views)

Hi anarkie,

 

This thread addresses your issue, and should be of some help.

David
Applications Engineer
National Instruments


Digital Multimeters
0 Kudos
Message 2 of 2
(3,799 Views)