DobotStudio Pro 4.1 User Guide (CR&Nova)
DobotStudio Pro 4.1 User Guide (CR&Nova)
Preface
1 Getting Started
2 Connecting to Robot
3 Main Interface
4 Jog
5 Monitor
5.1 Controller DI/DO
5.2 Controller AI/AO
5.3 Tool I/O
5.4 Safety I/O
5.5 Modbus
5.6 Global variable
6 Settings
6.1 System settings
6.2 Coordinate system
6.2.1 User coordinate system
6.2.2 Tool coordinate system
6.3 Load parameters
6.4 Motion parameters
6.5 Posture
6.6 Trajectory playback
6.7 Communication settings
6.8 Installation
6.9 Drag
6.10 Security settings
6.10.1 Collision detection
6.10.2 Safety wall
6.10.3 Initial posture
6.10.4 Joint brake
6.11 Operation Mode settings
6.12 Home calibration
2
6.13 Advanced functions
6.14 Power voltage (CCBOX)
7 Log
8 Dobot+
9 Application
9.1 Application main interface
9.2 Blockly programming
9.3 Script programming
Appendix A Modbus Register Definition
Appendix B Blockly Command
B.1 Event
B.2 Control
B.3 Operator
B.4 String
B.5 Custom
B.6 IO
B.7 Motion
B.8 Modbus
B.9 TCP
B.10 Quick start
Control robot movement
Read and write Modbus register data
Transmit data by TCP communication
Appendix C Script Command
C.1 Lua basic grammar
Variable and data type
Operator
Process control
C.2 Motion command
Command list
General description
MovJ
MovL
Arc
3
Circle
MovJIO
MovLIO
StartPath
GetPathStartPose
C.3 Relative motion command
Command list
RelPointUser
RelPointTool
RelMovJTool
RelMovLTool
RelMovJUser
RelMovLUser
RelJointMovJ
RelJoint
C.4 Motion parameter
Command list
CP
VelJ
AccJ
VelL
AccL
SpeedFactor
SetPayload
User
SetUser
CalcUser
Tool
SetTool
CalcTool
GetPose
GetAngle
GetABZ
CheckMovJ
4
CheckMovL
SetSafeWallEnable
SetCollisionLevel
SetBackDistance
C.5 IO
Command list
General description
DI
DIGroup
DO
DOGroup
GetDO
GetDOGroup
AI
AO
GetAO
C.6 Tool
Command list
General description
ToolDI
ToolDO
GetToolDO
ToolAI
SetToolMode
SetToolPower
SetTool485
C.7 TCP&UDP
Command list
TCPCreate
TCPStart
TCPRead
TCPWrite
TCPDestroy
UDPCreate
5
UDPRead
UDPWrite
C.8 Modbus
Command list
ModbusCreate
ModbusRTUCreate
ModbusClose
GetInBits
GetInRegs
GetCoils
SetCoils
GetHoldRegs
SetHoldRegs
C.9 Program control
Command list
Print
Log
Wait
Pause
ResetElapsedTime
ElapsedTime
Systime
C.10 SafeSkin
Command list
EnableSafeSkin
SetSafeSkin
Appendix D Remote Control Signal Sequence Diagram
6
Preface
Purpose
This document describes the functions and operations of DobotStudio Pro for controlling six-axis robots
(CR and Nova series), which is convenient for users to fully understand and use the software.
Intended Audience
Customer
Sales Engineer
Installation and Commissioning Engineer
Technical Support Engineer
Change History
2023/05/15 V4.1.0
Symbol Conventions
The symbols that may be found in this document are defined as follows:
Symbol Description
Indicates a hazard with a high level of risk which, if not avoided, could
DANGER result in death or serious injury
Indicates a hazard with a medium level or low level of risk which, if not
WARNING avoided, could result in minor or moderate injury, robotic arm damage
7
1 Getting Started
DobotStudio Pro is a multi-functional control software for robot arms developed by Dobot. With simple
interface, easy-to-use functions and strong practicability, it can help you quickly master the use of various
robot arms.
This document mainly introduces how to use DobotStudio Pro to control six-axis robot arms (CR and
Nova series).
For PC
Win7
Win10
Win11
For Tablet
Please visit Dobot website to download the latest DobotStudio Pro installation package.
Procedure
Step 1: Double-click DobotStudio Pro installation package. Select a language for installation. Click Next.
8
Step 2: Click One Click Install, or start installation after setting the installation path in Custom options.
9
For Tablet
Android: Download the latest installation package of DobotStudio Pro from Dobot website and install
it.
iOS: Search and install the latest DobotStudio Pro on App Store.
Guidance
If you are using DobotStudio Pro for the first time, it is recommended to read this Guide in the following
order.
1. Connecting to Robot: Know about how to connect DobotStudio Pro to the robot arm.
2. Main Interface/Jog/Monitor/Log: Know about how to control the robot arm through DobotStudio Pro
online. On Monitor page you can configure DI/DO and Modbus remote control functions.
3. Settings: Know about how to configure the robot arm based on actual requirements. If the robot is
installed in an in-ceiling or wall-mounting mode or at a certain angle, you need to set the rotation
angle and tilt angle under the disabled state. See Installation for details.
4. Dobot+: Know about how to use external tools through Dobot+ plugins.
5. Application: Know about the programming module of DobotStudio Pro and try creating your own
project.
10
2 Connect to Robot
DobotStudio Pro supports wired (LAN) and wireless (WiFi) connection to the robot on PC, and only
wireless (WiFi) connection on App.
NOTE
During the start-up of CC262 control cabinet, the orange light of the LAN2 interface will flash,
indicating that the built-in WiFi router is initialising. At this time the LAN2, WiFi and SmartPendant
are unable to connect to the robot. Throughout the initialisation process, the light will flash faster and
faster and finally extinguishes, indicating that the initialisation is completed. Now you can try
connecting to the robot.
Wireless Connection
Before connecting to the robot, ensure that a WiFi module has been installed in the control cabinet (the
CC262 control cabinet is equipped with it and does not need to be installed separately).
Search the WiFi name of robot on PC or tablet and connect it. The default WiFi SSID is
“Dobot_WIFI_XXX (XXX is the robot index located on the base, as shown below), and initial WiFi
password is 1234567890. The WIFI SSID and password can be modified in Communication settings.
**On PC**
11
After you enter DobotStudio Pro, the software will automatically search for robots and displays the search
results on the interface. Click Connect on the right side of the device to connect it. **On tablet**
Click Connect on the left-top corner to connect to the robot. After successful connection, the software
interface will refresh and display the information about the connected robot and its 3D model. If you want
to disconnect the robot, click Disconnect on the right side of the device name.
Wired connection
Wired connection is only supported on PC.
12
Connect one end of the network cable to the LAN interface on the control cabinet and the other end to the
PC. Change the IP address of the PC to make it on the same network segment as that of the control cabinet.
The CC16X control cabinet (first-generation control cabinet) has only one LAN interface (referred to as
LAN1 port) with a default IP address of 192.168.5.1. The CC26X (second-generation control cabinet) and
CCBOX have two LAN interfaces. The default IP of the LAN1 interface is 192.168.5.1, and the default IP
of the LAN2 interface is 192.168.200.1. The LAN 1 IP address can be modified in Communication
settings.
Different Windows versions vary in the method to modify the IP address. This section takes Windows 10
as an example to introduce specific operations.
4. Select a device on the left side of DobotStudio Pro and click Connect.
13
1. After successful connection, the software interface will refresh and display the information about the
connected robot and its 3D model. If you want to disconnect the robot, click Disconnect on the right
side of the device name.
14
3 Main interface
No. Description
Click to open the main interface (current interface). The colour of the robot arm icons
1 changes according to the robot status. For detailed definition of the indicator colours, see the
corresponding hardware guide.
Click to open help documents, which can be displayed in the software interface, in a separate
6
window or in a browser.
Display the current global speed rate. Drag the slider or click the speed bar to adjust the
9 global speed rate. The global speed rate is the calculation factor of the robot actual running
speed. For the calculation method, see Motion parameters.
Emergency stop switch. Press the button in an emergency, and robot arm will stop running
10
and be powered off. See Emergency stop switch.
15
14 Click to view the voltage, current and temperature of the robot.
If you need to enable the robot arm again, please click the emergency stop switch first to reset it, clear the
alarm and then enable it.
NOTE
Emergency stops caused by other emergency stop inputs (physical emergency stop button or user
emergency stop input) will also change the state of the switch. In this case, however, the button
cannot be reset via the software interface, and must be reset via the corresponding input source
(rotate to reset the physical button or reset the safety input signal).
Information panel
Enable
When the enabling button is OFF, click it and the "Load enabling settings" window will pop up.
16
Select the load parameter group through the drop-down box. You need to set the parameter groups in Load
parameters and then select here. The following parameters can be modified manually by selecting Custom.
Centre offset of X/Y/Z: Offset distance of the load mass centre in each direction. For the direction of
each axis, refer to the diagram on the interface (The diagram above is based on CR series. Please refer
to the actual software interface, and pay attention to the direction of the aviation socket in the
diagram).
Load weight: Total weight of the end fixture and workpiece, which must not exceed the maximum
load of the robot arm.
Execute load detection: When this function is checked, the robot arm will make a small movement to
check whether the load parameters you set are the same as the actual load. If not, the robot fails to be
enabled, and you need to reset the load parameters or uncheck Execute load detection.
Once the robot is enabled successfully, the enabling button turns ON.
17
Device information
Device mode: It indicates the current control mode of the robot. You can click the underlined text to
switch the mode. If the robot is in motion when you switch the mode, it will stop moving immediately
after the switch, but the enabling status will remain unchanged.
Online mode is the default control mode, in which the robot arm can be controlled through
DobotStudio Pro, or be controlled remotely through I/O or Modbus.
TCP mode is only used when you develop your own control software based on TCP. If you need
to develop your own control software, please contact technical support for TCP_IP Remote
Control Interface Guide (V4).
Manual/Automatic mode switch: This function is displayed in the information panel only after the
operation mode switch function is switched on. See Mode settings for details.
IO/Modbus configuration: Set whether the remote IO/Modbus input is valid. You can click the button
to switch it. The effective scope of remote IO/Modbus input is affected by automatic/manual mode, as
shown below.
Serial No. refers to the serial No. of the currently connected robot.
IP address refers to the IP used by the currently connected robot to communicate with DobotStudio
Pro.
Load
18
Display the current load settings of the robot. Click the load parameter group name to open Load Parameter
interface.
Safety information
Display the collision detection settings of the robot. Click the level of collision detection to open Collision
detection interface.
19
4 Jog
The Jog panel is used to jog the robot arm, which supports joint jog and coordinate system jog.
No. Description
Display the coordinate system currently in effect for the robot. You can click the drop-down
2
box to change it.
Robot 3D model, which displays the robot posture in real-time. The panel is not available
3
on App.
4 Select jog mode, including joint jog and coordinate system jog.
Select whether to jog the robot arm along the user coordinate system or tool coordinate
20
system. When the user coordinate system is selected, the end of the robot arm will move
7
along the corresponding axis of the user coordinate system, and similarly for the tool
coordinate system.
21
5 Monitor
5.1 Controller DI/DO
5.2 Controller AI/AO
5.3 Tool I/O
5.4 Safety I/O
5.5 Modbus
5.6 Global variable
22
5.1 Controller DI/DO
This page is used to monitor and set the status and functions of controller DI and DO. As different
controllers vary in the number of I/O, the screenshots in this section are for reference only.
The middle area of the page is used to view and set the alias and status of DI/DO.
Click or the alias in black font to modify the alias. The alias in blue font refers to the function
configured for the IO, which can be changed in Settings page.
The circular indicator on the right side of DI refers to the current status of DI (grey: OFF, green: ON).
The switch on the right side of DO refers to the current status of DO. Click it to switch ON/OFF and
control the status of the corresponding DO.
Click Settings on the right-top of the page to jump to Settings page, which consists of three tabs.
I/O settings
23
Check Switch to virtual DI on the right side of corresponding DI to switch it to virtual DI. When the DI is
set to virtual DI, the indicator on the Monitor page will turn to a switch. Clicking it can switch the ON/OFF
status of the virtual DI, which is convenient for debug.
NOTE
The virtual DI continues to take effect after being set, which will affect the DI judgement during the
project operation. If you want to avoid this condition, switch virtual DI to real DI before running the
project.
You can configure the remote control function of DI/DO through the drop-down box in Function
configuration column, as described below.
DI DO
Description Description
function function
24
When the robot arm is idle, it
starts running the specified
project. See Select project
Running Output 1 when running a
Start below for details.
status project, and 0 otherwise
When the arm is paused, it
continues to run the project (or
other forms of command queue)
Pause running the project (or Pause Output 1 when pause running,
Pause
other forms of command queue) status and 0 otherwise
Initial
Output 1 when in Initial posture,
Enable Enable the robot posture
and 0 otherwise
status
Control the robot to enter the Power Output 1 when powered on, and
Enter drag
drag mode status 0 otherwise
Control the robot to exit the Enabling Output 1 when enabled, and 0
Exit drag
drag mode status otherwise
DI with "Alternative project" function cannot be configured in this page, which should be released in
Select project page first.
When the type of control cabinet is CCBOX, safety I/O and universal I/O share the same terminal. The
terminal configured as safety IO cannot be configured as remote I/O.
NOTICE
All remote trigger sources take effect at the same time. Please do not set too many trigger sources to
avoid security risks. For the safety of the equipment and production, please ensure that the robot is
activated by only one control source.
Select project
25
When you select Default running project, the project selected here will run directly when the Start DI is
triggered.
Click Select, and the "Selection project" box will pop up. refers to blockly projects, and refers
to script projects. Clicking Delete, and the currently selected project will be cleared.
When selecting Group IO select project, you can configure multiple projects through group I/O.
1. Click + or - to increase or decrease the number of addresses allocated to the group I/O. The more
addresses allocated, the more projects can be configured.
26
2 addresses: 4 projects can be configured
3 addresses: 8 projects can be configured
4 addresses: 16 projects can be configured
2. You can modify the assigned address through the drop-down box. The address assigned to the group
I/O cannot overlap the address of remote I/O or safety I/O (CCBOX).
3. After assigning the address, you can set the project for each group IO value. (Just set it according to
the actual requirements, or leave it blank)
Before running a project, select the corresponding project by setting the corresponding (green:
ON, grey: OFF) group IO value. If no project is selected for the corresponding group IO, the
robot will not run the project when the \"Start\" DI is triggered.
Taking the four addresses DI1~DI4 assigned in the figure above as an example:
DI1 and DI2 are ON, DI3 and DI4 are OFF: the 3rd project is selected.
Advanced configuration
The interface varies from control cabinet to control cabinet, see the description below, The figure below
takes CC262 as an example.
Trigger mode
The DI trigger mode is used to set how the DI function is triggered. The rising edge indicates that the
configured function is triggered when DI changes from OFF to ON, and the falling edge indicates that the
configured function is triggered when DI changes from ON to OFF.
27
Select mode When the control cabinet type is CCBOX or CC262, you will see the following settings on
the interface.
CCBOX: DI or DO mode.
CC26X: DO mode.
You need to select the DI/DO mode according to the actual hardware wiring. See the corresponding
hardware guide for details.
28
5.2 Controller AI/AO
This page is used to monitor and set the status and modes of controller AI and AO. As different controllers
vary in the number of I/O, the screenshots in this section are for reference only.
The analog output is used to display the actual value of the controller AI.
When the type of control cabinet is CC162 and CC262, both voltage and current modes are supported. You
can click Modify to switch the mode, and modify the AO output manually. Then click Confirm
modification.
NOTE
When the control cabinet type is CC162, switching mode needs to be operated with DIP switch,
which is located inside the control cabinet. Please contact Dobot technical support if required.
29
5.3 Tool I/O
This page is used to monitor the status and modes of tool IO. For devices with multiple aviation sockets,
you will see multiple tabs here.
DI/DO
The circular indicator on the right side of DI refers to the current status of DI (grey: OFF, green: ON).
When the DI is set to virtual DI, the indicator will turn to a switch. Clicking it can switch the ON/OFF
status of the virtual DI, which is convenient for debug.
The switch on the right side of DO refers to the current status of DO. Click it to switch ON/OFF and
control the status of the corresponding DO.
30
NOTE
The virtual DI continues to take effect after being set, which will affect the DI judgement during the
project operation. If you want to avoid this condition, switch virtual DI to real DI before running the
project.
RS485/AI
For CR or CR A series robots, you can switch the operating mode of the end.
When the operating mode is "RS485", the tool IO pin1 and pin2 function as 485A and 485B
respectively.
When the operating mode is "Analog input", the tool IO pin1 and pin2 function as AI_1 and AI_2.
You can monitor the input value in real time from this interface.
31
5.4 Safety I/O
This page is used to view the status and set the functions of safety I/O. Different control caninets vary in
the design of safety IO. See the corresponding hardware manual for details.
The indicators in the Status column refer to the corresponding safety I/O status (green: high level, grey:
low level).
When the controller type is CC262, the safety IO is configured with dual circuits. The two indicators
of dual SI indicate the status of each channel, and their trigger logics vary according to the configured
functions. As the status of dual SO are synchronised, only one indicator is used to indicate the status.
When the controller type is CC162, the safety IO supports single/dual circuit configuration. Please
configure according to the actual requirements.
When the controller typee is CCBOX, the safety IO and the universal IO share the same terminals.
Please pay attention to planning the terminal usage.
Click Settings to modify the function configuration of safety I/O. For configurable functions and
description, see the corresponding hardware guide.
32
NOTE
In actual use, please try to ensure that SI signal changes at an interval of over 150ms, otherwise SI
signal jump may cause anomaly in robot running status.
For example, when the protective stop reset input is not configured, the jump of the protective stop
input signal (the change interval is less than 150ms) may cause the robot not to automatically resume
operation after being paused. In this case, you need to solve the problem through the method below.
1. Pause the project through the software, and then continue to run the project.
2. Trigger the protective stop input signal again and remain over 150ms.
33
5.5 Modbus
This page is used for connecting a Modbus slave when the upper computer serves as a Modbus master to
view and modify register values, and to configure remote Modbus control functions when the controller
serves as a slave.
Click Connect on the right-top of the page to set the slave to be connected.
34
Slave IP: address of Modbus device. Enter controller IP when connecting the Modbus slave of the
controller, such as 192.168.200.1.
Port: port index of Modbus communication. Enter 502 when connecting the Modbus slave of the
controller.
Slave ID: slave device ID.
Function code: select the function type of the slave device.
Address/Quantity: address and number of registers. Refer to Appendix A Modbus Register Definition
when connecting the Modbus slave of the controller.
Scan rate: time interval of scanning the slave station by the robot arm.
After successful connection, the table in the middle of the page shows the alias and value of each address
of the slave. Clicking the alias cell can modify the alias. If the register type is coil register or holding
register, clicking the register value cell can modify the value.
Click \Settings\ at the top of the page to enter Settings page, which consists of two tabs.
Modbus settings
35
Trigger mode is used to set how the function of the coil register is triggered. The rising edge indicates that
the configured function is triggered when the coil register changes from 0 to 1, and the falling edge
indicates that the configured function is triggered when the coil register changes from 1 to 0.
For each remote control function supported by the controller, enter the corresponding coil/contact register
address. -1 means that the function is not configured. The remote control functions supported by the
controller are shown in the table below.
Coil Discrete
register Description input Description
function function
Pause running the project (or Pause Output 1 when pause running,
36
other forms of command queue) status and 0 otherwise
Initial
Output 1 when in Initial posture,
Enable Enable the robot posture
and 0 otherwise
status
Control the robot to enter the Power Output 1 when powered on, and
Enter drag
drag mode status 0 otherwise
Control the robot to exit the Enabling Output 1 when enabled, and 0
Exit drag
drag mode status otherwise
NOTICE
All remote trigger sources take effect at the same time. Please do not set too many trigger
sources to avoid security risks. For the safety of the equipment and production, please ensure
that the robot is activated by only one control source.
All remote trigger sources take effect at the same time. Please do not set too many trigger
sources to avoid security risks. For the safety of the equipment and production, please ensure
that the robot is activated by only one control source.
Select project
When you select Default running project, the project selected here will run directly if the "Start" coil
register is triggered.
37
Click Select, and the "Selection project" box will pop up. refers to blockly projects, and refers
to script projects. Click Delete to clear currently selected project.
Click + or - to increase or decrease the projects to be configured. When the "Start" coil register is triggered,
the project to be started will be determined based on the value of the holding register at the specified
address (3095).
38
5.6 Global variable
This page is used to set global variables.
After setting the global variable, you can call the variable through relevant blocks in blockly programming,
or call the variable through the variable name in script programming.
Click Add to add a new global variable. After selecting a variable, click Modify to modify the properties
of the variable, and click Delete to output the selected variable.
number
bool: boolean value
string
table: table (including array)
39
When the variable is set as \Global Hold\</b>, the value of the global variable will take effect globally
after being modified in blockly or script programming, and subsequent projects will obtain the modified
value when referring to the variable; otherwise the modified value will only take effect when the
corresponding project is running, and the global variable will recover its pre-modified value after the
project stops running.
40
6 Settings
6.1 System settings
6.2 Coordinate system
6.2.1 User coordinate system
6.2.2 Tool coordinate system
6.3 Load parameters
6.4 Motion parameters
6.5 Posture
6.6 Trajectory playback
6.7 Communication settings
6.8 Installation
6.9 Drag
6.10 Security settings
6.10.1 Collision detection
6.10.2 Safety wall
6.10.3 Initial posture
6.10.4 Joint brake
6.11 Operation Mode settings
6.12 Home calibration
6.13 Advanced functions
41
6.1 System settings
The "System settings" page is used to change the software language, Manager password, system time, etc.
Manager password: Modify Manager password of DobotStudio Pro (initial password: 888888).
System time: Display the current system time of the controller, which can be modified.
Connect to the robot automatically next time the software starts: when selected, the software will try
connecting to the currently connected robot automatically next time the software starts.
You can click the icons and text on the right bottom of the interface, as described below.
: To open "Manufacturer function" page, you need to enter the password. The manufacturer function
is not described in this document.
42
6.2 Coordinate system
6.2.1 User coordinate system
6.2.2 Tool coordinate system
43
6.2.1 User coordinate system
When the position of workpiece is changed or a robot program needs to be reused in multiple processing
systems of the same type, you can create a user coordinate system to make all paths updated with the user
coordinate system, which will greatly simplify the programming.
DobotStudio Pro supports 50 user coordinate systems, of which the User coordinate system 0 is defined as
the base coordinate system by default and cannot be changed.
NOTE
When creating a user coordinate system, make sure that the reference coordinate system is the base
coordinate system.
The user coordinate system is recommended to create by three-point calibration method. Move the robot to
three points: A, B and C. PointA is defined as the origin, and the line AB is defined as the positive
direction of X-axis. The line that point C is perpendicular to X-axis is defined as the positive direction of
Y-axis (In actual calibration, point C does not have to be on the Y-axis. It can be in the plane quadrant
determined by the positive direction of the X-axis and Y-axis, and not on the X-axis. The system can
automatically calculate the positive direction of the Y-axis). The Z-axis can be defined based on the right-
hand rule.
44
2. Click Three points setting.
NOTE
You can also modify the X, Y, Z, Rx, Ry and Rz values directly and click Save.
1. According to the diagram, control the robot arm to move to the corresponding points and click
\Obtain\</b>.
NOTE
When creating a user coordinate system, make sure that the reference coordinate system is
the base coordinate system, that is, the user coordinate system is 0 when you jog the robot.
Long pressing Run To can move the robot to the obtained points.
2. Click Confirm to return to "User Coordinate System" page, and the coordinates are updated to the
calibrated values. You can view/modify the three-point settings used to generate the coordinate
system, or modify the coordinate system values manually, as described in the steps of modifying user
coordinate system.
45
3. Click Save. The user coordinate system is added successfully.
2. If the values of the selected user coordinate system are saved after manual input, the interface of
Modify page is the same as Add page. You can modify it directly or click Three-point setting to
calibrate it.
3. If the values of the selected user coordinate system are generated by three-point setting, the interface
of Modify page is shown below.
4. Click View three-point settings at the right bottom of the coordinate system values to view the three
point settings used to generate the coordinate system values, and re-obtain the points that need to be
modified.
5. Click Modify to modify the coordinates. Note that after manual modification, you can no longer view
the three-point setting corresponding to the value of the coordinate system before modification.
46
6.2.2 Tool coordinate system
When an end effector such as welding gun or gripper is mounted on the robot, the tool coordinate system is
required for programming and operating a robot. For example, when using multiple grippers to carry
multiple workpieces simultaneously, you can set a tool coordinate system for each gripper to improve the
efficiency.
DobotStudio Pro supports 50 tool coordinate systems, of which the Tool coordinate system 0 is defined as
the base coordinate system by default and cannot be changed.
NOTE
When creating a tool coordinate system, make sure that the reference coordinate system is the base
coordinate system.
The tool coordinate system of six-axis robots is recommended to create by six-point calibration method
(TCP +ZX): After mounting the end effector, adjust the direction of the end effector to make TCP (Tool
Center Point) align with the same point (reference point) in three different directions for obtaining the
position offset of the end effector. Then jog the robot to three other points (④⑤⑥) for obtaining the angle
offset.
47
2. Click \Six point setting\</b>.
NOTE
You can also modify the X, Y, Z, Rx, Ry and Rz values directly and click Save. As the
operation method of four-point setting is similar to that of six-point setting, it will not be
described in details in this section.
3. According to the diagram, control the robot arm to move to the corresponding points and click
\Obtain\</b>.
NOTE
When creating a tool coordinate system, make sure that the reference coordinate system is the
base coordinate system, that is, the tool coordinate system is 0 when you jog the robot. Long
pressing Run To can move the robot to the obtained points.
48
4. Click Confirm to return to "Tool Coordinate System" page, and the coordinates are updated to the
calibrated values. You can view/modify the six-point settings used to generate the coordinate system,
or modify the coordinate system values manually, as described in the steps of modifying user
coordinate system.
2. If the values of the selected tool coordinate system are saved after manual input, the interface of
Modify page is the same as Add page. You can modify it directly or click Six/Four-point setting to
calibrate it.
3. If the values of the selected tool coordinate system are generated by Six/Four-point setting, the
interface of Modify page is shown below.
4. Click View six/four-point settings to view the six/four point setting used to generate the coordinate
system values, and re-obtain the points that need to be modified.
5. Click Modify manually to modify the coordinates. Note that after manual modification, you can no
longer view the six/four-point setting corresponding to the value of the coordinate system before
modification.
49
Select a coordinate system and click \Copy\</b> , and you will create a new coordinate system the same as
the selected one.
50
6.3 Load parameter
To ensure optimum robot performance, it is important to make sure that the load and eccentric coordinates
of the end effector are within the maximum range of the robot, and that Joint 6 does not become eccentric.
Proper setting of load can improve the motion of robot, reduce vibration and shorten the operating time.
NOTE
This page is only used to modify the load parameter group. The modification will not take effect
immediately. To make the modified parameters effective, please select the corresponding parameter
group in the “Load enabling settings” page that pops up when the robot arm is enabled.
Click Add to add a new group of load parameters. Click Modify to modify the selected group of
parameters. Click Delete to delete the selected group of parameters.
The parameter group name can be modified. You can refer to the parameter group using the corresponding
parameter group name when enabling the robot and programming.
51
There are two ways to set load parameters: automatic identification and manual modification.
Automatic identification
When the robot arm is enabled, without alarm and not in motion, the current load parameters of the robot
arm can be automatically identified.
NOTE
The point selected should meet the two following requirements:
1. There are significant differences between the joint angle of each point.
2. The J4 to J6 axes are applied significant forces.
It is recommended to select the first 6 points referring to the diagram on the page (try to make the
robot posture almost similar to the diagram), and select point 7 as any posture not the same as the
first 6 points.
1. Click Confirm. If the identification is successful, the software will return to Add/Modify interface
and the load parameters will be updated to the identified parameters. Please check whether these
parameters are reasonable according to the actual load. If they are not reasonable, please re-identify
the load or modify the parameters manually. If the load failed to be identified, an error message will
pop up and stay on the automatic identification page, In this case please re-obtain the 7 points.
Modify manually
52
Centre offset of X/Y/Z: Offset distance of the load mass centre in each direction. For the direction of
each axis, refer to the diagram on the interface (The diagram above is based on CR series. Please refer
to the actual software interface, and pay attention to the direction of the aviation socket in the
diagram).
The payload includes the weight of the end effector and workpiece, which should not exceed the
maximum load of the robot arm.
NOTICE
Incorrect load settings may cause collision detection anomaly alarms or robot uncontrolled during
dragging.
53
6.4 Motion parameters
The optimal motion parameters have been set before delivery, and are not recommended to be modified
without special requirements. If the working conditions require higher moving speed, small changes are
recommended, otherwise excessive moving speed may shorten the service life of the joints and pose safety
hazards.
NOTE
The robot speed is divided into jog speed and playback speed. The jog motion includes Jog panel jog, TCP
jog and "Run to" function. Other robot automatic motions are all playback motion.
For jog motion, it supports setting the maximum speed and acceleration of joint or Cartesian coordinate
system. For playback motion, it additionally supports setting the maximum jerk.
Example: If the joint speed is 12°/s, and the global speed is 50%, then the actual motion speed is 12°/s x
50% = 6°/s.
Robot actual maximum speed = set speed × global speed × command speed.
Example: If the coordinate system speed is 2000mm/s, the global speed is 50%, and the speed set by the
motion command is 80%, then the actual motion speed is 2000mm/s x 50% x 80% = 800mm/s.
54
Robot actual maximum acceleration/jerk = set maximum acceleration/jerk × command
acceleration/jerk.
Example: If the coordinate system acceleration is 10000mm/s, and the acceleration set by the motion
command is 50%, then the actual motion acceleration is 10000mm/s x 50% = 5000mm/s.
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to its
pre-modified value. Click Restore default value to reset the motion parameter to the factory settings.
55
6.5 Posture settings
Packing posture can reduce the robot space, making it easy to pack and transport.
For home posture, all joints angles are 0.
56
6.6 Trajectory playback
The trajectory playback is used to record and play back the trajectory of the robot arm.
Click New trajectory on the right top corner, and the robot arm will enter the drag mode. Now you can
drag the robot, and the trajectory will be recorded.
After recording the trajectory, click \Save\</b>. The robot arm exits the drag mode, and a new record is
added in the Trajectory file list.
Click \Trajectory playback\</b> to play back the recorded trajectory of the robot. The playback
process can be stopped at any time.
Click Refresh to obtain the latest trajectory file list of the controller.
NOTE
57
The saved trajectory file can be called through relevant playback commands in blockly and script
programming.
Playback times refers to the times that the trajectory is played back after you click \Trajectory
playback\</b>. If the number of times is greater than 1, the robot arm will automatically return to the
starting point of the trajectory after completing a trajectory playback, and then start the next time.
Speed multiplier is only effective when Playback at a uniform speed is unchecked. The robot arm
will play back the trajectory at the recorded speed (not affected by global speed) after isometric
scaling.
After Playback at a uniform speed is checked, the robot arm will play back the trajectory at the
uniform global speed.
58
6.7 Communication settings
Click Modify in the right top corner to modify the communication settings.
IP settings
The robot can communicate with external equipment thourgh the LAN2 interface which supports TCP,
UDP and Modbus protocols. You can modify the IP address, subnet mask and gateway. When the robot is
connected to the external equipment, its IP address must be within the same network segment as that of the
external equipment without conflict.
For CC16X control cabinet (first-generation control cabinet), as there is only one LAN interface (LAN1),
the IP address in this page refers to LAN1 IP. For CCBOX or CC26X (second-generation control cabinet),
there are two LAN interfaces. The IP address in this page refers to LAN1 IP. The default IP address of the
LAN1 interface is 192.168.5.1 for three types of control cabinet.
If the robot is connected directly to an external equipment or via a switch, select Manual to change
the IP address, subnet mask (required when connecting to a combined network with multiple network
segments) and default gateway so that the robot is within the same network segment as the external
equipment.
If the robot is connected to an external equipment via a router, select Obtain automatically (the
router automatically assigns the IP address).
WiFi settings
The robot can communicate with external equipment through WiFi. You can modify the WiFi name and
password and then restart the controller to make it effective (no need to restart for CC26X controller). The
initial password is 1234567890.
59
6.8 Installation settings
If the robot is mounted on a flat table or floor, you do not need to set in this page. However, if the robot is
ceiling mounted, wall mounted or mounted at an angle, you need to set the rotation angle and slop angle in
the disabled status.
NOTE
Manual calibration
You can select a proper installation posture based on the actual condition, or select Custom and adjust the
tilt angle and rotation angle.
Tilt angle is the angle that a robot rotates counterclockwise around X-axis at the origin point.
Rotation angle is the angle that a robot rotates counterclockwise around Z-axis at the origin point.
Automatic calibration
After installing and enabling the robot, click Calibration and operate according to the pop-up box to
obtain the tilt angle and rotation angle.
60
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to
its pre-modified value.
After setting the mounting angle, you need to restart the controller and re-enable the robot arm. Then try
entering the drag mode via the end button of the robot arm to verify whether the drag function works
properly. If not, please reset the mounting angle or contact technical support.
61
6.9 Drag settings
Drag setting is mainly used to adjust the sensitivity of joints during dragging process.
NOTE
You need to enter Manager password to unlock the page.
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to
its pre-modified value.
62
6.10 Security
6.10.1 Collision detection
6.10.2 Safety wall
6.10.3 Initial posture
6.10.4 Joint brake
63
6.10.1 Collision detection
The robot will automatically stop when a collision is detected during its movement. You can set the
sensitivity of the collision detection and the specific handling mode after collision.
NOTE
The higher the collision level you select, the lower the force required to trigger collision detection.
There are differences in the way that the robot handles collision between jogging and automatic running.
The "Collision Detection" window will pop up. In this case, you need to resolve the cause of the collision
and click Reset. If you need to operate the software to resolve the collision cause, you can click Remind
me in a minute to temporarily close the pop-up window (a pop-up message will be displayed again in one
minute).
64
Collision when automatic running
For all handling modes, the robot arm will automatically back off the specified distance along the
trajectory before the collision. The range of the back-off distance is 0~50mm (default: 10mm).
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to
its pre-modified value.
65
6.10.2 Safety wall
DobotStudio Pro supports setting up to 8 safety walls to specify the safety limit space for the robot arm.
When the end of the robot arm (or elbow joint) exceeds the safety limit space, the robot arm triggers
different actions based on the types of safety wall.
NOTE
66
1. Jog or drag the robot arm to P1, and click Get Point to get the coordinates of P1.
2. Get the coordinates of P2 and P3 in the same way. Then click Preview to view the generated safety
wall in the simulation area on the right.
**NOTE**
You can also manually enter the Cartesian coordinates of the three points.
For subsequent changes to the wall type and wall orientation, you also need to click Preview to
update the display of the simulation area.
1. Set the wall type. When the tool sphere at the end of the robot arm (spherical space with a custom
radius centred on the TCP) or the J3 joint (with Elbow limit checked) interferes with the limited area
defined by the safety wall, different actions will be triggered based on the wall types.
Real wall: The robot arm triggers an alarm and stops moving immediately.
Real wall: The robot arm triggers an alarm and stops moving immediately.
Interference zone: The robot arm triggers the specified DO and does not affect the movement.
2. Set the wall direction. You can view the wall direction in the simulation area on the right. The arrow
direction is the safe side of the wall, and the opposite direction is the limited side.
NOTE
The positive direction of the wall is the normal vector of the plane calculated according to the right
hand rule based on the vector direction of P1 -> P2 -> P3.
67
The properties of the safety wall can be modified except **Index**. The signal output is only configurable
for the interference zone. The switch on the right controls whether the safety wall is effective or not. Only
effective safety walls will interfere with the robot arm and be displayed in the simulation area on the right.
Select a safety wall and click **Delete** to delete the safety wall. ### Advanced settings
Effective scope
Effective globally: The safety wall will be triggered when the robot arm is running manually (jog,
step) or automatically (project, trajectory playback). Note that the reduced mode is only effective for
running projects.
Project only: The safety wall is triggered only when the robot arm is running a project.
Specify the radius of the end tool sphere (a spherical space with a custom radius centred on the TCP) that
will trigger the safety wall when it interferes with the restricted area of the safety wall. 0 means that only
the TCP interferes with the limited area.
Elbow limit
When the option is checked, the J3 joint will also interfere with the limited area. When the option is
unchecked, only the end tool ball will interfere with the limited area.
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to its
pre-modified value.
68
6.10.3 Initial posture
The initial posture is a self-defined posture, which is the home posture by default, namely, all joint angles
are 0.
You can enter the angles of all joints, or move the robot to a specified posture and click Get current
posture to obtain the current angles of all joints. Click Restore default posture to recover the initial
posture to the default posture.
After confirming all joint angles, click Save to update the initial posture.
69
6.10.4 Joint brake
When the robot is disabled, all joints will automatically brake to prevent the joints from moving. Joint
brake keeps the motor position locked to ensure that the moving part of the machine will not move due to
its self weight or external force.
NOTE
If you need to drag joints, you can switch on the joint brake function, that is, hold the joint manually after
the robot arm is disabled, switch on the button of the corresponding joint, and click Apply. Click Restore
before clicking Apply to restore the parameter to its pre-modified value.
NOTICE
When switching on the function, be sure to hold the joint with your hand to prevent it from falling.
70
6.11 Operation Mode settings
The robot Manual/Automatic mode switch function, which is switched off by default, can be switched on
in this page.
NOTE
After switching on the operation mode switch function, you can select whether a password is required
when switching from Manual mode to Automatic mode. If you check it, you need to set a password (no
initial password).
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to
its pre-modified value.
When this function is switched on, the manual/automatic mode switch button is displayed on the
information panel of the main page (default to manual mode).
When the robot is not in the status described below, you can switch it to automatic mode. If an automatic
mode password is set, you need to enter the password before switching.
71
Project debug status
Trajectory playback status
Drag status
Joint brake status
In automatic mode, you can click the button to switch the robot to manual mode at any time. If the robot is
in motion when you switch the mode, it will stop moving immediately after the switch, but the enabling
status will remain unchanged.
In manual mode, the global speed of the robot may not be greater than 50% for movements other than jog
movement.
Besides speed, the main differences between manual and automatic modes are whether the inputs for the
remote IO/Modbus control and the safety I/O are effective, as detailed in the table below.
Start X √
Stop X √
Pause X √
Enable √ √
Disable √ √
Clear alarm √ √
Enter drag √ X
Exit drag √ X
Select project X √
Safety I/O
Emergency stop √ √
Protective stop X √
Reduced mode X √
72
6.12 Home calibration
After some parts (motors, reduction gear units) of the robot arm have been replaced or the robot has been
hit, the home posture of the robot will be changed. In this case you need to reset the home posture.
NOTE
Home calibration is used only when the home position changes. Please operate cautiously.
You need to enter Manager password to unlock the page.
Move the robot to the home point (You can calibrate using home point sticker on each joint. See the
corresponding hardware guide for details) according to the prompt on this page. Then click Home
calibrationin the enabled status.
After successful calibration, you need to disable the robot to make the calibration effective. Then you can
check the joint coordinates in Jog panel. Now all joint coordinates (J1-J6) are zero.
73
6.13 Advanced functions
If you need to switch on/off the advanced functions, you can configure them in this page. It is
recommended to keep the default value if you do not have special requirements.
NOTE
Click Apply to save the modification. Click Restore before clicking Apply to restore the parameter to its
pre-modified value.
74
6.14 Power voltage(CCBOX)
When the type of the controller is CCBOX, you need to set the input voltage range of the controller.
Please set according to the actual range of input voltage, with maximum voltage no more than 60V and
minimum voltage no less than 30V.
75
7 Log
This page is used to view the alarms and log of the the robot arm.
Current alarm
If a point is saved incorrectly, for example, a robot moves to where a point is at a limited position or a
singular position, an alarm will be triggered. If an alarm is triggered when a robot is running, you will see a
red dot with number on the upper right of the alarm icon.
When an alarm exists, you will see the alarm level, error code, description and solution on “Current alarm”
page. Please refer to the description and solution to resolve the alarm.
Click Clear alarm to clear the current alarm. For alarms that cannot be cleared directly, please refer to the
alarm solution for details.
History
History page displays the logs of robot operations, which supports filtering by date, keywords and type.
76
Click Export to export the logs to a local path on the computer or to a storage device connected to the
USB port of the control cabinet.
NOTE
If the storage device connected to the USB interface contains multiple partitions, the logs will be
exported to the first partition. For some storage devices (e.g. USB disks used as boot disks) of which
the first partition is hidden partition, the exported logs may not be viewed directly in Windows.
In some cases (e.g. the robot arm is connected to the control software when running automatically) the logs
will not be refreshed automatically, and you need to manually click Refresh to get the latest logs.
Error: Alarms related to error actions of the software or alarm status of the robot.
Warning: Warnings related to abnormal actions of the software or abnormal status of the robot. The
abnormal status does not affect the execution of subsequent actions.
Information: Messages recorded when the robot status changes.
Custom: Messages generated during project running, including logs output via “Log(value)”
command.
77
8 Dobot+
Dobot+ plug-in helps you quickly configure and use Dobot eco-accessories, without performing secondary
development.
Click Install on the right side of the plugin to install it, or click Import to upload a plug-in. After selecting
a plugin, click Unload to unload the plugin.
After the plugin is installed successfully, Install will turn to Open. Click it and the plugin will be opened
in a new page. You can open multiple plugins simultaneously. Different plugins vary in their using
methods. This document does not describe in details.
After adding the plugins, their relevant blocks/commands will also be added in Blockly/Script
programming for controlling the plugin in projects.
78
9 Application
9.1 Application main interface
9.2 Blockly programming
9.3 Script programming
79
9.1 Application main interface
The main page of Application is the entry for the programming and process.
The projects that are opened recently are displayed under Recent projects. Click Open project, and the
Select project window will pop up. refers to blockly projects, and refers to script projects.
80
9.2 Blockly programming
DobotStudio Pro provides blockly programming. You can program through dragging the blocks to control
the robot.
NOTE
This section only introduces the use of blockly programming. For specific description on blocks , see
Appendix B.
No. Description
Display the current project name Click to open File menu, which supports functions
1
including Open, Save As, Import, Export and Transform script. Click to save the
current project.
3 Control the running of the project. See Debug and run project.
Provide blocks used in programming, which are divided into different colours and
4 categories.
Click ? on the right top of the module to view the relevant description on the blocks.
Program editing area. You can drag the blocks to the area to edit a program.
Right-click the block in this area to open the menu, which supports copying blocks,
deleting blocks, and turning a group of blocks (not including Event blocks) into sub-
5 routines.
81
If a block is modified but not saved, you will see on the left side of the block, which
prompts that the block has been modified.
Running log of projects. Click the icon on the far right to unfold or fold the log display
6
area. Click Clear to clear the log display area.
The icons on the right side of the programming area is described below.
Icon Description
82
Back to the top of blocks/Centre blocks/Back to the bottom of blocks.
Drag the block to this icon to delete it. Right-click the block and select Delete Block
to delete it.
Points
Points interface is used to manage the points in programming, as shown below.
No. Description
1 Control the robot to move to the selected point in the specified mode.
Click Add point to save the current point of the robot arm as a new point.
2 After selecting a point, click Cover to overwrite it with the current point.
After selecting a point, click Delete to delete the point.
Point list. After selecting a point, click any value except No. and Point of the point to directly
3
modify the value.
Click Run after saving the project, and the project will enter the running mode. At this time the Run
button turns to Pause button.
Click Pause to pause running the project, and the button changes to Continue. Click Resume to
continue running the project.
Click Stop to stop running the project.
Operation procedure
83
The following example describes the procedure of editing a blockly program to control the robot to move
between two points repeatedly.
1. Open Points page. Move the robot arm to a point (P1), and click Add to save P1.
2. Move the robot arm to a point (P2), and click Add point to save P2.
3. Drag the forever block from the block area and place it under the Start block.
84
9.3 Script programming
Dobot robots provide various APIs, such as motion commands, TCP/UDP commands etc., which use Lua
language for being called in secondary development. DobotStudio Pro provides a programming
environment for Lua scripts. You can write your own Lua scripts to control the operation of robots.
NOTE
This section mainly introduces the use of script programming. For specific description on
commands, seeAppendix C.
No. Description
Display the current project name Click to open File menu, which supports functions
1
including Open, Save As, Import, Export and Transform script. Click to save the
current project.
3 Control the running of the project. See Debug and run project.
85
4
Running log of projects. Click the icon on the far right to unfold or fold the log display
6
area. Click Clear to clear the log display area.
Points
No. Description
1 Control the robot to move to the selected point in the specified mode.
Click Add point to save the current point of the robot arm as a new point.
2 After selecting a point, click Cover to overwrite it with the current point.
After selecting a point, click Delete to delete the point.
Point list. After selecting a point, click any value except No. and Point of the point to directly
3
modify the value.
86
Debug and run project
Click Debug after saving the project, and the project will enter the debug mode. At this time the Debug
button turns to Step button, and you can run the project step by step. The Run button turns to Run to
breakpoint button, and you can debug the breakpoint (Click the line number of the code to set or cancel
the breakpoint).
Click Run after saving the project, and the project will enter the running mode. At this time the Run
button turns to Pause button.
Click Pause to pause running the project, and the button changes to Continue. Click Resume to
continue running the project.
Click Stop to stop running the project.
Operation procedure
The following example describes the procedure of editing a script program to control the robot to move
between two points repeatedly.
1. Open Points page. Move the robot arm to a point (P1), and click Add to save P1.
2. Move the robot arm to a point (P2), and click Add point to save P2.
3. Add a loop command in the programming area.
4. Add a motion command under the loop command, and set P1 as the target point.
5. Add another motion command, and set P2 as the target point.
while(true)
do
MovJ(P1)
MovJ(P2)
end
87
Appendix A Modbus Register Definition
1 Modbus Introduction
Modbus protocol is a serial communication protocol. The robot system can communicate with external
equipment through this protocol. When the robot is controlled through external equipment (such as PLC),
the external equipment serves as the Modbus master, and the robot serves as the slave.
Dobot 6-axis collaborative robots support the following Modbus addresses, according to the Modbus
protocol.
The robot system provides two tables for the access from external equipment. map1 is accessible via port
502 (Modbus-TCP) and port 503 (RTU-over-TCP), and map2 is accessible via port 1502 (Modbus-TCP)
and port 1503 (RTU-over-TCP).
Some of the addresses of map1 are used by the robot system by default, as detailed in the register definition
below. The definition of the coil and contact registers can be modified. Please refer to the actual
configuration shown in "Monitor > Modbus > Settings". map2 is currently empty and can be used
based on your actual requirement.
88
00009~01025 8~1024 Bit Reserved
Number Script
Data Register
PLC address of Byte address Function
address type
values (GetInRegs)
unsigned
31000 1 2 999 U16 data validity
short
unsigned
31002~31004 3 6 1001~1003 U16 Reserved
short
89
31013~31016 uint64 1 8 1012~1015 U64 Robot mode
Memory structure
test standard value
31025~31028 uint64 1 8 1024~1027 U64
0x0123 4567
89AB CDEF
Current
31037~31040 double 1 8 1036~1039 F64 momentum of
robot
Control board
31041~31044 double 1 8 1040~1043 F64
voltage
Target joint
31097~31120 double 6 48 1096~1119 F64
position
Target joint
31145~31168 double 6 48 1144~1167 F64
acceleration
Target joint
31169~31192 double 6 48 1168~1191 F64
current
Actual joint
31217~31240 double 6 48 1216~1239 F64
position
Actual joint
31265~31288 double 6 48 1264~1287 F64
current
90
TCP actual
31313~31336 double 6 48 1312~1335 F64 Cartesian
coordinates
TCP force
31361~31384 double 6 48 1360~1383 F64 (calculate through
joint current)
TCP target
31384~31408 double 6 48 1384~1407 F64 Cartesian
coordinates
TCP target
31409~31432 double 6 48 1408~1431 F64
Cartesian speed
Hand coordinate
31505~31506 char 4 4 1504~1505 U16
system
1506 low
31507 char 1 1 U8 User coordinates
byte
1506 high
31507 char 1 1 U8 Tool coordinates
byte
1508 low
31509 char 1 1 U8 Joint speed ratio
byte
1509 low
31510 char 1 1 U8 Joint jerk ratio
byte
91
31512 char 1 1 1511 high U8 Cartesian position
byte jerk ratio
1512 high
31513 char 1 1 U8 Robot brake status
byte
1513 high
31514 char 1 1 U8 Robot drag status
byte
1514 high
31515 char 1 1 U8 Robot alarm status
byte
1515 low
31516 char 1 1 U8 Robot jog status
byte
1515 high
31516 char 1 1 U8 Robot type
byte
Button board
1518 low
31519 char 1 1 U8 gripper control
byte
signal
x-directional
31589~31592 double 1 8 1588~1591 F64 eccentric distance
(mm)
y-directional
31593~31596 double 1 8 1592~1595 F64 eccentric distance
(mm)
z-directional
92
31597~31600 double 1 8 1596~1599 F64 eccentric distance
(mm)
Trajectory
31649~31652 double 1 8 1648~1651 F64
playback running
Original value of
31653~31676 double 6 48 1652~1675 F64 current six
dimentional force
[qw,qx,qy,qz]
31677~31692 double 4 32 1676~1691 F64
target quaternion
[qw,qx,qy,qz]
31693~31708 double 4 32 1692~1707 F64
actual quaternion
Manual/Automatic
status
unsigned 1: Manual
91709 1 2 1708 U16
short 2: Automatic
0: Mode switch is
off
DI/DO description
DI/DO each occupies 8 bytes. Each byte has 8 bits (binary) and can represent the status of up to 64 ports
each. Each byte from low to high indicates the status of one terminal. 1 indicates the corresponding
terminal is ON, and 0 indicates the corresponding terminal is OFF or no corresponding terminal.
For example, the first byte of DI is 0x01, represented as 00000001 in binary, which from low to high
indicates the status of D1_1~DI_8 respectively, that is, DI_1 is ON and the remaining 7 DIs are OFF.
The second byte is 0x02, represented as 00000010 in binary, which from low to high indicates the status of
D1_9 ~ DI_16 respectively, that is, DI_10 is ON and the remaining 7 DIs are OFF.
Different control cabinets vary in the number of IO terminals. The binary bits exceeding the number of IO
terminals will be filled with 0.
RobotMode description
93
6 ROBOT_MODE_BACKDRIVE Drag mode
Character
Description
No.
Orientation of the elbow joint (J3). 1: upward (forearm is tilted forward relative to
2
upper arm), -1: downward (forearm is tilted back relative to upper arm)
Whether the wrist joint (J5) is flipped (whether joint angle is positive value). 1: not
3
flipped (positive joint angle), -1: flipped (negative joint angle)
4 J6 angle range. -1: [0, -90], -2: [-90, -180], 1: [0, 90], 2: [90, 180] …
94
BrakeStatus description
This byte indicates the brake status of the each joints by bit. 1 means that the corresponding joint brake is
switched on. The bits correspond to the joints in the following table:
Bit 7 6 5 4 3 2 1 0
Example:
RobotType description
Value Model
3 CR3
31 CR3L
5 CR5
95
7 CR7
10 CR10
12 CR12
16 CR16
101 Nova 2
103 Nova 5
113 CR3A
115 CR5A
117 CR7A
120 CR10A
122 CR12A
126 CR16A
130 CR20A
96
Appendix B Blockly Command
B.1 Event
B.2 Control
B.3 Operator
B.4 String
B.5 Custom
B.6 IO
B.7 Motion
B.8 Modbus
B.9 TCP
B.10 Quick start
97
Event
The event commands are used as a mark to start running a program.
Start command
Description: It is the mark of the main thread of a program. After creating a new project, there is a Start
block in the programming area by default. Please place other non-event blocks under the Start block to
program.
Description: It is the mark of the sub-thread of a program. The sub-thread will run synchronously with the
main thread, but the sub-thread cannot call robot control commands. It can only perform variable operation
or I/O control. Please determine whether to use the sub-thread according to the logic requirement.
98
Control
The control blocks are used to control the running path of the program.
Wait until…
Description: The program pauses running, and it continues to run if the parameter is true .
Repeat n times
Description: Embed other blocks inside the block, and the embedded block command will be executed
repeatedly for the specified times.
Repeat continuously
Description: When other blocks are embedded inside this block, the embedded commands will be
End repetition
Description: It is used to be embedded inside the execution-repeating blocks. When the program runs to
this block, it will directly end the repetition and execute the blocks after the execution-repeating block.
99
if…then…
Description: If the parameter is true, execute the embedded block. If the parameter is false, jump directly
to the next block.
Parameter: Use other hexagonal blocks which return a Boolean value (true or false) as the parameter.
if…then…else…
Description: If the parameter is true, execute the embedded blocks before "else". If the parameter is false,
execute the embedded blocks after "else".
Parameter: Use other hexagonal blocks which return a Boolean value (true or false) as the parameter.
Repeat until…
Description: Repeatedly execute the embedded block until the parameter is true.
Parameter: Use other hexagonal blocks which return a Boolean value (true or false) as the parameter.
Set label
Description: Set a label, then you can jump to the label through .
100
Parameter: Label name, which must starts with a letter, and special characters such as spaces cannot be
used.
Goto label
Description: When the program runs to the block, it will jump to the specified label directly and execute
the blocks after the label.
Fold commands
Description: Fold the embedded blocks. It has no control effect but to make the program more readable.
Pause
Description: The program pauses automatically after running to the block. It can continue to run only
through control software or remote control operations.
Description: Set collision detection. The collision detection level set through this block is valid only when
the project is running, and will restore the previous value after the project stops.
Parameter: Select the sensitivity of the collision detection. You can turn it off or select from level 1 to
level 5. The higher the level is, the more sensitive the collision detection is.
101
Description: Modify the specified user coordinate system. The modification is valid only when the project
is running, and the coordinate system will restore the previous value after the project stops.
Parameter:
Description: Modify the specified tool coordinate system. The modification is valid only when the project
is running, and the coordinate system will restore the previous value after the project stops.
Parameter:
Description: Set the user coordinate system used in the current project.
Description: Set the tool coordinate system used in the current project.
Wait
102
Description: Wait specified time before delivering the next command.
103
Operator
The operator commands are used for calculating variables or constants.
Arithmetic command
Parameter:
Fill in both blanks with variables or constants. You can use oval blocks that return numeric values, or
directly enter the value in the blanks.
Select an operator.
Comparison command
Parameter:
Fill in both blanks with variables or constants. You can use oval blocks that return numeric values, or
directly enter values in the blanks.
Select a comparison operator.
Return: It returns true if the comparison result is true, and false if the result is false.
A and B command
Return: It returns true if the two parameters are true, and false if any one of them is false.
A or B xommand
104
Description: Perform or operation to the parameters.
Return: It returns true if any one of the parameters is true, and false if both of them are false.
Not A command
Return: It returns false if the parameter is true, and true if the parameter is false.
Get remainder
Parameter: Fill in both blanks with variables or constants. You can use oval blocks that return numeric
values, or directly fill the value in the blanks.
Round-off operation
Parameter: Fill in the blank with a variable or constant. You can use oval blocks that return numeric
values, or directly fill the value in the blank.
Monadic operation
105
Parameter:
Select an operator.
abs
floor
ceiling
sqrt
sin
cos
tan
asin
acos
atan
ln
loh
e^
10^
Fill in the blank with a variable or constant. You can use oval blocks that return numeric values, or
directly fill the value in the blank.
Description: Output the parameters to the console, which is mainly used for debugging.
Parameter:
Select Sync or Async. For Sync, it will print information after all the commands that have been
delivered are executed. For Async, it will print information immediately when the program runs to the
block.
Variables or constants to be output. You can use oval blocks, or directly fill in the blank.
106
String
The string commands include general functions of string and array.
Parameter:
Description: Determine whether the first string contains the second string.
Parameter: Two strings. You can use oval blocks which return string, or fill in directly.
Return: If the first string contains the second string, it returns true, otherwise it returns false.
Description: Connect two strings into one string. The second string will follow the first string.
Parameter: Two strings to be connected. You can use oval blocks which return string, or fill in directly.
Description: Get the length of the specified string or array. The length of a string refers to how many
characters the string has, and the length of an array refers to how many elements the array has.
107
Parameter: A string or array. You can use oval blocks that return string or array.
Parameter: Two strings to be compared. You can use oval blocks which return string, or fill in directly.
Return: It returns 0 when string 1 and string 2 are equal, -1 when string 1 is less than string 2, and 1 when
string 1 is greater than string 2.
Description: Convert the specified array to a string, and the different array elements in the string are
separated by the specified delimiter. For example, if the array is {1,2,3} and the delimiter is |, then the
converted string is "1|2|3".
Parameter:
An array to be converted to string. You can use oval blocks which return string
Delimiter used in conversion
Description: Convert the specified string to an array, using the specified delimiter to separate strings. For
example, if the array is “1|2|3” and the delimiter is |, then the converted array is {[1]=1,[2]=2,[3]=3}.
Parameter:
A string to be converted to array. You can use oval blocks which return string or fill in directly
Delimiter used in conversion
108
Description: Get the element at the specified subscript position in the specified array. The subscript
represents the position of the element in the array. For example, the subscript of 8 in the array {7,8,9} is 2.
Parameter:
Description: Get multiple elements at the specified subscript position in the specified array. Get the
element based on the step value within the range of the start and end subscripts.
Parameter:
Description: Set the value of the element at the specified position of the array.
Parameter:
109
Custom
The custom commands are used for creating and managing custom blocks, and calling global variables.
Description: Set the value of a specified variable. Please note that the block for setting global variables
and setting custom variables are the same in shape, but have slightly different functions.
Parameter:
Create variables
Click to create a variable. The variable name must start with a letter and cannot contain special characters
such as Spaces. After creating at least one variable, you will see the following variable blocks in the block
list.
Description: The newly created custom number variable (default value: nil) is recommended to be used
after assignment. You can also modify the variable name or delete the variable through the variable drop-
down list.
110
Return: variable value
Description: Set the value of a specified number variable. Please note that the block for setting global
variables and setting custom variables are the same in shape, but have slightly different functions.
Parameter:
Parameter:
Description: The newly created custom string variable (default value: nil) is recommended to be used after
assignment. You can also modify the variable name or delete the variable through the variable drop-down
list.
Parameter:
111
Select a variable to be modified.
Value after modification. You can directly fill the blank with a string.
Create array
Click to create a custom array. The array name must start with a letter and cannot contain special
characters such as Spaces. After creating at least one array, you will see the following array blocks in the
block list.
Custom array
Description: The newly created custom array is an empty array by default. It is recommended to use it
after assignment. Right-click (PC)/long-press (Android or iOS) the block in the block list to modify the
name of the array or delete the array. You can also modify the name of the currently selected array or
delete the array through the array drop-down list in other array blocks. The check box on the left side of the
array block has no use, which can be ignored.
Description: Add a variable to a specified array. The added variable will be the last item of the array.
Parameter:
Variable to be added. You can directly fill the variable in the blank, or use other oval blocks.
Select an array to be modified.
Parameter:
112
Item index. You can directly fill the index in the blank, or use other oval blocks that return numeric
values.
Parameter:
Parameter:
113
Parameter:
Select an array.
Item index. You can directly fill the index in the blank, or use other oval blocks that return numeric
values.
Create function
Click to create a new function. A function is a fixed program segment. You can define a group of blocks
that implement specific functions as a function. Every time you want to use the function, you only need to
call this function with no need to build the same block group repeatedly. A new created function needs to
be declared and defined. After the new function is created successfully, the corresponding function block
will appear in the block list.
1. Declare function
114
In this interface, you need to define the name of the function, and the type, quantity and name of the input
(parameter). The function and parameter names should not contain special characters such as spaces. You
can also add labels to functions, which can be used as comments for functions or inputs.
1. Define function
After completing the function declaration, you will see the definition header block in the programming
area.
You need to program below the header block to define the function.
You can drag out the input in the header block to use in the blocks below, indicating using the input when
actually calling the function as a parameter.
Custom function
Description: The custom function blocks, of which the name and input parameters are defined by the user,
are used to call the defined function. Right-clicking (PC)/long-pressing (App) the block in the block list
can modify the declaration of the function. If you need to delete the function, delete the definition header
block of the function.
115
Create sub-routine
Click to create a new sub-routine. Blockly programming supports embedding and calling sub-routines, and
sub-routines support blockly programming and script programming, with a maximum of two embedded
levels. After the new sub-routine is successfully created, the corresponding sub-routine block will appear in
After selecting Block programming, you will see the sub-routine block programming page. You can
set the sub-routine description and write the subroutine.
116
After selecting Script programming, you will see the sub-routine script programming window. You
can set the sub-routine description and write the subprogram.
Sub-routine
Blockly sub-routine
Script sub-routine
Description: The sub-routine block, which is defined by the user when creating a sub-routine, is used to
call the saved sub-routine. Right-clicking (PC)/long-pressing (App) the block in the block list can modify
or delete the sub-routine.
117
IO
The IO commands are used to manage the input and output of the IO terminals of the robot arm. The value
range of the input and output ports is determined by the corresponding number of terminals of the robot
arm. Please refer to the hardware guide of the corresponding robot arm.
Parameter:
Description: Set the on/off status of digital output port. Please use this block when setting in the sub-
thread.
Parameter:
Description: Set a group of DOs. You can drag the block to the programming area and click to set it.
Parameter:
118
Click + or - to increase or decrease the number of DO
Select DO port index
Select the output status (ON or OFF)
Description: Wait for the specified DI to meet the condition or wait for timeout before executing
subsequent block commands.
Parameter:
Parameter:
119
Select analog output port index.
Analog output value. You can directly enter the value in the blank, or use oval blocks that return
numeric values.
Description: Determine whether the current status of the specified DI meets the condition.
Parameter:
Return: If the current status of the specified DI meets the condition, it returns true, otherwise, it returns
false.
Parameter:
120
Motion
The motion commands are used to control the movement of the robot arm and set motion-related
parameters.
The point parameters can be selected here after being added on the "Points" page of the project. The
motion blocks also support dragging out the default variable block and replacing it with other oval blocks
which return Cartesian point coordinates.
Description: Control the robot to move from the current position to the target point. After dragging the
block to the programming area, click it for advanced settings.
Parameter:
Select a motion mode, including joint motion (MovJ) and linear motion (MovL). For joint motion, the
trajectory is non-linear, and all joints complete the motion simultaneously.
target point
Advanced settings
121
Teaching point: target point of motion
V: velocity rate, range: 1~100. When unchecked, it means that the velocity rate is not set separately
for this command.
Speed: target speed of motion, incompatible with V. (Only supported in linear motion).
The target speed is not affected by the global speed, but limited by the maximum speed in Playback
settings (or the maximum speed after reduction if the robot is in reduced mode), i.e. if the target speed set
by the speed parameter is greater than the maximum speed in Playback settings, then the maximum speed
takes precedence.
Example: If the speed set in MovL is 1000 (less than the maximum speed of 2000 in Playback settings),
the robot will move at a target speed of 1000 mm/s, which is independent of the global speed at this point.
However, if the robot is in reduced mode (assuming a reduction rate of 10%), the maximum speed turns to
200 (less than 1000), and the robot will move at a target speed of 200 mm/s.
122
The parameter will not be described in details in subsequent commands
Accel: acceleration rate, range: 1~100. When unchecked, it means that the acceleration rate is not set
separately for this command.
The maximum acceleration/velocity can be viewed and modified in Playback settings in the software.
Example: If the coordinate system speed set in the control software is 2000mm/s, the global speed is 50%,
and the speed set by the motion command is 80%, then the actual motion speed is 2000mm/s x 50% x 80%
= 800mm/s.
Continuous path (CP): continuous path rate in motion, range: 0~100. See "Set CP ratio" for details.
When unchecked, it means that the continuous path rate is not set separately for this command.
Process I/O setting: the specified DO will be triggered when the robot arm moves to the specified
distance or percentage. When the distance is positive, it means the distance from the starting point;
when the distance is negative, it means the distance from the target point. You can click + below to
add a process IO, and click - on the right to delete the corresponding process IO (at least one is
retained). When unchecked, it means no process I/O will be triggered.
Description: Control the robot arm to move from the current position by a specified offset along the
specified coordinate system. After dragging the block to the programming area, click it for advanced
settings.
Parameter:
Select a motion mode, including relative joint motion (RelMovJ) and relative linear motion
(RelMovL).
type and index of specified coordinate system (user/tool coordinate system)
offset in the X-axis, Y-axis, and Z-axis direction, unit: mm
Advanced settings
V: velocity rate, range: 1~100. When unchecked, it means that the velocity rate is not set separately
for this command.
Speed: target speed of motion, incompatible with V. (Only supported in linear motion).
123
Accel: acceleration rate, range: 1~100. When unchecked, it means that the acceleration rate is not set
separately for this command.
Continuous path (CP): continuous path rate in motion, range: 0~100. See "Set CP ratio" for details.
When unchecked, it means that the continuous path rate is not set separately for this command.
Description: Control the robot to move a specified offset from the current position. After dragging the
block to the programming area, click it for advanced settings.
Advanced settings
V: velocity rate, range: 1~100. When unchecked, it means that the velocity rate is not set separately
for this command.
Accel: acceleration rate, range: 1~100. When unchecked, it means that the acceleration rate is not set
separately for this command.
Continuous path (CP): continuous path rate in motion, range: 0~100. See "Set CP ratio" for details.
When unchecked, it means that the continuous path rate is not set separately for this command.
Arc motion
Description: Control the robot to move from the current position to a target position in an arc interpolated
mode under Cartesian coordinate system. The coordinates of the current position should not be on the
straight line determined by the intermediate point and the end point. After dragging the block to the
programming area, click it for advanced settings.
Parameter:
124
Middle point is an intermediate point to determine the arc.
End point is the target point.
Advanced settings
V: velocity rate, range: 1~100. When unchecked, it means that the velocity rate is not set separately
for this command.
Speed: target speed of motion, incompatible with V.
Accel: acceleration rate, range: 1~100. When unchecked, it means that the acceleration rate is not set
separately for this command.
Continuous path (CP): continuous path rate in motion, range: 0~100. See "Set CP ratio" for details.
When unchecked, it means that the continuous path rate is not set separately for this command.
Circle motion
Description: Control the robot arm to move from the current position in an full-circle interpolated mode,
and return to the current position after moving a specified number of circles. The coordinates of the current
position should not be on the straight line determined by the intermediate point and the end point. After
dragging the block to the programming area, click it for advanced settings.
Parameter:
Advanced settings
V: velocity rate, range: 1~100. When unchecked, it means that the velocity rate is not set separately
for this command.
Speed: target speed of motion, incompatible with V.
Accel: acceleration rate, range: 1~100. When unchecked, it means that the acceleration rate is not set
separately for this command.
Continuous path (CP): continuous path rate in motion, range: 0~100. See "Set CP ratio" for details.
When unchecked, it means that the continuous path rate is not set separately for this command.
Trajectory playback
Description: Control the robot to play back the trajectory. The trajectory should be recorded in Trajectory
playback process.
125
Parameter:
Advanced settings
sample: the sampling interval of the trajectory points, i.e. the sampling time differences between two
adjacent points when generating the trajectory file. range: [8, 1000], unit: ms, 50 by default (the
sample interval when the controller records the trajectory file).
freq: The smaller the value of this parameter, the smoother the playback trajectory curve is, but the
more severe the distortion relative to the original trajectory. Please set the appropriate filter coefficient
according to the smoothness of the original trajectory. range: (0,1], 1 refers to turning off filtering, 0.2
by default.
user: user coordinate system index corresponding to the trajectory point (use the user coordinate
system index recorded in the trajectory file if not specified)
tool: tool coordinate system index of the target point (use the tool coordinate system index recorded in
the trajectory file if not specified)
Set CP ratio
Description: Set the continuous path ratio in motion, that is, when the robot moves from the starting point
to the end point via the intermediate point, whether it passes the intermediate point through right angle or
in curve, as shown below. The CP transition curve will be affected by the motion speed/acceleration. Even
if the point and CP values are the same, the curvature of the transition curve will vary due to different
motion speed/acceleration. The value is 0 by default when it is not set.
126
Note that continuous path will affect the timing of the IO signal output between two motion commands. If
you want to output the IO signal when the robot arm reaches exactly the target point, set the continuous
path rate of the command to 0.
Description: Set the speed ratio of joint motion. The settings take effect only in the current project.
Parameter: joint speed ratio, range: 0~100. Actual robot speed = percentage set in blocks × speed in
playback settings × global speed ratio.
127
Description: Set the acceleration ratio of joint motion. The settings take effect only in the current project.
Parameter: joint acceleration ratio, range: 0~100. Actual robot acceleration = percentage set in blocks ×
acceleration in playback settings × global speed ratio.
Description: Set the speed ratio of lineal and arc motion. The settings take effect only in the current
project.
Parameter:
Linear and arc speed ratio (value range: 0~100). Actual robot speed = percentage set in blocks ×
speed in playback settings × global speed ratio.
Description: Set the acceleration ratio of lineal and arc motion. The settings take effect only in the current
project.
Parameter:
Linear and arc acceleration ratio (value range: 0~100). Actual robot acceleration = set ratio × value in
playback settings in software × global speed ratio.
Modify coordinates
Description: Modify the value of the specified point in the specified Cartesian coordinate axis.
Parameter:
Select a point.
Select a coordinate axis.
Set coordinate value.
128
Get coordinates
Description: Get the value of the specified point in the specified Cartesian coordinate axis.
Parameter:
129
Modbus commands
The Modbus commands are used for operations related to Modbus communication.
Description: Create Modbus master, and establish the connection with slave.
Parameter:
Return: It returns 0 if the Modbus master is created successfully, and 1 if the Modbus master failed to be
created.
Description: Wait for the value of the specified address of input register to meet the condition before
executing the next command.
Parameter:
130
Wait for holding register
Description: Wait for the value of the specified address of holding register to meet the condition before
executing the next command.
Parameter:
Description: Wait for the value of the specified address of discrete input register to meet the condition
before executing the next command.
Parameter:
Address: Starting address of the discrete input registers. Value range: 0~4095.
condition that the value is required to meet
Description: Wait for the value of the specified address of input register to meet the condition before
executing the next command.
Parameter:
131
Description: Get the value of the specified address of input register.
Parameter:
Parameter:
Description: Get the value of the specified address of discrete input register.
Parameter: Starting address of the discrete input register. Value range: 0~4095
132
Description: Get the value of the specified address of coil register.
Parameter:
Return: coil register values stored in table. The first value in table corresponds to the value of coil register
at the starting address.
Parameter:
Return: holding register values stored in table. The first value in table corresponds to the value of holding
register at the starting address.
133
Parameter:
Parameter:
Parameter:
Description: Close the Modbus master, and disconnect from all slaves.
134
TCP commands
The TCP commands are used for operations related to TCP.
Connect SOCKET
Description: Create a TCP client to communicate with the specified TCP server.
Parameter:
Select the SOCKET index (4 TCP communication links at most can be established).
IP address of TCP server.
TCP server port.
Create SOCKET
Description: Create a TCP server to wait for connection from the client.
Parameter:
135
1501, 1502, 1503, 4840, 8172, 9527,
Close SOCKET
Get variables
Parameter:
Socket index
variable type: string or number.
name is used for saving received variables, using created variable blocks
waiting time: if the waiting time is 0, it will wait until it gets variables.
Send variables
Parameter:
136
Socket index
data to be sent. You can use oval blocks that return string or numeric values, or directly fill in the
blank.
Return: It returns 0 if the variable is sent, and 1 if the variable failed to be sent
137
Quick start
Control robot movement
Read and write Modbus register data
Transmit data by TCP communication
138
Control robot movement
Scene description
In order to experience how to control the movement of the robot arm through blockly programming, you
can assume the following scene:
When the controller DI1 is ON, the robot moves from P1 to P2 in a linear mode, moves to P4 via P3 in a
arc mode, and then returns along the same way. When the controller DI1 is OFF, the robot arm does not
move.
1. The robot arm moves to the starting point through joint motion (P1).
139
2. Set an unconditional loop to make subsequent commands cycle while the program is running.
3. Judge whether the controller DI1 is ON. The subsequent program wil be executed only when the
controller DI1 is ON. Otherwise, it will directly enter the next loop and reacquire the status of DI1.
4. The robot arm moves to P2 in the linear mode.
5. The robot arm moves to P4 via P3 through the arc motion.
6. The robot arm moves to P2 via P3 through the arc motion (return along the same way).
7. The robot arm moves to P1 in the linear mode, and then enters the next loop (return to Step 3).
Run program
Run the program after teaching the points and programming. You can set the status of DI1 through virtual
DI in the IO panel.
140
Read and write Modbus register data
Scene description
To experience how to read and write Modbus data through blockly programming, you can assume the
following scene:
Create a Modbus master for the robot. Connect to the external slave and read the address from the specified
coil register. If the value is 1, the robot moves to P1.
1. Create the master station. Set the IP address to the slave address, and the port and ID to the default
values. In this demo the IP is set to robot address, as the robot slave is used here for quick verification.
2. Determine whether the master station is created successfully. The subsequent steps will be executed only
if the creation is successful, otherwise, the program will end directly.
3. If the value of coil register 0 of the robot has been modified, it may affect the subsequent program. So
you need to set the value of coil register 0 to 0 first.
4. Wait for the value of coil register 0 to change to 1.
5. Control the robot to move to P1, which is a user-defined point.
6. Close the master station.
141
2. Move the robot to a point other than P1 (for observing whether the robot executes the motion
command). Then save and run the program.
3. After you see "Create Modbus Master Success" in the running log, select Active in the debug tool, and
modify Network Address and Port.
4. Modify Slave ID Function Code to Write Single coil, and modify Data of Resister 0 to 1. Then click
Send.
5. Observe whether the robot moves to P1.
The figure below shows the interface of the debug tool. The marked numbers correspond to the steps
above.
142
Transmit data by TCP communication
Scene description
To experience how to perform TCP communication through blockly programming, you can assume the
following scene:
Create a TCP server for the robot. Wait for the client to connect to the server and send "go" command.
Then the server returns "Go to P1" message and the robot starts to move to P1.
1. Create the TCP server (Socket 1). Set the IP (robot IP) and port (custom) .
2. Determine whether the TCP server is created successfully. The subsequent steps will be executed only
if the creation is successful, otherwise, the program will end directly.
143
3. Wait for the client to connect and send the string. Save the received string to the string variable
"tcp_recv". You need to create the string variable in advance.
4. Determine whether the received string includes "go". if it does, execute step 5 and 6. Otherwise,
execute step 7 directly.
5. Send the string "Go to P1" to the client.
6. Control the robot to move to P1, which is a user-defined point.
7. Close the TCP server.
Run program
If you need to run the program quickly, you can use the debug tool of DobotStudio Pro as the TCP client.
1. Open the debug tool and enter "Net Tool" > "TCP Client" page.
2. Move the robot to a point other than P1 (for observing whether the robot executes the motion
command). Then save and run the program.
3. After you see "Create TCP Server Success" in the running log, modify the IP address and port of the
server in DebugTools page, and click Connect.
4. After the connection is successful, enter "go" at the bottom of DebugTools page and click Send.
5. Observe whether the debug tool receives the "Go to P1" message and whether the robot moves to P1.
The figure below shows the interface of the debug tool. The marked numbers correspond to the steps
above.
144
145
Appendix C Script Command
C.1 Lua basic grammar
C.2 Motion command
C.3 Relative motion command
C.4 Motion parameter
C.5 IO
C.6 Tool
C.7 TCP&UDP
C.8 Modbus
C.9 Program control
C.10 SafeSkin
146
Basic grammar
Variable and data type
Operator
Process control
147
Variable and data type
If you want to learn related knowledge of Lua programming systematically, please search for Lua
tutorials on the Internet. This guide only lists some of the basic Lua syntax for your quick reference.
Variables are used to store values and pass values as parameters or return values as results. Variables are
assigned by "=".
Variables in Lua are global variables by default unless explicitly declared as local variables using "local".
The local variables works from the declaration location to the end of the code block in which they are
located.
a = 5 -- global variable
local b = 5 -- local variable
Variable names can be a string made up of letters, underscores and numbers, which cannot start with a
number. The keywords reserved by Lua cannot be used as a variable name.
For Lua variables, you do not need to define their types. After you assign a value to the variable, Lua will
automatically judge the type of the variable according to the value.
Lua supports a variety of data types, including number, boolean, string and table. The array in Lua is a type
of table.
There is also a special data type in Lua: nil, which means void (without any valid values). For example, if
you print an unassigned variable, it will output a nil value.
Number
The number in Lua is a double precision floating-point number and supports various operations. The
following formats are all regarded as a number:
2
2.2
0.2
2e+1
0.2e-1
7.8263692594256e-06
Boolean
The boolean type has only two optional values: true and false. Lua treats false and nil as false, and others
as true including number 0.
String
148
A string can be made up of digits, letters, and underscores. A string can be represented in three ways:
When performing arithmetic operations on a string of numbers, Lua attempts to convert the string of
numbers into a number.
Function Description
Example:
149
str = "Lua"
print(string.upper(str)) --Convert to uppercase letters, and print the result: LUA
print(string.lower(str)) --Convert to lowercase letters, and print the result: lua
print(string.reverse(str)) --The string is reversed, and print the result: aul
print(string.len("abc")) --Calculate the length of the string abc, and print the result:
3
print(string.format("the value is: %d",4)) --Print the result: the value is:4
print(string.rep(str,2)) --Copy the string twice and print the result: LuaLua
string1 = "cn."
string2 = "dobot"
string3 = ".cc"
print("Connect strings: ",string1..string2..string3) --Use..to connect strings, and print t
he result: Connect strings: cn.dobot.cc
string1 = [[aaaa]]
print(string.gsub(string1,"a","z",3)) --Replace in a string, and print the result: zz
za
print(string.find("Hello Lua user", "Lua", 1)) --Search for Lua in the string, return the s
tarting and ending index of the substring, and print the result: 7, 9
sourcestr = "prefix--runoobgoogletaobao--suffix"
sub = string.sub(sourcestr, 1, 8) --Get the first to eighth characters of the st
ring
print("\n result", string.format("%q", sub)) --Print: result "prefix--"
Table
The simplest way to create a table is using {}, which creates an empty table. This method initializes
the table directly.
A table is actually an associative array. The index of an array can be any type of value except nil.
The size of a table is not fixed and can be expanded as required.
The symbol "#" can be used to obtain the length of a table.
Function Description
table.concat
"concat" is the abbreviationn of "concatenate". The table.concat () function lists all
(table [, sep [,
elements of the specified array from start to end, separated by the specified
start [,
separator (sep)
end]]])
table.insert
Insert an element at the specified position (pos) in the table. pos is an optional
(table, [pos,]
parameter, which defaults to the end of the table.
value)
150
Return the element in the table at the specified position (pos). The element that
table.remove
follows will be moved forward. pos is an optional parameter and defaults to the
(table [, pos])
table length, that is, deleting from the last element.
table.sort
(table [, The elements in the table are sorted in an ascending order.
comp])
Example 1:
print("The last element is",fruits[5]) --print the result: The last element is mango
table.remove(fruits)
print("The last element after removal is ",fruits[5]) --Print the result: The last element a
fter removal is nil
Example 2:
fruits = "banana","orange","apple","grapes"}
print("Before")
for k,v in ipairs(fruits) do
print(k,v) --Print the result: banana orange apple grapes
end
--In ascending order
table.sort(fruits)
print("After")
for k,v in ipairs(fruits) do
print(k,v) --Print the result: apple banana grapes orange
end
Array
An array is a collection of elements of the same data type arranged in a certain order. It can be one-
dimensional or multidimensional. The index of an array can be represented using an integer, and the size of
the array is not fixed.
151
One-dimensional array: The simplest array, of which the logical structure is a linear table.
Multi-dimensional array: An array contains an array, or the index of a one-dimensional array
corresponds to an array.
Example 1: One-dimensional array can be assigned or read through the for loop command. An integer
index is used to access an array element. If the index has no value, the array returns nil.
In Lua, array indexes start with 1 or 0. Alternatively, you can use a negative number as an index of an
array.
array = {}
for i= -2, 2 do
array[i] = i*2+1 --Assign values to a one-dimensional array
end
for i = -2,2 do
print(array[i]) --Print the result: -3 -1 1 3 5
end
-- initialize an array
array = {}
for i=1,3 do
array[i] = {}
for j=1,3 do
array[i][j] = i*j
end
end
-- Access an array
for i=1,3 do
for j=1,3 do
print(array[i][j]) --Print the result: 1 2 3 2 4 6 3 6 9
end
end
152
Operator
Arithmetic Operator
Command Description
+ Addition
- Subtraction
* Multiplication
// Floor division
% Remainder
^ Exponentiation
\ OR operator
~ XOR operator
Example
a=20
b=5
print(a+b) --Print the results for a plus b: 25
print(a-b) --Print the result of a minus b: 15
print(a*b) --Print the result of a times b: 100
print(a/b) --Print the result of a divided by b: 4
print(a//b) --Print the result of a divisible by b: 4
print(a%b) --Print the remainder of a divided by b: 0
print(a^b) --Print the results for the b-power of a: 3200000
print(a&b) --Print the results of a And b: 4
print(a|b) --Print the results of a OR b: 21
print(a~b) --Print the results of a XOR b: 17
print(a<<b) --Print the result of a shift left b: 640
print(a>>b) --Print the result of a shift right b: 0
Relational Operator
Command Description
== Equal
153
~= Not equal
Example
a=20
b=5
print(a==b) --Determine whether a is equal to b:false
print(a~=b) --Determine whether a is not equal to b:true
print(a<=b) --Determine whether a is less than or equal to b:false
print(a>=b) --Determine whether a is greater than or equal to b:true
print(a<b) --Determine whether a is less than b:false
print(a>b) --Determine whether a is greater than b:true
Logical Operator
Command Description
Logical AND operator, the result is true if both sides are true, and false if either side
and
is false
or Logical OR operator, the result is true if one side is true, or false if either side is false
not Logical NOT operator, that is, the judgment result is directly negative
Example
a=true
b=false
print(a and b) --True and false, the result is false
print(a or b) --True or false, the result is true
print(20 > 5 not true) --True and untrue, the result is false
154
Process control
Command Description
if…then…
Conditional command (if). Determine whether the conditions are valid from top to
elseif…
bottom. If a condition judgment is true, the corresponding code block is executed, and
then…
the subsequent condition judgments are directly ignored and no longer executed
else…end
Loop command (while). When the condition is true, the corresponding code block is
while…
executed repeatedly. The condition is checked for true before the code block is
do…end
executed
for…do… Loop command (for). The specified statement is executed repeatedly. The repetition
end times can be set in the for statement
repeat… Loop command (repeat). The code block is executed repeatedly until the specified
until() condition is true
Example
a = 100;
b = 200;
--[ Check conditions --]
if(a == 100)
then
--[Execute the following code if the condition is true--]
if(b == 200)
then
--[Execute the following code if the condition is true--]
print("This is a: ", a );
print("This is b: ", b );
end
end
a=10
while( a < 20 )
do
print("This is a: ", a)
a = a+1
end
for i=10,1,-1 do
155
print(i)
end
a = 10
repeat
print("This is a: ", a)
a = a + 1
until(a > 15)
156
Motion
Command list
The motion commands are used to control the movement of the robot arm.
Command Function
General description
Point parameters
All point parameters in this document support three expressions unless otherwise specified.
Joint variable: describe the target point using the angle of each joint (j1~ j6) of the robot arm.
Posture variable: describe the spatial position of the target point in the user coordinate system using
Cartesian coordinates (x, y, z), and describe the rotation angle of the tool coordinate system relative to
the user coordinate system when the TCP (Tool Center Point) reaches a specified point.
The rotation order when calculating the Euler angle of Dobot robot is X->Y->Z, and each axis rotates
around a fixed axis (user coordinate system), as shown below (rx=γ, ry=β, rz=α).
157
Once the rotation order is determined, the rotation matrix (cα is short for cosα, sα is short for sin α,
and so on)
The posture of the end of robot arm can be calculated through the equation.
Taught point: the points obtained through hand-guiding using the software are saved as constants in
the following format.
{
name = "name",
joint = {j1, j2, j3, j4, j5, j6},
tool = index,
user = index,
pose = {x, y, z, rx, ry, rz}
}
158
pose: posture variable value of taught point
The "user" and "tool" in the optional parameters are used to specify the user and tool coordinate systems
for the target point. Now the coordinate system can be specified only through the index, and the
corresponding coordinate system needs to be added in the software first.
1. Coordinate system specified by the optional parameter. If the target point is a taught point, use the
user coordinate system in the taught point constant.
2. Coordinate system index of the taught point.
3. If the target point is a joint variable or a posture variable, use the global coordinate system set in the
motion parameters (See User and Tool commands for details. The default coordinate system is 0 when
no command is called).
Speed parameters
1. The "a" and "v" in the optional parameters are used to specify the acceleration and velocity rate when
the robot arm executes motion commands.
The maximum acceleration/velocity can be viewed and modified in Playback settings in the software.
When the motion acceleration/velocity rate is not specified through the optional parameters, the value
set in the motion parameter is used by default (see VelJ, AccJ, VelL, AccL commands for details).
Example: If the coordinate system speed set in the control software is 2000mm/s, the global speed is
50%, and the speed set by the motion command is 80%, then the actual motion speed is 2000mm/s x
50% x 80% = 800mm/s.
1. The "speed" in the optional parameter of linear and arc motion commands is used to specify the target
speed when the robot executes the command.
The target speed is not affected by the global speed, but limited by the maximum speed in Playback
settings (or the maximum speed after reduction if the robot is in reduced mode), i.e. if the target speed set
by the speed parameter is greater than the maximum speed in Playback settings, then the maximum speed
takes precedence.
Example: If the speed set in MovL is 1000 (less than the maximum speed of 2000 in Playback settings),
the robot will move at a target speed of 1000 mm/s, which is independent of the global speed at this point.
However, if the robot is in reduced mode (assuming a reduction rate of 10%), the maximum speed turns to
200 (less than 1000), and the robot will move at a target speed of 200 mm/s.
159
Continuous path parameters
When the robot arm moves through multiple points continuously, it can pass through the intermediate point
through a smooth transition so the robot arm will not turn too bluntly.
The "cp" or "r" in the optional parameters are used to specify the continuous path rate (cp) or continuous
path radius (r) between the current and the next motion commands. The two parameters are mutually
exclusive. If both exist, r takes precedence.
Note: Joint motion related commands do not support setting the continuous path radius (r). See the
optional parameters of each command for details.
When setting the continuous path rate, the system will automatically calculate the curvature of the
transition curve. The larger the CP value, the smoother the curve, as shown in the figure below. The CP
transition curve will be affected by the motion speed/acceleration. Even if the point and CP values are the
same, the curvature of the transition curve will vary due to different motion speed/acceleration.
When setting the continuous path radius, the system will calculate the transition curve according to the
specified radius with the transition point as the center of the circle. The R transition curve is not affected by
the motion speed/acceleration, but determined by the point and continuous path radius.
If the continuous path radius is set too large (more than the distance between the start/end point and the
intermediate point), the system will automatically calculate the transition curve using half of the shorter
distance between the start/end point and the transition point as the continuous path radius.
160
When the continuous path rate and radius are not specified in the optional parameters, the continuous path
rate set in the motion parameter is used by default (See CP command for details. The default value is 0
when no command is called).
Note that continuous path will affect the timing of the IO signal output between two motion commands. If
you want to output the IO signal when the robot arm reaches exactly the target point, set the continuous
path rate of the command to 0.
MovJ
Command:
Description:
Move from the current position to the target position through joint motion. The trajectory of joint motion is
not linear, and all joints complete the motion at the same time.
Required parameter:
161
Optional parameter:
Example:
MovJ(P1)
The robot moves to P1 through joint motion with the default setting.
The robot moves to the specified posture through joint motion with the default setting.
MovL
Command:
Description:
Move from the current position to the target position in a linear mode.
Required parameter:
Optional parameter:
Example:
MovL(P1)
162
The robot arm moves to P1 in a linear mode with the default setting.
The robot moves to the specified posture in a linear mode with the default setting.
Arc
Command:
Description:
Move from the current position to the target position in an arc interpolated mode.
As the arc needs to be determined through the current position, P1 and P2, the current position should not
be in a straight line determined by P1 and P2.
Required parameter:
Optional parameter:
Example:
MovJ(P1)
Arc(P2,P3)
The robot moves to P1, and then moves to P3 via P2 in an arc interpolated mode.
Circle
Command:
163
Description:
Move from the current position in a circle interpolated mode, and return to the current position after
moving specified circles.
As the circle needs to be determined through the current position, P1 and P2, the current position should
not be in a straight line determined by P1 and P2, and the circle determined by the three points cannot
Required parameter:
Optional parameter:
Example:
MovJ(P1)
Circle(P2,P3,1)
The robot arm moves to P1, and then moves a full circle determined by P1, P2 and P3.
MovJIO
164
Command:
Description:
Move from the current position to the target position through joint motion, and set the status of digital
output port when the robot is moving.
Required parameter:
P: target point
Digital output parameters: Set the specified DO to be triggered when the robot arm moves a specified
distance or percentage. You can set multiple groups, each of which contains the following parameters:
Mode: trigger mode. 0: distance percentage; 1: distance value. The system will synthesise the
joint angles into an angular vector and calculate the angular difference between the end point and
the start point as the total distance of the motion.
Distance: specified distance/angle
If Distance is positive, it refers to the percentage/angle away from the starting point
If Distance is negative, it refers to the percentage/angle away from the target point
If Mode is 0, Distance refers to the percentage of total angle. range: (0,100]
If Mode is 1, Distance refers to the angle value. unit: °
Index: DO index
Status: DO status. 0/OFF: no signal; 1/ON: with signal
Optional parameter:
Example:
The robot arm moves towards P1 with the default setting. When it moves to 30% distance away from the
starting point, set DO2 to ON.
165
MovJIO(P1, {1, -15, 3, 0})
The robot arm moves towards P1 with the default setting. When it moves to 15° away from the starting
point, set DO3 to OFF.
MovLIO
Command:
166
MovLIO(P,{ {Mode,Distance,Index,Status},{Mode,Distance,Index,Status}...},{user = 1, tool = 0,
a = 20, v = 50, cp = 100, r = 5})
Description:
Move from the current position to the target position in a linear mode, and set the status of digital output
port when the robot is moving.
Required parameter:
P: target point
Digital output parameters: Set the specified DO to be triggered when the robot arm moves a specified
distance or percentage. You can set multiple groups, each of which contains the following parameters:
Mode: trigger mode. 0: distance percentage; 1: distance value
Distance: specified percentage/distance
If Distance is positive, it refers to the percentage/distance away from the starting point
If Distance is negative, it refers to the percentage/distance away from the target point
If Mode is 0, Distance refers to the percentage of total distance. range: (0,100]
If Mode is 1, Distance refers to the distance value. unit: mm
Index: DO index
Status: DO status. 0/OFF: no signal; 1/ON: with signal
Optional parameter:
Example:
The robot moves towards P1 with the default setting. When it moves 30% distance away from the starting
point, set DO2 to ON.
The robot moves towards P1 with the default setting. When it moves 15mm away from the starting point,
set DO3 to OFF.
167
StartPath
Command:
StartPath(string, {multi = 1, isConst = 0, sample = 50, freq = 0.2, user = 0,tool = 0})
Description:
Play back the recorded trajectory in the specified trajectory file. You need to run the robot to the starting
point of the trajectory when calling this command.
Required parameter:
Optional parameter:
multi: speed multiplier in playback, valid only when isConst=0. range: [0.1, 2], 1 by default.
isConst: if or not to reproduce at a constant speed. The default value is 0.
1 means the trajectory will be reproduced at the global rate at a uniform rate by the arm;
0 means the trajectory will be reproduced at the same speed as when it was recorded, and the
motion speed can be scaled equivalently using the multi parameter, where the motion speed of
the arm is not affected by the global rate.
sample: the sampling interval of the trajectory points, i.e. the sampling time differences between two
adjacent points when generating the trajectory file. range: [8, 1000], unit: ms, 50 by default (the
sample interval when the controller records the trajectory file).
freq: The smaller the value of this parameter, the smoother the playback trajectory curve is, but the
more severe the distortion relative to the original trajectory. Please set the appropriate filter coefficient
according to the smoothness of the original trajectory. range: (0,1], 1 refers to turning off filtering, 0.2
by default.
user: user coordinate system index corresponding to the trajectory point (use the user coordinate
system index recorded in the trajectory file if not specified)
tool: tool coordinate system index of the target point (use the tool coordinate system index recorded in
the trajectory file if not specified)
Example:
168
After moving to the start point of the "track.csv" file, the robot plays back the trajectory recorded in the file
at 2 times the original speed.
After moving to the start point of the "track.csv" file, the robot plays back the trajectory recorded in the file
at the uniform speed.
GetPathStartPose
Command:
GetPathStartPose(string)
Description:
Get the start point of the trajectory. The type of point data (taught point/joint/posture) may be different
according to the trajectory files.
Required parameter:
Example:
Get the start point of the "track.csv" file and print it.
169
Relative Motion
Command list
The relative motion commands are used to control the movement of the robot arm. Please read the General
description before using the commands.
Command Function
RelMovJTool Move relatively through joint motion along tool coordinate system
RelMovJUser Move relatively through joint motion along user coordinate system
RelPointUser
Command:
Description:
Displace the specified point under the specified user coordinate system, and return the posture variable
after offset.
Required parameters:
P: point to be displaced.
{OffsetX, OffsetY, OffsetZ, OffsetRx, OffsetRy, OffsetRz}: Specify the offset in the user coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
If the specified point is a taught point, the offset is based on the user coordinate system of the
taught point.
If the specified point is a joint variable or a posture variable, the offset is based on the global user
coordinate system.
Return:
170
Posture variable after offset: {pose = {x, y, z, rx, ry, rz}}
Example:
Displace P1 by a specified distance under the specified user coordinate system, and then move to the point
after the offset.
RelPointTool
Command:
Description:
Displace the specified point under the specified tool coordinate system, and return the posture variable
after offset.
Required parameters:
P: point to be displaced.
{OffsetX, OffsetY, OffsetZ, OffsetRx, OffsetRy, OffsetRz}: Specify the offset in the tool coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
If the specified point is a taught point, the offset is based on the tool coordinate system of the
taught point.
If the specified point is a joint variable or a posture variable, the offset is based on the global tool
coordinate system.
Return:
Example:
Displace P1 by a specified distance under the specified tool coordinate system, and then move to the point
after the offset.
RelMovJTool
171
Command:
Description:
Move from the current position to the target position relatively through joint motion. The trajectory of joint
motion is not linear, and all joints complete the motion at the same time.
Required parameters:
{x, y, z, rx, ry, rz}: offset of the target point relative to the current position in the specified tool coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
Optional parameters:
Example:
The robot arm moves relatively to the target point through joint motion in the global tool coordinate system
with the default setting.
RelMovLTool
Command:
RelMovLTool({x, y, z, rx, ry, rz}, {user = 1, tool = 0, a = 20, v = 50, cp = 100, r = 5})
Description:
Move relatively in the specified tool coordinate system through linear motion.
Required parameters:
{x, y, z, rx, ry, rz}: offset of the target point relative to the current position in the specified tool coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
Optional parameters:
172
tool: tool coordinate system index of the target point
a: acceleration rate, range: (0,100]
v: velocity rate, range: (0,100]
speed: target speed, incompatible with v. range: [1,maximum motion speed], unit: mm/s
cp: continuous path rate, incompatible with r. range: [0,100]
r: continuous path radius, incompatible with cp. range: [0,100], unit: mm
Example:
The robot arm moves relatively to the target point through linear motion in the global tool coordinate
system with the default setting.
RelMovJUser
Command:
Description:
Move relatively from the current position in the specified user coordinate system through joint motion. The
trajectory of joint motion is not linear, and all joints complete the motion at the same time.
Required parameters:
{x, y, z, rx, ry, rz}: offset of the target point relative to the current position in the specified user coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
Optional parameters:
Example:
The robot arm moves relatively to the target point through joint motion in the global user coordinate
system with the default setting.
173
RelMovLUser
Command:
RelMovLUser({x, y, z, rx, ry, rz}, {user = 1, tool = 0, a = 20, v = 50, cp = 100, r = 5})
Description:
Move relatively from the current position in the specified tool coordinate system through linear motion.
Required parameters:
{x, y, z, rx, ry, rz}: offset of the target point relative to the current position in the specified tool coordinate
system. x, y, z represent the spatial offset, unit: mm; rx, ry, rz represent the angular offset, unit: °
Optional parameters:
Example:
The robot arm moves relatively to the target point through linear motion in the global user coordinate
system with the default setting.
RelJointMovJ
Command:
Description:
Move from the current position to the specified joint offset angle through joint motion.
Required parameters:
{Offset1, Offset2, Offset3, Offset4, Offset5, Offset6}: J1~J6 offset in the joint coordinate system, unit: °
174
Optional parameters:
Example:
RelJointMovJ({20,20,10,0,10,0})
The robot arm moves to the offset angle through joint motion with the default setting.
RelJoint
Command:
Description:
Displace the specified point under the specified joint coordinate system, and return the joint variable after
offset.
Required parameters:
P: point to be displaced
Offset1~Offset6: J1~J6 offset in the joint coordinate system, unit: °
Return:
Joint variable after offset: {joint = {j1, j2, j3, j4, j5, j6}}
Example:
Displace P1 by a specified angle along J1~J6 axes, and then move to the point after the offset.
175
Motion parameters
Command list
The motion parameters are used to set or obtain relevant motion parameters of the robot.
Command Function
CP
Command:
CP(R)
176
Description:
Set the continuous path (CP) rate, that is, when the robot arm moves continuously via multiple points,
whether it transitions at a right angle or in a curved way when passing through the intermediate point.
The CP rate set in this command is only valid in the current project, and it is 0 by default when not set.
Required parameter:
Example:
CP(50)
Move(P1)
Move(P2)
Move(P3)
The robot moves from P1 to P3 via P2 with 50% continuous path rate.
VelJ
Command:
VelJ(R)
Description:
The velocity rate set in this command is only valid in the current project, and it is 100 by default when not
set.
Required parameter:
177
Example:
VelJ(20)
MovJ(P1)
AccJ
Command:
AccJ(R)
Description:
The acceleration rate set in this command is only valid in the current project, and it is 100 by default when
not set.
Required parameter:
Example:
AccJ(50)
MovJ(P1)
VelL
Command:
VelL(R)
Description:
The velocity rate set in this command is only valid in the current project, and it is 100 by default when not
set.
Required parameter:
178
R: velocity rate, range: [1,100]
Example:
VelL(20)
MovL(P1)
AccL
Command:
AccL(R)
Description:
The acceleration rate set in this command is only valid in the current project, and it is 100 by default when
not set.
Required parameter:
Example:
AccL(50)
MovL(P1)
SpeedFactor
Command:
SpeedFactor(ratio)
Description:
179
Example: If the joint velocity set in the software is 12°/s and the global rate is 50%, then the actual jog
velocity is 12°/s × 50% = 6°/s.
Actual robot acceleration/velocity in playback = rate set in motion commands × value in Playback
settings × global rate.
Example: If the coordinate system velocity set in the software is 2000mm/s, the global rate is 50% and the
velocity set in the motion command is 80%, then the actual velocity is 2000mm/s × 50% × 80%=
800mm/s.
The global rate set by this command only takes effect when the current project is running. If it is not set,
the value set in the software or TCP command before running the script will be adopted.
Required parameter:
Example:
SpeedFactor(50)
SetPayload
Command:
Description:
Set the weight and eccentric coordinates of the load, supporting setting directly or through pre-set
parameters.
Required parameter:
180
Example 1:
Set the weight of the load to 1.5kg, and eccentric coordinates to {0, 0, 10}.
Example 2:
SetPayload("payload1")
User
Command:
User(user)
Description:
Set the global user coordinate system. If you do not specify the user coordinate system through optional
parameters when calling other commands, the global user coordinate system will be used.
The global user coordinate system set by this command only takes effect when the current project is
running. When it is not set, the default global user coordinate system is User coordinate system 0.
Required parameter:
User: user coordinate system after switch, specified through coordinate system index, which needs to be
added in the software first.
Return:
-1 indicates that the set user coordinate system index does not exist.
Example:
User(1)
SetUser
Command:
181
SetUser(index,table)
Description:
Required parameter:
index: user coordinate system index, range: [0,9]. The initial value 0 refers to the default user
coordinate system.
table: user coordinate system after modification (format: {x, y, z, rx, ry, rz}), represents the offset of
the coordinate system relative to the default user coordinate system.
Example:
SetUser(1,{10,10,10,0,0,0})
Modify the User coordinate system 1 to "X=10, Y=10, Z=10, RX=0, RY=0, RZ=0".
CalcUser
Command:
CalcUser(index,matrix_direction,table)
Description:
Required parameter:
index: user coordinate system index, range: [0,9]. The initial value 0 refers to the default user
coordinate system.
matrix_direction: calculation method. 1: left multiplication, 0: right multiplication
table: user coordinate system offset (format: {x, y, z, rx, ry, rz})
Return:
user coordinate system after calculation (format: {x, y, z, rx, ry, rz})
Example:
newUser = CalcUser(1,1,{10,10,10,0,0,0})
182
Tool
Command:
Tool(tool)
Description:
Switch the global tool coordinate system. If you do not specify the tool coordinate system through optional
parameters when calling other commands, the global tool coordinate system will be used.
The global tool coordinate system set by this command only takes effect when the current project is
running. When it is not set, the default global tool coordinate system is Tool coordinate system 0.
Required parameter:
tool: tool coordinate system after switch, specified through coordinate system index, which needs to be
added in the software first.
Return:
-1 indicates that the set tool coordinate system index does not exist.
Example:
Tool(1)
SetTool
Command:
SetTool(index,table)
Description:
Required parameter:
index: tool coordinate system index, range: [0,9]. The initial value of coordinate system 0 is the
default tool coordinate system.
table: tool coordinate system after modification (format: {x, y, z, rx, ry, rz}), represents the offset of
the coordinate system relative to the default tool coordinate system.
Example:
183
SetTool(1,{10,10,10,0,0,0})
Modify the Tool coordinate system 1 to "X=10, Y=10, Z=10, RX=0, RY=0, RZ=0".
CalcTool
Command:
CalcTool(index,matrix_direction,table)
Description:
Required parameter:
index: tool coordinate system index, range: [0,9]. The initial value 0 refers to the default user
coordinate system.
matrix_direction: calculation method. 1: left multiplication, 0: right multiplication
table: tool coordinate system offset (format: {x, y, z, rx, ry, rz})
Return:
tool coordinate system after calculation (format: {x, y, z, rx, ry, rz})
Example:
newTool = CalcTool(1,1,{10,10,10,0,0,0})
GetPose
Command:
GetPose(user_index, tool_index)
Description:
If the command is called between two motion commands, the obtained point will be affected by the
continuous path settings.
If the continuous path is switched off (cp or r is 0), the target point will be obtained accurately.
If the continuous path is switched on, a point on the transition curve will be obtained.
184
Optional parameter:
user_index: user coordinate system index corresponding to the posture. The coordinate system needs
to be added in the software first. The global user coordinate system will be used when the index is not
set.
tool_index: tool coordinate system index corresponding to the posture. The coordinate system needs
to be added in the software first. The global tool coordinate system will be used when the index is not
set.
Return:
Current posture of the robot arm: {pose = {x, y, z, rx, ry, rz}}
Example:
The robot moves to P1, and then returns to the current posture.
MovJ(P1,{cp=0})
local currentPose = GetPose() --Obtain P1 posture
MovJ(P2)
The robot moves to P1. Get P1 posture. Then the robot moves to P2.
GetAngle
Command:
GetAngle()
Description:
If the command is called between two motion commands, the obtained point will be affected by the
continuous path settings.
If the continuous path is switched off (cp or r is 0), the joint angle of the target point will be obtained
accurately.
If the continuous path is switched on, the joint angle of a point on the transition curve will be
obtained.
Return:
185
Current joint angle of the robot arm: {joint = {j1, j2, j3, j4, j5, j6} }
Example:
The robot moves to P1, and then returns to the current posture.
MovJ(P1,{cp=0})
local currentAngle = GetAngle() --Get joint angle of P1
MovJ(P2)
The robot moves to P1. Get P1 posture. Then the robot moves to P2.
GetABZ
Command:
GetABZ()
Description:
Return:
Example:
Get the current position of the ABZ encoder and assign the value to the variable "abz".
CheckMovJ
Command:
Description:
186
Required parameter:
P: target point
Optional parameter:
Return:
Check result.
0: no error
16: End point closed to shoulder singularity point
17: End point inverse kinematics error with no solution
18: Inverse kinematics error with result out of working area
22: Arm orientation error
26: End point closed to wrist singularity point
27: End point closed to elbow singularity point
29: Speed parameter error
32: Shoulder singularity point in trajectory
33: Inverse kinematics error with no solution in trajectory
34: Inverse kinematics error with result out of working area in trajectory
35: Wrist singularity point in trajectory
36: Elbow singularity point in trajectory
37: Joint angle is changed over 180 degrees
Example:
local status=CheckMovJ(P1)
if(status==0)
then
MovJ(P1)
end
Check whether the robot arm can reach P1 through joint motion with the default setting. If it can, move to
P1 through joint motion.
CheckMovL
Command:
187
CheckMovL(P, {user = 1, tool = 0, a = 20, v = 50, cp = 100, r = 5})
Description:
Required parameter:
P: target point
Optional parameter:
Return:
Check result.
0: no error
16: End point closed to shoulder singularity point
17: End point inverse kinematics error with no solution
18: Inverse kinematics error with result out of working area
22: Arm orientation error
26: End point closed to wrist singularity point
27: End point closed to elbow singularity point
29: Speed parameter error
32: Shoulder singularity point in trajectory
33: Inverse kinematics error with no solution in trajectory
34: Inverse kinematics error with result out of working area in trajectory
35: Wrist singularity point in trajectory
36: Elbow singularity point in trajectory
37: Joint angle is changed over 180 degrees
Example:
local status=CheckMovL(P1)
if(status==0)
then
MovL(P1)
end
188
Check whether the robot arm can reach P1 through linear motion with the default setting. If it can, move to
P1 through linear motion.
SetSafeWallEnable
Command:
SetSafeWallEnable(index,value)
Description:
Required parameter:
index: safety wall index, which needs to be added in the software first. range: [1,8]
value:
true: switch on safety wall
false: switch off safety wall
Example:
SetSafeWallEnable(1,true)
SetCollisionLevel
Command:
SetCollisionLevel(level)
Description:
Required parameter:
Level: collision detection level. 0: switching off collision detection, 1~5: the larger the number, the higher
the sensitivity.
Example:
SetCollisionLevel(3)
189
Set the collision detection level to 3.
SetBackDistance
Command:
SetSafeWallEnable(index,value)
Description:
Required parameter:
Example:
SetBackDistance(20)
190
IO
Command list
The IO commands are used to read and write system IO and set relevant parameters.
Command Function
General description
The ON and OFF variables are predefined inside the system to indicate whether there is a signal.
ON = 1: there is a signal
ON | OFF in the parameter means that the parameter value is ON or OFF. You can also use 1 or 0 as input.
DI
Command:
DI(index)
Description:
Required parameter:
index: DI index
191
Return:
Example:
if (DI(1)==ON)
then
MovL(P1)
end
DIGroup
Command:
DIGroup(index1,...,indexn)
Description:
Required parameter:
Return:
Example:
The robot arm moves to P1 through linear motion when DI1 and DI2 are ON.
DO
Command:
DO(index,ON|OFF,time_ms)
192
Description:
Required parameter:
index: DO index
ON|OFF: status of the DO port.
Optional parameter:
If this parameter is set, the system will automatically invert the DO after the specified time. The inversion
is an asynchronous action, which will not block the command queue. After the DO output is executed, the
system will execute the next command.
Example:
DO(1,ON)
DO(1,ON,50)
DOGroup
Command:
DOGroup({index1,ON|OFF},..,{index1,ON|OFF})
Description:
Required parameter:
index: DO index
ON|OFF: status of the DO port.
You can set multiple groups, with each group within a brace and different groups separated by commas.
Example:
DOGroup({1,ON},{2,ON})
193
Set DO1 and DO2 to ON.
GetDO
Command:
GetDO(index)
Description:
Required parameter:
index: DO index
Return:
Example:
GetDO(1)
GetDOGroup
Command:
GetDOGroup(index1,...,indexn)
Description:
Required parameter:
Return:
Example:
GetDOGroup(1,2)
194
Get the status of DO1 and DO2.
AI
Command:
AI(index)
Description:
Required parameter:
index: AI index
Return:
Example:
test = AI(1)
AO
Command:
AO(index,value)
Description:
Required parameter:
index: AO index
value: value to be set. voltage range: [0,10], unit: V; current range: [4,20], unit: mA
Example:
AO(1,2)
195
GetAO
Command:
GetAO(index)
Description:
Required parameter:
index: AO index
Return:
AO value
Example:
GetDO(1)
196
Tool
Command list
The tool commands are used to read and write the tool IO of the robot arm and set relevant parameters.
Command Function
General description
The ON and OFF variables are predefined inside the system to indicate whether there is a signal.
ON = 1: there is a signal
ON | OFF in the parameter means that the parameter value is ON or OFF. You can also use 1 or 0 as input.
ToolDI
Command:
ToolDI(index)
Description:
Required parameter:
Return:
197
Example:
if (ToolDI(1)==ON)
then
MovL(P1)
end
The robot moves to P1 in a linear mode when the status of tool DI1 is ON.
ToolDO
Command:
ToolDO(index,ON|OFF)
Description:
Required parameter:
Example:
ToolDO(1,ON)
GetToolDO
Command:
GetToolDO(index)
Description:
Required parameter:
Return:
198
Example:
GetToolDO(1)
ToolAI
Command:
ToolAI(index)
Description:
Get the value of tool analog input port. You need to set the port to analog-input mode through
SetToolMode before using.
Required parameter:
Return:
Example:
test = ToolAI(1)
Get the value of tool AI1 and assign it to the variable "test".
SetToolMode
Command:
SetToolMode(mode,type,identify)
Description:
The tool AI1 and AI2 interfaces are multiplexed with the 485 interface. The mode of the tool multiplexing
terminal can be set through this interface, with 485 mode by default.
Required parameter:
199
1: 485 mode.
2: Analog input mode.
type: When mode is 1, the parameter is ineffective. When mode is 2, you can set the analog input mode. It
consists of two digits, the units digit which represents the mode of AI1, and the tens digit which represents
the mode of AI2. When the tens digit is 0, you can just input the units digit.
Mode:
Optional parameter:
identify: When the robot arm has multiple aviation sockets, it is used to specify the sockets, 1 refers to
socket 1, and 2 refers to socket 2.
Example:
SetToolMode(2,0)
Set the tool multiplexing terminal to analog input, with 0~10V voltage input mode for both inputs.
SetToolPower
Command:
SetToolPower(status)
Description:
Required parameter:
Example:
200
SetToolPower(0)
SetTool485
Command:
SetTool485(baud,parity,stopbit)
Description:
Set the data type corresponding to the RS485 interface of the end tool.
Required parameter:
Optional parameter:
parity: whether there are parity bits. "O" means odd, "E" means even, and "N" means no parity bit.
("N" by default)
stopbit: stop bit length. range: 1, 2. (1 by default)
Example:
SetTool485(115200,"N",1)
Set the baud rate corresponding to the tool RS485 interface to 115200Hz, parity bit to N, and stop bit
length to 1.
201
TCP/UDP
Command list
The TCP/UDP commands are used for TCP/UDP communication.
Command Function
TCPCreate
Command:
Description:
Required parameter:
isServer: whether to create a server. true: create a server; false: create a client
IP: IP address of the server, which is in the same network segment of the client without conflict. It is
the IP address of the robot arm when a server is created, and the address of the peer when a client is
created.
port: server port. Please do not use the following ports which are already occupied by the system,
otherwise, it will cause failure to create the server.
7, 13, 22, 37, 139, 445, 502, 503(0~1024 ports are linux-defined ports, which has a high possibility
of being occupied. Please avoid to use),
202
11740, 22000, 22001, 29999, 30004, 30005, 30006,
Return:
err:
0: TCP network has been created successfully.
1: TCP network failed to be created.
socket: socket object
Example 1:
Example 2:
local ip="192.168.5.25" -- Set the IP address of external equipment (such as a camera) as the
server
local port=6001 -- Server port
local err=0
local socket=0
err, socket = TCPCreate(false, ip, port)
TCPStart
Command:
TCPStart(socket, timeout)
Description:
Establish TCP connection. The robot arm waits to be connected with the client when serving as a server,
and connects the server when serving as a client.
Required parameter:
203
Return:
Connection result.
Example:
TCPRead
Command:
Description:
Required parameter:
Optional parameter:
timeout: waiting timeout, unit: s. If timeout is set to 0, wait until the data is completely read before
running; if not 0, continue running after exceeding the timeout.
type: type of return value. If it is not set, the RecBuf buffer format is a table. If it is set to "string", the
RecBuf buffer format is a string.
Return:
err:
0: Data has been received successfully.
1: Data failed to be received.
Recbuf: data buffer
Example:
204
err, RecBuf = TCPRead(socket,0,"string") -- The data type of RecBuf is string
err, RecBuf = TCPRead(socket, 0) -- The data type of RecBuf is table
Receive TCP data, and save the data as string and table format respectively.
TCPWrite
Command:
Description:
Required parameter:
Optional parameter:
timeout: waiting timeout, unit: s. If timeout is set to 0, the program will not continue to run until the peer
receives the data. If timeout is not 0, the program will continue to run after exceeding the timeout.
Return:
Example:
TCPDestroy
Command:
TCPDestroy(socket)
Description:
205
Required parameter:
Return:
Execution result.
Example:
UDPCreate
Command:
Description:
Required parameter:
isServer: false
IP: IP address of the peer, which is in the same network segment of the client without conflict
port: peer port
Return:
err:
0: The UDP network has been created successfully.
1: The UDP network failed to be created.
socket: socket object
Example:
local ip="192.168.5.25" -- Set the IP address of external equipment (such as a camera) as the
IP address of the peer
local port=6001 -- Peer port
local err=0
local socket=0
err, socket = UDPCreate(false, ip, port)
206
Create a UDP network.
UDPRead
Command:
Description:
Required parameter:
Optional parameter:
timeout: waiting timeout. unit: s. If timeout is set to 0, wait until the data is completely read before
running; if not 0, continue to run after exceeding the timeout.
type: type of return value. If type is not set, the RecBuf buffer format is a table. If type is set to
"string", the RecBuf buffer format is a string.
Return:
err:
0: Data has been received successfully.
1: Data failed to be received.
Recbuf: data buffer
Example:
Receive UDP data, and save the data as string and table format respectively.
UDPWrite
Command:
Description:
207
Required parameter:
Optional parameter:
timeout: waiting timeout, unit: s. If timeout is set to 0, the program will not continue to run until the peer
finishes receiving the data. If timeout is not 0, the program will continue to run after exceeding the timeout
Return:
Example:
208
Modbus
Command list
The Modbus commands are used for Modbus communication.
Command Function
ModbusCreate
Command:
Description:
Create Modbus master station, and establish connection with the slave station.
Required parameter:
Optional parameter:
slave_id: slave ID
isRTU: boolean. If it is not carried or fasle, establish modbusTCP communication; if it is true,
establish modbusRTU communication.
Return:
err:
209
0: Modbus master station has been created successfully.
1: Modbus master station failed to be created.
id: master station ID, which is used when other Modbus commands are called. range: [0, 14]
Example:
local ip="192.168.5.123"
local port=503
local err=0
local id=0
err, id = ModbusCreate(ip, port, 1)
Create the Modbus master, and connect with the specified slave.
ModbusRTUCreate
Command:
Description:
Create Modbus master based on RS485, and establish connection with slave station.
Required parameter:
slave_id: slave ID
baud: RS485 baud rate
Optional parameter:
parity: whether there are parity bits. "O" means odd, "E" means even, and "N" means no parity bits
("E" by default)
data_bit: data bit length. range: 8 (8 by default)
stopbit: stop bit length. range: 1, 2 (1 by default)
Return:
err:
0: Modbus master station has been created successfully.
1: Modbus master station failed to be created.
id: master station ID, which is used when other Modbus commands are called.
Example:
210
Create Modbus master, and establish connection with the slave station through RS485. The slave ID is 1
and baud rate is 115200.
ModbusClose
Command:
ModbusClose(id)
Description:
Disconnect with Modbus slave station and release the master station.
Optional parameter:
id: master ID
Return:
Example:
ModbusClose(id)
GetInBits
Command:
Description:
Required parameter:
id: master ID
addr: starting address of the discrete input
count: number of discrete inputs, range: 1~2000 (ModbusTCP protocol restriction. For actual range,
please determine according to the number of slave registers or the protocol)
Return:
211
Discrete input value stored in a table, where the first value in the table corresponds to the discrete input
value at the starting address.
Example:
inBits = GetInBits(id,0,5)
GetInRegs
Command:
Description:
Read the input register value with the specified data type from the Modbus slave.
Required parameter:
id: master ID
addr: starting address of the input registers
count: number of input register values, range: 1~125 (ModbusTCP protocol restriction. For actual
range, please determine according to the number of slave registers or the protocol)
Optional parameter:
Return:
Input register values stored in a table, where the first value corresponds to the Input register value at the
starting address.
Example:
212
GetCoils
Command:
Description:
Required parameter:
id: master ID
addr: starting address of the coil register
count: number of coil register values, range: 1~2000 (ModbusTCP protocol restriction. For actual
range, please determine according to the number of slave registers or the protocol)
Return:
Coil register value stored in a table, where the first value corresponds to the coil register value at the
starting address.
Example:
Coils = GetCoils(id,0,5)
SetCoils
Command:
Description:
Required parameter:
id: master ID
addr: starting address of the coil register
count: number of values to be written to the coil register, range: 1~1968 (ModbusTCP protocol
restriction. For actual range, please determine according to the number of slave registers or the
protocol)
table: store the values to be written to the coil register. The first value of the table corresponds to the
213
starting address of coil register
Example:
Starting from address 1024, write 5 values in succession to the coil register.
GetHoldRegs
Command:
Description:
Read the holding register value with the specified data type from the Modbus slave.
Required parameter:
id: master ID
addr: starting address of the holding register
count: number of holding register values, range: 1~125 (ModbusTCP protocol restriction. For actual
range, please determine according to the number of slave registers or the protocol)
Optional parameter:
Return:
Holding register value stored in a table, where the first value corresponds to the holding register value at
the starting address
Example:
214
SetHoldRegs
Command:
Description:
Write the specified value according to the specified data type to the specified address of holding register.
Required parameter:
id: master ID
addr: starting address of the holding register
count: number of values to be written to the holding register, range: 1~123 (ModbusTCP protocol
restriction. For actual range, please determine according to the number of slave registers or the
protocol)
table: store the values to be written to the coil register. The first value of the table corresponds to the
starting address of holding register
Optional parameter:
Example:
Write a 64-bit double-precision floating-point number to the holding register starting from address 2048.
215
Program control
Command list
The program managing commands are general commands related to program control.
Command Function
Continue executing the next command after waiting specified time or meeting
Wait
specified condition.
Print
Command:
Print(value)
Description:
Required parameter:
Example:
Print('Success')
Log
Command:
216
Log(value)
Description:
Output custom log information, which can be viewed and exported in the Log page of the software.
Required parameter:
Example:
Log('test')
Wait
Command:
Wait(time_ms)
Wait(check_str, timeout_ms)
Description:
Once completing the last command, the robot arm continues executing the next command after waiting
specified time or meeting specified condition.
Required parameter:
time_ms: When the parameter is of integer type, it means specifying waiting time. 0 or less than 0
means not waiting. unit: ms
check_str: When the parameter is of string type, it means judging the logic. Continue executing the
next command after the logic is true.
Optional parameter:
timeout_ms: Timeout time. When the judgment logic is always false and the waiting time exceeds the time,
the system will continue executing the next command and return false. 0 or less than 0 means not waiting
and timing out immediately. When this parameter is not set, it means that it will not time out and will wait
until the judgment logic is true. unit: ms
Return:
Return true when it meets the condition and continues running; return false when it does not meet the
condition and continues to run due to a timeout.
217
Example:
Wait(300)
Wait 300ms.
Wait("DI(1) == ON")
Wait("GetDO(1) == ON")
Wait("var_1 == true")
Continue running when the variable "var_3" equals the string "Success".
Pause
Command:
218
Pause()
Description:
Pause running the program. The program can continue to run only through software control or remote
control.
Example:
MovJ(P1)
Pause()
MovJ(P2)
The robot moves to P1 and then pauses running. It can continue moving to P2 only through external
control.
ResetElapsedTime
Command:
ResetElapsedTime()
Description:
Start timing after all commands before this command are executed completely. This command should be
used combined with ElapsedTime() command for calculating the operating time.
Example:
ElapsedTime
Command:
ElapsedTime()
Description:
Stop timing and return the time difference. The command should be used combined with
ResetElapsedTime() command.
Return:
219
Example:
MovJ(P2)
ResetElapsedTime()
for i=1,10 do
MovL(P1)
MovL(P2)
end
print (ElapsedTime())
Calculate the time for the robot arm to move back and forth 10 times between P1 and P2, and print it to the
console.
Systime
Command:
Systime()
Description:
Return:
Example:
Get the current system time and save it to the variable "time".
220
SafeSkin
Command list
The SafeSkin commands are used to set functions of the SafeSkin.
Command Function
EnableSafeSkin
Command:
EnableSafeSkin(ON|OFF)
Description:
Required parameter:
Return:
Example:
EnableSafeSkin(ON)
Enable SafeSkin.
SetSafeSkin
Command:
SetSafeSkin(part,status)
Description:
221
Set the sensitivity of each part of SafeSkin.
Required parameter:
Example:
SetSafeSkin(3,0)
222
Appendix D Remote Control Signal Sequence
Diagram
The typical sequence diagram of controlling the robot arm through remote signals to run projects is shown
below.
The signals related to project control are not effective when the robot arm is not enabled.
If the protective stop input is configured and the protective stop reset input (safety IO) is not configured,
the typical sequence diagram is shown below. When the protection stop status takes effect, the signals
related to project control are not effective. Triggering the protection stop status when the robot arm is
running the project will trigger a pause in the project, and the project will continue to run after reset.
223
224