LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using VI Server to pass data between a Labview Executable and a VI

I tried to buid an executable with the Standard Labview example VISERVER/Plug in and I'm not able to make it working: The exe is unable to load the plugged in vi's!I've added "Open application reference.vi": It works but only when Labview is loaded!As I need to use this program on a computer without Labview, it's not enough! The comments to the example says that it should be possible!
How could I make it running! Do someone have an example that is running without problem!
Thanks for your Help!
0 Kudos
Message 1 of 9
(4,185 Views)
If you build the shipping example as is, it will work. Don't add anything. I think the problem is with the plug-ins. You'll only get a list of plug-ins if the open without an error. Without the LabVIEW development system, subVIs, etc. are missing and they won't open. For each of the plug-ins, do a Save with Options and choose Application Distribution. Save the llb in the same folder as your plug-in VI. The llb will have vi.lib files and all external sub-routines and the plug-in VI should open without an error.
0 Kudos
Message 2 of 9
(4,185 Views)
Something to consider when building executables: the vi is simply bundled into the executable. For instance, a path that looked like C:\Level1\Level2\sample.vi in code, looks like C:\Level1\Level2\Sample.exe\sample.vi in the executable.

This can play merry havoc with any relative pathing that's performed in executables, such as in the Create Plugin List.vi subvi in the plugin example.

This may or may not be the source of your problem, but it's worth trying.

Good luck.
0 Kudos
Message 3 of 9
(4,185 Views)
It definitely is possible to build a standalone application and call plug-in
VIs with the VI server. I did it in some of my apps. You even don't need to
include the plug-ins into the distributed applications as has been suggested
here.
All that the VI server call needs to know is the correct path to the plugin
when opening it. I tried your example and get error (in development
environment as well as in the compiled version) when a reference to
'localhost' ist opened. Why is this necessary (since the 'Open VI reference'
function works in the local environment by default)? When I remove the 'open
localhost' from your code (bringing me back to the example provided with LV
basically) the code works in the development environment. I didn't recompile
it, but it should w
ork then, too.

It is, BTW, not easy to debug a plugin called by VI server in a built
application. You can, however, also run the built code in the development
environment by opening 'plug in.exe/Plug In Example.vi' from the development
environment. Then you can manually go to the plugin code and place
breakpoints, probes etc and debug it.The code of the main.vi and it's subs
which are embedded in the built app are not accesible to debugging.


- Franz

"Olivier" schrieb im Newsbeitrag
news:5065000000080000007A780000-1042324653000@exchange.ni.com...
> I tried to buid an executable with the Standard Labview example
> VISERVER/Plug in and I'm not able to make it working: The exe is
> unable to load the plugged in vi's!I've added "Open application
> reference.vi": It works but only when Labview is loaded!As I need to
> use this program on a computer without Labview, it's not enough! The
> comments to the example says that it should be possible!
> How could I make it running!
Do someone have an example that is
> running without problem!
> Thanks for your Help!
0 Kudos
Message 4 of 9
(4,185 Views)
I tried the example provided with LV: the code works in the development environment but it does not works with the .exe (Only the called VI's that do not have sub-VI's can be found in the list!).It seems that the run time is able to locate the called VI but not its sub-VI's!

I've added the reference to the local host as I found some information on the following link:

http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/7da6b2904e33e59386256adf006512ba?OpenDocument

..with this, the .exe work well when Labvew also loaded is! but it's only half of the way as I need to run this on a computer without LV!
0 Kudos
Message 5 of 9
(4,185 Views)
I've tried it but it does not solve the problem! I even tried to call the vi in the .llb without success!
0 Kudos
Message 6 of 9
(4,185 Views)
Here's an exe I created from the shipping example. I've also included your plug-in folder. Without the Hartley llb, it will only find Linear Curve and Clip Input. I opened Hartley.vi and did an Application Distribution and saved the llb in the same folder as the VI. When I ran the exe the next time, it found Fast Hartley Transform.
0 Kudos
Message 7 of 9
(4,185 Views)
The plugin VIs are found in the development environment call because the
path to the plugin VIs is constructed relative to the "Create Plugin
List.vi" path in that very VI. In the compiled version this will give the
wrong path, where the .exe looks for the plugins.

I have attached a slightly modified version of LV's plugin example program:
It displays on the front panel where it looks for the plugins. Run it in the
development envvironment and in the compiled and see the difference.

What you should do is replace the calculation of the plugin path (in "Create
Plugin List.vi") with a path parameter which is passed to this VI. The best
place where this path should be stored, is the .ini file (You will have
noticed, that in the folder where your plugin.exe resides, a file named
plugin.ini is created after the first call of plugin.exe). This ini file
should contain an entry pointing to the correct path where the plugin VIs
are located.
If you want to make your program really cute, you can alternatively add a
dialog allowing the user to enter the correct path (which of course your
program should store in the ini file)...

Access to ini files is done with the functions in the "File
I/O-->Configuration File VIs" palette. Their use is explained in
"\examples\file\config.llb"

-Franz


"Olivier" schrieb im Newsbeitrag
news:50650000000500000013D50000-1042324653000@exchange.ni.com...
> I tried the example provided with LV: the code works in the
> development environment but it does not works with the .exe (Only the
> called VI's that do not have sub-VI's can be found in the list!).It
> seems that the run time is able to locate the called VI but not its
> sub-VI's!
>
> I've added the reference to the local host as I found some information
> on the following link:
>
>
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/7da6b2904e
33e59386256adf006512ba?OpenDocument
>
> .with this, the .exe work well when Labvew also loaded is! but it's
> only half of the way as I need to run this on a computer without LV!
0 Kudos
Message 8 of 9
(4,185 Views)
Sorry, forgot the attachment...

"Olivier" schrieb im Newsbeitrag
news:50650000000500000013D50000-1042324653000@exchange.ni.com...
> I tried the example provided with LV: the code works in the
> development environment but it does not works with the .exe (Only the
> called VI's that do not have sub-VI's can be found in the list!).It
> seems that the run time is able to locate the called VI but not its
> sub-VI's!
>
> I've added the reference to the local host as I found some information
> on the following link:
>
>
http://digital.ni.com/public.nsf/3efedde4322fef19862567740067f3cc/7da6b2904e
33e59386256adf006512ba?OpenDocument
>
> .with this, the .exe work well when Labvew also loaded is! but it's
> only half of the way as I need
to run this on a computer without LV!



[Attachment plugins.zip, see below]
0 Kudos
Message 9 of 9
(4,185 Views)