Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Digital Input Wait Method Broken
In my code I use the command, "robot.waitDI(1,1)" to pause the program until the robot receives a high signal on digital input 1, but the robot never actually waits when the program is run regardless of what the input value is. The robot I am trying to run the program on is a UR10 which has a digital input "ON region" of 11V-30V according to the manual. I have confirmed that digital input 1 is receiving 0V using a digital multimeter and have even tried running the command with all of the digital inputs completely disconnected from any possible voltage source but the program still skips right over this instruction. The strangest part is that the input wait method worked exactly as expected when I replicated my Python program using the "Set or Wait I/O Instruction" button in the RoboDK graphical interface. After realizing this, I generated a UR script from both the UI program and Python program I created and they were identical, so I can only assume that this behavior is due to some kind of software error. I have attached my Python code as well as the UR scripts generated from both the UI and Python versions of my program. Any help getting this method to work would be greatly appreciated as it is essential to my project.

Attached Files
.txt   IOwaitMalfunctionPythonCode.txt (Size: 526 bytes / Downloads: 9)
.txt   IOwaitURscriptPython.txt (Size: 922 bytes / Downloads: 7)
.txt   IOwaitURscriptUIversion.txt (Size: 728 bytes / Downloads: 7)
I'm not sure I understand the issue. 

If you are planning to move the real robot and use the inputs/outputs of the robot I recommend you to make sure you have this setting unchecked:
Tools-Options-Motion-Manage I/O with RoboDK when connected to a robot
(it is unchecked by default)

If the previous solution doesn't work, it would help if you can provide the RDK file.

You can also run this code as a test:

RDK = Robolink()
robot = RDK.Item('UR10')
robot.Connect()  # Make sure you are connected to the robot
RDK.setRunMode(RUNMODE_RUN_ROBOT) # Trigger robot commands on the real robot
robot.waitDI(1,1) # This should wait for the real Input 1 to be set to True/On

A more detailed example is available here:

Users browsing this thread:
1 Guest(s)