Error: Another thread is already controlling the robot


Hi guys,

I’m trying to set a waypoint just for inspection
Condition
When switch is on - halt on whichever step and goes to the inspection waypoint
When switch is off - resume where the program is before it goes to the inspection waypoint.

But i keep getting an error where it says “another thread is already controlling the robot” when i flip my digital_in0 to true. Any easy way to solve this?

maybe juse not a thread.
is it important to go instand from the moveing situation to another position? if not, maybe make it like an funktion that will be asked after reaching every single Waypoint.

Like
move WP_1
if var_inspec =? true than…
set var_inspec = false
move WP_2
if var_inspec =? true than…

in the thread you can handle the input:
Thread:
wait if digital_in[0] =? true
set var_inspec = true

You could change it to a subprogram. So whenever the robot is a start position or waiting for something to happen, you can call the subprogram.
Something like:

# Robot Program
MoveJ
	Start_Position
	Waypoint_1
	Waypoint_2
	Waypoint_3
	# Now the robot is avaliable for doing something else
	Call SubProgram_1

# SubProgram_1
if get_standard_digital_input(0):
	MoveJ
		inspection

Thanks for your suggestion but I have around 12 waypoints in my actual program so it will be a hassle to add it in after every single one of them. Will use this if I cant find any other ways!

Hi thanks for your suggestion! but I would like the robot to go to inspection whenever digital input0 is true wherever the program is being executed instead of it only being executed after the robot moves to waypoint 1,2,3.

image
This solution may be right for you.
Use the loop with the check expression continuously, as long as the expression is false, you will get out of this loop.
Be careful to use a STOPJ or STOPL to have a smooth change of direction.