LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

LIKE TO USE MENU TO START SUB VI

I CAN USE A BUTTON TO RUN A SUB PROGRAM (KEEPING THE MAIN AND SUB PROGRAM CYCLING). BUT WHEN I TRY TO OPEN A SUB PROGRAM USING A CUSTOM MENU CHOICE, EITHER THE MAIN PROGRAM STOPS CYCLING, BOTH STOP CYCLING, SOMETIMES IT WORKS THE FIRST TIME BUT NOT THE SECOND. I HAVE TRIED SEVERAL DIFFERENT WAYS, BUT HAVE NOT FOUND AN ANSWER. WHAT I WANT TO DO IS USE THE MENU CHOICE TO WORK LIKE THE BUTTON CHOICE. SAMPLE PROGRAM ATTACHED. THANK YOU ALL FOR YOUR ASSISTANCE. DOGFACE
0 Kudos
Message 1 of 4
(2,713 Views)
Hi

The problem why it does not work is that you can not determine if an item was selected with the function you use.

Try it with an event structure. There you can configure a case that catches an event, if a menu selection was made.

Hope this helps.

Thomas
Using LV8.0
--------------------------------------------------------------------
Don't be afraid to rate a good answer... 😉
--------------------------------------------------------------------
0 Kudos
Message 2 of 4
(2,704 Views)

@dogface wrote:
... WHAT I WANT TO DO IS USE THE MENU CHOICE TO WORK LIKE THE BUTTON CHOICE.

dface,
You can use an Event structure as becktho suggests, or you can get your demo working the older fashion way if you:
1) Replace the menubar refnum with a "Current VIs Menubar" refnum constant,
2) Use the "Get Menu Selection" function instead of "Get Menu Item Info".
=====================================================
Fading out. " ... J. Arthur Rank on gong."
0 Kudos
Message 3 of 4
(2,684 Views)
THE ANSWERS THAT I GOT WORKED LIKE A CHARM. YOU HAVE NO IDEA HOW GREATFUL I AM FOR THIS HELP. DOGFACE
0 Kudos
Message 4 of 4
(2,675 Views)