LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Question On Path Locations

Solved!
Go to solution

A VI I'm working on stores a few controls in a .ini file and works a treat. I'm going to be turning the VI into an application and have it accessable on a few PCs by either copying the .exe and .ini over to the PCs or keeping it on a thumbdrive.

What I would like ideally is to have the VI look for the path in the same folder the application is stored in. So if I copy the folder over to a desktop or a thumbdrive, it wouldn't matter. What's the easiest way to do this?

0 Kudos
Message 1 of 5
(2,384 Views)

Application Directory function.


I am not allergic to Kudos, in fact I love Kudos.

 Make your LabVIEW experience more CONVENIENT.


Message 2 of 5
(2,370 Views)
Solution
Accepted by topic author awwende

There is a function in the File IO->Path Constants palette called Application Directory.  When in the development environment, it returns the folder of the project file.  When in an application (exe), it returns the folder of the executable.  Use this function with the Build Path to locate your ini file.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 3 of 5
(2,368 Views)

Run this VI.

 

It correlates each of the path constants to the actual location it points to on your specific PC which will vary depending on your OS and who is logged in.

Message 4 of 5
(2,364 Views)

Thank you all. That's exactly what I was digging around trying to find. 

0 Kudos
Message 5 of 5
(2,345 Views)