ni.com is currently experiencing unexpected issues.

Some services may be unavailable at this time.

取消
显示结果 
搜索替代 
您的意思是: 

Programmatically create a free label on the frontpanel

已解决!
转到解答

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.

0 项奖励
1 条消息(共 6 条)
6,192 次查看

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 项奖励
2 条消息(共 6 条)
6,172 次查看

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!
3 条消息(共 6 条)
6,135 次查看

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 项奖励
4 条消息(共 6 条)
6,111 次查看
解答
接受人 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

 

5 条消息(共 6 条)
6,079 次查看

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 项奖励
6 条消息(共 6 条)
2,802 次查看