LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use outside Class in packed library plugins

Solved!
Go to solution

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?

Marc Dubois
0 Kudos
Message 1 of 6
(3,280 Views)

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.


LabVIEW Champion, CLA, CLED, CTD
(blog)
Message 2 of 6
(3,273 Views)

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.

Marc Dubois
0 Kudos
Message 3 of 6
(3,266 Views)
Solution
Accepted by topic author MarcDub

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.

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 4 of 6
(3,258 Views)

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).

Marc Dubois
0 Kudos
Message 5 of 6
(3,252 Views)

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).

Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
Culverson.com


Blog for (mostly LabVIEW) programmers: Tips And Tricks

0 Kudos
Message 6 of 6
(3,248 Views)