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 |
Index of the tool-side digital output pin |
||
bOnOff |
bool |
Data to output |
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.