05-05-2022 02:26 PM
I have a subVI that generates a XY graph from data passed to it.
That subVI's XY graph is an output of that subVI.
I wire the subVI's XY graph output to the main VI front panel XY graph.
When I change between two sets of data the autoscaling doesn't seem to work.
I am not sure what I have to do to make what is generated by the subVI's XY graph is exactly the same as what is on the main VI's XY graph.
I hope I am making sense.
Do I need to pass a reference to the subVI ?
Solved! Go to Solution.
05-05-2022 02:32 PM
Hi psuedonym,
@psuedonym wrote:
I am not sure what I have to do to make what is generated by the subVI's XY graph is exactly the same as what is on the main VI's XY graph.
You just need to set the same properties in you rmainVI graph as is used in the subVI.
Especially enable the autoscaling also in the mainVI graph!
Keep in mind: LabVIEW is "THINK DATAFLOW!"
Your subVI provides just the plot data, but not the properties of its graph to the mainVI!
05-05-2022 02:58 PM
Your description is way too ambiguous to say anything. Feel free to attach a simplified version of your VIs and we'll figure it out.
05-05-2022 03:03 PM
What I did is copy the subVI's XY graph indicator to the main VI.
The properties are the same.
The main VI's XY graph is in a cluster and that cluster is on one of the pages of a Tab Control.
It seems that if I have the Tab Control page with the XY graph "open", e.g. viewing it, then the XY graph updates properly. But if I am on a different page, the update with the autoscaling is hit or miss.
Any idea why this might be?
05-05-2022 03:32 PM - edited 05-05-2022 03:36 PM
Yes, indicators on tabs that don't show typically don't get as much attention by the scheduler for performance reasons. You can typically program your way around it, e.g. using a "value change" event for the tab is a parallel loop to trigger a "force redraw" method on the graph if the new tab is the one containing it. There are many other ways, of course.
05-05-2022 04:06 PM - edited 05-05-2022 04:31 PM
@altenbach wrote:
Yes, indicators on tabs that don't show typically don't get as much attention by the scheduler for performance reasons. You can typically program your way around it, e.g. using a "value change" event for the tab is a parallel loop to trigger a "force redraw" method on the graph if the new tab is the one containing it. There are many other ways, of course.
Could you explain what you mean about doing a Value Change in a parallel loop?
Currently there is only one WHILE loop with a Event Structure inside.
EDIT:
I do see that @mikeporter says that graphs and tab controls are not a good combination. https://forums.ni.com/t5/LabVIEW/Update-graph-in-background-tab/td-p/2913792
I was given this code, but I want to make this work more smoothly.
05-05-2022 05:06 PM
Most my my programs have a small independent while loop exclusively for handling UI without complicating the main code. You can fire a force redraw whenever the tab changes and the new values is the tab containing your graph.
05-05-2022 05:22 PM
We really need to see some simplified code how you are doing things. Typically all you need is to ensure that the graph terminal gets written at regular intervals, so don't bury it deep inside structures.
Most likely your are complicating things too much, gumming things up.
I have many graphs on many pages and never have a problem with updates (example here). Mike Porter is a very smart guy, but that was 7 years ago. There are plenty of easy workarounds. 😄
05-05-2022 05:56 PM - edited 05-05-2022 06:01 PM
@altenbach wrote:
We really need to see some simplified code how you are doing things. Typically all you need is to ensure that the graph terminal gets written at regular intervals, so don't bury it deep inside structures.
Most likely your are complicating things too much, gumming things up.
I have many graphs on many pages and never have a problem with updates (example here). Mike Porter is a very smart guy, but that was 7 years ago. There are plenty of easy workarounds. 😄
I would like to simplify it, but I have 10 Access database files that are 2GB in size.
And this VI is to query for data from them and graph it.
It would take me at least an hour to simplify it.
Once someone enters a serial number, the VI grabs the data and grab it.
It does it once.
But when I change from one serial number to another, the XY graphs are not autoscaling on the main VI.
I select the pages on the tab control and they are no autoscaling even though the underlying subVI has its XY graph showing correctly.
05-06-2022 11:24 AM - edited 05-06-2022 11:27 AM
I ended up passing a reference of the main VI's XY graph to the subVI while leaving everything the same.
Changed the Value property.
That worked.
Why? I don't know.