LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Better way to turn off multiple plots on XY-graph ?

Solved!
Go to solution

Hi, All,

 

I need some suggestion here. I have a XY-graph with multiple plots.

Here is how the VI would work.

 

1. When program started, no plots or scale is shown.

 

2. Multiple buttons are available to select which plot to turn ON/OFF (corresponding scale also turns ON/OFF.)

 

What I have now is to pass the data to the graph first, and make all plots and scale invisible.

I did this using the graph property nodes ActPlot, ActYscl and PlotVisble, but I had to do this by

going through each ActPlot/ActYscl. So there are many property nodes all over the place such as

shown in the figure below.

 

22286iD0CBD2FB452F09F7

My questions are the following:

 

1. Would lots of property nodes require more memory or CPU resource ?

 

I'm doing lots of similar manipulation on the graph property ( cursors, scale, color, etc.) I'm concerned

the end result is a program that really doesn't do much but hogs lots of memory/CPU resource.

 

 

2. Is there a better way to do this ? Perhaps a property node that turns off everything

visible at one time?

 

I've read in another post which suggests using a loop to turn it off one by one. I can

certainly do this, but would this be a better way ?

 

 

Any suggestion or share of thought is appreciated !!!!

 

 

Thanks,

CC

 

 

0 Kudos
Message 1 of 6
(4,479 Views)

Here is an example that removes the data from the graph or let you hide the data. Take a look at what I did it should help you get where you need to go.

Tim
GHSP
0 Kudos
Message 2 of 6
(4,453 Views)

Tim,

 

Thanks for your example. Looks like you chose to manipulate the data array instead of the graph property.

I appreciate your input. I'd prefer to work around the graph property than the data array because I could

eventually lost track of the array index if my array set gets very large. Nonetheless, it's one of the options.

By the way, I'm using XY graph instead of waveform graph, so the x values are random and not evenly distributed.

 

 

Does anyone have other inputs regarding my original question 1 and 2 ?

 

 

All comments welcome !! Smiley Happy

0 Kudos
Message 3 of 6
(4,447 Views)
Solution
Accepted by topic author chad_vi

You definetly should modify the data you pass to the graph, esp. when working with lots of data. Simple reason: Memory usage.

Switching visibility does not reduce the amount of data you pass to the graph (which copies it for display) therefore, you will probably waste lots of memory.

But if you desire to show all data at once and only give the opportunity to hide small amounts of data, the approach with property node "visible" is correct though.....

 

hope this helps,

Norbert

 

EDIT: If you want to change several properties at once, you should include a defer panel updates (panel-property).

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 4 of 6
(4,436 Views)

Norbert,

 

You brought up a valid point. Although I do want to show all plots at some point, I should still consider other

ways to avoid passing all data to the display (until it's necessary). Potentially there could be 100+ hours of data

for my application.

 

Thanks for the defer panel updates idea. That's something I'm not aware of and I just found an example it.

Learned something new today !!!

 

 

CC

0 Kudos
Message 5 of 6
(4,423 Views)

OK here is the XY version. It is not that much different than the waveform. I assumed XY pairs as you said that the data would not be evenly spaced for the data.

Tim
GHSP
Message 6 of 6
(4,417 Views)