Example Code

Waveform to XY Array

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

Coding that exemplifies how to create a subVI that generates an XY pair out from the time stamp and values of a waveform.

 

Description

This VI allows the user to output a waveform as XY pairs where each Y is associated with a timestamp. It also allows the waveform to be output as an array of doubles where the timestamp is replaced with an initial start value which can be set by the user. Each value of Y has an associated X value based on that initial value and increments with the change in t or dt which will be taken from the waveform or set by the user. The user is also able to select whether the first column is X or Y.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code
1. Configure the t0 and dt if desired.
2. Select the order for the XY pair.
3. If you do not want to use it as a SubVI, we can use a simulated signal and wire it instead of the "Waveform In" control.
4. Run the SubVI.

 

Additional Information or References

Snippet.png

Vince M
Applications Engineer

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

Comments
JeffL
NI Employee (retired)
on

While this does give the user a little more choice, there is the Waveform to XY Pairs.vi in LabVIEW.

Jeff | LabVIEW Software Engineer