06-15-2022 12:35 PM
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.
06-15-2022 01:40 PM
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
06-15-2022 02:25 PM
It's possible, but the code is ugly:
06-15-2022 02:34 PM - edited 06-15-2022 02:37 PM
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
06-15-2022 09:14 PM
@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.