LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically control a stand-alone LabVIEW application

How can I programatically control a stand-alone LabVIEW application(exe) from another VI. I tried wiring "localhost" to the machine name(in open application reference node) and specifying the path of the exe to the (open VI refernce). I can't, it throws error. Help would be really appreciated.
Thanks.
0 Kudos
Message 1 of 6
(3,492 Views)
Try using the system exec function under the communications palette. This can be used just like opening a dos window and running the exe from the command prompt. Hope this helps.
BJD1613

Lead Test Tools Development Engineer

Philips Respironics

Certified LV Architect / Instructor
0 Kudos
Message 2 of 6
(3,492 Views)
Using a data socket connection between the two VIs should do the trick. There are some examples provided with LabView
0 Kudos
Message 3 of 6
(3,492 Views)
> How can I programatically control a stand-alone LabVIEW
> application(exe) from another VI. I tried wiring "localhost" to the
> machine name(in open application reference node) and specifying the
> path of the exe to the (open VI refernce). I can't, it throws error.

The main thing you need to do is configure the Built app so that it has
the VI Server on and is listening on a known and distinct port.

Depending on what menus are available in your EXE, you might be able to
use the tools>>options dialog to set these things, otherwise, you can
copy from your LabVIEW.ini and modify slightly.

Ultimately, you want an EXENAME.ini file, with EXENAME being substituted
for your EXE's name. If your ini has a section header in []'s, change
that to the EXE
also. Then place the VI Server tokens to turn the TCP
connection on, to set a port, to allow or disallow different types of
access, and to allow/disallow different machine IP/DNS patterns. Again,
this stuff is more easily copied from the LV ini file and modify the
port number.

Now when you try to open the connection, use the localhost and use the
new port number.

Greg McKaskle
Message 4 of 6
(3,492 Views)
Hi Greg,

Thanks for your reply on the concern I have, but I am new to this and do not understand what you are trying say. If you have an example file, it would be splendid. Thank you so much.
0 Kudos
Message 5 of 6
(3,492 Views)
> Thanks for your reply on the concern I have, but I am new to this and
> do not understand what you are trying say. If you have an example
> file, it would be splendid. Thank you so much.

It is hard to give an example that works since your problem is likely
with the EXE rather than with the controller VI.

The error code will also help distinguish between things that may be
going wrong. Again, I'd start by making sure the VI Server is on in the
built EXE and identifying a TCP port for it.

Then on the controller VI, open a appRef to the EXE giving the machine
and port info.

If it isn't working, please give the error number at least.

Greg McKaskle
0 Kudos
Message 6 of 6
(3,492 Views)