LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

tab control

Hi 

I have a problem : i use a tab control with multiple pages , the first three pages run  but when  i add other page only the last one run. 

please can any one help me.

 

Download All
0 Kudos
Message 1 of 13
(4,784 Views)

Hi Chaabane,

                        Dont use these many case structures for your code. you have used 4 case structure and all the four you have marked default for a condition so what happens is irrespective of the tab input all the case will run simultaneously . so you a single case structure and pass the tab control as input (Refer image below) and place the corresponding code inside the particular case and your issue will be solved.

 

tab.jpg

 

The reason behind your 3page tab not showing any issue is that you havent used any loops for the 1st 3pages, for your 4page tab program you have used while loop so you are getting this error. 

 

 

Kudos are Welcome 😄 

 

 

Certified-LabVIEW-Associate-Dev_rgb (1).jpg

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
Message 2 of 13
(4,736 Views)

You are using the tab control wrong.

 

A tab control is meant to be an organizer for your front panel controls.  It is very rarely actually a control that is read and somehow used to control your VI.  The architecture of your VI needs to be redone because the tab control is read once at the very beginning of your program, never to be read again.  If it is anything but the 4th tab, one of the other case structures execute and your VI immediately stops.

 

Redo your whole architecture.  Have one while loop where everything occurs, or have 4 separate while loops one for each type of control system.  Get rid of the case structures, and the tab control terminal shouldn't need to be wired to anything.

0 Kudos
Message 3 of 13
(4,703 Views)

Hi RavesFan,

                         The statement you gave is wrong .Tab control is not only meant to be an organiser for front panel controls it can also be used as control. it is actually a enum control. kindly see to the descriptiion below.

 


On the block diagram, the tab control is an enumerated control or indicator. As a control, you can pass the value of the active page to other block diagram nodes. As an indicator, you can wire nodes to control which page is displayed. You do not need to wire the tab control terminal for the tab control to operate.
Tip  You can wire the enumerated control terminal of the tab control to the selector of a Case structure to produce cleaner block diagrams. With this method, you associate each page of the tab control with a subdiagram in the Case structure. You add the control and indicator terminals from each page of the tab control—as well as the block diagram nodes and wires associated with those terminals—into the subdiagrams of the Case structure. If you need a component of a VI to run continuously, even when its controls are hidden, do not use a Case structure, because the structure executes only one case at a time.
 

 

Refer to the Link below for details

http://zone.ni.com/reference/en-XX/help/371361J-01/lvhowto/creating_tab_controls/

 

 

Certified-LabVIEW-Associate-Dev_rgb (1).jpg

 

 

 

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
Message 4 of 13
(4,665 Views)

@SanthoshJoel wrote:

Hi RavesFan,

                         The statement you gave is wrong .Tab control is not only meant to be an organiser for front panel controls it can also be used as control. it is actually a enum control. kindly see to the descriptiion below.


Let me put it this way.  Nearly every time I have used the tab control to control how my application runs, it turns into a big giant mess.  Just because you can do something does not mean you should.  What the OP has here is a huge archetectural issue.  In fact, I would say that the OP should actually have 4 different VIs.

 

The only time I use the tab control's enum is on a value change with an event structure to do something for the GUI (usually disable certain controls).


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 5 of 13
(4,613 Views)

Hi Crossrulz,

                      It depends on the type of application. If its a simple one and the need arrises its not an issue. Since you are a good programmer you are saying this but we cannot expect everyone to be a good programmer. We can guide them to be a good programmer. But what i meant to say is even in NI description for Tab Control they have said that. 

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
0 Kudos
Message 6 of 13
(4,607 Views)

SanthoshJoel wrote:  Since you are a good programmer you are saying this but we cannot expect everyone to be a good programmer. 

I would not hire a bad programmer.  If you are not a good programmer, then you should learn from the good ones.  Just because somebody is not a good programmer does not mean you should teach them bad habits.  The idea is to teach them good habits so that they may become a good programmer.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 7 of 13
(4,604 Views)

 

@crossrulz wrote:


I would not hire a bad programmer.  If you are not a good programmer, then you should learn from the good ones.  Just because somebody is not a good programmer does not mean you should teach them bad habits.  The idea is to teach them good habits so that they may become a good programmer.


tab.jpg

 

 

See to this . ...

Certified LabVIEW Developer
Best LabVIEW Programmer @NIDAYS 2015
0 Kudos
Message 8 of 13
(4,592 Views)

In the image you posted it says "Tip:  You can wire the enumerated control to a case structure.... "   It doesn't say "you should" or "you must".

 

 

Also read the later part of the paragraph,  "If you need a component of a VI to run continuously, even when its controls are hidden, do not use a Case structure, because the structure executes only one case at a time."

 

That is the situation you have here.

 

My statement is not wrong.  It fits entirely within the statement NI made in that help file.  When you come to the forums asking for help, I suggest you listen and learn rather than dismissing people's statements to you.  People will be much more willing to help you be successful in your project.

0 Kudos
Message 9 of 13
(4,566 Views)

@chaabane wrote:

Hi 

I have a problem : i use a tab control

 


We love you chaabane!  (Anyone who has ever heard of "The Big Book" should get that joke)

 

Seriously, I dislike "Tab Containers"  Not Tab Controls- they are Containers!  

 

Are you using the "Run Continuous" Button?  Don't do that!  Put a while loop around the Tab Container so that its value may be read more than once.  And what is the point of single case case structures?  The semantics of three of your Case stuctures is:

 

If Tab Value is equal to "XYZ" do "This" Otherwise, do the same thing.  Sounds funny when you state it that bluntly doesn't it?


"Should be" isn't "Is" -Jay
0 Kudos
Message 10 of 13
(4,557 Views)