Programmatically Creating a Palette from a Library
- First, you should have a LabVIEW library (.lvlib) that contains the VIs that you wish to include in your LabVIEW palette.
- It is best practice to create Public and Private Virtual Folders with corresponding Access Scope. VIs stored in the Private Virtual Folder will not be exported to the palette.
- Your file hierarchy on disk should resemble the hierarchy in the project. See the below image as an example.
- Using Windows File Explorer, navigate to C:\Program Files (x86)\ National Instruments\LabVIEW <version>\vi.lib.
- Create a folder called Example Palette.
- Create a copy of your library and place it inside Example Palette. You should include the Public and Private folders and all of their contents.
- Download the attached Installer VI and place it inside your project.
- The VI has the following functionality:
- It looks inside C:\Program Files (x86)\ National Instruments\LabVIEW <version>\vi.lib for a folder called Example Palette. Within this folder should be your library.
- For each public VI in the library, an item is created in your new palette.
- The new palette is given the name Example Palette.
- A new ExamplePalette.mnu file is created inside C:\Program Files (x86)\ National Instruments\LabVIEW <version>\menus\Categories\Programming. This path defines where the palette will appear in LabVIEW.
- The Write Palette VI is used to create the new palette.
- An Invoke Node is used to refresh the palette.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
When you run the VI, a palette called
Example Palette will be created in the
Programming palette.
Programmatically Creating a Palette from a Packed Project Library (PPL)
- First, you should have a LabVIEW library (.lvlib) that contains the VIs that you wish to include in your LabVIEW palette.
- It is best practice to create Public and Private Virtual Folders with corresponding Access Scope. VIs stored in the Private Virtual Folder will not be exported to the palette.
- Your file hierarchy on disk should resemble the hierarchy in the project. See the below image as an example.
- Create a Build Specification for a Packed Library. The LabVIEW library (.lvlib) must be configured as the Top-level Library in the Source Files tab.
- Build the Packed Library.
- Using Windows File Explorer, navigate to C:\Program Files (x86)\ National Instruments\LabVIEW <version>\vi.lib
- Create a folder called PPL Palette.
- Within the PPL Palette folder, place a copy of your Packed Library.
- Download the attached Install PPL Palette VI and place it inside your project.
- This VI has the following functionality:
- It looks inside C:\Program Files (x86)\ National Instruments\LabVIEW <version>\vi.lib for a folder called PPL Palette. Within this folder should be your Packed Library.
- For each public VI in the library, an item is created in your new palette.
- The new palette is given the name PPL Palette.
- A new PPLPalette.mnu file is created inside C:\Program Files (x86)\ National Instruments\LabVIEW <version>\menus\Categories\Programming. This path defines where the palette will appear in LabVIEW.
- The Write Palette VI is used to create the new palette.
- An Invoke Node is used to refresh the palette.
Note: This image is a LabVIEW snippet, which includes LabVIEW code that you can reuse in your project. To use a snippet, right-click the image, save it to your computer, and drag the file onto your LabVIEW diagram.
When you run the VI, a palette called
Example Palette will be created in the
Programming palette.