From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Running external VIs with a LabVIEW executable

Hello folks,

 

Is it possible to run VIs dynamically using a LabVIEW executable? (Open VI Reference, Call By Reference or Start Asynchronous Call...)

 

If so, what are the major caveats? Last time I tried, I remember it didn't work very well.

 

I am using LV2015 to create VIs and the executable, which will run on a computer that only has the LV Run-Time Engine.

 

Regards,

Pomi

0 Kudos
Message 1 of 7
(3,174 Views)

Not many problems...

VIs should be added to Always included list in Source Files section of exe build configuration.

Pay attention to exe build configuration ->  Advanced -> Use LabVIEW 8.x file layout. It will change relative VI path if checked. I do not know, if it is still present in 2015

Path to the VI is better be relative to mainVI or at least within exe - you do not want troubles with absolute path if executable is moved.

Message 2 of 7
(3,162 Views)

It should be simple enough to make an exe where you select a VI and then try to run it.

It should work, we do it in several projects.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 3 of 7
(3,128 Views)

The attached images show some settings I used to create a dummy executable to run dynamic VIs. I tried to run VIs that were included as source files through the VI server but I keep getting an error 7. The test VI is shown in the attached snippet. Does the file path make sense? Could you point out why this doesn't work?

 

Download All
0 Kudos
Message 4 of 7
(3,062 Views)

Do you get an error when you run the executable?

Matt J | National Instruments | CLA
0 Kudos
Message 5 of 7
(3,044 Views)

The executable runs fine. The error happens when I run the VI (snippet) that I attached. It seems it cannot find Sum.vi from Calc.exe.

0 Kudos
Message 6 of 7
(3,026 Views)

You can access VIs in the executable only from other VIs of the same executable.

So you build exe, based on VI_server_test.vi, always include Sum.vi.

 

I would suggest to remove "Use LabVIEW 8.x layout", then relative path of VIs inside exe and in OS stays the same. Also when building more complex application, VIs from different libraries, placed into one folder (C:\calc.exe) can conflict.

 

If you want to access VI in build from another application (or may be from 2 different applications), it is better to use a library - llb or lvlibp. You also compile VI and its subVIs into this folder, remove all block diagrams.

0 Kudos
Message 7 of 7
(2,987 Views)