I'm using a 6602 board in continuous two-edge separation mode.
Whenever an error occurs, I can't figure out how to recover and make the task usable again.
For example, when this occurs:
Error: Two consecutive active edges of the input signal occurred without a counter timebase edge.
I have tried a number of steps to then recover and continue with the app. I always get this when next accessing the task:
Error: Task name specified conflicts with an existing task name.
After the first error, I have tried a couple of techniques for recovery. Currently, my code tries
DAQmxResetDevice ("Dev1");
followed by
DAQmxCreateTask("MyTaskName", ptask);
Previously, I had tried this sequence with the same result
DAQmxStopTask(taskHandle);
DAQmxClearTask(taskHandle);
DAQmxCreateTask("MyTaskName", ptask);
Finally, I have tried to not stop, clear or reset the task, but just go on reading from the task after the error.
I get 'Task specified is invalid or does not exist'.
So, my question is, what is the correct sequence of API calls to correctly recover from an error when using mx?
Also, I'm not interested in fixing the first error, I know how to do that. My concern is the more general issue of recovering from an arbitrary error.
Thanks