05-02-2018, 04:39 PM
Greetings,
I started playing with the Python API today. It's great! I was curious how to get the RDK.RunMessage() function correctly with our UR5 teach pendant.
Is this a matter of creating a definition in the UR post processor? It also looks like the UR Script API has a function called popup() which writes a message to the teach pendant. I am just to write a simple 'Hello World' message for right now.
Any insight would be a great help. Below is the simple python code I've been experimenting with so far.
Thanks!
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
RDK.RunMessage('Hello world', message_is_comment = True) #Writes to teach pendant
robot = RDK.Item('UR5')
home = RDK.Item('Home')
approach = RDK.Item('Approach')
target3 = RDK.Item('Target 3')
target4 = RDK.Item('Target 4')
target5 = RDK.Item('Target 5')
i = 0
while (i < 5):
robot.MoveJ(home)
robot.MoveJ(approach)
robot.MoveL(target3)
robot.MoveL(target4)
robot.MoveL(target5)
robot.MoveL(approach)
i = i + 1
RDK.RunCode('Prog2', True)
I started playing with the Python API today. It's great! I was curious how to get the RDK.RunMessage() function correctly with our UR5 teach pendant.
Is this a matter of creating a definition in the UR post processor? It also looks like the UR Script API has a function called popup() which writes a message to the teach pendant. I am just to write a simple 'Hello World' message for right now.
Any insight would be a great help. Below is the simple python code I've been experimenting with so far.
Thanks!
from robolink import * # RoboDK API
from robodk import * # Robot toolbox
RDK = Robolink()
RDK.RunMessage('Hello world', message_is_comment = True) #Writes to teach pendant
robot = RDK.Item('UR5')
home = RDK.Item('Home')
approach = RDK.Item('Approach')
target3 = RDK.Item('Target 3')
target4 = RDK.Item('Target 4')
target5 = RDK.Item('Target 5')
i = 0
while (i < 5):
robot.MoveJ(home)
robot.MoveJ(approach)
robot.MoveL(target3)
robot.MoveL(target4)
robot.MoveL(target5)
robot.MoveL(approach)
i = i + 1
RDK.RunCode('Prog2', True)