From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Event Structure and Menu Selection

I am using a custom run-time menu to fire events.

I notice that when I try to add an event (such as a value change event) to the event case already containing 'Menu Selection (User)', the Source item tag and item path terminals disappear.  It seems then that in this case, one is not able to add additional events to an event case configured to fire on a user event.  Or am I missing something?

Sincerely,

Don
0 Kudos
Message 1 of 8
(3,976 Views)
Hi DonRoth,
If you take a look at the 'Caveats and Recommendations for Using Events' it states that an event structure can handle multiple events, but they must be of the same type.
Hope this helps.
0 Kudos
Message 2 of 8
(3,966 Views)

Given LV's current way of passing data into events, these restrictions also make good logical sense. Think about it for a moment: If someone were to trigger the combined event by pressing a button, what would you set the item tag and item path data values to? Or for that matter, say someone fires the same event by making a menu selection. What would you set the NewVal data value to?

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 3 of 8
(3,961 Views)

Hi Mike:

 

There are easy ways with logic to handle the different firing of events by determining actually which event was fired.

 

Regarding the use of different events in the same case, note that I have used different event types in the same case in many applications.  One example is a 'mouse up' event on a control in combination with a value change event on a different control.  The advantage of this type of strategy is one does not have to duplicate event cases (which by the will be my workaround in this case - no pun intended) if the same actions are to occur in both cases.

 

Sincerely,

 

Don

0 Kudos
Message 4 of 8
(3,952 Views)

Oh yes, I have doubled-up events many times myself. The point I was making is that if you combine certain types of events it makes logical sense that the event data that is available would change...

Mike...


Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 5 of 8
(3,936 Views)

HI.. I am also doing tha same case.. Handling menu selection and value change in same event handler. Could you please let me know how to find which event is fired.

0 Kudos
Message 6 of 8
(3,407 Views)

There is a "Type" node on the left hand side of the event case you can look at to determine the event that fired the case.

0 Kudos
Message 7 of 8
(3,366 Views)

In this thread, they are using it for user created item. But I am using it for application item cut. So I started new thread.

Since I am using application item, I dont have any case structure for cut.So how can i check the type of event and fire different actions.

0 Kudos
Message 8 of 8
(3,331 Views)