Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Robot
#1
Hi ! 

I want to generate my programs with the API and I keep getting a program generation LOG saying a robot has not been defined yet, even if I set my robot before making the program.

My robots name in the cell are Robot1 and Robot2.

Thanks !
Camille


Attached Files Thumbnail(s)
       
#2
Hi Camille,

To avoid confusion I recommend you to wrap the section of the code you want to use for program generation with ProgramStart and PorgramFinish.

Code:
# robot = the robot you want to use for program generation
post_processor = "ABB_RAPID_IRC5" # Enter the name of the file in the RoboDK/Posts folder (no PY extension)
RDK.ProgramStart('Prog1','C:/MyProgramFolder/', post_processor, robot)  # specify the program name for program generation
# RDK.setRunMode(RUNMODE_MAKE_ROBOTPROG) # redundant, ProgramStart changes the mode to program generation
...
robot.MoveJ(target)                     # execute your simulation/program
...
RDK.Finish() # This triggers program generation


More information here:
https://robodk.com/doc/en/PythonAPI/robo...ogramStart
#3
Hi Albert,

The program already exists, I just want to generate the program to send it to the robot.
That's why I use the MakeProgram.

And I want to add that it also does this when I right-click on the program to generate it, so it might not be an API problem.

Thanks.
#4
Hi Camille,

You can try setting the run mode to "RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD" right after you call ProgramStart. Example:

Code:
# specify the program name and post processor for program generation
RDK.ProgramStart('Prog1','C:/MyProgramFolder/', post_processor, robot)

# upload the file to the robot (it usually sends the program via FTP but it depends on the robot and dedicated configuration)
RDK.setRunMode(RUNMODE_MAKE_ROBOTPROG_AND_UPLOAD)

Albert
  




Users browsing this thread:
1 Guest(s)