05-14-2012 11:55 AM
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","
My signal frequency is betwenn 0 and 16000hz.
My code is below
"Dev2/ctr4", // gating pulse generated
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,
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
05-21-2012 10:34 AM
To make edge count, you need to put your signal on the counter sources pin. If not you will not get counts!
National Instruments France