12-06-2010 02:15 PM - edited 12-06-2010 02:16 PM
I looked into the documentation further, and we actually do specify what the behavior for Is Task Done? should be for On Demand tasks. From the DAQmx Help:
If the measurement or generation is finite, the task is done when you acquire or generate the final sample or when you call the Stop Task function/VI. If the measurement or generation is continuous (including on-demand timing), the task is not done until you call the Stop Task function/VI. In addition, the task is done if a fatal error is generated while performing the measurement or generation, or you abort the measurement or generation. Check for errors and warnings to verify the task completed successfully.
So... the task indeed should not be done unti Stop is called. Corrective Action Request #276690 has been filed to address the issue, the behavior should be changed in an upcoming release since it goes against the documented (and more intutiive) behavior.
In the meantime, if you want to explicitly start and stop the tasks in parallel threads, I suggest simply keeping track of the current state with a global variable.
Sorry about the confusion, I guess the notion of a task being "done" was a bit vague to me for "On Demand" tasks, but it clearly does state in the documentation what the behavior should be.
Best Regards,