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

Not generating output file using API

#1
I need to generate an offline robot program by directly recording a stream of Python API commands.

The problem I am having is that no file is created, and I am at a complete loss. I have tried 100+ variants and looked at every doc and example I can find.

Manual program generation and MakeProgram() both work, but I need the stream recorded instead.

ProgramStart returns 0 errors, but no robot program file is generated after RDK.Finish().

I reproduced the same issue with a clean ABB station using ABB_RAPID_IRC5 and separately with FANUC using Fanuc_R30i.

Is there an additional step required when using RUNMODE_MAKE_ROBOTPROG and ProgramStart, , or am I misunderstanding the intended use of this run mode?

RoboDK 6.0.6, Python 3.13, robodk package 5.9.4.

Code:
Code:
from robodk.robolink import *
import time
RDK = Robolink()
RDK.AddFile("C:/Users/Sam/code/robodk_stations/test_station.rdk")
robot = RDK.Item("ABB CRB 1300-7/1.4", ITEM_TYPE_ROBOT)
t1 = RDK.Item("safe_target_1", ITEM_TYPE_TARGET)
t2 = RDK.Item("safe_target_2", ITEM_TYPE_TARGET)
RDK.setRunMode(RUNMODE_MAKE_ROBOTPROG)
errors = RDK.ProgramStart(
    "Prog123",
    "C:/Users/Sam/Downloads/",
    "ABB_RAPID_IRC5",
    robot
)
print("ProgramStart errors:", errors)
robot.MoveJ(t1)
robot.MoveL(t2)
RDK.Finish()


Attached Files
.rdk   test_station.rdk (Size: 1.65 MB / Downloads: 49)
#2
I was able to generate the program using your example without any issues. I only had to update the path to save the file.

Here are some questions that will help troubleshoot this issue on your computer:
  1. Can you make sure the path you set to store the file is valid?
  2. Did you make any modifications to RoboDK or changed any settings? For example the post processor.
  3. Can you try with the default settings in RoboDK? (select Tools-Options-Set default settings)
  4. If the issue persists, can you run in debug mode and send us the debug log?
To run in debug.mode:
  1. Close RoboDK
  2. Start RoboDK by double clicking this file: C:/RoboDK/RoboDK-Debug.bat
  3. Try to reproduce the problem in RoboDK
  4. Right after you see the issue, send us this file: C:/RoboDK/bin/RoboDK.debug.txt
#3
Hi Albert, I appreciate your help.

To answer your questions:
1) All paths appear valid.
2) Unmodified versions tried. Multiple post processors / robots tried. Post processor files exist.
3) Tried just now but it isn't resolved.
4) Please see the attached debug logs. It appears as if the post processor is never called.

Thank you.


Attached Files
.txt   RoboDK.debug.txt (Size: 7.79 KB / Downloads: 32)
#4
Hi Albert,

Update & additional logs: RoboDK.exe is crashing a few seconds after the API disconnects, i.e. at the moment it should be generating the pending program. That is why the debug log just stops after the last MoveXb and the post processor is never called.

Windows Application event log (Event ID 1000), identical on every run:

  Faulting application name: RoboDK.exe, version: 6.0.6.26901 (build Jul 13 2026)
  Faulting module name:      RoboDK.exe, version: 6.0.6.26901
  Exception code:            0xc0000005 (access violation)
  Fault offset:              0x00000000003d8a18

I reproduced this ~20 times across two computers and the fault offset is the same every time. Crash minidumps (.dmp, ~11 MB each) are attached / linked below.

What I tried, each against a freshly started RoboDK instance (all crash unless noted):

  - Script-started RoboDK and RoboDK already open before the script  -> crash
  - With and without -DEBUG                                          -> crash
  - Without calling ProgramStart at all (default name/folder)        -> crash
  - Default program folder ("") instead of an explicit folder        -> crash
  - Post processor ABB_RAPID_IRC5 and ABB_RAPID_IRC5_Robtargets      -> crash
  - Single MoveJ to current joints only                              -> crash
  - Explicit setPoseFrame / setPoseTool before the moves            -> crash
  - Different robot with no station loaded: only AddFile of
    UR8-Long.robot + post Universal_Robots + two MoveJ              -> crash (so not station specific)
  - Calling ProgramStart a second time, or switching to
    RUNMODE_SIMULATE before Finish(), to force generation early      -> nothing written, still crashes on disconnect
  - Fresh settings: settings.ini and layout ini moved away          -> crash
  - RoboDK's embedded Python (C:\RoboDK\Python-Embedded) and the
    bundled API instead of the pip robodk package (6.0.1)            -> crash
  - Launch flags -NOUI, -HIDDEN, -SKIPMAINTENANCE, -SKIPINI          -> crash
  - RoboDK started with "Run as administrator"                      -> crash (so not a permissions issue)

Controls that do NOT crash:

  - Same script with RUNMODE_SIMULATE instead of RUNMODE_MAKE_ROBOTPROG  -> OK, RoboDK stays open
  - AddProgram + MoveJ/MoveL + MakeProgram(folder) with the same post    -> OK, Prog123.mod written correctly
    (so the post processors and Python are fine; it is only the
    "generate program recorded through the API on disconnect" path)

Minimal repro (same as before):

  from robodk.robolink import *
  RDK = Robolink()
  RDK.AddFile("C:/.../test_station.rdk")
  robot = RDK.Item("ABB CRB 1300-7/1.4", ITEM_TYPE_ROBOT)
  t1 = RDK.Item("safe_target_1", ITEM_TYPE_TARGET)
  t2 = RDK.Item("safe_target_2", ITEM_TYPE_TARGET)
  RDK.setRunMode(RUNMODE_MAKE_ROBOTPROG)
  print(RDK.ProgramStart("Prog123", "C:/.../", "ABB_RAPID_IRC5", robot))  # prints 0
  robot.MoveJ(t1)
  robot.MoveL(t2)
  RDK.Finish()      # RoboDK.exe crashes ~5 s later, no file

Environment:
  RoboDK 6.0.6.26901 (64-bit), Windows 11 Enterprise 10.0.26200
  Python 3.13 with pip robodk 6.0.1 (same result with the embedded Python)
  License shows as activated (license load 2/2 in the debug log)

Since you could not reproduce it, I suspect something on this machine/install that only this code path touches. Are you able to symbolize the attached minidump against the 6.0.6.26901 build to find out what the crashing function is please? We have tried clean installs over two computers, and we are happy to try a test build if that helps.

Thank you,
Sam


Attached Files
.zip   RoboDK.debug.crash.zip (Size: 3.57 MB / Downloads: 6)
  




Users browsing this thread:
1 Guest(s)