LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Tab control

Solved!
Go to solution

Hi guys, let me tell you what i am working on. I have four page (tab control). When i run the code, firstly a log in screen comes, i enter the username and password then an upload button comes, i press the button then uploading animation plays and finally at the fourt page real animation plays. But the problem is that when i enter an invalid password or username, it passes second page too. I dont want it. I want to call page 1 which contains login screen, If i enter an invalid value. Whenever i enter the right values then it must pass to the second part.

0 Kudos
Message 1 of 8
(4,528 Views)

Hello Omnom,

 

To answer your question, the reason it is going to tab 2 is because after that sequence in the flat sequence structure has executed (correct OR incorrect password) it will move on to frame 2 of the sequence. To fix this, you could put a while loop around frame 1 with your pop up and exit the while loop only on condition of correct password or error.. To better achitect your solution, I'd recommend you use a State Machine, you can find a link to make it here, sequence structures I pretty much only use for benchmarking and timing, not to control data flow.. 

CLD | CTD
0 Kudos
Message 2 of 8
(4,522 Views)

Hello Chris, I thank you for help. i already tried to put while loop but i took different errors like not passing second page. 

0 Kudos
Message 3 of 8
(4,514 Views)

Please post your code with the While Loop and errors. 

CLD | CTD
0 Kudos
Message 4 of 8
(4,510 Views)
0 Kudos
Message 5 of 8
(4,500 Views)

So I'm going to repeat what I said before, it's much easier to do this within a state machine, that way you can enqueue whichever state you want next within the previous state. Also, you need to exit the while loop programmatically, currently you have the first frame exiting the while loop after one single iteration, so if they hit cancel or wrong username/password, it will go to frame 2 and not go into the while loop.. 

 

 

CLD | CTD
0 Kudos
Message 6 of 8
(4,479 Views)

Try to use state machine which will most likely help you to take decision based on your input to the state selection and you just need only one event structure with many events as you wish.

Better way of coding is to avoid sequence structure whenever you can do a logic without using sequence structure.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 7 of 8
(4,446 Views)
Solution
Accepted by topic author Omnom

Please find the attached rough code which will make you to understand simple

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
Message 8 of 8
(4,440 Views)