08-23-2023 01:38 AM
I have a small problem. So I have this labview application that needs the path at different locations. So for application I use the application directory at all those places and the program works fine. But when there is some problem somewhere else in the application, then to debug it, I need to use LabVIEW itself, so here I use current VIs path. Now here comes the problem. All the subVIs are neatly placed in different subfolders, so I have to work on it each time, like get the current VIs path, go one folder up and stuff like that. So because of this I cannot initialize it at one place and use it everywhere. So everytime I have to debug, I need to change the location at all places from application path to current VIs path, which is a headache. Is there a easier way to do this or is there a way that a labview application can recognise itself that it is an application and not a VI, so then I can use a case structure and tell the program if it is application use application path, if not use current VIs path. Thank you.
Solved! Go to Solution.
08-23-2023 01:47 AM
Hi govindsankar,
@govindsankar wrote:
Is there a easier way to do this or is there a way that a labview application can recognise itself that it is an application and not a VI, so then I can use a case structure and tell the program if it is application use application path, if not use current VIs path.
The solution is to use the AppDir file constant ALL THE TIME!
From the help of this constant:
Returns the path to the directory containing the application.
If you call this VI from a stand-alone application, this VI returns the path to the folder containing the stand-alone application.
If you call this VI from the development environment and the VI is loaded in a LabVIEW project file (.lvproj), this VI returns the path to the folder containing the project file. If the project is not saved, this VI returns <Not a Path>.
You surely use a LabVIEW project when you edit/debug in the development environment, don't you?
08-23-2023 01:51 AM
Sorry I got the solution:
https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000YIDzCAO&l=de-DE