cDAQ Hands On

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 124

AN INTRODUCTION TO

DATA ACQUISITION
with NI CompactDAQ and NI LabVIEW
Version 1.0 – 7 November 2012
Worldwide Technical Support and Product Information
ni.com
National Instruments Corporate Headquarters
11500 N Mopac Expwy Austin, Texas 78759-3504 USA Tel: 512 683 0100
Worldwide Offices
Andean and Caribbean +58 212 503-5310, Argentina 0800 666 0037, Australia 1800 300 800, Austria 43 662 45 79 90 0, Belgium 32 0 2 757
00 20, Brazil 55 11 3262 3599, Canada 800 433 3488, Chile 800 532 951, China 86 21 5050 9800, Czech Republic/Slovakia 420 224 235 774,
Denmark 45 45 76 26 00, Finland 358 0 9 725 725 11, France 33 0 1 48 14 24 24, Germany 49 89 741 31 30, Hungary 36 23 501 580, India 1
800 425 7070, Ireland 353 0 1867 4374, Israel 972 3 6393737, Italy 39 02 413091, Japan 81 3 5472 2970, Korea 82 02 3451 3400, Lebanon
961 0 1 33 28 28, Malaysia 1800 887710, Mexico 01 800 010 0793, Netherlands 31 0 348 433 466, New Zealand 0800 553 322, Norway 47 0
66 90 76 60, Poland 48 22 3390150, Portugal 351 210 311 210, Russia 7 495 783 68 51, Singapore 1800 226 5886, Slovenia/Croatia,
Bosnia/Herzegovina, Serbia/Montenegro, Macedonia 386 3 425 42 00, South Africa 27 0 11 805 8197, Spain 34 91 640 0085, Sweden 46 0 8
587 895 00, Switzerland 41 56 200 51 51, Taiwan 886 2 2377 2222, Thailand 662 278 6777, Turkey 90 212 279 3031, U.K. 44 0 1635 523545,
Uruguay 0004 055 114
To comment on National Instruments documentation, refer to the National Instruments Web site at ni.com/info and enter the
info code feedback.
© 2012 National Instruments Corporation. All rights reserved.
Important Information
Warranty
The media on which you receive National Instruments software are warranted not to fail to execute programming instructions, due to defects in materials and
workmanship, for a period of 90 days from date of shipment, as evidenced by receipts or other documentation. National Instruments will, at its option, repair or replace
software media that do not execute programming instructions if National Instruments receives notice of such defects during the warranty period. National Instruments does
not warrant that the operation of the software shall be uninterrupted or error free. A Return Material Authorization (RMA) number must be obtained from the factory and
clearly marked on the outside of the package before any equipment will be accepted for warranty work. National Instruments will pay the shipping costs of returning to the
owner parts which are covered by warranty. National Instruments believes that the information in this document is accurate. The document has been carefully reviewed for
technical accuracy. In the event that technical or typographical errors exist, National Instruments reserves the right to make changes to subsequent editions of this document
without prior notice to holders of this edition. The reader should consult National Instruments if errors are suspected. In no event shall National Instruments be liable for any
damages arising out of or related to this document or the information contained in it. EXCEPT AS SPECIFIED HEREIN, NATIONAL INSTRUMENTS MAKES NO WARRANTIES,
EXPRESS OR IMPLIED, AND SPECIFICALLY DISCLAIMS ANY WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. CUSTOMER’S RIGHT TO
RECOVER DAMAGES CAUSED
BY FAULT OR NEGLIGENCE ON THE PART OF NATIONAL INSTRUMENTS SHALL BE LIMITED TO THE AMOUNT THERETOFORE PAID BY THE
CUSTOMER. NATIONAL INSTRUMENTS WILL NOT BE LIABLE FOR DAMAGES RESULTING FROM LOSS OF DATA, PROFITS, USE OF PRODUCTS,
OR INCIDENTAL OR CONSEQUENTIAL DAMAGES, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. This limitation of the liability of National
Instruments will apply regardless of the form of action, whether in contract or tort, including negligence. Any action against National Instruments must be brought
within one year after the cause of action accrues. National Instruments shall not be liable for any delay in performance due to causes beyond its reasonable control. The
warranty provided herein does not cover damages, defects, malfunctions, or service failures caused by owner’s failure to follow the National Instruments installation,
operation, or maintenance instructions; owner’s modification of the product; owner’s abuse, misuse, or negligent acts; and power failure or surges, fire, flood, accident,
actions of third parties, or other events outside reasonable control.
Copyright
Under the copyright laws, this publication may not be reproduced or transmitted in any form, electronic or mechanical, including photocopying, recording, storing in an
information retrieval system, or translating, in whole or in part, without the prior written consent of National Instruments Corporation. National Instruments respects the
intellectual property of others, and we ask our users to do the same. NI software is protected by copyright and other intellectual property laws. Where NI software may be
used to reproduce software or other materials belonging to others, you may use NI software only to reproduce materials that you may reproduce in accordance with the terms
of any applicable license or other legal restriction. BSIM3 and BSIM4 are developed by the Device Research Group of the Department of Electrical Engineering and Computer
Science, University of California, Berkeley, and copyrighted by the University of California.
Trademarks
CompactDAQ, CompactRIO, LabVIEW, National Instruments, and NI, ni.com are trademarks of National Instruments Corporation. Refer to the Terms of Use section on
ni.com/legal for more information about National Instruments trademarks. Other product and company names mentioned herein are trademarks or trade names of their
respective companies.
Patents
For patents covering National Instruments products, refer to ni.com/patents.
Some portions of this product are protected under United States Patent No. 6,560,572.
WARNING REGARDING USE OF NATIONAL INSTRUMENTS PRODUCTS
(1) NATIONAL INSTRUMENTS PRODUCTS ARE NOT DESIGNED WITH COMPONENTS AND TESTING FOR A LEVEL OF RELIABILITY SUITABLE
FOR USE IN OR IN CONNECTION WITH SURGICAL IMPLANTS OR AS CRITICAL COMPONENTS IN ANY LIFE SUPPORT SYSTEMS WHOSE
FAILURE TO PERFORM CAN REASONABLY BE EXPECTED TO CAUSE SIGNIFICANT INJURY TO A HUMAN.
(2) IN ANY APPLICATION, INCLUDING THE ABOVE, RELIABILITY OF OPERATION OF THE SOFTWARE PRODUCTS CAN BE IMPAIRED BY
ADVERSE FACTORS, INCLUDING BUT NOT LIMITED TO FLUCTUATIONS IN ELECTRICAL POWER SUPPLY, COMPUTER HARDWARE
MALFUNCTIONS, COMPUTER OPERATING SYSTEM SOFTWARE FITNESS, FITNESS OF COMPILERS AND DEVELOPMENT SOFTWARE USED TO
DEVELOP AN APPLICATION, INSTALLATION ERRORS, SOFTWARE AND HARDWARE COMPATIBILITY PROBLEMS, MALFUNCTIONS OR
FAILURES OF ELECTRONIC MONITORING OR CONTROL DEVICES, TRANSIENT FAILURES OF ELECTRONIC SYSTEMS (HARDWARE AND/OR
SOFTWARE), UNANTICIPATED USES OR MISUSES, OR ERRORS ON THE PART OF THE USER OR APPLICATIONS DESIGNER (ADVERSE FACTORS
SUCH AS THESE ARE HEREAFTER COLLECTIVELY TERMED “SYSTEM FAILURES”). ANY APPLICATION WHERE A SYSTEM FAILURE WOULD
CREATE A RISK OF HARM TO PROPERTY OR PERSONS (INCLUDING THE RISK OF BODILY INJURY AND DEATH) SHOULD NOT BE RELIANT
SOLELY UPON ONE FORM OF ELECTRONIC SYSTEM DUE TO THE RISK OF SYSTEM FAILURE. TO AVOID DAMAGE, INJURY, OR DEATH, THE
USER OR APPLICATION DESIGNER MUST TAKE REASONABLY PRUDENT STEPS TO PROTECT AGAINST SYSTEM FAILURES, INCLUDING BUT
NOT LIMITED TO BACK-UP OR SHUT DOWN MECHANISMS. BECAUSE EACH END-USER SYSTEM IS CUSTOMIZED AND DIFFERS FROM
NATIONAL INSTRUMENTS' TESTING PLATFORMS AND BECAUSE A USER OR APPLICATION DESIGNER MAY USE NATIONAL INSTRUMENTS
PRODUCTS IN COMBINATION WITH OTHER PRODUCTS IN A MANNER NOT EVALUATED OR CONTEMPLATED BY NATIONAL INSTRUMENTS,
THE USER OR APPLICATION DESIGNER IS ULTIMATELY RESPONSIBLE FOR VERIFYING AND VALIDATING THE SUITABILITY OF NATIONAL
INSTRUMENTS PRODUCTS WHENEVER NATIONAL INSTRUMENTS PRODUCTS ARE INCORPORATED IN A SYSTEM OR APPLICATION,
INCLUDING, WITHOUT LIMITATION, THE APPROPRIATE DESIGN, PROCESS AND SAFETY LEVEL OF SUCH SYSTEM OR APPLICATION.
Overview
Purpose of the Hands-on Seminar
This hands-on seminar is aimed at educating researchers and graduate students in the fields of science
and engineering on the fundamental concepts of data acquisition. You will physically setup and plug in
the DAQ system and sensors, write a program in LabVIEW, and then visualize the results.

It will be a true example of what you need to do as a scientist or engineer that needs to acquire,
analyze, and present data. It might not be the exact setup as your application, but you will be able to
extract this knowledge and apply to your application at a later time.

You will be able to leave the seminar with an exposure to data acquisition and programming in
LabVIEW. You will also be able to either keep the physical manual, or gain access to an electronic
version of this manual that you should reference when setting up your system at a later time.

What You Will Do


Through three (3) main exercises that also contain sub-exercises, you will use NI LabVIEW and NI DAQ
to create an Audio Equalizer. There are also supplementary exercises that teach you how to customize
your NI LabVIEW user interface, how to configure Measurement & Automation Explorer (MAX), and a
glossary for the common terms used in NI DAQ Specifications documents.

In the beginning, the NI Presenter will also give a quick presentation on what DAQ is and how National
Instruments approaches the task.

Why You Should Take This Course


- you need to acquire data for an experiment
- you need to learn how to program in LabVIEW for DAQ applications
- you are curious about the NI approach to data acquisition
- you need exposure to setting up a DAQ system

Time Required to Complete Course


The seminar should take around three (3) hours, but this can vary depending on your prior knowledge
and rate of learning.

Background Knowledge Required


It is recommended that you have some exposure to LabVIEW, but it is not at all required. The
instructions for the exercises will cover all necessary steps to complete the task. It should be noted
that you will be expected to learn basic tasks as you progress, and the instructions will become less
detailed and require that you retain some of the knowledge. Visit ni.com/lv101 to learn more.

You will be expected to be familiar with using a computer, a mouse, a keyboard, and a screwdriver.
Contents
Required Equipment ......................................................................................................................... 1
Hardware ..................................................................................................................................... 1
Software ...................................................................................................................................... 1
Configuring Hardware .................................................................................................................. 1
Data Acquisition Fundamentals ......................................................................................................... 3
What is Data Acquisition? ............................................................................................................ 3
What is a Sensor? ........................................................................................................................ 3
What is a DAQ Device? ............................................................................................................... 4
What is a Computer’s Role in DAQ? ............................................................................................ 4
Finding Hardware & Installing Software ............................................................................................. 6
Identifying the Right Hardware .................................................................................................... 6
Finding the Specifications Online ................................................................................................. 6
Purchasing Hardware ................................................................................................................... 8
Installing Software ....................................................................................................................... 8
Development Environment: NI LabVIEW .............................................................................. 8
Hardware Driver: NI-DAQmx ................................................................................................ 9
Academic Site License ......................................................................................................... 9
Data Acquisition in LabVIEW ........................................................................................................... 10
NI-DAQmx Example Programs ................................................................................................... 10
NI-DAQmx Help Files ................................................................................................................. 10
NI-DAQmx Functions Palette ..................................................................................................... 12
The Eight Most Popular NI-DAQmx Functions ........................................................................... 13
Configure Functions............................................................................................................ 13
Read/Write Functions ......................................................................................................... 17
Close Functions .................................................................................................................. 18
Logging Data in DAQmx.................................................................................................................. 20
Data Acquisition Methods ............................................................................................................... 21
Single-point, Finite, Software-timed ........................................................................................... 21
Single-point, Continuous, Software-timed .................................................................................. 22
Multiple Point, Finite, Hardware-timed ....................................................................................... 23
Multiple Point, Continuous, Hardware-timed.............................................................................. 24
Measurement and Automation Explorer........................................................................................... 25
Locally Installed Software .......................................................................................................... 25
Locally Installed Hardware ......................................................................................................... 26
Test Panels ................................................................................................................................ 29
LabVIEW Tips and Tricks ................................................................................................................. 31
Hands-on Exercise .......................................................................................................................... 37
Before You Begin: The LabVIEW Environment .......................................................................... 38
Optional Exercise: Single Point and Finite Acquisition ................................................................ 39
Exercise 1: Acquire Audio Signal ................................................................................................ 47
Exercise 2: Filtering and FFT ...................................................................................................... 64
Exercise 3: Output Processed Signal ......................................................................................... 78
Additional Training .......................................................................................................................... 85
Getting Started with LabVIEW ................................................................................................... 85
Professional Training Options .................................................................................................... 86
NI Certification Path ................................................................................................................... 87
Appendix A: Exercise Solution Screenshots ..................................................................................... 87
Optional Exercise a .................................................................................................................... 87
Optional Exercise b .................................................................................................................... 88
Exercise 1a ................................................................................................................................ 88
Exercise 2a ................................................................................................................................ 89
Exercise 2b ................................................................................................................................ 89
Exercise 2c ................................................................................................................................ 90
Exercise 2d ................................................................................................................................ 90
Exercise 3a ................................................................................................................................ 90
Exercise 3b ................................................................................................................................ 91
Exercise 3c ................................................................................................................................ 92
Exercise 3d ................................................................................................................................ 92
Glossary A: Data Acquisition Specifications ...................................................................................... 93
Analog Input............................................................................................................................... 93
Analog Output.......................................................................................................................... 101
Timing I/O ................................................................................................................................ 109
Triggers.................................................................................................................................... 111
Excitation ................................................................................................................................. 112
Digital Signal Processor ........................................................................................................... 113
Real Time System Integration (RTSI) ....................................................................................... 114
Required Equipment
Hardware
 NI cDAQ-9174 — NI CompactDAQ 4-Slot USB Chassis
 NI 9215 — 4-Channel, 100 kS/s/ch, 16-bit, ±10 V Analog Input Module
 NI 9263 — 4-Channel, ±10 V, 16-Bit Analog Voltage Output Module
 12 V DC Power Supply for cDAQ (included with chassis purchase)
 Power Cable for Appropriate Region
 USB A Male to B Male cable (included with chassis purchase)
 Host PC with Windows OS
 3.5mm Stereo Plug to Bare Wire (Qty. 2)
 3.5 mm Stereo Jack F/F Adapter
 MP3 Player with 3.5mm Stereo Output (provided by customer, or use PC sound card)
 Stereo Headphones
 NI Screwdriver

Software
 NI LabVIEW 2012 or later
 NI DAQmx 9.5.5 or later
 [Recommended] Microsoft Excel 2003 or later
 [Recommended] TDM Excel Add-In for Microsoft Excel Download

Configuring Hardware
Connect the hardware as seen in the figure below:

1. Insert NI 9215 Analog Input module into Slot 1 of NI cDAQ 9174 chassis
2. Insert NI 9263 Analog Output module into Slot 2 of NI cDAQ 9174 chassis
3. Connect USB A Male connector to an available USB slot of a PC and connect USB B male
connector to the USB terminal of NI cDAQ 9174 chassis
4. Connect Stereo Left and Stereo Right bare wires of 3.5mm Stereo plug to Bare Wire adapter to
AI0+ and AI1+ terminals of NI 9215 Analog Input module, respectively
5. Connect COM of 3.5mm Stereo plug to Bare Wire adapter to both AI0- and AI1- terminals of NI
9215 Analog Input module
6. On the same 3.5mm Stereo plug to Bare Wire adapter, connect the 3.5mm Stereo Plug to the
3.5mm Audio Output terminal of your MP3 Player as you would headphones
7. Repeat steps 4 & 5 for second 3.5mm Stereo plug to Bare Wire adapter to NI 9263 Analog
Output module
8. On the same 3.5mm Stereo plug to Bare Wire adapter, connect the 3.5mm Stereo Jack into
one end of the 3.5mm Stereo Jack F/F Adapter, and connect headphones into the other end
9. Connect the cDAQ Power Supply to the chassis, connect Power Cable to the power adapter,
and then connect the Power Cable to the wall outlet.

ni.com/daq Page | 1
Figure 1. Hardware Connection Diagram

ni.com/daq Page | 2
Data Acquisition Fundamentals
This section will educate you in the fundamental concepts of data acquisition, helping to get you up to
speed on the topics that you will encounter in specifications documents and also prepare you to get
the results you need from your experiments.

What is Data Acquisition?


Data acquisition (DAQ) is the process of measuring an electrical or physical phenomenon such as
voltage, current, temperature, pressure, or sound with a computer. A DAQ system consists of sensors,
DAQ measurement hardware, and a computer with programmable software. Compared to traditional
measurement systems, PC-based DAQ systems exploit the processing power, productivity, display,
and connectivity capabilities of industry-standard computers providing a more powerful, flexible, and
cost-effective measurement solution.

