LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Information about CAR #723751

Solved!
Go to solution

Hello,

 

Could someone please share information about CAR #723751:

  • Is it fixed in a particular version of LabVIEW?
  • Is there a work-around?

I found some details in this post: https://lavag.org/topic/20687-shared-library-ppl-dependency-problems/

 

Thanks!

---
SergioR
0 Kudos
Message 1 of 5
(3,359 Views)

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.

image.png.7d268e2fbbb3335d91ff8a82cb602a17.png

 

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.


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
0 Kudos
Message 2 of 5
(3,315 Views)

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.

---
SergioR
0 Kudos
Message 3 of 5
(3,305 Views)
Solution
Accepted by topic author SergioR

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

  • \project\_builds\
  • \project\main sources\
  • \project\plugin parent sources\ (both main and all plugins are inherited from this one)
  • \project\plugin1 sources\
  • \project\plugin2 sources\
  • \project\plugin[...] sources\

What do I then do?

  • All Build Specifications point towards the _build folder, not to vi.lib or similar(*). Plugins dependent on other PPLs you made use this folder as source for these PPLs. LabVIEW will find the dependency PPLs here. No "Library could not be loaded" message. (see attached components_ik.zip)
  • Check "Exclude dependent packed libraries" and "... shared..." in all plugins.
  • Pull all your shared dependencies you want to use in more than one plugin into the main program's project, and set them a "Always Included". This way they are available before the plugins gets loaded (depends on the actual code inside those dependencies).
  • For future dependencies that you did not compile into your main program: Compile them into that respective PPL. There are several ways to to, see the following section.

 

*: 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:

  1. Have the main application load it.
  2. Publish dependency PPLs and a config file with your "new" plugin PPL. The config file lists the dependencies of that PPL. Your main application has code that reads the config file, then loads the dependencies, then loads the plugin PPL itself. (See attached loader.vi).
  3. Compile the dependency PPLs (not from vi.lib or user.lib) into the plugin PPL. Load this plugin dynamically using the 0x10 option on the Get LV class defaults. This makes LabVIEW load/search for the dependencies. It's slower, but works as well.

 

 

 

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


Ingo – LabVIEW 2013, 2014, 2015, 2016, 2017, 2018, NXG 2.0, 2.1, 3.0
CLADMSD
Download All
Message 4 of 5
(3,264 Views)

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!

---
SergioR
Message 5 of 5
(3,252 Views)