LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can i create a large number of identical tabs?

I have searched around and found nothing on the topic.. what i am looking at here is this.

 

I have currently set up two tabs that are identical, each representing a component on a device and the component is selected when the user clicks on the tab.

 

For example, if i switch to tab two, i select component two.

 

Now these tabs are identical, same controls same indicators and so on.. what i want to know is if it is possible to make it so that say.. if i tell it i have 5 components, it would show 5 identical tabs. if i told it it had 20 components it would bring up 20 and so on. At the moment i am looking at having to create each tab one by one and then hiding them..

 

Thanks for your time and any help at all is greatly appreciated 🙂

0 Kudos
Message 1 of 14
(3,095 Views)
Your idea does not scale well. If all control sets are identical, only one set is needed. No tabs. Use an array of settings on the diagram, one element per device. Use a selector to pick the instrument, and whenever it changes, Fill the controls with the current values of the newly selected instrument. See how far you get... 😉
0 Kudos
Message 2 of 14
(3,090 Views)

altenbach--this problem could be phrased a little more generally though:  some, but not all types of controls could appear on each tab, while other controls are unique to particular tabs.  I've encountered exactly this situation, and I don't have a good way to duplicate the exact location of the common controls on each tab.  Can "copy and paste" be done "in place" somehow?

0 Kudos
Message 3 of 14
(3,069 Views)

Have you tried right-clicking an existing tab page and select "duplicate page"?

0 Kudos
Message 4 of 14
(3,057 Views)

I will try the "duplicate page" option when I get back on Tuesday lol. Sounds simple enough... but even so, that just means I have to make a whole bunch and then hide them all again...

 

Your original idea sounds the best even though it will mean re doing all the code.. definitely sounds a lot simpler. Thanks 🙂 I will explore the options.

0 Kudos
Message 5 of 14
(3,049 Views)

Where do we find "duplicate page"?--I don't see it as a right-click option.  I see in the help that there is a "duplicate page" function associated with VI scripting.  What would be really be nice is "duplicate control on all pages", so that individual changes can be made after the pages already have stuff on them.

0 Kudos
Message 6 of 14
(3,012 Views)

I would strongly second altenbach's original post.  It is far easier and scalable to create all the controls you need on a single interface, then hide/show them and populate them with appropriate values as needed.  Maintaining twenty or more tabs with virtually identical controls would be difficult, at best and highly error prone.  If you really need different functionality in the tabs, I would recommend you use subpanels and implement as different VIs (using LabVIEW classes makes this even easier/better).  From your questions, you can probably implement twenty different options with only a few subVIs.

 

Full disclosure - I consider tabs a poor UI choice when there are more than four or five leaves.  At that point, you are usually better off using a selector of some sort and subpanels to implement the functionality.  It is much easier to maintain, as well.

Message 7 of 14
(3,006 Views)

 


@bracker wrote:

altenbach--this problem could be phrased a little more generally though:  some, but not all types of controls could appear on each tab, while other controls are unique to particular tabs.  I've encountered exactly this situation, and I don't have a good way to duplicate the exact location of the common controls on each tab.  Can "copy and paste" be done "in place" somehow?


 

Using altenbach's approach would be best. If you have a handful of specific controls but most are common you can control this by showing/hiding control. When the user selects the type of device you could show/hide the controls which are not common to all. Using this approach you could place controls on top of each other as long as only one would be visible at a time. This saves on diagram space and gives you a clean interface. Internally you use an array of clusters. If you may have different clusters you can decide if the differences are significant enough to warrant using different cluster definitions or simply having a few parameters that do not apply to all devices included in a single cluster definition. The controls on the front panel itself do not need to be in a cluster since they are only there for the UI. This gives you a bit more freedom in laying out the front panel. Anything that uses typedefs (ENUMs for example) should share the same typedef though.

 

If you feel very ambitious and think you may reuse this control in several applications you could implement this as an X-Control.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 8 of 14
(3,005 Views)

Guys, thanks.

You've brought up a few of the issues I was thinking about a couple of months ago; at the time, I just settled for a tab control (I only have 3 tabs, so my issue is a little different than Ryzhawk's in that sense).  I need more time to look into your suggestions, which I can't do at work today, but I'll come back with a few more questions in a day or so.

0 Kudos
Message 9 of 14
(2,993 Views)

 


@bracker wrote:

Where do we find "duplicate page"?--I don't see it as a right-click option.  I see in the help that there is a "duplicate page" function associated with VI scripting.  What would be really be nice is "duplicate control on all pages", so that individual changes can be made after the pages already have stuff on them.


 

You need to right-click on a tab or on the tab border in order to get the correct right-click menu. Try it!

(If you right-click inside the main area, you get the palette of course)

0 Kudos
Message 10 of 14
(2,981 Views)