End Effector
Different versions of controllers, plugins, and upper computers support different Lua API commands. Developers can view the specific supported Lua APIs in the "Application" menu of DobotStudio Pro, under the "Script Programming" command sidebar.
Command List
The end effector commands are used for reading and writing the mechanical arm's end I/O states and setting related parameters.
| Command | Function |
|---|---|
| ToolDI | Read the status of the end digital input ports |
| ToolDO | Set the status of the end digital output ports (queue command) |
| GetToolDO | Get the current status of the end digital output ports |
| ToolAI | Read the value of the end analog input ports |
| SetToolMode | Set the communication mode of the end multipurpose terminal |
| SetToolPower | Set the power state of the end tool |
| SetTool485 | Set the data format corresponding to the RS485 interface of the end tool |
ToolDI
Prototype:
ToolDI(index)
Description:
Reads the status of the end digital input port.
Required Parameter:
index: The number of the end DI terminal.
Returns:
- The status of the corresponding DI terminal (ON/OFF).
Example:
-- If end DI1 is ON, move the mechanical arm to point P1 in a linear motion.
if (ToolDI(1) == ON) then
MovL(P1)
end
ToolDO
Prototype:
ToolDO(index, ON|OFF)
Description:
Sets the status of the end digital output port.
Required Parameters:
index: The number of the end DO terminal.ON|OFF: The status to set the DO port.
Example:
-- Set end DO1 to ON.
ToolDO(1, ON)