LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Graph range problem with tab control

Hello.

I am using LabVIEW 8.2.1
I have five XY-graphs in a tab control, with five tabs. One graph in each tab. When running, theese graphs is constantly written to, but the user is only allowed to watch one at a time.

The program also contain a maximum&minimum chart, containg the maximum and minimum value for every plot in the viewable part of the graphs. The user can zoom in on a graph, and then watch the max&min values in this picture. The values are calculated by taking the range to each graph, and use theese ranges to cut out the viewable part from the input data to the graphs.

The problem is, that the program only see the last viewed range. If I view a graph in a tab, the max&min values for this graph is correct, but the four other graphs dont get the correct values. The graphs data is written correctly. It seems like the ranges from the "hidden" graphs dont get updated when not viewed. Does anybody know how to fix this problem?

I have uploaded an example to this problem. See how the range just freezes on the not viewed graph, even the two graphs is exactly the same.

Thanks

Fredrik, Norway

Message Edited by Kalman on 06-19-2008 01:58 AM
0 Kudos
Message 1 of 8
(3,534 Views)
Fredrik,

if frontpanelelements are not shown, they will not get updated. So if you do your math on the graph, i am not surprised that the display will not update "properly" (technically, it does, but it is not like you want to have it....).
So i recommend you to do the peak search on the arrays within your blockdiagram.

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 8
(3,515 Views)

Hello Kalman

This is really interesting. I didn't expect it to be like this. I don't know the reason for it, but I think the way LabVIEW works is everytime it runs a code it refreshes the values on the front panel and when you select the one tab for some reason the graph on the other tabs is not updated (because it is not included in the active front panel part), however that data is stored somewhere and the next time you select this tab it will update that graph.

May be some one more experienced in the group can provide better understanding in this matter.

For solving your problem I will use the maximum ranges of the graph directly from the data instead of graph properties.

This was definitely interesting. Please note there may be a fix to it (which I don't know) but I just wanted to share my opinion on this.

Thanks

Ankit

0 Kudos
Message 3 of 8
(3,511 Views)
Norbert:
Thanks, but I dont think that will help.

The arrays in the blockdigram contains all data, but I am only interested in the viewable part of the graph. If there is no way to do this, I think I will stick to how it is working now. To view the correct values, you have to watch the graph.

Fredrik

Message Edited by Kalman on 06-19-2008 02:39 AM
0 Kudos
Message 4 of 8
(3,508 Views)
Frederik,

the reason for your issue is autoscaling. If the graph is not drawn, autoscaling will not take place, so you will not get any correct values, you will get the last autoscale-values.
The behaviour therefore is "works as intended" since it reduces CPU usage.
So the best way to work around is something like seen in the attached VI: you should compute the scaling for each graph on your own and use this to update the scales as well as the indicators (which i left out in my VI).

hope this helps,
Norbert
Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 8
(3,497 Views)

Hi Kalman!

There are TERIBLE BUGS in graphs on tabbed pages in LV 8.2!

I lost three days of work trying to troubleshoot one of my apps. As a last ditch effort I tried the app under LV 8.5 and all of the problems went away,

AND,

The performnace improved big time!

I'd offer more ideas but I tried them all (in the three days of hell) and they did not help.

Just trying to save you some headaches!

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 6 of 8
(3,480 Views)
Kalman,

One clumsy and inelegant approach might be to put all the graphs on the front panel (not in a tab control) and move them to an off screen position when not being viewed. This can be done with property nodes. Because LV thinks they are visible, they should get updated. I have not tried this, so it may not work. If you do this, move each graph to a different location in the off screen area. Overlapping front panel objects cause a performance degradation, so it is probably best if each has its own bit of panel real estate.

Lynn
0 Kudos
Message 7 of 8
(3,475 Views)
Thanks for reply.
 
I found a solotion. Since the the range wont update in autoscale, it is best to use the data arrays. I therefore created a test to check if autoscaling was on, for both the x- and y-axis. In this way, the max&min will always be calculated correctly. If autoscaling is on the x-axis, the program uses the x data array, and takes the range for the y-axis (since this wont change) and cuts out the viewable part. The same the other way around.
I then made sure  that the graphs was updated every loop, so that the user has to turn off autoscaling when zooming, to prevent it jump back out.
 
It's not perfect, but works as it should be.
 
Fredrik
0 Kudos
Message 8 of 8
(3,453 Views)