Example Code

Get Multiple Plot Names and Colors 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

1. Overview:

This example gets the names and color plots from multiple plots

 

2. Description: 

Simple example that shows how to use property nodes with multiple plots.  The trick is to set the Active Plot before any properties are read from or written to.  In order to have multiple plots for one graph or chart, you must have an array of data.  Each element of the array is a seperate plot, so in order to determine how many plots are in a graph all you need to find out are how many elements there are in the array.  In LabVIEW, the For Loop has a great feature of auto indexing arrays.  To get names for all the plots in the graph or chart, simply wire the data into a For Loop and it will only iterate for as many elements (plots) there are in the array.  This will ensure you used the correct iteration number.

 

3. Requirements

  • LabVIEW 2012 (or compatible)

4. Steps to Implement or Execute Code

  1. Set Number of graphs
  2. Run "Get Waveform Names LabVIEW 2012 NI Verified.vi"
  3. Once finished, Names of the plots and their colors will be displayed in Names and Colors indicators respectively

5. Additional Information or References 

VI Block Diagram

Block Diagram.JPG

 

 

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

National Instruments
Applications Engineer

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