LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can a LV executable use a vi for its execution?

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

0 Kudos
Message 1 of 8
(3,068 Views)

You have to include that VI and Create executable once again,I hope thats the only option.

 

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 8
(3,038 Views)

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?

0 Kudos
Message 3 of 8
(3,035 Views)

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.

----------------------------------------------------------------------------------------------------------------
Palanivel Thiruvenkadam | பழனிவேல் திருவெங்கடம்
LabVIEW™ Champion |Certified LabVIEW™ Architect |Certified TestStand Developer

Kidlin's Law -If you can write the problem down clearly then the matter is half solved.
-----------------------------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 8
(3,030 Views)

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

http://labviewjournal.com/2011/07/to-ppl-packed-project-libraries-or-not-to-ppl-part-1/?relatedposts...

 

(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.)


LabVIEW Champion, CLA, CLED, CTD
(blog)
0 Kudos
Message 5 of 8
(3,023 Views)

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…)

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(3,019 Views)

@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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 7 of 8
(3,008 Views)

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.

_____________
Creator of the BundleMagic plugin for LabVIEW!
0 Kudos
Message 8 of 8
(2,820 Views)