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

Document Type: Tutorial
NI Supported: Yes
Publish Date: Oct 2, 2009


Feedback


Yes No

Related Categories

Related Links - Developer Zone

Related Links - Products and Services

Using NI CompactDAQ with NI LabVIEW 2009

1 ratings | 4.00 out of 5
Read in | Print

Programming NI CompactDAQ with LabVIEW was designed to be easy, but features in the new NI cDAQ-9174 and cDAQ-9178 chassis correlate with LabVIEW 2009 features to help you get the most performance out of your system with the least programming effort. These features revolve around two main themes: performing operations in parallel and handling large amounts of data.


[+] Enlarge Image

Figure 1. NI CompactDAQ and LabVIEW 2009 features combine to increase acquisition performance.

Multiple Timing Engines for Parallel Mixed Signal Acquisition

Few systems provide the flexibility of measuring low-speed DC data and high-speed dynamic signals in the same instrument. With NI CompactDAQ, you can install a thermocouple module next to an accelerometer measurement module and acquire from both modules simultaneously. The new cDAQ-9174 and cDAQ-9178 chassis have multiple analog input timing engines, which means you can group all of your analog input modules in up to three sets of modules. These sets, known as tasks, can all run at different rates because each one will have its own timing engine in the chassis backplane. This alleviates the need to decimate or parse lower-speed data from the higher-speed data as you need to do in the original cDAQ-9172 chassis. In LabVIEW, thermocouple data can now be handled separately from high-speed power measurements or microphone measurements. Further, with the multicore optimization in LabVIEW 2009, each one of the timing engines, represented by a separate DAQ Assistant in LabVIEW, can be run in a separate loop on the block diagram and in a separate core in the processor. With the new features in NI CompactDAQ and multicore optimization in LabVIEW 2009, you can make the most out of the performance, and expense, of your Windows PC. Figure 2 shows an illustration of a chassis and associated LabVIEW VI for a system acquiring from multiple modules at different rates.


[+] Enlarge Image
[+] Enlarge Image

Figure 2. This image shows multiple AI tasks with different sampling rates.

See a mixed sensor measurement system at work in the NI CompactDAQ appliance test video demonstration.

Multicore Optimization to Speed Up Data Processing

Programmers often look to parallel processing when it comes to analyzing large sets of data using multicore processors to greatly reduce calculation times. With LabVIEW 2009, you can take advantage of this processing topology without having to be an expert in the field of computer science or networked processing engines. For example, the “parallel workers terminal” in a for loop, as seen in Figure 3, will recognize nonsequential processing iterations and divide them among all of the requested processors. Where before the process steps would be distributed at will by the OS CPU manager and often end up in line behind each other, LabVIEW now sends multiple streams of data to be processed simultaneously, decreasing the amount of time consumed by execution of the for loop.


[+] Enlarge Image

Figure 3. This image shows a parallel for loop in LabVIEW 2009.

Direct Stream to Disk with TDMS and LabVIEW 2009

Analog-to-digital converters (ADCs) are becoming faster and more prevalent on data acquisition test systems with many systems having a single ADC per channel. Many NI CompactDAQ C Series modules, such as the NI 9215 and NI 923x series of modules have multiple ADCs on board. This translates ultimately into the potential for more data – much more data. The multicore optimization technologies in LabVIEW 2009 help to process the data more quickly and efficiently. To help store this data in LabVIEW, ranging from megabytes to terabytes, there is a new feature to directly stream data from the NI-DAQmx API to a technical data management (.TDMS) file at high speeds. Figure 4 below shows a screenshot of LabVIEW 2009 using the new Configure Logging VI, located on the NI-DAQmx palette, to stream data directly to disk.  Note that this code is logging directly to the hard disk without using functions found on the File I/O palette.  This functionality, new to NI-DAQmx 9.0, is built-into the hardware driver calls to simplify the programming experience.


[+] Enlarge Image

Figure 4. This screenshot shows direct disk streaming to TDMS in LabVIEW 2009 with the NI-DAQmx driver.

The Configure Logging VI can achieve high-speed streaming rates by directly streaming the raw unscaled data from NI CompactDAQ and bypassing the Windows buffer. To learn more about TDMS files in LabVIEW, read the application note: Writing TDM and TDMS Files in LabVIEW. See the LabVIEW home page for more information on LabVIEW 2009.

Buy NI CompactDAQ Now

NI CompactDAQ System Advisor

NI cDAQ Chassis Model Page

 

1 ratings | 4.00 out of 5
Read in | Print

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/).