Example Code

Merge and Display Two Signals Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This VI shows how to merge two signals together and then display it on a graph.

 

Description

There are a couple of ways of doing this but this is one (another would be to use the Merge Signals.vi). We create two signals using the Simulate Signal Express VI for a Sine Wave and a Random Number generator for the other signal. We use Initialize Array, Replace Array Subset, and Shift Registers to combine the Random Number data into a 1D Array. After the While Loop stops when the set number of data points are recieved, we combine the two 1D Array into a 2D array using Build Array and then pass that into a Waveform Graph. When you run the VI you will notice that both signals will be displayed on the graph. Try this out but remember that there are a bunch of different ways to accomplish anything in LabVIEW.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible)

Steps to Implement or Execute Code

  1.  Enter a "Number of samples"
  2.  Run the VI.

 

Additional Information or Resources

 

snip2012.png



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

 

 

 

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