What is a Shell VI?
A shell VI is a subVI that exposes its own code on the block diagram rather than showing the subVI icon. It uses the merge VI feature in LabVIEW to do this. The VI can be placed on a palette, and the user can select the VI and drop it into the block diagram as usual. However, when the merge VI feature is enabled, the user will see the code in the VI as opposed to the icon when the VI is placed on the block diagram. The user can customize the code as needed. For example, let’s look at a shell VI from a customized palette. In Figure 1, our shell VI is the Finite Acquisition VI. It looks like a normal VI, but when we drop it into the block diagram, we will see the code.
Figure 1: Palette with a Shell VI
When we drop the Finite Acquisition VI onto the block diagram, we see the following:
Figure 2: Shell VI
How Do I Create a Shell VI?
In order to create a shell VI, you will first need to create the code you want in the shell VI. Say we have created the following VI which takes a noisy ECG signal and filters out the noise using a Butterworth filter.
Figure 3: Code for the Shell VI
Once we have the code we want for our shell VI, we need to save our VI. Make sure you remember the directory to which you are saving your VI. For this example, we will save the VI to the My Documents folder as shown.
Figure 4: Saving the Shell VI in a Known Directory
Once we have saved our shell VI, we need to put it onto a palette. Go to the toolbar and click on Tools>>Advanced>>Edit Palette Set...
Figure 5: Navigating to Edit Palette Set
The Edit Controls and Functions Palette screen will come up, and you can navigate to the place on the Functions Palette where you would like to place your VI. For this example, we will place the VI on the Biomedical Applications Palette. Navigate to this palette, and right-click in any free space. Select Insert>>VI(s)...
Figure 6: Inserting a VI Onto a Palette
A dialog box will appear that asks you to select the VI. Navigate to the directory where you saved your shell VI and select that VI.
Figure 7: Selecting the Shell VI
Once you have selected your VI, click on Open, and your VI will appear on the palette.
Figure 8: Shell VI Appears on Palette
Now, in order to enable the merge VI feature and make this VI a shell VI, right-click on the VI, and select Merge VI.
Figure 9: Enabling the Merge VI Feature
Select Save Changes, and when you are prompted, click Continue. Now, when you select this VI and drag it onto the block diagram, the code will appear.