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

Python: Specific post processor and run mode for machining project

#7
我建议你应用the following modifications to take the Extruder calls into account:

1- For offline programming:
Our latest KUKA KRC2 post processor (default post used for KUKA robots, attached) takes the Extruder commands into account and can easily be customized in the post processor. I recommend you to take a look at the configurable section of the file (around line 75) and how the RunCode parses the Extruder call (line 631).

I strongly recommend you to rename this post processor if you customize it because a new RoboDK install will override this file.

2- For online programming:
RoboDK doesn't support calling named subprograms using the driver (Run On Robot option). However, there is a workaround for this and you can call numbered programs. To do so, you have to trigger a program a program call with a number. Using the GUI or the API. An example using the API would be:
robot.RunCodeCustom("Program 5", INSTRUCTION_CALL_PROGRAM)

To integrate this with the Extruder command you can add a new Python program in your RoboDK project called Extruder, then parse the passed parameter using sys.argv (similar to the RoboDK/Library/Macros/ArcOn.py example).

This is what the RoboDKSync.src file looks like towards the end. You can customize the action once a program is triggered by retrieve the program id. You could actually use the passed parameter as the E value (program id).

Code:
CASE 13
;----- Run program COM_VALUE1 ---------
;(to trigger from RoboDK: use robot.RunCodeCustom("program id", INSTRUCTION_CALL_PROGRAM)
program_id = COM_VALUE1
SWITCH program_id
CASE 1
;-- run program 1 --
;钻()
;-------------------
CASE 2
;-- run program 2 --
;Cut()
;-------------------
ENDSWITCH


Attached Files
.py KUKA_KRC2.py(Size: 29.94 KB / Downloads: 666)


Messages In This Thread
RE: Pyton: Specific post processor and run mode for machining project - byAlbert- 04-02-2019, 04:51 PM



Users browsing this thread:
1 Guest(s)