03-30-2016 04:24 PM
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
03-30-2016 04:58 PM
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.
03-31-2016 03:13 AM
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
04-06-2016 05:49 PM - edited 04-06-2016 05:50 PM
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?
04-06-2016 06:13 PM
Do you get an error when you run the executable?
04-06-2016 06:51 PM
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.
04-07-2016 10:30 AM
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.