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: 34)
.txt   IOwaitURscriptPython.txt (Size: 922 bytes / Downloads: 30)
.txt   IOwaitURscriptUIversion.txt (Size: 728 bytes / Downloads: 28)
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:
Hello Albert,

We tried using waitDI method today and in our cases it doesn't work as intended as well.

We can see the input is off on the controller. While it's off, as we are waiting for it to be on (1), this function should wait at least the ms defined. However, it doesn't wait anything.

Edit: It would also be lovely, if we could have it return whether it received the signal or timed out.
Edit 2: It seems to work as a program in RoboDK only when it receives a signal. Timeout is discarded.
+1 on this...
It would be great that this function returns a value 1/0 in case the signal has been received, with this we'll be able to make If statements with inputs instead of just waiting...
I don't think the timeout is implemented when using the robot driver. It it is not implemented it should wait permanently. This may highly depend on the robot controller. We are writing it down as an improvement request.

Just to be sure that you are waiting for the correct input you should uncheck the following option:
  • Tools-Options-Motion-Manage I/O with RoboDK when connected to a robot
The latest UR robots have some inputs and outputs on the tool. Are those the inputs you are checking?
If so, you should address them as input/output 11 for input/out output 1, 12->2, etc.

Users browsing this thread:
1 Guest(s)