LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

PPL build path when inheriting from another PPL

I have a factory design pattern to load UI plugins into a subpanel. These plugins inherit from a parent class which is also a PPL. This worked well until today when an unknown changed caused dependency issues. I'll sketch the situation:

Parent VI source code is located in D:\project\src\PluginParent\. The PPL is build to D:\project\PPL\.

The child plugin source is located at D:\project\src\Plugin1\. And now comes the tricky bit, I have the build location at D:\program\bin\Plugins\. As the plugins are meant to be used in an excutable located at D:\program\. When building the executable, which, statically, only loads PluginParent. The children are then loaded dynamically. In the build specifications of the program I set the destination of the PluginParent PPL to D:\program\bin.

During development, I also load the child plugins from D:\program\bin\Plugins\, and this worked well until now without any . I have made some changes to PluginParent and suddenly whenever I load any ChildPlugin during development, I get dependency warning because it tries to load PluginParent from D:\program\bin\. I understand why, since when building the ChildPlugin, this is where it expects the parent to be, but I don't understand why it worked before...

 

This file structure mockup may help

Basjong53_1-1710508756414.png

 

What is the best way of doing things when using this architecture?

0 Kudos
Message 1 of 3
(205 Views)

The #1 and #2 recommendations I see with PPLs (and what we use in our company):

 

1. Always build the PPLs to the same location you will install/deploy them. Never have them anywhere else on disk.

2. Always check the box for "Exclude dependent packed libraries" in the PPL Build Spec (or EXE Build Spec as well)

 

Doing those things always ensures you don't end up with linking issues like you described. The issue you are having, is the Child PPLs are built when the parent is in X Location, but then you build the program (and don't exclude ppls) so the parent ppl gets copied along. Now the parent PPL the children look at is in a different location.

 

When you build a PPL, LabVIEW puts in relative paths to any dependent PPLs. So when you build the children to D:\program\bin\Plugins while the parent is in D:\project\PPL, the children PPL will have a relative path to the parent that is something like ../../../../project/PPL. When they then get loaded then the parent is in the exe, that relative path changes so you get the popup. So you have two options:

 

1. Do what I mentioned above.

2. Keep the relative paths the same between where you build the PPLs so if they get copied from A to B, the relative path is the same.

Message 2 of 3
(178 Views)

I understood the issue. I wasn't working because I updated the parent PPL in the project folder, but then didn't copy it to the program folder. 

 

I don't know if it is intended behaviour, but if you load 2 identical PPLs, there are no dependency issues. I have the parent in the project folder because it is then part of my SCC. If I would build it to the program folder, I will have issues with SCC (since the parent is a direct dependency that may not be updated correctly during any SCC doings).

0 Kudos
Message 3 of 3
(95 Views)