.. _set_on_tp_initializing_completed: set_on_tp_initializing_completed ------------------------------------------ This function registers a callback function that automatically checks whether initialization has been completed when the robot controller is initialized by the T/P application after booting. Use it to run your own code automatically when this event occurs. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp void set_on_tp_initializing_completed(TOnTpInitializingCompletedCB pCallbackFunc) { _set_on_tp_initializing_completed(_rbtCtrl, pCallbackFunc); }; **Parameter** .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - pCallbackFunc - :ref:`TOnTpInitializingCompletedCB ` - - - Refer to definition of callback function **Return** |br| None .. note:: The callback is called once, the first time a robot state other than STATE_NOT_READY or STATE_INITIALIZING is received after registration, and is then unregistered. The controller reports the robot state when the connection is opened and whenever it changes. Register this callback before open_connection: if the controller is already initialised it is then called during connection. A callback registered after connecting to an idle controller is called at the next state change. Register it again after every open_connection. See :ref:`Rules for callback functions `. **Example** .. code-block:: cpp void OnTpInitializingCompletedCB() { // Requests control right after checking Tp initialization printf("tp initializing completed\n"); drfl.manage_access_control(MANAGE_ACCESS_CONTROL_REQUEST); } drfl.set_on_tp_initializing_completed(OnTpInitializingCompletedCB); Once registered, this callback executes automatically **after the T/P (Teach Pendant) initialization process** completes. It prints a message and requests **control authority** using `manage_access_control()`, allowing the external application to take control immediately after system boot.