Pietro Z.
Pietro Z.

Reputation: 531

Python and Labview

I need to call a Python script from Labview, someone know which is the best method to do that? I've tried Labpython, but it is not supported on newest versions of Labview and I'm not able to use it on Labview-2014. Definitevly, I'm looking for an advice about python integration: I know this two solutions:

1)Labpython: is a good solution but it is obsolete

2)execute python script with shell_execute block in Labview. I think that it isn't the best solution because is very hard to get the output of python script

Upvotes: 2

Views: 3532

Answers (5)

Jensolo
Jensolo

Reputation: 97

You can use the integrated Python nodes. There are quite simple examples integrated in LabVIEW. Open them via the Help/Find examples... menu, then type Python into the search field and you will find various Python examples such as "PythonNode_AddTwoDoubles.vi".

Be aware that this Python support is only available with (I think) LV2018 or later.

Upvotes: 0

Ghannah412
Ghannah412

Reputation: 1

You can save Python script as a large string constant(or load from text file) within the LabVIEW vi so that it can be manipulated within LabVIEW and then save that to a text file then execute the Python script using command line in LabVIEW. Python yourscript enter

Upvotes: 0

Adrian Keister
Adrian Keister

Reputation: 1025

Check out TestScript: a free, source-released Python/LabVIEW connector. It's fully bi-directional, including arguments and is compatible with LabVIEW 2013 and later, and Python 3.

Upvotes: 0

slacker
slacker

Reputation: 66

Why not use the System Exec.vi in Connectivity->Libraries and Executables menu?

You can execute the script and get the output.

Upvotes: 1

Khachik Sahakyan
Khachik Sahakyan

Reputation: 1982

I think this will be useful: send data from LabView to Python and get back

Also, the easiest way(for me) to communicate with python code from LabVIEW is to send TCP commands from LabVIEW to Python and back.

Upvotes: 2

Related Questions