From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

auto caption creation

Solved!
Go to solution

Hello,

 

I have large front panel with more than 200 controlls on it. Some of them have caption some have not.

I want to create caption for all controlls. Is there an easy way to do that?

I have created recursive VI that gives me reference to all controlls on FP but what should I do next??

 

0 Kudos
Message 1 of 9
(3,313 Views)

check the property "Has Caption", if it has caption move on, if not set the property "Caption.Text" = "Label.Text".

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
0 Kudos
Message 2 of 9
(3,296 Views)
Solution
Accepted by topic author pawhan11

It is probably worth mentioning that the VI MUST BE IN EDIT MODE for my above instructions to work! In order to do this, use the "Open VI Reference" primitive, then get the "Front Panel" property, then controls of said "Front Panel"... All of this MUST be done from a separate VI than what you are trying to set captions. Please see this helpful blog post from Darren.

Charles Chickering
Architecture is art with rules.

...and the rules are more like guidelines
Message 3 of 9
(3,284 Views)

Thanks, I have found it. It works just like You said 🙂

0 Kudos
Message 4 of 9
(3,262 Views)

Hi pawhan11

 

Not sure if you're aware but you can easily get an array of references to all controls on the front panel like this ...

 

All controls.JPG

 

0 Kudos
Message 5 of 9
(3,255 Views)

Yes I know that, but when You have muptiple tab controlls,  clusters and so on, getting all references is more complex... Or I am doing it wrong way ?

0 Kudos
Message 6 of 9
(3,231 Views)

@pawhan11 wrote:

Yes I know that, but when You have muptiple tab controlls,  clusters and so on, getting all references is more complex... Or I am doing it wrong way ?


Use Traverse for GObjects.vi.

Example_VI_BD.png

 

Adding to the links to Darren's blog - http://labviewartisan.blogspot.com/2009/06/labview-scripting-tip-1-power-of.html

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 7 of 9
(3,223 Views)

Good to know there is something like that 😄

Bad is that I intil now had to write recursive vi to get controlls references on my own 😞

0 Kudos
Message 8 of 9
(3,209 Views)

Hello!

 

I just had a similar task to the original poster (I wanted to get and set captions programmatically) and overlooked an important part of the error message (Error 1320 When Setting a Caption Property). My frontpanel also had too many objects to add all captions by hand. I wanted to stop by to add the direct link to the blog post containing the details behind the answer, as it has moved down the timeline since http://labviewartisan.blogspot.com/2012/02/captions-more-than-you-ever-wanted-to.html

 

0 Kudos
Message 9 of 9
(2,063 Views)