From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Recent tutorials on building dependent PPLs?

Solved!
Go to solution

I'm trying to learn PPL's and am getting stuck on getting the pathing right. I've read through several tutorials and watched several Youtube videos on the process from various summits, but I'm running into conflicting information on where to put reuse libraries, where to target builds, etc.

 

Part of my trouble is that lots of the tutorials are from pre-2014, where LV introduced the "Exclude dependent packed libraries" checkbox. The Help for that function is confusing to me, and I can't quite figure out what the pathing will be for my newly built PPL if I exclude the dependent PPL's.


Some of these older tutorials are very specific, saying I should target my reuse directory for my build (e.g., user.lib). Others are very specific in that I should target a builds directory, then do some deleting and moving to get the new files into the reuse directory. None of them are new enough to discuss the "Exclude dependent" option.

 

What's the current best practice on where to target my builds? I'd rather not target user.lib or vi.lib. If I target a build location and Exclude Dependent, how do I tell it where the dependent library is? Are these paths relative or absolute?

 

Does NI have any official documentation on this anywhere?

 

Thanks in advance.

Message 1 of 9
(3,039 Views)
Solution
Accepted by topic author BertMcMahan

From a post I just read in the Champions forums earlier today it was recommended that you use vi.lib for your PPLs. Keep paths relative to each other there. They actually recommended that you have a development copy and a distribution copy. Keep the "Exclude dependent PPLs" checked. Otherwise you end up with multiple copies of the dependent PPLs and things start to get messy. Now the particular post that I was reading was also discussing having different targets (Windows, cRIO, RT as well but that starts to get even more complicated. However the basic concept that you need to keep in mind is that the relative path to the PPLs and between them should always be the same. By using vi.lib you have a very stable and well known (to LabVIEW) base path to work from. What we have done in our environment as well is to also keep are development folder and the install folder depth the same for applications. This helps keep everything working between the development and distribution environments.



Mark Yedinak
Certified LabVIEW Architect
LabVIEW Champion

"Does anyone know where the love of God goes when the waves turn the minutes to hours?"
Wreck of the Edmund Fitzgerald - Gordon Lightfoot
Message 2 of 9
(3,018 Views)

Thanks Mark. So let me see if I'm following your terms correctly. Let's say my parent class is "Animal.lvclass". For brevity, let's assume each PPL has one class in it, the same name as the PPL. As I understand, I'll:

 

1. Build my reuse library into a PPL into a "builds" folder (my distribution copy; C:\myBuilds\Animal.lvlibp)

2. Copy this reuse library into vi.lib (my development copy (<LabVIEW>\vi.lib\Animal.lvlibp)

 

OK so far? If so, after this, say I'm developing a dependent PPL, Dog.lvclass. Now in my development folder I have C:\dev\dog\Dog.lvlib. After I build Animal, I replace Animal.lvlib in my Dog.lvproj to point to vi.lib\Animal.lvlibp.

 

Now here's where I get confused:

 

-If I build Dog.lvlibp into myBuilds\Dog.lvlibp with "Exclude dependent" unchecked, then I'll have myBuilds\Animal.lvlibp and myBuilds\Dog.lvlibp. I've now duplicated Animal.lvlibp, and I'm also not sure if Dog.lvlibp will reference this new one via absolute or relative paths.

 

-If I build Dog.lvlibp into myBuilds\Dog.lvibp with "Exclude dependent" checked, then I'll just have the one copy, but I don't know where Dog.lvlibp will look for Animal.lvlibp:

   -Does it have an absolute path to vi.lib\Animal.lvlibp?

   -Does it use a relative path from Dog.lvlib (not p, the library before the build) to vi.lib\Animal.lvlibp?

   -Does it use a relative path from myBuilds\Dog.lvlibp to vi.lib\Animal.lvlibp?

 

Thanks for the tips and your video. I watched your very helpful video several times and I think I understand how the relative paths need to work, I just can't figure out how to configure those relative paths in the build spec. My goal is to just put them all in one location with maybe a few subfolders. I just can't figure out how to tell it to use specific relative paths. I'm sure it's straightforward but I can't find it in the documentation anywhere.

0 Kudos
Message 3 of 9
(2,972 Views)

Thanks Darren. If I'm reading that first article correctly, then as long as my source PPL's and my output destinations have a common root location, then LabVIEW will use relative paths. (Unfortunately that example didn't work for me :()

 

Thus, when Mark said to always keep my PPL's in vi.lib, it sounds like I should be using the PPL's in vi.lib as development source, and also targeting vi.lib as my destination when building new PPL's. I don't love building directly into vi.lib, but ah well.

 

As I understand it, this means that all of the PPL's share vi.lib as a "starting point" and their paths are relative. Then when I build my exe (and uncheck "Exclude dependent packed libraries"), the App Builder will copy all of the PPL's into the data folder of my executable. Since the PPL's only care about their relative paths, then they can find each other with no troubles, and the App Builder will redirect all of the unbuilt code to point to the correct location (the data folder).

 

I think I got all of that! I'll try it out tomorrow and see if I can make something work. Thanks both of you for the help... I'll mark solutions once I can confirm I've understood you both.

0 Kudos
Message 5 of 9
(2,946 Views)

Another couple of things I've started doing as a personal best practice:

 

1. Build all PPLs to a root folder on C:, like C:\AppNamePPLs.

2. Make sure Additional Exclusions > Exclude dependent packed libraries is CHECKED in all PPL/EXE build specs.

 

These two tactics don't solve all my PPL problems, but used together, I seem to have less problems.

Message 6 of 9
(2,944 Views)

Well now I'm confused again 🙂

 

Let's say I have my Actor Framework PPL at:

 

C:\Program Files\National Instruments\LabVIEW 2020\vi.lib\ActorFramework\Actor Framework.lvlibp

 

And then I create an abstract test actor and build it to:

 

C:\MyApp\MyAbstractTestActor.lvlibp

 

with Exclude Dependent checked, won't that put the internal link to Actor Framework as:

..\Program Files\National Instruments\LabVIEW 2020\vi.lib\ActorFramework\Actor Framework.lvlibp

 

Is that right? In other words, it creates a relative link from the build target directory to <LabVIEW>\vi.lib\Actor Framework. It seems like that would be an issue when you go to deploy an actual exe to another computer.

0 Kudos
Message 7 of 9
(2,921 Views)
Solution
Accepted by topic author BertMcMahan

Right, which is why I would have built Actor Framework.lvlibp to C:\MyApp, not to vi.lib.

 

When I said "Build all PPLs to C:\MyApp", I meant *all* PPLs. 🙂

 

Again, that's my own personal best practice I've developed, not an official recommendation.

Message 8 of 9
(2,918 Views)

Ahh, gotcha, thanks 🙂 I was getting yours an Mark's suggestions mixed up. It sounds like you're both saying the same thing though... all PPL's get built to the same folder, be it C:\MyApp or vi.lib. Thanks for clarifying.

0 Kudos
Message 9 of 9
(2,916 Views)