LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

creating a simple main menu

Solved!
Go to solution

Hi all i'm very new to labview and would appreciate a hand with something. At the moment I'm trying to make a simple main menu which will open different vi's depending on which button is pressed. I've attached screenshots to demonstrate what im saying.

 

All i want is for each button to open a different VI, and also close the main menu so that i only have 1 window open at a time. So for example clicking deceleration should open deceleration.vi and close the main menu. I've tried to find out how to do this and discovered that i need to use event structures but beyond that i'm stuck.

 

Cheers, Iain

Download All
0 Kudos
Message 1 of 10
(4,058 Views)

Hi Iain,

you need only one event structure. Create an event case for every button and insert your code there.

Use the "Open VI Reference" function to get a reference to the vi you want to show. With an invoke node you can change the visibility state of it.

 

Mike

Message 2 of 10
(4,046 Views)

thanks Mike,

 

so when I add the open vi reference block what do i need to connect to it, presumably I have to specify the VI path but do i need anything else?

0 Kudos
Message 3 of 10
(4,040 Views)

Hi Iain,

 

Here is quick example I created.

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 4 of 10
(4,030 Views)
thanks Adnan Z, unfortunately I can't open the files as it says they were created using Labview 8.6 and the Uni only have version 8.5.1. Is there a way you can resave them so they're compatible? 
0 Kudos
Message 5 of 10
(4,028 Views)
Here you go.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 6 of 10
(4,019 Views)
I've followed your example through and got it so that it will close the main menu but it isnt opening the front panel of my sub vi. The only difference i can see is that the block for your sub vi has a number 2 on it whereas mine has a number 1, is this of any significance? Also when I put your sub VI in instead of mine it works properly. Cheers for the help so far, its been brilliant
0 Kudos
Message 7 of 10
(4,005 Views)
Solution
Accepted by topic author Robbo13
You have to set the property of your subVI. Goto File -> VI Properties -> Windows Appearance of my subVI and select the same options for yours.
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 8 of 10
(4,002 Views)
brilliant, thanks so much!
0 Kudos
Message 9 of 10
(3,957 Views)
At this point, let me just let you know that having a while loop within an event is not recommended since it can lead to abnormal program behavior; not happening in the example that I have provided, but just something to keep in mind. You should look into the producer/consumer (event based) design pattern which is part of the templates installed with LV. You can find it using the template browser (File >> New). Instead of using queues, you could probably use notifiers. Wish you luck with your application!
Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
0 Kudos
Message 10 of 10
(3,946 Views)