You're reading the documentation for an older, but still supported version (GL013300).
For information on the latest version, please have a look at GL013301.

set_on_program_stopped

This is a function for registering the callback function that automatically checks if program execution has been completely terminated when the program is terminated due to errors or user command during execution in automatic mode in the robot controller. It is useful when functions that should be executed automatically are made.

Definition
DRFLEx.h within class CDRFLEx, public section (line 653)

void set_on_program_stopped(TOnProgramStoppedCB pCallbackFunc) {
    _set_on_program_stopped(_rbtCtrl, pCallbackFunc);
};

Parameter

Parameter Name

Data Type

Default Value

Description

pCallbackFunc

TOnProgramStoppedCB

Refer to definition of callback function

Return
None

Example

void OnProgramStoppedCB(const PROGRAM_STOP_CAUSE eStopCause)
{
    // Shows whether restart of program is possible
}

int main()
{
    drfl.set_on_program_stopped(OnProgramStoppedCB);
}

When this function is registered, the callback OnProgramStoppedCB() is automatically executed whenever a program is stopped. It helps determine whether the program was terminated normally, by user interruption, or due to an error — and can be used to trigger restart or recovery logic accordingly.