From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Automatically labeling Plots in Mixed Graphs

Hello.

 

I would like to name my sine plots one by one after the words in the array.

Graphs Plots + Names.png

 

When I do so, I get an error.

 

Error_Graphs Plots + Names.png

 

 

Can somebody help me?

Thank you.

 

0 Kudos
Message 1 of 5
(3,074 Views)

Your array of plot names has 9 elements in it.

 

On the right, all three of those for loops run 9 times, because they are governed by the size of the plot-name array.

 

The problem is that not all of your graphs have 9 plots, and the error occurs when you try to make a nonexistant plot active.

 

For example, one of your graphs only has 3 plots (so there are plots numbered 0, 1 and 2).  When you try to wire a 3 into the active plot property, you'll get an error.

0 Kudos
Message 2 of 5
(3,060 Views)

You're looping through each Active Plot to a number higher than the number of plots. You have the plots labeled 3, 6, and 9, so each of those I assume only has 3, 6, and 9 plots respectively.

 

Edit: WiseGuy beat me to it, but to clarify you probably want to do something like this:

Example_VI_BD.png

Cheers


--------,       Unofficial Forum Rules and Guidelines                                           ,--------

          '---   >The shortest distance between two nodes is a straight wire>   ---'


Message 3 of 5
(3,058 Views)

Thank you every one for the quick answers but, actually, my problem is more difficult.

In my exemple, I used a main loop doing the same task 2 times and a second big loop repeating itself 3 times. And 3 little parallel waveform loops.

In reality, one little waveform loop represents a curve (a plot) and I have to plot them all in a graph, one graph per big loop and same with the main loop. Nothing stays the same from one iteration to another (in main or big loop). My graphs are all independent (e.g. from 3 to 9 plots each loop). This results in 3 different arrays of graphs that I bundle ultimately.

But the common thing is the order the plots get a name in every graph: 1st is "A", 2nd "B", 3rd "C", 4th "Do", 5th "Re", 6th "Mi", 7th "1", 8th "2" and 9th "3".

This might look difficult to understand, so I adapted the example to make it more accurate and relevant to my problem.

Basically, I muddlep up all the wires defining the number of plots per (little) loop in order to shuffle the result in the graphs.

Graphs Plots + Names_part 2.png

0 Kudos
Message 4 of 5
(2,973 Views)

Hello again.

I have managed to simplify this problem for the understanding of everybody: one main loop with only 2 iterations (2 graphs) with 3 or 9 plots (3 or 9 times one little loop) each.

Plot names_pt 3.png

I might have a solution but I am afraid it would not be "automatic"...
Any help is appreciated.
Thank you all.

0 Kudos
Message 5 of 5
(2,935 Views)