manage_access_control (Manual Mode)
This section explains how to use manage_access_control during Manual (Teach) operations.
This function requests control authority, or answers another client’s request for it,
ensuring that only one client (PC, HMI, or external device) can actively command the robot at a time.
In Manual mode, it is commonly used to obtain permission before jogging or executing any motion command.
Typical usage
Request access control before performing manual motion or configuration operations.
After teaching is completed, answer a control request with
MANAGE_ACCESS_CONTROL_RESPONSE_YESto allow other clients (e.g., the teach pendant) to take control.Check access if multiple clients are connected to the same robot controller.
Note
Only one controller session can hold access at a time.
Required before executing most motion or configuration commands in Manual (Teach) mode.
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: Request robot access control
#include <atomic>
#include <chrono>
#include <thread>
// Set by the access control callback
std::atomic<bool> g_bHasControl{false};
void OnAccessControl(const MONITORING_ACCESS_CONTROL eAccess)
{
if (eAccess == MONITORING_ACCESS_CONTROL_GRANT)
g_bHasControl = true;
else if (eAccess == MONITORING_ACCESS_CONTROL_LOSS)
g_bHasControl = false;
}
// Preconditions:
// - drfl.set_on_monitoring_access_control(OnAccessControl) registered
// - Connection established (open_connection)
// - Manual (Teach) mode active
// 1) Request access control to operate robot manually
if (drfl.manage_access_control(MANAGE_ACCESS_CONTROL_REQUEST))
printf("[Access Control] Request sent; waiting for GRANT.\n");
else {
printf("[Access Control] Request was not sent.\n");
return -1;
}
// Wait up to 10 s for MONITORING_ACCESS_CONTROL_GRANT before moving
for (int i = 0; i < 1000 && !g_bHasControl; ++i)
std::this_thread::sleep_for(std::chrono::milliseconds(10));
if (!g_bHasControl) {
printf("[Access Control] Control was not granted.\n");
return -1;
}
// 2) Perform simple manual move or teaching operation
float qTarget[6] = {0, -30, 90, 0, 90, 0};
drfl.movej(qTarget, 50, 50);
// Wait until motion is complete
while (drfl.check_motion() != 0)
std::this_thread::sleep_for(std::chrono::milliseconds(100));
// 3) Control stays with this client until it answers a request
// from another client with MANAGE_ACCESS_CONTROL_RESPONSE_YES,
// or until another client sends MANAGE_ACCESS_CONTROL_FORCE_REQUEST
// (see TOnMonitoringAccessControlCB).
Tips
Always call
manage_access_control(MANAGE_ACCESS_CONTROL_REQUEST)before issuing any motion in Manual or Auto mode.When multiple clients are connected, only one can have exclusive control.
Control authority does not need to be renewed. The holder keeps it until it answers a request with
MANAGE_ACCESS_CONTROL_RESPONSE_YESor another client takes it withMANAGE_ACCESS_CONTROL_FORCE_REQUEST.Control authority changes are reported through TOnMonitoringAccessControlCB (GRANT, LOSS, REQUEST, DENY).