LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Control a VI with Menu and Buttons

Hi,

I'm a beginner in LabView, so my question could be very easy. However, I
have not found a solution yet.

I have a VI which is controlled over buttons using an event structure.
Now I want additionally control the same VI with a menu, so that the
user can either use the buttons or the menu.
How can I realize that?

I would be very happy, if someone can explain to me an easy way how to
solve this problem. Perhaps a small Example-VI would be very helpful.

Martin
0 Kudos
Message 1 of 5
(3,133 Views)
With the event structure, you have Menu Selection (User) and Menu Selection (App) with the event source set to . There is a shipping example called Menu Selection with Events. If you browse the the NI Example finder, you can find it a Building User Interfaces>Menus and Toolbars.
0 Kudos
Message 2 of 5
(3,133 Views)
If you want the action to occur with either the button click or menu selection, configure the event case to watch for both events by selecting "Edit Events handled by this case", then in the top portion where you select the 'Event Specifiers', click the plus sign to add another event for that case.

Then follow what Dennis said and you'll have a single case that will react to both events.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 3 of 5
(3,133 Views)
Thank You for your fast response.

At the moment it works fine the way you described, if I'm using only one
button.

But in my VI I'm using 4 Buttons corresponding to 4 different events of
one eventstructure. Made I any fault in the realization or do I have to
choose a different way, if I want to use the 4 buttons and 4Menu-Items
to control the VI?

Martin
0 Kudos
Message 4 of 5
(3,133 Views)
Looking at my last comment, I think I may have confused you a bit. I stated something that's not quite correct.

The Menu selection for the Event Structure should only be configured to a single event case in the event structure. But you can still have a menu selection trigger an event case that is also triggered by a button.

The attached example shows how to setup for what you want to do. The menu selections trigger the Menu event, then there's a property node for the correct cases to trigger the button so it's event case will run. I put a delay in there just so you can see that two events are triggered when you select a menu.

Hope this helps more than last.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
0 Kudos
Message 5 of 5
(3,133 Views)