LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do i create a drop down menu???

This is nothing to do with creating a run-time menu, rather it is to do with creating a sort of drop down or drop up menu selection with three or more options. I want to have a button at the buttom of the front panel, when you click on it, a menu which contains some options should appear (kind of Start button menu in Windows), and after chosing one option it disapears (the menu). How do i do it in LabView. Thanks
0 Kudos
Message 1 of 8
(3,951 Views)
This sounds like a MenuRing to me! In the Ring & Enum palette!
0 Kudos
Message 2 of 8
(3,944 Views)
Or a combo box (string palette), text ring, or enum.
0 Kudos
Message 3 of 8
(3,938 Views)
thanks, that did it. though, how can i make it interrupt my main program that's running continuously, or pause it anytime i choose a pause or stop option from the drop down menu. thanks
0 Kudos
Message 4 of 8
(3,928 Views)
you can create an event structure that will trigger an event upon a button hit. Now you will have to be careful when using an enum if you want to populate it dynamically. You cannot write directly to the strings property of an enum. I would suggest using a text box and right clicking on it to create a property node. Once you have created the property node then write to the strings property and you will be able to write an array of strings. You can programmatically remove your options from that array before writing it based on what button was hit. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 5 of 8
(3,912 Views)
I apologize. I meant to say a text ring not a text box... sorry... not enough coffee today.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 6 of 8
(3,911 Views)
There's several ways. One is to use the event structure. Another is a queued state machine. There are shipping examples of both. There are other examples on the NI Developer Zone. There was one called Pause-Resume State machine I believe but I don't have the link handy right now. Another way is to just wire your menu box to a case structure. If you have menu options of run, stop, pause, for example, your case structure's run case would have your existing program.
0 Kudos
Message 7 of 8
(3,910 Views)
Thanks dennis and BJD1613, i have already wired the enum to a case structure. It does the job, but with a slight delay as a result of the location i put the case structure in (at the begining of the main program, which runs in a while loop, if it's at the end it waits until the next iteration of the while loop to interupt the running of the program). I will have to modify it and try the event structure and run the main program in one of the event structures. Thanks for your help, and hope you have had some coffee today BJD1613.
0 Kudos
Message 8 of 8
(3,869 Views)