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

Python API MakeProgram with specific file path

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


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

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

Code:
[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\RoboDruckv10.py", line 306, in <module>
    [success, log, transfer succeed]=PrintProgram.MakeProgram('C:\\RoboDruck\\Zielordner\\program.src')
  File "C:\RoboDruck\robolink.py", line 4285, in MakeProgram
    prog_status = self.link._rec_int()
  File "C:\RoboDruck\robolink.py", 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.
#2
In general it is better if you provide only the path. Something like:

    PrintProgram.MakeProgram('C:\\RoboDruck\\Zielordner\\')

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.
#3
Thanks a lot Albert,
I am using the KUKA_KRC2 post. It works fine when I use

Code:
PrintProgram.MakeProgram('C:\\RoboDruck\\Zielordner')

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)