LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using tabs

Solved!
Go to solution

OK this is a sort of follow-up to some issues that were brought up in a former thread.

http://forums.ni.com/t5/LabVIEW/Code-best-practice-question-LV2013/m-p/2683385#M798201

 

In was brought up in the thread that two event structures in the same code can cause issue with the vi and is kind of a big no - no. Well that meant I had to sit down and figure out how to fix this. So what I came up with is a better way to pragmatically control the tabs of my program which is kind of a big backbone of what my program does and came up with the solution below. I felt kind of proud of the accomplishment so I published it.

 

https://decibel.ni.com/content/docs/DOC-34737

 

So is this better? Now there is only one Event Structure and program wise it works the same as the program I am currently working on.

Feedback is cool and appreciated.

 

Thanks

0 Kudos
Message 1 of 7
(2,817 Views)
Solution
Accepted by topic author Gearmiester

A lot better!  Of course, the discussion isn't complete unless I point out "I Hate Tabs."  and link to post 15 of this thread since you already have the Radio button anyhow

 


"Should be" isn't "Is" -Jay
Message 2 of 7
(2,810 Views)

Thanks for the response Jeff.

 

I can see by your linked thread that you found a way to create 'tabs' without using the tab control?

 

While the radio button control worked best for me in my application I didn't come to the solution easily as I had very specific needs (one big one was to be able to disable the radio button control as a sort of page lock)

 

But the big question I have now is can only one tab be active at a time? Is there a way to pragmatically enable a page that is performing a function - to keep performing that function while I bring up another page (without it being a pop-up)

 

Specifically in my example code page 5 is outside the radio button. If the radio button control is disabled via the rotation control on page 1 and I bring up page 5 via the separate Boolean, will page 1 stop sending info to a real-time or FPGA device? If so then this is not good and I have need of finding yet another way to operate pages...

0 Kudos
Message 3 of 7
(2,792 Views)

A tab is primarily a cosmetic display. It is irrelevant to what code is or is not being executed. You do not need any case statement wired to the tab control.

Message 4 of 7
(2,785 Views)

Thanks for the reply Dennis.

 

Can you explain this comment a bit more?

 

"You do not need any case statement wired to the tab control."

 

Are you referring to the tab control that is selecting the case in the case structure on the diagram? If so then how would I call each of the pages to the top level for access by the user without creating a redundancy in the code?

 

Or do you mean that the code that is operating in a specific case does not depend on which case is called by the tab control?

 

BTW I am freezing in my office this morning -> 50 deg Robot Frustrated

 

 

0 Kudos
Message 5 of 7
(2,727 Views)

I have typically used a tab control along with a state machine. I set the tab by writing to a local variable or value property. It is the state that determines which code to execute. If the user wishes to view a different page, it can be selected if the program sets the tabs to be visible. 

0 Kudos
Message 6 of 7
(2,711 Views)

OK that makes sense to me.

 

Although the program code for the front panel does not use state machine control I may need it somewhere else with the real time mod or FPGA. I haven't gotten that far with it yet.

 

As far as the tabs being visible during run mode; they are not, as the radio button control determines the visible page in my program.

 

This is the current front panel in 'run' mode - - hmm won't allow me to ad an attachment...

0 Kudos
Message 7 of 7
(2,699 Views)