02-23-2010 04:45 PM
Hi everyone.....
yesterday my application suddenly started behaving in a weird way.........
I have a Sub VI , in which i have current VIs path function. I created executable of my application. launched and observed that current Vis path is giving me some stupid path all of a sudden.
It should give me ..... Program files\application\app.exe\subVI.vi
but I am getting Program files\application\app.exe\D:\Application name\sub directory\subvi.vi
"D:\Application name\sub directory\subvi.vi " this is the path where the actual VI was located on development machine
while preparing exe I selected "same as caller" in the destionation field......
and u know what?....This happens only for one project.all other applications are fine...........and even I created a test project and tried to reproduce this issue in that. but I am getting proper path in the test project EXE......
I am not sure whether I am the first person to get this kind of weird error with current VIs path........
I solved my problem at present by using property node: App Dir as I just wanted to know the place where my EXE is installed....
Thanks
Anil
Solved! Go to Solution.
02-23-2010 08:58 PM
You are running into one of the new features of LabVIEW 2009. In order to solve the problem where by LabVIEW could end up having tons of VIs outside the executable if LVLib or LVClasses were used, NI changed the internal structure of a LabVIEW EXE to have folders rather than just a flat file list. This is a big benefit if your like me and use classes and lvlibs, but means that the old logic for dynamically calling VIs has to be changed somewhat
If you want the old behavior, check out the advanced settings in the build definition and look for a setting called "8.x File layout" (or something like that).
02-23-2010 10:51 PM
02-25-2010 07:45 AM - edited 02-25-2010 07:46 AM
Thank you shew82........But i still have doubt that why other applications are not behaving like this with the same settings...............
may be they are taking some time before explosion
02-25-2010 08:10 AM
Haha yeah, thats a totally understandable feeling, although in some cases your code may not have to change:
1. If you upgrade a project from 8.x to 2009, the "Use 8.x file layout" should already be set.
2. If the VI you are calling dynamically is in the same physical folder in your source code as the VI calling it, then the old logic will still work (as they will end up in the same folder within your exe).
I also remember reading somewhere (although haven't tried this yet) that if you are using classes, then you can just wire the VI's name into the Open VI Ref function as all the VIs that are part of a class are loaded into memory when the class is instantiated.