LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

list VIs inside 2010 executable

Hi all,

 

I have an application where I would need to get a list of VIs present in a folder which is inside the current application (executable). But the 'List Folder' funtion returns an error when trying to do this. This link provides a way to list the VIs inside a LV2009 exe. But mine is a LV2010 executable & the OpenG example does not work. Any help for listing 2010 exe VIs will be appreciated.

 

Thanks,

Priyadarsini

0 Kudos
Message 1 of 30
(4,237 Views)

Hi,

What error do you get when you use " list folder" function?

 

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 2 of 30
(4,224 Views)

Error 7 - File not found. This is the error I get with both 'List Folder' function and also the openG VI.

0 Kudos
Message 3 of 30
(4,210 Views)

Hi priyadarsini,

I do not think it has anything to do with Labview Version. check the path...I think "List Folder" function is getting wrong path.

can you post your code..or show us Block diagram where you have used this function?

If you are posting code please post it in LV2009.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 4 of 30
(4,200 Views)

Hi gak,

 

I have attached a sample application used to list the files and folders. I have used the normal 'List Folder' function when running in development system and the OpenG VIs for listing the folder in exe. These OpenG VIs work perfectly in LV2009 but not in LV2010. NI List Folder gives error in both LV2009 and LV2010 in exe. I have attached both these versions.

0 Kudos
Message 5 of 30
(4,133 Views)

Here you go.Smiley Wink

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 6 of 30
(4,117 Views)

Hi Gaurav,

 

Your modified VI accesses the SubVIs folder in the disk outside the executable and populates the contents. I had tried the same method previously - to keep a copy of the folder whose contents I would need to list in my application in data folder of the exe. But this is not an ideal solution and since I stumbled upon the OpenG VI which does it for folders which is a part of exe, I thought of using the same method. But my problem now is to make the OpenG VI work in LV2010. Or is it something related to a NI change in LV2010 application builder which I am not sure of.

 

Thanks,

Priyadarsini S

0 Kudos
Message 7 of 30
(4,109 Views)

Hi priyadarsini,

This is not due to "List folder" function. In LabVIEW 2009, the file layout of an executable was changed.This is the reason why you get error 7.Because that function is getting wrong path.

Read here.

May be it will help.

Gaurav k
CLD Certified !!!!!
Do not forget to Mark solution and to give Kudo if problem is solved.
0 Kudos
Message 8 of 30
(4,095 Views)

Hi Gaurav,

 

Thanks for the link. But to be more clear, I am able to confirm that the path is correct by opening a static reference to a VI that resides inside the folder which I am trying to list and getting the VI's path. So the path issue can be ignored. Further I created the project and Vis in LV2009 & then upgraded & mass compiled all to LV2010. Also note here that 'Use LabVIEW 8.x file layout' build setting is unchecked in both LV2009 and LV2010 projects. So I am expecting both should work the same way. Also I think error 7 from NI's 'List Folder' is also expected since the path wired is not in disk but a virtual path. But the OpenG VIs adapt a zip style to list the paths in an exectuable. So this works for a path in LV2009 exe also. Since our application is in 2010 it would be great if there is a way to make it work in 2010. Yes the alternative is to maintain a copy in data folder and use it to list the contents. But this is not a desired solution as I mentioned in my previous post.

 

Thanks,

Priyadarsini

0 Kudos
Message 9 of 30
(4,062 Views)

I am not familiar with how the Open G VI is able to list the contents of an EXE. The native "List Folder" function in LabVIEW will not work inside of an EXE. There were customer reports that you could use zip software to view the list of VIs in a 2009 executable. In LabVIEW 2010, a change was made to prevent this from happening. If the Open G VI uses some zip file API to read the contents then it is possible that this change to the EXE affected that functionality.

George M
National Instruments
Message 10 of 30
(4,041 Views)