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
(3,492 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! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 2 of 6
(3,472 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
(3,435 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! ADDQ VIPM Now on GitHub
"Only dead fish swim downstream" - "My life for Kudos!" - "Dumb people repeat old mistakes - smart ones create new ones."
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 6
(3,411 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
(3,379 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
(102 Views)