02-07-2019 03:54 AM
Hello,
Could someone please share information about CAR #723751:
I found some details in this post: https://lavag.org/topic/20687-shared-library-ppl-dependency-problems/
Thanks!
Solved! Go to Solution.
02-08-2019 04:00 AM
Hello Sergio,
From reading the thread you linked, it looks like a class inheritance issue. The child class needs to be inherited from the Parent lvlibp (PPL), not the Parent lvlib (lib). If it is derived from the lib, then LabVIEW will prioritize loading the lib, and not load the PPL anymore, as shown in this screenshot from the thread you linked.
Unfortunately, we cannot see what's inside of "Dependencies" here. I guess Limits.lvlib showed up there, which should never be the case. If so, Right-Click » Why is this in dependencies, and then replace all calls to the lib with calls to the PPL.
And, in general: The linked thread is about PPLs used in a plugin structure. For this, PPLs have to be completely self-contained. That is, all dependencies need to be inside the root PPL, or already be loaded before the PPL is loaded. Here, all needed dependencies need to be either in Parent PPL, or set to "Always included" in the executable build specification.
Apart from that I tried to reproduce the issue here. It works for me as intended. Sergio, do you have code where this is an actual issue? It's easier to troubleshoot existing code than discussing such an issue theoretically with at least a dozen of unknowns.
02-08-2019 05:08 AM
Hi Ingo,
Thanks for replying... I am attaching an example (LV2017 64-bit), on which I want to create a plugin architecture using PPLs. Please have a look.
In the example, Power Supply.lvclass inherits correctly from Instrument.lvlibp:Instrument.lvclass, which should be deployed to a sub-folder inside vi.lib. To reproduce the issue, you may copy the already built lvlibp files from each component to a subfolder in vi.lib. Both lvlibp files should sit side by side.
The issues I face, which I hoped would be explained in CAR #723751, is that I cannot load Power Supply.lvlibp if Instrument.lvlibp is not already in memory. If vi.lib\...\Instrument.lvlibp is in memory, then it is no problem loading vi.lib\...\Power Supply.lvlibp.
If Power Supply.lvclass is set to inherit directly from LabVIEW Object, none of these issues exist. So it is related to inheritance, and LabVIEW not being able to load automatically the parent class from the PPL located in vi.lib.
My end-goal is to distribute plugin components for a test system as PPLs, not limited to instruments, but also for interfaces, reporting, etc. For development, I would like to make them available in palettes, menus, and quick drop for ease of access. For end-use, I would like to release the test system application as an executable, and load the necessary plugins at run-time, allowing for expansion and interchangeability of plugin components.
Thanks for looking into it. I look forward to any findings or advice.
02-12-2019 04:51 AM - edited 02-12-2019 04:52 AM
Hello Sergio,
Sorry for the delayed answer, I needed to find enough time to do some testing.
I'll split this answer in three sections. The first is about I would set up the folder structure for a plugin project. The last one is about the behavior you see. As far as I understand, the behavior should be irrelevant in regards to your goals. PPLs that are used as plugins need to be fully self-contained, therefore dependencies have to be loaded beforehand. Section 2 is about this.
=== Plugin structure ===
I have two goals when creating a plugin structure: Keeping an easy overview over your sources and builds, and keeping the number or PPL copies as low as possible.
I would use a folder structure like this
What do I then do?
*: I know that there are certain limitations to this. E.g. when compiling your plugins for very different targets, it's sometimes impossible to use PPLs, going for LLBs instead. Different types have different Build Specifications. Some allow "exclude dependencies from user.lib", therefore you sometimes actually want to have some llbs/ppls in there.
=== Loading dependencies ===
In general, dependencies of self-contained PPLs have to be loaded before the PPL itself is loaded. There are several ways to do so:
=== Loading behavior ===
Using LabVIEW 17.0.1f3 (64-bit) I see the same behavior as you do. I created a project like yours from scratch in LabVIEW 2018 SP1 and did some testing. I think I can confirm your behavior, however I don't know if it is expected or not. I created a PPL2 that depends on PPL1. If PPL1 was (and still is) inside user.lib or vi.lib when PPL2 was compiled, I get the same message like you when trying to open PPL2. However, when I put PPL1 somewhere else, compile PPL2 with that new dependency path, I can open PPL2. I assume this is due to some kind of optimization:
1) Is the dependency PLL "somewhere"? Try to load it. Search for it. If not available, ask the user to point towards it.
2) Is the dependency PPL in user.lib or vi.lib? Don't bother to load it. The programmer will load the dependencies.
I assume this is the reason for the different behavior: "If I put a PPL inside of vi.lib, I know what I am doing. I want to load my PPLs manually, in the correct order." This sounds like a reasonable explanation to me.
Edit: Mixed up attachments, deleted the duplicate ones.
02-12-2019 06:22 AM
Please, no need to apologize, and wow, where do I start! Thanks for spending the time to look into it and following up with such a detailed reply.
I did as you tell in your third section, placing the PPLs in a location other than vi.lib/user.lib, and the load error is gone. LabVIEW can find the parent PPL at the location expected by the child PPL without a problem. Here I was, thinking, "let's deploy the plugins to vi.lib to be installation-directory-independent, so the plugins can always be found at the same relative location." I will use system folders instead.
Your structure is well in line with what I read out there about plug-in architectures. A clean and logic structure will pay off in the long run, so I definitely see the value in it.
Thanks again!