02-16-2012 09:35 AM - edited 02-16-2012 09:36 AM
Hi all,
I would like to create an executable which is able to dynamically run a VI. This is done with the "Run VI" invoke method. However, it doesn't work because it is not able to find the required SubVIs. I was able to fix it by adding a few paths in the "viSeachPath" file of the executable ini file. But it takes a lot of time to find all the VIs in the specified paths.
Is there any way to optimize this ? I've seen that there is a method to get the dependencies of a VI. Would it be possible to use this method, then pre-load all dependencies and finally run the VI ?
Thanks,
Alex
02-16-2012 09:44 AM
All you really need to worrry about is finding the VI you want to call dynamically. For that I have found it helpful to always have such plugin VIs always located in a known location like a "Plugins" subdirectory in the application directory. Alternately, you could create entries in the application's ini file or a table in a database that contains the path to each plugin.
Are you planning to have the dynamically called VIs included in the executable that will be running them? That structure offers some other alternatives, as well as new issues to address.
Mike...
02-16-2012 09:54 AM
The dynamically called VIs won't be included in the executable.
The path to dynamically called VIs is given by the user so that should not be a problem.
I'm trying to dynamically run a VI which uses a DAQ board and thus uses some DAQmx VIs. However, it fails to find all DAQmx VIs as long as I don't write the corresponding path in the executable ini file.
02-16-2012 10:58 AM
when you build your program (not the installer) go to source files. Add in the dynamic vi into Always include window. The vi will now be included into the executable. Be careful how you access the dynamic VI. In the development, it is in one directory but when you generate the executable, it will be in the executable.
02-16-2012 03:09 PM
Thanks for your reply.
In fact, I don't want to include the dynamic VIs into the executable.
I've seen that when I run my executable, it is not able to find any VI which in the vi.lib folder. It seems that the runtime can't translate the <vilib> symbolic path to "C:\Program Files (x86)\National Instruments\LabVIEW 2009\vi.lib.
Is it a normal behavior ?
Thanks,
Alex
02-16-2012 10:25 PM
02-17-2012 01:43 AM
Is there any way to save a VI with an absolute path instead of a symbolic path ?
Thanks,
Alex