Example Code

Programmatically Remove LabVIEW Run-Time Menu Items

Code and Documents

Attachment

Overview

This VI gives the user the ability to programmatically delete the LabVIEW Run-Time Menu options using Boolean controls.

 

Description

The code as attached, demonstrates deleting menu items that are part of a custom LabVIEW Run-Time Menu (.rtm file). The same code can be used for the default LabVIEW Run-Time Menu; however, to implement this functionality the Menu Tag and the Items inputs on the Delete Menu Items.vi need to be changed to match the default LabVIEW Run-Time Menu settings.

Requirements

  • LabVIEW 2012 or compatible

 

Steps to Implement or Execute Code

  1. Open the VI
  2. Navigate to Edit >> Run-Time Menu... and verify MenuExample.rtm is used
    1. If not, choose File >> Open... and choose MenuExample.rtm from downloaded .zip file
    2. Click Yes to any prompt
  3. Run the VI (notice the Run-Time Menu options are now limited to Menu1)
  4. Click any delete Boolean button and notice how the corresponding item is removed from Menu1
  5. All deleted Booleans will reappear when the VI is re-run.

Additional Information or References

2.png

 **This document has been updated to meet the current required format for the NI Code Exchange. **

 

Sam Burhans
Senior Product Manager
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.