Developer Center Resources

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a LabVIEW Palette with VI Package Manager

LabVIEW Add-on Dev Center » Developing a VI-Based API » Creating a LabVIEW Palette with VI Package Manager

Palettes

This page, of the VI Package Builder window, allows you to edit the palettes which show up in LabVIEW when your package is installed. If your package does not require a LabVIEW palette you can disable the checkboxes next to the Functions and Controls Palette.

image100_109.png

Palette Set: Here you can create multiple palette sets. By default LabVIEW requires just one palette set which targets the default LabVIEW desktop installation. However, it’s possible to create multiple palette sets. For example you can create a palette set that targets the LabVIEW FPGA or LabVIEW Real-Time development environment. Just click the image100_111.png button to add a palette set. Click the image100_108.png  to delete it. You cannot delete the last palette set. You must have at least one.

image100_110.png


Custom Category: When this checkbox is enabled, this allows you to locate your palettes beneath a custom category subpalette. This is useful for example if your company produces multiple products that need to be grouped under a common palette Icon.

WARNING: Placing tools in a custom palette violates the LabVIEW Tools Network requirements, but is shown here for completeness.

image100_113.png

Custom Category Icon: You can edit the icon by right-clicking on it and selecting Edit Icon from the menu.

image100_114.png

You can also have VIPM autogenerate an icon for you based on the company name. Just select Autogenerate Icon from the right-click pop-up menu.

Category Name: Enter a category name that will appear in the title of the subpalette category in the LabVIEW palettes.

Note: Each package your company distributes should define your company’s palette category.  This ensures that the category icon will appear correctly.  If multiple packages are installed that define the same palette category, VIPM will ensure that the latest version of your category icon is used.  It does this by only replacing the palette category's icon, if the one to be installed is newer than the one already installed.

Functions\Controls Palette: Enable this checkbox to create a functions or controls palette. If your product does not require a LabVIEW functions or controls palette you can disable this checkbox.

image100_115.png

Name: Enter a name for the functions or controls palette here. This is displayed as the title for the palette when installed in LabVIEW.

Installation Location: This is the virtual palette location of your palette in LabVIEW. In the example above, we see that the functions and controls palette will be installed under the Acme Products subpalette of the Main functions and controls palette.

In order to change the location of your functions or controls palette, click on the image100_116.png button. This will bring up the Palette Category Browser Dialog.

Editing the base icon: You can edit the base palette icon by right-clicking on the icon and selecting Edit Icon from the menu.

image100_117.png

Edit Palette: Allows you to do advanced palette editing. Tip: You can also edit the palette by just clicking on the icon. See the Editing the Palettes section for more details.

Regenerate Icon: Deletes all package icon customizations and restores it to the default, auto-generated state.

Regenerate Palette: Deletes all palette customizations and restores it to the default, auto-generated state.

Editing the Palettes

When you click on the Controls Palette or Functions Palette icon in the Palette Properties page of the VI Package Builder window, a Palette Editor window will open.

The initial default palette shown is auto-generated by VIPM and is based on the directory structure of the source folder. Every folder is converted to a sub-palette and every VI in the folder is shown as an icon in the palette. VIPM does not display folders in the palettes if they are prefixed with an _ (underscore). This can be useful if you have support VIs that you don’t want to show in the palettes.

image100_118.png

The Palette Editor supports Drag & Drop and right-clicking on items and empty space.  It behaves like the palette editor in LabVIEW, but with some extra features.

Drag & Drop

You can Drag & Drop items in the palettes, as shown below:

image100_119.png

  • Drag & Drop on the same palette - move items to new locations in a palette
  • Drag & Drop between palettes - move items from one palette to another palette (between palettes)
  • Drag & Drop from File Explorer - add items or folders of items from Windows File Explorer

Tip: Drag items slowly near the edge of the palette window to grow the size of the palette.

Right-click on Empty Space

Right-clicking on empty space in a palette, as shown below, gives you several options.

Insert:      

Subpalette: Presents a dialog asking you for the name of your new subpalette and then creates it.

VI: Presents a dialog asking you to locate a VI on disk and adds it to the palette.

Folder of VIs: Presents a dialog asking you to locate a folder on disk and adds its contents to the palette.

