06-26-2019, 09:27 PM
I am trying to use the Python API to open a RoboDK station and then connect to a real UR10 robot, but the connection always fails. The only way I am able to successfully connect to the robot is if I open the station by clicking the .rdk file in file explorer. When I attempt to connect using either Connect() or ConnectSafe(), the 'Connection to UR10' menu in RoboDK gives me the following log:
From this, it seems that the problem is coming from apiur.exe crashing. Below is the Python script that I am running to open RoboDK and connect to the robot:
Quote:DISCONNECT
Driver apiur not running
Disconnected
Stopped
Starting robot driver: C:/RoboDK/api/robot/apiur.exe
Starting...
CONNECT 169.254.213.80 2000 6
Driver apiur not running
Disconnected
Error: Process crashed (id 1)
Stopped
DISCONNECT
From this, it seems that the problem is coming from apiur.exe crashing. Below is the Python script that I am running to open RoboDK and connect to the robot:
Quote: RDK = robolink.Robolink()
station_file =r'Documents\forumSample'
current_station = RDK.AddFile(station_file)
robot = RDK.Item(“UR10”)
robot.setConnectionParams('169.254.213.80',2000,'/','','')
robot.Connect('169.254.213.80')
time . sleep (3)
状态,味精= robot.ConnectedState()
print(state)
print(msg)