Table of Contents
- Data Acquisition Hardware
- NI-DAQmx and LabVIEW Graphical Programming
- Creating a Virtual Instrument in LabVIEW with NI-DAQmx
- Adding Analysis and Data-Logging Functions
- Continuing the Customization to Meet Your Exact Needs
- Take the Next Step
| Whether you are validating a new hardware design, determining stress points on a metal structure, or recording temperature changes during a scientific experiment, you need to take measurements and visualize your data. You can choose from many commercially available instruments to take the measurement you need, but those are often vendor-defined and difficult to customize. With data acquisition hardware, you can transform your standard laptop or desktop computer into a user-defined measurement system by using intuitive graphical programming software to build in the exact analysis and visualization capabilities your application requires. With PC-based data acquisition, the software defines the instrument. | ![]() |
Data Acquisition Hardware
Data acquisition hardware adds inputs and outputs (I/O) to standard laptop and desktop computers, turning a general-purpose PC into a flexible, high-performance measurement system. By taking advantage of the fast pace of standard PC technology improvements, you can achieve progressively faster processing, more memory, larger hard drives, and graphics displays for system visualization at increasingly lower costs. Standard PC buses like USB and PCI Express provide a path for sensor and voltage measurements to be streamed directly into your computer for processing, analysis and visualization.
With hundreds of hardware options to choose from, you need to consider the following factors to select the right data acquisition device for your application.
| Considerations | Example |
| PC bus or form factor | USB, PCI, PCI Express, wireless |
| Sensor connectivity and signal conditioning | Filtering, amplification, excitation, isolation |
| Channel count | Channels per device or multidevice synchronization |
| I/O specifications | Sampling rate, resolution, accuracy |
| Application development environment | LabVIEW, C, C++, Visual Basic .NET |
Table 1. Data Acquisition Hardware Considerations
NI-DAQmx and LabVIEW Graphical Programming
Included with more than 200 National Instruments data acquisition (DAQ) devices, NI-DAQmx driver software is used to communicate with measurement hardware. It works with several programming languages including NI LabVIEW and LabWindows™/CVI, ANSI C/C++, Visual Basic 6.0, and C#/Visual Basic .NET.
LabVIEW graphical programming software provides an easy-to-use application development environment designed specifically for the needs of engineers and scientists. Without any prior programming experience, you can configure your hardware, take measurements, analyze data, and display the results. A LabVIEW application is called a virtual instrument (VI) because you can customize software front panels with knobs, buttons, dials, and graphs to emulate the control panels of traditional instruments.

Figure 1. LabVIEW applications consist of a Front Panel (left) and Block Diagram (right)
Creating a Virtual Instrument in LabVIEW with NI-DAQmx
To illustrate the programming experience, consider an example where you need to take a series of temperature measurements and view the resulting data on a graph.
Begin by installing LabVIEW graphical programming software, NI-DAQmx hardware driver software, and then your data acquisition device. Once you have installed the software and hardware, creating a software-defined virtual instrument involves two main tasks:
1. Defining the functionality you need on the block diagram
2. Creating a user interface on the front panel
Follow these steps to take your first measurement.
Start LabVIEW and open a blank VI, which is a brand new LabVIEW program.

Figure 2. Start programming with a blank LabVIEW virtual instrument (VI)
On the white window (the block diagram), you can drop down the DAQ Assistant, which is a configuration wizard for NI-DAQmx devices.

Figure 3. The DAQ Assistant is a configuration wizard for NI-DAQmx Devices
Once you place the DAQ Assistant on the block diagram, a configuration window pops up to provide step-by-step instructions for the most common measurement types.

Figure 4. The DAQ Assistant with Thermocouple Selected
After you have selected your measurement type (in this case, thermocouple) and your NI-DAQmx device, the final configuration window provides all the parameters for the thermocouple measurement task.

Figure 5. Assign all temperature measurement task configuration parameters with the DAQ Assistant.
You can then wire measurement data from the DAQ Assistant to a graph output on the front panel by right-clicking on the data output terminal and creating a Graph Indicator, as shown in Figure 5.

Figure 6. Create graph displays to view your data using the right-click menu
When you have created the graph, the basic functionality of your virtual instrument is complete, and you can use the run arrow to display the measurement results.

Figure 7. Basic Virtual Instrument Displaying Simulated Data
Now you can either add functionality such as data logging or signal processing on the block diagram or customize the front panel to let users of this application interact with additional buttons and displays.
Adding Analysis and Data-Logging Functions
You can add functions to incorporate signal processing and analysis in your new virtual instrument. Using the signal analysis palette, you can add the Spectral Measurements function to your block diagram, as shown in Figure 7.

Figure 8. Add frequency domain analysis using the Spectral Measurements function
Similar to the DAQ Assistant, the Spectral Measurements function also opens a configuration window when you first place it on the block diagram. The resulting configuration window is shown in Figure 8.

Figure 9. Configuration Window for Spectral Measurements Function
Once you have configured your parameters, you can wire the data output from the DAQ Assistant to the Spectral Measurements function and create a second graph that shows the power spectrum of your measured signal.

Figure 10. Wire the data output terminal from the DAQ Assistant to the Spectral Measurements function

Figure 11. Newly Built VI with Power Spectrum of Simulated Signal
Visualizing processed data in real time can be helpful, but you often need to save the results to disk for future analysis or report generation. LabVIEW offers several options for saving data, including the Write To Measurement File function shown in Figure 12.

Figure 12. Save your measurement data to disk with the Write To Measurement File function
You can also add logic around these functions to start logging data only when a button is pressed on the front panel. Finally, once you have defined the block diagram functionality, you can continue customizing the front panel and create a user interface with a look and feel specific to your application. Figure 13 shows the example of a front panel that has been customized with additional buttons, slide controls and graph colors.

Figure 13. Customized Front Panel with Buttons, Dials, Slide Controls and Graphs
Continuing the Customization to Meet Your Exact Needs
Using data acquisition hardware, you can turn your laptop or desktop computer into a virtual instrument that meets your exact measurement application needs. With LabVIEW graphical programming, any engineer and scientist can analyze and visualize measurement data without computer programming experience.
Take the Next Step
Watch a demonstration of building a LabVIEW application from scratch
Download and Try LabVIEW Today for Free
Click here for your local contact information or have an NI technical representative call you now.
The mark LabWindows is used under a license from Microsoft Corporation. Windows is a registered trademark of Microsoft Corporation in the United States and other countries.
Reader Comments | Submit a comment »
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/).