What is a Sensor?
The measurement of a physical phenomenon, such as the temperature of a room,
the intensity of a light source, or the force applied to an object, begins with a sensor.
A sensor, also called a transducer, converts a physical phenomenon into a
measurable electrical signal. Depending on the type of sensor, its electrical output
can be a voltage, current, resistance, or another electrical attribute that varies over
time. Some sensors may require additional components and circuitry to properly produce a signal that
can accurately and safely be read by a DAQ device.

Common Sensors Phenomenon


Thermocouple, RTD, Thermistor Temperature
Photo Sensor Light Intensity/Color

Microphone Sound

Strain Gauge, Piezoelectric Transducer Force and Pressure

Potentiometer, LVDT, Encoder Position and Displacement

Accelerometer Acceleration

pH Electrode pH
Table 1. Common sensors found in Industry and Research

ni.com/daq Page | 3
What is a DAQ Device?
DAQ hardware acts as the interface between a computer and signals from the
outside world. It primarily functions as a device that digitizes incoming analog signals
so that a computer can interpret them.

The three key components of a DAQ device used for measuring a signal are the
signal conditioning circuitry, analog-to-digital converter (ADC), and computer bus. Many DAQ devices
include other functions for automating measurement systems and processes. For example, digital-to-
analog converters (DACs) output analog signals, digital I/O lines input and output digital signals, and
counters/timers count and generate digital pulses.

Signal Conditioning
Signals from sensors or the outside world can be noisy or too dangerous to measure directly. Signal
conditioning circuitry manipulates a signal into a form that is suitable for input into an ADC. This
circuitry can include amplification, attenuation, filtering, and isolation. Some DAQ devices include built-
in signal conditioning designed for measuring specific types of sensors.

Analog-to-Digital Converter (ADC)


Analog signals from sensors must be converted into digital before they are manipulated by digital
equipment such as a computer. An ADC is a chip that provides a digital representation of an analog
signal at an instant in time. In practice, analog signals continuously vary over time and an ADC takes
periodic “samples” of the signal at a predefined rate. These samples are transferred to a computer
over a computer bus where the original signal is reconstructed from the samples in software.

Computer Bus
DAQ devices connect to a computer through a slot or port. The computer bus serves as the
communication interface between the DAQ device and computer for passing instructions and
measured data. DAQ devices are offered on the most common computer buses including USB, PCI,
PCI Express, and Ethernet. More recently, DAQ devices have become available for 802.11 Wi-Fi for
wireless communication. There are many types of buses, and each offers different advantages for
different types of applications.

What is a Computer’s Role in DAQ?


A computer with programmable software controls the operation of the DAQ device
and is used for processing, visualizing, and storing measurement data. Different
types of computers are used in different types of applications.

A desktop may be used in a lab for its processing power, a laptop may be used in
the field for its portability, or an industrial computer may be used in a manufacturing plant for its
ruggedness.

ni.com/daq Page | 4
Driver Software
Driver software provides application software the ability to interact with a DAQ device. It simplifies
communication with the DAQ device by abstracting low-level hardware commands and register-level
programming. Typically, DAQ driver software exposes an application programming interface (API) that
is used within a programming environment to build application software.

For almost all NI DAQ devices, NI-DAQmx is the hardware driver. As mentioned below, NI offers
development environments that can make driver calls into DAQmx, but other text based environments
can also access the hardware driver.

Application Software
Application software facilitates the interaction between the computer and user for acquiring, analyzing,
and presenting measurement data. It is either a prebuilt application with predefined functionality, or a
programming environment for building applications with custom functionality. Custom applications are
often used to automate multiple functions of a DAQ device, perform signal-processing algorithms, and
display custom user interfaces.

NI offers two main development environments: LabVIEW is a graphical system design software, and
LabWindows/CVI is a C based programming environment. Measurement studio is an add-on for Visual
Studio that allow users to easily develop GUIs for their DAQ programs.

For more information, navigate to ni.com and search for ‘Complete Guide to Building a Measurement
System.” If you are viewing this digitally, click here to access this white paper directly.

ni.com/daq Page | 5
Finding Hardware & Installing Software
It is first important to understand the complexities and requirements of your application to ensure that
your data acquisition system is the right fit. Here are the steps that you should complete

Identifying the Right Hardware


To help you identify the right DAQ hardware for your system, first navigate to ni.com/daq. At this
portal you will find everything that you need to know about data acquisition. You can use the left-hand
navigation facets to begin your search and narrow in on the right selection as outlined in red below.
Use the prior DAQ fundamentals section to help guide you through the portal.

Figure 2. CompactDAQ Product Selection guide at ni.com/cdaq

Finding the Specifications Online


The most important document for a DAQ device is the specifications document. This document is
housed on the product page for each device. Once you know the device of interest, it is easiest to find
the device using the Search in the upper right hand corner of the ni.com website. Simply enter the
product model number (i.e. 9215) and click search. An example search query is show below, with the
product page result outlined in blue.

Note. See Glossary A for help understanding any terms in the Specifications Documents

ni.com/daq Page | 6
Figure 3. Search result for “9215” at ni.com

Once on the product page, click on the Specifications tab to surface high level specifications about the
device; you can also access the complete Operating Instructions and Specifications document for the
device by clicking on the bullet title Specifications that is outlined in red below.

Figure 4. Product Page for NI 9215 Analog Input Module

ni.com/daq Page | 7
Purchasing Hardware
To receive a quote for NI Data Acquisition Hardware, you can add the hardware to your ‘Cart’ at ni.com
form the product page for the product. You can also call your NI Sales Engineer to help design the
best system for your application.

To speak with a technical representative, navigate to ni.com, and click on the ‘Contact’ link in the upper
right-hand corner of the homepage. You will see a page similar to the image below.

Installing Software
To acquire data from a NI DAQ device, you will need to first install a development environment and
then the hardware driver.

Development Environment: NI LabVIEW


The development environment facilitates the interaction between the computer and user for acquiring,
analyzing, and presenting measurement data. It is either a prebuilt application with predefined
functionality, or a programming environment for building applications with custom functionality.
Custom applications are often used to automate multiple functions of a DAQ device, perform signal-
processing algorithms, and display custom user interfaces.

The primary development environment for NI DAQ device is NI LabVIEW. LabVIEW is a graphical
programming language that abstracts the low-level complexities of text-based programming into a
visual language that scientists and engineers use worldwide to acquire, analyze, and present data in
the same environment.

Visit ni.com/trylabview for more information and to download a 30-day evaluation.

ni.com/daq Page | 8
Hardware Driver: NI-DAQmx
Driver software provides application software the ability to interact with a DAQ device. It simplifies
communication with the DAQ device by abstracting low-level hardware commands and register-level
programming. Typically, DAQ driver software exposes an application programming interface (API) that
is used within a programming environment to build application software.

The Hardware Driver for almost all NI Data Acquisition hardware is NI DAQmx. The DAQmx driver
enables you to use the same programming paradigm for all different types of I/O, and comes with
example programs and help files to get you moving in the right direction.

Visit ni.com/drivers and search for ‘DAQmx’ to download the latest version of the driver.

Academic Site License


If you are on a university with access to an Academic Site License (ASL), then you might have free
access to almost all NI Software, including LabVIEW. Contact your university Software Administrator
to get more information.

ni.com/daq Page | 9
Data Acquisition in LabVIEW
When installed properly, the NI DAQmx Hardware Driver automatically installs example programs, help
files, and functions.

NI-DAQmx Example Programs


To locate example files for all input and output applications using the DAQmx driver in LabVIEW,
navigate to Help» Find Examples… Once the NI Example Finder window loads, navigate to Hardware
Input and Output» DAQmx» … and then navigate the appropriate application for your experiment.

Figure 5. NI Example Finder with DAQmx Examples Listed

NI-DAQmx Help Files


There are two forms of help offered within the LabVIEW development environment: Context Help and
Detailed Help.

Context Help
The Context Help window displays basic information about LabVIEW objects when you move the
cursor over each object. To toggle the display of the Context Help window, select Help» Show Context
Help or press the <Ctrl-H> keys.

When you move the cursor over front panel and block diagram objects, the Context Help window
displays the icon for subVIs, functions, constants, controls, and indicators, with wires attached to each
terminal. When you move the cursor over dialog box options, the Context Help window displays
descriptions of those options.

ni.com/daq Page | 10
Figure 6. LabVIEW Context Help

If a corresponding Detailed LabVIEW Help topic exists for an object that the Context Help window
describes, a blue Detailed help link appears in the Context Help window. Click the link or the button to
display the LabVIEW Help for more information about the object.

Detailed Help (LabVIEW Help)


The LabVIEW Help is the best source of detailed information about specific features and functions in
LabVIEW. Each topic is broken down into a Concepts section with detailed descriptions and a How-To
section with step-by-step instructions for using LabVIEW features.

You can access the LabVIEW Help by selecting Help» Search the LabVIEW Help, or clicking the blue
Detailed Help link in the Context Help window. You also can right-click an object and select Help from
the shortcut menu.

ni.com/daq Page | 11
Figure 7. Detailed LabVIEW Help

NI-DAQmx Functions Palette


To access the NI DAQmx functions in LabVIEW, navigate to the Block Diagram and right-click empty
white space to bring up the Functions Palette. Then navigate to Measurement I/O» NI-DAQmx. The
functions will appear similar to the palette below. Simply drag-and-drop a function onto the Block
Diagram to begin programming.

Figure 8. The DAQmx – Data Acquisition Palette in LabVIEW

ni.com/daq Page | 12
The Eight Most Popular NI-DAQmx Functions
The following section outlines the eight most popular DAQmx functions to help get you started with
acquiring data for your experiments. They have been grouped by their functionality in the process of
making DAQmx driver calls out to an NI DAQ device to acquire data. These three categories are:
Configure, Read/Write, and Close.

Figure 9. The Eight Most Popular DAQmx Functions

Configure Functions
NI-DAQmx Create Virtual Channel
The NI-DAQmx Create Virtual Channel function creates a virtual channel and adds it to a
task. It can also be used to create multiple virtual channels and add all of them to a task.
When a task is not specified, the function creates a task automatically. The NI-DAQmx
Create Virtual Channel function has numerous instances which correspond to the
specific type of measurement or generation the virtual channel(s) perform.

ni.com/daq Page | 13
Figure 10: Context Help for NI-DAQmx Create Virtual Channel Function

NI-DAQmx Virtual Channel Types


There are many preconfigured channel types to choose from for your experiment. The table below
represents the options available for a DAQmx Virtual Chanel Type.

I/O Type Channel Type


Analog Input Voltage
Voltage RMS
Temperature –Thermocouple, RTD, Thermistor (Voltage & Current
Excitation)
Current
Current RMS
Resistance
Strain –Strain Gauge, Rosette Strain Gauge
Force –Bridge (2-point Linear, Table, and Polynomial Scale), IEPE Sensor
Pressure –Bridge (2-point Linear, Table, and Polynomial Scale)
Torque –Bridge (2-point Linear, Table, and Polynomial Scale)
Frequency –Voltage
Position –LVDT, RVDT, Eddy Current Proximity Probe
Acceleration –Accelerometer
Velocity –IEPE Sensor
Sound Pressure –Microphone
More –Custom Voltage with Excitation, Temperature Built-in Sensor,
Bridge (V/V)
TEDS –almost all of above sensors

ni.com/daq Page | 14
Analog Output Voltage
Current
Function Generation

Digital Input Digital Input

Digital Output Digital Output

Counter Input Frequency


Period
Count Edges
Pulse Width
Semi Period
Pulse Measurement –Frequency, Time, Ticks
Position – Angular & Linear Encoder
Two Edge Separation
Timestamp –GPS

Counter Output Pulse Generation –Frequency, Time, Ticks

Table 2. NI-DAQmx Virtual Channel Types

NI-DAQmx Timing
The NI-DAQmx Timing function configures the timing for hardware-timed data
acquisition operations. This includes specifying whether the operation will be
continuous or finite, selecting the number of samples to acquire or generate for finite
operations, and creating a buffer when needed.

For operations that require sample timing (analog input, analog output, and counter), the Sample Clock
instance of the NI-DAQmx Timing function sets both the source of the sample clock, which could be
an internal or external source, and its rate. The sample clock controls the rate at which samples are
acquired or generated. Each clock pulse initiates the acquisition or generation of one sample for each
virtual channel included in the task.

ni.com/daq Page | 15
Figure 11. Context Help for NI-DAQmx Timing Function

NI-DAQmx Trigger
The NI-DAQmx Trigger function configures a trigger to perform a specific action. The
most commonly used actions are a start trigger and a reference trigger. A start trigger
initiates an acquisition or generation. A reference trigger establishes the location, in a
set of acquired samples, where pre-trigger data ends and post-trigger data begins. Both
of these triggers can be configured to occur on a digital edge, an analog edge, or when an analog
signal enters or leaves a window.

Figure 12. Context Help for NI-DAQmx Trigger Function

NI-DAQmx Start Task


The NI-DAQmx Start Task function explicitly transitions a task to the running state. In
the running state, the task performs the specified acquisition or generation. A task will
be implicitly transitioned to the running state, or automatically started, if the NI-DAQmx
Start Task function is not used, when the NI-DAQmx Read function executes. This
implicit transition also occurs if the NI-DAQmx Start Task function is not used and the NI-DAQmx Write
function executes with its auto start input specified accordingly.

ni.com/daq Page | 16
Although it is not always required, using the NI-DAQmx Start Task function to explicitly start a task
involving a hardware-timed acquisition or generation is preferred. Furthermore, if the NI-DAQmx Read
function or the NI-DAQmx Write function will be executed multiple times, such as in a loop, the NI-
DAQmx Start Task function should also be used. Otherwise, the task performance will be reduced
because it will be repeatedly started and stopped. Additional information describing when to use the
NI-DAQmx Start Task function is available in the NI-DAQmx Help under Key NI-DAQmx Concepts»
Tasks» Explicitly Starting a Task.

Figure 13. Context Help for NI-DAQmx Start Task Function

Read/Write Functions
NI-DAQmx Read
The NI-DAQmx Read function reads samples from the specified acquisition task. The
different instances of the function allow for the type of acquisition (analog, digital, or
counter), the number of virtual channels, the number of samples, and the data type to
be selected. After the specified number of samples has been transferred from the FIFO
on the DAQ board to the PC Buffer in RAM, the NI-DAQmx Read function moves samples from the PC
Buffer to the Application Development Environment (ADE) Memory where they can then be displayed
on a Front Panel indicator.

ni.com/daq Page | 17
Figure 14. Context Help for NI-DAQmx Read Function

NI-DAQmx Write
The NI-DAQmx Write function writes samples to the specified generation task. The
different instances of the function allow for the type of generation (analog or digital),
the number of virtual channels, the number of samples, and the data type to be
selected. The NI-DAQmx Write Function moves samples from the Application
Development Environment (ADE) Memory to the PC Buffer in RAM. These samples are then
transferred from the PC Buffer to the DAQ board FIFO in order to be generated.

Each instance of the NI-DAQmx Write function has an auto start input to determine if the function will
implicitly start the task if it has not already been explicitly started. As was previously discussed in the
NI-DAQmx Start Task section of this document, the NI-DAQmx Start Task function should be used to
explicitly start a generation task that uses hardware timing. It should also be used to maximize
performance if the NI-DAQmx Write function will be executed multiple times.

Figure 15. Context Help for NI-DAQmx Write Function

Close Functions
ni.com/daq Page | 18
NI-DAQmx Stop Task
The NI-DAQmx Stop Task function stops the task and returns it to the state the task
was in before the DAQmx Task was started.

If you do not use the DAQmx Start Task VI and the DAQmx Stop Task VI when you use
the DAQmx Read VI or the DAQmx Write VI multiple times, such as in a loop, the task will start and
stop repeatedly, which can reduce the performance of your application. If you do use the DAQmx Start
Task explicitly, you can avoid using DAQmx Stop Task and only use DAQmx Clear Task, which will
inherently stop the DAQmx task as well, and see no performance degradation. This is common
practice to use DAQmx Start Task and DAQmx Clear Task, and the DAQmx Stop Task is only used for
advanced applications.

Figure 16. Context Help for NI-DAQmx Stop Task Function

NI-DAQmx Clear Task


The NI-DAQmx Clear Task function clears the specified task. If the task is currently
running, the function first stops the task and then releases all of its resources. Once a
task has been cleared, it cannot be used unless it is recreated. Thus, if a task will be
used again, the NI-DAQmx Stop Task function should be used to stop the task, but not
clear it.

For continuous operations, the NI-DAQmx Clear Task function should be used to stop the actual
acquisition or generation.

ni.com/daq Page | 19
Figure 17. Context Help for NI-DAQmx Clear Task Function

Logging Data in DAQmx


Within the advanced task configuration sub-palette of the DAQmx functions palette is the option to
directly add data logging to the data acquisition.

Figure 18. Context Help for NI-DAQmx


Configure Logging (TDMS)

The data is logged in the Technical Data Management Streaming (TDMS) format as is written directly
to disk from the buffer. This function should be added directly before the DAQmx Start Task VI.

To read the data, you will need to use a program capable of reading this file format. National
Instruments offers a data management software tools, NI DIAdem, that natively reads the file format
and allows for easy post processing and data visualization tools. You can also download a Microsoft
Excel plug-in which allows you to open this format in Excel.

ni.com/daq Page | 20
Data Acquisition Methods
The following four methods are the most popular methods for acquiring data during an experiment.
Each method will have a few sample applications, along with example LabVIEW Block Diagram code to
help get you started.

Single-point, Finite, Software-timed


