03-21-2011 08:47 PM
Hello,
I am using LV 2009 SP1.
I am trying to build a "Main.vi" into an exe, in which this Main.vi needs to dynamically call two vi "A.vi" and "B.vi" using call by reference node.
Therefore in the Build Specs/Source Files, I've put A.vi and B.vi into "always included" before building the exe.
I assume this way A.vi and B.vi will be in memory already inside the exe and I can simply wire string constants "A.vi" and "B.vi" to the Open VI reference's vi path input, instead of loading the VI from the hard drive.
Unfortunately the loading from memory - string input approach gets me an error message and told me to provide a path to the input to load this VI into memory.
It kind of suggests that A.vi and B.vi is not in memory at all even though I've put them inside "always included" during the Build exe setup.
I would really want to get the string constant path input working instead of loading these VIs through the hard drive. Based on the above description, I would like to seek some help and determine what can I do to get it working.
Any help will be deeply appreciated.
Cheers
Will
03-21-2011 10:54 PM - edited 03-21-2011 10:56 PM
Just because they are in the executable they are not loaded into memory - that't why it's called dynamic linking. You still have to open a reference to the plugins to get them loaded into memory and to open a reference you need to give a path to the VIs, not just their names.
Mike...
03-22-2011 02:28 AM
Hi,
Mike is right with what he explained. I just wanted to add, that if you're using paths (to the dynamic VI's) that you should be carefull with those. The path to a VI in development mode is different then in runtime mode.
Development : ../Folder/VI
Runtime : ../Application.exe/VI
So you will have to check whether you are in development or in runtime. More info on how to do that can be found here . You can compare the output of this property to a certain value and determine which kind it is.
03-22-2011 03:20 AM - edited 03-22-2011 03:21 AM
@ABCPrograms wrote:
Hi,
Mike is right with what he explained. I just wanted to add, that if you're using paths (to the dynamic VI's) that you should be carefull with those. The path to a VI in development mode is different then in runtime mode.
Development : ../Folder/VI
Runtime : ../Application.exe/VI
So you will have to check whether you are in development or in runtime. More info on how to do that can be found here . You can compare the output of this property to a certain value and determine which kind it is.
When you use the modern 2009 and newer application layout (the default unless selecting the 8.x layout in the build options), the path is actually the same in an executable than in the development system, at least in respect to the project file.
Another point: If the OP expects the VIs to be in memory anyhow why not include them as static VI reference? Or call them as simple subVI anyhow?
04-29-2011 05:45 AM
Sorry I have the same problem and I don't understand how to resolve it.
I have a main application main.vi that call other 4 vi when the user want clicking on specific button.
To open the front panel of the selected vi I use the Open VI Reference connected to the Invoke Methods Fp.Open and than Run VI.
To the "vi path" input of Open VI reference I connect the relative path of the vi using the constant "Current vi's path" stripped with the name of the vi to call.
When I create the exe file I put the main.vi in the Startup VIs listbox and the vi to call in the Always Included listbox.
When I run the application in development mode, running main.vi, all works fine, when I run main.exe the 4 subpanels never display.
Could you explain me how can I resolve the problem (without using acronimous)?
I also try to substitute the Open VI Reference with Static VI Reference and connect the output reference to the Fp.Open but it still not working fine.
Thanks.
Ale
04-29-2011 07:25 AM
Ok, I don't know what wrong before, now the main.exe works fine.
I have tried again the solution using Static VI Reference insted of Open Reference. In the Build option I add the 4 vi that shall be called by main.exe in the Always Included listbox (in Source files category) and now it works fine. Probabily in the previous test I mistake to add those files in the always included list...
Ale
01-16-2013 06:16 AM - edited 01-16-2013 06:17 AM
Even I have the same problem. Please any one solve this.
In my application application.exe will ask for the vi to execute. I suppose to give defects_feature_information.vi in that path.
If that defect_feature_information.vi path is selected from folder its not showing any error.Executing fine.
Problem : I builded my application along with defects_feature_information.vi as always included. So I suppose to choose path as
H:/my project/Application.exe/Defects_Feature_Information.vi . In this case it shows error.
Please anyone help me out. I have included my exe and VI.
Note: ProgOpenaVI LV 8.0.vi is top level vi