06-11-2013 03:03 PM
Does the DAQ Assistant call create and close say a task everytime its called? Therefore should I not constantly be calling it in a loop to get temperature readings?
06-11-2013 03:19 PM
It might depend on the way it is set up.
If you right click on the DAQ assistant and choose Open Front Panel, it will convert it to a subVI. You can open that up and look at the underlying code to see how it is working.
06-11-2013 03:44 PM
It is generally better to use the actual DAQmx API. This way you can setup the task once before your loop, read as much as you want inside of the loop, and close once after the loop. I would consider the DAQ Assistant preformance expensive. But it really does depend on your application.
06-11-2013 03:46 PM
Yes, thanks for this. I looked and they do create and clear so I will use the API.
06-11-2013 07:00 PM
Actually I think the DAQ Assistant is a little smarter than the code it generates when you convert it to code. For continuous tasks I believe it will create and commit your task on the first iteration of the loop and then leave it open for subsequent iterations, only closing it when the "Stop" input is written true or the calling VI goes idle.
For single-point or finite acquisitions the task will be closed on every iteration unless you wire false into the the "Stop" input (normally you would use whatever value is stopping the loop to also stop the task).
Using the lower-level API is also a safe bet.
~Simon