LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Anyway to programmatically add a page to Tab Control during VI execution?

I've read that this isn't possible. But those were old posts. I couldn't find anything more current so I'm hoping things have changed with Labview. 

 

Basically, I just want to have a regular Tab Control with a boolean button, and upon it's press a new Tab Page is added to the Tab Control. That is all. 

 

I read there is an Invoke Node for the Tab Control specified as Add Page, but it didn't seem to be there in my version of Labview. 

0 Kudos
Message 1 of 23
(6,814 Views)

You cannot add or remove pages of a tab control at runtime.  The pages are the owners of the controls and indicators placed on them.

 

You CAN, however, change the visibility of individual pages at runtime.  A tab control has a property called "Pages".  This is an array of page references.  Iterate over that array, perhaps looking for the "Page Label" property of interest, then use the "Page Visible" property (writing a Boolean) to get the runtime behavior you want.

 

Dave

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 2 of 23
(6,802 Views)

You can use sub-panels to make it LOOK like you added a tab page. But please explain why you can not add the tag page at development time and just show/hide the tab to get at the same end.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 3 of 23
(6,791 Views)

@DavidBoyd wrote:

You cannot add or remove pages of a tab control at runtime.  The pages are the owners of the controls and indicators placed on them.


 

 

Let me amplify my own earlier post:

You cannot add or remove pages of a tab control at runtime.  The pages are the owners of the controls and indicators placed on them.  Therefore, each page's existence is fixed at design time.

David Boyd
Sr. Test Engineer
Abbott Labs
(lapsed) Certified LabVIEW Developer
Message 4 of 23
(6,770 Views)

@DavidBoyd wrote:

@DavidBoyd wrote:

You cannot add or remove pages of a tab control at runtime.  The pages are the owners of the controls and indicators placed on them.


 

 

Let me amplify my own earlier post:

You cannot add or remove pages of a tab control at runtime.  The pages are the owners of the controls and indicators placed on them.  Therefore, each page's existence is fixed at design time.


And let me amplify David's point because it is the easiest and best solution provided you can establish what that "PAGE" will look like at development time. Simply hide/show as needed.

 

Have fun!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 5 of 23
(6,719 Views)

@ShogunOrta wrote:

I've read that this isn't possible. But those were old posts. I couldn't find anything more current so I'm hoping things have changed with Labview.  


TabControls are enums, and enums cannot change during runtime.

 


@ShogunOrta wrote:

 

Basically, I just want to have a regular Tab Control with a boolean button, and upon it's press a new Tab Page is added to the Tab Control. That is all. 

 


Even if you could add a page during run time, the would not be a way to add anything on it.

 


@ShogunOrta wrote:

 

I read there is an Invoke Node for the Tab Control specified as Add Page, but it didn't seem to be there in my version of Labview. 


If you turn on scripting, there is a method "Add page". But it doesn't work during run time (when the Vi is running), only during edit time. This might still be enough for you. You can script a control, and then start the VI it's on. But keep in mind that the program will never work in an executable before spending weeks on it.

 

I'd make a solution where there is a TabControl with enough pages. Show a hidden page whenever more are needed (within the maximum). When a page is selected, load the appropriate VI in a subpanel. You can make this look very (but not 100%) identical to a TabControl with dynamic pages. 

0 Kudos
Message 6 of 23
(6,710 Views)

how do we turn on scripting, can you please brief it...

 


wiebe@CARYA wrote:

 

If you turn on scripting, there is a method "Add page". But it doesn't work during run time (when the Vi is running), only during edit time.
0 Kudos
Message 7 of 23
(6,611 Views)

Hi Priya,

 

don't you think you should read the LabVIEW help first?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 8 of 23
(6,603 Views)

@PriyadarsiniS wrote:

how do we turn on scripting, can you please brief it...


If you don't know how to turn it on, it's save to say you don't want to turn it on.

 

Scripting is advanced stuff. It will only confuse you. It even confuses advanced users.

 

Also note that it will not solve your problem.

 

 

Message 9 of 23
(6,596 Views)

There is nothing wrong in knowing new things, without mistakes did anyone became an Expert..

 

Thanks Gerd 

0 Kudos
Message 10 of 23
(6,578 Views)