.. _cb_tontpgetuserinputcb: TOnTpGetUserInputCB ------------------------------------------ This callback is triggered when a DRL program requests user input with ``tp_get_user_input``. The application shows the prompt and answers with :ref:`tp_get_user_input_response `. See :ref:`Rules for callback functions `. **Defined in:** ``DRFLEx.h`` .. code-block:: cpp // typedef (DRFLEx.h) typedef void (*TOnTpGetUserInputCB)(LPMESSAGE_INPUT); // registration API (internal + wrapper) DRFL_API void _set_on_tp_get_user_input(LPROBOTCONTROL pCtrl, TOnTpGetUserInputCB pCallbackFunc); // user input message handler void set_on_tp_get_user_input(TOnTpGetUserInputCB pCallbackFunc) { _set_on_tp_get_user_input(_rbtCtrl, pCallbackFunc); }; **Parameter** .. list-table:: :header-rows: 1 :widths: 20 25 15 40 * - Parameter Name - Data Type - Default Value - Description * - tInput - :ref:`MESSAGE_INPUT ` - - - Pointer to the input request: ``_szText`` is the prompt and ``_iType`` the expected type (0: int, 1: float, 2: string, 3: bool). **Return** |br| None **Example** .. code-block:: cpp #include "DRFLEx.h" #include #include #include using namespace DRAFramework; using namespace std; // Callback triggered when a DRL program requests user input void OnTpGetUserInputCB(LPMESSAGE_INPUT tInput) { if (!tInput) return; cout << "[TP USER INPUT]" << endl; cout << "Prompt : " << tInput->_szText << endl; cout << "Type : " << static_cast(tInput->_iType) << endl; // Send the answer with tp_get_user_input_response() } int main() { CDRFLEx drfl; // Connect to robot controller if (!drfl.open_connection("192.168.137.100")) { cout << "Failed to connect to controller." << endl; return -1; } // Register TP user input callback drfl.set_on_tp_get_user_input(OnTpGetUserInputCB); // Keep alive to monitor TP user inputs while (true) std::this_thread::sleep_for(std::chrono::seconds(1)); drfl.close_connection(); return 0; } **Notes** - Triggered when a DRL program calls ``tp_get_user_input``. The callback receives the request, not the answer. - The :ref:`MESSAGE_INPUT ` structure contains the prompt (``_szText``) and the expected input type (``_iType``). - Common use cases: **operator prompts**, **manual confirmations**, or **parameter entry** during DRL program execution.