Task State Model

NI-DAQmx uses a task state model to improve ease of use and speed up driver performance.

The task state model consists of five states—Unverified, Verified, Reserved, Committed, and Running. You call the Start Task function/VI, Stop Task function/VI, and Control Task function/VI to transition the task from one state to another. The task state model is very flexible. You can choose to interact with as little or as much of the task state model as your application requires.



If you explicitly invoke a state transition that has already occurred, it is not repeated and an error is not returned. For example, if the task has already reserved its resources and, therefore, is in the Reserved state, calling the Control Task function/VI with the Action parameter set to Reserve does not reserve the resources again.

Sometimes, calling a function/VI may require multiple state transitions, such as calling the Start Task function/VI while in the Verified state. In these cases, the task will implicitly transition between each of the necessary states to get to the final desired state, as shown in the following diagram.

Transitioning backwards in the Task State Model will undo any implicit forwards transitions in addition to the requested explicit transition. Continuing with the example above, calling the Stop Task function/VI after implicitly transitioning to the Running State from the Verified State will cause the task to return to the Verified State, as shown in the following diagram.