03-21-2018 03:59 PM
Hello Blokk,
You mentioned "Also, you should avoid using Express VIs in real application, and also do not use dynamic data type". Can you elaborate on this?
Thanks
03-21-2018 04:07 PM - edited 03-21-2018 04:10 PM
@xliu461 wrote:
Hello Blokk,
You mentioned "Also, you should avoid using Express VIs in real application, and also do not use dynamic data type". Can you elaborate on this?
Thanks
Express VI for DAQ is ok for quick testing, but not for real applications. First, the Express VI initializes and closes the DAQ task at EVERY call. This is not optimal procedure. The usual way when you use DAQmx low level functions is that, first you initialize plus setup your task BEFORE your DAQ loop, then you Close the Task AFTER the loop. So only a single initialize and a single close step involved. Initializing a task takes some resources and extra time, sometimes this is not an issue, sometimes it is. All depends on your application.
Second, the dynamic data type is "evil". It hides details from you. Ok for beginners for quick measurements, but you are much more flexible and effective if you use proper data types, like 1D/2D arrays or waveforms with DAQmx Read/Write functions.
EDIT:
You can read more info at this page: http://www.ni.com/product-documentation/2835/en/
"Certain data acquisition applications require more flexibility and/or performance than the DAQ Assistant provides. These applications require the simple, yet powerful, NI-DAQmx functions described below."
03-21-2018 05:21 PM
@Blokk wrote:
@xliu461 . First, the Express VI initializes and closes the DAQ task at EVERY call. This is not optimal procedure.
That is not actually true. If you open the Front Panel of the DAQ Assistant and examine the code, you'll see that the configure channels and Stop and Clear Task functions are all in case structures so they'll only occur on first and last call.
That said, the Express VI hides the details from you and always puts out the blue DDT wire that hides the details of the data. For those reasons, it is good to learn the lower level DAQ functions and use them so you'll know what your code is really doing.
03-22-2018 01:15 AM
@RavensFan wrote:
@Blokk wrote:
@xliu461 . First, the Express VI initializes and closes the DAQ task at EVERY call. This is not optimal procedure.That is not actually true. If you open the Front Panel of the DAQ Assistant and examine the code, you'll see that the configure channels and Stop and Clear Task functions are all in case structures so they'll only occur on first and last call.
That said, the Express VI hides the details from you and always puts out the blue DDT wire that hides the details of the data. For those reasons, it is good to learn the lower level DAQ functions and use them so you'll know what your code is really doing.
Correct! For some reason I thought the code is equivalent with what you get using the "Generate DAQmx Code" 🙂 Of course, there is the "Open Front Panel" option, and yes, there are the Case structures for init and close.