12-04-2020, 03:06 PM
Dear forum users,
I wonder if there is a possibility to include KUKA KRL code within my python script. With KRL i would write:BAS( #TOOL ,2) to activate Tool2. Now I wonder how to activate tools with the RoboDK API?
I tried to think of a workaround. I wanted to create a KUKA program within the Python script, pass the KRL command and run the program. That didn't work. Maybe I faulty interpreted the AddProgram()-function. Those are the few lines I have tried within my python script:
prog = RDK.AddProgram('Set_Tool_Program')
prog.RunInstruction('BAS(#TOOL,2)',INSTRUCTION_INSERT_CODE)
prog.RunCode()
prog.WaitFinished()
Does anybody know how to incorporate the KRL "BAS(#TOOL,2)" command into my python script?
Thank you in advance!
I wonder if there is a possibility to include KUKA KRL code within my python script. With KRL i would write:BAS( #TOOL ,2) to activate Tool2. Now I wonder how to activate tools with the RoboDK API?
I tried to think of a workaround. I wanted to create a KUKA program within the Python script, pass the KRL command and run the program. That didn't work. Maybe I faulty interpreted the AddProgram()-function. Those are the few lines I have tried within my python script:
prog = RDK.AddProgram('Set_Tool_Program')
prog.RunInstruction('BAS(#TOOL,2)',INSTRUCTION_INSERT_CODE)
prog.RunCode()
prog.WaitFinished()
Does anybody know how to incorporate the KRL "BAS(#TOOL,2)" command into my python script?
Thank you in advance!