LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Menus and EventStructures

Hallo,

I have a rather strange behaviour. I've made a runtime menu with a couple
of entries (all are type UserItem).

Now I have an EventStructure which handles the event
MenuSelection (User).

Inside the EventStructure I get information on the selected item by reading
ItemTag which is wired to a CaseSelector.

The funny thing is: If I click let's say the item "Create new profile" this
event seems to be produced twice. The first occurence is handled by
EventStructure A. EventStructure B which is called after EventStructureA is
also configured to handle Menu Selection (User) and it triggers immidiately
returning the same ItemTag than StructureA. I can't accept this behaviour.

1. Do I have to "consume" the first event that it
won't be handled a second
time by another EventStructure. How could this be done?

2. Maybe there are two events produced. The first when I press the mouse
button on the menu entry, the second on releasing. Is this correct.

3. What exactly is "MenuTracking" and "Block menu" ?

Thanks for your help

Oliver Friedrich
0 Kudos
Message 1 of 3
(2,571 Views)
If I understood correctly, you've got 2 Event structures. If so you have to be very careful if they are placed in a loop.

I suggest you use only one Event Structure. See in labView help (Event structures) for more info on things to take care of when using event structures.
On menu items, you're doing the right thing when handling the event -> MenuSelection (User), the Tags enable you to process the events in a case Structure.
A single event is generated when selecting a menu item.

Hope this helps !
Julien
0 Kudos
Message 2 of 3
(2,571 Views)
Yes, parallel event loops where they handle the same events are not a good idea. Try the Queued Message Handler template.
0 Kudos
Message 3 of 3
(2,571 Views)