LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a Linux exe from LabVIEW for Windows

Hello,

I need to call a non-LabVIEW Linux executable using LabVIEW for Windows. Any suggestions, aside from buying LabVIEW for Linux?

Thank you,
Chris White
0 Kudos
Message 1 of 5
(3,672 Views)
Hey Chris,

Could you provide more information? Are you planning to execute the linux executable under windows? Or wanting to run LabVIEW for Windows on Linux, or do you have two seperate machines?

What type of information will be passed between the two. Command line arguments, standard in / standard out?

Do you have the ability to re-compile the linux executable (if you have source?). Can it be a command line call, or will you want to call directly into shared libraries or dlls?

If it is a standard linux executable, you may be able to find it compiled for windows in the cygwin distribution, and then you could simply call it like a normal windows executable.
Message 2 of 5
(3,672 Views)
David,

There are two machines: one is Windows and the other is Linux. The Linux executable is a compiled Fortran program written by a colleague that needs to run on the Linux machine. We need to remotely call this Linux executable from LabVIEW for Windows.

Ideally, the call will be with a single command line input argument. No output arguments are required.

Recompiling the executable for Windows or purchasing LabVIEW for Linux are not desirable options.

Thank you.
0 Kudos
Message 3 of 5
(3,672 Views)
Okay, I'll throw out a few ideas and I'll let you pick which one you may think is easiest.

1. Use the internet toolkit ($$$) or build a simple telnet client yourself in LabVIEW (use the TCP VIs in labview). This would allow you to connect to the telnet port of your linux box, login, password, and execute a command. (You'll probably want to use nohup, do a man on nohup to find out more).

2. Install SSH daemon on your linux box, and an ssh client on your windows machine. You can't get SSH for windows from cygwin. This would be more secure, and you wouldn't need to use the TCP VIs, you could simply use the "system exec" vi to call SSH.

3. On your linux box, install your app in inetd. Then, whenever someone connected to a certai
n port # on the linux box, it would execute your command. A little dangerous because someone might try to connect 50 million times (or a port scan) and kill your box. You also wouldn't be able to send a dynamic command line argument.

4. Write a small TCP application on your linux box to wait for connections (listen for command line options) and execute your command.

You'll probably find one of these options ideal depending on your administration and programming background.
Message 4 of 5
(3,672 Views)
David,

We were successful with option 4. A colleague wrote a TCP listener application on the linux box. The LabVIEW code simply sends a formatted string command to a TCP port. The listener application then calls the linux executable in its native environment. Thanks for the help!
0 Kudos
Message 5 of 5
(3,672 Views)