Example Code

Graph Interpolation - when x-axis values are not equal - 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

Download All

Introduction

This example takes two channels of data with different x axis values and subtracts the data to get the difference displayed on a waveform.

 

Description

This VI takes two channels of data, here simulated using the random number generator and combines them into a customized waveform graph. The maximum and minimum x axis values are extracted using the array max and min.vi, these values are passed to the ramp pattern.vi . The output of this VI is used in the interpolate 1d.vi along with the original acquired data to output the required data to the build waveform function, which then outputs a waveform. To minus 2 plots from each other the dt values (x axis) normally need to be matching, in this case the align waveforms (single shot).vi takes the data and allows for the subtraction to take place. This method allows for the subtraction without causing an unexpected data output after the subtraction.

 

Requirements

  • LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Input number of samples per channel of data
  2.  Run the VI
  3. The generated channel data is displayed graphically for the 2 channels
  4. The interpolated data is displayed on a separate waveform.

 

Additional Information or References
VI Snippet

Graph Interpolation 2012 NIVerified.png

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

 

Stephanie L
Applications Engineer
National Instruments UK and Ireland

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