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

Insert instruction code not sent in Run On Robot mode


I need to send a custom command through the on-line robot driver interface, but when I set the program which contains this instruction in "Run on robot" mode and right click on the instruction then "Execute instruction" (after connecting to the driver of course), nothing is sent - as can be seen in the log window. And this is independent on the actual content of the instruction code.

Any built-in instruction works with the same method (I can see them in the log window and they are properly handled by the driver).

I am running RoboDK on LUbuntu but one of my colleagues has the same problem on Windows. What is happening?

Thank you in advance,

Hi there,

Could you tell us what robot brand you are using? Different robot brands use different drivers (Run on robot).

Thanks for posting. Universal Robots - my understanding was that brands mattered for postprocessors (which, if I understand correctly, are not used here) and online robot drivers (which I understand only kick in after the command line is written to the log), is there something else dependant on brand on this chain?
Standard commands do appear in the log before they are processed by our custom driver, but these instructions don't do anything (even using the built-in apiur online robot driver).
You are right, I missed the "log window" portion of your post. (Don't really know how I missed it as you mention it twice...)

I have tried to replace the program by a call to a python script which uses robot.RunInstruction("anything",INSTRUCTION_INSERT_CODE), and it still does not work: nothing is sent through the console log. This is a very inconvenient bug (which happens to be blocking for us) and it is easily reproductible, is your development staff aware of this?

Also (but this is less important), I noticed Robolink.Render() has no effect when programs calling it are set to Run on robot (I make calculations using robot.setJoints() and I would like these calculations to be hidden to the user - and it works when Run on robot is not ticked), I think this is also a bug but perhaps there is another way? If this is indeed a bug I'll open another thread.
When you use the Run on robot option and you want to run Python programs in RoboDK you should make sure you have the following setting activated:
  • Tools-Options-Motion
  • Check the option: Manage program calls with RoboDK when connected to a robot
Hi Albert, thanks for your answer. I already have this option checked, I just checked. Also, insert code instructions in the GUI don't work either, it's not only a Python issue it seems (I assume both are linked by the fact that the underlying function from RoboDK does not seem to work).

Do not you have the same problem on your end?
I'm not sure I understand the issue. Do you have a sample project that we can use to reproduce this problem?

To make sure your commands are being sent to the robot from your Python program you can add something like this:

   state, msg = robot.ConnectedState()
   if state == ROBOTCOM_READY:
Hello Albert,

This post interests me. I have the same problem with ITEM.RunInstruction(code, run_type=INSTRUCTION_INSERT_CODE)
This method works only with a program item or it could also work with a robot item?

Is there a way to send directly urscrip code to the UR10 controller in RUNMODE_RUN_ROBOT (ie using apiur.exe) trough the user interface or through the python api?

You will find a robodk scene test attached to this post :
- with gui interface
- with the api with robot.RunInstruction() or program.RunInstruction()

I took in my example the "popup("text")" urscript command but it coul be any : textmsg(), set_payload()...

Thanks for your help

Attached Files
.rdk   UR10_send_urscript.rdk (Size: 2.55 MB / Downloads: 491)
I am also interested in sending urscript code directly. In my case I have a URCap which communicates to an external laser scanner mounted on my UR3e.

Users browsing this thread:
1 Guest(s)