LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call an external VI's from EXE?

Dear LVer's,
I have been searching and reading all the articles you have posted, and finally I learned how to build application with dynamic VI's (keep the panel!). However, my problem is now, I don't have those dynamic VI's. The dynamics VI's I am calling are external drivers written previousely, and exist somewhere in local hard drive. The goal is to call them externally rather than including them when building application.

To simplify the question, how can my LV6 .EXE application dynamiclly call an external VI/LLb if a specific path is given?
0 Kudos
Message 1 of 10
(4,892 Views)
The only way I know of doing this is to include all the vi's that are called in the .llb of which you are trying to build the application and then build the application. Please post the solution if you find one.

Good Luck.
Pari.
0 Kudos
Message 2 of 10
(4,892 Views)
> To simplify the question, how can my LV6 .EXE application dynamiclly
> call an external VI/LLb if a specific path is given?

If the path is absolute, simply feed it to the open vi reference function.
If the path is relative, it is easiest if the dynamically called vi is in
the same directory or a subdirectory of the executable. Use the strip path
function to get the relative path. Note that with an executable, you need
to call strip path twice, since the path to the executable takes the form:
c:\program directory\more directories\vi name.exe\vi name.vi . In the
development environment, the path takes the form: c:\program directory\more
directories\vi name.vi . You can use an application property node to
determine whether your vi is running in the development or the
run-time
(.exe) environment.
0 Kudos
Message 3 of 10
(4,892 Views)
Thanks for your suggestion DD.
However, the problem was when building the VI to application, it wouldn't work properly unless I include ALL dynamic VI's (with panel), but I don't want them to be included.
0 Kudos
Message 4 of 10
(4,892 Views)
You should be able to dynamically call the external VIs with your exe just like when its a VI without including them in the build. I just tried and it worked fine. What kind of problems are you having?

Brian
0 Kudos
Message 5 of 10
(4,892 Views)
The error code is "7", however when I run the application, the error message is "??? in chamber control.vi" instead of "File not found" (chamber control.vi is the main VI) That is strange to me.

I am pretty sure that the path is correct. The only problem I can think of is that the VI I am calling is actaully a Labview 5 LLB. I guess before building application, Labview 6 can translate the LV5 code to LV6, and that is why it works in editing mode. After building application, the LV6 run-time engine doesn't have the ability to translate the LV5 code, and hence give such error.

Do you guys think that is why? Any solution?
p.s. I could call a LV6 VI dynamiclly.
0 Kudos
Message 6 of 10
(4,892 Views)
I think you've discovered the problem. All VIs have to be the same version as the run time engine.
0 Kudos
Message 7 of 10
(4,892 Views)
It might have more to do with the fact that its in a library. I ran a quick test and counldn't seem to get it to work either...

Brian
0 Kudos
Message 8 of 10
(4,892 Views)
I was wrong, my test was flawed. Dennis is right, its because of a version conflict.
0 Kudos
Message 9 of 10
(4,892 Views)
This sounds right. I know that V5 executables will not work with the V6
run-time engine.

"Brian Vibert" wrote in message
news:50650000000500000079500000-1005954886000@exchange.ni.com...
> I was wrong, my test was flawed. Dennis is right, its because of a
> version conflict.
0 Kudos
Message 10 of 10
(4,892 Views)