Hey all,
I have an interesting problem using the USB-6210 to measure angular encoder information. If I look at the inputs to the encoder using MAX, I can clearly see smooth counts rising when I perform edge counting on the specific PFI channels that I've defined (PFI 1 and PFI3 are CHA and Ch b respectively). At the hardware level, I see no real issues (e.g. bad connections, noisy lines - edge counting seems to be rock solid on either PFI line). When I try to read data from encoder using CVI or measurement studio (7.0 and 6.0 respectively - DAQMx version is 8.3.f0), I get zeros returned and no configuration errors. TO make sure I wasn't doing anything in my code, I went to the example code (here is a snippet of the code). Again, no errors and no change in values returned. Does anybody have any thoughts? I'm at the end of my debugging. Interestingly, I switched to another 6210 that I had lying around in inventory and still no change. This is a problem that just occurred, the last parts I received from NI worked fine using the same hardware setup and code - I'm begging to wonder if the quadrature circuit in this batch of 6210s is not quite right.
Thanks in advance and I look forward to your responses.
Jeff
DAQmxErrChk (DAQmxCreateTask("",&taskHandle));
DAQmxErrChk (DAQmxCreateCIAngEncoderChan(taskHandle,"Dev1/ctr1","",DAQmx_Val_X4,0,0.0,DAQmx_Val_AHighBHigh,DAQmx_Val_Degrees,120,0.0,""));
DAQmxErrChk (DAQmxCfgSampClkTiming(taskHandle,"100kHzTimebase",100000.0,DAQmx_Val_Rising,DAQmx_Val_ContSamps,1000));
DAQmxSetChanAttribute (taskHandle,"Dev1/ctr1",DAQmx_CI_DupCountPrevent, 1);
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
printf("Continuously reading. Press Ctrl+C to interrupt\n");
while( 1 ) {
/*********************************************/
// DAQmx Read Code
/*********************************************/
DAQmxErrChk (DAQmxReadCounterF64(taskHandle,1000,10.0,data,1000,&read,0));
printf("Acquired %d samples\n",read);
for (i = 0;i < read;i+10)
printf("\tSample Value is: %f\n",data[i]);
fflush(stdout);
}