LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Darren's Weekly Nugget 06/15/2010

In today's nugget, I'm going to talk about .mnu files, which define the hierarchy for the Controls and Functions palettes in LabVIEW.  There are three primary locations where you would find .mnu files on your machine:

 

  • [LabVIEW]\menus - This is the main location for almost all .mnu files.  This folder contains .mnu files installed with core LabVIEW, modules/toolkits, and some 3rd-party LabVIEW add-ons.
  • [LabVIEW]\user.lib - Any .mnu files in this folder will be used to populate the contents of the User Controls subpalette of the Controls palette and the User Libraries subpalette of the Functions palette.
  • [My Documents]\LabVIEW Data\{version}(xx-bit)\Palettes\menus - If you ever change the contents of your palettes with the Tools > Advanced > Edit Palette Set utility, any changes you make will be stored in this location, and these changes will override the contents of [LabVIEW]\menus when the palettes are loaded.

 

In the past we have supported other locations for .mnu files, but support for locations other than the three mentioned above is mostly deprecated at this point.

 

So how do .mnu files work?  The file format is an internal LabVIEW file type that stores all the information LabVIEW needs to construct a palette...the palette icon, the contents of the palette, the type of each palette object, and links to .mnu files that define any subpalettes on that palette.  Paths to subpalette .mnu files are stored as relative paths within an owning .mnu file.  Paths to VIs and CTLs in vi.lib are stored as relative to vi.lib. The palette API (Read Palette.vi and Write Palette.vi) provide programmatic access to all the information stored in .mnu files.

 

Finally, let's discuss a curious entity you might find when you start browsing around [LabVIEW]\menus...dozens of empty text files called 'readonly.txt'.  The filename is a misnomer...it is a relic of some old palette editing functionality.  At this point, these files really only serve one purpose.  There are some hard-coded palette items within the core LabVIEW palette set.  This is because we want to enforce an intuitive palette layout when you install modules and toolkits.  So the positioning of some module and toolkit subpalettes are actually defined within the core LabVIEW .mnu files.  So what happens if a particular module/toolkit is not installed?  As a general rule, if something in a .mnu file cannot be found when LabVIEW is loading the palettes, a big "?" appears in its position in the palettes.  The presence of the 'readonly.txt' file simply prevents these question marks from appearing.  This behavior occurs within any palette defined by a .mnu file that has a 'readonly.txt' file sitting next to it on disk.  If you delete all the 'readonly.txt' files from your [LabVIEW]\menus folder, a bunch of question marks will appear within your palettes where empty space used to be.

 

If you're interested in how you might plug in to the LabVIEW palettes for your own add-ons, check out the Creating a LabVIEW Palette article on the NI Community website.

Message Edited by Darren on 06-15-2010 06:50 PM
Message 1 of 4
(5,495 Views)

I feel an urge to reply since I find myself in a camp outside the rest of the LabVIEW tribe.

 

Customized menus are an issue for me because I don't have the luxury of using the same machine all of the time. Add to taht my projects can start on my machine, get completed by another and then deployed on yet another. This create a deployment nightmare. To avoid this issue when attempting to utilize "drivers" that are implemented using menus, I work to take them apart and put them back together in unique folders I can include with the rest of source code.

 

When you have a bunch of developers with as many as ten versions of LV and an even larger number of customer machines, the convienence of finding VI is the menu is over-taken by the nightmare or code control.

 

A change that would serve me well is a function in the project that would let me un-do the work of putting drivers VI in a palette and move them to my project folder so I can keep them under tight suorce control.

 

Just my 2 cents,

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 2 of 4
(5,346 Views)

Ben

 

To maintain control I put the Drivers in LabVIEW XX\instr.lib and the Driver APIs in  LabVIEW XX\user.lib (where xx is the LabVIEWversion).  I also put the .mnu files for these folders and subfolders into source code control (vss). All of my machines now have the same palettes.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Message 3 of 4
(5,302 Views)

Spectre Dave wrote:

Ben

 

To maintain control I put the Drivers in LabVIEW XX\instr.lib and the Driver APIs in  LabVIEW XX\user.lib (where xx is the LabVIEWversion).  I also put the .mnu files for these folders and subfolders into source code control (vss). All of my machines now have the same palettes.


That would be nice!

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
0 Kudos
Message 4 of 4
(5,294 Views)