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.

drl_stop

This function stops the DRL program (task) currently running in the robot controller. It stops the motion in the currently active section. When drl_stop returns true, the robot is in Manual mode; call set_robot_mode(ROBOT_MODE_AUTONOMOUS) before the next drl_start. When no DRL program is running or paused, or the controller refuses the stop, drl_stop returns false and the mode does not change. drl_stop also returns false after the program has stopped when Manual mode is not confirmed or the robot is in a fault state; after a false return, check get_program_state() and get_robot_mode().

Definition
DRFLEx.h within class CDRFLEx, public section

bool drl_stop(unsigned char eStopType = 0) {
    return _drl_stop(_rbtCtrl, eStopType);
};

Parameter

Parameter Name

Data Type

Default Value

Description

eStopType

unsigned char

0

The program’s motion is always quick-stopped. 0 and 1 end the program as a normal forced stop; 2 ends it as an error stop.

Return

Value

Type

Description

0

int

Error

1

int

Success

Example

DRL_PROGRAM_STATE eProgramState = drfl.get_program_state();
if ((eProgramState == DRL_PROGRAM_STATE_PLAY) ||
    (eProgramState == DRL_PROGRAM_STATE_HOLD)) {
    // Stop DRL program
    drfl.drl_stop(STOP_TYPE_QUICK);
}

This example checks the current DRL program execution state using get_program_state(). If the state is either PLAY or HOLD, the program is stopped using drl_stop(STOP_TYPE_QUICK), which ends the program as a normal forced stop.