LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

is there any way of getting the label of any variable as a string ?

Solved!
Go to solution
After I label any indicator (or whatever) is there a function that reads that label and outputs a string ?
0 Kudos
Message 1 of 18
(5,026 Views)

You can read the "label.text" property.

 

Message Edited by altenbach on 04-20-2009 03:27 PM
0 Kudos
Message 2 of 18
(5,019 Views)
Ok but in order to use this i need to link the property node to that variable. What I was thinking is something like a SubVI or a structure that for whatever variable (labeled) as input it outputs the label as string. (something that will autolink my property node to the input).
0 Kudos
Message 3 of 18
(5,006 Views)

You could use Altenbach's code as a VI and wire in a reference to the property node.  Does that make sense or do you need more help?

 

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 4 of 18
(4,994 Views)

I think i need more help.

 

I created a suvbi that looks like Altenbach's code, i connected a terminal to the indicator, but whenever I use that subvi and input a variable, the label does not pass to the indicator in the subvi so as an output i get the label of the indicator inside the vi.

 

0 Kudos
Message 5 of 18
(4,991 Views)
Also I'm not sure what that reference should be. Can a reference be a let's say integer type indicator (control) ?
0 Kudos
Message 6 of 18
(4,988 Views)
Solution
Accepted by topic author zmuccelmic

Code and image attached (I'm using 8.2)

 

First of all, the reference is a control -- it's connected to the connector pane.

 

This will only work for numerics.  I figured out a way to get it to work for generic references, but I didn't do it yet and it's probably too much work unless you really need it.  There might be an easier way...

 

When you this subVI from another VI, you would connect a reference to the object whose label you want to the input terminal.

 

Let me know how it goes...

 

-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




Message 7 of 18
(4,984 Views)
If you need one for strings, it's not that hard.  Minor changes to the code.
-Matt Bradley

************ kudos always appreciated, but only when deserved **************************




0 Kudos
Message 8 of 18
(4,982 Views)

It seems to do the job. I have no idea what those control refnum are but hopefuly I'll figure out eventually (I just started using LabView 3 days ago 😞 ).

 

 Thank you !

 

 

0 Kudos
Message 9 of 18
(4,977 Views)
It works if for a certain variable i create a reference first and input that reference to that subvi. Is there any way that i can just input the variable ? (I do have a lot of them and I dont want to create references for every one of them.)
0 Kudos
Message 10 of 18
(4,973 Views)