LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Switching between two VIs

I am writting a program in Labview PDA that has a login page and a main page. The login page is just entering a user name and password. If the password is wrong then an error message appears. If it is right then the program is supposed to "switch" to the main program. Right now I have them both in two different VIs but cant figure out how to combine the two so that the main vi runs after a successful login on the first VI.
 
Any suggestions?
0 Kudos
Message 1 of 5
(3,777 Views)

Hi,

I also faced a similar situation sometime back. The way I acheived it was to create Second.vi as a sub-vi in First.vi. Second.vi shows its front-panel when called and closes it later when exiting. In LV, it is possible to close the current VI and call another VI dynamically, thereby switching from one VI to another. To my knowledge, the same can not be done in PDA. So, inorder to create a switching effect, I used Second.vi as a sub-vi in First.vi. But here First.vi keeps running in the background and its front-panel is hidden by the front-panel of Second.vi.

In my application, I have a chain of screens created as sub-vis in the main vi which conditionally show their front-panels .

 

0 Kudos
Message 2 of 5
(3,750 Views)
Hi,
 
I tried doing something like that. I had a case structure that was being controlled by a boolean variable. If the password and username matched it would send a 'true' signal to the case structure. In the case structure i inserted my second.vi but when i run it nothing happens. Maybe i am not doing it right.
0 Kudos
Message 3 of 5
(3,742 Views)

If the password and username matched it would send a 'true' signal to the case structure. In the case structure i inserted my second.vi but when i run it nothing happens. Maybe i am not doing it right.

Probably, you could attach the code snippet that is doing this comparison.
we could take a look and suggest
 
regards,
Dev
0 Kudos
Message 4 of 5
(3,722 Views)

Did you set the Front-Panel Show properties? (VI Properties>Window Appearance>Customize> Show Front-Panel When Called , Close Afterwards if Originally Closed). If you set the above properties in the sub-vi, then it should show its front-panel whenever called.

Does that help?

-Shruti

0 Kudos
Message 5 of 5
(3,705 Views)