03-02-2006 03:00 AM
03-02-2006 03:12 AM
03-02-2006 03:55 AM
03-02-2006 04:27 AM
Yes and no.
Let's do a little example:
Assume you have a main vi, which is in a llb (let's say main.llb\Main.vi). This library is in a root-directory (let's say ..\Program Files\MyApp). Your pdf-file is in a subdirectory of root-directory.
Now, if you access the pdf-file from the vi Main in the LV development environment, you can use the function "Current VIs path" to get its path and then strip it once (results in ..\Program Files\MyApp\main.llb) and then a second time (results in ..\Program Files\MyApp) - so you reach the root directory of your app.
If you compile your app to an exe, you can use the properties mentioned in the other thread to get this directory directly. If you would use the "Current VIs path" function you would get ..\Program Files\MyApp\Application.exe\main.llb\Main.vi. So in the LV IDE, you have to strip it - using the properties mentioned, you would get the directory of the LabVIEW.exe.
What I can suggest you is, that you create a vi, that reads several paths with several methods, compile it to an exe and then compare - just to get used to it. This helped me a lot.
OpenG is some kind of open source project for LV. Just visit http://www.openg.org to learn about it.
Hope this makes it easier for you.
Thomas
03-02-2006 06:01 AM - edited 03-02-2006 06:01 AM
Message Edited by SteveDe on 03-02-2006 06:03 AM
03-02-2006 06:12 AM
03-02-2006 06:25 AM
03-02-2006 06:34 AM
Could you either post it or tell me where I can find this vi?
I've never seen this before.
03-02-2006 06:49 AM - edited 03-02-2006 06:49 AM
Message Edited by SteveDe on 03-02-2006 06:51 AM
03-02-2006 07:09 AM - edited 03-02-2006 07:09 AM
Somehow I must have been far away with my thoughts...
What you wired works - but just as a normal vi in the LV IDE. If you compile it, it won't work anymore.
So here is the difference:
If you run your vi, the path looks like this: ..\DirectoryX\PowerMosFet.pdf
If you compile the vi and run it as an application, it looks like this: ..\DirectoryX\Application.exe\PowerMosFet.pdf
This is exaclty what I tried to describe - you get different paths. Have a look at this picture and to it the same way:
Message Edited by becktho on 03-02-2006 02:10 PM