Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Connect UR5 to RoboDK from a python script

#1
Hello, 

I would like to know if there's a way to connect the real robot to RoboDK as shown in the attachement without actually clicking on the "connect" button. Preferably, i want to initiate the connection from a python file. I'm open to all suggestions. Thanks in advance.

Context : 

I'm running a python script on the robot from RoboDK, but mid-way i want to close a gripper (RG2 OnRobot). For this i created a small program on the robot which serves this exact purpose. Afterwards, in my main python script i used socket communication (Dashboard server)  to load and run the program that closes the gripper. At this point, the connection between RoboDK and UR5 is lost (The DriverRoboDK is not running anymore). For this reason i'm trying to find a way to re establish the connection.

RoboDK : 5.6.0
Python : 3 
UR5 : CB 3.15


Attached Files Image(s)
   
#2
Hello there,

The solution was to use the python API function (Connect()), but running the python script with an external IDE, because when i ran the script on RoboDK, the function (Connect()) interrupts the execution. The use of a (time.sleep(1)) was mandatory to give the robot the time to reconnect before continuing the execution on the real robot.

I hope this will help someone in the futur.

Cheers
#3
Thank you for your feedback!

For your information, we implemented this safe connection using the ConnectSafe function:
https://robodk.com/doc/en/PythonAPI/robo...onnectSafe
  




Users browsing this thread:
1 Guest(s)