LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 08/03/2009

One helpful LabVIEW feature that add-on developers frequently utilize is the fact that you can place VIs in the [LabVIEW]\project folder to create new entries in the Tools menu.  Did you know that you can also place VIs in the [LabVIEW]\help folder to have them appear in the Help menu?  Or the even less well-known [LabVIEW]\wizard folder to have them appear in the File menu?

 

This functionality has been around for a long time, and there are even some private VI Server properties that help you determine the VI from which the menu option was selected.  In LabVIEW 2009, I added a VI to vi.lib that will give you this information (it basically just wraps the private properties).  Check out [LabVIEW]\vi.lib\VIServer\Menu Launch VI Information.vi.  This VI will return the App reference of the owning app for the VI from which the menu item was selected, along with the VI name.   You can then wire these items to an Open VI Reference function to gain access to the VI from which the menu item was selected.

Message 1 of 6
(6,923 Views)

Very good nuget.
But there is a question: how could I assign a keyboard shortcut to so represented in, let's say File menu, VI? 

 

Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 2 of 6
(5,461 Views)
There is currently no G-based way to assign keyboard shortcuts to VIs that appear dynamically in the menus.  Any G-based menu items that ship with LabVIEW required modifications to LabVIEW source code to get keyboard shortcuts.
0 Kudos
Message 3 of 6
(5,449 Views)

 
I will reply myself 😉
Checked/works in LabVIEW 8.6:

File and Help - menu: Tools>Options> Menu Shortcuts
There is no such option for Tools menu 

And observed behaviour: defined this way shortcut is active only in this session LabVIEW - shortcut disappear after LabVIEW restarting, item in menu still existing 🙂 

Message Edited by Zbigniew StS on 01-07-2010 03:16 PM
Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
Message 4 of 6
(5,443 Views)
Oh, that's cool, I've only ever added G-based menu items to the Tools menu, so I didn't consider that it would (almost) work for File/Help menus.
0 Kudos
Message 5 of 6
(5,436 Views)
And behaviour LabVIEW2009: Tools> Options > Menu Shortcuts  - self-made menu items (ours VIs) are not shown in menus tree, but exist in menu.
Regards
Mikrobi (Zbigniew St. Sobków)____________________________________________________________
"You can lead a horse to water, but if you can get him to float on his back you've got something."
0 Kudos
Message 6 of 6
(5,415 Views)