LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Setting names of cluster items?

I have an array of strings and i want to use these strings as names for cluster items. This
functionality is only used for developping VI's.
By default LabVIEW creates clusters with the entries called 'name'. I want to create such clusters without
manually modifying the cluster control show on the frontpanel.
Is there any solution or workaround to this?

Regards,
Sunny
0 Kudos
Message 1 of 5
(3,249 Views)
It is not clear to me what you want to do.

You cannot create controls on the front panel using LabVIEW. This is restricted to the editor and not part of the runtime system.

If you create controls on the front panel, this includes clusters, you get the label of the control and the name is preset by LabVIEW. You cannot change the label at runtime and you should avoid to do this with the editor.

Use the context menu of the control to hide the label and to show the caption. The caption will get the same string as the label. You can change the string of the caption with the editor or at runtime with a property node.

Waldemar
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
0 Kudos
Message 2 of 5
(3,249 Views)
Hi,

I am looking for an easy way to set the names of my cluster items (i want to access its values by name). Actually i am manually defining a constant array and wire this to the cluster entry of the 'bundle' function. To create this constant is boring work and
i havn't to do this only in one VI.
Is there any workaround to easly generate this constant (names and type definition)?

Regards,
Sunny
0 Kudos
Message 3 of 5
(3,249 Views)
Hi,

You can build a vi that asks for a vi name (in memory). Then the vi can get
all controls on this (not running) vi, and select which one is a cluster.
Then get all the controls inside the cluster, and change the names.

In order:
Open a VI Ref to the desired VI (not running).
Get the VI's front panel ref
Get all control refs on the front panel
Get some properties of each control, to select the cluster, e.g. control
name
Get the selected control ref
Change the property Label>Text

Close all the opened references!

You can add functionality to automatically save the vi, or copy the vi to a
new name. You can also use Selection list in stead of all controls on the
front panel.

Regards,

Wiebe.


"Sunny" wrote in message
news:50650000000800000073
750000-1042324653000@exchange.ni.com...
> I have an array of strings and i want to use these strings as names
> for cluster items. This
> functionality is only used for developping VI's.
> By default LabVIEW creates clusters with the entries called 'name'. I
> want to create such clusters without
> manually modifying the cluster control show on the frontpanel.
> Is there any solution or workaround to this?
>
> Regards,
> Sunny
0 Kudos
Message 4 of 5
(3,249 Views)
Now its clear,

open a new VI. Create a control of the type like your constant. Select the control. Use Edit>>Customize Control... to open the control editor. Change the type from "Control" to "Strict type def" in the toolbar. Save the control.

In the block diagram of the VI you need the constant use the "Select a VI..." palette. Then you will get a constant of that type. If you do this on the front panel you will get a control.

In the context menu you can see that the "Autoupdate from Type def" is checked and not grayed. If you need to change the type def in the future a simple mass compile will update all instances.

See the Dr. VI article about enumeration updates and
="http://zone.ni.com/devzone/conceptd.nsf/webmain/A9FBCAA7A3D7922186256A3000652B56?opendocument">Tec...
for Typedefs.

I think this is an easier solution than that of Wiebe.

Waldemar
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 5 of 5
(3,249 Views)