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

set_on_program_stopped

This function registers a callback function that automatically checks whether program execution has been completely terminated when the program is terminated in Auto mode due to an error or a user command. Use it to run your own code automatically when this event occurs.

Definition
DRFLEx.h within class CDRFLEx, public section

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
}

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.