Showing results for 
Search instead for 
Did you mean: 

NI 6602 how to synchronize frequency counter

NI 6602 how to synchronize frequency counter

Hi, i'm working with a NI 6602 board. Actually we have 3 optical encoder connected to ctr0 (pfi38), crt1(PFI34)  and ctr2(PFI30). I need to have synchronous acquisition of frequency. I'm using NI-DAQMX with C . Our goal is to display frequency variation between the 3 entry.

I think using  edge count can be a better way to have synched samples but actually i can't change wiring and cannot connect my source signal to pfi39, pfi35 and pfi31.  I've tried to use  DAQmxSetCICountEdgesTerm(taskHandle,"Dev2/ctr0","Dev2/PFI38") , i have the error  -89120 (signal can't be routed). When i set  DAQmxSetCICountEdgesTerm(taskHandle,"Dev2/ctr0source","Dev2/PFI38") no error but always count 0.

My signal frequency is betwenn 0 and 16000hz.



My code is below

DAQmxErrChk (DAQmxCreateCOPulseChanTime(taskHandleOut,
       "Dev2/ctr4",  // gating pulse generated
       "channel 1",
       DAQmx_Val_Seconds, // units
       DAQmx_Val_Low, // resting state
       0.0,  // initial delay
       0.5,  // pulse train freq 0.,
          0.5));  // pulse shape
 DAQmxErrChk (DAQmxCfgImplicitTiming( taskHandleOut,

DAQmxErrChk (DAQmxCreateCICountEdgesChan( taskHandle,
       "channel 0",
       0,   // initial count
       DAQmx_Val_CountUp)); // count direction

 DAQmxErrChk (DAQmxCfgSampClkTiming( taskHandle,
      "/Dev2/Ctr4InternalOutput", // sample clock set to pulse gen
      20000000.0,    // max expected rate of sample clock
      10000000));    // buffer size




0 Kudos
Message 1 of 2 (3,107 Views)
0 Kudos

Re : NI 6602 how to synchronize frequency counter

Hi yipilipi,


To make edge count, you need to put your signal on the counter sources pin. If not you will not get counts!



Rémi D.
National Instruments France

>> Les rencontres techniques de NI - Mesures et acquisition de données : de la théorie à la mise en ...

0 Kudos
Message 2 of 2 (3,085 Views)
0 Kudos