LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to make a graph inside a while loop maintain previous values

Solved!
Go to solution

In the beginning I was trying to use an the XY Graph Express VI to create a plot of points.  However, the graph is making a linear retrace between the first point of the new line, and the last point of the previous line.  It then creates the new line as desired.

 

I have tried using a for loop with to bundle a cluster to the graph, but the graph resets the plot on each iteration (as expected) and I cannot find a way to make it maintain the previous data.  I tried using shift registers but was unable to find out how to do this, and I have also tried bundling the cluster to an array, but cannot figure out how to make the cluster go to a 1D array of a cluster of 2 elements.

 

One option is having is finding a way to make it maintain previous data, but the preferred option is to make it create a new plot on each iteration so as to see the color change for each new plot.

0 Kudos
Message 1 of 3
(1,702 Views)
Solution
Accepted by topic author AVISNI

I'm taking a stab at this because I'm not exactly sure what you want. But I think it is what I have shown here. You need to use a shift register on your outter while loop as I have shown. Your image where you tried using a shift register shows a misunderstanding of shift registers and how they work though, so I would take a look at these tutorials.

 

0 Kudos
Message 2 of 3
(1,676 Views)

That's exactly what I wanted.  Could you explain why you don't need to use a for loop for the cluster as I was previously doing?  Also on the graph part - on each iteration of the while loop does it maintain the previous plots and continue to list them as their respective plots?  For example, the first plot is always considered plot 0, the second always plot 1, etc.  I tried to create an array indicator to follow what was happening but I can only expand it to a width of 3, and there are 7 plots.

 

Thank you for your help!

0 Kudos
Message 3 of 3
(1,657 Views)