Hello,
I have a python program that triggers a few Robodk force programs to run on a UR10e. The force programs are pretty simple:
force_program_1:
force_program_2:
Snippet of python program:
The problem I have is that the reconnection to the robot once the force programs are done is not repeatable. Sometimes it reconnects properly and I can continue with the rest of the python program. Sometimes I get this error in the image. I think I am doing something incorrect with the way I'm reconnecting to the robot. Am I unintentionally trying to connect to the robot as the robot is executing the force program and that's causing the connection fail? Or is it some other problem? Thanks!
I have a python program that triggers a few Robodk force programs to run on a UR10e. The force programs are pretty simple:
force_program_1:
Code:
def force_program_1():
force_mode(p[0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, -125, 0, 0, 0], 2, [0.1, 0.1, 0.01, 0.1, 0.1, 0.1])
end
force_program_1()
force_program_2:
Code:
def force_program_2():
force_mode(p[0, 0, 0, 0, 0, 0], [0, 0, 1, 0, 0, 0], [0, 0, 50, 0, 0, 0], 2, [0.1, 0.1, 0.01, 0.1, 0.1, 0.1])
count = 0
while count < 200: # Run for n seconds
count = count + 1
sync() # 2ms cycle
end
end_force_mode()
end
force_program_2()
Snippet of python program:
Code:
program_name = 'force_program_1'
prog = RDK.Item(program_name, ITEM_TYPE_PROGRAM)
prog.MakeProgram('', RUNMODE_MAKE_ROBOTPROG_AND_START)
robot.Disconnect()
robot.Stop()
robot.ConnectSafe(robot.robot_ip, max_attempts=1, wait_connection=1)
robot.Joints()
program_name = 'force_program_2'
prog = RDK.Item(program_name, ITEM_TYPE_PROGRAM)
prog.MakeProgram('', RUNMODE_MAKE_ROBOTPROG_AND_START)
robot.Disconnect()
robot.Stop()
robot.ConnectSafe(robot.robot_ip, max_attempts=1, wait_connection=1)
robot.Joints()
The problem I have is that the reconnection to the robot once the force programs are done is not repeatable. Sometimes it reconnects properly and I can continue with the rest of the python program. Sometimes I get this error in the image. I think I am doing something incorrect with the way I'm reconnecting to the robot. Am I unintentionally trying to connect to the robot as the robot is executing the force program and that's causing the connection fail? Or is it some other problem? Thanks!