LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

To invoke an application exe built using Labview from python.

I am trying to invoke an application exe built using Labview from python.

 

I am able to invoke labview vi, send and receive data. But if I change the vi to exe, it doesn’t work.

0 Kudos
Message 1 of 11
(5,307 Views)

You can use the "os.startfile("<Exe path>")" to launch any executable from python (Not actually a LabVIEW question though 🙂 ).

-----

The best solution is the one you find it by yourself
Message 2 of 11
(5,304 Views)

Am able to launch exe. But the problem is I want to send data to that application exe and read back the data from it.

0 Kudos
Message 3 of 11
(5,301 Views)
The LabVIEW application has to be built to accept command line arguments. Did you do that? There is an example that shows what you have to do.
0 Kudos
Message 4 of 11
(5,288 Views)

This is more of Python. I can suggest you another way, if you can do those changes to your existing code.

 

This is what I do: If I have to communicate between 2 different platforms I use "File" as a communication medium (Simple method). So if you want to pass data to the LabVIEW code from python, write the data to the file from Python and read the data in LabVIEW and vice versa. I generally use *.ini files for this purpose.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 5 of 11
(5,284 Views)

By accessing vi from Python script am able to pass and read data from vi.

 

If I build exe to accept command line arguments, I can send data to the Labview exe but cant read data back from it.

 

 

0 Kudos
Message 6 of 11
(5,283 Views)

Ya. I can do this. 

 

But am checking to see is there a way to directly pass data and read data from exe.

 

Because sending and receiving data from Python to vi is possible.

0 Kudos
Message 7 of 11
(5,278 Views)
There is nothing returned from an exe unless you write to a file. If you want return values, create a dll.
0 Kudos
Message 8 of 11
(5,274 Views)

Return values means I want to read back the values from exe. For example using functions like getControlValue()

0 Kudos
Message 9 of 11
(5,270 Views)
That's completely different. You must enable the VI Server when you build the exe before you can invoke any methods or properties.
Message 10 of 11
(5,266 Views)