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

Generating a robot program that uses python code

I am using a 30 trail version of this software. In my Kuka station, I have a Python script (called MyRobotScript) and regular program that calls the python script. When I click "Generate robot program" on the regular program, a file called "prog2.scr" shows up in my "Documents\RoboDK" folder. This file contains an external call to MyRobotScipt:
; External program calls:
EXT MyRobotScript()

; Program generated by RoboDK v5.1.2 for KUKA KR 20 R1810 on 18/11/2020 16:45:33
; Using nominal kinematics.
I am wondering where the "MyRobotScript" external program is located. I don't see any other files in the "Documents\RoboDK" folder. 

Also if I right click on the python script and click "Generate robot program", message shows up at the bottom saying "Running Python script...". This message never goes away and no script is generated as far as I can see.  

 In options, my python interpreter is: 
Quote:C:\Users\[My Name]\AppData\Local\Programs\Python\Python39\pythonw.exe
I think I have answered my own question. Should I be using program.MoveJ to add movements to my program instead of using robot.moveJ to do the movements in Python? It looks like robot.moveJ are not added to the generated program, but program.MoveJ commands are.
Hi Petsven,

You are right, the .MoveJ command has different behavior if it's associated with a robot item or a program item.

program.MoveJ(Target) will add a MoveJ to the program.

Find useful information about RoboDK and its features by visiting our Online Documentation and by watching tutorials on our Youtube Channel


Users browsing this thread:
1 Guest(s)