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

1. Connecting Hardware

Before using NI LabVIEW software to take measurements with an NI data acquisition device, you need to set up and configure the device. This module explains how to install the proper driver and connect, configure, and test your device using NI Measurement & Automation Explorer (MAX) software. It also describes the setup process with the NI myDAQ measurement and control tool, but the same process applies to other USB multifunction DAQ devices such as the NI Educational Laboratory Virtual Instrumentation Suite (NI ELVIS) II or NI USB-6009.


Detailed Explanation

Download the Detailed Explanation PDF


Installing Hardware Drivers

Before connecting or installing your multifunction DAQ device, you need to install the proper hardware driver. Most NI multifunction DAQ devices communicate to your computer via the NI-DAQmx driver. You can access NI educational devices such as NI ELVIS II and NI myDAQ using the NI ELVISmx driver, which is built on and uses the NI-DAQmx driver to communicate to your computer. Plus the NI ELVISmx driver has additional functionality such as the NI ELVISmx Instrument Launcher, as seen in Figure 1.Click here for more information on using NI ELVISmx.


Figure 1. NI ELVISmx Instrument Launcher

Download the NI ELVISmx Driver
Download the NI-DAQmx Driver

Back to top | Collapse

NI Measurement & Automation Explorer (MAX)

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. 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 2. MAX User Interface

Back to top | Collapse

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 3.


Figure 3. Locally Installed NI Software
in the MAX User Interface

When you select an installed software package such as LabVIEW 2010 Service Pack 1 (SP1), 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 4.

Figure 4. Detailed Information Displayed for
LabVIEW 2010 SP1 (Version 10.0.1) in MAX

Back to top | Collapse

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 5.


Figure 5. Locally Installed NI Hardware

On the system shown in Figure 5, an NI myDAQ and an NI ELVIS II are installed. Because the NI myDAQ device was installed and detected first, it was enumerated in the system as Dev1 (Device 1); the NI ELVIS II device was installed and detected second, so it is Dev2 (Device 2). You can rename the device by right-clicking it to display the shortcut menu and selecting Rename, as shown in Figure 6.


Figure 6. Shortcut Menu of NI myDAQ Device in MAX

In this example, the devices were renamed to match their product names, NI myDAQ and NI ELVIS II (see Figure 7). This can make the device selection more intuitive when you are programming.


Figure 7. Devices Renamed to Their Product Names

The shortcut menu also features the Create Task… option, which you can use to create a data acquisition task in LabVIEW for analog input, analog output, and so on. With a MAX task to program your data acquisition or data generation, you can generate a step-by-step graphical interface rather than using the low-level NI-DAQmx API in LabVIEW.

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

Figure 8. Device Pinouts for NI myDAQ

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


Figure 9. 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 10.


Figure 10. 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 cause.

Back to top | Collapse

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 analog input, analog output, digital I/O, and counter I/O for a multifunction DAQ device such as an NI myDAQ or NI ELVIS II (see Figure 11). You can also set the input range, sample mode, and configuration as well as the channel to test.


Figure 11. Analog Input Test Panels for the NI myDAQ Device

Figure 12 is a graphical representation of the analog input voltage data acquired from the ai0 pin. Notice that there is also an instantaneous value displayed in the lower right-hand corner.

Figure 12. Data From Analog Input Test Panel

Back to top | Collapse

Additional Resources

Back to top | Collapse

Step-by-Step Procedure

Download the Step-by-Step Procedure PDF


Use this section with the video to test and validate that your NI data acquisition device, such as an NI myDAQ or NI ELVIS II, is working properly. Before proceeding, you must open the test panels for the device.

  1. Open NI Measurement & Automation Explorer (MAX).
    1. Navigate to Start»Programs»National Instruments»Measurement & Automation Explorer.
  2. Open test panels.
    1. Expand My System.
    2. Expand Devices and Interfaces.
    3. Right-click your device of interest and select Test Panels.

You can now use test panels to ensure that the analog input, analog output, digital I/O, and counter I/O are all functioning correctly. In this example, test the NI myDAQ.

Analog Input

By default, the test panels open to analog input. You can choose the channel you want to test (Note that you can access the audio input channels as well as the digital multimeter here.), the input range of the channel, the sample mode, and the input terminal configuration. For this test, leave them as default values and just press Start.

Note: If you do not have any signals connected to an input line, the signal floats and does not hold steady. This is expected behavior.

To verify that the analog input is reading correctly, input a known voltage. You can use any known signal such as a AA battery, but, in this case, use the + rail on the device:

  1. Connect the +5 V rail to the ai0+ terminal with a wire.
  2. Connect the DGND terminal to the ai0- terminal with a wire.
  3. In the MAX test panel, navigate to the Analog Input tab.
  4. Select DevX/ai0 for the input channel, where X is the device number for your device.
  5. Select On Demand for the Mode.
  6. Select Differential for the Input Configuration.
  7. Enter 10 for Max Input Limit and -10 for Min Input Limit.
  8. Press the Start button and observe the voltage.
  9. The graph should display between 4.7 and 5.0 VDC.

