01-21-2014 05:48 PM
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??
Solved! Go to Solution.
01-21-2014 06:49 PM
check the property "Has Caption", if it has caption move on, if not set the property "Caption.Text" = "Label.Text".
01-21-2014 07:02 PM
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.
01-22-2014 03:08 AM
Thanks, I have found it. It works just like You said 🙂
01-22-2014 03:17 AM
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 ...
01-22-2014 12:04 PM
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 ?
01-22-2014 12:16 PM
@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.
Adding to the links to Darren's blog - http://labviewartisan.blogspot.com/2009/06/labview-scripting-tip-1-power-of.html
01-22-2014 12:32 PM
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 😞
11-23-2020 09:53 AM - edited 11-23-2020 09:54 AM
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