Example Code

Interpolate LVM Data Using Ramp Function in 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

Description

1. Overview

This program reads all channels and all samples from a file, created with Write LabVIEW Measurement File.

 

2. Description
The example starts by generating a set of values to write into an example LVM, so the user can understand the way the information is ordered.
If the Read LabVIEW Measurement File is not within a while loop, only one segment of the original size or a segment of a specified size will be retrieved. That is why we need to put this Express VI inside of a while loop and use the End of File boolean to control the While loop.
Here we pull the dynamic data out, convert it to a 2D array of scalars where columns are channels. With each iteration of the While loop we extract a segment of the original sampling size. For example, if the original sampling size was 100 samples, then we are reading 100 samples with every iteration.
We use shift registers and Build Array to build an array that contains all samples from all channels in the file.
Outside of the While loop we can extract each channel from the 2D array with the help of Index Array, where the index corresponds to the channel number.

 

3. Requirements

  • NI LabVIEW Professional Development System 2012 (or compatible).

 

4. Steps to Implement or Execute Code

  1. Download and open the project "Interpolate LVM Data Using Ramp Function LabVIEW 2012 NIVerified"
  2. Open the VI: "Ramp Interpolation of LVM Data LabVIEW 2012 NIVerified.vi"
  3. Set the Ramp Settings (for the example, values of 1 to 100 are used with increments of 0.001).
  4. Run the VI.
  5. Review the outputs: XY Graph, Transposed Array, Output waveform and File Name Out.

 

5. Additional Information or References

Interpolate LVM Data Using Ramp Function Screenshot.PNG

 

 

**The code for this example has been edited to meet the new Community Example Style Guidelines.**

David
Applications Engineer
National Instruments


Digital Multimeters

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