LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab control - how to go to a specific tab when counter goes to zero?

I have a tab panel in my VI. Right now I would like it so that the VI goes to the last tab once a counter reaches zero (having started at 15 seconds). Any idea how I program that into the VI?

0 Kudos
Message 1 of 6
(3,162 Views)

Example_VI.png

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 2 of 6
(3,160 Views)
You have the solution to what you asked, but you might want to consider a different approach. Instead of using tabs, use subpanels. You can get the same user experience, and your software will be simpler and easier to maintain.

http://www.notatamelion.com/2015/02/09/building-a-subpanel-based-user-interface/

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
Message 3 of 6
(3,127 Views)

@mikeporter wrote:
You can get the same user experience, and your software will be simpler and easier to maintain.

I think what you meant to say is your code is more scalable, more modular, and more reusable using subpanels.  But I wouldn't call subpanels "simpler" than a tab control.  Users gravitate to tabs because they are so simple.  Plop down a single control and put stuff in it that you want.  I prefer subpanels, but I'd call tabs simpler to use than subpanels.

Message 4 of 6
(3,099 Views)
No, I meant simpler.

Say you have an interface that you want to have 4 selections. With tabs you have 1 VI that needs to handle 4 distinct interfaces. With subpanels you have (at most 4) VIs each handling exactly one thing. And if the VI in the subpanel is reentrant, you only have 1 VI that you are reusing 4 times. Any way you slice it, that is simpler.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 6
(3,080 Views)

I respect you, but I don't fully agree.  Beginning developers aren't thinking about scalability when they develop software.  They have a single large while loop with all their code running in it.  If they want 4 charts they make 4 charts.  This work great and each chart takes up 1/4 of the screen.  Then they realize they want 5 charts, but they don't want to reduce the size of the charts.  The code already runs, and updates all 5 charts, but they want an easy way to show one of the 5 at a time.  Step 1: Drop a tab down, Step 2: Put each chart in a tab.  

 

Or a beginner will need to drop a subpanel down, then a way to select what VI goes into that subpanel.  Now they need a listbox, or a drop down, which indexes an array of VI references.  What's a VI reference they ask?  How do they use these references?  How do they properly cleanup and close these references?  Do they need to make 5 VIs one for each graph?  Or just one that is reentrant?  Either way there is more files on disk, and more files to keep track of.  Wait what is a reentrant VI?  And how in the world am I supposed to pass data into my running VIs?  They had the data on the wires in the main but now what?  Queues?  User Event? Native Global?  They will likely pick a native global, and then they'll ask: How do I know when there is new data?  If I poll a global I have no way of knowing when the data was updated last.

 

These two scenarios have pros and cons of each.  Again I would not call the subpanel method simpler, I would call it better, more reusable, extensible, modulare, etc.  But I wouldn't call it simpler.

Message 6 of 6
(3,063 Views)