drl_pause
This function pauses the DRL program (task) currently running in the robot controller.
Definition
DRFLEx.h within class CDRFLEx, public section
bool drl_pause() {
return _drl_pause(_rbtCtrl);
};
Parameter
None
Return
Value |
Type |
Description |
|---|---|---|
0 |
int |
Error |
1 |
int |
Success |
Note
Returns false if the request was refused. A return of true does not confirm that the controller applied the request; get_robot_mode and get_program_state report the request made by this CDRFLEx instance, so they do not confirm it either. A refusal is reported through TOnLogAlarmCB.
Example
if (drfl.get_program_state() == DRL_PROGRAM_STATE_PLAY) {
drfl.drl_pause();
}
This example checks if the current DRL program is in the PLAY state using get_program_state(). If so, it suspends execution by calling drl_pause(). The suspended program can later be resumed using drl_resume, allowing safe interruption and continuation of automatic DRL tasks.