.. _set_robot_system: set_robot_system ------------------------------------------ This function sets or changes the robot system currently in operation in the robot controller. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp bool set_robot_system(ROBOT_SYSTEM eRobotSystem) { return _set_robot_system(_rbtCtrl, eRobotSystem); }; **Parameter** .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - eRobotSystem - :ref:`ROBOT_SYSTEM ` - - - Specifies the target robot system to be set. **Return** .. list-table:: :widths: 10 20 70 :header-rows: 1 * - **Value** - **Type** - **Description** * - 0 - int - Error — failed to change the robot system. * - 1 - int - Success — successfully changed the robot system. .. note:: A return of true does not confirm that the controller applied the request. Confirm the result with the corresponding getter or callback (for example get_digital_output, get_robot_system, get_robot_speed_mode). If the value reported by the controller already equals the requested value, the function returns true immediately. **Example** .. code-block:: cpp ROBOT_SYSTEM eRobotSystem = drfl.get_robot_system(); if (eRobotSystem != ROBOT_SYSTEM_REAL) { // Converts to real robot system drfl.set_robot_system(ROBOT_SYSTEM_REAL); } else { // Do something ... } This example switches the robot controller to the real robot system (ROBOT_SYSTEM_REAL) if it is currently set to the virtual robot system (ROBOT_SYSTEM_VIRTUAL).