LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how, to, stop, running, a, phython, script, automatically, when, labview, exit, or, got, hanged, through, openG

Hi,

Can anyone help me out !

 

how to stop running a phython script automatically when labview exit or got hanged through openG.

 

Thanks in advance.

0 Kudos
Message 1 of 11
(4,189 Views)

Hi dennis,

 

is, there, a, reason, to, put, so, many, commata, in, your, thread, title?

 

how to stop running a phython script automatically when labview exit or got hanged through openG.

How is the Python script connected with LabVIEW and/or OpenG?

 

Atleast I can say: when LabVIEW is exited (or "got hanged") you cannot do anything more in LabVIEW…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 11
(4,184 Views)

Are you using LabPython with the script node or the VI API? Or just a System Exec call?

Rolf Kalbermatter
My Blog
0 Kudos
Message 3 of 11
(4,182 Views)

Hello..

 I use Labphython . I want to know exactly how to stop the phython without executing the further scripts when labview stops without writing exit script to phython.

0 Kudos
Message 4 of 11
(4,059 Views)

Then upload your code. LabPython has two ways to execute scripts and you still didn't tell us which of them you use nor how you use it.

Rolf Kalbermatter
My Blog
0 Kudos
Message 5 of 11
(4,043 Views)

Hello

 

Labview version : 2014 Developer suite

Python version : 2.7.9

 

Thanks.

0 Kudos
Message 6 of 11
(4,009 Views)

How about making the upper loop stop on error too? And why do you Close the session in the lower loop? As soon as that loop has executed once and the session is closed, the upper loop has nothing anymore to work with, since the session, and accordingly its script and everything is gone completely.

 

All in all that construct as is makes little sense at all. Why those two loops in the first place?

Rolf Kalbermatter
My Blog
0 Kudos
Message 7 of 11
(3,984 Views)

Hi,

That was just an example of my main code. I simply wanna know how to exit the scripting to phython without executing the remaing script when the stop button is pressed in labview.

0 Kudos
Message 8 of 11
(3,938 Views)

And that example has a main flaw. The upper loop only stops on the stop button, not when it sees an error. So if you press stop everything should go fine if you don't that loop will never exit. If your problem is something else, that example does absolutely nothing to show what your problem is.

Rolf Kalbermatter
My Blog
0 Kudos
Message 9 of 11
(3,901 Views)
Hi, In the example when the stop button is pressed, the loop does not exit ,this is because the script is still running. I dont want this to happen. Actually I wanna exit script running as soon as the stop button is pressed. Please give the solution ASAP.
0 Kudos
Message 10 of 11
(3,785 Views)