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

KUKA Online Programming trigger subprogram calls

#1
I am using a Kuka KR60 HA with a custom program to use it's tool.
To start the tool i have to add a command "SPINDEL(#ON)" and to stop it "SPINDEL(#OFF)".
I did create offline a robot program with RoboDK and add the commands as custom code instruction. If i manually copy the program onto the robotcontroller and execute the program it work. Thats great!

Now i want to do the excution directly from RoboDK. I did follow the instructions from https://robodk.com/doc/en/Robots-KUKA.html#DriverKUKA and I can now execute move commands. So the connection seems to be working. But if I execute my program the tool does not turn on. So the robot moves with an inactive tool.

To solve the issue i looked into the RoboDksync562.src and found this case at line 176:
Code:
    ; Run Subprogram by ID from COM_VALUE1
    ; To trigger from RoboDK use robot.RunCodeCustom("Program ID", INSTRUCTION_CALL_PROGRAM)
    CASE 13
      program_id = COM_VALUE1
      SWITCH program_id
      CASE 1
        ; Drill()

      CASE 2
        ; Cut()
      ENDSWITCH
      COM_VALUE1 = 0
      COM_ACTION = 0

Do i have to replace "; Drill()" with "SPINDEL(#ON)" and  "; Cut()" with "SPINDEL(#OFF)"?
What are the correct instruction to add to a program in RoboDK? As an example, will the instruction "SPINDEL(#OFF)" in image still be correct or has it to change to "2" for "CASE 2"?

It would be nice if someone can show me an example on how to do it!

.png   addcustomcode.PNG (Size: 4.75 KB / Downloads: 46)
#2
You are close. You should simply replace the string parameter by a program ID and then in the KUKA driver you should trigger the SPINDLE(#ON) or SPINDLE(#OFF). The index of your program in RoboDK is what's important (more than the program name).
#3
Hello Albert, I don't know if I understand.

So step by step:
1. That's what the RoboDksync562.src should look like?
Code:
    ; Run Subprogram by ID from COM_VALUE1
    ; To trigger from RoboDK use robot.RunCodeCustom("Program ID", INSTRUCTION_CALL_PROGRAM)
    CASE 13
      program_id = COM_VALUE1
      SWITCH program_id
      CASE  1
         SPINDEL(#ON)
      CASE  2
         SPINDEL(#OFF)
      ENDSWITCH
      COM_VALUE1 = 0
      COM_ACTION = 0

2. This is what it should look like in RoboDK? I am really guessing here:
(See the image in the attachment)
The programs SPINDEL(#ON) and SPINDEL(#OFF) are empty placeholders, because the code is already on the robotcontroller.

3. But this will work, because in RoboDK the program "main program" is index 0, "SPINDEL(#ON)" is index 1,  "SPINDEL(#OFF)" is index 2?


Attached Files
.png   inside_robodk.PNG (Size: 10.46 KB / Downloads: 45)
#4
The SRC file edits look good. However, you should adjust the program call from RoboDK's end. To call SPINDLE(#ON) you should trigger SPINDLE(1) from RoboDK and to call SPINDLE(#OFF). In fact, RoboDK only sends the ID of the program parameter. Not the program name.
#5
It still does not work.

An example station and the code are in the attachmend.

maybe you will see an error.

if not any idea what is maybe the reason?


Attached Files
.src   RoboDKsync562.src (Size: 3.86 KB / Downloads: 41)
.rdk   test_robodk.rdk (Size: 1.1 MB / Downloads: 46)
#6
If program calls are not being triggered on the robot controller when running a program directly from RoboDK, you may need to change the following setting to trigger program calls on the robot controller when using the driver:
  1. Select Tools-Options in RoboDK
  2. Select the Drivers tab
  3. Check the option Trigger program calls on the robot
#7
i did it. Now RoboDK has an error during the excution at the first program call.
The protocol is as an image in the attachmend


Attached Files
.png   Error_RoboDK_Custom_call.PNG (Size: 13.03 KB / Downloads: 44)
#8
Actually you should switch to the legacy driver called apikuka (which uses the KUKAVARPROXY application on the KUKA robot controller) to make program calls work. We'll improve the official driver in the next 4 weeks to make program calls work.

You can find the documentation link to make the legacy KUKA driver work here:
https://robodk.com/doc/en/Robots-KUKA.ht...DriverKUKA
  




Users browsing this thread:
1 Guest(s)