Academic Company Events NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Document Type: Tutorial
NI Supported: Yes
Publish Date: Sep 6, 2006

NI-DAQmx -- the Next Phase in the Evolution of Data Acquisition Software

27 ratings | 3.81 out of 5
Print

Overview

When PC-based data acquisition (DAQ) first emerged in the late 1980s, it revolutionized the way engineers and scientists take measurements. Rather than using a set of bulky stand-alone instruments that often required transcribing measurements to paper for data logging, PC-based data acquisition helps you harness the power of your computer to efficiently develop your measurement and control applications. The initial software, while functional, seems crude by today’s standards. Future generations improved on the first generation, and now National Instruments introduces the most advanced DAQ software technology with NI-DAQmx.

First-Generation DAQ Software

In the beginning, hardware vendors often shipped their DAQ devices with register-level programming software examples for C or a static library; this software provided basic functions for accessing hardware registers. Programming at the register level was difficult for many users, and both types of software required extensive development time even for simple applications. Additionally, the software written for the first PC-based DAQ devices could control only a single hardware operation (such as analog input) at a time, blocking all other hardware operations that tried to access the driver software until that operation was completed. Therefore, you could not perform concurrent DAQ operations, such as synchronized analog input and output.

Once you acquired the data, you faced an even more formidable task. Often, the drivers returned the raw data in binary format, which had to be programmatically converted to voltage. If you used sensors, you had to implement any necessary scaling programmatically as well. For example, a single thermocouple measurement would not only require you to acquire data from another type of temperature sensor for cold-junction compensation (CJC), but it would also require you to scale the raw thermocouple voltage data to the correct units by implementing an nth order polynomial scaling function or a complex look-up table in your program. Again, this cost extra time and effort that could have been spent optimizing a design, rather than creating the system to test a design.

Second-Generation DAQ Software


The early 1990s brought about a second generation of driver software that built upon and offered many improvements over the first-generation software. National Instruments NI-DAQ software for measurement and control emerged, providing extended functionality over the first-generation model of programming data acquisition.

As second-generation NI-DAQ software evolved during the late 1990s and early 2000s, it added coverage for the widest range of hardware platforms (PCI, AT, USB, PCMCIA, PXI, and FireWire) of any DAQ vendor. Moreover, it provided access to the widest variety of voltage ranges, sensors, and signal types by adding signal conditioning functions. It enabled measurements of voltage ranges up to 1000 V and sensors such as strain gages, RTDs, pH sensors, and many more.

This second-generation driver software also featured many updates that made it easier for you to control and acquire data from PC-based DAQ hardware. NI-DAQ included a configuration utility with which users could configure and test each channel of their hardware before they began programming. You also could create "virtual channels," which provided not only logical naming of channels (for example, Voltage Channel 1), but also scaling to engineering units for common sensors and signals. For example, you could create a channel that read a voltage signal from an accelerometer and scaled the voltage data into g units, all without programming. You could then use this channel in your program to acquire data without researching and implementing complex conversion algorithms in your code. You could even create custom scaling polynomials or import look-up tables for less common sensors. As illustrated in Figure 1, this advancement significantly decreased the amount of development time it took to convert raw voltage data from sensors into proper units.


Figure 1. Code Reduction for a Thermocouple Measurement Using NI-DAQ Virtual Channels

Second-generation DAQ software offered something more for advanced DAQ applications as well. You could also synchronize multiple boards together for accurate timing and triggering, even in high-channel-count applications. However, the interface for doing this required several functions or VIs, which could overwhelm a beginning user.

On the other hand, extensive Web and application capabilities made second-generation versions of NI-DAQ easier to use and helped you develop DAQ applications. In addition to thousands of KnowledgeBases, tutorials, and example programs available on the Web, experienced measurement and control developers and partners increasingly became part of growing worldwide community devoted to developing and deploying NI data acquisition applications. As of March 2003, users could find more than 650 NI Alliance Program and solution partners worldwide, more than 60 LabVIEW and NI DAQ training facilities, and more than 2000 measurement and control examples available for download on ni.com.

Third-Generation DAQ Software


The release of NI-DAQmx marks a third generation in DAQ driver software that enables you to take measurements and obtain meaningful information easier and more quickly than ever before. These changes apply not only to the LabVIEW environment, but to LabWindows/CVI and Measurement Studio for Visual Studio programmers as well.