Application: Probing a circuit, troubleshooting, turn on/off light bulb

The following table lists out the DAQmx functions that you will use for this type of application. Note
that some functions are required, and other can be added for more advanced functionality.

NI-DAQmx Function Required Optional


Create Virtual Channel 
Timing
Trigger
Start Task 
Read/Write 
Stop Task 
Clear Task 

The most elementary type of analog data acquisition is single-point, finite, software-timed analog input.
This means that a single analog value is retrieved from the ADC and brought into the memory of the
operating system. A hardware timing engine is not used for this form of data acquisition; the
Operating System makes the driver call to retrieve the data point.

After a single point is acquired, the value is displayed and the program ends. This is not a very
common use case for data acquisition. It is, however, used for very basic tasks such as probing a
circuit to ensure voltage levels are correct and troubleshooting a DAQ device to ensure that it is
working properly. Because the program must be restarted each time a new value is needed,
programmers often move toward a continuous acquisition where a new value is retrieved on a set
frequency as discussed in the next section.

Figure 19. Example Block Diagram Code for Single-point,


Finite, Software-timed Analog Input

ni.com/daq Page | 21
Single-point, Continuous, Software-timed
Application: Logging Temperature, Monitoring Humidity

The following table lists out the DAQmx functions that you will use for this type of application. Note
that some functions are required, and other can be added for more advanced functionality.

NI-DAQmx Function Required Optional


Create Virtual Channel 
Timing
Trigger
Start Task 
Read/Write 
Stop Task 
Clear Task 

Single-point, continuous, software-timed acquisition is a perfect approach for applications that do not
require deterministic (cycle-accurate) sample periods. Most slow data logging applications will use this
method as it is not crucial to sample every 10 nanoseconds, and it can be sufficient to sample once a
second to poll the temperature of a room.

The main caveat is that the timing engine is based on the CPU millisecond timer, which is affected by
all other processes and applications running on the operating system. That means that if an anti-virus
program is launched, it might delay the acquisition period by a few milliseconds. This is referred to as
software timing skew. For single-point acquisitions that need deterministic sampling for control
applications, consider a real-time operating system from our NI-RIO platform.

Figure 20. Example Block Diagram Code for Single-point, Continuous,


Software-timed Analog Input with 100ms sample period

ni.com/daq Page | 22
Multiple Point, Finite, Hardware-timed
Application: Impact Testing, Acceleration Monitoring

The following table lists out the DAQmx functions that you will use for this type of application. Note
that some functions are required, and other can be added for more advanced functionality.

NI-DAQmx Function Required Optional


Create Virtual Channel 
Timing 
Trigger 
Start Task 
Read/Write 
Stop Task 
Clear Task 

Multiple-point, finite, hardware-timed acquisition is common in applications where a very quick set of
data is required, and nothing more (i.e., once the accelerometer exceeds 10 m/s2, acquire 1000
samples at a rate of 1000 samples/second). This allows only the required data to be acquired and
eliminates the need for logging a lot of unnecessary data. This method of acquisition is almost always
paired with a trigger, but it is not required.

The hardware-timing engine, which is very cycle-accurate, will automatically acquire and store samples
in the on-board memory of the device. Once the required number of samples is acquired, they will be
transferred into PC memory through a data transfer to be processed and displayed.

Figure 21. Example Block Diagram Code for Multiple-point, Finite,


Hardware-timed Analog Input with optional triggering

ni.com/daq Page | 23
Multiple Point, Continuous, Hardware-timed
Application: Vibration Monitoring, Motor Performance

The following table lists out the DAQmx functions that you will use for this type of application. Note
that some functions are required, and other can be added for more advanced functionality.

NI-DAQmx Function Required Optional


Create Virtual Channel 
Timing 
Trigger 
Start Task 
Read/Write 
Stop Task 
Clear Task 

Multiple-point, continuous, hardware-timed acquisition is also a very popular method for acquiring data.
This type of test is typically run for several minutes up to several days, and the limiting factor is
typically the amount of available memory for storing the data. Common applications involve situations
where it is important to have cycle-accurate samples to allow for mathematical transformations to find
rates of change in data. This technology also uses the hardware timing engine of the DAQ device.

Figure 22. Example Block Diagram Code for Multiple-point,


Continuous, Hardware-timed Analog Input

ni.com/daq Page | 24
Measurement and Automation Explorer
Similar to the Windows Device Manager, which manages all peripherals connected to a Windows PC,
MAX manages all NI hardware and software. This application is installed with most NI software
packages. Let’s take a look at the most used features of MAX: Software and Devices and Interfaces.

Note: You can access two systems in MAX: the locally installed hardware and software, which is listed
under My System, and Remote Systems, which contains all the remote targets you have detected on
your network such as NI CompactRIO hardware or a real-time PXI system.

Figure 23. MAX User Interface

Locally Installed Software


Knowledge of the software and drivers on your system is beneficial for setting up and troubleshooting
your measurement system. The Software section of MAX contains all of the installed NI software on
your local machine, as seen in Figure 24.

ni.com/daq Page | 25
Figure 24. Locally Installed NI Software in the MAX User Interface

When you select an installed software package such as LabVIEW, more detailed information is
displayed in the pane to the right of the software list. For a development system such as LabVIEW, all
installed toolkits and modules, the version, a description, and the path to the executable are displayed
in the right window pane, as shown in Figure 25.

Figure 25. Detailed Information Displayed for LabVIEW

Locally Installed Hardware


By being able to view and manage all of the hardware connected to your local machine, you can easily
manage and configure your hardware all in one place. All of the NI hardware, as well as the peripherals
that can be accessed by NI hardware and software, are listed in the Devices and Interfaces section of
MAX, as shown in Figure 26.

ni.com/daq Page | 26
Figure 26. Locally Installed NI Hardware

On the system shown in Figure 26, a simulated Compact DAQ chassis with 2 modules is installed.
Because the chassis was the first chassis installed, it was enumerated in the system as cDAQ1
(Compact DAQ Chassis 1). You can rename the device by right-clicking it to display the shortcut menu
and selecting Rename, as shown in Figure 27.

Figure 27. Shortcut Menu of NI myDAQ Device in MAX

In this example, the devices were renamed to match their product name and function as seen in Figure
28. This can make the device selection more intuitive when you are programming in LabVIEW.

ni.com/daq Page | 27
Figure 28. Devices Renamed to Their Product Names

The shortcut menu also features the option for Device Pinouts, as shown for the NI 9215 device in
Figure 29, which provides a visual reference for the I/O terminals on each device and helps you identify
the proper terminal for signal or device connection. Note that this is not available for every device.

Figure 29. Device Pinouts for NI 9215

Two other useful resources in the shortcut menu are Reset Device and Self-Test. Resetting the device
clears all of the references to the device as well as any routes and tasks associated with the device. A
dialog box appears with the result of the reset (see Figure 30).

ni.com/daq Page | 28
Figure 30. Dialog Box After Successfully
Resetting a NI-DAQmx Device

Self-test checks to see if the NI-DAQmx driver is able to successfully communicate with the device. A
dialog box appears with the result of the self-test; a successful self-test dialog box is shown in Figure
31.

Figure 31. Dialog Box After Successfully Self-Testing


an NI-DAQmx Device

If either the self-test or reset fails, the error number is displayed, which you can research at ni.com to
investigate the root cause.

Test Panels
It is beneficial to be able to quickly test if the voltages or signals you are receiving or outputting are
correct. The NI-DAQmx test panels, which you can access in the shortcut menu of your device,
provide this option. You are able to test the input/output of your DAQ device as seen in Figure 32. You
can also set the input/output range, sample mode, and configuration as well as the channel to test.

ni.com/daq Page | 29
Figure 32. Analog Input Test Panels for the NI 9215

ni.com/daq Page | 30
LabVIEW Tips and Tricks
Note: This exercise assumes that you have already installed all required software and as outlined in
earlier sections. If you have not, please refer back to the appropriate section.

Goal: Configure LabVIEW environment for easier programming

Instructions: 1. Launch LabVIEW by navigating to Start» All Programs» National Instruments»


LabVIEW 2012» LabVIEW.
2. Create a new LabVIEW Project by navigating to File» New Project and select
Blank Project and select Finish to create a project file to hold all files and
references for the application.

3. Within the LabVIEW project window, right-click My Computer and select New»
VI to create a new LabVIEW Virtual Instrument.
4. On either window, Front Panel (grey) or Block Diagram (white), navigate to Tools»
Options…
a. On the Front Panel Category section, choose ‘Silver style’ for the
Control Style for New VIs sub-section. This will place all new controls
and indicators on the Front in the new and updated Silver style.

ni.com/daq Page | 31
Here is the result:

b. On the Block Diagram Category section, de-select ‘Place front panel


terminals as icons’ in the General sub-section to clean up the
appearance of the Block Diagram and save space.

5. Right-click empty white space on the Block Diagram to bring up the Functions
Palette and then left-click the thumbtack in the upper-left corner of the

ni.com/daq Page | 32
palette to tack it down.

a. After tacked-down, a new menu appears for Customize. Left-click


this new button and select Change Visible Palettes…

b. Select the Available Palette Categories to the categories outlined in


Green (Programming, Measurement I/O, Mathematics, and Signal
Processing) and de-select the categories outlined in Red (Express,
Favorites, User Libraries, and Select a VI…).

ni.com/daq Page | 33
6. Repeat the process for the Controls Palette on the Front Panel, and select the
categories outlined in Green (Silver) and de-select the categories outlined in
Red (Express, User Controls, and Select a Control…).

ni.com/daq Page | 34
7. To create a control or indicator from a function or subVI, simply right-click the
input or output terminals and select Create» Control/Indicator

LabVIEW Shortcuts

ni.com/daq Page | 35
Keystroke Description
Ctrl+C Copy selected item(s)
Ctrl+V Paste selected item(s)
Ctrl+X Cut selected item(s)
Ctrl+Z Undo
Ctrl+Space Activate Quick Drop menu
Ctrl+H Toggle on/off Context Help
Ctrl+B Remove all broken wires from Block Diagram
Ctrl+E Navigate between Block Diagram and Front Panel
Ctrl+R Run the selected VI
Ctrl+S Save the selected VI
Ctrl+T Tile Block Diagram and Front Panel Windows Vertically
Ctrl+U Clean Up Block Diagram
Ctrl+Click & Drag Insert empty space on Block Diagram

ni.com/daq Page | 36
Hands-on Exercise
Creating an Audio Equalizer

ni.com/daq Page | 37
Before You Begin: The LabVIEW Environment
Before you begin, it is important that you are familiar with the LabVIEW environment. It is a graphical
“G” programming language used by thousands of engineers across the world to design small, medium,
and system level applications.

The Graphical User Interface of the program is called the “Front Panel” and is the grey window in the
LabVIEW environment. You can place controls, knobs, switches, graphs, charts, LEDs, and many
other common items that enable the user/operator to control the program.

The programming or coding interface is called the “Block Diagram” and is the white window. As the
programmer, you can place a multitude of functions and sub-routines to determine the functionality of
your program. LabVIEW has thousands of pre-defined functions that enable you to save time by
reusing popular functions and quickly accessing hardware devices.

To learn more about LabVIEW, you have several options. The fastest and quickest way to familiarize
you with LabVIEW is through a free, online portal created for learning LabVIEW, which is called
LabVIEW 101.

For more information, see the Additional Training Options section at the end of this document.

ni.com/daq Page | 38
Optional Exercise: Single Point and Finite Acquisition
Note: This exercise assumes that you have already installed all required software and configured all
hardware as outlined in earlier sections. If you have not, please refer back to the appropriate section to
do so.

Goals a) The first goal is to quickly acquire a set of data using the DAQ Assistant
b) The second goal is to acquire a 1000 data point array of data from the audio
source connected to the NI 9215 module.

Part A 1. Launch LabVIEW by navigating to Start» All Programs» National Instruments»


LabVIEW 2012» LabVIEW.
2. Create a new LabVIEW Project by navigating to File» New Project and select
Blank Project and select Finish to create a project file to hold all files and
references for the application.

3. Within the LabVIEW project window, navigate to File» Save Project. Create a
new folder on your desktop named “cDAQ Hands on Exercises” and save
your project within this folder; title your project “cDAQ hands on.”
4. Within the LabVIEW project window, right-click My Computer and select
New» VI to create a new LabVIEW Virtual Instrument (VI) to acquire data.

ni.com/daq Page | 39
5. Within the project window, right-click the newly created VI, Untitled 1.vi, and
select Save. Navigate to the folder on your desktop again, and save the VI as
“Optional Exercise a.”

6. Navigate to the Block Diagram (white window) of Exercise 1a.vi. If you are on
the Front Panel (grey window), press <Ctrl+E> to jump between Block
Diagram and Front Panel.
7. Right-click on empty white space to bring up the Functions Palette and
navigate to Measurement I/O» NI-DAQmx. This is the DAQmx Functions
Palette.
a. Now select the first function, DAQmx Create Virtual Channel.
Left-click to select the function, and then left-click to place it onto
the Block Diagram. This function opens a reference to and

ni.com/daq Page | 40
reserves the DAQ hardware device.

b. Once placed, left-click the white polymorphic selection box and


navigate to Analog Input» Voltage. Although we are acquiring a sound
signal, we will still use a voltage because this is what the MP3 player
outputs.

c. Turn on Context Help by pressing <Ctrl+H> and then hover over the
Create Channel VI to see all of the inputs and outputs.

d. Hover over the upper-left corner of the Create Channel VI and notice
that the cursor changes to the wiring tool automatically and the tip-
strip displays for the terminal over which your mouse is located.

e. Right-click the terminal for Physical Channels and select Create»


Constant. This constant will only be visible on the Block Diagram, and
there is no corresponding control or indicator on the Front Panel.
f. Left-click the arrow on the Physical Channels constant and browse to
the channel of interest, 9215/ai0.
g. Right-click the Input terminal configuration terminal and create a
constant. Select Differential. This means that the ADC will take the
difference between the ai0+ and ai0- pins on the DAQ device, which
is the most accurate way to measure from a sensor. Always use this
configuration if available for sensor acquisition. The resulting Block
Diagram should appear as follows.

ni.com/daq Page | 41
8. Right-click the Create Channel VI and navigate to DAQmx – Data Acquisition
Palette» DAQmx Start Task. This is a shortcut to quickly place another
function from the same palette, NI-DAQmx.
a. Place the DAQmx Start Task VI to the right of the Create Channel
VI.
b. To align any functions on the Block Diagram, select by holding
Shift and left-clicking the functions. Then select the Align Objects
button and select Align Top Edges.

c. Now wire the Task Out and Error Out of the Create Channel VI to
the Task In and Error In of the Start Task VI, respectively.
d. Press the Clean Up Diagram button or simply press <Ctrl+U>
to have LabVIEW automatically arrange the Block Diagram.
9. Place a NI-DAQmx Read VI to the right of the Start Task VI and wire the task
and error terminals together from each VI.

a. The VI’s polymorphic instance is by default set to Analog» Single


Channel» Single Sample» DBL. This is the proper setting for this
initial task.
b. Right-click the Data output terminal of the Read VI and place an
indicator. This will place the correct type of numerical indicator for
the data output terminal, which is a Double Precision Floating

ni.com/daq Page | 42
Point Numeric. This indicator will also automatically be labeled by
the name of the output terminal, data.

c. Right-click on this newly created indicator and select, Find


Indicator. This will take you to the Front Panel and highlight the
indicator.
10. Return to the Block Diagram and place a NI-DAQmx Clear Task VI to the right
of the Read VI and wire the Error and Task wires. This will dispose of all
references to the hardware.
11. Place a Simple Error Handler to the right of the Clear Task VI. This is located
in the Programming» Dialog and User Interface palette, but you can also use
the search button of the Functions Palette.
a. Wire the Error Out terminal to the Error In terminal of the Simple
Error Handler VI.
b. Because you have wired all of the error terminals together, the
errors will be passed from one VI to the next, and then handled at
the end. Once handled, the error message will be displayed, if
there is an error detected.

12. Navigate to the Front Panel and press the run button or simply press
<Ctrl+R> to run the VI. Ensure that the MP3 source is playing a song.
a. A single numeric value is displayed each time the VI is executed as
a new value is retrieved from the input pin.

Part B 1. Insert a NI-DAQmx Timing VI in-between the Create Channel and Start Task
VIs and wire appropriately. You can also right-click the DAQmx Task wire
and select Insert» DAQmx» Timing to accomplish this.
a. Create a constant for the Rate input terminal and enter 10k for the
value. LabVIEW can interpret metric abbreviations for units such a
‘k’ for thousand, and ‘m’ for milli.
b. This means that the task will use the Analog Input hardware timing
engine on the 9215 module to acquire data at a rate of 10k
Samples per second.
c. Create a constant for Samples per channel input terminal and set
the value to 10k as well. This means you will acquire 10k
Samples, or one second of data.
d. Create a constant for the Sample mode input terminal and leave as
the default setting, Finite, which means that you will only acquire
one set of data and then the task is ready to be cleared.

ni.com/daq Page | 43
2. Modify the DAQmx Read so that it is set to read Analog» Single Channel»
Multiple Samples» Waveform. A waveform is a cluster of data that contains
a 1-D array of numeric values, a single numeric value for the sample period
‘dt’ of the acquisition, and t0. It also contains a variant for attributes about
the waveform. This makes data processing much easier as all required info
is stored together.
a. Notice that the wire connecting the data output of the DAQmx
Read and the data indicator is now brown. This is the color of a
waveform data type.
b. Notice also that the indicator is still orange, and now there is a
small red dot on the input to the indicator. This is a coercion dot,
which means that LabVIEW is forcing the data type from one type
to another, which is not ideal. In this case, it is coercing a
waveform of data into a single numeric value. This is not a good
thing because we want to see the entire waveform of acquired
data.

