LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to call Python Scripts throght Labview

Hi all,

I am new to this community. Need some inputs  for following Questions

Questions:

1)  How can I call python script from LabView?

 (Basically this python script calls some other DLL and print some message, to run the script using Python net in my application .To run my script in python net using following commands: import python script name )

 

2)  In how many ways we can call Python scripts from labview?

 

I have tried with this option "System Exec.vi "in labview , able to calling pythonnet but unable to send commands and arguments to run python script(i.e  import python script name ). 

 

 If anyone have samples".VI " please send to me. If you people want any information and clarification  from my side please let me know. Thanks in advance.

 

Regards,

Sambasivareddy

0 Kudos
Message 1 of 10
(25,544 Views)
One way is to create a client server app and to send arguments to python (and back) over TCP/IP. This work very well.

There is an example on the old OpenG Website about this. Look it up.

Python client to LabVIEW Server.

PJM


Message Edited by PJM_Labview on 03-12-2008 09:00 AM


  


vipm.io | jki.net

0 Kudos
Message 2 of 10
(25,538 Views)
The easiest way is probably to use LabPython.
Message 3 of 10
(25,527 Views)

This is a good example for Python client to LV server.  Does anyone know how to do it the other way around?  Ex: Labview Client to Python Server.  I want to use LV to open a python session and continue to send python commands to the existing python session from LV.

 

thanks,

Tony

0 Kudos
Message 4 of 10
(24,857 Views)

I want to use LV to open a python session and continue to send python commands to the existing python session from LV. 


Does LabPython not work for you?  It does what I understand you to want.

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 5 of 10
(24,846 Views)

Hi Jim,

 

I did not have much luck with LabPython doing Python server to LV Client.  Do you have an example by chance?

 

thanks,

Tony

0 Kudos
Message 6 of 10
(24,825 Views)

I guess I'm not understanding what you need.  I've attached a VI that connects to a SQLite database using LabPython.

 

 

The PythonDB control can be passed wherever it's needed and more Set Script Text, Set Data and such can operate on that same Python session.

 

Is this what you're looking to do?  I've never tried to have Python call a LabVIEW VI.

Message Edited by jcarmody on 03-13-2009 12:00 PM
Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

Download All
Message 7 of 10
(24,821 Views)

I also had many problems with proper python script invoking from LabView. System Exec.vi works bit weird and after many tries I finally got the expecting result (see attached code for LV 7.1) - it works fine with my python script using parameters, which invokes other python scripts and make TCP/IP transmission with external equipment. Still don't know what is the purpose of Standard Input slot but who cares if we can ignore it.

 

Luck!

0 Kudos
Message 8 of 10
(24,077 Views)

Hello,

 I downloaded on my pc LABPYTHON but I wanted to know how to install it because there are too many folders and DLLs do not know how to insert them to bring up the corresponding palette.

 

Thanks

0 Kudos
Message 9 of 10
(19,229 Views)

Hello, I downloaded on my pc LABPYTHON but I wanted to know how to install it because there are too many folders and DLLs do not know how to insert them to bring up the corresponding palette. Thanks .....

0 Kudos
Message 10 of 10
(19,227 Views)