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.

get_tool

This is a function for retrieving the tool information currently set in the robot controller. When there is no currently set tool, an empty character string is returned.

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

string get_tool() { return string(_get_tool(_rbtCtrl)); };

Parameter
None

Return

Value

Description

string

Name of the currently selected tool.
If no tool is active, returns an empty string “”.

Example

string strTool = drfl.get_tool();

// Check the currently mounted tool
if (strTool != "tool#1") {
    drfl.set_tool("tool#1");
}

This example checks the currently mounted tool name using get_tool(), and sets the active tool to “tool#1” if it is not already selected.