LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

subVI 's XY graph not autoscaling on main VI's XY graph

Solved!
Go to solution

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 ?

 

0 Kudos
Message 1 of 10
(1,272 Views)

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!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 10
(1,265 Views)

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.

0 Kudos
Message 3 of 10
(1,258 Views)

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?

 

 

0 Kudos
Message 4 of 10
(1,253 Views)

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.

0 Kudos
Message 5 of 10
(1,241 Views)

@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.

 

 

0 Kudos
Message 6 of 10
(1,230 Views)

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.

0 Kudos
Message 7 of 10
(1,213 Views)

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. 😄

 

0 Kudos
Message 8 of 10
(1,208 Views)

@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.

 

 

0 Kudos
Message 9 of 10
(1,198 Views)
Solution
Accepted by topic author psuedonym

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.

0 Kudos
Message 10 of 10
(1,162 Views)