3. Select the numeric indicator on the Block Diagram and press the <Delete>
key to delete it.
a. Notice that there is now a broken wire.

b. Press <Ctrl+B> to remove all broken wires from your Block

ni.com/daq Page | 44
Diagram.
c. Right-click the data output terminal of the DAQmx Read VI and
create an indicator. Locate the indicator on the Front Panel. This
is a waveform indicator, which is the proper indicator, but it would
be better to visualize the results on a graph.
d. Right-click the waveform indicator on the Front Panel and choose
Replace» Silver» Graph» Waveform Graph. A waveform graph will
display an entire waveform of data, and will redraw the graph
(erase old data and replace with new data) each time it receives
new waveform data.

e. Wire the Samples per channel constant to the Number of samples


per channel input on the DAQmx Read VI. When you mouse over
the middle of a wire, the mouse will change to a wiring tool,
allowing you to splice into the wire. Your block diagram should
now appear as follows.

4. Now run the VI to visualize 10k Samples of analog data acquired at 10kHz
from your MP3 music source. Ensure that your MP3 source is playing music
to see a proper audio signal.

ni.com/daq Page | 45
ni.com/daq Page | 46
Exercise 1: Acquire Audio Signal
Note: This exercise assumes that you have already installed all required software and configured all
hardware as outlined in earlier sections. If you have not, please refer back to the appropriate section to
do so.

Goals a) The first goal is to continuously acquire 40000 data point arrays from the audio
source connected to the NI 9215 (or similar Analog Input) module
NOTE: if you started with the optional exercise, skip ahead to the portion of this
section where you add the while loop

b) The second goal is to add data logging to the DAQmx task

Part A 1. Launch LabVIEW by navigating to Start» All Programs» National Instruments»


LabVIEW 2012» LabVIEW.
2. Create a new LabVIEW Project by navigating to File» New Project and select Blank
Project and select Finish to create a project file to hold all files and references for
the application.

3. Navigate to the desktop of your computer and create a new folder titled “My DAQ
Project,”
4. Return to LabVIEW. Within the LabVIEW project window, navigate to File» Save
Project and choose to save within the newly created folder on your Desktop and
title your project “cDAQ Hands On.”
5. Within the LabVIEW project window, right-click My Computer and select New» VI
to create a new LabVIEW Virtual Instrument (VI) to acquire data.

ni.com/daq Page | 47
6. Within the project window, right-click the newly created VI, Untitled 1.vi, and select
Save and title the VI “Exercise 1a” and save within the same folder on your
desktop.

7. Navigate to the Block Diagram (white window) of Exercise 1a.vi. If you are on the
Front Panel (grey window), press <Ctrl+E> to jump between Block Diagram and
Front Panel.
8. Right-click on empty white space to bring up the Functions Palette and navigate to
Measurement I/O» NI-DAQmx. This is the DAQmx Functions Palette.
a. Now select the first function, DAQmx Create Virtual Channel. Left-click
to select the function, and then left-click to place it onto the Block
Diagram. This function opens a reference to and reserves the DAQ
hardware device.

ni.com/daq Page | 48
b. Once placed, left-click the white polymorphic selection box and navigate to
Analog Input» Voltage. Although we are acquiring a sound signal, we will
still use a voltage because this is what the MP3 player outputs.

c. Turn on Context Help by pressing <Ctrl+H> and then hover over the Create
Channel VI to see all of the inputs and outputs.

d. Hover over the upper-left corner of the Create Channel VI and notice that
the cursor changes to the wiring tool automatically and the tip-strip displays
for the terminal over which your mouse is located.

e. Right-click the terminal for Physical Channels and select Create» Constant.
This constant will only be visible on the Block Diagram, and there is no
corresponding control or indicator on the Front Panel.
f. Left-click the arrow on the Physical Channels constant and browse to the
channel of interest, 9215/ai0.
g. Right-click the Input terminal configuration terminal and create a constant.
Select Differential.
h. Here is a common sensor setup diagram. In this example, a thermocouple
is connected to a cDAQ device.

ni.com/daq Page | 49
Noise and other signals can enter into the signal through the wires between
the sensor and the DAQ device, as wires act like antennas. Shielding and
other techniques can help to reduce this affect.

The terminal input configuration is the easiest way to eliminate a lot of the
effect of noise. Single-ended measurements (RSE and NRSE) only take the
positive sensor signal (ai+) and then they reference this to the system or
chassis ground (GND). The chassis ground typically does not have any
noise on it, and is represented by the solid black line below. The signal line
does typically have noise on it.

With Single-ended measurements, the noise will still be seen because the
acquired data will be the difference between the noisy signal line, and the
clean GND line.

Differential configuration means that the ADC will take the difference
between the ai0+ and ai0- pins on the DAQ device, which is the most
accurate way to measure from a sensor as it eliminates noise that is
common on both the positive and negative wires.

Always use this configuration if available for sensor acquisition. The


resulting Block Diagram should appear as follows.

ni.com/daq Page | 50
9. Right-click the Create Channel VI and navigate to DAQmx – Data Acquisition
Palette» DAQmx Timing. This is a shortcut to quickly place another function from
the same palette, NI-DAQmx.
a. Place the DAQmx Timing VI to the right of the Create Channel VI.
b. To align any functions on the Block Diagram, select by holding Shift and
left-clicking the functions. Then select the Align Objects button and
select Align Top Edges.

c. Now wire the Task Out and Error Out of the Create Channel VI to the
Task In and Error In of the Timing VI, respectively.
d. If you diagram is cluttered or messy, press the Clean Up Diagram button
or simply press <Ctrl+U> to have LabVIEW automatically arrange
the Block Diagram. It is not always the best result, but it is always
worth a try.
e. Create a constant for the Sample mode input terminal and select
Continuous, which means that you will continuously acquire data until
the task is cleared.
f. Create a constant for the Rate input terminal and enter 40k for the value.
LabVIEW can interpret metric abbreviations for units such a ‘k’ for
thousand, and ‘m’ for milli.
g. Create a constant for the Source input and select Onboard Clock. This
means that the task will use the Analog Input internal timing engine on
the 9215 module to acquire data at a rate of 40k Samples per second.
h. Create a constant for Samples per channel input terminal and set the
value to. This means you will acquire 4k Samples e very time the
DAQmx Read is called, or one second of data. This will configure the
buffer for the transfer of data from the DAQ device to the System
Memory.
i. A good benchmark is to acquire 1/10th of the number of samples as the

ni.com/daq Page | 51
sample rate. This is not required, but you can do this programmatically
using a Divide function in LabVIEW. This function is located in the
Programming» Numeric palette.

10. Place a NI-DAQmx Start Task VI to the right of the NI-DAQmx Timing VI and wire
the error and task wires together from each VI. This function will begin the
acquisition of data from the device and begin to store data in the on-board FIFO
memory of the device.

11. Place a NI-DAQmx Read VI to the right of the Start Task VI and wire the task and
error terminals together from each VI.

a. The VI’s polymorphic instance is by default set to Analog» Single


Channel» Single Sample» DBL. Because we will be reading 4k samples
at a time, we will need to change this to Analog» Single Channel»
Multiple Samples» Waveform.

ni.com/daq Page | 52
b. Right-click the data output terminal of the DAQmx Read VI and create an
indicator.

c. Locate the indicator on the Front Panel. This is a waveform indicator,


which is the proper indicator for the data type, but it would be better to
visualize the results on a graph.
d. Right-click the waveform indicator on the Front Panel and choose
Replace» Silver» Graph» Waveform Graph. A waveform graph will
display an entire waveform of data, and will redraw the graph (erase old
data and replace with new data) each time it receives new waveform
data.

e. Return to Block Diagram. Wire the Samples per Channel constant to the
Samples to Read input of the DAQmx Read VI by hovering over the wire
until the automatic tool selector (mouse cursor) changes into the wiring
tool; this will allow you to branch

12. Place a NI-DAQmx Clear Task VI to the right of the Read VI and wire the Error and
Task wires. This will clear and dispose of all references to the hardware.
13. Place a Simple Error Handler to the right of the Clear Task VI. This is located in the
Programming» Dialog and User Interface palette, but you can also use the search
button of the Functions Palette.
a. Wire the Error Out terminal to the Error In terminal of the Simple Error
Handler VI.

ni.com/daq Page | 53
b. Because you have wired all of the error terminals together, the errors
will be passed from one VI to the next, and then handled at the end.
Once handled, the error message will be displayed, if there is an error
detected.

14. To acquire continuously, you will need to use an execution structure to repeat
code continuously until a condition is met; this is a While Loop.
a. On the Block Diagram, open the Functions Palette and navigate to
Programming» Structures» While Loop. This will turn your mouse
cursor into a while loop cursor.
b. Left-click and drag around everything that needs to run continuously in
the VI, which is the DAQmx Read Function. You will want to add space
around the function before drawing the loop.

c. Notice the solid boxes that are created on the edges of the While Loop
border; these are called tunnels and are used to pass data from outside
the loop into the loop before it begins, and then from inside the loop
outside the loop after the condition is met and the loop is exited.
d. Try to run the VI by pressing the run arrow –notice that the run arrow is
broken , but go ahead and click on it. The VI will not run, but it will
list the errors that need to be resolved before you are able to run. The
Error list window will appear, and you can click on Show Error and
LabVIEW will take you to the error source.

ni.com/daq Page | 54
15. You now need to wire a Boolean (True/False) control into the Conditional Terminal
of the loop (Stop sign). Right-click the input and create a control to place a stop
button on the Front Panel.

16. To ensure that the DAQmx Read VI receives the Task and Error values are passed
from one iteration to the next, you will need to use shift registers to pass data.
a. Right-click the output tunnel of the purple DAQmx Task wire and select
Replace with Shift Register. This will change the output tunnel to a shift
register, and then allow you to select the proper input terminal. Left-
click the input tunnel for the DAQmx Task wire.

ni.com/daq Page | 55
b. Repeat for error wire tunnels.
17. To ensure that the VI exits the loop in the event that an error is generated within
the loop, it is necessary to unbundle the error cluster which contains an error
status Boolean, an error code numeric, and an error source string.

a. Select the While Loop on the Block Diagram and expand it vertically
downward, and then move the conditional terminal and stop button to
the bottom again to make room for more functions within the loop.
b. On the Functions Palette, navigate to Programming» Cluster, Class, and
Variant» Unbundle by Name and place this function in the empty space
you just created.
c. Wire from the Error output wire of the DAQmx Read to the input of the
Unbundle by Name function. This will automatically populate the names
of all of the elements of the Error cluster, and you can left-click to select
the element that you wish to unbundle. Select Status.

ni.com/daq Page | 56
d. Now place a Compound Arithmetic function with the Boolean
functionality of OR with multiple inputs. This is located in the Functions
Palette under Programming» Boolean. This will create a multi-input OR
function that will report a Boolean True if any one of the inputs is True,
which stops the While Loop execution. Note: you can use a basic
Boolean OR function for this example, but the compound is used as it
will enable you to grow the application in a later exercise.
e. Wire the output of the Compound OR function into the Conditional
Terminal of the While loop.

18. Save your VI by pressing <Ctrl+S>.


19. Navigate to the Front Panel and press the run button or simply press <Ctrl+R> to
run the VI. Ensure that the audio source is playing a song.
a. You should see a sound signal in the waveform graph indicator similar to
the image below.

ni.com/daq Page | 57
Part B NOTE: For the best experience, ensure that NI LabVIEW 2012 and DAQmx 9.5.5 or
later are installed, and that you also have Microsoft Excel with the TDM plug-in. Refer
to the Required Software section at the beginning of this document for more
information.

The following section will explain how to log data using the TDMS format. This format
allows for easy organization of data, high streaming rates to disk, and other great
qualities for engineering data storage. NI offers a program dedicated to opening and
manipulating data in TDMS format, NI DIAdem. If you have more than 30K samples in
your log, you are approaching Microsoft Excel’s limitations and DIAdem is the right tool
for you.

1. To log the acquired data to the previous example, only one (1) function needs to
be added to the chain of DAQmx code. Fortunately, there is already an
example built by the DAQmx R&D team at National Instruments that has this
function added.
a. Within the LabVIEW environment, navigate to Help» Find Examples….
Once the NI Example Finder is loaded, browse to Hardware Input and
Output» DAQmx» Analog Input» Voltage – Continuous Input.vi. Double-
click to open this example.

ni.com/daq Page | 58
b. Explore the Front Panel. This was made entirely using LabVIEW Front
Panel controls, indicators, and decorations.
2. Press <Ctrl+E> to open the Block Diagram. Observe the code. If you still have
the solution to Exercise 1a open, compare your Block Diagram code to this
code. There are a few differences in this Block Diagram in comparison to your
Block Diagram.
a. For the Create Channel VI, all of the inputs are set to be controls rather
than indicators. This allows the operator to easily change things directly
from the front panel, instead of having to go to the block diagram. Also,
the Max and Min Voltage input terminals have controls. This allows you
to specify the range of the input signal. There are limits for this range,
and you should refer to the specifications document for these limits.

b. For the Timing VI, again, controls are used instead of constants. There
is also an advanced function used, called a Property Node. Turn on

ni.com/daq Page | 59
context help <Ctrl+H> and mouse over the property node to learn more.
This property node is used to read out the ‘actual’ rate of the sample
clock. Some timers can only sample at certain rates; if you do not
specify one of those rates, it will be coerced into that rate.

c. Here is a brand new VI, DAQmx Configure Logging (TDMS).vi. This


enables you to automatically stream (log) the data acquired to your DAQ
device directly to disk using the Technical Data Management (TDM)
format. If you are using a sensor such as an accelerometer or
thermocouple that has custom scaling, it will log in the scaled
engineering units.

d. Explore the remaining functions of the VI to notice a few more changes


such as the Read and Boolean OR functions.
3. To explore the functionality of the data logging, return to the Front Panel.
Locate the section on the Front Panel.
a. Mouse over the right folder section of the TDMS File Path and left-click
to browse to the proper file path. This allows you to browse to the file
location, but you must also enter the name of the file to be created
before selecting OK in the Open Dialog Window. Enter “Exercise 1b
Data” for the file name and place the file within the project folder and
then proceed.

ni.com/daq Page | 60
b. Change the controls on the Front Panel so that they match the image
below:

c. Run the VI for a few seconds, and then press the Stop button on the
Front Panel to end the acquisition. Assuming that no errors were
encountered, the data should now be logged to file.
4. If you have Excel and the TDM plug-on installed, you should be able to locate
and double-click the file to open it directly in Excel. If not, you can try to first
open Excel, and then choose to open the file from the Excel environment.

ni.com/daq Page | 61
NOTE: if you do not have the Excel plug-in, you can search for “TDM plug in
Excel” at ni.com. If that does not work, you can open the TDM file within
LabVIEW. Skip ahead to step 5.

a. After you open the file in Excel, the root tab is the default open tab. This
tab contains high level information about the file, but does not actually
have the data points.
b. To see the data, navigate the _unnamedTask<1> tab. This tab has every
single data point that was acquired, and the top row has the physical
channel name.

c. You can choose to graph and manipulate the data however you please
from this point.
5. (For those who cannot open the file in Excel) Within LabVIEW, navigate to the
Block Diagram and open the functions palette. Using the Search section in the
upper right-hand corner, search for “TDMS file viewer.”
a. Place this function and provide the filepath of your TDMS file into the file
path input.
b. Run the VI to view the data. Expand the root tree on the left until you
can select the channel, 9215/ai0 and then select the Analog values
(graph) tab of the data viewer window. You can right-click the graph and
select Export» Export Data to Excel to save the data into Excel.

ni.com/daq Page | 62
Challenge 1. What is the highest frequency that a human ear can detect?
- Try searching online for ‘audible hearing range’ if you do not know.
Questions
2. What is the rule of the Nyquist Theorem for analog sampling to avoid aliasing
(misrepresentation of a signal frequency)?
- Try searching online for ‘Nyquist Theorem’ if you do not know.

3. If you need to accurately sample the full audible range of the input signal, what
should your sample rate be for the analog acquisition?
- You will have to make a calculation here.

4. Can the 9215 Analog Input module sample fast enough?


- Check the specifications of the 9215 module online at ni.com. Check the earlier
section, Before You Acquire Data, for help on how to find the specifications
document for NI DAQ modules.

ni.com/daq Page | 63
Exercise 2: Filtering and FFT
Goals a) Add a Fast Fourier Transform (FFT) to the audio signal to view the signal in the
frequency spectrum
b) Add a low-pass filter to remove the high-frequencies from the audio signal
c) Add a band-pass and high-pass filter to split the signal into Bass, Mid-tone, and
Treble, attenuate signals, and mix back together
d) Create a subVI to contain all of the signal processing

Part A 1. Because we do not need to log the data, open the solution to Exercise 1a.
2. To save this VI as a new VI, navigate to File» Save As…Copy» Substitute copy for
original. This will close the old VI, and leave the new VI in memory.
3. Before placing the signal processing functions, first create empty space within the
while loop for these functions.
a. While holing <Ctrl>, left-click-and-drag to place blank white space on the
block diagram within the while loop
b. Try this a few times to get used to how it works. If you do not like the
result, press <Ctrl+Z> to undo your last action.
c. Here is an example on how this functionality works.

4. Open the Functions Palette and navigate to Signal Processing» Waveform


