08-24-2010 05:57 PM
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.
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
Solved! Go to Solution.
08-25-2010 08:07 AM
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.
08-25-2010 08:39 AM
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 !!
08-25-2010 08:56 AM - edited 08-25-2010 08:57 AM
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).
08-25-2010 09:37 AM
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
08-25-2010 10:00 AM
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.