09-13-2016 04:23 AM
Hi all,
I have created an executable for my labview project. I now want to know if this executable can be made to use a Labview VI (which was no used while building the executable) that is present in some location in that system. I am no sure whether this is possible or not. I would like to know if it is possible. If yes, how can that be made?
Thanks for the help in advance.
Regards,
Ramya
09-13-2016 06:26 AM
You have to include that VI and Create executable once again,I hope thats the only option.
09-13-2016 06:29 AM
No. I browsed on this topic and found that we can create some llb and use it as a plugin with the exe. Any idea about this?
09-13-2016 06:38 AM
I am not sure, you can share the link of the one which you shared.
If you can explain the sceanrio for which its being required it will be good.
09-13-2016 06:52 AM - edited 09-13-2016 06:56 AM
The run-time engine can only run compiled VIs, so you can't copy a .vi file from your development machine onto a machine with the run-time engine and call that VI from your executable (I think...).
It *might* be possible to call the VI from the executable if you create a build specification that includes the VIs and you can then load it into your executable (Open VI reference from path) as long as the run-time engine version numbers match (but I'm not sure I've ever tried this outside of originally including the VI as an 'always include' in the exe build specification).
The more common method is to use Packed Project Libraries - put your VI into a LabVIEW library (.lvlib) and then create a build specification to compile that into a PPL (.lvlibp). You can then call VIs from the PPL dynamically (there are special methods for 'get VI path from PPL' but then you use Open VI Reference -> Run VI Synchronously/Asynchronously etc.).
There are many topics/posts about using PPLs (including potential pitfalls):
https://decibel.ni.com/content/docs/DOC-19176
https://decibel.ni.com/content/docs/DOC-20274
(Essentially what you're talking about is a plugin architecture - you might want to try searching for that too - it allows you to update parts of your code by providing updated plugin files which are loaded dynamically into the executable during execution.)
09-13-2016 06:54 AM
Hi Ramya,
this VI/LLB needs the be the very same LabVIEW version as was used to create your executable - the VI needs to run using the same RunTimeEngine! (And you should avoid separating the compiled code from your VI in this case…)
09-13-2016 07:23 AM
@Sam_Sharp wrote:The run-time engine can only run compiled VIs, so you can't copy a .vi file from your development machine onto a machine with the run-time engine and call that VI from your executable (I think...).
As long as you do not have the "Separate From Compiled" turned on for the VI, the compiled code is in the VI file. Therefore, you can have an executable call a VI.
10-14-2016 12:51 PM - edited 10-14-2016 12:55 PM
The answer here is, yes you can. As mentioned, calling a library is more common, as it is more certain that all required subroutines are present. I have built a plugin architecture which calls VIs from packed libraries (preferred) and llbs. These libraries must contain all VIs required by the VI you want to call (such as LV standard VIs that are not loaded by your application into the runtime environment).
It's also helpful to know how to build a path to a VI in a packed library. See here.