# Kill thread does not stop the movement

**URL:** <https://forum.universal-robots.com/t/kill-thread-does-not-stop-the-movement/8689>\
**Category:** URScript\
**Created:** [September 6, 2020, 5:39pm UTC](https://forum.universal-robots.com/t/kill-thread-does-not-stop-the-movement/8689 "2020-09-06T17:39:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon30805486](https://avatars.discourse-cdn.com/v4/letter/a/fbc32d/32.png) [@anon30805486](https://forum.universal-robots.com/u/anon30805486)\
**Post date:** [September 6, 2020, 5:39pm UTC](https://forum.universal-robots.com/t/kill-thread-does-not-stop-the-movement/8689/1 "2020-09-06T17:39:42Z")

</div>

Hi,  
I see that the robot arm keeps moving through the kill thread command is issued. Is it required to provide the stopj command as well to stop the movement? Below is the test script I’ve used. Thanks.

`

> def thread\_prog():  
> set\_tool\_communication(False, 115200, 0, 1, 1.5, 3.5)  
> set\_tool\_output\_mode(0)  
> set\_tool\_digital\_output\_mode(0, 1)  
> set\_tool\_digital\_output\_mode(1, 1)  
> set\_tool\_voltage(0)  
> step\_count\_9abcdbf1\_b410\_4fc8\_8eb9\_04aeae05d209 = 0.0  
> thread Step\_Counter\_Thread\_362bf5fc\_c431\_477a\_b9af\_1976601a499d():  
> while (True):  
> step\_count\_9abcdbf1\_b410\_4fc8\_8eb9\_04aeae05d209 = step\_count\_9abcdbf1\_b410\_4fc8\_8eb9\_04aeae05d209 + 1.0  
> sync()  
> end  
> end  
> thrd = run Step\_Counter\_Thread\_362bf5fc\_c431\_477a\_b9af\_1976601a499d()  
> set\_safety\_mode\_transition\_hardness(1)  
> set\_tcp(p[0.0,0.0,0.0,0.0,0.0,0.0])  
> set\_payload(1.0)  
> set\_gravity([0.0, 0.0, 9.82])  
> set\_standard\_analog\_input\_domain(0, 1)  
> set\_standard\_analog\_input\_domain(1, 1)  
> set\_tool\_analog\_input\_domain(0, 1)  
> set\_tool\_analog\_input\_domain(1, 1)  
> set\_analog\_outputdomain(0, 0)  
> set\_analog\_outputdomain(1, 0)  
> set\_input\_actions\_to\_default()  
> $ 3 “Thread\_1”  
> thread Thread\_1():  
> while (True):  
> $ 4 “speedj([0.2,0.3,0.1,0.05,0,0], 0.5, 0.5)”  
> speedj([0.2,0.3,0.1,0.05,0,0], 0.5, 0.5)  
> end  
> end  
> global threadId\_Thread\_1 = run Thread\_1()  
> while (True):  
> $ 1 “Robot Program”  
> $ 2 “‘runnign in thread’”  
> # ‘runnign in thread’  
> end  
> kill threadId\_Thread\_1  
> end`
