LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how can I dynamically load a tab?

My VI is a tabbed panel that will display various bit fields within an FPGA.  These bitfields are represented by boolean indicators/controls, numeric indicators/controls, and some tables for memories.  Data is relayed back from the FPGA in the form of a string via a telnet connection.  My code parses this string (which contains data and address) and configures the relative front panel indicator/control accordingly.

 

This is all working fine.  The issue is that I'm worried about the size of my VI.  There are thousands of registers in this FPGA, and as I program in more regs, the size of my VI is increasing.  All of these thousands of controls and indicators are currently contained within my main VI.  However, they are organized by IP block and address within a case structure.  So the top level case switches on IP block, then a sub-structure on address within the block.  I say that to say that it's not like I have thousands of controls spread out over my block diagram, they are all organized.

 

What is the right way to dynamically load these things by their tab?  So for instance, I have 8 clients, each identical, but each with it's own set of unique regs.  Could I make it such that when the user clicks to Client 3 tab, then that tab is dynamically loaded, and it goes away when they click away?  How difficult is this to do?

 

Thanks for the help

0 Kudos
Message 1 of 6
(2,667 Views)

So I don't know if I have the full picture, but maybe something like subpanels would work here.  Where you load in the subpanel one at a time for the set of controls you want.  You could still have a tab control, or listbox as a list of items, then changing the tab or selecting the item in the listbox just loads that subpanel in and you use it.  Check out XTabs from Saphir here.  I'm not saying this is a solution for you, but it demonstartes tabs and subpanels in a way I am describing.

Message 2 of 6
(2,663 Views)

Exactly what Hoovah said!

 

Although you don't really need an xControl to do this

A subpanel / radio button solution scales well! as seen here


"Should be" isn't "Is" -Jay
0 Kudos
Message 3 of 6
(2,654 Views)

ok, this concept looks interesting...some questions to set my mind at ease...

 

I have an event structure in my main VI that uses dynamic event registration.  So for instance, all of RW controls get their control refnum put into an array (I use traverse for GObjects when the code starts up) and then I register that array for a Value Change event.  Would this integrate well?

 

Let me put it a different way...if I load a sub panel and click on a control within that sub panel, how do I get the event structure that's in my main VI to recognize that event and execute?  I understand I might have to change my main event structure, I'm just talking about conceptually.

0 Kudos
Message 4 of 6
(2,635 Views)

Customized radio buttons is a neat idea I hadn't thought of.  In my situation I dynamically load items into the subpanel and have no way of knowing until it runs, how many items there are that can be loaded into the subpanel.  For me this is why I use a single column listbox listing the VIs that can be loaded and clicking on one loads it into the subpanel.

 

As for the question about control references.  You could potentially scan through the subpanel VIs looking for the same references that you normally look for in the main.  Or you could have events go the other way where the subpanel registers for all controls it has (similar to your Main right now) and then it can generate a user event sent to the Main with the reference of the control that just changed.  This is just two of many different approaches and without knowing more its hard to say what would work best for you.

0 Kudos
Message 5 of 6
(2,627 Views)

no matter which sub-panel originates the event, I ultimately want to process it in the same way.  For instance, a subpanel A might have a button that when clicked writes to address 0xA, and subpanel B has a button that writes to address 0xB...but imagine it with 20 different subpanels each with 200 controls.

 

Without boring you with detail, I already have global arrays set up that have all the information about the masks and addresses associated with the controls in each subpanel.  Additionally, each control/indicator has a unique label that includes the index number within the global arrays where said information can be found.

 

So what I want to do is have a 'generic' event structure in the main VI, and the subpanels pass it the specific info it needs for when it runs.

 

To that end, my idea was to have an event structure within each subpanel, and any value change event that's within the subpanel triggers this sub-event-structure, which passes out the ctrl refnum.  The generic event structure now has a ctrl refnum, which means it has access to the label of the control which caused the event, which means it knows where to find all the info in the array.  The only thing I'm still wondering is the best way to trigger the 'parent' event structure.  It needs to execute each time a sub-panel event occurs...what's the best way?  Perhaps a global boolean that I simply invert it's Val(Sgnl) property each time a write occurs, and then the parent event structure is triggered on any value change event of said boolean?

0 Kudos
Message 6 of 6
(2,592 Views)