.. _drl_stop: 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** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp bool drl_stop(unsigned char eStopType = 0) { return _drl_stop(_rbtCtrl, eStopType); }; **Parameter** .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - **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** .. list-table:: :widths: 10 20 70 :header-rows: 1 * - **Value** - **Type** - **Description** * - 0 - int - Error * - 1 - int - Success **Example** .. code-block:: cpp 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.