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

Unable to send custom code to online robot

#1
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:

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)
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


Messages In This Thread
Unable to send custom code to online robot - bydavidmurray- 05-13-2019, 07:29 PM



Users browsing this thread:
1 Guest(s)