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

set_tool_digital_output

This function outputs a digital signal at the tool-side contact point mounted on the robot arm (end-effector side), through the robot controller.
It is mainly used to control external devices attached to the flange or wrist, such as grippers, valves, or end-effector sensors.

Definition
DRFLEx.h within class CDRFLEx, public section (line 831)

bool set_tool_digital_output(GPIO_TOOL_DIGITAL_INDEX eGpioIndex, bool bOnOff)
{ return _set_tool_digital_output(_rbtCtrl, eGpioIndex, bOnOff); };

Parameter

Parameter Name

Data Type

Default Value

Description

eGpioIndex

GPIO_TOOL_DIGITAL_INDEX

Index of the tool-side digital output pin

bOnOff

bool

Data to output
1: ON (set high)
0: OFF (set low)

Return

Value

Description

0

Error — failed to output digital signal

1

Success — digital output signal sent successfully

Example

#include "DRFLEx.h"
using namespace DRAFramework;

int main() {
    CDRFLEx drfl;

    // Activate the digital output #1 pin on the tool-side connector
    drfl.set_tool_digital_output(GPIO_TOOL_DIGITAL_INDEX_1, true);

    // Turn off the same pin
    drfl.set_tool_digital_output(GPIO_TOOL_DIGITAL_INDEX_1, false);
}

This example shows how to control the digital output pin on the robot tool flange, typically used to operate external actuators such as pneumatic grippers or tool LEDs.