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: 

Ending Python script through LabVIEW

Hi,

I have created a VI that calls a subvi.  This subvi calls a python script that is supposed to run in parallel with the main VI.  The subvi is called asynchronously through the main VI.

 

I got the python script to run in parallel with my main, but I am having trouble ending/killing the python script when the main vi stops running.

 

I am using LabVIEW 2019 and am using the native Python functions.  I tried creating a global variable for the Python Session refnum and passed it to my main to close the python session but it gave me an error.

 

Does anyone know how to end a running python script through LabVIEW?

 

Thank you

 

pythonerror.PNG

Download All
0 Kudos
Message 1 of 4
(3,431 Views)

How do you communicate with this function otherwise? My initial thought is: TCP/IP. It can easily be used both for sending and recieving commands, as a shutdown.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
Message 2 of 4
(3,380 Views)

Thank you for the response.  Where I can find some more information about your TCP suggestion? Is there an example?  Thanks

0 Kudos
Message 3 of 4
(3,355 Views)

I don't have LV on this computer, but Help -> Find examples -> TCP/IP and you should have a good VI to base your work on. 🙂

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 4 of 4
(3,331 Views)