LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Current VIs path function.......

Solved!
Go to solution

 

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

 

 

 

 

 

Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 1 of 5
(3,277 Views)
Solution
Accepted by topic author Anil_Reddy

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

0 Kudos
Message 2 of 5
(3,250 Views)

Hi anil,

  In the source file settings of the subvis,destination should be application.exe,then only the path will be ......\application.exe\subvi.vi...

 

 

 

Thanksand regards,

srikrishnaNF

Regards,
Srikrishna


0 Kudos
Message 3 of 5
(3,237 Views)

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  Smiley Very Happy

Message Edited by Anil Reddy on 02-25-2010 07:46 AM
Anil Punnam
CLD
LV 2012, TestStand 4.2..........
0 Kudos
Message 4 of 5
(3,201 Views)

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. 

0 Kudos
Message 5 of 5
(3,195 Views)