LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically create a free label on the frontpanel

Solved!
Go to solution

To make my VI's look nicer I would like to add some free labels to a tab control on the front panel.

 

So editing the free texts in the tab control and placing a free text on the block diagram works fine with the attached VI's. (Note: place them both in the same folder)2014-02-14 15_26_21-VI Scripting Origin.vi Block Diagram on Probe Configurator.lvproj_My Computer.png

 

However if I'm trying to add a free label to the Tab Control with the following code Labview generates error 1060 "LabVIEW:  Object cannot contain (own) the specified object."

2014-02-14 15_35_29-VI Scripting Origin.vi Block Diagram on Probe Configurator.lvproj_My Computer _.png

 

So now I'm wondering what I need to to in order to add text to the front panel with the help of VI scripting.

 

Hope you can help.

Download All
0 Kudos
Message 1 of 6
(4,839 Views)

In one case you add a label to a panel, in the other to a tab control. Is there some panel-property for each page?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 6
(4,819 Views)

I haven't tried this specifically, but from your image I would guess that the New primitive simply doesn't recognize the page as a legitimate owner. I would suggest creating it in the pane or FP and then using the Move method on it to move it into the page.


___________________
Try to take over the world!
Message 3 of 6
(4,782 Views)

2nd thought: On the top one you get the Decos on page-property, while on the lower picture you work on the page-property. What if you Add to the Decos-property-array a label-item?

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(4,758 Views)
Solution
Accepted by topic author TimBotsM

@Yamaeda

On your 2nd thought: I don't think I need to add the label to the decorations array and/or that it is possible since the parameter is "Read Only".

 

@tst

You got the answer indirect. I first created the example below to check if I could create a color box on the tab's.

2014-02-17 08_38_22-VI Scripting Origin.vi Block Diagram on Probe Configurator.lvproj_My Computer _.png

 

2nd I started browsing trough the style options in order to see if I could find something that would allow me to draw some other form of decoration. And by accident I found the "Label (system)" style (ID = 21961). So the following code generates a nice label on the tab and solves my problem.

2014-02-17 08_55_50-VI Scripting Origin.vi Block Diagram on Probe Configurator.lvproj_My Computer _.png

 

Message 5 of 6
(4,726 Views)

Although NI refers to Front Panel text as a free label, the style "Free Label" is only for Block Diagram labels. They have an arrow in the lower right that can be stretched to another object for documentation purposes. A front panel "free label" cannot have that functionality so cannot be used there.

0 Kudos
Message 6 of 6
(1,449 Views)