10-26-2010 05:00 AM
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
10-26-2010 05:49 AM
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,
10-26-2010 06:18 AM
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
10-26-2010 06:38 AM
10-26-2010 08:38 AM
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"?
10-26-2010 08:44 AM
10-26-2010 09:20 AM - edited 10-26-2010 09:24 AM
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
10-26-2010 09:35 AM
@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.
10-26-2010 09:53 AM
10-26-2010 10:08 AM
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.