10-01-2019 02:20 PM
I successfully converted ActorFramework to a PPL, which now resides in vi.lib\ActorFramework\ActorFramework.lvlibp.
I have my own base actor, let's called it ParentActor. It now inherits from the ActorFramework PPL.
I want to build a ParentActorPPL. When I do this with default settings, it produces ParentActorPPL AND a copy of ActorFrameworkPPL. These two files must be in the same directory for ParentActorPPL to load properly.
If I check "exclude dependent PPLs" then only ParentActorPPL is produced, but that library is corrupt and won't load at all.
Is there a way I can create ParentActorPPL such that it knows to pull from vi.lib\ActorFramework? Or is it always going to need to be in the exact same directory as ActorFrameworkPPL?
10-02-2019 01:34 AM
Hi Mike,
when you exclude a dependent PPL (e.g. ActorFramework PPL) you have to make sure that it is in memory whenever your PPL (e.g. ParentActorPPL) is loaded otherwise LabVIEW will tell you "Project or Library cannot be opened." or it won't be loaded if you add it to a project. You can solve this by adding the dependent PPL's to a virtual support folder in your project first and then add your PPL to the project.
That's the way I do it for my main applications. When they are build into executables all those ppl's are then placed in the build support folder since the executable needs them.
For plugins or child actors (e.g. ChildActorPPL) it is a bit different. They can be loaded dynamically from the main application. The main application then already has taken care of loading the dependent ppl's (ActorFrameworkPPL and ParenActorPPL) into memory so the child can also be loaded without any problem.
You can find a tutorial on actor framework and PPL's that I made here : http://bit.ly/lvactorbasic2ppl
Example 5 shows how I created a main application with PPL plugins. Each of the project files also contains the build specifications. You can have a look there at where the dependent PPL's are excluded and where not.
Best Regards,
Stefan Lemmens
10-02-2019 07:12 AM
Although this may be true for dynamically loaded PPLs, this bit:
@StefanLemmens wrote:
when you exclude a dependent PPL (e.g. ActorFramework PPL) you have to make sure that it is in memory whenever your PPL (e.g. ParentActorPPL) is loaded otherwise LabVIEW will tell you "Project or Library cannot be opened." or it won't be loaded if you add it to a project.
isn't actually true - if I have a set of PPLs and add one near the end of a list of dependencies (so, it depends on a bunch of others) into my blank project, the things it requires will be added to Dependencies automatically (assuming they can be found - if the paths are broken this may not work so well...)
10-02-2019 07:39 AM
That's true but the original question was : how can you build a PPL with "Exclude dependent PPL's" enabled and still have this loading its dependencies automatically. In my tests the lvlibp file wasn't loaded (in a blank project) until I added the dependencies myself.
The dependencies were located in the user.lib and not in a folder relative to the lvlib(p), that might be the reason the paths got "broken".
Anyway, explicitly adding those dependencies to the lvproj solves this problem and makes it even more clear that they are being used.