LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Open VI Reference Can't Find VIs in Runtime Mode

Solved!
Go to solution

I have ported a VI to LabVIEW 2024 Q1 Professional that was originally developed in LabVIEW 2017.  Upon a button push, the main VI ("GA24") uses Open VI Reference to check if VI "sigGen_allOutputs" is idle, and calls another VI to start it up if it is idle. Here is the code snippet:

JayKaye_0-1744219785157.png

Everything works well when I run the main VI in development mode, but when I build an executable and run it, the Open VI Reference declares the VI to be bad since it cannot find six VIs that are part of the NI vi.lib.  I added the 0x10 optional input to Open VI Reference to figure this out:

 

JayKaye_1-1744220281235.png

 

LabVIEW should certainly be able to find it's own VIs.  Per a forum posting, I tried activating "Use LabVIEW 8.x file layout," but that did not help.

Please let me know if you have a solution to this problem.  

0 Kudos
Message 1 of 4
(153 Views)
Solution
Accepted by JayKaye

You can't use a fixed path on disk to get a VI from an EXE.

 

EXEs can only access VIs that are either compiled into them or are part of a packed library (LVLIBP file).  For VIs that are packed into them, the path to them will be different.  It is often, but not always "C:\Path to EXE\EXE file name.exe\VI name.vi".

 

Instead of using a hardcoded path, use a Static VI reference, get the name or path from that, and then proceed with the rest normally.

 

https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/static-vi-reference.html

 

However, I think you will find that the "Idle" check also might not work in an EXE, as most VIs are marked as "reserved for running" even if they're not actively running, so your entire plan may need to be redone slightly to make it work in an EXE.  For instance, have the VI you're running an "idle check" on just set something globally when it starts and unset it when it completes, then check that global setting to determine whether to start it or not.

Message 2 of 4
(128 Views)

My Application (EXE) Does Not Dynamically Call My Plug-Ins Correctly

-------------------------------------------------------
Applications Engineer | TME Systems
https://tmesystems.net/
0 Kudos
Message 3 of 4
(80 Views)

Using a Static VI Reference instead of the fixed path corrected the problem. Thank you so much.

0 Kudos
Message 4 of 4
(64 Views)