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
#5
Hi Albert,

Sorry for not following on your suggestion, I have been busy on another side of this job.
The solution you provided did not work, but I now think this is not related to the API but to my project and/or maybe my computer. I opened a cell made by someone else, right-clicked on a program and selected "Generate robot program" and it worked without the error.
But if I create a new cell and a program, the error is back if I try to generate the program.
I linked a cell I just created with said error : 

.rdk   Bug.rdk (Size: 598.36 KB / Downloads: 359)

I tried to uninstall RoboDK to have a clean start but it did not work.

Thanks,
Camille
#6
Hi,

After talking with Jeremy my error is fixed.
It probably came from Roboguide when the post processor tried to make the TP program but could not for some reason. So we just changed the PATH_MAKE_TP to None and it now works.

Thanks,
Camille
  




Users browsing this thread:
1 Guest(s)