You're reading the documentation for an older, but still supported version
(GL013300).
For information on the latest version, please have a look at GL013301.
For information on the latest version, please have a look at GL013301.
get_robot_mode
This is a function for checking information on the current operation mode of the robot controller. The automatic mode is a mode for automatically executing motions (programs) configured in sequential order, while manual mode is a mode for executing single motions like jog.
Definition
DRFLEx.h within class CDRFLEx, public section (line 691)
ROBOT_MODE get_robot_mode() { return _get_robot_mode(_rbtCtrl); };
Parameter
None
Return
Value |
Description |
|---|---|
Refer to the Definition of Enumeration Type |
Example
string strDrProgram = "\r\n"
"loop = 0\r\n"
"while loop < 3:\r\n"
" movej(posj(10,10,10,10,10,10), vel=60, acc=60)\r\n"
" movel(posx(00,00,00,00,00,00), vel=60, acc=60)\r\n"
" loop=loop+1\r\n"
"end\r\n"
"movej(posj(10,10,10,10,10,10), vel=60, acc=60)\r\n";
if (drfl.get_robot_state() == ESTATE_STANDBY) {
if (drfl.get_robot_mode() == ROBOT_MODE_MANUAL) {
// Manual mode
drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.0f);
sleep(2);
drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.0f);
}
else {
// Automatic mode
ROBOT_SYSTEM eTargetSystem = ROBOT_SYSTEM_VIRTUAL;
drfl.drl_start(eTargetSystem, strDrProgram);
}
}
This example checks the robot’s operation mode and performs different actions accordingly. In manual mode, the robot executes a short jog motion; in automatic mode, it runs a predefined DRL program sequentially.