LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to link to a VI in an EXE

Hi All,

I have two modules of code. The first is either in VI or EXE format, the second is in EXE format. I want the first module to link to a VI in the second using call by reference node. I find that when I try this I get error 1003 (The VI is not executable.) even thought I know it is functional.

Has anyone attempted this? Or can any one explain this behaviour?

Thanks for your help

Denis
0 Kudos
Message 1 of 3
(2,957 Views)
Well, there are a few issues here. First if you want to load the VI from your other application you will have to either reference it by the path
/otherapp.exe/yourVI.vi or alternatively using VI server open a reference to the other executable and then opening a reference to the VI through the VI server of that application. For this to work you have however to enable the VI server of the other application. You can do that most easily by configuring VI server in your development system and copying the according labview.ini file settings into your otherapp.ini file.
Complicated? Yes of course, but there are a few reasons to do it that way.

1) If the LabVIEW runtime systems are not exactly the same you will get trouble loading the VI from one executable into the
other executable.

2) If you load an external VI in an executable it usually has subVIs. If one of those subVIs happens to have the same name as another subVI in your caller executable, the LabVIEW runtime will try to link to its own subVI instead and if the connector pane of those two subVIs isn't exactly the same the externally loaded VI is not executable.

Rolf K
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 2 of 3
(2,957 Views)
Denis Jolivet wrote:
> Hi All,
>
> I have two modules of code. The first is either in VI or EXE format,
> the second is in EXE format. I want the first module to link to a VI
> in the second using call by reference node. I find that when I try
> this I get error 1003 (The VI is not executable.) even thought I know
> it is functional.
>
> Has anyone attempted this? Or can any one explain this behaviour?

Well, there are a few issues here. First if you want to load the VI from
your other application you will have to either reference it by the path
/otherapp.exe/yourVI.vi or alternatively using VI server open a
reference to the other executable and then opening a reference to the VI
through the VI server of that application. For this to work you have
howev
er to enable the VI server of the other application. You can do
that most easily by configuring VI server in your development system and
copying the according labview.ini file settings into your otherapp.ini file.
Complicated? Yes of course, but there are a few reasons to do it that way.

1) If the LabVIEW runtime systems are not exactly the same you will get
trouble loading the VI from one executable into the other executable.

2) If you load an external VI in an executable it usually has subVIs. If
one of those subVIs happens to have the same name as another subVI in
your caller executable, the LabVIEW runtime will try to link to its own
subVI instead and if the connector pane of those two subVIs isn't
exactly the same the externally loaded VI is not executable.

Rolf K
0 Kudos
Message 3 of 3
(2,957 Views)