Waveform Generation with CompactRIO
Overview
Engineers who develop and test automotive electronics, avionics, communication systems and other similar systems often need to measure and simulate components that generate analog waveforms. The LabVIEW FPGA Module is a tool that you can use to create custom waveform generation hardware for test and measurement systems. Unlike dedicated waveform generators, Reconfigurable I/O (RIO) hardware that is defined by LabVIEW FPGA allows you to customize the waveform generation and behavior for your application. While the other RIO devices are capable of generating waveforms, we will focus this tutorial on using CompactRIO which is a customizable, rugged, and portable hardware solution for waveform generation. This tutorial describes how to generate four types of waveforms, linear, non-linear, periodic, and arbitrary using the LabVIEW FPGA Module and CompactRIO hardware. Additionally, it discusses the use of good programming practices to create scalable, maintainable, and robust FPGA code. The accompanying example programs are great starting points to develop a customized waveform generator for your specific application.
Table of Contents
Linear Waveform Generation
A linear waveform is a waveform that can be defined by an equation with a linear slope. Linear waveforms can be described by two points, a start and end point, and any points located on the line connecting these two points. These waveforms can be output on a point-by-point basis with CompactRIO analog output modules. A visual representation of a linear waveform can be seen in the following graph.
We are able to generate linear waveforms with the LabVIEW FPGA Module and CompactRIO using many different methods. The tutorials and example programs linked below address many key aspects of linear waveform generation including: (1)storing waveforms in arrays and (2)utilizing linear interpolation to minimize the number of waveform points that must be stored on the FPGA. Also, an algorithm is discussed in the tutorial that allows the user to define an output waveform by only the start point, the end points and the number of desired output values between these two values.
- Tutorial: Linear Waveform Generation with CompactRIO and LabVIEW FPGA
Example: Finite Waveform Generation with Array Storage on CompactRIO
Example: Waveform Generation with Linear Interpolation on CompactRIO
Example: Piecewise-linear Waveform Generation with Linear Interpolation on CompactRIO
Non-Linear Waveform Generation

Non-linear waveform generation encompasses many different waveforms. This tutorial addresses common methods that can be used to output non-linear waveforms. Array storage is discussed as well as utilizing the FPGA memory for waveform storage. The tutorial focuses on using the Look-Up Table 1D VI in the LabVIEW FPGA Module to store and index through non-linear waveforms on the FPGA. It also includes a discussion of simulating thermocouples on the FPGA. Non-linear waveforms include a wide range of waveforms including periodic waveforms and arbitrary waveforms. There are special features in the LabVIEW FPGA Module that allow the user to perform unique operations on these two types of non-linear waveforms. Each of these waveforms is addressed in separate tutorials to accent some of the features available in the LabVIEW FPGA Module that are available for waveform generation.
- Tutorial: Non-linear Waveform Generation with CompactRIO and LabVIEW FPGA
Example: Finite Waveform Generation with Array Storage on CompactRIO
Example: Finite Waveform Generation with a Look-Up Table on CompactRIO
Example: Continuous Waveform Generation with a Look-Up Table on CompactRIO
Example: Thermocouple Simulation with CompactRIO
Periodic Waveform Generation
We are able to generate periodic waveforms with CompactRIO hardware and the LabVIEW FPGA Module using several different methods. The first method involves the use of the LabVIEW FPGA Sine Generator Express VI. By using this Express VI, we can quickly develop an FPGA program, download it to the target hardware, and have a fully functional sinusoidal waveform generator with frequency, amplitude, and offset controls. The second method takes advantage of advanced functions of the LabVIEW FPGA Module, reading and writing to FPGA memory. This advanced functionality allows us to load arbitrarily complex cycles of a periodic waveform to the FPGA memory. The tutorial linked below outlines these two methods of periodic waveform generation in detail. The example programs are a demonstration of a sinusoidal waveform generator that uses the Sine Generator Express VI and a periodic waveform generator that uses the FPGA onboard memory.
- Tutorial: Periodic Waveform Generation with RIO-Enables Hardware and LabVIEW FPGA
Example: Sinusoidal Waveform Generation with LabVIEW FPGA (Sine Generator Express VI)
Example: Periodic Waveform Generation with LabVIEW FPGA (Memory Read & Write)
Arbitrary Waveform Generation
By using arbitrary waveforms, engineers and scientists are able to generate unique waveform signals that are specific to their applications. Most often, arbitrary waveforms are designed to simulate “real world” signals. It is possible to integrate glitches, drift, noise and other anomalies on an arbitrary waveform that a device under test will encounter when it leaves the lab or manufacturing floor. We are able to generate arbitrary waveforms with CompactRIO hardware by taking advantage of an advanced functionality of the LabVIEW FPGA module, reading and writing to FPGA memory. This advanced functionality allows us to load large, unique waveforms to the FGPA memory and output the waveform according to a hardware-timed update clock. The tutorial and example program linked below outline the creation of an arbitrary waveform generator that uses the FPGA onboard memory.
- Tutorial: Arbitrary Waveform Generation with RIO-Enables Hardware and LabVIEW FPGA
Example: Arbitrary Waveform Generation with LabVIEW FPGA (Memory Read & Write)
Reader Comments | Submit a comment »
Legal
This tutorial (this "tutorial") was developed by National Instruments ("NI"). Although technical support of this tutorial may be made available by National Instruments, the content in this tutorial may not be completely tested and verified, and NI does not guarantee its quality in any way or that NI will continue to support this content with each new revision of related products and drivers. THIS TUTORIAL IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND AND SUBJECT TO CERTAIN RESTRICTIONS AS MORE SPECIFICALLY SET FORTH IN NI.COM'S TERMS OF USE (http://ni.com/legal/termsofuse/unitedstates/us/).


