I have multiple common/stable VI's that other developers use. Like many others, when I reuse code I usually copy and paste it in the new project. I'm trying to get away from that.
I like the public/private feature that the library provides, and from the reading sounds like the packed library is precompiled making it faster. Also, the packed library can still show the code/debugging but is not editable.
My intention is to create a library that I can install in the user.lib. This way people can use the functions, see how they work, but not modify them. Is the packed project library the right way? How do you go about creating the library?
packed libraries are definetly a way to go. The basis of a packed (project) library is a lvlib, and you should define items as public/private.
By default, all public items are configured as "Exported" for the lvlibp (packed library).
The only thing which differs for your request is the following:
The build process for the packed library does by default remove the block diagram of the exported items. You can change this, but all private (not exported) items will show up in the blockdiagram of the exported items with a "?" as icon:
The user cannot make any changes to the VI even if the blockdiagram is included.
hope this helps,
That's interesting. I can make the VI's all public since they are not editable, and just to keep things clean I can place the files I wanted to hide in another virtual folder identifying them as subVIs.
I do have a question on installing them. I've tried just dropping the packed library (.lvlibp) directly into the user.lib folder with no success. How do you go about installing the packed library so it appears in your functions palette?
i did not do this the complete way, so i am not sure if it will result in the features you are looking for. But here is what i find promising:
1. You have to create an .mnu file for you lvlib using the tool Tools>>Advanced>>Edit Palette Set. Insert all VIs you want to have on your palette in the correct palette and save the mnu file.
2. Build the lvlibp and include the mnu file for the exported functions.
3. Place the lvlibp in the user.lib folder in a subfolder you find suitable on the target PC.
4. Open Edit Palette Set on this target PC and browse to the User Libraries subfolder. Rightclick the empty palette and select Insert >> Subpalette. This should open the following dialog:
5. Select the last bullet in the list, browse to your lvlibp and press ok. It should populate the subpalette in the manner your mnu file defines.
hopes this helps,
Thanks for the post Norbert!
To add to his post, this KnowledgeBase is helpful to show what Norbert is talking about using pictures. It is a KnowledgeBase from LabVIEW 8.2, but the steps that you have to go through are still the same. Hope this helps!
I have problems adding packed project library to a pallete. If I select "Link a palette file in a project library", I get an error "The library you selected does not contain any valid menu files". What should I do?