LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 
Reply

Project packed libraries for referenced VIs

Solved!
Go to solution

Project packed libraries for referenced VIs

Hello,

 

this has been addresses before, but I couldnt find any exact answer regarding this issue.

 

I am trying to run a VI by reference in my executable (it is not physically put into main). I have one VI that has around 15 dependent SubVIs. From what I've read (I'll link sites in the end) I am supposed to:

1. create a separate project for my TS.vi

2. include TS.vi in the project (it lists all dependent SubVIs and controls)

3. create a library for TS.vi (dependencies are included)

4. Built a project packed library for TS.lvlib and include it as main library

5. Replace TS.vi in the main VI with the PPL that I've created.

 

My problem is a common one: everything runs on the development system, but it doesnt run on the runtime system. Could someone look at the process and comment. I realise I might be making a rookie mistake or could be missing some basic knowledge, but that's why I'm posting anyway.

 

PS: I've read the following topics, posts:

- http://zone.ni.com/reference/en-XX/help/371361M-01/lvconcepts/dynamic_loadcall_vis/    (this is how I call the VI)

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA00Z0000019QDcSAM&l=sl-SI (building libraries)

http://zone.ni.com/reference/en-XX/help/371361P-01/lvhowto/converting_packed_libraries/

 

I didn't include any of the project files since they are kind of sensitive. I can provide it later if needed for additional information.

 

Thank you in advance.

0 Kudos
Message 1 of 7
(155 Views)

Re: Project packed libraries for referenced VIs

The thing I have learned with PPLs is that you have to be EXTREMELY careful about where you build your PPLs and executables since the relative paths must be consistent.  The build specification for the executable can include the dependent PPLs, so make sure you are using that option.  Since you are calling this VI dynamically, you will need to "Always Include" said VI inside of the PPL using the build specification of the executable.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 2 of 7
(132 Views)

Re: Project packed libraries for referenced VIs

Here's an answer for basically same problem:

 

https://forums.ni.com/t5/LabVIEW/LabVIEW-exe-cannot-find-VI-s-in-lvlibp/td-p/3676171

 

If I understood you and as a reference to the link, the location of the build is important. My idea is to create a "data" folder, put the referenced VI in it, link dependent SubVIs from the same folder to the VI and then build the PPL.

When building executable, I would put the PPL in the Support Directory (which is basically "data" folder when installed) and always include it.

Also, I am building a path to dinamically call VI using "Build Path" with "Application directory" + string: App.exe\data\Library.lvlibp\TS.vi

I guess the logic here is OK or could this also be a problem?

 

Thanks again.

0 Kudos
Message 3 of 7
(122 Views)

Re: Project packed libraries for referenced VIs


@Grega991 wrote:

Also, I am building a path to dinamically call VI using "Build Path" with "Application directory" + string: App.exe\data\Library.lvlibp\TS.vi


That could be a problem, based on whatever dependencies get added to the PPL.  Inside the PPL, relative paths are maintained starting from the most common directory.  So there could be extra folder levels in there that you are unaware of.  If you dig into the File IO->Advanced File Functions->Packed Library palette, you will find a VI called Get Exported File Path.  You give it a path to the PPL and the name of the VI you want to load and it will give you the full path of that VI.


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 4 of 7
(110 Views)

Re: Project packed libraries for referenced VIs

I tried using "Get Exported File Path.vi". I simply put the path (including *.lvlibp) of the VI and the name of the VI as inputs. It says file not found. 

However, when checking the properties of the VI inside PPL, the path to the VI is exactly the same. Frankly, I copied it as input for "Get Exported File Path.vi". I also opened the library via cmd, using the same path.

Any ideas?

 

Thank you.

0 Kudos
Message 5 of 7
(83 Views)
Highlighted
Solution
Accepted by topic author Grega991
02-11-2019 12:32 PM

Re: Project packed libraries for referenced VIs


@Grega991 wrote:

I tried using "Get Exported File Path.vi". I simply put the path (including *.lvlibp) of the VI and the name of the VI as inputs. It says file not found.


You just need the path of the lvlibp as the path input (ex. C:\temp\blah.lvlibp).  But you do need the full qualifying name for the VI, which will include the lvlibp file name as well as any additional layers of libraries and classes (ex. blah.lvlibp:foo.vi).


There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
0 Kudos
Message 6 of 7
(81 Views)

Re: Project packed libraries for referenced VIs

I finally managed to solve this. The whole time I had a problem with the path - or library reference. 

 

"Get Exported File Path.vi" gave me the exact same path that I was referencing in the code. However, when building the path using app directory + string, I had the VI in the library referenced with library name as well. So the error was actually wrong syntax for library, not the path itself.

 

Thanks crossrulz, you've provided a lot of useful information.

0 Kudos
Message 7 of 7
(70 Views)