LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Re-build a PPL using scripting

Solved!
Go to solution

I'm using VI Scripting to add/remove elements from a typedef cluster inside a LabVIEW library. The project already contain a build specification to create a packed project library from the library containing the typedef. I would like to know if it's possible to run this build specification programmatically using VI Scripting (or with another method)?

 

Thanks,

 

Ben

0 Kudos
Message 1 of 10
(2,778 Views)
Solution
Accepted by topic author ben64

You should be able to use the Application Builder API to programatically run a build specification (or indeed, create an entirely new one and set all the necessary values).

 

For PPLs, you should take a look at vi.lib\AppBuilder\AB_API\PPL for the API and probably "Open BuildPacked Library.vi" in that directory for the loading of a Build object from the name of the build specification and a project and target reference.

 

Then you can call Build.vi on that object to build the specification.

 

Here's a quick example using the following VIs:

vi.lib\AppBuilder\AB_API\Build\Open Build.vi

vi.lib\AppBuilder\AB_API\Build\Build.vi

Here I used the Build class Open Build, so I specified the Packed Library input, there's also an "Open Packed Library.vi" in the PPL folder which doesn't require a target reference or the enum.

 

Build My PPL_BD.png


GCentral
Message 2 of 10
(2,741 Views)

Wow, that was so easy! What is the buid API you are using, it doesn't seem to be a native NI API?

 

Thanks,

 

Ben

0 Kudos
Message 3 of 10
(2,730 Views)

It's as far as I know just the API for the Application Builder system.

 

It ships in VI.lib for LabVIEW 2017 and 2019 at the very least, although I imagine it requires the Application Builder module. That is included in the professional edition but not the Base or Full. 

 

However, without that you can't build PPLs at all, as far as I know (?), so I'd assumed you had access to it.


GCentral
0 Kudos
Message 4 of 10
(2,727 Views)

Hmm. Actually, this isn't even the easiest way.

 

If you already have the build specification set up, and don't need to edit it (because the API I showed above also has lots of VIs to change every attribute or property of the specification, or script it entirely from scratcch) then you can use the VI at Application Control > Application Builder > Build.vi 


GCentral
0 Kudos
Message 5 of 10
(2,723 Views)

This is what my application builder palette looks like (LV2019 Pro):

 

App builder API.png

 

Ben64

0 Kudos
Message 6 of 10
(2,721 Views)

@ben64 wrote:

This is what my application builder palette looks like (LV2019 Pro):

 

App builder API.png

 

Ben64


Yeah, same. I gave the paths in the first posts because I don't think the "good stuff" is on the palettes.

 

Maybe there's a hidden gem equivalent package or something, but I haven't tried looking for one.

 

Once you have a couple in your building VI, you can use the Dependencies list to find more, or you can just keep Explorer open and guess based on file names and directories.

 

The documentation is a little sparse, but the VIs are powerful. Most block diagrams are locked. Fortunately you probably only have to do it once(ish)...


GCentral
Message 7 of 10
(2,719 Views)

Thanks, I just navigated to the vi.lib/AppBuilder directory and there are a lot of things there!

 

Ben64

0 Kudos
Message 8 of 10
(2,713 Views)

We use a combination of a modified version of the MGI Solution Explorer and Jenkins to build our PPLs. Granted, we have over 170 PPLs which are roughly split equally between reuse libraries and plugins. To manage this many we need a good build process. MGI Solution Explorer makes it easy build the various levels of the PPLs in the proper order as well as only building what is necessary. Jenkins automates the process for us.



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 9 of 10
(2,690 Views)

Thanks Mark, I never heard about MGI Solution Explorer but I'll take a look at it.

 

Ben

0 Kudos
Message 10 of 10
(2,662 Views)