Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Set Robot
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 !

Attached Files Thumbnail(s)
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.

# 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:
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.

Hi Camille,

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

# 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)


Users browsing this thread:
1 Guest(s)