LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to find a BMP file included with Application in LabView?

I have a VI that I would like to build into an application (.EXE).  The VI has a Picture indicator, whose source is a BMP on my local hard drive.  Using "Read BMP File.vi" and a Path constant, it's relatively easy to read the BMP and display it in the indicator.  I know how to include the file with the distribution (Build App or DLL -> Installer Settings -> Files), but how does one determine the location of the file after users install the EXE? I tried using just the filename of the picture in the path constant, hoping it would look in it's current directory, but I received an error.  With the full path in the path constant, everything works just fine.
 
Thank you,
...jerry
 
0 Kudos
Message 1 of 3
(2,479 Views)
You can reconstruct the path. Use the "Current VI's path" to get the path of the caller VI. Then use the "Build path" and Strip path" to build the path to your file.

Note that in an executable, the VIs path includes the executable, like the following:  C:\directory_name\my_exec.exe\main.vi

The attached code (image) should do it (or at least give you a start).

Regards;
Enrique


www.vartortech.com
0 Kudos
Message 2 of 3
(2,475 Views)
That's it - the Current VI's Path!!!  Thanks Enrique.
0 Kudos
Message 3 of 3
(2,449 Views)