LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to ensure support file paths during building application

I'm building an application (which also uses certain configuration files and files containing controls data) using LabView 7.1 Professional. During building application the support files (configuration files and controls data files) are added using "Add Support File" option in "Source Files" tab of Build Application script. But the application(after building) donot interact with these files as defined in block diagrams. The probable reason is that the paths of these files donot match with the paths in block diagram. Can any body guide me how to resolve this problem.
0 Kudos
Message 1 of 4
(2,540 Views)

Hi,

What I always do is the following:

Somewhere in my LV data directory. I make a directory for my application. We call this 'application'

In this folder I create directories for my VI's, support files, and ....  In one of those directories there is my main VI. We call this directory 'main VI's'  The target directory for the application builder is the 'application' directory.
In your main VI you use the VI 'current VI path' function with 2x strip path and you have the application directory as start path. From this point you have a (relative) path to all your files.
 
It works for your VI and for your executable. You can create all the sub directories you want to store your VI's and support files.
 
0 Kudos
Message 2 of 4
(2,532 Views)
I presume your filepaths are relative to the location of the Top-level VI/application?  If so, then there is a trick in that the Runtime version effectively has an extra directory level - the application itself - in the "Current VI's Path".  If you create a Labview  Application Property Node, there is a property called "App.Kind", and one of the values is "Run Time System".  Use a Case diagram to put in an extra "strip path" function in the wire when it is a built application.

Paul
Message 3 of 4
(2,531 Views)
Thanks K C and Paul Davey,
 
I've got the point. There is an extra directory level put in during building process. But Paul Davey's soloution is more effective and requires more programming. Because the Application will not work during development and debugging (when not built) because one more directory level is stripped off (which works only in built application). In my case, the application contains more than 300 VIs and every time I've to modify all relative paths of support files whenever I'm shifting in between built application and non built application for upgradations. So the better soloution is to use App.Kind property node for defining different cases for Development System and for Run Time System.
0 Kudos
Message 4 of 4
(2,520 Views)