LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

toggle between subVI's

Hello all,

I need your help! I'm adjusting, for someone else, a program built by
someone else! :-S,
first let me discribe the problem:

I have a Main VI with 5 subVI's in the Main menu (Main VI) a Bolean
turns a Case structure False or True(5 times for the 5 subVI's), in
this Case structure there's a sequence struct with in there a sub VI.
Two subVI's are used most frequently and I need one button or switch
to toggle between them, without going back to the Main VI. what do I
have to do?

Both SubVI are quite large programs in an 'eternal' While Loop only to
return with 'Back to Main Menu' button, constructed in the most common
way (button via a 'not' to the while condition of the while loop)

Thanks in advance!!

Michel
0 Kudos
Message 1 of 4
(2,719 Views)
Michel (spelled like a French name, n'est pas):
I am not sure what you are trying to do. Perhaps an example would make it more clear. Are you trying to jump to vi2 while inside vi1, and then jump to vi1 while in vi2? If so, you would need buttons in each vi to run the next vi. Or maybe you are trying to start one of two vi's from the main loop, with the vi being chosen by some button or condition. You could put a Message Dialog Box vi inside your Case structure, asking the operator which vi to run. Does this help? If not, please include an example of what you are trying to do.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 4
(2,719 Views)
tbob,

Yes, Michel is a French name, but I'm Dutch... (life was not meant to
be easy)

The problem is the one you stated: I am trying to jump to vi2 while
inside vi1 and vice versa. now this is done by a "Back to main menu"
button and then select vi2 from the main menu, but i'd like to reduce
this '2 button action' to a 1 button action. the big problem is to get
out of the while loop from vi1 and to go to vi2, and the other way
around, vi2 -> vi1, is the same problem. You say I need buttons in
each VI to run the next, like I said the buttons are not my biggest
concern, I just need a function/button/pop up menu/whatever/etc. in
one VI that closes the while loop,from that VI, and 'jumps' straight
to the other VI. but 'the back to main menu' function has to rema
in,
while these 2 vi's or not the only ones in the whole program.

Hope this makes it a bit more clear and thx for the help!!
Michel
0 Kudos
Message 3 of 4
(2,719 Views)
See the attached example. This is an example of a state machine. Pay attention to the button mechanical action settings on VI1 and VI2. Also notice the VI properties custom settings to show front panel when opened and close after running if initially closed. Open the llb and run the main vi. A dialog box appears asking to run vi 1 or vi 2 or stop. Choosing 1 or 2 will run that vi. Inside vi1 are two buttons, one for switching to vi2 and one to go back to main. Same for vi 2. You can switch back and forth or go back to main from either vi 1 or vi 2. Hope this helps.
- tbob

Inventor of the WORM Global
0 Kudos
Message 4 of 4
(2,719 Views)