Hello Sandra,
Thanks for the clarification. I removed the timing in the code and changed the
DAQmxReadCounterF64 function to DAQmxReadCounterScalarF64. My code is:DAQmxErrChk (DAQmxReadCounterScalarF64(taskHandle,10.0,&data,0));
printf("Acquired %d samples\n",data);
where I use the print to output the current encoder reading is. The problem I get now is that as I spin the motor
I only get a discrete amount of values as output, they seem to fluctuate from 0 to a positive number to negative number
back to 0 and again...I am playing around with the "pulsesPerRev" parameter in the DAQmxCreateCIAngEncoderChan function since the motor that I am testing this with is conected to a gear box, but if I take into acount the gear reduction
in selecting the pulses per revolution I still get the discrete number of output.
Any ideas as to what am I doing wrong?
I would like to get an incremental value starting at 0 and growing as the # of revolutions increases
without reseting.
Thanks in advance for your help.
Best regards,