pikro Posted September 6, 2008 Report Share Posted September 6, 2008 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 Does someone have any idea where is the problem? (LabView 8.6) Quote Link to comment
shoneill Posted September 6, 2008 Report Share Posted September 6, 2008 QUOTE (pikro @ Sep 5 2008, 12:28 PM) 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 Have some one idea where is the problem? (LabView 8.6) 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. Quote Link to comment
LAVA 1.0 Content Posted September 6, 2008 Report Share Posted September 6, 2008 QUOTE (shoneill @ Sep 5 2008, 05:42 AM) 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. http://lavag.org/old_files/monthly_09_2008/post-3370-1220628668.png' target="_blank"> Quote Link to comment
Yair Posted September 7, 2008 Report Share Posted September 7, 2008 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. Quote Link to comment
pikro Posted September 10, 2008 Author Report Share Posted September 10, 2008 QUOTE (Yair @ Sep 6 2008, 08:17 PM) 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 http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=293206#M293206' target="_blank">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. Quote Link to comment
Yair Posted September 10, 2008 Report Share Posted September 10, 2008 QUOTE (pikro @ Sep 9 2008, 10:43 AM) 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. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.