.. _get_robot_state: get_robot_state ------------------------------------------ This function returns the current operation state of the robot controller. It is used together with the `TOnMonitoringStateCB` callback function. For safety, change the operation state according to the current state using the `set_robot_control()` function. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp ROBOT_STATE get_robot_state() { return _get_robot_state(_rbtCtrl); }; **Parameter** |br| None **Return** .. list-table:: :widths: 25 75 :header-rows: 1 * - **Value** - **Description** * - :ref:`ROBOT_STATE ` - Refer to the Definition of Enumeration Type **Example** .. code-block:: cpp #include #include if (drfl.get_robot_state() == STATE_STANDBY) { if (drfl.get_robot_mode() == ROBOT_MODE_MANUAL) { // Manual mode drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 10.0f); // start jog std::this_thread::sleep_for(std::chrono::seconds(2)); drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.0f); // stop jog } } This example checks the robot’s **state and mode** before motion. When the robot is in **standby** and **Manual mode**, it performs a short jog motion on joint 3. No motion is executed otherwise, ensuring safe operation.