05-13-2019, 07:29 PM
(This post was last modified: 05-13-2019, 07:33 PM bydavidmurray.)
Hello,
I'm trying to activate a tool through modbus on a UR10 robot. Eventually, programming will be done offline, but right now I'd like to do it online through the RoboDK Python API. Here is my code:
However, nothing happens on the robot when I do this. I have confirmed (when writing this command directly in a new script on the teach pendant) that this modbus command is correct.
What am I doing wrong? Should I be using RunInstruction or RunProgram instead?
Best regards,
David
I'm trying to activate a tool through modbus on a UR10 robot. Eventually, programming will be done offline, but right now I'd like to do it online through the RoboDK Python API. Here is my code:
Code:
import RoboDK.robolink # RoboDK API
import RoboDK.robodk # Robot toolbox
RDK = RoboDK.robolink.Robolink()
RDK.setRunMode(RoboDK.robolink.RUNMODE_RUN_ROBOT)
robot = RDK.Item('UR10', RoboDK.robolink.ITEM_TYPE_ROBOT) # The currently open station has a robot named "UR10".
robot.setConnectionParams('192.168.241.116', 30001, '/', '', '') # Connect to the robot
success = robot.Connect()
status, status_msg = robot.ConnectedState()
打印(“Status: {0}, status msg: {1}".format(status, status_msg)) # This returned "0 Ready"
robot.RunCode('modbus_set_output_signal("v1_a", True)', True)
What am I doing wrong? Should I be using RunInstruction or RunProgram instead?
Best regards,
David