.. _set_on_monitoring_data: set_on_monitoring_data ------------------------------------------ This function registers a callback that automatically monitors the robot’s operation data such as joint positions, task coordinates, and system status. It is useful when certain tasks must run automatically when the data is updated. **Definition** |br| ``DRFLEx.h`` within class `CDRFLEx`, public section .. code-block:: cpp void set_on_monitoring_data(TOnMonitoringDataCB pCallbackFunc) { _set_on_monitoring_data(_rbtCtrl, pCallbackFunc); }; **Parameter** .. list-table:: :widths: 20 20 20 40 :header-rows: 1 * - **Parameter Name** - **Data Type** - **Default Value** - **Description** * - pCallbackFunc - :ref:`TOnMonitoringDataCB ` - - - Callback function pointer to handle real-time monitoring data updates **Return** |br| None .. note:: See :ref:`Rules for callback functions `. **Example** .. code-block:: cpp void OnMonitoringDataCB(const LPMONITORING_DATA pData) { // Displays the current joint position data printf("joint data %.1f, %.1f, %.1f, %.1f, %.1f, %.1f\n", pData->_tCtrl._tJoint._fActualPos[0], pData->_tCtrl._tJoint._fActualPos[1], pData->_tCtrl._tJoint._fActualPos[2], pData->_tCtrl._tJoint._fActualPos[3], pData->_tCtrl._tJoint._fActualPos[4], pData->_tCtrl._tJoint._fActualPos[5]); } drfl.set_on_monitoring_data(OnMonitoringDataCB); This example registers a **data monitoring callback** that continuously prints the robot’s **joint positions** in real time as they are updated by the controller.