set_robot_system

This function sets or changes the robot system currently in operation in the robot controller.

Definition
DRFLEx.h within class CDRFLEx, public section

bool set_robot_system(ROBOT_SYSTEM eRobotSystem) { return _set_robot_system(_rbtCtrl, eRobotSystem); };

Parameter

Parameter Name

Data Type

Default Value

Description

eRobotSystem

ROBOT_SYSTEM

Specifies the target robot system to be set.

Return

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

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).