In my application I'm using a Functional Global Variable for all Task-related operations. I create a task, then I start it, then I read from the DAQmx buffer and everything works fine. Then I stop the task and the task doesn't seem to stop. I first saw this problem when I tried to restart the task and I got a message saying the task was reserved. So then I tried stopping the task and then waiting till the task was done (constantly reading the Done? boolean on the DAQmx Task property node). The task never got done UNLESS I placed a breakpoint somewhere (probably right before the property node), stopped at the breakpoint, and continued.
Should I be doing something else BEFORE I stop the task (like reading all samples from the buffer)? I thought I had somehow solved this problem a while ago, but I was mistaken. I first saw this with a USB9215A, but I'm now seeing this with a simulated E-series DAQ.
Thanks!