.. _enum_robot_state: ROBOT_STATE ------------------------------------------ This enumeration specifies the operation state of the robot controller, and is defined as follows. .. list-table:: :header-rows: 1 :widths: 5 20 85 * - Value - Constant Name - Description * - 0 - STATE_INITIALIZING - Initialization state, in which the controller parameters are set. * - 1 - STATE_STANDBY - This is the basic operable state and the command standby state. * - 2 - STATE_MOVING - A command operation state that is entered automatically while |br| the robot moves after receiving a command. |br| When the motion finishes, the state automatically changes |br| to the command standby state. * - 3 - STATE_SAFE_OFF - This is a robot pause mode caused by functional and operational |br| errors, and is a servo-off state (a state in which motor and brake |br| power is cut off after control pause). * - 4 - STATE_TEACHING - Direct teaching state. * - 5 - STATE_SAFE_STOP - This is a robot pause mode caused by functional and operational |br| errors, and is a safety stop state (a state in which only control |br| pause was executed, and a temporary program pause state |br| in Auto mode). * - 6 - STATE_EMERGENCY_STOP - Emergency stop state. * - 7 - STATE_HOMMING - Homing mode state (hardware-based alignment of the robot). * - 8 - STATE_RECOVERY - Recovery mode state for moving the robot into the operation range |br| when the robot has stopped due to errors such as leaving the |br| robot operation range. * - 9 - STATE_SAFE_STOP2 - The same as the STATE_SAFE_STOP state, except that the robot has |br| left the robot operation range and must be switched to |br| recovery mode. * - 10 - STATE_SAFE_OFF2 - The same as the STATE_SAFE_OFF state, except that the robot has |br| left the robot operation range and must be switched to |br| recovery mode. * - 11 - STATE_RESERVED1 - Reserved. * - 12 - STATE_RESERVED2 - Reserved. * - 13 - STATE_RESERVED3 - Reserved. * - 14 - STATE_RESERVED4 - Reserved. * - 15 - STATE_NOT_READY - State for initialization after the robot controller boots up. |br| The T/P application changes it to the initialization state. * - 16 - STATE_LAST - Indicates the **final enumerator marker** used internally by the API. |br| It does not represent an operational state of the robot, but simply |br| defines the **total number of valid states** in this enumeration. |br| (Used for boundary checking and array size definitions.) .. Note:: In Recovery mode, jog, multi_jog and the motion functions (movej, movel, movec, moveb, movejx, movesj, movesx, move_spiral, move_periodic, their amove variants, movesj_g and movesx_g) return false and print "this command cannot be used in recovery mode. please change to auto mode as robot mode". To leave Recovery mode, call set_robot_control(CONTROL_RESET_RECOVERY), then set_robot_mode(ROBOT_MODE_MANUAL) or set_robot_mode(ROBOT_MODE_AUTONOMOUS). Until set_robot_mode is called, these functions keep returning false. **Defined in:** ``DRFC.h`` .. code-block:: cpp // robot state enumerated value typedef enum { STATE_INITIALIZING, STATE_STANDBY, STATE_MOVING, STATE_SAFE_OFF, STATE_TEACHING, STATE_SAFE_STOP, STATE_EMERGENCY_STOP, STATE_HOMMING, STATE_RECOVERY, STATE_SAFE_STOP2, STATE_SAFE_OFF2, STATE_RESERVED1, STATE_RESERVED2, STATE_RESERVED3, STATE_RESERVED4, STATE_NOT_READY = 15, STATE_LAST, } ROBOT_STATE;