Example Code

Programmatically Load Custom Run-Time Menu Using LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Download All

Overview

This VI shows the way of changing Run Time Menu of VI programmatically.

 

Description

There may be a situation where you need to programmatically change the Run-Time menu for your VI. For example, if you have a large VI that incorporates a few different tests, during the execution of a given test, you need to have a limited run-time menu. However, during other parts of the program, you need to have a completely different, less restrictive, Run-Time menu.

 

Requirements

Software:

  • LabVIEW 2012 (or compatible) 

 

Steps to Implement or Execute Code

1. Extract the 7z file to any folder.

2. Run the VI.
3. Flip the switch between "Menu #1" and "Menu #2".
4. Notice that the Run-Time menus change depending on the positions of the boolean switch.

 

Additional Information or References

 

 2012.png

 

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

 

 

Hope this helps.
-Ben

WaterlooLabs

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

Comments
Phil_
Member
Member
on

Useful Stuff!

Thanks.

YuChuanHuang
Member
Member
on

Thanks for saving  a lot time!

Well Done!

JastrebokELI
Member
Member
on

Please note that you can also use an RTM of your choice for controls. It needs a hack though.

 

1) Generate the desired swappable menu as if it was your VI menu and save it using Save->Run-Time Menu invoke node on This VI. (e.g.: MyMenu.rtm)

2) Link this RTM to your control or indicator using Advanced->Run-Time Shortcut Menu->Edit.

3) Use Save->Run Time Menu to save different menus under the same name (MyMenu.rtm). This reliably updates RTM of the control/indicator without the need top generate the menu every single time!