LabVIEW Evaluation Series: Connect to PXI Hardware

Publish Date: Dec 20, 2019 | 2 Ratings | 3.00 out of 5 | Print | Submit your review


NI LabVIEW software gives you the ability to connect to any measurement hardware to acquire or generate a variety of signal types. In this guide, see an example of how to acquire an analog signal using modular oscilloscope hardware and the NI-SCOPE instrument driver.

Table of Contents

  1. Before You Begin: Download Sample Code and the NI-SCOPE Driver
  2. Create a Simulated Device
  3. Acquire a Signal Using the NI-SCOPE Express VI
  4. Acquire a Signal Using the NI-SCOPE API
  5. Take the Next Step

1. Before You Begin: Download Sample Code and the NI-SCOPE Driver

There is sample code that accompanies this guide. To the right of the page in the Downloads section you are able to download it before you start. You must also install NI-SCOPE, a free device instrument driver for National Instruments oscilloscope hardware, to follow along with this guide.


Back to Top

2. Create a Simulated Device

If you don’t have NI oscilloscope hardware yet, you can still use this guide by creating a simulated device. To create a simulated device, open Measurement & Automation Explorer. Right-click on Devices and Interfaces and select Create New… » Simulated NI-DAQmx Device or Modular Instrument and click Finish. Select High-Speed Digitizers » NI PXIe-5122 from the Create Simulated NI-DAQmx Device menu and click OK. The NI PXIe-5122 is the simulated device that is used in the sample code.


Figure 1. This is an example of how a simulated device appears within Measurement & Automation Explorer.


Back to Top

3. Acquire a Signal Using the NI-SCOPE Express VI

1. Open Acquire Analog Inputs Using the NI-SCOPE from the Connect to NI-SCOPE Hardware.lvproj. This VI includes a prebuilt user interface and analysis code. In this guide, you will add the code required to acquire a signal.


Figure 2. This shows the starting point within LabVIEW for this exercise.


2. The NI-SCOPE provides a step-by-step guide for configuring, testing, and programming measurement tasks. Start by adding an NI-SCOPE Express VI to your diagram. If you are currently not on the block diagram, select Window » Show Block Diagram. To add the Express VI, right-click on your block diagram and navigate to Measurement I/O » NI-SCOPE » Express Block, and then click and place the NI-SCOPE Express icon onto your block diagram.


Figure 3. Navigating to the NI-SCOPE Express VI


3. When you place the NI-SCOPE on your block diagram, the measurement configuration dialog box appears to help you set up your task. The first step is to select Configuration for your measurement. There are several options for an analog input acquisition. In this guide, you step through a simple scope capture, but if you’re using your own device and probe, you can select the appropriate measurement type and channel for your system. Configure your measurement by selecting the Configuration tab, which has a variety of settings to accommodate your NI-SCOPE application requirements.


Figure 4. Select scope parameters within the Express VI.


4. The next step is to select your channels. If you are using your own NI data acquisition hardware, you see it listed by a device name. Dev1 is the default for a system with only one NI-SCOPE device in the system. If you’re using the simulated device from Part 1 of this guide, you see it listed under the name Device pulldown. Select the appropriate analog input channel from your physical device (if available), or select Channel 0 if you’re using the simulated device.


5. After you have selected your channel(s), preview your data by clicking the Run button at the top of the window.


Figure 5. Configuring and Testing Acquisition Parameters


6. When you’ve finished configuring your NI-SCOPE parameters, click OK. The NI-SCOPE Express VI automatically generates the code required to implement your acquisition. To complete the system, wire the data output of your NI-SCOPE Express VI to the inputs of the analysis VI and the “Scope Capture” graph indicator as shown below.


Figure 6. Completed Block Diagram


7. Switch to the front panel by selecting Window » Show Front Panel and run the program. You can see your raw signal data, the maxima, and mean of the acquired signal.


Figure 7. Visualize raw data and analyzed.


As a reference, you can find the finished VI in the Solutions folder in the Connect to NI-SCOPE Hardware.lvproj.


Back to Top

4. Acquire a Signal Using the NI-SCOPE API

The NI-SCOPE Express VI provides a quick and easy way to acquire data with minimal programming; however, more advanced users may need added flexibility and lower level control than what the NI-SCOPE Express VI offers. The NI-SCOPE driver features a comprehensive API of basic and advanced functions for control over such parameters as timing, synchronization, data manipulation, and execution control.


Figure 8. The NI-SCOPE API provides added programming flexibility.


Open Acquire Analog Inputs using the NI-SCOPE for an example of a more advanced application. Here you can configure channels as well as recording options, triggering options, and advanced timing settings.


Back to Top

5. Take the Next Step

Explore other examples through the NI Example Finder at Help » Find Examples…

Figure 9. Explore a variety of example programs to quickly start taking a measurement.


View additional PXI resources:

Back to Top

Bookmark & Share



Rate this document

Answered Your Question?
Yes No