LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

odd issue with dynamically loaded tab control

My VI lets the user choose a block of registers to view inside of an FPGA.  Based on what menu selection they make, a different tab view is dynamically loaded into a subpanel.  In some cases they might choose to view an entirely different block of regs, in others they may choose to look at the same block for a different port (i.e. the port 1 clock control vs. port 2 clock control...the views are identical, the only difference is the base address the regs are loaded at).

 

This all works fine with one exception.  If the user chooses to view the same block of regs, just at a different offset, the correct tab structure gets loaded in, and the view that's shown is of the first page of that tab structure, but that doesn't mean the first page is what is shown as selected.  A simple example:

tab_1.png

 

There are 2 instances of the ALS IP block in the FPGA.  A34 and A12.  Here I've loaded the regs for A34.  Notice that page 3 is selected (i.e. CSR3) and the first offset is 226: L2_SDH_CTRL.  Now, I will load the A12 version of the tab...it's identical in every way, it's just located at a different base address in the FPGA:

tab_2.png

 

Notice that now the first offset shown is at 0-6: L1_STATUS; however, notice that page 3 of the tab structure is the one selected, even though 0-6 is located on CSR1 (i.e. page 1).

 

In other words, the view underneath the page selection is completely correct and it's what I expect, it's just not showing the correct page selected.

 

When I load any tab into the subpanel, I first run the Abort VI method on the existing tab so that I start with a clean slate.  The code of the tab itself includes a Val (Sgnl) property write to the tab to select CSR1.  That seems to be working, because it's showing the contents of CSR1.  However, the page selected is always whatever was selected prior to loading this tab.  I actually took it a step further as a test to see if I could force it to select page 1:

tab_3.png

So the block diagram code you see there is part of the code that's executed when the ALS tab loads.  Yes, I know it's redundant...I put in all 3 writes there just to see if it made a difference (it didn't).

 

Hopefully that wasn't too confusing...this is kind of complex to describe.  Happy to provide more details if necessary.

0 Kudos
Message 1 of 5
(2,498 Views)

I have seen this occasionally in older versions of LV, but usually using the Value property would cause the tab to be displayed correctly.

 

I suggest you not bother too much to find out why this happening and just find a workaround. Some options:

  1. Defer and undefer updates.
  2. Hide and show the tab.
  3. Don't use tabs. Use subpanels instead.
  4. Don't show the tabs and use another method to select the page (like customized radio buttons or a ring).

___________________
Try to take over the world!
0 Kudos
Message 2 of 5
(2,476 Views)

Thanks for the info....

 

I tried unsetting and then setting both the 'Visible?' and 'Tabs Visible' property, but it had no effect.

 

Can you tell me more (or post link) about deferred and undeferred updates?  I've not heard of that.

 

I was looking for a way to simulate the user physically clicking on the CSR 1 page, but I don't think that's very straightforward.  There is a Pages[] property for the tab control, but it's read-only.  Really want to avoid changing the entire architecture as far as tabs vs. subpanels go if I can.  There's a lot of LabView scripting code that goes in to creating the tab structure automatically from a text file...

 

Thanks again for the help.

0 Kudos
Message 3 of 5
(2,457 Views)

nevermind...I found the Defer property and gave it a shot but no luck...in my routine that inserts the appropriate tab into the subpanel, I get a handle to the panel and set the DeferPanUpdts property to true.  After the tab structure has been inserted and is running, I then set that property false.  I assume that's the correct way to do it, let me know if not.

 

thx again

0 Kudos
Message 4 of 5
(2,452 Views)

I'm not surprised that the defer method didn't work, but I am surprised that hiding and then showing the tabs didn't work, as I would expect that to draw it from scratch. The last option I suggested should work, though, as it doesn't involve the tabs at all. It would require more code.

 

I can't think of anything else to suggest other than that you upload your code (ideally as a simplified example) so that we can see if we can see it too. Any other suggestion I would have would be to find other workarounds similar to the ones I already suggested.


___________________
Try to take over the world!
0 Kudos
Message 5 of 5
(2,443 Views)