06-28-2019 05:37 AM
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?
Solved! Go to Solution.
06-28-2019 10:18 AM
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.
06-28-2019 10:34 AM
OK, I'm using a shift register how do I clear this?
Here's my code (version 16).
06-28-2019 12:09 PM - edited 06-28-2019 12:14 PM
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.
06-28-2019 12:13 PM - edited 06-28-2019 12:15 PM
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.
06-28-2019 12:16 PM
Thanks for all the tips, that's working now.
06-28-2019 12:28 PM