LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Linking graphical objects

Hello

In my application, I have a double loop, over parameters x and y. I have a subVI that implements the y loop for one value of x. In that subVI, I have a real time plot that shows the quantity being measured as a function of x and y. I wish to "link" this plot upwards into the front panel which calls that subVI. Is this possible ?

If I place this realtime plot in the front panel, it won't be real time anymore - I would have to wait for the y loop to complete in that subVI in order to update the results.

Thanks.
0 Kudos
Message 1 of 6
(3,321 Views)
Yes. In the main VI, you can create the chart and pass a reference to it to the subVI. In the subVI, you wire the reference to a value property and the indicator in main will get updated at the same time. What I do is right click on the indicator and select Create>Reference. I then right click on the reference and select Create>Control. I cut this control from the main VI and paste it onto the subVI. In the subVI's diagram, you can then right click on the reference and select Create>Property>Value.
0 Kudos
Message 2 of 6
(3,314 Views)

Another way to do this, as I described in this weekly nugget, is to Ctrl-Drag the actual chart into a control reference control.  I used to do it the way Dennis described, until I learned about the Ctrl-Drag trick.

-D

Message 3 of 6
(3,310 Views)
How did I miss this one?Smiley Surprised This works much better.
0 Kudos
Message 4 of 6
(3,305 Views)
Thanks for the responses.

On the front panel of the main VI, I have copied over the chart from the front panel of the subVI. Then created a control refnum and ctrl + drag'ed the chart onto the control refnum, followed by right click + show control.

Now, as far as wiring is concerned, it is obvious that the main VI chart has to be an indicator, not a control. So, I right clicked and changed it to an indicator. Now what kind of indicator do I need from the subVI to wire to the input of this indicator ?

Sorry about the confusion and if I have misunderstood what you explained.
0 Kudos
Message 5 of 6
(3,277 Views)
Here's an example that will hopefully explain a little bit better. The main VI passes a reference to a chart on it's front panel. The subVI has a control reference as an input and writes to a value property node of the reference. When you run the main, as the subVI runs, you will see the chart update. Note that you do not have to have a chart in the subVI or wire a vale returned from the subVI to the indicator in the main. Having either is optional. There are shipping examples of control references tha you may also want to look at.
Message 6 of 6
(3,262 Views)