manage_access_control

This function sends the control right request message to the robot controller, or processes the user response when a control right request message is received.

Definition
DRFLEx.h within class CDRFLEx, public section

bool manage_access_control(MANAGE_ACCESS_CONTROL eAccessControl = MANAGE_ACCESS_CONTROL_REQUEST) {
    return _manage_access_control(_rbtCtrl, eAccessControl);
};

Parameter

Parameter Name

Data Type

Default Value

Description

eAccessControl

MANAGE_ACCESS_CONTROL

MANAGE_ACCESS_CONTROL_REQUEST

Specifies the type of control authority management command.

Return

Value

Type

Description

0

int

Error — failed to send or process the control right message.

1

int

Success — successfully processed the control right request or response.

Note

A return of true does not confirm that the controller applied the request. Confirm the result through TOnMonitoringAccessControlCB (GRANT or DENY).

Note

Control authority is handed over only on request. When another client (for example the teach pendant) requests control, the holder receives MONITORING_ACCESS_CONTROL_REQUEST in TOnMonitoringAccessControlCB. When another client sends MANAGE_ACCESS_CONTROL_REQUEST, authority moves only if the holder answers manage_access_control(MANAGE_ACCESS_CONTROL_RESPONSE_YES); the requester then receives GRANT and the holder LOSS. If the holder answers MANAGE_ACCESS_CONTROL_RESPONSE_NO or does not answer, the requester does not get control, and further requests are not forwarded while the first one is pending. There is no function to give up control without a request. manage_access_control returns as soon as the request is made; the outcome arrives later in TOnMonitoringAccessControlCB. If your application must let the teach pendant take over, answer REQUEST with RESPONSE_YES. A client that sends MANAGE_ACCESS_CONTROL_FORCE_REQUEST takes control without an answer. Outside process-button mode, the controller stops the robot (SS1) and turns the servo off when control is handed over. It refuses a handover in remote-control mode, during initialization, in Recovery or backdrive mode, and in configure mode.

The controller ignores every request from a client without control authority, except get_system_version, get_safety_configuration and setup_monitoring_version. A client without control authority still receives monitoring data, state and alarm callbacks; use the monitoring getters (get_current_posj, get_robot_state, …) for position and state information.

Example

void OnMonitoringAccessControlCB(const MONITORING_ACCESS_CONTROL eAccCtrl)
{
    switch(eAccCtrl) {
        case MONITORING_ACCESS_CONTROL_DENY:
            // Deny the transfer of control right
            break;
        default:
            // Displays no control right message
            break;
    }
}

drfl.set_on_monitoring_access_control(OnMonitoringAccessControlCB);

// Requests transfer of control right
drfl.manage_access_control(MANAGE_ACCESS_CONTROL_REQUEST);

This example registers a callback function to monitor control-right events and sends a control right request to the robot controller. When executed, it requests authority to control the robot and handles responses (granted or denied) accordingly.