LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

relative paths in compiled VIs (*.exe applications)

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. 

0 Kudos
Message 1 of 3
(4,520 Views)

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

Message 2 of 3
(4,515 Views)

Here is a knowledge base article on it:

Why Does My Executable Not Work When Using the Current VI's Path Constant?

Adnan Zafar
Certified LabVIEW Architect
Coleman Technologies
Message 3 of 3
(4,492 Views)