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.

get_digital_output

This function reads the current signal state of a digital output port on the robot controller’s control box. It is used to check whether the specified digital output is currently ON (1) or OFF (0).

This function is useful for verifying signal states before sending commands, or for debugging I/O operations during automated sequences.

With DRCF_VERSION 3 (the default), this function requires setup_monitoring_version(1). Without it, the function returns false and prints “Depreciated.. please make sure monitoring version..”. Call setup_monitoring_version(1) again after every open_connection.

Version Note
- If DRCF version = 2, this function internally calls _get_digital_output().
- If DRCF version = 3, it calls _get_digital_output_ex() for extended I/O access.
Refer to get_library_version to check the current DRCF version.

Definition
DRFLEx.h within class CDRFLEx, public section

#if DRCF_VERSION == 2
bool get_digital_output(GPIO_CTRLBOX_DIGITAL_INDEX eGpioIndex) {
    return _get_digital_output(_rbtCtrl, eGpioIndex);
};
#elif DRCF_VERSION == 3
bool get_digital_output(GPIO_CTRLBOX_DIGITAL_INDEX eGpioIndex) {
    return _get_digital_output_ex(_rbtCtrl, eGpioIndex);
};
#endif

Parameter

Parameter Name

Data Type

Default Value

Description

eGpioIndex

GPIO_CTRLBOX_DIGITAL_INDEX

Index of the digital output port on the control box.

Return

Value

Description

0

OFF — output signal is currently low (inactive)

1

ON — output signal is currently high (active)

Example

// Check the state of digital output #1
bool bSignal = drfl.get_digital_output(GPIO_CTRLBOX_DIGITAL_INDEX_1);

if (bSignal)
    printf("Digital output #1 is currently ON\n");
else
    printf("Digital output #1 is currently OFF\n");

This example reads the state of digital output #1 on the control box and prints whether the port is currently active (ON) or inactive (OFF).