LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem running VIs in EXE

I am attaching an example.


What I'm trying to to is I have a TopLevel.vi.

On a certain ocasion I wan the TopLevel.vi to spawn a Window.vi.

 

This works in the Development System, but fails to work in EXE.

 

I would like if possible to have the Window.vi reside in an Auto Populating Folder as it is now set up in the attached project.

 

I've applied this advice ( but I cannot make it to work ) , perhaps becaouse my Window.vi is in a folder?

http://digital.ni.com/public.nsf/allkb/FD7DE8BC8FFC256C862565F4006BE363?OpenDocument


Please help me understand why this fails to work.

 

Regards,

Maciej

 


0 Kudos
Message 1 of 14
(3,161 Views)

Hi Mac671,

 

When creating the .exe do you include the window.vi as well?

You can do this by clicking on the 'Source File' tab after you have opened the 'New executable' window from the project window.

Regards,

John McLaughlin
Academic Account Manager
National Instruments UK & Ireland
0 Kudos
Message 2 of 14
(3,152 Views)

Yes I am icluding it. ( screen below )

I've attached the entire project in the previous post feel free to browse through it and check any other settings.

 

Maciej


0 Kudos
Message 3 of 14
(3,146 Views)

Hi,

 

Everything worked fine for me, once I copied the folder "Window" in the folder including my executable.

 

test.png

 

Regards,

 

 

Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
0 Kudos
Message 4 of 14
(3,135 Views)

Thanks for the tip...

It seems what I'm trying to do cannot be done, as the VI structure under the Exe does not preserve folders...

 

I will keep on trying to solve this some other way.
Any suggestions how this should be done "by the book"?


0 Kudos
Message 5 of 14
(3,118 Views)

Hi,

 

If you plan to create an installer for your application, you can preserve the folder structure when you configure your installer in the source files properties windows.

 

ed.JPG

 

Regards,

Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
Message 6 of 14
(3,113 Views)

As I do not have version 10 of LV, I cannot read your code, but this occurs in LV7 as well.

 

One way to do this is to determine if you are using a compiled or not compiled system and strip off the directory from the VI path if it is.  This is how I found this system that I inheirted.  It is a bit messy doing it this way, and it is the way that the link you provided does it to.

 

A better way I found is to create a spawner vi or opening vi in the same directory that the spawing vi is in.  In the spawer or opener vi, open the spawning vi, but DO NOT GIVE A PATH.  This will open in the current vi's directory, which is in the same directory as the spawning vi.  Then if it is a spawner vi, run the vi, otherwise return the reference.

 

Hope that helps.

 

 

A

0 Kudos
Message 7 of 14
(3,100 Views)

 


@Mac671 wrote:

Thanks for the tip...

It seems what I'm trying to do cannot be done, as the VI structure under the Exe does not preserve folders...


 

Actually, it does - that's the whole point. Previous versions of LabVIEW used a "flat" format for the files in the executable. LabVIEW 8.5 (?) changed this so that a hierachical structure is used. You can change it to a flat structure if you want in the "Advanced" tab of the build spec.

 

If you want to include the VIs into the application you can do so. You can also simply call them directly from disk. Either way it can be done. See attached modification. All I changed was the way the path was being created.

Message 8 of 14
(3,091 Views)

 

Thank you!

 

Maciej


0 Kudos
Message 9 of 14
(3,085 Views)

Mac671 wrote:

Thanks for the tip...

It seems what I'm trying to do cannot be done, as the VI structure under the Exe does not preserve folders...


 

Actually, it does - that's the whole point. Previous versions of LabVIEW used a "flat" format for the files in the executable. LabVIEW 8.5 (?) changed this so that a hierachical structure is used. You can change it to a flat structure if you want in the "Advanced" tab of the build spec.

 

If you want to include the VIs into the application you can do so. You can also simply call them directly from disk. Either way it can be done. See attached modification. All I changed was the way the path was being created.


Awesome ! I didn't know that ! Is this allowed because EXE files are in fact some kind of ZIP files ?
Regards,
Da Helmut
Voir le profil de Maxime M. sur LinkedIn - View Maxime M.'s profile on LinkedIn
0 Kudos
Message 10 of 14
(3,071 Views)