VI Package Manager is a very powerful tool for distributing and installing LabVIEW toolkits and add-ons. There are tons of features for customizing your palettes, install destinations, licensing, etc in almost every way that is needed. However as a developer,you may occasionally find yourself needing a little more control of your package that may not be directly supported in VIPM. In these situations, you may use custom actions to unlock the full potential of your product.
For those unaware of this powerful feature, custom actions are VIs that execute during the build or installation process of a VI Package. They are standard LabVIEW VIs that run in the LabVIEW development environment, so anything that you can do in LabVIEW can be added to your build or install process. There are three main types of custom Actions:
One feature of Custom Actions that really makes them powerful is their use of Parameters that are passed from VIPM. Parameters are passed via Variant Attributes into each Custom Action VI and can be used to make decisions based on information from the users (or developers) system. Not every parameter applies to every Action type, but below are some parameters you may find useful:
All custom Action VIs have an error output which passes an error back to VIPM. If an error occurs in the custom action VI, then installation/uninstallation/building is aborted and an error is displayed to the user.
As I mentioned, you can use custom actions to do almost anything that is possible in LabVIEW. However a few ways custom actions can be useful are:
Creating your own custom actions is easy. In your VIPM build specification, simply click the Custom Actions tab and then click Generate VI for the desired action. This will create a VI in your build directory with the appropriate connector pane. The Parameters variant is also added to the block diagram with code that breaks out the parameters that are useful in the specific type of custom action. Simply use data extracted from the variant to start programming your custom action.
Do you have any other interesting uses for Custom Actions or advice to other developers? If so leave a comment below.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.