DAQmxClearTask
int32 DAQmxClearTask (TaskHandle taskHandle);
Clears the task. Before clearing, this function stops the task, if necessary, and releases any resources reserved by the task. You cannot use a task once you clear the task without recreating or reloading the task.
If you use the DAQmxCreateTask function or any of the NI-DAQmx Create Channel functions within a loop, use this function within the loop after you finish with the task to avoid allocating unnecessary memory.
The task handle is the same value of type TaskHandle you used when you created the task
Elijah Kerry
NI Director, Software Community