LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Send python shell commands from LabVIEW

Hi,

 

I`m investigating in Labview2018 the possibility to interface to python classes.

 

What I found out so far is the possibility to call Python functions in Labview2018 , Like;

http://www.ni.com/tutorial/8847/en/

https://forums.ni.com/t5/LabVIEW/Python-Node-in-LV2018/td-p/3797256

 

Looking for a way to call python ‘shell commands’ directly form LV.

 

 

Example return ‘Python 3.6 version nr’:

   PyVersion.py

         import sys def function():    

             return(sys.version)

This works, with normal python function callback.

 

The coal to directly send the commands from LV:

  import sys

  sys.version

 

 

Anyone have some ideas / example code?

Thx

Leon

0 Kudos
Message 1 of 4
(2,740 Views)

May be you could use System Exec.vi  and run the py. script which you want directly.

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 4
(2,720 Views)

Hi Nghtcwrlr,

 

Thx, but I`m looking for an option without creating a ‘.py’ file in this example.

Calling the python ‘shell commands’ directly from LV2018.

 

Thx

0 Kudos
Message 3 of 4
(2,707 Views)

have a look at

https://forums.ni.com/t5/LabVIEW/Streaming-commands-to-a-python-console/m-p/2613903/highlight/true#M...

 

Nghtcwrlr

---------------------------------------------------------------------------------------------
*************************************
---------------------------------------------------------------------------------------------
0 Kudos
Message 4 of 4
(2,698 Views)