LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Short Cut menu Selection Multiple Controls

I have a VI with some 38 graphs. I'd like an event that fires when the a selection from the short cut menu is made on any one of those graphs. I could create an event and add each graph with the "Short Cut Menu Selection (App) Filter" for each graph, but I was wondering if there is a better way to do it, maybe an event that fires off any XY graph or even control, and I could filter which one was selected.
 
Michael
0 Kudos
Message 1 of 7
(3,520 Views)

I might add these graphs are in tab controls. I have been playing with "SHort Cut Menu Activiation" and "Selection". Seems the "Activation" event for a tab control will fire regardless of where on the tab control the menu is activated, but the "Selection" event will only fire IF you select a short cut menu item for the tab control, not for the XY graph...

Michael

0 Kudos
Message 2 of 7
(3,511 Views)

Michael:

If I understand correctly, you are trying to create an event that will control all the waveform graphs on your front panel?. As you eluded to earlier, you can either create individual events that handle each waveform graph or add multiple other objects to one event. I will keep looking into this and let me know if you have additional information for me.

Regards,

Rudi N.

0 Kudos
Message 3 of 7
(3,495 Views)

Rudi:

I ended up adding every XY graph to a single event ( a very long and tedious task), but after that it was easy. I read in the control ref of the graph, made sure the shorcut was the "Export Simplified Image" selection, then saved my own image of the graph instead of the built in black and white image that LV saves. When I posted this I was kind of hoping there was a way to have a general event for any XY graph on the front panel, but it appears that isn't possible; events have to be specific to the control. Maybe in future LV versions. I think it would be a nice feature. I did think possibly about creating my own User Event, but I haven't played with those much so I don't know if thats even possible for this application.

Thanks for replying!

Michael

0 Kudos
Message 4 of 7
(3,493 Views)
There is indeed a more generic way to register for events, especially if all the controls you want to register events for are on a particular tab page or set of tab pages. You can dynamically register events using the Register for Events node in the User Events palette (it's moved around from LV7.1 to 8.x, so search for it).

As seen in the pic below, you can wire in an array of references for controls and select the event to register in this node. It outputs an Event Registration Refnum (try saying that 10 times in a row). You can wire this refnum into the Dynamic Events Terminal of the Event Structure. You don't see this terminal by default. You have to click the Event Structure frame and select Show Dynamic Events Terminal. After wiring it in, you'll be able to select your new dynamic event for an Event Structure case.

And voila! Any number of controls have registered events without any tedious navigation of the Configure Events dialog! This technique is also very useful for dynamically unregistering events when they're no longer needed, and of course for registering for User Events, which are data-only events that aren't bound to front panel controls. Search the site for User Events for more info on how to use all this stuff.

Message Edited by Jarrod S. on 02-26-2007 01:54 PM

Jarrod S.
National Instruments
Message 5 of 7
(3,489 Views)
Oops, the screenshot didn't come out just right. Note that the control reference array from the CtrlsOnPage property node should appear to be wired into the Shortcut Menu Activation terminal, not one of those upper terminals.

Message Edited by Jarrod S. on 02-26-2007 01:56 PM

Jarrod S.
National Instruments
0 Kudos
Message 6 of 7
(3,483 Views)

Great post Jarrod, I've been meaning to figure out Dynamic Events and your example helped a ton. I attached a screen shot of what I did to loop through each page and get the control refnum of the graph on each tab page. It assumes there is one graph per page. Works great.!

Michael

0 Kudos
Message 7 of 7
(3,471 Views)