Visit our LabVIEW Wiki Code Distribution Portal
Tags |
(This content has not been tagged yet)
|
![]() |
Sep 5 2008, 10:28 AM
Post
#1
|
|||
|
1 more post to go! Member Posts: 9 Joined: 15-March 08 Member No.: 11064 Using LabVIEW Since:2008 LV:8.0 ,. ,.
|
Hi, I have confiuration file defaults.ini for my application. When I compile it and then run it, i see always the message : ["C:\MyApplication\MyApplication.exe\defaults.ini" not found]. I have tried to change in MyApplication Property - Advanced - Configuration file form LabView.ini to my file defaults.ini. But it still doesn't work
This post has been edited by pikro: Sep 5 2008, 10:48 AM
|
||
|
|
|||
| Ad |
Sep 5 2008, 10:28 AM
Post
#
|
||
|
|
|
||
|
|
|||
Sep 5 2008, 10:42 AM
Post
#2
|
|||
|
Very Active Member Posts: 173 Joined: 26-September 05 From: Zurich Member No.: 3076 Using LabVIEW Since:2006 LV:8.2.1 ,8.20 ,6.1
|
Hi, I have confiuration file defaults.ini file for my application. When I compile it and then run it. Every time i see message : "C:\MyApplication\MyApplication.exe\defaults.ini" not found. I have tried in MyApplication Property - Advanced - Change configuration file form LabView.ini to my file defaults.ini. But it still doesnt work When you get the path of a VI from within an EXE, the name of the EXE is treated as a folder. The EXE is basically just a glorified LLB. You need to strip one extra level from the "this VI's Path" to get the containing folder after making an EXE. Pain in the rear I know, but once you know about it, you'll know in future. Shane.
|
||
|
|
|||
Sep 5 2008, 03:33 PM
Post
#3
|
||||
![]() Very Active NI ![]() Posts: 110 Joined: 28-October 05 From: Austin, TX Member No.: 3370 Using LabVIEW Since:1993 LV:8.5.1 ,8.2.1 ,8.6
My Gallery
|
When you get the path of a VI from within an EXE, the name of the EXE is treated as a folder. The EXE is basically just a glorified LLB. You need to strip one extra level from the "this VI's Path" to get the containing folder after making an EXE. Pain in the rear I know, but once you know about it, you'll know in future. Shane. Here's an example of how to get the path of a calling VI and automatically strip the EXE if necessary. VI and project are attached.
Attached File(s)
-------------------- Christian L
NI Systems Engineering - Real-Time and Embedded Control Technologies "I like my G code neat."
|
|||
|
|
||||
Sep 6 2008, 06:17 PM
Post
#4
|
|||
![]() Extwemely Active Premium Member ![]() Posts: 1632 Joined: 23-January 05 From: Here Member No.: 1431 Using LabVIEW Since:2003 LV:8.6 ,7.0 ,.
|
Et tu, Christian?
While that method is reasonably likely to work (at least in Windows), it fails to account for many corner cases (e.g. non-Windows OS, a VI in an LLB, a VI whose extension is .exe, etc.). A more robust way would be to do something like this: ![]() Incidentally, this example has its own problems (the top level VI might not always be what you think), but the stripping part is sound. -------------------- More than meets the eye...
|
||
|
|
|||
Sep 9 2008, 07:43 AM
Post
#5
|
|||
|
1 more post to go! Member Posts: 9 Joined: 15-March 08 Member No.: 11064 Using LabVIEW Since:2008 LV:8.0 ,. ,.
|
Et tu, Christian? While that method is reasonably likely to work (at least in Windows), it fails to account for many corner cases (e.g. non-Windows OS, a VI in an LLB, a VI whose extension is .exe, etc.). A more robust way would be to do something like this: ![]() Incidentally, this example has its own problems (the top level VI might not always be what you think), but the stripping part is sound. Thank you for help. This solution doesn´t work, but on your link i found similar way with case structure. And that work.
|
||
|
|
|||
Sep 9 2008, 04:53 PM
Post
#6
|
|||
![]() Extwemely Active Premium Member ![]() Posts: 1632 Joined: 23-January 05 From: Here Member No.: 1431 Using LabVIEW Since:2003 LV:8.6 ,7.0 ,.
|
This solution doesn´t work That code works just fine. As I mentioned, the part on the left (getting the name of the top level VI) might not behave as you expect under all circumstances, but the loop was the important part of the code. -------------------- More than meets the eye...
|
||
|
|
|||
![]() ![]() |
| Time is now: 1st December 2008 - 08:21 PM |