06-08-2015 10:37 AM
I have found the very useful article from Michael Lacasse (https://decibel.ni.com/content/docs/DOC-19176) on how to use packed library as plugins. This approach makes the most sense when you try to distribute additional code after your executable has already been installed.
My problem is that when I try to use a class from the main code in a plugin, the plugins won't work anymore. Ideally, I would have liked the parent plugin-interface to inherit from a class used in the main code, or using the class as an input parameter of the plugin would be the next best thing.
I got several errors, some at execution time (#1448) or at edit time ("This VI does not match other VIs in the method: connector pane terminal(s)"). I have settled to use clusters to pass data to the plugins.
My question is: Is it possible to use a class defined in the main code in a packed-project-library, either inherited or as a parameter? If yes, do you have any example?
Solved! Go to Solution.
06-08-2015 10:42 AM
You need to put your class into a separate 'shared components' PPL and have both your executable and plugin PPLs refer to the version of the class in the 'shared components' PPL.
06-08-2015 10:55 AM
Have you succeeded to pass a class that way to a plugin?
I guess it makes sense. That would be the same way that the parent interface-plugin class is shared by the main code and the plugins.
My problem is that the class I want to pass inherits from another class, which I guess would need its own PPL as well.
06-08-2015 10:59 AM
Haven't done it with actual CLASS structures, but I do the same thing with PPLs.
Don't try to inherit from something in the host MAIN.
Create the ancestor class in a separate PPL.
Use it in the MAIN, as it is.
Inherit from it in your add-ons.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
06-08-2015 11:04 AM
Thanks, I will try it but at a later time. For the moment I will stick to clusters because I would need to rethink my class structure (as it happens often in LVOOP I guess).
06-08-2015 11:08 AM
I should point out that it's important to use the copy THAT'S IN THE PPL, *-NOT-* the copy from your source.
It will compile if you mix them together, but they aren't the same object, and won't share data.
You should never refer to your source code for the class, except to build the PPL.
(Consider using a separate project, to avoid temptation).
Blog for (mostly LabVIEW) programmers: Tips And Tricks