set_on_monitoring_welding_data

Definition
DRFLEx.h within class CDRFLEx, public section

void set_on_monitoring_welding_data(TOnMonitoringWeldingDataCB pCallbackFunc)
{
    _set_on_monitoring_welding_data(_rbtCtrl, pCallbackFunc);
};

Features

This function registers a callback that receives real-time welding monitoring data from the lower-level robot controller. The callback function is invoked automatically whenever new welding information is available, allowing the upper-level application to monitor and process welding parameters such as target voltage, current, and feed speed in real time.

This mechanism is typically used in applications that require welding process monitoring, performance logging, or adaptive control based on live sensor feedback.

This function is declared only when DRCF_VERSION is set to 2, for example with -DDRCF_VERSION=2. See DRCF Version Compatibility.

Arguments

Field

Data Type

Value

Remarks

pCallbackFunc

TOnMonitoringWeldingDataCB

Function pointer called by the controller to deliver welding status data.

Return
None

Example

// Build with -DDRCF_VERSION=2
#include "DRFLEx.h"
#include <iostream>
#include <thread>
#include <chrono>
using namespace DRAFramework;

CDRFLEx Drfl;

// Callback function to handle incoming welding monitoring data
void MyWeldingDataCallback(const LPROBOT_WELDING_DATA pData)
{
    std::cout << "Adj Available : " << static_cast<int>(pData->_iAdjAvail) << std::endl;
    std::cout << "Target Voltage : " << pData->_fTargetVol << std::endl;
    std::cout << "Target Current : " << pData->_fTargetCur << std::endl;
    std::cout << "Actual Voltage : " << pData->_fActualVol << std::endl;
    std::cout << "Actual Current : " << pData->_fActualCur << std::endl;
    std::cout << "Offset Y : " << pData->_fOffsetY << std::endl;
    std::cout << "Offset Z : " << pData->_fOffsetZ << std::endl;
    std::cout << "Gas On : " << static_cast<int>(pData->_iGasOnDO) << std::endl;
    std::cout << "Arc On : " << static_cast<int>(pData->_iArcOnDO) << std::endl;
    std::cout << "Inching Plus : " << static_cast<int>(pData->_iInchPDO) << std::endl;
    std::cout << "Inching Minus : " << static_cast<int>(pData->_iInchNPO) << std::endl;
    std::cout << "Status : " << static_cast<int>(pData->_iStatus) << std::endl;
}

int main()
{
    // Connect to robot controller
    if (!Drfl.open_connection("192.168.137.100")) {
        std::cout << "Failed to connect to controller." << std::endl;
        return -1;
    }

    // Register callback to receive welding monitoring data
    Drfl.set_on_monitoring_welding_data(MyWeldingDataCallback);

    // Receive welding data for 60 seconds
    std::this_thread::sleep_for(std::chrono::seconds(60));

    Drfl.close_connection();
    return 0;
}

In this example, MyWeldingDataCallback continuously receives live updates on welding parameters such as voltage, current, and wire feed rate during active welding. This allows integration of real-time process feedback into monitoring dashboards or adaptive control logic.