My previous posting seems to have developed into a different related question.
Using the ANSI C example program TwoEdgeSep.c. In my application I want to measure on both counters of a USB 6210 so I am interested in starting both counters and then waiting for the counter tasks to finish, and then reading the results.
To test this out on a single counter I added the following loop:
// code before here is as the original example
//apart from bool32 Yes; declaration
/*********************************************/
// DAQmx Start Code
/*********************************************/
DAQmxErrChk (DAQmxStartTask(taskHandle));
loop: DAQmxErrChk (DAQmxIsTaskDone(taskHandle,&Yes));
if(Yes==0)
goto loop;
// code after here is as the original example
/*********************************************/
// DAQmx Read Code
/*********************************************/
DAQmxErrChk (DAQmxReadCounterScalarF64(taskHandle,30.0,&data,0));
printf("Measured Pulse Width: %.9f sec\n",data);
I tested this without the loop and put in a 1 sec pulse onto the default inputs and it worked fine.
If I enable the loop then the program stays in it for ever, however many pulses I put in. I think this means that the task is never done. I get the feeling that the counter is not ARMED until the call the Read function but I cant see a way of doing that earlier.
Looking for help
Martyn Eccles