|LabVIEW 2016 Help|
|LabVIEW 2017 Help|
|LabVIEW 2018 Help|
|LabVIEW 2019 Help|
|LabVIEW 2020 Help|
Use VI scripting to define actions that LabVIEW performs when you select a custom item from the shortcut menu.
|Note Generate the files you need to create a shortcut menu plug-in by running the following utility VI: labview\resource\plugins\PopupMenus\Create Shortcut Menu Plug-In From Template.vi|
|Note To avoid name conflicts, National Instruments recommends prefixing the filename of any additional VIs and subVIs with the name of the plug-in or using a project library. For example, name subVIs as x_subVI.vi or save additional VIs and subVIs in the project library x.lvlib, where x is the name of the plug-in.|
|Tip To reload plug-ins without restarting LabVIEW, create an empty VI, add the Invoke Node to the block diagram, configure the Invoke Node for the Menus:Refresh method, and run the VI. This method is also useful if you write an installer for your plug-ins. You can run the method as part of the installation process. If you use the JKI VI Package Manager (VIPM) software to distribute your plug-ins, add the Menus:Refresh method to the post-installation VI.|
To protect VI scripting operations when the plug-in execution VI runs, LabVIEW calls the Set Busy VI to disable the mouse. After the plug-in execution VI runs, LabVIEW calls the Unset Busy VI to enable the mouse.
You can instruct LabVIEW to automatically wrap your scripting operations in an undoable transaction by using the Transaction Control? of the build VI (x.vi, where x is the name of the plug-in). Alternatively, you can instruct LabVIEW not to control transactions in the build VI so that you manage your own transactions in the plug-in execution VI. If LabVIEW automatically creates the transaction, configure the Fail Transaction? output of the plug-in execution VI to return TRUE if this VI does not run successfully.
|Part 2: Building the Shortcut Menu Using Plug-Ins||Understanding Shortcut Menu Plug-Ins|