LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

NI Application Builder API in PPL

Hello everyone,

 

My team and I developed a couple of VIs for the Pre-Build and Post-Build Actions used when building some Packed Project Libraries (PPLs) for our framework. The VIs do a bunch of stuff, mainly related to our SCC but the most important is to change the build's Target Filename and Destination Paths, so that the version being built is conconated to the PPLs name and the build is built into a destination that follows a certain rules for everyone. We did this using the Set Tag and Get Tag for the Project Items as project file is simply a XML file.

We have the same problem mentioned in a bunch of other threads where the first run of the Pre-Build only updates this data and we have to cancel this run and start a new so they take effect. By opening the .lvproj file with a Notepad we verify that the data is in fact changed to what we want.

Despite this, when we run the build again, the destination path doesn't seem to change. We noticed that to force it to take the new value, we have to manually open the Build Specification Properties Window and click 'OK', without changing anything. This seems to commit the changes made.

I started looking into ways to overcome this and stumbled upon the NI_AB_API nested in vi.lib. I replaced our Get Tag Set Tag VIs with the ones from the API to change the Primary Destination Path and so on, and added the "Commit Build Settings.vi" at the end. This did seem to do the trick. I then wrapped the Pre-Build and Post-Build VIs into a PPL so it can be distributed into multiple projects by multiple developers and noticed that it stopped working. 

The error I get is the error 1448. "Error 1448: Bad type cast. LabVIEW cannot treat the run-time value of this LabVIEW class as an instance of the given LabVIEW class."

It seems that trying to get the Build class when in a PPL does not work. I have been trying to multiple build settings to try to get it to work but I only got it to work when deploying the dependent classes with the PPL. I find this strange as I thought that any dependencies would be found in the vi.lib with no problems and it would run. In fact, the VI is not broken, so I am puzzled at the issue. I am no LVOOP expert by no means.

I am now desperate with no more ideas so I came here for help.

I am attaching a project with a simple VI to get the Destination Path from the PPL build spec within the project and the actual PPL that holds the same VI. You will see that the VI in the project works fine but within the PPL, it does not.

 

carlosjuniorocha_0-1634840864180.png

 

If anyone has any idea on how to get the NI_AB_API within the PPL to work or any other way to "commit" the changes done to .lvproj xml in the build specifications, I would be very grateful. 

 

Thank you.

0 Kudos
Message 1 of 1
(648 Views)