I would like to know if using a Daqmx task constant input to a Daqmx Read vi inside a while loop allocates additional memory on each iteration of the while loop. To further explain my question please see the attached VIs. In DAQ01.vi I wire a task constant to a Start Task outside the loop, and then continue the wire insdie the loop for use by the Daqmx Read. Finally, teh wire exits the loop and the task is cleared outsiode the loop, when the loop exits. I believe this to be the satndard method given in NI examples.
In contrast, DAQ02.vi uses independent task constants (all referencing the same task name) for the Start Task (outside the loop) Read (inside loop), and Clear Task (outside loop, when loop exits). It is obvious that I could just run the wire into the loop easily in this application , but in the case of a more complex application, in which I might have the Read vi inside a subvi and may also access the read elsewhere in my application, I find it cleaner to reference the task constant.
It has been suggested to me that this method (as given in DAQ02.vi) could lead to memory leaks. I do not understand how this is possible if the Daqmx Read vi is not creating a separate task on each iteration, but is referencing the same task vi the task constant.
I would appreciate any other comments on this.
Thanks
Dan