yes, you can (and should) use the reserved state of the task to figure out if you can proceed. In fact, I would recommend your app be written to explicitly call reserve before doing a read operation and then call unreserve after you are done reading. The reserve/unreserve semantics ensure that only one task can use a particular DAQ resource.
Multiple analog output tasks will run into the same issues, but they wont collide with analog input tasks.
The various states of the task are:
1) unverified (this is the state the task starts in when a task is created, channels are added, timing/triggering is configured)
2) when u call Verify using the Task Control function, the driver validates all the settings in the task.
3) When Reserve is called, the har
dware resources necessary for the task (e.g., clocks, DMA, analog input subsystem)are reserved for exclusive use. Until this point you can configure multiple analog input tasks on the same device w/o errors
4) Commit - when this is called, the settings are programmed and deployed into the hardware (trigger settings, clock settings, etc.) and the device is now primed to begin operations as soon as Start is called.
The following points should be noted:
- If you skip all of these steps above and directly call Start (e.g., Load a task & start it), the DAQmx driver implicitly transitions the task through the
verified ->reserved -> commmitted state.
Hope this info helps.
Rajesh Vaidya, Ph.D
National Instruments