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. |
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.