LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

control references; need some help

Solved!
Go to solution

Im having a VI with controls, let's say some boolean control. From another running VI I want to be able to adjust the value of that control. How do I do that? I remember something about creating a reference of the control and calling

the reference in another VI.  If I'm wrong, can somebody clearly explain what they are for?

 

Second, is there a way to call a subVi and display the front pabel in a tab of the VI from which i am calling it?

 

Thanks!

0 Kudos
Message 1 of 6
(3,930 Views)

1. In your front panel go to the Modern -> Refnum -> Control Refnum and place it on your panel. Then create a control of which refnum you need (in this case a boolean) and drag 'n' drop it into the refnum element on the front panel. Now you will have a refnum to your boolean control in your block diagram.

 

2. Place the SubPanel (Modern -> Containers -> SubPanel) element on your front panel and wire a reference to your VI you want to display to it.

Message Edited by Giedrius.S on 02-13-2010 06:46 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
Message 2 of 6
(3,920 Views)

On the Block Diagram select the terminal you want to update Right-Click>Create>Referance.

 create ref.PNG

 

Here is a basic example of implementation (Attached)

 

 

So it is pretty easy to update controls with VI server referances.  This technique is used often to handle GUI updates like status and messages to the user in medium and large applications.

 

Your other question


_Faust wrote: 

Second, is there a way to call a subVi and display the front pabel in a tab of the VI from which i am calling it?

 

Thanks!


Yes this is possible by using a Subpanel on your VI front panel.  You can show your vi front panel in the sub panel.  Read the help on sub panels because it does have a few caveats so you really need to know what limitaions you will run into

 


"Should be" isn't "Is" -Jay
Download All
Message 3 of 6
(3,910 Views)
Solution
Accepted by topic author _Faust

1. In your front panel of the local VI go to the Modern -> Refnum -> Control Refnum and place it on your panel. Then create a control of which refnum you need (in this case a boolean) and drag 'n' drop it into the refnum element on the front panel. Now you will have a refnum to your boolean control in your block diagram. You can adjust the value of that control in another (foreign) VI simply by placing a Property Node of your control (in the foreign VI) and wiring the already created reference to it. So basically you need to transmit the reference from the local VI to the foreign one. The adjusted value can also be transmited or, if it is static, it can be placed on the foreign VI.

 

Sorry, I could not to edit my previous post. Just thought I could elaborate on the first point a bit more.

Please ask is something is not clear enough.

 


Jeff Bohrer wrote:

On the Block Diagram select the terminal you want to update Right-Click>Create>Referance.

 


Just don't understand how I have managed to forget this one, including the fact that I use this method in most of the cases 😄

 

Message Edited by Giedrius.S on 02-13-2010 07:01 PM
---

While evaluating my code please have in mind that I am a LV novice. Therefore sometimes my code might violate some coding rules that I have to learn about myself. But how else could I do that... 🙂

Chart zoom with "Mouse Over" effect
Message 4 of 6
(3,909 Views)

You might want to review Ben's nugget.

 

But keep in mind that using the 'value' property is by far slower than the terminal or a local variable. You won't rtealize it for a few booleans, but don't use it for larger data sets.

 

My own approach would be using user events. The top-level vi already has an event structure in place. The complete idea is presented in my own nugget.

 

Felix

Message 5 of 6
(3,879 Views)

I have been struggling with getting the Control reference wired to my property node.  I finally got it to work but it just seems like i'm doing something wrong.  What I did to get it to work is, on the block diagram of my main VI I created a property node for a numeric indicator.  I then drug the property node from the block diagram of the main VI to the block diagram of the sub-VI.  I then deleted the property node on the main VI.  I was then able to wire the dignum refnum to the property node now labeled DigNum (strict).  Am I doing this correctly?  It seems strange I had to delete the property node on the main block diagram after I moved it to the sub VI. 

 

Thank you

Danny
Download All
0 Kudos
Message 6 of 6
(3,352 Views)