Returns the item tag of the last selected menu item, optionally waiting ms timeout milliseconds.

If you use this function with an Event structure configured to handle the same menu item, the Event structure takes precedence and LabVIEW ignores the Get Menu Selection function. In any given VI, use the Event structure or the Get Menu Selection function.

(Real-Time Module) You cannot use this function in VIs that run on RT targets.


icon

Inputs/Outputs

  • cgnrn.png menu reference

    menu reference is the reference to a menu bar in a VI.

    You can obtain this refnum with the Current VI's Menubar function.
  • ci32.png ms timeout (200)

    ms timeout is the maximum amount of time this function checks for a menu selection.

    The default is 200 ms. –1 indicates never to time out.
  • cbool.png block menu (F)

    If block menu is TRUE, LabVIEW disables menu tracking after reading an item tag.

    After you process the menu selection, you must use the Enable Menu Tracking function to enable menu tracking. The default is FALSE.
  • cerrcodeclst.png error in (no error)

    error in describes error conditions that occur before this node runs. This input provides standard error in functionality.

  • ibool.png timed out

    If timed out is TRUE, a user selection was not made within the time specified by ms timeout.

  • ignrn.png menu reference out

    menu reference out returns menu reference unchanged.

  • istr.png item tag

    item tag is the menu item that was selected.

    Wire this value to a Case structure selector terminal to handle the menu selection. When you create a case to handle each menu item, enter application item tags in the case selector label to handle application menu items.
  • istr.png item path

    item path describes the position of the item in the menu hierarchy, which is in the format of a list of menu tags separated by a colon (:).

    For example, if you choose the Open menu item from the File menu, the item path is File:Open.
  • ierrcodeclst.png error out

    error out contains error information. This output provides standard error out functionality.

  • Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Dialog and User Interface\Menu\Customizing the Menubar\Customizing the Menubar.vi