CDRFLEx.get_robot_mode
Features
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.
Parameter
None
Return
Value | Description |
---|---|
enum.ROBOT_MODE | Refer to the Definition of Constant and Enumeration Type |
Example
string strDrlProgram = "\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\
movej(posj(00,00.00,00,00.00), vel=60, acc=60)\r\n\
loop+=1\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, 60.f);
sleep(2);
drfl.jog(JOG_AXIS_JOINT_3, MOVE_REFERENCE_BASE, 0.f);
}
else {
// Automatic Mode
ROBOT_SYSTEM eTargetSystem = ROBOT_SYSTEM_VIRTUAL;
drfl.drl_start(eTargetSystem, strDrlProgram)
}
}