LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the number of plots in Waveform Graph or how to iterate plots of Waveform Graph?

I am using Labview 2017

 

I want to make a vi which get a waveform graph refnum and set the color of the plots

 

I understand how to change the color of plot using the Active plot and Plot color property when I know the index of the plot

 

But I don`t know how to iterate all plots of the Waveform Graph when I don`t know the number of plots

 

Is there any way to get the number of plots or iterate over the plots

0 Kudos
Message 1 of 6
(1,871 Views)

How did the plots get into the graph in the first place? 

 

Somewhere in the program you created the graph.  In that part you put N sets of data into the graph.  Or put in a 2D array that you can get the dimensions of.  Determine that N and pass it to the part of the program where you are dealing with the colors either using a shift register, or a value property node or a local variable.

0 Kudos
Message 2 of 6
(1,844 Views)

This is the easiest way I know of to tell the number of plots in a waveform graph.

number_of_plots.png

Message 3 of 6
(1,839 Views)

you might take a look at this very fine example, especially look at the top-level.vi and inside the "Format Plot".vi

 

https://forums.ni.com/t5/Example-Code/LabVIEW-Box-Plots/ta-p/3506533

 

0 Kudos
Message 5 of 6
(755 Views)

Hi Des1gnR,

 


@Des1gnR wrote:

This is the easiest way!


Your way potentially creates very large data copies in memory just to determine an array size. And it depends on pre-defined datatypes of the graph…

Darrens example is very quick, without large data copies!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 6 of 6
(737 Views)