From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
11-29-2019 12:05 AM
I'm setting up an asynchronous VI to display 'popup' XY Graphs and want to allow the use of a second Y scale, although by default it will be hidden.
Displaying the second scale is not too difficult - I have an Event Structure which checks the "Plot Attribute Change" event and if New.YScaleIdx != Old.YScaleIndex, I make the New scale visible, and autoscale as necessary.
However, I'm not sure how I can check if the "old" scale has any remaining plots using it, and if not, hide it.
Is there some sensible method to do this?
I think it should be possible to iterate through the Active Plot -> YScaleIdx -> If Index == oldIdx, stop and return true, else, iterate, -> return false (are there any plots using this index scale), but
How should I solve this?
Solved! Go to Solution.
11-29-2019 03:48 AM
AFAIK, iterating the plots is the only way.
Of course if you manage the plots, you can buffer the information.
Finding the number of plots is a bit of a mystery. IIRC, adding them is easy, deleting them is hard. Somehow the graphs grow the nr. of plots but don't shrink them...
I also had huge cosmetic problems with dynamically showing\hiding scales. They seem to remember position or something, and when shown they can popup on their old location. So scale 5 can appear before scale 2 under the correct (wrong) circumstances. This was in a dynamically scaling graph, that might make a difference.
My way out was to DIY everything, as you can set the positions of the scales. It was (and still is) hell! Just a heads up, YMMV. If you run into these symptoms, consider not supporting this.
11-30-2019 08:51 AM
wiebe@CARYA wrote:
AFAIK, iterating the plots is the only way.
That's too bad, but good to know I didn't miss something obvious. At least now I know a LabVIEW Champion also missed it if it does exist 😉
wiebe@CARYA wrote:
Of course if you manage the plots, you can buffer the information.
Finding the number of plots is a bit of a mystery. IIRC, adding them is easy, deleting them is hard. Somehow the graphs grow the nr. of plots but don't shrink them...
I considered this, but I'm just trying to do something simple/quick - one of my colleages likes to throw up a bunch of graphs with MATLAB and so I thought perhaps a way to quickly display a graph (with a snapshot of data - I don't have any communication method to update the data after launch) in a new window might be useful - sometimes you want to display something when it is calculated, but you don't want to take up front panel space all the time.
I've also got some memories of the number of plots never decreasing, or at least being a pain to manipulate. I'm hoping the short-lived nature of my graphs will make this not such an issue for me...
wiebe@CARYA wrote:
I also had huge cosmetic problems with dynamically showing\hiding scales. They seem to remember position or something, and when shown they can popup on their old location. So scale 5 can appear before scale 2 under the correct (wrong) circumstances. This was in a dynamically scaling graph, that might make a difference.
My way out was to DIY everything, as you can set the positions of the scales. It was (and still is) hell! Just a heads up, YMMV. If you run into these symptoms, consider not supporting this.
I'm thinking I'll just not allow more than 2 scales, and the front panel essentially only has a graph on it (everything else is hidden) so resizing is done with the built-in scaling (and a little minor repositioning/resizing for the legend). If anything gets too complicated, I think not supporting it will be my first choice for this tiny chunk of code (2 VIs and a VIM to allow rearrangement of the accepted datatypes of an XY Graph).