LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Obtain Name of Property

Is it possible to get the name of a property as a string from a property node? I created a SubVi that converts a color property to hex but I would like to be able to retain the name of the data, but right now the name will just be whatever the label of the indicator is in the SubVi.

0 Kudos
Message 1 of 5
(1,363 Views)

There may be a clever way to do this, but your description is sufficiently confusing to me that I don't understand what you are trying to do.

 

Can you create a little VI that illustrates the input (control, wire, data, whatever) and what you'd like the output to be?  If you had several examples that made it clear ("I want this, not that ..."), we could "try to be clever" ...  Do attach actual LabVIEW code with actual LabVIEW quantities (controls, wire, data, whatever) and the corresponding "what I want" for each.

 

Bob Schor

0 Kudos
Message 2 of 5
(1,336 Views)

It's possible, but the code is ugly:

pnn.png

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 3 of 5
(1,319 Views)

Two things here to solve.

1 get a property name as String. You would need a reference to the property node object. Scripting will let you do that and you could get an array of property names fairly easily. But this may not be available with the vi running.

2 changing a property of an indicator to store that name. Labels cannot be written at run time but, Captions can. Again, changes made to the subvi require saving to persist so this may not be exactly what you want.

 

Frankly I would just output a Void Variant with an attribute of name and value of color


"Should be" isn't "Is" -Jay
0 Kudos
Message 4 of 5
(1,314 Views)

@shynds wrote:

Is it possible to get the name of a property as a string from a property node? I created a SubVi that converts a color property to hex but I would like to be able to retain the name of the data, but right now the name will just be whatever the label of the indicator is in the SubVi.


I agree that your description is not clear at all.

Color property of what? What is "to hex"? Are you formatting as a string using characters 0..F? A binary string? A U32 indicator with a special format? Something else? Why does it need to be a subVI? What's the purpose of this exercise?

 

Can you describe your use case in detail?

 

What is your definition of "the name of the data" and why would it matter? The labels of controls and indicators matters. The name of a wire not so much.

 

0 Kudos
Message 5 of 5
(1,287 Views)