Showing results for 
Search instead for 
Did you mean: 

What is the best/proper method for using DAQmx tasks

Should a task be created at the beginning of a program and destroyed at the end or should the task be created just before use and then destroyed immediately after use. The way I have been doing things so far has been the latter.
I am just curious if there are benefits to one way vs the other.
0 Kudos
Message 1 of 3


While either method will work fine, I recommend clearing the task as soon as you are finished with it. The benefit to this is that the resources that the task uses will be freed and you can use them again later in your program. If you don't clear the task when you are finished, then those resources will still be reserved. I hope that you find this information helpful.


Hal L.

0 Kudos
Message 2 of 3
Hal thanks for the reply. I do find the info useful. I was just wanting to verify that what I was doing is the preferred method. Since you agree, I will take it as good.
0 Kudos
Message 3 of 3