LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

problem creating .exe file

My vi program takes some of the file from the directory in which the vi is present for some intialization functions. This was working fine until I created the exe file. When I created the exe file, it is not reading the files from the directory in which the exe file is present and is giving some memory read error. Can anyone help to overcome this problem.

Thanx & Regards,
Srini.
0 Kudos
Message 1 of 8
(2,913 Views)
You need to tell the program in which directory to find all other files, so you need to give it a full path.
If you want to determine what is the current path, you can use either "current vi Path" constant in function pallete or find a call Chain constant, open a reference to the first vi and read a path from there with prior stripping it to path and file name.

See enclosed file for help.

Pawel
0 Kudos
Message 2 of 8
(2,913 Views)
Hi Srini,

Some of those problems are due to a change in the VI path when in an EXE or not.

For instance if your VI path is :
- \MyLLB.llb\MyVI.vi when you create the EXE file then your VI path becomes \MyEXE.exe\MyVI.vi
- \MyVI.vi when you create the EXE file then your VI path becomes \MyEXE.exe\MyVI.vi

That's why when you're in "Run-Time System" (Use "application type" Property node to know if you're in an exe or not) you need to strip path once more if your VI is not in a llb.

Hope this helps !
Julien
0 Kudos
Message 3 of 8
(2,913 Views)
Hi,
Actually my VI is not in a llb. And wherever I need to open files, I am using curretn vi's path, strip it once and build path to get the actual filename. But I found that this is not really causing the problem. I have some subpanels in my main VI in which I insert some VIs. But when I create the exe file, these VIs are not getting inserted into the subpanels bcoz they are not subVIs. LabVIEW by default includes all subVIs required by the main VI but the VIs that will be getting inserted into the subpanels are not included in them. I felt like since there is no reference to them,it is giving an error that it is an not able to find a file or so. So, what I did was, I used the open VI in the controls palette and simply included the VIs icons in my program
and this was causing some memory reference problem. When I removed these icons, these memory reference problem was not there.
So, I would like to know how to display the VIs that are getting inserted into the subpanels when I create an exe file. What changes should I make to main VI before creating the main VI.

Thanx & Regards,
Srini.
0 Kudos
Message 4 of 8
(2,913 Views)
Hi Srini,

If I understand well your comment all you need to do is insert your VI when you build the application.

To do so, in the LV's Build application window select the tab "Source files" and "Add dynamic VI...". This enables you to add your subpanels one by one. You don't have to change anything to the other tabs.
Keep in mind (to get the VIs paths) that all those VIs are in the same EXE.

Hope this helps !
Julien
0 Kudos
Message 5 of 8
(2,913 Views)
Hi,

If you load vi's dynamically, and you are setting or reading controls
(values or properties, etc) dynamically, you also need to untag the "remove
panel" option.

Regards,

Wiebe.


"jumarion" wrote in message
news:506500000005000000D7C90100-1079395200000@exchange.ni.com...
> Hi Srini,
>
> If I understand well your comment all you need to do is insert your VI
> when you build the application.
>
> To do so, in the LV's Build application window select the tab "Source
> files" and "Add dynamic VI...". This enables you to add your subpanels
> one by one. You don't have to change anything to the other tabs.
> Keep in mind (to get the VIs paths) that all those VIs are in the same
> EXE.
>
> Hope this helps !
> Julien
0 Kudos
Message 6 of 8
(2,913 Views)
Sorry! I couldn't get what you mean by "untag the remove panel" option. Please give more explanation.
0 Kudos
Message 7 of 8
(2,913 Views)
in the tab "VI settings" when you build the application :
if the column "Remove Panel" of your dynamic VI is set to "Yes" it means that when creating the EXE the front panel of your dynamic VI will be removed. As you don't want this to happen select the line of your dynamic VI and "Edit build Settings..." change the first "No change" to "No" and the front panel of your dynamic VI won't be removed when creating the EXE.

Hope this helps !
Julien
0 Kudos
Message 8 of 8
(2,913 Views)