I'd like to have a counter output a single pulse whenever a condition occurs within a loop. My current solution (in pseudocode; I use LabWindows CVI on a RT target) looks like this:
DAQmxCreateTask(...);
DAQmxCreateCOPulseChanTime(...);
while (true)
{
if (condition)
{
t1 = Timer();
DAQmxStartTask(...);
t2 = Timer() ;
DAQmxErrChk (DAQmxWaitUntilTaskDone(*th,2));
DAQmxErrChk (DAQmxStopTask(*th));
}
}
DAQmxClearTask(...);Unfortunately, the delay between t1 and t2 is at least 0.142ms, and sometimes 2ms. Is there an elegant way to decrease this and not having to call StartTask again and again?
Thanks,
Jonas