Measurements» Power Spectrum and PSD and place this VI to the right and below
the DAQmx Read VI.
a. Wire the DAQmx Read data output into the Time signal input of the Power
Spectrum.
b. This function will compute a fast Fourier transformation and output a
Power Spectrum, which displays the power of each signal for each
frequency band.
c. Create a waveform Graph on the Front Panel and wire the Power
Spectrum / PSD output into the input of this graph.
d. Wire the Error out of the DAQmx Read into the Error In of the Power
Spectrum FFT, and then connect the Error Output into the Shift Register
and the Unbundle by Name function.

ni.com/daq Page | 64
5. Save the VI.
6. Run the VI to observe the Frequency spectrum of the audio signal.

Part B 1. Open the Solution to Exercise 2a, or continue using your VI if you have successfully
completed Exercise 2a.
2. Save this VI as a new VI, Exercise 2b.
3. Open the Functions Palette and navigate to Signal Processing» Waveform
Conditioning» Digital IIR Filter and place the VI in-between the DAQmx Read and
Power Spectrum VI so that the signal is filtered before it is transformed to the
frequency spectrum. Wire accordingly for error and signal wires. Expand the while
loop if you need more space.

ni.com/daq Page | 65
a. Create a constant for the IIR filter specifications input to the filter. This is
a cluster of data that contains many items. Mouse over each with
Context Help on to find out what each represents.

b. Make the following entries into the constants


i. Topology = Butterworth
ii. Type = Lowpass
iii. Order = 10
iv. Lower Fc = 600
c. Right-click the border to the cluster and select View Cluster as Icon to
minimize its space on the block diagram.

ni.com/daq Page | 66
d. Move the cluster constant below and to the left of the filter. Your Block
Diagram should appear as follows.

4. To visualize the effect of the filter and to find out the ideal cutoff frequency for the
filter, it would be better to be able to control the frequency cutoff while the program
is running. With LabVIEW, this is possible!
a. You will need to modify the Lower Fc component of the IIR Filter
Specifications. Place a Bundle by Name function below and to the left of
the IIR filter function.
b. Wire the cluster output into the input cluster input on the top of the
Bundle by Name function.

c. Wire the output of the Bundle by Name function into the IIR Filter
Specifications input of the IIR Filter function
d. Create a control for the Lower Fc input of the Bundle by Name function

ni.com/daq Page | 67
e. Navigate to the Front Panel to locate the Numeric Control and replace the
control with a Silver» Horizontal Numeric Pointer Slide. Double-click the
minimum value and change it to 1 and double-click the maximum value
and change it to 20k.
f. The minimum frequency must always be greater than zero, and the
maximum frequency must always be less than or equal to the Nyquist
Frequency, which is the ½ of the Sampling Frequency, 40kHz in this
example.

5. Save the VI.


6. Run the VI and modify the cutoff frequency while it is running. Can you see the
effect on the frequency?

ni.com/daq Page | 68
Part C 1. You are now aware of the effect of the filter. For this reason, you no longer need to
have the control on the Front Panel.
a. Delete the Lowpass Frequency control and remove the Bundle by Name
function from the Block Diagram.
b. Change the Lower Fc value to 600 within the cluster
c. Wire the cluster output back into the IIR Filter Specifications input of the
IIR filter function.
2. Add in 2 more Digital IIR filters, one bandpass filter for the mid-range frequencies,
and one high-pass filter for treble frequencies. You will need to add more space to
the While Loop to place two more filters.
a. Select the entire filter setup by clicking and dragging to select, and then
hold <Ctrl> and click-drag-and-drop to copy the functions for the additional
filters to save time. You can also select multiple items by holding <Shift>
while selecting items.
b. Wire the error out of the Lowpass into the error in of the Bandpass Filter.
Wire the error out of the Bandpass into the error in of the highpass. Wire
the error out of the highpass into the error in of the Power Spectrum
function. You will need to adjust the Block Diagram spacing again.

ni.com/daq Page | 69
c. The bandpass Lower Fc must always be greater than zero and less than
the Upper Fc of the bandpass filter. Open the cluster by double clicking
on it and then set Lower Fc to 800 and Upper Fc to 3000. Change the
type to Bandpass.
d. Contrary to intuition, the high-pass filter uses the Lower Fc for the
frequency limit, not the Upper Fc terminal. Set this to 5000. Change the
type to Highpass.
e. The filters are now cascaded in series for the error wires, which is
acceptable. However, we do not want to run the filtering in series; the
filtering must be in parallel to allow each filter to view the original sound
signal. Branch off of the data output from the DAQmx Read VI and wire
this to the signal in terminal of each filter.

3. With the above setup, only the lowpass filtered signal will be displayed. However,
the goal of an audio equalizer is to mix the signals back together after filtering them
out and attenuating them.

ni.com/daq Page | 70
a. To attenuate the signals, you need to operate on the array of numeric data
within the waveform rather than the entire waveform. Use a Get
Waveform Components for each of the three waveform clusters to
unbundle the Y array of data.
b. This is located in Programming» Waveform on the Functions Palette.
Place 3 of these down and wire the waveform output from each filter into
the function.
c. Place a multiply function for each array from the Programming» Numeric
Functions Palette and connect each one of the three arrays to the top
input of the function.
d. On the Front panel, create 3 Silver Numeric Vertical Pointer controls, one
for Bass, one for Mid-tone, and one for Treble, titled respectively.
e. Set the input range at 0 to 1.0 for each

f. Place each control inside of the while loop and connect to the respective
Multiply functions.

4. To add the arrays back together, use a Compound Arithmetic function as you did to
add the Boolean functions together for the Conditional terminal.
a. You can copy and paste from the Compound OR function and change the
mode, or place it from the Programming» Numeric Functions Palette.
b. Expand for three inputs, and wire the arrays into it accordingly.
c. To build the arrays back into a waveform, use a Build Waveform function

ni.com/daq Page | 71
and branch off of the previous waveform to use as a reference for the
input cluster input on the top of the function.
d. Wire the output of the Compound Arithmetic into the Y terminal of the
Build Waveform.
e. Wire the resulting waveform into the Power Spectrum VI. The Block
Diagram code within the While Loop should appear as follows.

5. Save the VI.


6. Run the VI and set the level of attenuation of the signals on the Front Panel to
visualize the effect of the filters.

Part D 1. At this point, the Block Diagram is getting pretty messy, and it would be in your best
interest to try to clean it up. In LabVIEW it is possible to make a subVI, which is a
function that you create and use within a larger VI. In this example, we will make a
subVI for all of the signal processing.
2. Open your solution to Exercise 2c and save a new file for Exercise 2d.
3. To prepare the Block Diagram for creating a subVI, you need to align the Controls
(Inputs) to the left side and the indicators (outputs) to the right. Everything that you
wish to conceal within the subVI should be in the center. Here is an example.

ni.com/daq Page | 72
The blue section will be contained within the subVI, and the wires that are
enveloped in the red section will be inputs and outputs to the subVI function.
4. To create the subVI, left-click and drag a selection around the entire blue section
from the prior image.

a. After you have selected the items, navigate to Edit» Create subVI.
b. This will put all the enclosed items within a new subVI and automatically
create controls and indicators

ni.com/daq Page | 73
5. You can now proceed by editing the icon for the subVI and changing the wiring if
required. Double-click on the subVI icon to begin this process. This will bring up
the Front Panel of the subVI.
a. In the upper right hand corner of the subVI Front Panel, you will find the
icon and terminal editor of the subVI.

b. Double-click the default icon to open the icon editor.


c. Browse around the environment and edit the icon as you desire. It is best
to add in text and choose an icon to indicate the functionality of the subVI.
You can drag-and-drop glyphs from the library and also copy and paste in
images from the internet.

d. Here is an example of an icon that you could use, but feel free to create
your own. Select OK once you are satisfied.

ni.com/daq Page | 74
e. Now let’s change the terminal pattern and wiring. It is best to keep the
inputs on the left and outputs on the right. The top and bottom are
typically used for specifications and optional inputs. This means that we
need to have 5 inputs on the left and move the Treble control terminal to
the left-hand side.
f. Right-click the terminal editor and select Patterns» and then select the
pattern with 5 inputs, 5 outputs, and 3 top and 3 bottom terminals.

g. You now need to change the terminals that are mapped to controls.
Right-click the lower orange input which corresponds to mid-tone and
select Disconnect This Terminal.
h. No you will need to reconnect the Mid-tone control to the middle input
terminal. Left-click the middle input. Notice that it changes the mouse
pointer to the wiring tool.

i. You will now need to left-click on the control that you wish to be mapped
to this terminal, Mid-tone.
j. You can left-click any terminal that is already assigned to a control and it
will highlight the associate control
k. Repeat this process to map the Treble control to the input terminal just
above the error input and just below the mid-tone input.
l. Return to the Block Diagram and right-click on the waveform wire that is
input to the Power Spectrum function and create an indicator. Map this
indicator to the middle output terminal.

ni.com/daq Page | 75
m. Here is the how all of the controls and indicators should be mapped.

n. Save the VI as Signal Processing subVI within the folder on your desktop.
o. Close the subVI.
6. Return to Exercise 2d.vi. Open the Block Diagram and notice that the subVI is
now greyed-out. This is because you need to re-link to the subVI after changing
the input terminals.

a. Right-click the subVI and select Relink to subVI.


b. Verify that all connections are now correct. Clean up the Block Diagram
and condense the size of the while loop. Here is the resulting Block
Diagram after cleaning it up.

ni.com/daq Page | 76
7. Save the VI. Run the VI to verify that it still functions correctly.

Challenge 1. What is the best type of filter to use for audio processing, FIR or IIR?
- Try searching online for ‘FIR IIR audio filtering’
Questions 2. What effect does the Order have on the quality of the filter?
- Try searching, or just experimenting with this in LabVIEW
3. What effect does the Order have on the processing requirements of the CPU and
LabVIEW?
- Try watching the memory usage in the Windows Task Manager while running with
different order filters.
4. What is a good way to test out the filter characteristics?
- Try searching for a ‘white noise’ source in LabVIEW
5. What are typical ranges for Bass, Mid-tone, and Treble frequencies?

ni.com/daq Page | 77
Exercise 3: Output Processed Signal
Goals a) Create an Analog Output Task to play a simple tone
b) Modify code to continually generate and output a new waveform
c) Add this code into the Analog Input code and then output the filtered Audio Signal
d) Modify code to allow for two analog inputs and two analog outputs because it is a
stereo signal with Right and Left audio signals

Part A 1. Create a new VI in your Project Explorer window by right-licking My Computer and
selecting New» VI.
2. Save this VI as Exercise 3a.
3. Create an Analog Output Voltage DAQmx Virtual Channel by placing a DAQmx
Create Virtual Channel and then selecting the type to be Analog Output» Voltage.
a. Set the input to be 9263/ao0
b. Set the input terminal configuration to be default
4. Create a DAQmx Timing VI
a. Set the rate to be 40k
b. Set the sample mode to be Continuous

