LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Rename cluster elements

This isn't any critical issue but it would be nice to be able to rename elements of a cluster. The cluster will form an array cluster in a for loop. Reason for renaming is to be able to tell which is what immediately instead of to have to go trace its origin to know what it is.
0 Kudos
Message 1 of 7
(7,772 Views)
You probably already know that you can't rename owned labels during run-time, but you can do anything similarly via the caption property. For clusters, you can either use the individual control properties or use the Cluster->Controls[] property to rename elements.

LV 7.0 example attached.
Message 2 of 7
(7,758 Views)
I'm not really sure what you mean when you say "array cluster". If you are trying to change a label within an array the rule to remember is if you change one, you change all. Changing a name of an element within a cluster is quite simple. Fist thing to remember is that you can not change the Label name but you can change the Caption name. First, make the Caption visible and the Label not visible. If you have a few elements it may be easer to create a property node (Caption:Text)for each element in the cluster. If there are many elements. I suggest creating a property node for the Cluster (Controls[]); Wiring the output of the Controls[] property to a For Loop; then read in the new caption text. I have attached a picture of a diagram on three ways I would change the Caption Text.
0 Kudos
Message 3 of 7
(7,741 Views)
I should have explained myself clearer. A simple code of what I wanted would be say create a for loop that takes in 2 arrays so that I can combine array elements to form a cluster (elements 0 will be cluster 0, elements 1 to cluster 1 and so on). So upon completing the for loop I will have an array of clusters (each cluster contain 2 data).

I just found out a simpler way to get what I wanted. I simply create the cluster> then create a Control from that cluster> on front panel I rename each Control elements> then from the renamed Control create a Constant on block diagram and link the Constant to Bundle. Maybe this is the way to do it but well I'm a rookie in this and I just found out.

Attach is a screenshot of what I did.
0 Kudos
Message 4 of 7
(7,735 Views)
Instead of creating a constant, you can create a local variable (by right-clicking on the terminal and selecting Create>>Local variable) and wire this into the bundle function. That way, if you change the cluster, the function will grow to fit the new cluster. Also, you can use the Bundle by Name VI if you want your diagram to be more readable. It allows you to only show some of the cluster elements on the diagram.

___________________
Try to take over the world!
0 Kudos
Message 5 of 7
(7,719 Views)

 

@JoshMonkey wrote:

I just found out a simpler way to get what I wanted. I simply create the cluster> then create a Control from that cluster> on front panel I rename each Control elements> then from the renamed Control create a Constant on block diagram and link the Constant to Bundle.

Thank you! That worked great!

 


 Smiley Happy

0 Kudos
Message 6 of 7
(6,775 Views)

Late into the game....   I renamed my cluster elements from "Output Array[..." to "Voltage " by using the replace text function of the Find and Replace selection under EDIT in front panel view.

 

   Better late than never.    Jay Dubya

Message 7 of 7
(6,508 Views)