Install LabVIEW NXG
LabVIEW NXG simplifies hardware integration so that you can rapidly acquire and visualize data from virtually any I/O device, whether from NI or a third party. Combined with a graphical programming syntax that reduces programming time, LabVIEW NXG streamlines complex system design with tools and IP at the forefront of today’s technology.
Figure 1. LabVIEW NXG provides an intuitive programming environment for automating measurements from both NI and third party instruments.
Install Tektronix 4000 Series Instrument Driver
NI develops and supports thousands of instrument drivers for third party instruments to help engineers and scientists automate measurements. You can find these instrument drivers in the Instrument Driver Network. Download Tektronix 4000 Series Instrument Driver
Figure 2. The NI Instrument Driver Network houses thousands of instrument drivers for automating third party instruments.
Connect and Configure Tektronix 4000 Series Oscilloscope
The Tektronix MDO MSO DPO 2000 3000 4000 Series Instruments support USB and Ethernet communication. You need either a USB cable (Type A to Type B) or an Ethernet cable connected to a network to connect the Tektronix oscilloscope to your computer.
Figure 3. The Tektronix 4000 Series have USB and Ethernet ports on the back.
Configure Your System With SystemDesigner
SystemDesigner, a graphical tool for discovering, documenting, and configuring your test system, is integrated directly into every LabVIEW NXG project. This tool automatically detects USB hardware connected to your host PC and adds a graphical representation to the window. If you select the device, you can see additional properties, such as the device name, and any software or drivers that are installed on your system to support this device. You can also troubleshoot and make manual function calls to your instrument to ensure that it is working as expected before moving into automation.
Figure 4. SystemDesigner provides an intuitive, graphical representation of all hardware and software associated with your test and measurement system.
- Locate the communication ports on the back of the Tektronix Instrument.
- Locate the communication ports on your host PC.
- If you are using a laptop, you likely have multiple USB ports and one Ethernet port.
- If you are using a PC or an industrial PC, you likely have multiple USB ports but need to connect the computer to your local network. Tektronix oscilloscopes have network capability to allow the computer to connect over this network. If you are not connected to a local network, feel free to plug in the Tektronix Oscilloscope to the computer directly via Ethernet or USB port.
- Using the right cable for your communication port (USB/Ethernet), connect your Tektronix oscilloscope instrument to your host PC.
- Power on your Tektronix oscilloscope Instrument and allow time for initialization.
- Launch LabVIEW NXG.
- On the LabVIEW NXG Welcome screen, select Use Your Hardware
- The SystemDesigner opens with a high level view of your system. The procedure for detecting your device depends on the bus you are using.
USB: USB devices are automatically detected in NI Measurement & Automation Explorer (MAX) and SystemDesigner
- Select your USB interface in SystemDesigner. From the Configuration Pane on the right, scroll down to the Installed drivers section to find and install the NI-VISA driver. Then return to the Configuration Pane and go to the Advanced section to select Launch NI MAX. Within MAX, select the USB interface and click Scan for Instruments. The instrument is then detected.
Ethernet: Ethernet network devices have to be added using the IP address the device is given.
- Select your PC in SystemDesigner. From the Configuration Pane on the left, scroll down to the Advanced section to select Launch NI MAX. Within MAX expand My System»Devices and Interfaces»Network Devices to view instruments that are connected to the same subnet as your PC. To add an instrument that is not on the local subnet, right-click Network Devices, select Create new VISA TCP/IP Resource, and follow the instructions in the wizard.
- The instrument is now configured.
Automate Measurements With LabVIEW NXG
After performing manual/interactive measurements to achieve the results that you need to test your device, the next step is to perform automated measurements to reduce measurement time and increase repeatability.
Application Programming Interface (API)
To help accelerate software development, all instrument drivers follow a consistent programming flow of: Open, Configure, Read/Write, Close. All drivers for NI hardware (for example, PXI modular instrumentat) also follow this paradigm because it is a best practice when programming in LabVIEW NXG.
Figure 5. The Tektronix instrument driver for LabVIEW NXG uses an intuitive and consistent programming pattern of Open, Configure, Read/Write, and Close.
Start From an Example Program
The Tektronix 4000 series LabVIEW Plug and Play driver includes a LabVIEW NXG project that features several example VIs to help you get started. Open these examples using the following procedure.
- Open LabVIEW NXG.
- Open the Learning tab by selecting the Learn to Program tile in the Welcome screen or selecting the Learning tab from the top right.
- Select Examples»Hardware Input and Output»Instrument Drivers to locate all of the examples included with installed LabVIEW Plug and Play instrument drivers.
- Click the Tektronix project to create a new copy.
. LabVIEW NXG instrument driver examples are included with every LabVIEW Plug and Play instrument driver.
- The Tektronix DPO MSO 2000 4000 Series.lvproj contains several example VIs that require no extra programming to run. Double click a VI in the Project Files tab within the Navigation Pane to open it.
. The Tektronix 4000 series LabVIEW Plug and Play driver includes multiple example VIs to get started.
- To run a VI, first select the corresponding VISA Resource Name and appropriate settings on the Panel. Then click the green Run arrow at the top left of the VI.
. Select the corresponding VISA Resource Name and appropriate settings on the Panel before running the example VI.
Customize Measurement Settings
All LabVIEW Plug and Play examples are completely extensible and customizable to fit your measurement needs. For example, start with the Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi included in the Tektronix DPO MSO 2000 4000 Series example project. Then add the ability to control the range of the measurement being taken.
- Open the Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi from the Tektronix DPO MSO 2000 4000 Series.lvproject.
- Click Diagram on the View Selector to view the VI's Diagram.
- Use the following procedure to add the ability to control the range for your measurements
- Create a Range double control by right clicking the orange double constant that is set to 10 and selecting Change to control.
- Reposition controls on the Diagram as needed. You can easily sort the Diagram by clicking and dragging to help with reading and understanding program flow.
- Go back to the Panel by choosing Panel on the View Selector. Place the new control on the Panel by selecting the Unplaced items box and placing it on the Panel. Note that you can place multiple items simultaneously from the Unplaced items box by holding Ctrl while selecting the items in the box. You can then place items one by one on the Panel.
. Right click the Vertical Range constant and choose Change to control
. You can also add Controls, Constants and Indicators by right clicking terminals on VI's on the Diagram to add functionality or test parameters.
- You can add and edit any controls, constants and indicators in the Item view on the right side of the LabVIEW NXG environment. This includes changing data types, adding documentation, and changing the name of the item.
. Place controls onto the Panel using the unplaced items box. Keeping controls on the left of the Panel and indicators on the right helps user readability.
Add Signal Processing
LabVIEW includes hundreds of built-in functions we can take advantage of to implement things like Signal Processing and Analysis. Follow the procedure below to add a Peak Amplitude Analysis to the "Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi".
- Open the Diagram of the VI by selecting Diagram in the View Selector.
- Focus on the section containing the Read (Multiple Waveforms) Node. Drop down the Peak Amplitude Node next to the Read (Multiple Waveforms) Node. You can find the Peak Amplitude analysis gvi can be found by right clicking on the Diagram white space, going to Analysis»Signal Processing» Measurement and selecting the top left node that is called Amplitude Measurements. Drop this on the Diagram and recreate the picture shown in Figure 12.
- Use this opportunity to explore the other signal processing categories that are available for your test.
. This is the Peak Amplitude measurement node that you are adding.
- The Peak Amplitude Node reads in the waveform signal that the Read (Multiple Waveforms) Node creates and analyzes the data your Tektronix device collects.
- Connect the Waveform Graph Wire to the Peak Amplitude VI by left clicking the top left terminal of the Peak Amplitude VI and then clicking the Waveform Graph Wire.
- Delete the Yellow Error Wire. Then left click the bottom left Error Terminal of the Peak Amplitude VI and connect it to the output Error Terminal of the Read Waveform VI to the left of it. Next, connect the Error Out Terminal to the Error In Terminal of the Close VI.
- Right click each of the Double Output Terminal on the Peak Amplitude VI and select Create Indicator to add outputs for the Peak Amplitude VIs data.
. Your example with the added Peak Amplitude VI should look like this.
- Switch to the Panel of the VI by selecting Panel in the View Selector.
- Drop down all of the indicators and controls from the Unplaced Items box onto the Panel.
- Rename the x and y axis of the histogram graph to correspond with the values you are measuring by clicking on the axis labels and replacing the text or by clicking on the axis labels and changing the Name text at the top of the Configuration Pane on the right.
. The Panel should look like this. You have added a new control to decide the range of your test and you incorporated signal processing to determine the amplitudes of your signal. Customize the Panel of the VI to fit your applications needs.
- Save the VI by selecting File then Save Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi.
Add File I/O
Log the results of each test by adding file I/O to your application. LabVIEW NXG can log to TDMS, text, binary, and CSV files. Follow these steps to add logging to a CSV file to the Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi.
- Open the Diagram of the VI by selecting Diagram in the View Selector.
- Create space between the Read (Multiple Waveforms) Node and the Close Node. Delete the yellow Error wire between the two.
- Place a Build Array Node from the Data Types » Array palette where you just created space. Expand the Build Array Node to add an extra terminal by dragging down with the mouse after seeing the expansion cursor appear on the bottom of the node.
- On the Build Array Node, connect the first terminal Element 1 to the maximum peak indicator wire, Element 2 to the minimum peak indicator wire, and Element 3 to the peak to peak indicator wire.
. Expand the Build Array Node to include multiple elements.
- Next to the Build Array Node, drop down a Write Delimited Spreadsheet Node from the Storage palette. Connect the appended array terminal on the Build Array Node to the 2D data terminal on the Write Delimited Spreadsheet Node.
- Create a constant for the delimiter (/t) terminal on the Write Delimited Spreadsheet Node. Put “,” into the constant to make the file comma delimited. Then create an indicator for the new file terminal on the top right of the Write Delimiter Spreadsheet Node. Rename this indicator "New File Path".
. Write to CSV files using the Write Delimited Spreadsheet Node.
- Drop down to the left of the Write Delimited Spreadsheet Node a Get System Directory, Build Path, and Replace File Extension nodes found in the Storage > Path palette in that order from right to left.
- Wire the path with new extension terminal on the top right of the Replace File Extension Node to the file terminal on the top left of the Write Delimited Spreadsheet Node.
- On the Write Delimited Spreadsheet Node create a constant for the top format terminal. View how to create a format specifier by selecting the Write Delimited Spreadsheet Node and Online manual in the Configuration Pane on the right.
- Wire the appended path terminal on the top right of the Build Path Node to the path terminal on the top left of the Write Delimited Spreadsheet Node.
- Create a constant for the new extension terminal on the left side of the Replace File Extension Node. Place ".csv" into the constant to ensure the file is saved with the .csv extension.
- Wire the system directory terminal on the top right of the Get System Directory Node to the base path terminal on the top left of the Build Path Node.
- Create a control for the name or relative path terminal on the left side of the Build Path Node. Rename the control "File Name".
- Create a constant for the type terminal on the top left side of the Get System Directory Node. Select "Default Data Directory" to save the file to the default LabVIEW directory.
. With the File Name control, you can name the .csv file being created and new file.
- Wire the error out terminal on the Enable Output Node to the error in terminal on the Write Delimited Spreadsheet Node. Then wire the error out terminal of the Write Delimited Spreadsheet Node to the error in terminal of the Close Node.
- Open the Panel by selecting Panel in the View Selector. Place the unplaced controls and indicators on the Panel.
. With the File Name control, you can name the new .csv file.
- Save the VI by selecting File and then Save Tektronix DPO MSO 2000 4000 Series Acquire Multiple Waveform Example.gvi.
- Before you run the gvi type in the desired file name, save the file in the default LabVIEW directory and you can see the new file path in the New File Path indicator.
Conduct Sequencing and Database Reporting With TestStand Test Management Software
TestStand is a ready-to-run test management software that is designed to help you develop, execute, and deploy automated test and validation systems faster. While LabVIEW NXG is ideal for developing individual code modules, you can use TestStand to call multiple code modules you have developed in LabVIEW NXG, along with other programming languages, to build a sequence. Finally, you can specify execution flow, reporting, database logging, and connectivity to other enterprise systems for your test system.
Figure 18. Test management software, for example TestStand, is at the top of a properly architected test system.
Consider PXI Source Measure Units
PXI Source Measure Units and oscilloscopes are flexible, software‐defined instruments that are versatile enough for both time‐ and frequency‐domain measurements and deliver the benefits of the PXI platform. They feature up to eight channels that can sample at speeds up to 12.5 GS/s with 5 GHz of analog bandwidth. Using the PXI platform, you can synchronize multiple oscilloscopes with other instruments at picosecond‐level accuracy for high‐channel‐count and mixed‐signal applications. These instruments also feature numerous triggering modes, deep onboard memory, and a driver software API that includes data streaming and analysis functions.
Figure 19. The PXI-5922 oscilloscope delivers a smarter way to tackle difficult applications in industries ranging from consumer electronics and semiconductor test to aerospace and defense test.