5. By default, Analog Voltage output tasks are setup to have a waveform pre-loaded
into the output buffer before starting, and then continuously regenerate the
waveform until the DAQmx Task is cleared. So you now need to create a
waveform.
a. Navigate to the Functions Palette and browse to Programming»
Waveform» Analog Waveform» Waveform Generation» Basic Function
Generator and place it above the Sample Clock Timing VI.
b. Browse the inputs using Context Help <Ctrl+H>
c. Place a constant for frequency, amplitude, signal type, and sampling
info.
d. Enter 800 for frequency, 0.005 for amplitude, and Sine Wave for signal
type. For the sampling info, enter 40k for the Sample Rate (Fs) and 40k
for Number of Samples (#s). You can mouse over the items in a cluster
to view their label in context help, but in this case it does not matter as
they are the same value.
e. This function will now generate a one second long 800 Hz tone that is
sampled at 40kHz.

ni.com/daq Page | 78
6. Create a DAQmx Write VI and place to the right of the Sample Clock VI
a. Connect the Task and Error wires accordingly form the Sample Clock VI
b. On top of the VI there is a terminal, Auto-start, which will start the task
automatically after the buffer is loaded. Create a constant for this input
and select F to prevent it from auto-starting.
c. Wire the signal out from the Basic Function Generator VI to the data
input of the DAQmx Write VI
7. Place a DAQmx Start Task after the DAQmx Write
8. Create a small while loop to the right of the Start Task VI and pass the task and
error wire through to make tunnels.
a. Create a Stop Button control, and also unbundle the error wire to stop
the loop if an error is detected.
b. Replace the tunnels with shift registers
9. Clear the task and place a simple error handler which is located under
Programming» Dialog & User Interface.
10. This VI will now output an 800Hz tone continuously until the Stop button is
pressed. Put on your headphones and run the VI to test it out.

Part B 1. Open your solution to Exercise 3a and save a copy as Exercise 3b.
2. To update the output waveform while running, you will need to change the default
behavior of allowing regeneration.
a. Right-click the DAQmx Write VI and navigate to DAQmx – Data
Acquisition Palette» DAQmx Write Property Node and place this
property node in-between the Sample Clock and DAQmx Write VIs
b. Connect the Task and Error wires accordingly

ni.com/daq Page | 79
c. For the property node, select Regeneration Mode for the property of
interest and create a constant. Select Do Not Allow Regeneration.

3. Increase the size of the While Loop to allow for a copy of the Basic Function
Generator VI and all constants.
a. Copy and paste within the while loop the Function Generator.
b. Change the Frequency constant to a Control.
c. Navigate to the Front Panel and change the numeric control with a Silver
numeric horizontal pointer slide control.
d. Set the limits for the control at 1 to 20k.
4. Copy and Paste the DAQmx Write into the While Loop and wire accordingly to the
Task and Error wires.
a. Set auto-start to F if it is not already
b. Wire the Signal out of the Function Generator inside the loop to the data
in of the DAQmx Read VI.

5. Run the VI and modify the frequency during run time while listening to the output
waveform on your headphones.

Part C 1. To use the analog output code to play back the processed audio input, you will need
to add this code to the Exercise 2d solution.
a. Copy the entire Block Diagram Code and paste into the Block Diagram of
the Analog output as seen in the figure below. You can also select the
code from one Block Diagram and drag-and-drop onto the other.

ni.com/daq Page | 80
2. The goal is to now merge the two while loops together. Because the acquisition
and generation are linked together and data needs to be shared from one to the
other, they must be in the same while loop.
a. You have two options: remove one loop and add code into the other, or
remove both and draw a new while loop.
b. The result is the same, and it is only a matter of preference. You will
also need to remove one Stop button as you no longer need both.
c. Your block diagram should appear as follows.

3. Save the VI as Exercise 3c.


4. Remove the Function Generator VI and all connected constants and controls inside
of the While Loop.

ni.com/daq Page | 81
5. Wire the Output Waveform terminal of the Signal Provessing subVI to the data
input terminal of the DAQmx Write VI.

6. Change the amplitude on the Function Generator before the while loop to zero (0)
so that it is a 1 second delay with no sound as opposed to a 1 second tone at the
beginning of the initial output.
7. Delete one of the Simple Error Handler VIs as it is a best practice to only have one
error handler per VI.
a. Place a Merge Errors function to merge the two error wires together by
navigating to Programming» Dialog & User Interface
b. Connect the Error output from each DAQmx Clear Task into the inputs of
the merge error function, and wire the output of this function to the
input of the Simple Error Handler.

8. Save the VI. Run the VI with your headphones on and your MP3 source playing.
Toggle the attenuation and filter frequencies. Can you hear the effect?

Part D 1. Open the solution to Exercise 3d to explore how to add a second channel to the
analog input, signal processing, and analog output.
2. When selecting Multiple Channels in the Crate Virtual Channel VI, use the Browse
option and hold <Ctrl> while selecting multiple channels.

ni.com/daq Page | 82
3. A For loop is used to easily make an array of waveforms for multi channel outputs,
and the Count (N) terminal determines how many times the loop will run, and
therefore how many items will be in the array of waveforms

4. For loops are also used to index arrays for data processing. An input is not required
to the Count (N) terminal if there is an array that is input to the For Loop as it will
automatically pull the count based on the number of elements in the array

5. You also need to change the DAQmx Read and Write functions to account for

ni.com/daq Page | 83
Multiple Channels

Challenge 1. If one process is really slow inside of a while loop, and another process is really
fast, do they run independently, or in parallel?
Questions 2. Provided that the signal processing and DAQ functions are in the same loop, what
happens if the signal processing takes too long to execute?
3. Is there a way around this?

ni.com/daq Page | 84
Additional Training
Getting Started with LabVIEW
LabVIEW 101 is an online learning hub is a great tool for new users to LabVIEW. It is completely free,
and comes with videos, tutorials, quizzes, projects, and exams. It is built for students, but still covers
the same topics that are relevant to any new LabVIEW user.

If you have struggled with any of the topics in this manual today, there are more in depth resources
available here to help get you up to speed. Visit ni.com/lv101 to learn the basics of LabVIEW today!

ni.com/daq Page | 85
Professional Training Options
There are many courses that we offer for training in LabVIEW, as well as our Data Acquisition and
other hardware platforms. We also offer three levels of LabVIEW certification along with a few other
certification paths. These can help to boost your resume, and also solidify your knowledge of NI
Software and Hardware.

ni.com/daq Page | 86
NI Certification Path

For more information, visit ni.com/training today. Be sure to ask about our special pricing for academic
customers.

Appendix A: Exercise Solution Screenshots


Optional Exercise a
ni.com/daq Page | 87
Optional Exercise b

Exercise 1a

ni.com/daq Page | 88
Exercise 2a

Exercise 2b

ni.com/daq Page | 89
Exercise 2c

Exercise 2d

Exercise 3a

ni.com/daq Page | 90
Exercise 3b

ni.com/daq Page | 91
Exercise 3c

Exercise 3d

ni.com/daq Page | 92
Glossary A: Data Acquisition Specifications
This glossary consists of comprehensive descriptions of the specifications that National Instruments
uses to characterize the performance of its data acquisition (DAQ) products. It is intended to make it
easier to interpret and understand the material in our Instrumentation Reference and Catalogue.

Note: All specifications represent typical performance at 25°C unless otherwise noted. Not all
specifications are applicable for all DAQ products.

Analog Input
Input Characteristics

Number of Channels – The number of analog signals that the DAQ product is able to digitize. Usually,
this specification groups the channels into single-ended, pseudodifferential, and differential channels.
Single-ended channels have all inputs referred to a common ground that is connected to the computer
ground. Pseudodifferential channels are all referred to a common ground but

Type of ADC – Different applications require different types of analog-to-digital converters (ADCs) for
optimal performance. For example, an AC-class signal will most often be measured best with a delta-
sigma modulating ADC. Common types of ADCs include successive approximation, flash, half-flash,
integrating, and delta-sigma modulating.

Resolution – The number of bits that the ADC uses to represent the analog signal. The higher the
resolution, the greater the number of divisions the range is broken into, and therefore, the smaller the
detectable voltage change for a given input range and gain. The smallest detectable voltage change for
an ideal DAQ board is determined by:

Smallest detectable voltage change = range/(gain*2resolution)

Resolution is only one indication of the accuracy of a DAQ product. You must consider at least the
relative accuracy (linearity), settling time, offset errors, and gain errors to fully understand the accuracy
of a DAQ product.

Max Sampling Rate – The highest rate at which the input circuitry can digitize the analog signal. The
product will most likely have many other slower rates at which the product can digitize. For
multichannel sampling, the maximum sampling rate may not be achievable with full accuracy unless
the instrumentation amplifier settles properly as defined by the settling time specification. For a
complete description of settling time, see National Instruments Application Note 045, Is Your Data
Inaccurate Because of Instrumentation Amplifier Settling Time?

Input Signal Ranges – The voltage ranges that the DAQ product can be configured to accept and
convert accurately. National Instruments combines the input range and gain in one table to concisely
specify the input range, gain, and actual input signal range. You can calculate the actual input signal
range for products that do not specify it by:

ni.com/daq Page | 93
actual input signal range = input range/gain

For example, an input range of 0 to 10 V with a gain of 100 means that the product can accept signals
from 0 to 0.1 V. Input range and gain are selected in hardware on some products and by software on
others. The Maximum Working Voltage specification is related to the input signal range for signals with
a common-mode voltage and the Overvoltage Protection specification indicates how far you can
exceed the input signal range without damaging the product.

Input Coupling – The method by which the input signals are connected to the analog input circuitry. If
the coupling is DC, both AC and DC portions of signals are passed. If the coupling is AC, then only AC
portions of signals are passed and any DC portions are rejected.

Maximum Working Voltage (signal + common mode) – The highest voltage level that can be input to
the board without saturating the input. Even though a signal input range may be as small as 0 to 0.1 V,
both signals of a differential pair may be added to a common-mode voltage that is outside the range of
the board and therefore saturate the inputs. Sometimes, this specification is simply called the
common-mode voltage even though it refers to a combination of the common-mode voltage and the
signal voltage.

Overvoltage Protection – The highest voltage level that can be input to the board without damaging the
board. Usually, a specification will be given for when the board is powered on and when the board is
powered off. It is important to note that for a differential pair, a low voltage signal that is added to a
high common-mode voltage can damage the board if the combination of the differential and common
mode voltages exceed the level to which the board is protected.

Channels Protected – The names of the channels that have overvoltage protection.

Input Damage Level – The highest voltage level that can be input to the module without damaging the
module. The application of voltages up to this level, however, is not necessarily safe and may exceed
the safe operating voltage range for the module.

FIFO (First-In-First-Out) Buffer Size – A FIFO is a block of memory used to store a certain number of
samples on the board so that data is not lost if the data cannot be transferred to computer memory
fast enough. The FIFO is very important in high-speed DAQ products running with software such as
Windows, which can have high interrupt latencies. The FIFO size is typically specified in number of
samples so that you know how many sample points can be buffered. The amount of latency that the
product can tolerate is determined by multiplying the ADC conversion time (1/sampling rate) by the
size of the FIFO.

Data Transfers – The methods available to transfer digitized data from the DAQ board to computer
memory. Options for data transfer are DMA, interrupt, and programmed I/O. For programmed I/O
transfers, the CPU in the PC reads data from the DAQ board whenever the CPU receives a software
code to acquire a single data point. Interrupt data transfers occur when the DAQ board sends an
interrupt to the CPU, telling the CPU to read the acquired data from the DAQ board. DMA transfers
use a DMA controller instead of the CPU to move acquired data from the board into computer memory.
Even though high-speed data transfers can occur with interrupt and programmed I/O transfers, they

ni.com/daq Page | 94
require the use of the CPU to transfer data. DMA transfers are able to acquire data at high speeds and
keep the CPU free for performing other tasks at the same time.

DMA Modes (only for boards with DMA transfer capability) – The methods of DMA transfer available
to transfer digitized data from the DAQ board to computer memory. Options for DMA modes are
single, demand, and block-mode transfers. In single-mode transfers, one data value is transferred for
each DMA request asserted, which is the slowest method of transfer because the DMA controller
must arbitrate for the system bus with each transfer. Block and demand transfer modes increase
system throughput because the DMA controller performs several DMA transfers once the DMA
controller has gained bus access. For block-mode transfers, the DMA controller performs the entire
DMA sequence as specified by the transfer count register at the fastest possible rate in response to a
single DMA request from the DAQ board. For demand-mode transfers, the DMA controller performs
DMA transfers at the fastest possible rate as long as the DAQ board asserts its DMA request. When
the DAQ board unasserts this DMA request, transfers are held off. For more information on DMA
modes, see Application Note 011, DMA Fundamental on Various PC Platforms.

Configuration Memory Size – The configuration memory contains the scan list information for analog
input operations. Each entry in the configuration memory defines the behavior of each analog-to-digital
conversion. The information includes, but is not limited to, channel number, polarity, gain, and dither.

Transfer Characteristics
Relative Accuracy – A measure in least significant bits (LSBs) of the nonlinear errors associated with a
DAQ system. Relative accuracy is the worst-case deviation from the ideal DAQ board transfer function,
a straight line. A relative accuracy test is run by linearly sweeping the input from minus full scale to
plus full scale and comparing the average of the digitized values to the values of an endpoint-fit straight
line, created from an endpoint fit of the data. Relative accuracy includes all nonlinearity and
quantization errors but does not include offset and gain errors of the circuitry feeding the ADC. The
relative accuracy is measured in least significant bits (LSBs). The lower the relative accuracy, the better
the linearity of the product. Practically, a good DAQ product will have a relative accuracy of within ±1
LSB. The relative accuracy is a very important specification because it tells how accurately the
continuous analog input range is converted to discrete digital values.

Nonlinearity – A measure in percent of FSR (full scale range) of the worst-case deviation from the ideal
transfer function of a DAQ product, a straight line. This specification is included only for DAQ products
such as signal conditioning products that do not have an ADC. Because a product with this
specification will also be used with a DAQ product with an ADC, this nonlinearity specification must be
added to the relative accuracy specification of the DAQ product with the ADC.

INL – INL is the acronym for integral nonlinearity, a measure in LSBs of the straightness of the transfer
function of a DAQ board. Specifically, it indicates how far a plot of the DAQ board code transitions
deviate from a straight line. The INL test is run by linearly sweeping the input from minus full scale to
plus full scale and recording the locations of the transitions from one LSB to the next. The INL is the

ni.com/daq Page | 95
worst-case value found by subtracting the actual code transition locations from an endpoint-fit line of
the transitions.

DNL – DNL is the acronym for differential nonlinearity, a measure in LSB of the worst-case deviation of
code widths from their ideal value of 1 LSB. The DNL test is run by putting a triangle wave into one
channel of the DAQ board, digitizing many cycles of the waveform, making a histogram of the data,
and then normalizing the histogram. The greatest deviation from unity is the DNL. An ideal DAQ board
has a DNL of 0 LSB, meaning all the codes have a width of exactly 1 LSB. Practically, a good DAQ
board will have a DNL within ±0.5 LSB. No Missing Codes – A missing code is a digital code that a
DAQ board cannot produce, no matter voltage you input to it. A poorly performing DAQ board may
have a code width equal to or very near zero, which causes a missing code. A missing code has a
width of 0, causing the DNL to achieve the lower limit of –1 LSB. A DAQ board can be guaranteed to
have no missing codes to the resolution of the board over a certain temperature range.

Offset Error – The additional voltage level, specified in volts, that can be introduced in the input
circuitry. If you think of the amplifier transfer function as the equation y = m (x + b1) +b2, thenb1 is the
pregain offset error and b2 is the postgain offset error, where y is the output, x is the input, and m is
the gain. A pregain offset error occurs before amplification and a post-gain offset error occurs after
amplification. The pre-gain offset error will be amplified by the gain of the amplifier. The after-
calibration specification shows the maximum offset that will occur when the board is calibrated
properly. A before-calibration specification is also given so that you will know the worst-case error that
can occur, even if the board is not calibrated. The before-calibration specification also includes the
range of calibration of which the onboard circuitry is capable.

DC Offset Error – Same as offset error.

Gain Error – The degree to which the gain varies from the ideal, specified in percent of reading or ppm
(parts per million) of reading. The after-calibration specification shows the maximum gain error that will
occur when the board is calibrated properly. A before-calibration specification is also given so that you
will know the worst-case error that can occur, even if the board is not calibrated. The before-calibration
specification also includes the range of calibration of which the onboard circuitry is capable. The
specification also shows the error that will occur when the board is calibrated at a gain of 1 and used at
a different gain.

DC Gain Error – The gain error on the DC component of the signal. This specification is not applicable
when the device has AC input coupling.

Gain Adjustment Range – The range of gains for which the adjustment circuitry is capable of
compensating.

Amplifier Characteristics
Input Impedance – The effective resistance and capacitance seen at the input to the amplifier. The
impedance can vary differ when the board is powered on, powered off, and when isolated input limits
are overloaded. In general, the higher the input impedance of the DAQ product, the less the product
will disturb the signal being measured.

ni.com/daq Page | 96
Input Bias Current – The current, specified in nA, produced by the analog input circuitry that flows
through external components connected to the analog input channels. This current flowing through the
resistance of the connected circuitry will add an unwanted voltage to the one that you are trying to
measure. The lower the input bias current, the lower the additional unwanted voltage, and therefore
the better the measurement.

Input Offset Current – The difference in the input bias currents of the two inputs of the
instrumentation amplifier, usually specified in pA. If the source resistances connected to each of the
input terminals are nearly the same and the input offset current is low, the resulting offset voltages
tend to cancel. Thus, lower input offset currents improve measurements of balanced sources.

CMRR (Common-Mode Rejection Ratio) – CMRR describes the ability of a differential amplifier to
reject interfering signals common to both inputs and amplify only the difference between the inputs. A
differential-input instrumentation amplifier has both normal-mode (differential) gain and common-mode
gain. The normal-mode gain is the amplification of the difference between the positive and negative
inputs and ideally has such values as 1, 10, or 100. The common-mode gain refers to signals appearing
at the output of the amplifier resulting from the same (that is, common) signals appearing at both of
the inputs. Because the amplifier is expected to ignore common-mode signals, the common-mode
gain is usually very low and is ideally zero. The CMRR is the ratio of the normal-mode gain to the
common-mode gain and is usually expressed in dB. The higher the CMRR, the better the amplifier can
extract differential signals in the presence of common-mode noise.

Output Range – A specification for external DAQ accessories such as signal conditioning that tells the
voltage limits of the signal after it has been conditioned.

Output Impedance – The equivalent resistance at the output of external DAQ accessories such as
signal conditioning accessories. The lower the output impedance, the better the signal accuracy.

Dynamic Characteristics
Bandwidth – The signal frequency range that is passed by the analog input circuitry. The bandwidth
specification may have both a small signal bandwidth and a large signal bandwidth specification. The
small signal bandwidth is the range of frequencies that is passed with attenuation less than –3 dB.
Tests for small signal bandwidth are made with low voltage signals so that slew rate distortion is not a
factor. The large signal bandwidth (also called the full power bandwidth) is the range of frequencies
passed with THD less than a specified level, usually 1%. Tests for large signal bandwidth are usually
made with full scale input signals. For most DAQ boards, the bandwidth is specified in Hz. For the
dynamic signal acquisition boards that have digital antialiasing filters, the bandwidth is defined by the
sampling rate.

AC Coupling Low-Frequency Cut-Off (–3 dB) – The –3 dB corner frequency of the high-pass filter that
rejects the DC component of the input signal when the inputs are configured for AC coupling. This
specification is important because it indicates which AC signals will be attenuated when AC coupling is
used.

ni.com/daq Page | 97
Settling-Time-to-Full-Scale Step – The amount of time required for a signal to reach a certain accuracy
and stay within that range of accuracy. Settling time can be a major source of error for multichannel
acquisition systems because the switching between channels can cause large voltage steps that the
instrumentation amplifier may not be able to track quickly. National Instruments specifies how long it
takes a worst-case step (from minus full scale to plus full scale) to settle to different accuracies.
National Instruments Application Note 045, Is Your Data Inaccurate Because of Instrumentation
Amplifier Settling Time?, gives an in-depth description of settling time.

Scan Interval – The minimum period between scans of multiple channels.

System Noise (including quantization error) – A measure of the amount of noise added by the analog
circuit when the analog inputs are grounded at the I/O connector. On digitizers, this specification is
given in LSBrms. For signal conditioning accessories, this specification is given in Vrms. The
specification sometimes includes noise due to the quantization of the signal.

Dynamic Range – The ratio of the largest signal level a circuit can handle to the smallest signal level it
can handle (usually taken to be the system noise level), expressed in dB. The dynamic range is
equivalent to the maximum SNR.

Signal-to-THD Plus Noise – The ratio in dB of the rms test signal (a sine wave) to the rms level of
residual harmonic distortion and noise. This specification must include the input level used to
determine the specification and the bandwidth over which the specification is measured.

THD (Total Harmonic Distortion) – The ratio of the total harmonic distortion signal level to the test
signal (sine wave) level. THD is usually expressed in dB, sometimes in percent.

Amplitude Flatness – A measure of how close to a constant the gain of a circuit remains over a range
of frequencies. The specification is given in ± dB for a given frequency range.

Phase Linearity – A measure, in degrees, of the worst-case deviation of the phase-versus-frequency


plot from a straight line.

Interchannel Phase – The difference in phase that may result when the same signal is connected to
two or more channels. Unless otherwise stated, the interchannel phase is constant under constant
operating conditions. Thus, you can test your system once to determine the interchannel phase and
compensate for the error out additional tests.

IMD (Intermodulation Distortion) – IMD is the ratio, in dB, of the total signal level of harmonic sum and
difference distortion products, to the overall test signal level. The test signal is two sine waves added
together according to the following standards:

SMPTE – A 60 Hz sine wave and a 7 kHz sine wave added in a 4:1 amplitude ratio

DIN – A 250 Hz sine wave and an 8 kHz sine wave added in a 4:1 amplitude ratio

CCIF – A 14 kHz sine wave and a 15 kHz sine wave added in a 1:1 amplitude ratio.

IMD reveals nonlinearities under AC input signal conditions as opposed to relative accuracy, which
reveals nonlinearities under DC input signals conditions.

ni.com/daq Page | 98
Overload Recovery Time – The time necessary for an amplifier saturated at full scale to recover from
that saturation. In a multichannel acquisition, if the input of one channel saturates the amplifier and the
scan period is shorter than the overload recovery time, the data read for the next channel in the scan
may be erroneous.

Crosstalk – Any unwanted signal on one channel due to a signal on another channel. The crosstalk
does not include any settling time error. Crosstalk is the ratio, in dB, of the level of the interference on
the affected channel to the actual level of the interfering signal.

Filters
Type – Indicates what the purpose of the filter is. For example, simple single-pole RC filters are for
noise rejection while more sophisticated hardware and digital FIR filters are suitable for antialiasing
filters.

Cut-Off Frequency (–3 dB) – The frequency at which the filter attenuates the input 3 dB, or half of its
original power. Stationary filters such as RC filters will express the cut-off frequency in Hz while digital
antialiasing filters that move with the sampling rate will express the cut-off frequency in terms of the
sample rate.

Programmable Values – The selectable values for the cut-off frequency on modules with
programmable antialiasing filters. These switched capacitor filters are driven by a clock, either internal
or external.

Maximum External Clock Frequency – The maximum external clock frequency usable to drive the
switched capacitor programmable antialiasing filters.

Passband Ripple – Passband ripple indicates how much the analog signal will fluctuate due to the
presence of the filters. The ripple is specified in dB for an input frequency range.

Stopband Attenuation – The minimum amount of attenuation that the filter provides in the stopband.
The stopband is the range of frequencies where the filter attenuation is optimal.

Attenuation Rate – The slope with which the filter cuts off signals higher than the cut-off frequency.
The attenuation rate will usually be specified in dB/octave. Filters on the dynamic signal acquisition
boards are specified in dB per one-sixth octave because the filter attenuation is maximized in less than
an octave.

NMR (Normal-Mode Rejection) – The amount of signal rejection at a certain frequency. Typically the
frequency of the rejection is designed for electrical power frequencies such as 50 or 60 Hz.

Signal Delay – The amount of time required for the signal to be available for transfer to computer
memory from the time the signal was present at the input to the DAQ board. This delay is specified on
dynamic signal acquisition boards, which use delta-sigma modulating techniques, requiring a certain
number of sample periods before the data is available at the output of the digital filter.

Sample-and-Hold (S/H) Characteristics

ni.com/daq Page | 99
Acquisition Time – The time required for the sample-and-hold amplifiers to track to the correct voltage
level of the input when coming out of hold mode. This specification is given for different tracking
accuracies.

Hold-Mode Settling Time – The time necessary for the track-and-hold amplifiers to settle after the
transition from track mode to hold mode.

Droop Rate – The rate, in V/s, at which a voltage drifts while being held by a sample-and-hold or track-
and-hold circuit.

Interchannel Skew – The amount of delay that can occur between channels that are simultaneously
sampled. The interchannel skew is usually specified in ns.

Intermodule Skew – Intermodule skew is specified on SCXI products to indicate the amount of delay
that can occur between SCXI modules that are synchronized. The intermodule skew is usually
specified in ns.

Aperture Delay Time – A measure of the interval between the time the digital sample signal occurs and
the time when the actual analog sample is taken. A negative time value means that the propagation
delay on the analog signal is greater than that of the digital sample signal.

Hold Step – The residual offset error of the track-and-hold amplifiers after the hold-mode settling time.

Aperture Jitter – The amount of variation in seconds of the aperture delay time. If a product has an
external clock option, the specification will give the aperture jitter for both the internal and external
clock.

Stability
Recommended Warm-Up Time – Because the electrical parameters of electronic components vary
with temperature, stable and accurate electrical performance cannot be expected before the actual
temperatures of the components are stable. The recommended warm-up time is the amount of time it
takes for a room temperature unpowered product to stabilize at its higher operating temperature once
it has been powered up.

Offset Temperature Coefficient – The sensitivity of the voltage offset of the product to changes in
temperature. Usually, a pregain and a postgain offset temperature coefficient are specified. The
coefficient is specified in m V/°C.

Gain Temperature Coefficient – The sensitivity of the gain of the product to changes in temperature.
The coefficient is specified in ppm/°C.

Onboard Calibration Reference


Level – The voltage of the onboard reference of self-calibrating DAQ products. The level is usually
specified as a voltage and a tolerance.

ni.com/daq Page | 100


Temperature Coefficient – The sensitivity of the voltage of the onboard calibration reference to
changes in temperature. The coefficient is specified in ppm/°C and sometimes in mV/°C.

Long-Term Stability – The amount of change in the onboard voltage reference with time. Long-term
stability increases as parts age. Therefore, the stability is expressed in change per root time, usually in

Analog Output
Output Characteristics
Number of Channels – The number of simultaneous analog signals that the product can generate.

Resolution – The number of bits that the digital-to-analog converter (DAC) uses to generate the analog
signal. The higher the resolution, the higher the number of divisions the range is broken into, and
therefore, the smaller the voltage step capable of being generated. Resolution is only one indication of
DAQ product accuracy. You must consider at least the relative accuracy (linearity), offset errors, and
gain errors to fully understand the accuracy of the DAQ product.

Common-Mode Isolation – The maximum allowable difference in voltage between the D/A converter
channel and earth ground or another channel.

Max Update Rate – The fastest rate at which the analog output channels can convert digital data points
to analog values. Some products can generate the analog output samples directly from a buffer of
memory on the board and can therefore meet the max update rate under all conditions. Boards that
have DMA data transfer capability can also meet the max update rate consistently because they have
the DMA processor dedicated to transferring the data. Boards that require interrupt and programmed
I/O transfers may not be able to consistently meet the max update rate because of the processor
speed or other functions that the processor is trying to perform at the same time as transferring data
to the analog outputs.

Type of DAC – Different applications require different types of digital-to-analog converters (DACs) for
optimal performance. For example, an AC-class signal is best generated with a delta-sigma modulating
DAC. Examples of common types of DACs are multiplying, double-buffered multiplying, and delta-
sigma modulating.

FIFO (First-In-First-Out) Buffer Size – The FIFO is a block of memory used to store a certain number of
samples on the board so that data can be continually generated, even when there are interrupt
latencies preventing data transfers from PC memory. The FIFO size is specified in number of samples
so that you know-how many sample points can be buffered. The amount of latency that the product
can tolerate is determined by multiplying the DAC conversion time (1/update rate) by the size of the
FIFO.

Data Transfers – Data transfers are the methods available to transfer digital data from computer
memory to the DAQ board. Options are DMA, interrupt, and programmed I/O. For programmed I/O
transfers, the CPU in the PC writes data to the DAQ board whenever the CPU receives a software
code to generate a single analog value. Interrupt data transfers occur by the DAQ board causing an
interrupt to the CPU, telling the CPU to write the digital data to the DAQ board. DMA transfers use a

ni.com/daq Page | 101


DMA controller instead of the CPU to move digital data from computer memory onto the DAQ board.
Even though high-speed data transfers can occur with interrupt and programmed I/O transfers, they
require the use of the CPU to transfer data. DMA transfers are able to move data at high speeds and
keep the CPU free for performing other tasks at the same time.

DMA Modes (only for boards with DMA transfer capability) – This specification tells the methods of
DMA transfer available to transfer data from computer memory to the analog output circuitry on the
DAQ board. Options for DMA modes are single and demand transfers. In single-transfer mode, one
data value is transferred for each DMA request assertion, which is the slowest method of transfer
because the DMA controller must arbitrate for the system bus with each transfer. Demand-transfer
mode increases system throughput because the DMA controller performs several DMA transfers once
the DMA controller has gained bus access. For demand-mode transfers, the DMA controller performs
DMA transfers at the fastest possible rate as long as the DAQ board asserts its DMA request. When
the DAQ board unasserts this DMA request, transfers are held off. For more information on DMA
modes, see Application Note 011, DMA Fundamental on Various PC Platforms.

Transfer Characteristics
Relative Accuracy (INL) – A measure in least significant bits (LSBs) of the nonlinear errors associated
with a DAQ system. Relative accuracy is the worst-case deviation from the ideal analog output transfer
function, a straight line. The lower the relative accuracy, the better the linearity of the product.
Practically, a good analog output will have a relative accuracy within ±0.5 LSB. For analog output, the
relative accuracy is the same as the INL. The relative accuracy may be dependent on the output range.

Absolute Accuracy – The furthest the voltage output will deviate from the calibrated reference as a
percentage of full-scale range (FSR).

DNL (Differential Nonlinearity) – A measure in LSBs of the worst-case deviation of code widths from
their ideal value of 1 LSB. An ideal DAQ board has a DNL of 0 LSB meaning all codes have a width of
exactly 1 LSB. Practically, a good DAQ board will have a DNL within ±0.5 LSB.

Monotonicity – Monotonicity is the guarantee that the DAC will always give increasing voltages for
increasing codes. Monotonicity can be guaranteed to a resolution (usually the resolution of the ADC)
over a specified temperature range.

Offset Error – The additional voltage level, specified in volts, that can be introduced in the analog
output circuitry. The after-calibration specification shows the maximum offset that will occur when the
board is calibrated properly. A before-calibration specification is also given so that you will know the
worst-case error that can occur, even if the board is not calibrated. The before-calibration specification
also includes the range of calibration of which the onboard circuitry is capable.

Gain Error – The degree to which the gain varies from the ideal, specified in percent of reading or ppm
of reading. The after-calibration specification shows the maximum gain error that will occur when the
board is calibrated properly. A before-calibration specification is also given so that you will know the
worst-case error that can occur, even if the board is not calibrated. The before-calibration specification

ni.com/daq Page | 102


also includes the range of calibration of which the onboard circuitry is capable. For self-calibrating DAQ
products, the product will have an onboard reference. The gain error is often specified both for
calibration relative to this internal reference and to an external calibration reference.

Voltage Output
Output Ranges – The voltage ranges that the board can generate. Output range is selected in hardware
on some products and by software on others. The output range can be set by a voltage applied to the
external reference input.

Output Coupling – The method by which the output signals are connected to the I/O connector. If the
coupling is DC, both the AC and DC portions of signals are passed and generated. If the coupling is AC,
then only the AC portions of signals are passed and any DC signals are rejected.

Output Impedance – The effective source resistance seen at the output of the analog output channel.
The lower the output impedance, the less effect that circuitry connected to the analog outputs will
affect the analog output signal.

Current Drive – The maximum amount of current that can be generated by an analog output channel.

Recommended Load Impedance – The recommended minimum resistance and maximum capacitance
that the circuitry connected to the analog output should have.

Protection – The conditions that the analog output circuitry can be subject to without damaging the
board. Common types of protection are short circuit to ground and open circuit.

Power-On State – The level of the analog output channels when the product is powered on.

External Reference Input – AC and DC signals can be connected to the external reference input to set
the full scale levels of signals generated by the analog outputs.

Range – The range of voltage levels that can be connected to the external reference input without
saturating.

Overvoltage Protection – This specification indicates the maximum voltage level that can be input to
the external reference without damaging the board.

Input Impedance – The effective resistance and capacitance seen at the external reference input.

Bandwidth (–3 dB) – The range of frequencies that is passed with attenuation less than 3 dB.

Current Output
Range – The levels of current that can be controlled. Most current ranges will be 4 to 20 mA or 0 to 20
mA.

ni.com/daq Page | 103


Type – Type indicates how the current output channel controls the current. Some outputs are current
sinking channels, indicating that they require an external excitation source, while others can source the
current without external sources.

Output Impedance – The effective resistance of the current output channel. The lower the output
impedance, the less effect that circuitry connected to the analog outputs will affect the analog output
signal.

Current Loop Supply – The internal current loop supply indicates the range of voltages that the internal
loop supply can have when used as the loop supply for the current output channel. The external
current loop supply is the range of voltages that the current output channels can use when the current
output channel requires an external excitation source.

Excitation Voltage Range – The range of voltages that the current output channels can use when the
current output channel requires an external excitation source.

Absolute Accuracy – The farthest deviation that the current output will be from the calibrated reference
as a percentage of full-scale range (FSR).

Slew Rate – The maximum rate of current change per unit of time that the analog output channel is
capable of.

Protection – Protection specifies the types of conditions that the analog output circuitry can be subject
to without damaging the board. Common types of protection are short circuit to ground and open
circuit.

Power-On State – The level of the analog output channels when the product is powered on.

Dynamic Characteristics
Settling Time – The amount of time required for a signal to be accurate to within the specified accuracy
and to remain within that range of accuracy. The amount of time to settle depends on the voltage step
the analog output channel is generating. Thus, the specification will indicate the voltage step, and the
amount of time required to settle to within a specified accuracy.

Slew Rate – The maximum rate of voltage change of which the analog output channel is capable.

Noise – A measure of the amount of unwanted signal added by the analog output circuitry. The noise is
measured in Vrms over a specified frequency range.

Dynamic Range – The ratio of the largest signal level that the analog output circuitry can generate to
the smallest signal level it can generate (usually taken to be the noise level), expressed in dB. The
dynamic range is equivalent to the maximum signal-to-noise ratio.

Signal-to-THD Plus Noise – The ratio in dB of the rms test signal (a sine wave) to the rms level of
residual harmonic distortion and noise. This specification must tell which output level is used to
determine the specification and over what bandwidth the specification is measured.

ni.com/daq Page | 104


Amplitude Flatness – The measure of how close to a constant the gain of a circuit remains over a
range of frequencies. The specification is given in ±dB for a given frequency range.

IMD (Intermodulation Distortion) – The ratio, in dB, of the total signal level of harmonic sum and
difference distortion products, to the overall test signal level. The test signal is two sine waves added
together according to the following standards:

SMPTE – A 60 Hz sine wave and a 7 kHz sine wave added in a 4:1 amplitude ratio

DIN – A 250 Hz sine wave and an 8 kHz sine wave added in a 4:1 amplitude ratio

CCIF – A 14 kHz sine wave and a 15 kHz sine wave added in a 1:1 amplitude ratio

IMD reveals nonlinearities under AC input signal conditions as opposed to the relative accuracy which
reveals nonlinearities under DC input signals conditions.

Crosstalk – Crosstalk, specified in dB, is any unwanted signal on one channel due to a signal on
another channel.

Filter Characteristics
Type – The type of filter used on the analog output circuitry. Typical filter types are RC and digital
interpolating FIR.

Cutoff Frequency (–3dB) – The frequency at which the filter attenuates 3 dB of the input. Stationary
filters such as RC filters will express the frequency in Hz while anti-imaging filters that move with the
update rate will express the cut-off frequency in terms of the update rate.

Signal Delay – The amount of time required for the signal to be present at the I/O connector from the
time the analog output digital code was written to the DAQ board. This is specified on dynamic signal
acquisition boards, which use delta-sigma modulating techniques, requiring a certain number of sample
periods before the data is available at the output of the digital filter.

Stability
Offset Temperature Coefficient – The sensitivity of the voltage offset of the product to changes in
temperature. The coefficient is specified in mV/°C.

Gain Temperature Coefficient – The sensitivity of the gain of the product to changes in temperature.
The coefficient is specified in ppm/°C. The gain temperature coefficient is often specified both for
calibration relative to this internal reference and to an external calibration reference.

Onboard Calibration Reference


Level – The voltage of the onboard reference of self-calibrating DAQ products. The level is usually
specified as a voltage and a tolerance. Even though the tolerance on the calibration reference is large,

ni.com/daq Page | 105


the DAQ product can be accurately calibrated if the actual value of the calibration level is stored on the
board in EEPROM. The calibration reference is selected for its stability over temperature and time, not
for the absolute accuracy of its voltage level.

Temperature Coefficient – The sensitivity of the voltage of the onboard calibration reference to
changes in temperature. The coefficient is specified in ppm/°C and sometimes in mV/°C.

Long-Term Stability – The amount of change in the onboard voltage reference with time. Long term
stability increases as parts age. Therefore, the stability is expressed in change per root time, usually in
ppm/ 1000 hour.

Digital I/O
Number of Channels – The number of input or output digital signals that the DAQ product is capable of
acquiring and generating. Some of the channels may be input or output, while others may always be
inputs or always be outputs.

Compatibility – The compatibility indicates whether the digital I/O channels are TTL or CMOS
compatible, or compatible with both.

Power-On State – The logic level to which the digital channels will be to when the product is first
powered on. Possible power on states are logic low, logic high, and configured as input.

Digital Logic Levels – The minimum and maximum voltage levels that will be detected or generated as
a low or high voltage. This specification will also indicate the current levels associated with the high
and low voltages.

Input Low Voltage – The minimum and maximum voltages that the DAQ product will read as a low
logic level (binary 0) for that digital channel.

Input High Voltage – The minimum and maximum voltages that the DAQ product will read as a high
logic level (binary 1) for that digital channel. Voltage between the input low voltage max and the input
high voltage min are indeterminate as to whether they will return a binary 0 or 1.

Input Low Current – The maximum current that the board can source at the specified voltage Vin when
the digital channel is in the logic low state. The current is specified as a negative number to emphasize
that current is being sourced by the DAQ product.

Input High Current – The maximum current that the board can sink at the specified voltage Vin when
the digital channel is in the logic high state.

Output Low Voltage – The highest voltage the digital channel will generate at the output current Iout
when the DAQ product is generating a logic low signal.

Output High Voltage – The lowest voltage the digital channel will generate at the output current Iout
when the DAQ product is generating a logic high signal. The current is specified as a negative number
to emphasize that current is being sourced by the DAQ product.

ni.com/daq Page | 106


Output Low Current – The highest current that the digital output channel can sink while generating an
output logic low signal Vout .

Output High Current – The highest current that the digital output channel can source while generating
an output logic high signal Vout . The current is specified as a negative number to emphasize that
current is being sourced by the DAQ product.

Darlington Drive Output Current – Darlington drive digital outputs are digital channels with higher
current drive capability than typical digital channels. The Darlington drive output current specification
indicates which ports have darlington drive capability. The specification also indicates the current the
channel can source into a given resistance at a given voltage. The current is specified as a negative
number to emphasize that current is being sourced by the DAQ product.

Input Impedance – The effective resistance and capacitance seen at the input to the digital input
channels. In general, the higher the input impedance of the DAQ product, the less the product will
disturb the signal being measured.

Common-Mode Isolation – The maximum allowable difference in voltage between a channel and earth
ground or another channel.

Common-Mode Transient Rejection – The maximum allowable slew rate, expressed as V/ms, for the
maximum working common mode voltage. In other words, if your working common mode voltage is
changing more rapidly than this specified amount, the signal conditioning will not be able to reject the
common mode voltage.

Transfer Rate – The rate at which the digital I/O board can read its digital inputs or change its digital
outputs. The rate is highly dependent on the computer and software used, and what type of data
transfer is used to move data to and from computer memory. The specification will often indicate the
type of computer, software, and transfers used to achieve the specified rates. The rate will be
specified in either bytes/s or words/s where a word can be specified as either 16 or 32 bits.

Propagation Delay – Specified for signal conditioning modules such as SCXI, is the time necessary,
when the module is used in parallel mode, for a digital signal to propagate from the DIO board output
to the output of the module, or from the input of the module to the DIO board input.

Handshaking – Handshaking indicates the available methods of handshaking data into and out of the
digital I/O board. Some boards have dedicated handshaking lines while others require the sacrifice of
one or more digital I/O ports to use the handshaking capabilities. With all handshaking, the data source
and data sink devices control data transfer by using two wires. The “request” signal of the data source
is connected to the “acknowledge” signal of the data sink, and the “acknowledge” signal of the data
source is connected to the “request” signal of the data sink.

To begin a data transfer, the data source device drives data onto the data bus and asserts its
“acknowledge” signal. It then waits for its “request” signal to be asserted. The data sink device waits
for its “request” signal to be asserted and reads data off of the data bus when that condition is met. It
then asserts its acknowledge signal after reading the data. When the data source device senses that
its “request” signal has been asserted, it clears its “acknowledge” signal and the whole cycle repeats.

ni.com/daq Page | 107


Data Transfers – This specification tells the methods available to transfer digitized data from the DAQ
board to computer memory. Options for data transfer are DMA, interrupt, and programmed I/O. For
programmed I/O transfers, the CPU in the PC reads data from the DAQ board whenever the CPU
receives a software code to acquire a single data point. Interrupt data transfers occur by the DAQ
board causing an interrupt to the CPU, telling the CPU to read the acquired data from the DAQ board.
DMA transfers use a DMA controller instead of the CPU to move acquired data from the board into
computer memory. Even though high-speed data transfers can occur with interrupt and programmed
I/O transfers, they require the use of the CPU to transfer data. DMA transfers are able to acquire data
at high speeds and keep the CPU free for performing other tasks at the same time.

DMA Modes (only for boards with DMA transfer capability) – This specification tells the methods of
DMA transfer available to transfer data between computer memory and the digital I/O channels on the
DAQ board. Options for DMA modes are single and demand transfers. In single-transfer mode, one
data value is transferred for each DMA request assertion, which is the slowest method of transfer
mode because the DMA controller must arbitrate for the system bus with each transfer. Demand-
transfer mode increases system throughput because the DMA controller performs several DMA
transfers once the DMA controller has gained bus access. For demand-mode transfers, the DMA
controller performs DMA transfers at the fastest possible rate as long as the DAQ board asserts its
DMA request. When the DAQ board unasserts this DMA request, transfers are held off. For more
information on DMA modes, see Application Note 011, DMA Fundamental on Various PC Platforms.

Digital Relays
Number of Relays – The number of channels the DAQ product can switch with relays.

Relay Type – This specification describes the capabilities of the relays used on the DAQ product.
Options for relay type are single-pole double-throw (SPDT), latching, and nonlatching. SPDT relays, also
called Form C, can switch one channel from a common (COM) terminal between a normally open (NO)
and normally closed (NC) terminal. Latching relays maintain their latest state, even when powered
down. Nonlatching relays return to their normally closed state at power down.

Maximum Input Voltage – The highest voltage that should be connected to any input terminal (channel
to earth), or between any two terminals (channel to channel). The voltage level is usually specified in
VAC and VDC.

Maximum Switching Voltage – The highest voltage that can be switched by the relays. A specification
is usually given for both AC and DC signals.

Maximum Switching Capacity – The highest load, or power, that can be switched by a relay. This
capacity is specified for both AC and DC loads. Because you can often switch larger voltages at lower
currents, the specification will sometimes include two current/voltage combinations for AC and/or DC.

Minimum Switching Capacity – The amount of voltage and current required to ensure that the relay
contacts will conduct electricity. At lower loads, the closed relay may not conduct and appear to be an
electrical open circuit. This specification usually includes the current/voltage combinations for both AC
and DC loads.

ni.com/daq Page | 108


On Resistance – The resistance measured across closed relay contacts.

Output Capacitance – The capacitance across the solid-state relay outputs (i.e. between ‘CHAN’ and
‘COM’).

Leakage Current – The maximum current that can flow across the solid-state relay outputs (i.e.
between ‘CHAN’ and ‘COM’) when the relay is in the off state.

Contact Material – The material, such as silver alloy, with which the relay contact is constructed.

Expected Life – The number of opening and closing operations the relays are capable of before failure.
Mechanical life is the expected life with no electrical load applied to the relays. Electrical life is
measured with the maximum (or specified) switching load applied.

Thermal Offset – The amount of thermoelectric voltage generated at the junction of two closed
contacts. This voltage appears as an offset across the relay contacts.

Maximum Operating Speed – The highest switching speed, expressed as operations per minute or
second, at which you can use the relays. An operation is defined as a relay set and reset cycle. The
maximum operating speed is specified for two conditions—with maximum switching load applied, and
with no load or low-level loads.

Relay Set Time – The amount of time from when the voltage is applied to the latching relay until the
normally open (NO) contact closes.

Relay Reset Time – The amount of time from when the input to the latching relay is reset until the
normally closed (NC) contact closes.

Relay Operate Time – The amount of time from when the voltage is applied to the nonlatching relay
until the normally open (NO) contact closes.

Relay Release Time – The amount of time from when the input to the nonlatching relay is reset until
the normally closed (NC) contact closes.

Timing I/O
Number of Channels – The maximum number of channels available for timing input and output. The
product may have some channels that are general purpose counter/timers and other channels that are
scalable frequency output only. It is common for a multifunction DAQ board to use some of the
available counter/timer channels for more sophisticated DAQ operations such as interval scanning. All
National Instruments E Series multifunction boards, however, do not require user-available counter
timers, even when performing sophisticated DAQ operations.

Digital Logic Levels – The minimum and maximum voltage levels that will be detected or generated as
a low or high voltage. This specification will also indicate the current levels associated with the high
and low voltages.

ni.com/daq Page | 109


Input Low Voltage – The minimum and maximum voltages that the DAQ product will read as a low
logic level (binary 0) for that timing channel.

Input High Voltage – The minimum and maximum voltages that the DAQ product will read as a high
logic level (binary 1) for that timing channel. Voltage between the input low voltage max and the input
high voltage min are indeterminate as to whether they will return a binary 0 or 1.

Input Low Current – The maximum current that the board can source at the specified voltage Vin when
the timing channel is in the logic low state. The current is specified as a negative number to emphasize
that current is being sourced by the DAQ product.

Input High Current – The maximum current that the board can sink at the specified voltage Vin when
the timing channel is in the logic high state.

Output Low Voltage – The highest voltage the timing channel will generate at the output current Iout
when the DAQ product is generating a logic low signal.

Output High Voltage – The lowest voltage the digital channel will generate at the output current Iout
when the

DAQ product is generating a logic high signal. The current is specified as a negative number to
emphasize that current is being sourced by the DAQ product.

Output Low Current – The highest current that the digital output channel can sink while generating an
output logic low signal Vout .

Output High Current – The highest current that the digital output channel can source while generating
an output logic high signal Vout . The current is specified as a negative number to emphasize that
current is being sourced by the DAQ product.

Resolution – The number of bits available for the counter timers. The number of events that the
counter can count is determined by:

number of events = 2resolution

For example, a 16-bit counter can count 65,536 events. If the timers have both general purpose
counter/timers and frequency scalers, then the specification will tell the resolution of both.

Compatibility – The specification indicates whether the digital I/O channels are TTL or CMOS
compatible, or compatible with both.

Base Clock Available – DAQ boards with counter/timers have an onboard clock that can be used to set
the frequency to clock the counter/timer. The base clock available specification tells the frequencies
that this clock can be programmed to generate.

Base Clock Accuracy – The accuracy, specified in percent, of the frequency generated by the onboard
clock.

Maximum Source Frequency – The highest frequency that can be counted by the counter/timer.

ni.com/daq Page | 110


Minimum Source Pulse Duration – The length of time of the smallest pulse measurable by the
counter/timer.

Minimum gate pulse duration – The length of time of the smallest pulse detectable at the gate input of
the counter/timer.

Data Transfers – This specification tells the methods available to transfer digitized data from the DAQ
board to computer memory. Options for data transfer are DMA, interrupt, and programmed I/O. For
programmed I/O transfers, the CPU in the PC reads data from the DAQ board whenever the CPU
receives a software code to acquire a single data point. Interrupt data transfers occur by the DAQ
board causing an interrupt to the CPU, telling CPU to read the acquired data from the DAQ board. DMA
transfers use a DMA controller instead of the CPU to move acquired data from the board into
computer memory. Even though high-speed data transfers can occur with interrupt and programmed
I/O transfers, they require the use of the CPU to transfer data. DMA transfers are able to acquire data
at high speeds and keep the CPU free for performing other tasks at the same time.

DMA Modes (only for boards with DMA transfer capability) – This specification tells the methods of
DMA transfer available to transfer data between computer memory and the digital I/O channels on the
DAQ board. Options for DMA modes are single and demand transfers. In single-transfer mode, one
data value is transferred for each DMA request assertion, which is the slowest method of transfer
mode because the DMA controller must arbitrate for the system bus with each transfer. Demand-
transfer mode increases system throughput because the DMA controller performs several DMA
transfers once the DMA controller has gained bus access. For demand-mode transfers, the DMA
controller performs DMA transfers at the fastest possible rate as long as the DAQ board asserts its
DMA request. When the DAQ board unasserts this DMA request, transfers are held off. For more
information on DMA modes, see Application Note 011, DMA Fundamental on Various PC Platforms.

Triggers
Analog Trigger
Source – The channels available that can be the source for the analog trigger.

Level – The range of levels that can be input as an analog trigger.

Slope – The description of whether the trigger should occur on an increasing voltage (positive slope) or
a decreasing voltage.

Resolution – The number of bits used to determine the voltage level of the analog trigger. The higher
the resolution, the higher the number of divisions the input range is broken into, and therefore, the
smaller the detectable voltage change.

Hysteresis – The voltage level that defines the range that a signal must pass through after it has
caused a trigger before the signal can cause a second trigger. Hysteresis prevents multiple triggers
from occurring when there are small amounts of noise on the signal.

Bandwidth (–3dB) – The range of frequencies that can be input into the analog trigger.

ni.com/daq Page | 111


External Input Impedance – The effective resistance and capacitance of the external analog trigger
input.

Coupling – The method by which the input signals are connected to the trigger circuitry. If the coupling
is DC, both the AC and DC levels will be passed to be used for a trigger. If the coupling is AC, then
only the AC signals will be passed and the DC signals will be rejected.

Protection – The highest voltage levels that can be input to the trigger channel without damaging the
board. Usually, a specification will be given for both the protection when the board is powered on and
when the board is powered off. It is important to note that a low voltage signal that is riding on a high
common mode voltage can damage the board if the combination of the two levels exceeds the levels
for which the board is protected.

Digital Trigger
Compatibility – Indicates whether the digital trigger inputs are TTL or CMOS compatible, or compatible
with both.

Response – Indicates if the trigger responds to an edge transition or a voltage level.

Pulse Width – The minimum pulse width that can activate the digital trigger.

Excitation
Output Characteristics
Channels – The number of independent excitation channels.

Bridge Types – The type of bridge sensor that can be used with the product (quarter, half, or full).

Bridge Completion – Description of the bridge completion circuitry (resistors) required when the
product is measuring half or quarter bridge sensors. For example, bridge completion consisting of two
resistors will comprise one half of a full bridge, with a half-bridge sensor comprising the other half.

Voltage Mode
Level – The voltage level of each excitation channel. This specification also includes the excitation
channel accuracy (expressed as a percentage) and the maximum current that an excitation channel can
drive. If the channel is configurable for different levels, all levels are listed.

Current Drive – The amount of current that the constant excitation voltage can source.

Drift – The rate at which the excitation voltage level will drift with temperature.

Current Mode

ni.com/daq Page | 112


Level – The amount of current sourced by the excitation channel. This specification also includes the
excitation channel accuracy (expressed as a percentage). If the channel is configurable for different
levels, all levels are listed.

Max Load Resistance – The maximum resistance that an excitation current can drive with the specified
current level. For example, an excitation channel with 10 kW load resistance limit can drive its
specified current through up to ten 1 kW devices, or one hundred 100 W devices.

Drift – The rate at which the excitation current level will drift with temperature.

Cold-Junction Reference
Output – The range of voltages generated by the cold-junction temperature sensor. IC temperature
sensors are linear and their output is expressed as mV/°C. A 10 mV/°C sensor, for example, will output
250 mV at 25°C. Thermistor outputs, however, are nonlinear. Therefore, thermistor output is specified
as the voltage range over a defined temperature range (x volts at 50°C to y volts at 0°C).

Accuracy – The accuracy to which the temperature sensor measures the true cold-junction reference
junction. This specification includes the inaccuracy of the sensor, any supporting components,
inaccuracy of measuring the sensor output with an SCXI system and DAQ board, and inaccuracy
caused by temperature gradients between the sensor and any of the screw terminals. The accuracy of
the thermistor sensor on the SCXI-1328 varies over temperature; therefore, accuracy may be specified
for particular operating temperature range.

Repeatability – This specification indicates how well the cold junction sensor can repeat its
performance. This specification has nothing to do with how close the measurement is to the actual
temperature (see Accuracy above); rather it describes the precision of the sensor in repeating the
measurement. Therefore, offset and gain errors of the system are not included. Repeatability does
include errors such as nonlinearity, noise, and the temperature gradient between the sensor and any of
the screw terminals.

Digital Signal Processor


DSP Processor – The type of DSP processor chip used on the plug-in board. DSP chips are designed as
stand-alone processors that can run independent of the host CPU. DSP chip computation performance
is optimized for math operations common to spectral analysis, such as the Fast Fourier Transform and
convolution. In addition, DSP chips feature parallel multiply operations and can handle DMA transfers
and interrupt requests.

Clock Speed – The rate at which the DSP chip is clocked.

Instruction Rate – A measure of how fast the DSP processor can execute instructions. The instruction
rate is measured in millions of instructions per second (MIPS).

Floating-Point Rate – A measure of how fast the DSP processor can make floating point calculations.
The floating-point rate is measured in millions of floating point operations per second (MFLOPS). The

ni.com/daq Page | 113


maximum MFLOPS equals the MIPS rating multiplied by the number of parallel floating-point
operations that the DSP processor performs in one instruction cycle. DSP chips cannot sustain peak
MFLOPS performance.

Memory
On-Chip – The amount of random access memory (RAM) located on the DSP chip. Typically the on-chip
memory is accessed faster than the dual access or dual ported memory.

Dual-Ported – The amount of RAM that can be simultaneously accessed by more than one DMA
controller or DSP processor.

Dual-Access – The amount of RAM that can only be accessed sequentially by controllers, CPU, or DSP
chip.

DMA Controllers
Access – An indication of which memory the specified DMA controller can move data to and from.

Max Transfer Rate – The highest speed at which the DMA controller can move data from one point to
another.

Number of Channels – The number of DMA channels available for data transfer by the specified DMA
controller.

Interrupts
Types – The types of interrupts used by the DSP board.

Throughput Rates
1 Kword Transfer – Data transfer time required to transfer 1 Kword of data. The specification will
indicate where the data is transferred from and to.

1 K FFT – DSP processor time needed to calculate a 1,024-point FFT.

Real Time System Integration (RTSI)


Trigger Lines – The number of trigger lines the board can connect to the RTSI bus.

Clock Skew – The delay that can occur on timing signals sent over the RTSI bus when used to
synchronize events on two or more boards. This specification gives the time to get a signal to or from
the RTSI connector on the board to the board function.

ni.com/daq Page | 114


DMA Channels – For NuBus DAQ boards, this specification indicates the number of DMA channels
available for the product to connect to the RTSI bus. The NB-DMA2800 board uses these timing
signals to control the DMA data transfers.

Serial Links – The number of channels that a board can connect to the RTSI bus to send serial data
between DAQ boards, without using the bus backplane. Usually, the type of data transfer is also
specified. A full-duplex channel can send and receive data signals simultaneously. A half-duplex
channel can either receive or send data but not simultaneously.

Serial Transfer Rate – The maximum rate at which data can be transferred serially over the RTSI bus
serial channels.

Bus Interface – The type of interface the board has on its bus. The simplest boards are slaves, in which
some other processor controls the operation of the bus and therefore the board. More sophisticated
boards with processors often have master interfaces, so they can take control of the bus and control
other boards that are plugged into the bus.

Power Requirement – Typically, the maximum amount of power that the board will require. This
specification will tell the amount of power required from the different voltage signals available in the
computer.

Physical
Dimensions – The size of the product. For plug-in boards, the dimensions will always be expressed in
length and height

I/O Connector – Type of connector available on the product.

PCMCIA Card Type – Indicates the type of card for PCMCIA products.

Environment
Operating Temperature – The temperature range under which the components on the product can
properly operate.

Storage Temperature – The temperature range under which the components on the product can be
stored without damage.

Relative Humidity – The humidity range under which the components on the product can operate
properly or be stored without damage.

Note: A “typical specification” provides good insight into how the product will perform because it
represents how a vendor expects a product to perform under normal operating conditions. Typical
specifications, however, are not binding specifications, and the product is not guaranteed to perform at
the given specifications. Most companies give typical specifications because absolute maximum

ni.com/daq Page | 115


specifications are meaningless in many cases. For example, the absolute maximum power dissipation
from a plug-in board could be calculated by determining the absolute maximum power dissipated by
each component and adding them all together. This of course, would give a ridiculously high power
usage specification that would never be reached by the board. Therefore, a more valuable specification
is determined by using the board in normal operating conditions in a typical application and quoting the
amount of power dissipated by the board in that application.

With a “typical specification” the customer must rely on the honesty and integrity of the supplier.
National Instruments gives very conservative typical specifications. When we hear that a customer is
not achieving the typical specifications that we quote, we first attempt to verify the customers results
and then redesign the product to meet the typical specifications, if necessary. If all else fails, we
change the specifications to meet the performance of the product.

ni.com/daq Page | 116

You might also like