You're reading the documentation for an older, but still supported version (1.33.4).
For information on the latest version, please have a look at 1.33.5.

TOnTpPopupCB

This callback is executed when a user pop-up feature is triggered in the robot controller. It allows developers to handle or log pop-up events displayed on the teach pendant (T/P) UI.

See Rules for callback functions.

Defined in: DRFLEx.h

// typedef (DRFLEx.h)
typedef void (*TOnTpPopupCB)(LPMESSAGE_POPUP);

// registration API (internal + wrapper)
DRFL_API void _set_on_tp_popup(LPROBOTCONTROL pCtrl, TOnTpPopupCB pCallbackFunc);
void set_on_tp_popup(TOnTpPopupCB pCallbackFunc)
{
    _set_on_tp_popup(_rbtCtrl, pCallbackFunc);
};

Parameter

Parameter Name

Data Type

Default Value

Description

tPopup

MESSAGE_POPUP

Pointer to the pop-up data: _szText is the message text, _iLevel the level (0: message, 1: warning, 2: alarm) and _iBtnType the button type (0: Resume/Stop, 1: OK).

Return
None

Example

#include "DRFLEx.h"
#include <iostream>
#include <thread>
#include <chrono>
using namespace DRAFramework;
using namespace std;

// Callback triggered when a user pop-up message appears on the TP
void OnTpPopupCB(LPMESSAGE_POPUP tPopup)
{
    if (!tPopup) return;

    cout << "[TP POPUP]" << endl;
    cout << "Message : " << tPopup->_szText << endl;
    cout << "Level   : " << static_cast<int>(tPopup->_iLevel) << endl;
    cout << "Buttons : " << static_cast<int>(tPopup->_iBtnType) << endl;

    // You can log or trigger additional actions here
}

int main()
{
    CDRFLEx drfl;

    // Connect to the robot controller
    if (!drfl.open_connection("192.168.137.100")) {
        cout << "Failed to connect to controller." << endl;
        return -1;
    }

    // Register TP popup callback
    drfl.set_on_tp_popup(OnTpPopupCB);

    // Keep alive to monitor TP popup events
    while (true)
        std::this_thread::sleep_for(std::chrono::seconds(1));

    drfl.close_connection();
    return 0;
}

Notes

  • This callback is invoked when the robot controller triggers a teach pendant pop-up (e.g., alert messages, user confirmation dialogs, or DRL-generated pop-ups).

  • Common use cases include logging, custom alert handling, or debug message tracing.