LAVA Forums Buy cool LAVA gear Forums RSS Feed

Welcome Guest ( Log In | Register )

> Related links

Visit our LabVIEW Wiki Code Distribution Portal


Tags
(This content has not been tagged yet)
 
Reply to this topic Start new topic
> INI file for my application
pikro
post 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 ,. ,.
Czech Republic Nothing Selected Nothing Selected


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 sad.gif Does someone have any idea where is the problem? (LabView 8.6)

This post has been edited by pikro: Sep 5 2008, 10:48 AM


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Ad
post Sep 5 2008, 10:28 AM
Post #















Tags
(This content has not been tagged yet)
Go to the top of the page
Quote Post
shoneill
post Sep 5 2008, 10:42 AM
Post #2


Very Active
***

Member
Posts: 191
Joined: 26-September 05
From: Zurich
Member No.: 3076
Using LabVIEW Since:2006
LV:8.2.1 ,8.20 ,6.1
Ireland Switzerland Nothing Selected


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 sad.gif 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.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
LV_FPGA_SE
post Sep 5 2008, 03:33 PM
Post #3


Very Active
***

NI
Posts: 124
Joined: 28-October 05
From: Austin, TX
Member No.: 3370
Using LabVIEW Since:1993
LV:8.5.1 ,8.2.1 ,8.6
us_texas Canada Germany My Gallery


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.

Attached Image

Attached File(s)
Attached File  paths.zip ( 21.81K ) Number of downloads: 20
 

--------------------
Christian L
NI Systems Engineering - Real-Time and Embedded Control Technologies
"I like my G code neat."


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Yair
post Sep 6 2008, 06:17 PM
Post #4


Extwemely Active
*****

Premium Member
Posts: 1674
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


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...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
pikro
post 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 ,. ,.
Czech Republic Nothing Selected Nothing Selected


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 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.


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post
Yair
post Sep 9 2008, 04:53 PM
Post #6


Extwemely Active
*****

Premium Member
Posts: 1674
Joined: 23-January 05
From: Here
Member No.: 1431
Using LabVIEW Since:2003
LV:8.6 ,7.0 ,.
Israel Nothing Selected Nothing Selected


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.

--------------------
More than meets the eye...


Tags
(This content has not been tagged yet)
Go to the top of the page
+Quote Post

Reply to this topicStart new topic

 




Time is now: 9th January 2009 - 02:10 AM