1. Connecting HardwareBefore 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 ExplanationDownload the Detailed Explanation PDF Installing Hardware DriversBefore 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 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 SoftwareKnowledge 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 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 HardwareBy 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. Test PanelsIt 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 Additional ResourcesStep-by-Step ProcedureDownload 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.
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 InputBy 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:
Note: This voltage is dependent on the power of the USB hub, so it may not read exactly 5 V, but it holds steady. Analog OutputTesting the analog output requires looping the analog output back to the analog input to verify the voltage. Start by configuring the physical device.
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. Digital I/OTo 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.
Counter I/OA 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 there is any noise on the signal, multiple edges may be counted for each transition of the SPDT switch. 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
Figure 17. Counter Output Wiring
Module Quiz: Connecting HardwareTake the short quiz below to evaluate your understanding of the concepts taught in the Connecting Hardware video and detailed explanation.
Cumulative Exam:
|
















