10-14-2009 04:00 PM
It seems that a compiled VI runs from a different path than an interpreted VI in the same folder. Usually the filename (application.exe) is part of the path in a compiled VI, but not in an interpreted VI. When I use a relative path (e.g. functional block "Current VIs Path") I have to use a "Strip Path" function block once to get to the folder these VIs are in for an interpreted VI, but I have to use it twice with a compiled VI in the same folder. The result is that either my compiled VI or my original interpreted VI will correctly find files, but not both of them. This is annoying for development. Does anyone know how I can fix this? Perhaps I can specify the path that the exe runs out of? Or use a functional block other than the "Current VIs Path" block to find the folder that the VI is located in?
thanks.
10-14-2009 04:32 PM
I usually put the main VI in a UI sub directory, so I can have 2 strip paths in both cases.
Adapting this nugget you can get the app.kind property and use a case structure for stripping the relative path.
http://forums.ni.com/ni/board/message?board.id=170&thread.id=418126
10-15-2009 02:22 AM
Here is a knowledge base article on it:
Why Does My Executable Not Work When Using the Current VI's Path Constant?