11-04-2021, 02:34 PM
嗨,我是使用台面式晶体管demic Python post-processor to export programs designed in RoboDK, and noticed that some "set ref" and "set tool" commands of programs are being skipped when generating an output .py file.
A simplified example, say I have in the RoboDK tree a main program "MainProg" which calls two sub-programs "ProgA" and "ProgB":
With ProgA and ProgB containing commands to set a reference frame and a tool, and move the robot to some target:
Then, when I generate a robot program for MainProg, the output .py file looks like:
So, the "set ref" and "set tool" commands are skipped from ProgB. Presumably because they were already set in ProgA, which is called before ProgB.
这将导致麻烦如果我手动编辑output .py file, and would want to call ProgB before ProgA: no reference frame nor tool has yet been set. It also seems confusing when a program in the RoboDK tree contains commands which it does not in the generated .py file.
Can you explain why the "set ref" and "set tool" commands (and perhaps others?) are being skipped, and if it is possible to avoid this?
Kind regards,
Maarten
A simplified example, say I have in the RoboDK tree a main program "MainProg" which calls two sub-programs "ProgA" and "ProgB":
Code:
MainProg
Call ProgA
Call ProgB
With ProgA and ProgB containing commands to set a reference frame and a tool, and move the robot to some target:
Code:
ProgA
Set Ref: Meca
Set Tool: Meca tool
MoveJ(target1)
ProgB
Set Ref: Meca
Set Tool: Meca tool
MoveJ(target2)
Then, when I generate a robot program for MainProg, the output .py file looks like:
Code:
def MainProg():
Call ProgA()
Call ProgB()
def ProgA():
Set Ref: Meca
Set Tool: Meca tool
MoveJ(target1)
def ProgB():
MoveJ(target2)
So, the "set ref" and "set tool" commands are skipped from ProgB. Presumably because they were already set in ProgA, which is called before ProgB.
这将导致麻烦如果我手动编辑output .py file, and would want to call ProgB before ProgA: no reference frame nor tool has yet been set. It also seems confusing when a program in the RoboDK tree contains commands which it does not in the generated .py file.
Can you explain why the "set ref" and "set tool" commands (and perhaps others?) are being skipped, and if it is possible to avoid this?
Kind regards,
Maarten