LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to assign Decoration name or number to each decoration on Front panel?

Hi Everyone,

 

How to assign Decoration name or number to each decoration on Control panel?

 

Decoration.PNG

 

Best Regards,

Nirut

0 Kudos
Message 1 of 12
(4,183 Views)

 

image.pngWhat exactly do you mean by "decoration"? You already have the Control Label. You can customize it through the controls at the top of the window. Is this what you want?



Remember Cunningham's Law
0 Kudos
Message 2 of 12
(4,143 Views)

Don't use free labels associated to a specific control. Right-click on the control, select Visible Items -> Caption from the context menu.

Then, you can freely customize Caption font, color and so on. Furthermore, you will be able to change them by means of the control properties.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 3 of 12
(4,135 Views)

No. I mean if we want to program each decoration to visible or hide, we need to know decoration name or decoration ID to identify in program for that decoration will visible or hide correct object.

 

Because if we programming with 100+ decoration objects we need to assign each decoration name or ID for easy to manage in the program.

 

 

Best Regards,

Nirut

0 Kudos
Message 4 of 12
(4,134 Views)

Then your example vi is not so good, because it contains only free labels.

Working with decorations is not a very easy task; you may use the UID property to identify them, but this number is assigned by the compiler, so you need to annotate the UID of each decoration you create.

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
Message 5 of 12
(4,129 Views)

Just to reiterate what pincpanther said: Use Captions or labels as you have easy access to those through the properties.

 

If you do want (and you really don't need to) use decorations, the only way I know how to do this is to get back a list of references and know where in the array they are:

decoration.png



Remember Cunningham's Law
0 Kudos
Message 6 of 12
(4,128 Views)

So, that mean we cannot identify by our self need to follow number from compiler assigned only?

And the number from compiler assigned only one way to know is use index to check which decoration is visible/not visible?

 

Best Regards,

Nirut 

0 Kudos
Message 7 of 12
(4,120 Views)

In the past I had some main vis with a lot of decorations. At that time (LV 7.1) decorations had less properties, so I was forced to identify them by means of their position in the Decorations array. This is far from ideal, because the position will change depending on the decoration Z-order.

So, I wrote a small vi to find decorations in a given vi. You need to load both vi's, set the right vi name in Highlight decorations.vi, then run it.

As you navigate through the array, you will see the corresponding decoration highlighted in the other vi's Front Panel.

I attach a modified version, adding the UID as additional info.

 

Paolo
-------------------
LV 7.1, 2011, 2017, 2019, 2021
0 Kudos
Message 8 of 12
(4,117 Views)

Try these.

"If you weren't supposed to push it, it wouldn't be a button."
Message 9 of 12
(4,082 Views)

Obviously, you can use their index, if there are just a few, or if they are all the same.

 

Each decoration (each object actually) has a UID. These will not usually change, I think they stay linked to an object until it's deleted. You can use those.

 

The other way is to tag the objects. Each object can be tagged, including decorations. Those posted VI's use tags to attach a label to decorations.

 

Sadly the label that can be given from the UI has never worked... There are idea exchange posts about that (like this one) but apparently nobody cares...

Message 10 of 12
(4,062 Views)