Breadcrumbs

CDRFLEx.set_on_monitoring_ctrl_io_ex


The interface of this function varies depending on the V2/V3 controller. Please specify the controller version by defining either #define DRCF_VERSION 2 or #define DRCF_VERSION 3, and then import DRFL.

Features

This is a function for registering the callback function that automatically checks information on the current state of the I/O installed in the control box of the robot controller. It is useful when functions that should be executed automatically are made.

It is activated when the monitoring data version is changed to 1 using the set_up_monitoring_version function.

This function is only available in M2.5 version or higher.

Parameter

Parameter Name

Data Type

Default Value

Description

pCallbackFunc

TOnMonitoringCtrlIOExCB

-

Refer to definition of callback function

Return

None.

Example

C++
void OnMonitoringCtrlIOExCB(const LPMONITORING_CTRLIO_EX pCtrlIO) // In case of DRCF_VERSION 2
{
    // Displays the digital input GPIO state data 
    cout << "gpio data" << endl;
    for (int i = 0; i < NUM_DIGITAL; i++)
         cout << "DI#"<< i << ": " << pCtrlIO->_tInput._iActualDI[i] << endl;
}

void OnMonitoringCtrlIOExCB(const LPMONITORING_CTRLIO_EX2 pCtrlIO) // In case of DRCF_VERSION 3
{
	// Displays the digital input GPIO state data 
	cout << "gpio data" << endl; 
	for (int i = 0; i < NUM_DIGITAL; i++)
		cout << "DI#"<< i << ": " << pCtrlIO->_tInput._iActualDI[i] << endl;
}


int main()
{
    drfl.set_on_monitoring_ctrl_io_ex(OnMonitoringCtrlIOCBEx)
}