From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,735 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,715 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,702 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,693 Views)