LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Another XY multiplot issue

Solved!
Go to solution

I can create multiple plots if I do it all at once by using an array of clusters.
However, I want to create a second plot *after* the first plot is created and plotted. I cant seem to get this to work correctly.

 

Capture.PNG

 

On a side note... how do you make the images that you can drag from here onto a block diagram?

0 Kudos
Message 1 of 6
(3,456 Views)

WayneS1324 wrote:

On a side note... how do you make the images that you can drag from here onto a block diagram?


Edit -> Create Snippet.

aputman
------------------
Heads up! NI has moved LabVIEW to a mandatory SaaS subscription policy, along with a big price increase. Make your voice heard.
Message 2 of 6
(3,425 Views)
Solution
Accepted by topic author WayneS1324

Hi there,

 

You seem to have a pretty good understanding of XY plots, and you've stumbled upon one of the drawbacks - that you have to keep all graph data in memory. You have done it correctly so that the final graph takes in an array of clusters (clusters that contain an array of Xdata and array of Ydata), I'll call that a graph cluster. If you want to add a second plot on, you have to keep your first graph cluster handy, then build into an array with your second graph cluster. 

 

This shouldn't be too hard, the trickier part is when you are updating your plots with a couple points at a time, you have to do a bunch of in place indexing and bundling to get the point added to the plot.

Message 3 of 6
(3,424 Views)

You have to save your plot history in shift registers with XY charts.

 

This example plots a power supply output voltage and efficiency from no load to full load for three different input voltages, making 6 total plots in three consecutive runs.

xe.PNGThe shift register on the For-Loop saves each Volts and Efficiency pair of plots so the next run pairs are plotted on the same graph.

 

========================
=== Engineer Ambiguously ===
========================
Message 4 of 6
(3,412 Views)

Repeating operations (e.g. adding a plot) should be done in a loop. Just built the array of plots in a shift register. Here is a very simple example that demonstrates the technique. (here we add three plots 1 second apart, each incremented by a constant)

 

Of course in your case the x-values are spaced equally. If this is always the case, you can use a plain waveform-graph and simply define x0 and dx for the x-axis. This makes the data structures singificantly simpler. No need for an xy graph.

 

Message 5 of 6
(3,382 Views)

Thanks for all of the answers. I think gregoryj answered my question.

0 Kudos
Message 6 of 6
(3,369 Views)