Example Code

Highlight Sections of a Waveform Graph

Code and Documents

Attachment

Overview

This example VI uses built in LabVIEW functionality to generate a waveform and applies a background to the graph, to programmatically highlight the fundermental frequency of the waveform.

 

Description

This example VI uses built in LabVIEW functionality to generate a waveform (of selectable frequency, amplitude and shape) before applying an FFT to push the waveform into the frequency domain. But the main point of interest within the code is that it uses a simple technique apply a background to the graph, to programmatically highlight the fundamental frequency of the waveform.

As well as the waveform controls, the front panel also allows you to configure how you highlight the fundamental frequency on the wave form graph.

This example is not intended for direct reuse - at the moment, the code relies on the Graph being a very specific size in pixels. Although this can be improved upon using property nodes, in its current guise, the example is simply intended to illustrate a novel technique for improving your GUIs.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Open the VI " Draw Rectangle on Graph.vi";
  2. Run the program;
  3. Try to change the waveform with the waveform control.

 

Additional Information or References
VI Block Diagram

BD.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.