LabVIEW Primitive: Allows you to insert a LabVIEW primitive function in your palette. A dialog will pop-up where you can search for a primitive by name.

Row Above: Inserts an empty row above the item or empty space.

Row Below: Inserts an empty row below the item or empty space.

Column Left: Inserts an empty column to the left of the item or empty space.

Column Right: Inserts an empty column to the right of the item or empty space.

Delete and Shift: Deletes the item or empty space.

Right-click on Subpalette

Right-clicking on a subpalette, as shown below, gives you several options.

image100_121.png

Open in New Window: Opens the subpalette in a new window

Insert:

Space: Inserts an empty space and shifts all items (on the same row) to the right.

Plus all the options available when right-clicking on empty space.

Edit Icon: Opens the subpalette icon in the LabVIEW Icon Editor window.

Rename: Opens a dialog allowing you to rename a subpalette.

Delete: Deletes the item.

Delete and Shift: Deletes the item or empty space and shifts all the items (on the same row) to the left, to fill the empty space.

Regenerate Icon: Deletes any icon customizations and restores it to the default, auto-generated state.

Right-click on VI or Control

Right-clicking on a VI or Control, as shown below, gives you several options.

image100_122.png

Insert:     

            all the options available when right-clicking on subpalette.

Place VI Contents: When selected, causes the VI’s contents to be placed when it is dropped onto another VI (a.k.a. “Merge VI”)

Note: This setting is always enabled, and cannot be disabled, for VIs inside a Controls Palette.

Delete: Deletes the item.

Delete and Shift: Deletes the item or empty space and shifts all the items (on the same row) to the left, to fill the empty space.

Palette Category Browser Dialog

This dialog can be launched from the Palette Properties Page of the VI Package Builder Window. It allows you to browse your current LabVIEW installation for existing palette categories. You can pick any categories that are defined as being synced to a directory. Categories that are not synced to a directory are greyed out and disabled.  If you want to target your palette so that it only shows up in LabVIEW FPGA or LabVIEW Real-Time, you can select either of those root categories.

image100_123.png

Organizing a Group of Package Files in a Single Palette Category


LabVIEW populates the palettes based upon an alphabetical sorting of the .mnu filenames.  For example, a group of mnu files ending in '1', '3', and '5' will end up with an identical palette order:

menu files.pngpalette order.png

When using VI Package Manager to build packages for separate subpalettes for your toolkits, you depend on the above behavior to sort your packages or "modules" in LabVIEW and it is important to understand how the sorting works if you want to reorganize the palettes for your modules.

How it works


VI Package Manager creates the .mnu filename based upon the Package Filename configured in VI Package Builder.  So a package filename of 'lv2p_lib_module_1-1.0.0.3.vip' corresponds to a palette filename of 'functions_lv2p_lib_module_1.mnu' (or 'controls_lv2p_lib_module_1.mnu' when working with controls palette files):

vipm filename.png

If you want to install a package outside of this ordering in the LabVIEW palettes, you would need to rename your package file so the filename falls in front of your other packages:

Changing the package filename from module_6...

edit package name.png

...to module_0...

new package name.png

...results in the package .mnu file being renamed to end in module_0...

new file names.png

...which results in LabVIEW loading the subpalette for Module 6 in front of the other subpalettes.

new palette order.png

For more information, check out the community group.

Also, for more instruction on the entire package building process: Hands-On - How to Build a LabVIEW Add-on with VI Package Manager

Comments
Daklu
Active Participant
Active Participant
on

Great tutorial for first-timers!

A warning to other users:

I recently built a bunch of packages for our internal reuse code and ran into issues where the custom palettes I had set up were being deleted and replaced by the default palettes.  After creating custom palettes I went back to the Build Information tab and made a slight change to the Souce Directory field.  If the new directory contains Labview code, VIPM automatically resets the palette to match the directory structure in the source directory.  You lose icons, organization... everything.  This happens to all the palette sets in the file.  I worked around the issue by editing the .vipb file in a text editor.

I don't know if there are other changes that will also reset the palettes.

Richard_Ha
Member
Member
on

Is there an easy way of making my palette apear in BOTH Fucntions and AND Fucntions (RT) without having to maintain two seperate Palette sets?

Contributors