ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Control label in SubVI

Greetz All,

Is it possible to get the label of a control that is connected to a subvi from within the subvi without creating a control reference and connecting it to the subvi?

I'm trying to make some new general use subVIs, so I don't want to get a reference to the calling VI and get refs to all its controls and search for the label because what it would search for will change from application to application, so I would have a string input for the label to search for anyway.

Thanks
Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 1 of 7
(4,218 Views)
Hi Ed,

I think this would be great, but I doubt it's possible. It's the wires which are connected to the sub-vi connectors, not the controls directly so the assumption that wire=control is often false, and I don't think LV will offer this ability. If I wire a control "number" to a "+1" function and send this to the sub-vi, what should be given as the connected "control"?

Having read your question however, I've been thinking of other ways which may produce the same functionality. Apart from a standardised naming scheme, I can't think of any right now.

I just know this will keep me thinking for a while.

Shane.
Using LV 6.1 and 8.2.1 on W2k (SP4) and WXP (SP2)
Message 2 of 7
(4,218 Views)
I realized the "wire=control" issue late yesterday. And even though I figured out how to get the control name using a variant input ternimal, then use either 'Get Variant Attribute' or convert to XML and parse out the label, there's a good chance the label will not be there anymore for one reason or another, or that there never was one because the wire didn't come from a control.

So I've reverted back to just using a serarate string input to get the needed string into the subVI.

Thanks
Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 3 of 7
(4,218 Views)

Hello!

 

I also want to get label of control connected to my subVI. I have a variant input to the subVI and  I'm was trying use "Get Variant Attribute" but what next?

 

Thanks

Sakubh

 

-------------------------------------------------------------------------------------------------------
CLAD
0 Kudos
Message 4 of 7
(3,740 Views)

I just want label on output my subVI from any kind of connected control. Input is a variant.

-------------------------------------------------------------------------------------------------------
CLAD
0 Kudos
Message 5 of 7
(3,714 Views)

I found the solution. I just use OpenG function "Get Data name". 

-------------------------------------------------------------------------------------------------------
CLAD
0 Kudos
Message 6 of 7
(3,701 Views)

@sakubh wrote:

I found the solution. I just use OpenG function "Get Data name". 


The OP mentioned in the first post the fact that he wanted to get the control name, from within a subVI, of the calling VI.  In this instance the OpenG funtion won't work.

0 Kudos
Message 7 of 7
(3,693 Views)