While it still handles a broad range of bus interfaces, sensors, and signal types, the redesigned interface makes it simpler to develop even complex DAQ applications by providing identical functions and VIs for all types of operations. For example, rather than using a Digital Read function to read data from digital lines and an Analog Read function to read analog data, you use the same function for both, as shown in Figure 2. Functions like these, known as polymorphic functions, take on different characteristics based upon their input values. The combination of functions into one simple interface results in a flatter learning curve for you, not only for one device, but for an entire family of devices. Rather than learning four different ways to program the four types of operations (analog input and output, digital I/O, and counter/timer) available on National Instruments DAQ devices, you can now learn one way and reuse that knowledge to program the others.


Figure 2. With polymorphic VIs, you learn one interface for all DAQ operations.

The new interface streamlines the process by which you modify a simple application to form a more complex one. As you can see in Figure 3, the single set of VIs enables you to easily grow from simple operations (such as finite, software-timed analog input) to more complex operations (such as continuous, hardware-timed analog input) with just a few modifications to your existing code.

Figure 3. The NI-DAQmx programming interface requires few changes to progress from finite software-timed input to continuous hardware-timed input.

To further simplify DAQ programming, NI-DAQmx includes a new interactive measurement tool, DAQ Assistant. DAQ Assistant is a graphical way to configure your DAQ operation and then run it in LabVIEW, LabWindows/CVI, and Measurement Studio. Because DAQ Assistant is completely menu driven and requires no programming, you will encounter fewer errors and drastically decrease the time to your first measurement. With a single click, you can even generate code based on your configuration, which you can use as a starting point for a more complex operation in NI application software programs.


Figure 4. DAQ Assistant – Menu-Driven Task Configuration and Automatic Code Generation in LabVIEW

Prior to NI-DAQmx, DAQ drivers were single threaded. Consequently, users found it difficult to perform concurrent operations, such as continuous analog input and waveform output, without adding extra complexity to their programs. The new NI-DAQmx driver now eliminates the need to for this additional code because it has been designed to operate in multiple threads. Therefore, an analog input operation can occur in one thread, which will sleep until it has acquired the given number of points. And the analog output portion can operate in a separate thread. This makes concurrent DAQ operations much simpler to program.

Other benefits of this third-generation DAQ software include software and hardware-timed single-point I/O that execute at 50 kHz. These rates represent improvements of 20x and 2x, respectively, over previously achievable single-point I/O rates. Measurement and control applications ranging from temperature and position measurement to process control and manufacturing can all benefit from the increased execution speed.

Evolution Has Its Benefits


While DAQ driver software has improved over the years, few changes have affected its ease of use like those that National Instruments implemented in NI-DAQmx. With the new DAQ Assistant configuration utility and a simplified programming interface, NI-DAQmx will help flatten the learning curve for new users. In addition, NI-DAQmx will expand the capabilities of PC-based data acquisition with the new multithreaded driver and faster single-point I/O. Overall, these monumental changes will result in a significant reduction in development time for users.


[+] Enlarge Image
Figure 5. DAQ Software Evolution
Related Links:
Products and Services: NI LabVIEW
Products and Services: NI-DAQ Driver Software
Products and Services: Data Acquisition (DAQ) Hardware
27 ratings | 3.81 out of 5
Print

Reader Comments | Submit a comment »

..and this is meant to be good?!
"For example, rather than using a Digital Read function to read data from digital lines and an Analog Read function to read analog data, you use the same function for both," ..and this is meant to be a good thing?!!!!! Who are you kidding?! It just hides the complexity in invisible options rather than in the explicit choice of a tool for a job. It's like giving people a piece of jello and telling them they can use it as a hammer, or a saw, as they prefer! ...and what does it matter anyway, if they're not apparently bothering to write them for OS X?!. . Sad, sad times...
- Tom Lawton, EnFlo, MME, UniS. t.lawton@surrey.ac.uk - Jul 15, 2003

ended with more questions than started
This seems to me to be the answere to what is needed to allow a Tool & Die co. to integrate mechanical with computers that will enable us to go "where we have never gone before".
- Ronald Hoffman, Hoffman Tool & Die Inc.. rhof331314@aol.com - Jul 12, 2003

 

Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).