LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically changing scales for multiple graphs on different tabs

Solved!
Go to solution

I'm creating a data viewer that plots various sets of data collected from a piece of hardware into multiple XY graphs. The graphs are on different tabs. When the user zooms in on the x-axis of one graph, all graphs are supposed to update, so that the user can jump from tab to tab and be looking at the same time period for each set of data.

 

Here's where I encounter a problem: when I upload the data to all of the graphs, and then zoom in on one graph, none of the other graphs zoom in unless I've already looked at them. If I click through all the tabs (so that all graphs have been viewed), and then zoom in on any one graph, every other graph updates to match the new x-axis max and min. If I only clicked through the first two tabs before zooming on one of them, the first two graphs would have matching x-axis maxs and mins, but any graphs on tabs not viewed would still be zoomed all the way out to show the full x-axis.

 

I created a pared down sample program that illustrates this issue, and attached it here. I simulated the uploading of data by placing a "Populate Graphs" button that puts random data in a graph on each of four tabs.

 

To mimic the issue:

  1. Press the "Populate Graphs" button
  2. View a tab or two
  3. Zoom in on a section of the graph
  4. Look at all tabs and notice that any previously viewed match the zoomed graph x-axis, but the others are still zoomed out
  5. Zoom in on any one graph again
  6. Look at all tabs and see that now all the graphs have the same zoomed x-axis.

I also placed a "Clear Graphs" button to illustrate that each time you "upload" new data, the problem starts over anew.

 

Can anyone tell me if there is something I'm doing wrong here, or if there's a work-around? Other than programmatically flipping through every tab after every data upload?

 

Thanks in advance!

0 Kudos
Message 1 of 6
(3,647 Views)

For me it just works as it should. Whenever I re-launch the VI, populate graphs and zoom in at any of the 4 Graphs, all the others do the same reproducibly.

The only difference is that I use LabVIEW 2015, you use LV 2013. Maybe this was a bug, and got fixed at some later release of LabVIEW?

 

I remember there were (are?) several issues with Graphs "living" on separate TAB pages, I guess most of them got fixed up over the years. So one option is to upgrade your LabVIEW to 2015/2016, or try to find a workaround. Unfortunately I do not have recently LV2013, so I cannot test any workaround idea would I have...

 

Could you try to turn OFF the autoscaling of the axis for all the graphs, and see if you still see this problem? You can also turn on/off autoscaling via property nodes. Did this solve your problem?

 

0 Kudos
Message 2 of 6
(3,614 Views)
Solution
Accepted by topic author pkin

This is strange, I tried several times your VI, and I did not see the "bug", but now I re-opened the VI, and I see the same problem as you described...

 

This worked for me as a workaround:

 

multitab_xygraphs-5_BD.png

Message 3 of 6
(3,606 Views)

Good find BloKK! Setting the property node does not update the graphs.

Interesting that your snippet says LV:14.0 but it is indeed LV:15.

 

To pkin:

1) You can use just one Event case to update the property nodes

2) Using this method will turn off the your default X autoscale so

    when you do a "Populate Graphs" action you may want to set

    "Autoscale once now" so you have a fresh start and see all of

    your data.

3) Use Mechanical Action - Latch when Released - on your buttons

    to avoid the kludgy delay and local variable. I know sometimes

   people do this so they can use local variables to stop loops, but

   there are better ways IMHO.

 

I'm including a snippet and a test program. The test program allows you

to see some of the interesting behavior (it does not have the fix).

 

steve

multitab_xygraphs mod 1_BD.png

--------------------------------------------------------------------------------------------------------------------------
Help the forum when you get help. Click the "Solution?" icon on the reply that answers your
question. Give "Kudos" to replies that help.
--------------------------------------------------------------------------------------------------------------------------
Message 4 of 6
(3,591 Views)

 Steve: I can save snippet with code version even below 2015. Use code capture tool.

 

edit: and i think i have (had) a bug with this CC tool that even setting the source to be a lower version, it did not do it, but only showing it on the png 😄

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

Thank you Blokk, the "autoscale off" setting solves my issue!

 

Steve, thank you for the coding tips and the "autoscale once" suggestion. I never knew that one event case could be tied to multiple events! That's going to save me a lot of time down the road, so thanks again!

 

-Lisa

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