Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Python API MakeProgram with specific file path

I am having trouble generating and saving a robot program to a specific path using the python API.
The code line is

[success, log, transfer_succeed]=PrintProgram.MakeProgram('C:\\RoboDruck\\Zielordner\\program.src')

where PrintProgram is the RoboDK program. It works fine when I use

[success, log, transfer_succeed]=PrintProgram.MakeProgram()

Using the specific file path I get the following response to the python shell:

Traceback (most recent call last):
  File "C:\Robodruck\", line 306, in <module>
    [success, log, transfer succeed]=PrintProgram.MakeProgram('C:\\RoboDruck\\Zielordner\\program.src')
  File "C:\RoboDruck\", line 4285, in MakeProgram
    prog_status =
  File "C:\RoboDruck\", line 416, in _rec_int
    buffer = self.COM.recv(4)
socket.timeout: timed out

The message bar inside RoboDK confirms that the program generation works, but it is obviously not able to handle the path as I expect it to. It takes 3-4 seconds until the error is printed and RoboDK then brings up the prompt for selecting a path manually, so to say the default behaviour if no path is given.
I do not see how to fix this and hope for your advice.
In general it is better if you provide only the path. Something like:


The name and the extension will be added automatically and will depend on the program name in RoboDK and the extension specific to your robot controller (defined in the post processor).

This behavior mostly depends on the post processor you use and how it handles the file/path that it is being passed.

I noticed the documentation is not very specific so we'll improve it in the next 24 hours.
Thanks a lot Albert,
I am using the KUKA_KRC2 post. It works fine when I use


As you said the post processor requires the folder and adds another slash as well as the program name (see attachement).

Attached Files Thumbnail(s)

Users browsing this thread:
1 Guest(s)