09-14-2023 11:32 PM
I have one doubt is it possible to use one control in multiple pages of tab control in front panel.
09-15-2023 01:36 AM - edited 09-15-2023 01:36 AM
Hi shwethact,
@shwethact22 wrote:
is it possible to use one control in multiple pages of tab control in front panel.
Short generic questions yield short generic answers: Yes, that's possible.
09-15-2023 02:31 AM - edited 09-15-2023 02:31 AM
@GerdW: I'm pretty sure he meant "one and the same". If you also read it as that, then how it's possible? That'd be magic.
09-15-2023 03:59 AM
Hi MaSta,
@MaSta wrote:
@GerdW: I'm pretty sure he meant "one and the same". If you also read it as that, then how it's possible? That'd be magic.
No one forces you to place that control inside a specific page of your tab, it can hover over the tab…
09-15-2023 05:02 AM
@GerdW ha scritto:
Hi MaSta,
@MaSta wrote:
@GerdW: I'm pretty sure he meant "one and the same". If you also read it as that, then how it's possible? That'd be magic.
No one forces you to place that control inside a specific page of your tab, it can hover over the tab…
To do this, you have to place the control outside the tab, then select it with a mouse click, eventually move it by means of the arrow keys over the tab until it reaches the desired position. If you don't want that the control be visible on all tabs, you will need to set the control's Visible property depending on the Tab control value.
09-15-2023 11:24 AM
I would place a shared control outside the tab structure. You can always disable it based on the tab value if it should not be used when certain pages are selected.
09-18-2023 04:35 PM - edited 09-18-2023 04:35 PM
@shwethact22 wrote:
I have one doubt is it possible to use one control in multiple pages of tab control in front panel.
Yes, and there are many ways to do it...
But without seeing your code to know exactly what you are trying to achieve we can only toss out suggestions that may or may not be applicable in your situation.
For instance you can make your tab control smaller and place that one control outside the Tabs so it is always visible.
You can have a control on each tab page that do the same thing (control_0, control_1,control_2) and simply label them the same on the front panel. Then using an Event Structure when control_1 value changes the new value is written to control_0 and control_2 using property nodes.
09-18-2023 05:41 PM - edited 09-18-2023 06:09 PM
@altenbach wrote:
I would place a shared control outside the tab structure. You can always disable it based on the tab value if it should not be used when certain pages are selected.
I wouldn't use a Tab Container at all! Yes, I still hate tabs! My common approach to avoid the ungodly Tab container is to use a subpanel container instead and select the VI to load into that subpanel container with a custom Radio Button that looks and acts exactly like a tab page selection.
<EDIT>: The radio button CAN act exactly like a Tab page selector. But, you can also programmaticly access the enabled <enum> property for each Radio control button itself to hide some functionality based on user authority or prerequisites. Tab page selection has no comparable feature for the page selectors enabled state. Plus, I could choose to undock or even launch the sub.vis as Floating or Modal panels.
</EDIT>
This puts the code to handle each page in its single responsible vi and permits main.vi to concentrate on simply displaying the chosen groups of user interactions without needing to handle the minutiae of what and how each group interacts with the user. Reusable: Check, Scaleable: Check, Organized, readable and Maintainable: ✔✅🛫
And, of course, you can even use a common control on any of the subpanel.vis that need access to that common data value or, exclude that control wherever it isn't useful.
This approach easily address the original poster's problem without clumsy control visibility property management code or sloppy overlapping objects on the front panel of Main.vi
I hate tabs
09-19-2023 03:56 AM - edited 09-19-2023 04:31 AM
I have both in my current project, tabs and sub panels. Loading sub panels is a pita. Debugging is even worse (works only if you don't load the VI into the sub panel for debugging, else you cannot access the block diagram anymore).
Tabs, well, the handling is kinda easy. By the way: you can place sub panels in tabs. 😉
What's the benefit in sort of recreating your own tab, except from the fact that a sub panel control is a universal placeholder?
09-19-2023 04:23 AM
@MaSta wrote:
[...] Debugging is even worse (works only if you don't load the VI into the sub panel for debugging, else you cannot access the block diagram anymore). [...]
There is a "Allow User to Open Diagram" option in the right-click- menu for a subpanel in edit mode. If a VI is running in the subpanel you can right-click the subpanel and chose "Open Block Diagram".