LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Link Menu Event and control event

Solved!
Go to solution

I would like to have a menu item that performs the same function as a control event ("Save" or "Print"). Because there is only an event case for general "menu selection," it appears that I cannot just add an event for a specific case.

 

For example

Save Data case:

Button: Save Data

Menu Item: Save Data (Ctrl+S)

 

Print case:

Button: Print

Menu Item: Print (Ctrl+P)

 

 

Is there a way to do this without just duplicating the entire event case?

0 Kudos
Message 1 of 9
(2,981 Views)

Create a user event that corresponds to the control. When the menu item is activated simply fire off the user event and pass and necessary data in the event itself.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 2 of 9
(2,977 Views)

Thank you!

 

I am unfamiliar with user events, so I will have to do some research on them.

0 Kudos
Message 3 of 9
(2,964 Views)

Use Producer Consumer with Events template to start

 

In the consumer decode the event into a case structure by reading the menu item or menu tag string.

 

 

Heres a simple example

 

 

Download All
Message 4 of 9
(2,957 Views)

Thank you both. I have spent some time looking at the two methods, and I think I can make the second work. I'm still having a hard time understanding registered events, and how and what they cause to happen. It seems like an important concept, so I'll keep working at them. I've spent quite some time with the .vi provided in "help" for "Programmatically Fire Events." Is the "event structure" the same as the "event handler?" So it goes through the standard event case structure? If you have any ideas for clarifying this concept, I'd greatly appreciate it. 

0 Kudos
Message 5 of 9
(2,944 Views)

Yes, user events are processed in the event structure with the other standard LabVIEW events (value change, mouse up, menu eents, etc.). User events are very useful and are worth the time to learn.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
0 Kudos
Message 6 of 9
(2,933 Views)
Solution
Accepted by topic author emc08

Hi emc08,

  You implement your requirement using a dynamic events(user defined events).I had attached a VI for your referece.

 

 

Thanks and regards,

srikrishnaNF

Regards,
Srikrishna


Message 7 of 9
(2,925 Views)

Thank you very much for your help. I think I have a handle on these now.

0 Kudos
Message 8 of 9
(2,898 Views)

Hi emc08,

  Then what about kudos?Smiley Sad

 

 

regards,

srikrishna

Regards,
Srikrishna


Message 9 of 9
(2,886 Views)