09-05-2017 02:34 PM
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.
09-05-2017 02:46 PM
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
09-05-2017 03:00 PM
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
09-05-2017 03:59 PM
@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.
09-06-2017 07:51 AM
@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
09-06-2017 08:30 AM
@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.
09-13-2017 11:40 PM
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.
09-14-2017 01:25 AM
09-14-2017 02:37 AM
@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.
09-14-2017 06:18 AM
There is nothing wrong in knowing new things, without mistakes did anyone became an Expert..
Thanks Gerd