Note: This voltage is dependent on the power of the USB hub, so it may not read exactly 5 V, but it holds steady.


Figure 13. Analog Input Wiring

Back to top | Collapse

Analog Output

Testing the analog output requires looping the analog output back to the analog input to verify the voltage. Start by configuring the physical device.
NOTE: If you have not verified the analog input, do that now and then return to this section.

  1. Connect ao0 to the ai0+ terminal with a wire.
  2. Connect AGND to the ai0- terminal with a wire.
  3. Navigate to the Analog Output tab in the MAX test panels.
  4. Select DevX/ao0 for the input channel, where X is the device number for your device.
  5. Select Sinewave Generation for the Mode.
  6. Select <Default> for the Transfer Mechanism.
  7. Enter 10 for Max Output Limit and -10 for Min Output Limit.
  8. Enter 1k or 1000 for rate (Hz).
  9. Enter 5 for Sinewave Amplitude.
  10. Press the Start button to begin outputting the sine wave.

Now use the analog input to verify the analog output. Configure the analog input according to the analog input section. After pressing Run, you can see a sine wave on the graph indicator with a 5 V amplitude, 10 Vpk-pk.


Figure 14. Analog Output Wiring

Back to top | Collapse

Digital I/O

To test the digital I/O, connect DIO0 to DIO4, DIO1 to DIO5, DIO2 to DIO6, and DIO3 to DIO7, with a wire for each pair, which equals four wires total (see Figure 15). After connecting the wires, navigate back to the test panels in MAX.

  1. Navigate to the Digital I/O tab in the MAX test panels.
  2. Select DevX/ctr0 for the input channel, where X is the device number for your device.
  3. Select Port0 for the Port Name.
  4. Select Port0/line0:7 for the Port/Line Direction.
  5. Toggle lines 0-3 to be input and lines 4-7 to be output.
  6. Press the Start button.
  7. Toggle the software switches for lines 0-3 to observe the software LEDs change for lines 4-7.


Figure 15. Digital I/O Wiring

Back to top | Collapse

Counter I/O

A counter can both input and output a digital signal deterministically. First, test the input by applying a 5 V to 0 V pulse train; the counter can detect a transition from high to low or low to high.
NOTE: If you do not have a single-pole double-throw (SPDT) switch, you can simply connect a wire into PFI3 and then connect and disconnect the other end of the wire to the +5 V terminal.

  1. Connect a 330 Ω resistor, SPDT switch in series to terminal DIO 3 as seen in Figure 16.
  2. Connect one pole of the SPDT switch to the DGND terminal and the other pole to the +5 V terminal.
  3. Navigate to the Counter I/O tab in the MAX test panels.
  4. Select DevX/ctr0 for the input channel, where X is the device number for your device.
  5. Select Edge Counting for the Mode.
  6. Select /DevX/PFI3 for the Edge Source.
  7. Press the Start button and toggle the SPDT switch to begin counting edges.

NOTE: If there is any noise on the signal, multiple edges may be counted for each transition of the SPDT switch.


Figure 16. Counter Input Wiring

Now test the output of the counter pulse train, which is a series of digital high and low pulses often used to trigger an event such as a sample clock for data acquisition. To output a pulse train, you must

  1. Connect a 330 Ω resistor and an LED in series between terminal DIO 3 and the +5 V terminal as seen in Figure 17.
  2. Navigate to the Counter I/O tab in the MAX test panels.
  3. Select DevX/ctr0 for the input channel, where X is the device number for your device.
  4. Select Pulse Train Generation for the Mode.
  5. /DevX/PFI3 is the only option for the Pulse Terminal.
  6. Enter 1 for the Frequency.
    1. This outputs a high and low pulse every 1 second or 1 Hz.
  7. Press the Start button to observe the LED blink at a rate of 1 Hz.

Figure 17. Counter Output Wiring

Back to top | Collapse

Module Quiz: Connecting Hardware

Take the short quiz below to evaluate your understanding of the concepts taught in the Connecting Hardware video and detailed explanation.

  1. __________ performs a basic functionality test of the device to see if it is communicating with the driver correctly.
    Test Panels
    Device Pinouts
    Reset Device
    Self-Test

     
  2. __________  clears all associated tasks and references to the DAQ device.
    Test Panels
    Device Pinouts
    Reset Device
    Self-Test

     
  3. __________  provide a low-level testing environment to verify that all input and output is working as expected.
    Test Panels
    Device Pinouts
    Reset Device
    Self-Test

     
  4. __________ show all of the pin and terminal assignments for your DAQ device.
    Test Panels
    Device Pinouts
    Reset Device
    Self-Test

     

Cumulative Exam:
LabVIEW and DAQ

Evaluate your understanding of LabVIEW and the basics of DAQ. This exam is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks. There are 26 multiple choice questions on the exam.

Take the exam


Cumulative Project:
LabVIEW and DAQ

Assess your working knowledge of building a complete system by acquiring, processing, and displaying data with LabVIEW and a DAQ device. This project is recommended after you complete all of the modules for LabVIEW Basic Concepts and LabVIEW Basic Tasks.

Start the project