LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I call a dynamically loaded subvi from a subvi inside a library?

I have an application that uses a .lvlib, this library has many subvi's.  From my executable, I can dynamically load subvi's within the library using the "open reference.vi" and passing in just the name as long as the subvi's being called are listed in the "always included" list of my build specification.  What I want to do now is load an external subvi (external to the library) using the same method.  But when I try to do this, LabVIEW cannot find the external subvi even when it is included as part of the executable.  It seems the Paths are getting messed up.  Here is what is happening:

Lets say I have Mylibrary.lvlib as my library in the following path C:\MyProject\Mylibrary.lvlib,

and internal.vi as my subvi within the library in the following path C:\MyProject\MySubVis\internal.vi,

and external.vi as my subvi outside of my library in the following path C:\MyProject\external.vi

This is all in the same project.

I'm using the "Open VI Reference.vi" from internal.vi to call external.vi, and I'm including both internal.vi and external.vi in my executable (MyEXE.exe for illustration purposes).  When I run this part of my code I get an error and LabVIEW reports the path of my external subvi as: C:\MyProject\MyEXE.exe\MySubVis\external.vi which is really the path for my library subvi.  Why?

Either way, when I hard code what is supposed to be the correct path to my external subvi:  C:\MyProject\MyEXE.exe\external.vi, LabVIEW can't seem to find the file, its' almost like an access scope problem because I'm trying to access something outside of the library.  Is there such thing?  If the file is part of my exe why can't LabVIEW find it???  How can I call my external.vi BY NAME from my internal.vi??

Any help is appreciated.

0 Kudos
Message 1 of 4
(2,298 Views)
Your hardcoded path is incorrect. How do you have the build configured? Are you using the new executable structure or the pre-8.2 structure.

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 4
(2,286 Views)
Im using The New executable structure.
0 Kudos
Message 3 of 4
(2,278 Views)

Why do you say the path is incorrect?  When you add a subvi into the "always included" part of the build doesn't it make the path from the exe like so: C:\whatever my exe path is\Myexe.exe\myincludedsubvi.vi  --> Assuming that your included subvi is physically saved in the top level directory (same as where your project is saved).

0 Kudos
Message 4 of 4
(2,244 Views)