LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

clearing history on an xy graph

Solved!
Go to solution

I've been having lots of trouble trying to clear the history for an xy graph.  Currently I have only managed to clear the history temporarily, but the data comes back afterwards.

 

Any thoughts?

0 Kudos
Message 1 of 7
(2,137 Views)

I have not gotten LabVIEW 2019 installed yet.  Most people don't yet.  So I recommend you down-convert (File->Save For Previous) so that more people can open your VI.  I typically use 2016 at the moment.

 

XY graphs do not store history.  You must be storing the history somewhere, likely in a shift register or feedback node.  That is where you need to clear the array.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 2 of 7
(2,114 Views)

OK, I'm using a shift register how do I clear this?

 

Here's my code (version 16).

0 Kudos
Message 3 of 7
(2,109 Views)

Get rid of the code currently in the True case.

 

Wire the orange wires through the case structure in the False case.

Create an empty array constant to wire to the tunnels in the True case.

 

Don't use a local variable of Cluster into the Bundle by Name node.  Use a constant.  Or just use a regular bundle.

Your data types should match, you are working with orange floating point data, but your cluster and graph are based on blue integer data.

 

When putting a value at the end of the array, use Build Array rather than "Insert into Array".

 

I don't understand what you are doing with the rotate array functions.  Every iteration you are putting an element at the end, then rotating it to the front of the Array.  You might as well just use Build Array to put it at the beginning of the array if that is what you want.

0 Kudos
Message 4 of 7
(2,097 Views)

An xy graph does not retain any history. You need to clear the data in the shift register instead. No property node needed. You should also initialize the shift registers. You can simplify datastructures using a complex array. Use built array instead of insert into array. Rotate array seems pointless.

0 Kudos
Message 5 of 7
(2,093 Views)

Thanks for all the tips, that's working now.

0 Kudos
Message 6 of 7
(2,087 Views)
Solution
Accepted by topic author lafox24

Here's a simple example of what I meant. Arguably significantly less code ;):

 

clearXY.png

0 Kudos
Message 7 of 7
(2,084 Views)