LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

using control referrences in a subvi

Solved!
Go to solution

I have an issue and would like to know if someone can make me an example with and explaination. In my main program i have a subvi and in that subvi i have another subvi preforming a calculation. I need to bring the values of the subvi 2 layers up to the main program. I used the link below on another program which worked but I'm having issues doing it on the program with subvis 2 and 3 layers deep. I tried creating a reference then placing the reference on the main program but the values was not propagation upward to the main program. I do not have the file available to view on this forum.

 

 

http://www.ni.com/white-paper/3159/en/

0 Kudos
Message 1 of 11
(3,323 Views)

Hi E,

 

instead of linking to that AppNote you should attach your 3 VIs to demonstrate the problem you have…

Best regards,
GerdW


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

I find the property nodes just to update a value is not often the best way to do it.  If you can share some code, that would help us to figure out your issue and maybe even suggest something that would work better.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 3 of 11
(3,280 Views)

I just have a very basic example with these 3 files. I have the main program and a subVI thats suppose to be on the main program. When you open the subvi there is another called untitled 3 subVI. I need the output of Untitled 3 subvi to be displayed on the Main. Hope this is helps a little. 

Download All
0 Kudos
Message 4 of 11
(3,269 Views)

Also this was done in labview 8.2

0 Kudos
Message 5 of 11
(3,268 Views)

Your code works when I run it.

It's got some other problems such as a greedy loop. Updating the indicator is ok.

 

What part do you feel isn't working correctly?

0 Kudos
Message 6 of 11
(3,255 Views)

Also, did you mean to call the subVI?

Your Main directly calls Untitled.

 

Your subVI needs to have the terminals configured to accept the Control reference from Main.

0 Kudos
Message 7 of 11
(3,251 Views)

When i ran the main program it didnt show the values changing from Untitled 3. If i run the one call sub vi it works. The problem is that i cant post the real program so i made a simple example of what i was trying to accomplish. My main program runs which call a sub vi which then calls another subvi 2 lays down. I dont correctly know how to bring that reference value from 2 lays down back up to the main program.

0 Kudos
Message 8 of 11
(3,246 Views)

Your subVI needs to have the terminals configured to accept the Control reference from Main. How do i do this?

 

In my real program it will call the first subvi with proform calculations. That sub vi Call other subvi with in its block diagram. i need to get those values back over to the main program. If i have them open i can see the values being calculated but i dont know how to display it correctly on the main program.

0 Kudos
Message 9 of 11
(3,243 Views)
Solution
Accepted by topic author *E*

@*E* wrote:

Your subVI needs to have the terminals configured to accept the Control reference from Main. How do i do this?

 

In my real program it will call the first subvi with proform calculations. That sub vi Call other subvi with in its block diagram. i need to get those values back over to the main program. If i have them open i can see the values being calculated but i dont know how to display it correctly on the main program.


While working on the front panel, you need to set up the connector pane similar to how the Untitled connector pane is configured.

You'll need a Reference control for the numeric as an input on your front panel. Simplest way to do this is to create a reference on Main, Copy the reference to the block diagram of subVI and then Change to Control.

In the old LabVIEW 8.2 days, you'll need to right click on the icon editor and do a Show Connector Pane. Click on the terminal on the connector pane that you want to wire into and then select your Reference control.

 

Now, just make sure you're passing the reference through to whichever VI needs to work with it. In the case you're describing, Main should pass the reference to subVI which should pass the reference to Untitled. Any updates to the reference in Untitled will be reflected in the control on Main.

 

Message 10 of 11
(3,209 Views)