I want to use USB 6009 as an edge counter. I got this ouput :
create task
createCounterChan
start task
DAQmxBase Error -200428: Value passed to the Task/Channels In control is invalid.
with following code:
// Channel parameters
const char counter[] = "Dev3/ctr0";
// Read parameters
uInt32 readArray[1];
uInt32 arraySizeInSamps=1;
uInt32 initialCount=0;
int32 numSampsPerChan=1;
int32 sampsPerChanRead;
float64 timeout=100;
DAQmxErrChk (DAQmxBaseCreateTask ("", &taskHandle));
printf("create task\n");
DAQmxErrChk (DAQmxBaseCreateCICountEdgesChan (taskHandle, counter, NULL, DAQmx_Val_Falling, initialCount, DAQmx_Val_CountUp));
printf("createCounterChan\n");
// Start Task (configure port)
DAQmxErrChk (DAQmxBaseStartTask (taskHandle));
printf("start task\n");
DAQmxErrChk (DAQmxBaseReadCounterU32 (taskHandle, numSampsPerChan, timeout, readArray, arraySizeInSamps, &sampsPerChanRead, NULL));
printf("Data read: 0x%X\n",readArray[0]);
Please help