09-14-2005 09:06 AM
09-14-2005 09:14 AM
How are you making the path to the folder? Can you attach the simplified code? Or at least a picture of the relevant parts?
One trap to avoid falling into is this:
If you use THIS VI's PATH to start building a path, remember that you have to strip TWICE if you're in a LLB, TWICE if you're in an EXE, but ONCE if you're in a VI file (not in a library).
For that reason, I suggest never using stand-alone VI files, always use libraries.
Ask a clearer question and you'll get a clearer answer.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-14-2005 09:18 AM
We have two ears and one mouth so that we can listen twice as much as we speak.
Epictetus
09-14-2005 09:27 AM
Indeed, an EXE container is just like an LLB container.
If you use THIS VI'S PATH from a VI in a library, you get: Drive \ Parent Folder \ Folder \ MyProgram.llb \ This VI.vi
If you use THIS VI'S PATH from a VI in an executable, you get: Drive \ Parent Folder \ Folder \ MyProgram.exe \ This VI.vi
But if you use THIS VI'S PATH from a VI in a stand-alone file, you get: Drive \ Parent Folder \ Folder \ This VI.vi
To get to the Folder, you have to STRIP PATH once from a VI file, but TWICE from a VI in a LIBRARY and TWICE from a VI in an app.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-14-2005 09:35 AM
The "container" is actually the exe file but the exe file is actually an llb.
When you use Get Current VI's path on a VI in development mode and the VI exists in a folder and not an llb, the path would be something like c:\folder\example.vi. When you build an executable "built.exe", the path to the VI is c:\folder\built.exe\example.vi. So, in order to determine the actual folder you're in, you have to do an extra strip path. The way to write your VI so that it works in both development mode and as an exe is to use an application property node and the property application kind. When built, the property will return a value of "Run Time System". Wire the output of the property node to a case statement and create the case "Run Time System". Put the extra strip path inside this case and make another, empty case the default.
09-14-2005 10:13 AM
Actually, I find it easier to just avoid stand-alone VI files.
Use a library, then the EXE and LLB are exactly the same.
Blog for (mostly LabVIEW) programmers: Tips And Tricks
09-14-2005 10:26 AM