LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What Are VI Plugins?

Solved!
Go to solution

This is embarrassing - but people refer to "vi plugins" all the time - but I don't have a clue what that means.  Is it just another name for "sub-vi"?

0 Kudos
Message 1 of 3
(2,215 Views)
Solution
Accepted by LeahM

No, a plugin is usually something that loads at run-time rather than compile-time. You can open subVI's the normal way, by dropping them on the palette, or you can open them by reference using VI Server. Basically, your code will have a path to the VI in it (or maybe a folder containing several VI's, of which a user can select one), then the code will load up whatever VI is at that reference. In this way, you can add functionality to a program without needing to modify the "base" program.

 

For example: say you want to use some instrument, let's say a light meter that tells you how much light is falling on a sensor. Let's say that, at the start, you have a LeahCorp light meter and a BertCorp light meter, but that SteveCorp may make one sometime. You want your user to be able to use any light meter they want. You can do this with plugins.

 

So in your main code, you want to find out how much light there is on a sensor. When the program loads, you can have it look in the C:\LightMeterPlugins directory and get a list of all VI's in there. It can then show them to the user, and the user can select between BertCorp and LeahCorp light meters. It then loads the correct one via a path as opposed to loading whichever one you put on the block diagram.

 

Now SteveCorp comes out with their new light meter, and LeahCorp comes out with their light meter version 2.0. All you have to do now is to create VI's that match the connector pane of the other VI's and throw them in the same C:\LightMeterPlugins folder. When your main program starts, it'll list  out BertCorp, LeahCorp, SteveCorp, and LeahCorp v2 as options- without you having to modify the main code. Basically, these new drivers "plug in" to your main code and can expand its functionality without having to modify the main code.

Message 2 of 3
(2,189 Views)

Thanks - I knew that - duh!  Just didn't know what they were called.

0 Kudos
Message 3 of 3
(2,173 Views)