LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Building multiple plots on a single XY graph

Solved!
Go to solution

I am building a VI where the user can import a csv file (waveform) which is then displayed on to an xy graph.

 

I've used a VI from here to import the csv and bundled output the array for a XY graph plot. so far so good.

 

What I want to achieve now is keeping the previous plot loaded on the graph when/if another csv file is imported. At the moment whenever I do that it overwrites the current plot (ie I do not get plots 0, 1..., only plot 0).

 

the final part is that if the added plot is bigger/smaller than the current plot x range, then the value of that plot is set to its last y value for the undefined range

 

any pointers as how I may achieve these objectives?

0 Kudos
Message 1 of 6
(3,358 Views)
Solution
Accepted by topic author sherzaad

Use multiplot XY with array with 1 or more elements.
you can add/remove array elements any time

xy.png

Message 2 of 6
(3,347 Views)

Look at the shipped example on how to display plots in an XY-graph.

Store the 'old' plots as array(s) in a shift register

 

from your last plot x values, lookup the max and min value (min/max array) and use the x-scale-range-min/max properties to change the scale shown.

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


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

ok.... I cannot seem to make my XY graph become a multi plot... just getting a broken wire when I try to connect wire to plot... sorry for the dumb question but do I get a multi plot XY graph

0 Kudos
Message 4 of 6
(3,322 Views)

no bother... realised I had to delete the old xy graph and add a next one for it to accept the change!!! why can't labview just update that automatically.... I ask myself!

0 Kudos
Message 5 of 6
(3,320 Views)

Labview can.
Maybe you tried connect local variable or terminal to array when another copy was connected to scalar?

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