ni.com is currently undergoing scheduled maintenance.

Some services may be unavailable at this time. Please contact us for help or try again later.

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;

https://knowledge.ni.com/KnowledgeArticleDetails?id=kA03q000000x3k0CAA&l=en-GB

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
(4,080 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
(4,060 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
(4,047 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
(4,038 Views)