LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Names

Hello

How do I convet a string to a name?
I have string (array of strings) and an integer (array of integers) and
now I want to make an cluster containing my integer (array) so when I
later use the 'unbundle by name' function I can select my integer with
the name given by the string.

/ Peter
hpek@ifa.au.dk
0 Kudos
Message 1 of 2
(2,066 Views)
You have to create a control with the cluster you want. In this cluster you can name the elements as you want. Save this control as a strict type def. In your VI create a constant from this control. Then use bundle by name and connect the cluster input to this control. Now unbundle by name will display the names.

You can also do the following: Create a cluster constant, place constants of the right type in it. For each element choose "Visible Items >> Label" from the context menu and enter the name. Connect it at as described above.

I prefer the first method because the type def can be used at many places, e. g. as controls and indicators of subVIs. If any change will be nesseccary in the future the "Auto update from Typedef" will change them with
no extra effort in all places.
Waldemar

Using 7.1.1, 8.5.1, 8.6.1, 2009 on XP and RT
Don't forget to give Kudos to good answers and/or questions
Message 2 of 2
(2,066 Views)