Emergency stop robot but can not start it anymore

from vcScript import *

def startStopRobot(prop):
if prop.Value == True:
rx.IsEnabled = False
j1,j2,j3,j4,j5,j6 = [j.CurrentValue for j in rc.Joints]
rc.moveImmediate(j1,j2,j3,j4,j5,j6)
else:
rx.IsEnabled = True
rx.update()

comp = getComponent()
rx = comp.getBehaviour(“Executor”)
rc = comp.getBehaviour(“Controller”)
stop = comp.getProperty(“StopRobot”)
stop.OnChanged = startStopRobot

def OnRun():
stop.Value = False

This code I found in forum before can stop the robot immediately,but can’t start robot anymore. what is the problem? Software version? what can I do if I want the robot emergency stop function? Can “Visual Component” do this??? If can’t, please don’t announce your “Virtual commissioning” function anymore because it is a very important issue…

Ah yes, virtual commissioning. The lighthouse for our ships. Listen, spamming the forum is sassy. And I like sass, but let’s explore the topic before we throw our hands up and start shaking our hips.

Not sure if this mp4 will play.

Here is screenshot of simple test with the code above slightly modified.

So in your case, why is the robot not moving again after removing the e-stop? Does it still have something to do in its program? Is the call stack of the executor full or was it cleared? And is the simulation stopped or still running?

When robot is executing a program in VC, if you use script to stop the robot do not expect the pointer in the program to be where you left it and the motion interpolator to remember where it was. That is, I would recommend you specifically set the robot to the desired state.

Thanks a lot for your information and sorry for my fierce words before. I have test your code already, yes, the robot can restart after stop, but it start in the wrong way…

when the robot move to the P2 position, I stop the robot immediately, then restart the robot, normmaly the robot should continue running and send the OUT[1] signal out, but it directly run back to pos “P1”, this is not the right way for “Emergency stop” on the real factory… Please check the project below.
Test-Start-and-Stop-Robot_V1.vcmx (62.2 KB)