JAKA Script Programming Manual
Document Version: V3.3.2
App Version: V3.3.6
Controller Version: V3.4.0_alpha3
Collaborative robots are defined in accordance with applicable international ISO standards and national standards to protect operator safety. Direct use of the robot body in applications where the workpiece is a person is not recommended. If a robot integrator or application developer must use the robot in such an application, they shall perform a thorough risk assessment and equip the robot with a reliable, fully tested, and certified safeguarding system that ensures personnel safety.
The contents of this App User Manual are the proprietary property of Shanghai JAKA Robotics Ltd. (hereinafter referred to as “JAKA”). No part may be used in any form without JAKA’s prior written consent.
JAKA periodically revises and improves this manual. Its contents are subject to change without notice. Verify the applicable product information before using this manual.
The information in this manual does not constitute a commitment by JAKA. JAKA assumes no liability for errors in this manual or for incidental or consequential damage arising from use of this manual or the products described herein. Read this manual carefully before installing or using the product.
Figures in this manual are for reference only. The actual product shall prevail.
JAKA does not provide after-sales service for a robot body that has been modified or disassembled without authorization.
Always use appropriate safety equipment and comply with all safety requirements when operating or servicing a JAKA robot.
Programmers, system designers, and commissioning personnel shall be familiar with JAKA robot programming and system integration.
About This Manual
This manual describes JAKA Zu App script programming and its use.
This manual is intended for users who have received basic robot operation training.
Further information
For more product information, visit www.jaka.com.
Introduction to JAKA Script
JAKA Script is a dedicated programming language for controlling JAKA robots. Programs written according to the syntax defined in this manual can be executed by the robot controller.
JAKA Script Fundamentals
JAKA Basic Syntax:
Identifiers
In the JAKA Script, the identifier is case-sensitive and is a reserved word, but And and AND are two different valid names. In accordance with established practice, the program should avoid creating a name (e.g. _VERSION) that starts with one or more capital letters after the following underlined.
Additional naming needs to meet the following rules:
Use only English letters, digits, and underscores.
:: The first character cannot be a number
Keywords cannot be used as identifiers
· Up to 255 characters, with a recommended maximum of 30 characters, and a Han word at 3 characters
Example:
# legal
\_var1 = 1
var2 = 1
VAR3 = 1
\_2KDDinKAEld74Zl8WzKP = 1
# illegal
4VAR = 1
if = 1
Reserved Keywords
The following table lists the reserved words in JAKA Script. Reserved words cannot be used as constants, variables, or other identifiers.
and |
break |
do |
|---|---|---|
else |
elif |
end |
false |
for |
function |
goto |
if |
in |
local |
nil |
not |
or |
repeat |
return |
then |
true |
until |
while |
Script Comments
JAKA robot programming scripts support single-line comments and do not support multi-line notes. A single-line comment begins with #, with all strings from # to the end of the line.
Example:
# the first comment
str = "Hello, World!" #the second comment
Statements
JAKA Scripts support multiple statements or expressions separated by semicolons in the same row, and the parser executes them in the order of priority from the left to the right. One line is not supported to split into more than one line.
Basic Types
JAKA Scripts provide data support for the three basic types of standard, string and array. On an array basis, users can use predefined system variables.
Scalar
JAKA robot programming scripts do not distinguish between Boolean type, integer and floating point type data. For Boolean type, false corresponds to 0, and true corresponds to 1.
Example:
var = 1
# or
var = 1.0
# or
var = (expr1 > expr2)
Strings
User-defined strings need to be packaged using a double quotation sign (”) in English. The transliteration characters currently supported by JAKA Script are shown in the table below. Users need to be aware when defining a string, otherwise they will cause an error of resolution.
Conversion Characters |
Description |
|---|---|
|
Backslash symbol |
|
Single quotation marks |
|
Double quotes |
|
Line Break |
|
Horizontal Tabs |
|
Carriage return |
Example:
string = "this is a \\"string\""
string = "This is a string \\n"
Arrays
An array is the container in which a set of data is stored. The contents of the current array may be a sample, a string, or another array.
Array definition
Syntax:
arr = […] # Define an array
arr = [ ] # Defines an empty array
arr_num = [1,2,3,4] # scalar array
arr_str = ["aaa", "bb", "cc"] # string array
arr_arr = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] # embedded array
# Results
# arr_num[0] : 1
# arr_str[1] : bb
# arr_arr[2][2]: 9
Index access to modulars
Assuming that the array variable array is N in length, the following forms are supported for access to individual elements:
Array [index], where the index range is supported [0, N-1].
When the index is not supported, the value is the default empty nil.
Example:
a = [1, 2, 3, 4, 5, 6, 7, 8, 9, 0]
b = a[0] # b = a[0]
Index = 1
b = a[Index] # b = a[1]
b = a[100] # b=nil
Sub-array access
The function subarr = slice(arr, start, end, step) provides sliced access to an array.
Example:
arr = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
# Use slice syntax
#a5 = arr[5]
slice1 = arr[1:5:2] # Element to retrieve index 2 to 5 (excluding 5)
log_message(1,slice1) #
slice2 = slice(arr, 1,5,2)
log_message(1,slice2) # Output: 20,40
slice3 = slice(arr, 1,8,2)
log_message(1,slice3) # Output: 20,40,60,80
slice4 = slice(arr, 1,5)
log_message(1,slice4) # Output: 20,30,40,50
slice5 = slice(arr, 1,100)
log_message(1,slice5) # Output: 20, 30, 40, 50, 60, 70, 80, 90
# Output log
2026/02/28 17:18:17:793 # 1 # 0 # 20,40
2026/02/28 17:18:17:800 # 1 # 0 # 20,40
2026/02/28 17:18:17:809 # 1 # 0 # 20,40,60,80
2026/02/28 17:18:17:818 # 1 # 0 # 20,30,40,50
2026/02/28 17:18:17:824 # 1 # 0 # 20,30,40,50,60,70,80,90
Sub-array access returns a subsequence selected from the specified array range at a specified interval. The format is array[num_start: num_end: num_step].
num_start, num_end, and num_step must be integer literals; variables are not supported as these parameters. A num_step value of 0 causes an error and terminates execution. Values outside the array bounds do not cause an error; only matching values within the valid array range are returned, or an empty array if none exist.
Example:
a = [1,2,3,4,5,6,7,8,9,0]
b = a[0:5:1] #[1, 2, 3, 4, 5]
# illegal
Start = 0
End = 5
Step = 1
B = a[Start: End: Step] # Num_start, Num_end, Num_step, must have integer constant digital face, not supporting the use of variables as parameters
Array and pose representation
JAKA scripts use six-element arrays to represent robot joint positions or Cartesian poses. A joint-position array is [joint1, joint2, joint3, joint4, joint5, joint6] and its values are joint angles in degrees. A Cartesian pose is [Tx, Ty, Tz, Rx, Ry, Rz]; translation values are in millimetres and rotation values are in degrees.
Example:
endPosJ = [90, 90, 90, 90, 90, 90] # joint spatial position array
endPosL = [663.5, 8.159996, 6.950005, 90, 0, 0] # Cartesian space position array
Array assignment
Assigning one array to another transfers a reference rather than making a copy. For example:
a = [1, 2, 3, 4] # Definition and initialization of arraysa, with [1,2,3,4]
b = [] # Define an empty arrayb (this step is practically meaningless because the next line will be covered)
b = a # b and a now refer to the same array
b[1] = 11 # Modify b [1], actually modified by the array of a and b cited together
# a [1] = b [1] = 11, because a and b point to the same array
To copy an array, use table.move(a1, s, e, t, a2). It copies elements from a1[s] through a1[e] to array a2 beginning at a2[t]. The source and destination ranges may overlap, and the number of elements must remain within the valid array index range.
Example:
a = [1, 2, 3, 4] # Definition and initialization of arraysa, with [1,2,3,4]
b = [] # Define an empty arrayb
table.move(a,0,get_length(a),0,b) # Copy all elements of arraya to arrayb; b = [1,2,3,4]
b[1] = 66 # Modifyb [1] to 66
# b[1] = 66; a[1] = 1
Global Variables
The variable defined in the application (the program variable) is released after the program has been completed. For a variable where the desired value is sustainable, the JAKA Script provides a global variable mechanism. The global variable is classified as a durable global and non-sustainable global variable.
Enduring global variables are predefined through the APP, with aliases and automatic random distribution of IDs (i.e. integers greater than or equal to 0 less than 21474483647), which, when defined, can be accessed directly through ID in the script. Access is by: SYSVAR [ID].
The definition of the non-continuous global variable is the same as that of the program variable, the difference being that the non-continuing global variable can be used, after definition, in other programs or sub-routines called by the main line, but after the program has ceased, it will be released and will not be saved into the file.
The type of global variable value supports the scale, string and array, and the type of array element value equally supports the scale, string and array.
A global variable of the array type supports an inter-temporal visit in the same way as an inter-temporal visit.
Example:
SYSVAR[5500] = 100
a = SYSVAR[5500]
SYSVAR[234512] = "this is string"
b = SYSVAR[234512]
SYSVAR[34321] = [1,2,3,4,5,6,7,8,9,10,11,12]
c = SYSVAR[34321][1] # c=2
SYSVAR[34321][0]="str" # SYSVAR[34321] = ["str",2,3,4,5,6,7,8,9,10,11,12]
SYSVAR[34321][11]=[11,22,33] # SYSVAR[34321] = ["str",2,3,4,5,6,7,8,9,10,11,[11,22,33]]
arr = SYSVAR[34321][1:5:1] # arr = [2,3,4,5]
Note:
Negative index is not supported for global variables.
The global variable has an ID index value greater than or equal to 0 and less than 2147483647.
The parser performs command synchronization when implementing the grant and reading of global variables, i.e., when the instructions in the queue are executed, and the queue is emptied before the grant and reading of global variables are executed (cause: global variables are used to interact data across multiple lines, and synchronization before operating global variables avoids logical confusion). Potential impact: if a movement directive exists before and after a global variable operating directive, the transfer between the two movement commands will be interrupted.
Expressions
Arithmetic Operators
The algorithm operator is used to perform four operations, grouping them in a higher priority (,/, %, *) than (+, -). High priority operators are more closely combined than low priority operators, and the operators in the following table meet the left combination, i.e., in the order from left to right when the operator has the same priority.
Arithmetic Operators |
||
|---|---|---|
Operator |
Function |
Usage |
* |
Multiplication |
expr * expr |
/ |
Division |
expr / expr |
% |
Modulo |
expr % expr |
** |
Exponentiation |
expr ** expr |
+ |
Addition |
+expr |
- |
Subtraction |
-expr |
Logical and Relational Operators
The relationship operator works on the type of algorithm, and the logical operator works on any type that can be converted to a boolean value. The logical operator and the relationship operator return value is of a boolean type.
Logical and Relational Operators |
||||
|---|---|---|---|---|
Associativity |
Operator |
Function |
Usage |
Supported Input Types |
Right |
! |
Logical NOT |
!expr |
Integer, Boolean |
Left |
&& |
Logical AND |
expr && expr |
Integer, Boolean |
Left |
|| |
Logical OR |
expr || expr |
Integer, Boolean |
Left |
< |
Less than |
expr < expr |
Integer, String |
Left |
> |
Greater than |
expr > expr |
Integer, String |
Left |
== |
Equal to |
expr == expr |
Integer, String |
Left |
!= |
Not equal to |
expr != expr |
Integer, String |
Left |
<= |
Less than or equal to |
expr <= expr |
Integer, String |
Left |
>= |
Greater than or equal to |
expr >= expr |
Integer, String |
Bitwise Operators
Bit Operator acts on integer type operators and views them as a set of binary bits, which currently only supports variation or operation.
Bitwise Operators (Left-associative) |
||
|---|---|---|
Operator |
Function |
Usage |
^ |
XOR |
expr1 ^ expr2 |
Statements
Usually, the statement is executed sequentially. This only applies to the simplest procedure, so the JAKA Script provides a set of control phrases to support more complex execution controls.
Simple statement
In JAKA Scripts, you require statements to be made in separate rows, and most statements do not need enders. A simple statement includes an expression statement, a functional change phrase, etc.
Conditional statement
if…end statement
The effect of an if statement is to determine whether or not a given condition is true and to decide whether another statement is to be executed on the basis of the judgement. The if statement consists of two forms, one containing the else branch and the other not.
Syntax:
if(condition):
statement
end
Example:
condition = get_digital_output(0, 1)
if(condition):
endPosJ = [0, 0, 0, 0, 0, 0]
movj(endPosJ, 0, 60, 200, 0)
end
if…else…end statement
Syntax:
if(condition):
statement
else:
statement
end
Example:
condition = get_digital_output(0, 1)
if(condition):
endPosJ = [0, 0, 0, 0, 0, 0]
movj(endPosJ, 0, 60, 200, 0)
else:
endPosL = [663.5, 8.159996, 6.950, 90, 0, 0]
movl(endPosL, 0, 250, 250, 0)
end
if…elif…else…end statement
Syntax:
if(condition1):
statement
elif(condition2):
statement
else:
statement
end
Example:
condition1 = get_digital_output(0,1)
condition2 = get_digital_output(0,2)
if(condition1):
endPosJ = [0,0,0,0,0,0]
movj(endPosJ,0,60,200,0)
elif(condition2):
endPosL =[663.5,8.159996,6.950,90,0,0]
movl(endPosL,0,250,250,0)
else:
endPosL =[663.5,8.159996,6.950,90,0,0]
movl(endPosL,0,1000,250,0)
end
Loop statement
While loop statement
As long as the conditions are true, the phile statement repeats the cycling.
Syntax:
while(condition):
statement
end
In the phile structure, as long as the value requirement results are true, the status (usually a grammatical block) is always executed, and the condition cannot be empty. If the first request for value is false, status is not executed at all.
Example:
i = 0
while(i <= 4):
endPosJ1 = [0, 90, 90, 90, -90, 0]
movj(endPosJ1, 0, 10, 600, 0)
endPosJ2 = [90, 90, 90, 90, -90, 0]
movj(endPosJ2, 0, 10, 600, 0)
i = (i+1)
end
Jumping statement
The jump statement can interrupt the current implementation of the phile statement, and JAKA Scripts provide two jumps, break and continue.
Break statement
The break statement is responsible for the termination of the closest phile statement to it and continues from the first sentence after those words. The break function is limited to the most recent phile cycle.
Example:
Statement is a statement block; condition1 and condition2 are conditions to evaluate.
while(condition1):
statement
...
if(condition2):
break
end
...
statement
end
Continue statement
The continue statement terminates the current iteration of the nearest loop and immediately starts its next iteration. It can only appear inside a while loop and applies only to the nearest loop.
Example:
Statement is a statement block; condition1 and condition2 are conditions to evaluate.
while(condition1):
statement
...
if(condition2):
continue
end
...
statement
end
Multithreading
The latest controller software supports multi-wire functions, and users can use specific non-motion-related types of instructions in non-main threads.
Create Threads
When a user uses multiple threads, a thread is defined by way of a sub-file, i.e. a thread executioner is stored in a single jks-backed script file. The thread is created by specifying an absolute path for a thread-executing body application file, which will start automatically when the thread is created. The JAKA controller supports the number of sub-routines.
Threads need to be created in tandem with the thread name, which is used for the management of subtread resources, such as the destruction of the thread, synchronization, suspension, etc.
Example:
/path/to/thread/file.jks is the absolute path to the child-thread script, and thread_name is the unique string identifying the thread.
thread_create("/path/to/thread/file.jks", "thread_name")
Note: Child threads use function definitions from the main-thread environment by default. If a child thread executes a JKS file from an independent project that defines its own functions, execution reports an undefined-function error.
Thread Operations
JAKA Script Programming Language Support Lines Waiting for (join) and Thread Destruction Operations to Support Line Separation (detach). All sub-routines will be terminated at the end of the main route, and the resources used will be recovered. The associated operation supports only calls in the main line and invalids calls in the sub-routine; the thread operation must ensure that the line name is valid, that if the thread name that the threading commands into is invalid, the command parser does not find the name of the corresponding route, and that the line of the corresponding name is assumed to have been executed or closed.
The motion-related, partial set-up (e.g. load setting, coordinates setting) commands are only used in the main line and will be skipped and not executed in the sublinear.
Example:
thread_name as thread name
ThreadSync: thread_join ("thread_name")
Thread_destroy ("thread_name")
In addition, sub- and main-lined circuits can be called to suspend the command, and after suspending the execution of the instruction, all circuits in the procedure will be suspended; all circuits will be restored and continue to operate.
Scheduling of threads
All sub-routines created by the user in the operation maintain the same priority and do not support the change. Only one line is allowed to have access to the bottom control interface during the control command cycle.
Threads against each other.
When multiple threads access shared data or resources at the same time (e.g., system variables), a JAKA Script provides an operational interface to access and exit the critical area to resolve resource conflicts. When multiple threads are simultaneously prepared to enter the critical area, only one line will be able to access the critical area, and all other threads will be in a state of waiting until the thread exits from the critical area. As access to critical areas is equivalent to exclusive operating privileges, instructions to be executed during entry and exit are required to be as brief as possible to ensure that other threads are operational.
Example:
thread_enter_critical()
# do some stuff
thread_exit_critical()
Functions
From JAKA control software version V3.3.3, user definition functions are supported and called. The following functions are defined in JAKA scripts:
function functionName(parameters):
# Function
return result
end
Example:
function greet(name):
log_message(1, string_concat("Hello, ", name))
end
greet("Jack") # Log Output Hello, Jack
function supports multiple returns, as shown below.
function calculate(x, y):
return x + y, x - y, x * y, x / y
end
ret1, ret2, ret3, ret4 = calculate(4,2) # The results in descending order are: 6, 2, 8, 2
In addition, allow the function name to be used by the user to be entered in a string parameter to achieve a dynamic call for the function. On this basis, the entry of the function parameter is supported. The function prototype of the script command is as follows:
Function prototype |
Parameter and return-value description |
|---|---|
|
|
Example:
function greet(name):
log_message(1, string_concat("Hello, ", name))
end
succ = call_function("great", "Jack") # Hello, Jack
Note:
When using JAKA graphical programming software, the definition of a function is stored in a separate function definition file under the project, which can be used for the main and sub-routines of the project;
When a cross file is involved in a program calling (execute_script) or sub-routing (thread_create), the function definition under the project performed is carried out in a hidden background, rather than the function project definition under its path.
JAKA script preset function
Motion Commands
Basic Motion
movel
Command Syntax:
movl(var_pos, rel_flag, vel, acc, tol) # 5 parameters
movl(var_pos, rel_flag, vel, acc, tol, end_cond) # 6 parameters
movl(var_pos, rel_flag, vel, acc, tol, end_cond,ori_vel) # 7 parameters
movl(var_pos, rel_flag, vel, acc, tol, end_cond, ori_vel, ori_acc) # 8 parameters
movl(var_pos, rel_flag, vel, acc, tol, end_cond, ori_vel, ori_acc, planner_type) # 9 parameters
movl(var_pos, rel_flag, vel, acc, tol, end_cond, ori_vel, ori_acc, planner_type, robot_id) # 10 parameters
Description:
It’s used to control robots in the direct movement of Cartesian space.
Parameters:
var_pos |
Six-element array specifying the target pose in Cartesian space. Define it before calling the command. |
|---|---|
rel_flag |
Specifies absolute or relative motion. |
vel |
Speed of movement, unit mm/s. |
acc |
Linear acceleration, in mm/s². |
tol |
Allows a deviation to reach the specified endpoint. In the case of zero, the target pose will be reached accurately; In the case of positive values, the location may be mixed with the subsequent paragraph and cannot reach the target pose accurately. |
end_cond |
The paragraph directs the cessation conditions, with the optional parameters being an array consisting of three parameters, including: di_type: IO type and module ID (Note: Modular ID applies to robotic master stations extending multiple IO modules from 0 to 0 starting index) complex fields with 16 below IO type and 16 above IO type (or 0 if not applicable). The IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations di_index: IO address. di_state: IO meets condition status 0/1. |
ori_vel |
Attitude speed, is an optional parameter, in units deg/s. If this parameter is not entered, the robot will run at maximum orientation speed. |
ori_acc |
Optional orientation acceleration in deg/s². If omitted, the robot uses its maximum orientation acceleration. |
planner_type |
The type of speed planning is an optional parameter, which is selected flexibly according to the different scenarios. 0: Use of rhythm priority speed planning; 1: Adopt a soft-priority, fast-planning approach. |
robot_id |
Robotic IID for dual or multi-robot arm motion control. 0: (default) Mechanical arm of id in the controller type file. 1: Mechanical arm of id 1 in the control machine type document. |
Return Value: none
Example:
# Zu 15 model
endPosJ = [0,0,0,0,0,0]
endPosL = [0,0,0,0,0,0]
pos_mvl = [0,0,0,0,0,0]
pos_waypoint = [0,0,0,0,0,0]
set_tool_id(0)
set_user_frame_id(0)
endCon_UVOTzWMDQPCvnYNDMZ78 = [-1, -1, -1]
endPosJ = [13.187 ,80.642 ,97.289 ,91.046 ,-88.980 ,-5.741]
movj(endPosJ, 0, 60, 200, 0, endCon_UVOTzWMDQPCvnYNDMZ78,1)
endCon_Hj5Vu0vPxcRWewys6tA6 = [-1, -1, -1]
endPosJ = [13.187 ,92.258 ,129.041 ,47.678 ,-88.980 ,-5.741]
endPosL = [-615.884 ,20.989 ,365.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 60, 200, 0) # 5 Parameters
endCon_P0z9CPUaM6VViMjrX8mf = [-1, -1, -1]
endPosJ = [39.212 ,97.420 ,123.280 ,47.933 ,-89.532 ,20.280]
endPosL = [-615.884 ,-293.012 ,365.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 250, 250, 0, endCon_P0z9CPUaM6VViMjrX8mf) # 6 parameters
endCon_XEQqXa4nuSqkFUu3nwAX = [-1, -1, -1]
endPosJ = [39.212 ,87.254 ,80.052 ,101.327 ,-89.532 ,20.280]
endPosL = [-615.884 ,-293.012 ,867.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 60, 200, 0, endCon_XEQqXa4nuSqkFUu3nwAX,180) # 7 parameters
endCon_bzy9YphvZS3it4mu6Ck3 = [-1, -1, -1]
endPosJ = [-30.905 ,100.209 ,65.705 ,104.061 ,-88.556 ,-49.841]
endPosL = [-615.884 ,554.989 ,867.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 250, 250, 0, endCon_bzy9YphvZS3it4mu6Ck3,180,360) # 8 parameters
endCon_n0BaqEHl2zaXDidMteQp = [-1, -1, -1]
endPosJ = [-30.905 ,99.882 ,92.474 ,77.619 ,-88.556 ,-49.841]
endPosL = [-615.884 ,554.989 ,607.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 60, 200, 0, endCon_n0BaqEHl2zaXDidMteQp,180,360,1) # 9 arguments
endCon_kSap6DB6Kb5jXbv27vow = [-1, -1, -1]
endPosJ = [-13.013 ,104.031 ,87.355 ,78.146 ,-88.633 ,-31.944]
endPosL = [-807.884 ,350.988 ,607.746 ,-178.880 ,0.912 ,108.946]
movl(endPosL, 0, 250, 250, 0, endCon_kSap6DB6Kb5jXbv27vow,180,360,1,0) # 10 parameters
movej
Command Syntax:
movj(var_pos, rel_flag, vel, acc, tol) # 5 parameters
movj(var_pos, rel_flag, vel, acc, tol, end_cond) # 6 parameters
movj(var_pos, rel_flag, vel, acc, tol, end_cond, planner_type) # 7 parameters
movj(var_pos, rel_flag, vel, acc, tol, end_cond, planner_type,robot_id) # 8 parameters
Description:
For the control of robotics for joint space movement.
Parameters:
var_pos |
Six-element array specifying the target joint position. Define it before calling the command. |
|---|---|
rel_flag |
Specifies absolute or relative motion. |
vel |
Each joint command speed, unit dig/s. The physical motion will be subject to the maximum physical speed of the joints. |
acc |
Joint acceleration in deg/s². |
tol |
Allows a deviation to reach the specified endpoint. In the case of zero, the target pose will be reached accurately; If positive, it may be mixed with the subsequent paragraph and cannot reach the target pose accurately. |
end_cond |
The paragraph directs the cessation conditions, with the optional parameters being an array consisting of three parameters, including: di_type: IO type and module ID (Note: Modular ID applies to robotic master stations extending multiple IO modules from 0 to 0 starting index) complex fields with 16 below IO type and 16 above IO type (or 0 if not applicable). The IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations di_index: IO address. di_state: IO meets condition status 0/1. |
planner_type |
The type of speed planning is an optional parameter, which is selected flexibly according to the different scenarios. 0: Use of rhythm priority speed planning; 1: Adopt a soft-priority, fast-planning approach. |
robot_id |
Robotic IID for dual or multi-robot arm motion control. 0: (default) Mechanical arm of id in the controller type file. 1: Mechanical arm of id 1 in the control machine type document. |
Return Value: none
Example:
# Zu 15 model
endPosJ = [0,0,0,0,0,0]
endPosL = [0,0,0,0,0,0]
pos_mvl = [0,0,0,0,0,0]
pos_waypoint = [0,0,0,0,0,0]
set_tool_id(0)
set_user_frame_id(0)
endPosJ = [13.187 ,80.642 ,97.289 ,91.046 ,-88.980 ,-5.741]
movj(endPosJ, 0, 60, 200, 0) # 5 Parameters
endCon_Hj5Vu0vPxcRWewys6tA6 = [-1, -1, -1]
endPosJ = [44.483 ,80.642 ,97.289 ,91.046 ,-88.980 ,-5.741]
movj(endPosJ, 0, 60, 200, 0, endCon_Hj5Vu0vPxcRWewys6tA6) # 6 parameters
endCon_P0z9CPUaM6VViMjrX8mf = [-1, -1, -1]
endPosJ = [13.187 ,80.642 ,97.289 ,91.046 ,-88.980 ,-5.741]
movj(endPosJ, 0, 60, 200, 0, endCon_P0z9CPUaM6VViMjrX8mf,1) # 7 parameters
endCon_XEQqXa4nuSqkFUu3nwAX = [-1, -1, -1]
endPosJ = [44.483 ,80.642 ,97.289 ,91.046 ,-88.980 ,-5.741]
movj(endPosJ, 0, 60, 200, 0, endCon_XEQqXa4nuSqkFUu3nwAX,1,0) # 8 parameters
movec
Command Syntax:
movc(var_pos_mid, var_pos_end, rel_flag, vel, acc, tol, turn_cnt) # 7 parameters
movc(var_pos_mid, var_pos_end, rel_flag, vel, acc, tol, turn_cnt, end_cond) # 8 parameters
movc(var_pos_mid, var_pos_end, rel_flag, vel, acc, tol, turn_cnt, end_cond, movc_mode) # 9 parameters
movc(var_pos_mid, var_pos_end, rel_flag, vel, acc, tol, turn_cnt, end_cond, movc_mode, planner_type)
movc(var_pos_mid, var_pos_end, rel_flag, vel, acc, tol, turn_cnt, end_cond, movc_mode, planner_type, robot_id)
Description:
It is used to control robots in the Cartesian space arc movement.
Parameters:
|
Six-element array specifying the intermediate point of the arc; define it before use. |
|---|---|
|
Six-element array specifying the end point of the arc; define it before use. |
|
Motion mode. Only absolute motion is currently supported; set this parameter to |
|
Commanded joint speed in deg/s, subject to the maximum speed of each joint. |
|
Motion acceleration in mm/s2. |
|
End-point tolerance. |
|
Non-negative number of arc revolutions. |
|
Optional three-element stop-condition array: |
|
Optional orientation mode, effective when |
|
Optional velocity-planning mode: |
|
Robot ID for dual-robot or multi-robot control. |
Return Value: none
Example:
# Zu 15 model
endPosJ = [0,0,0,0,0,0]
endPosL = [0,0,0,0,0,0]
pos_mvl = [0,0,0,0,0,0]
pos_waypoint = [0,0,0,0,0,0]
set_tool_id(0)
set_user_frame_id(0)
endCon_UVOTzWMDQPCvnYNDMZ78 = [-1, -1, -1]
endPosJ = [37.399 ,62.195 ,113.698 ,94.107 ,-90.000 ,37.399]
movj(endPosJ, 0, 60, 200, 0, endCon_UVOTzWMDQPCvnYNDMZ78,1)
endCon_vx4cnIAdgBWueR0AUS2J = [-1, -1, -1]
passPos = [-600.000,100.000,700.000,-180.000,0.000,90.000]
endPos = [-800.000,-100.000,700.000,-180.000,0.000,90.000]
movc(passPos, endPos, 0, 250, 1200, 0, 1) # 7 parameters
endCon_5GIIkUcWwXQJ88GjuoeN = [-1, -1, -1]
endPosJ = [37.399 ,62.195 ,113.698 ,94.107 ,-90.000 ,37.399]
movj(endPosJ, 0, 60, 200, 0, endCon_5GIIkUcWwXQJ88GjuoeN,1)
endCon_wgO4L4bhhf9FaMELLH4P = [-1, -1, -1]
passPos = [-600.000,-300.000,700.000,180.000,0.000,90.000]
endPos = [-800.000,-100.000,700.000,180.000,0.000,90.000]
movc(passPos, endPos, 0, 250, 1200, 0, 1, endCon_wgO4L4bhhf9FaMELLH4P) # 8 parameters
endCon_wgn4JqmGzgnoR7czsXfw = [-1, -1, -1]
endPosJ = [37.399 ,62.195 ,113.698 ,94.107 ,-90.000 ,37.399]
movj(endPosJ, 0, 60, 200, 0, endCon_wgn4JqmGzgnoR7czsXfw,1)
endCon_48LioWCySzmj4freJNnS = [-1, -1, -1]
passPos = [-400.000,-300.000,500.000,180.000,0.000,90.000]
endPos = [-400.000,-100.000,300.000,180.000,0.000,90.000]
movc(passPos, endPos, 0, 250, 1200, 0, 1, endCon_48LioWCySzmj4freJNnS,0) # 9 parameters
endCon_a9ZrKEqwWmgcGFOJrasw = [-1, -1, -1]
endPosJ = [37.399 ,62.195 ,113.698 ,94.107 ,-90.000 ,37.399]
movj(endPosJ, 0, 60, 200, 0, endCon_a9ZrKEqwWmgcGFOJrasw,1)
endCon_GPiBONpvTms1as0TVpus = [-1, -1, -1]
passPos = [-400.000,100.000,500.000,180.000,0.000,90.000]
endPos = [-400.000,-100.000,300.000,180.000,0.000,90.000]
movc(passPos, endPos, 0, 250, 1200, 0, 1, endCon_GPiBONpvTms1as0TVpus,0,1) # 10 parameters
endCon_UVOTzWMDQPCvnYNDMZ78 = [-1, -1, -1]
endPosJ = [37.399 ,62.195 ,113.698 ,94.107 ,-90.000 ,37.399]
movj(endPosJ, 0, 60, 200, 0, endCon_UVOTzWMDQPCvnYNDMZ78,1)
endCon_vx4cnIAdgBWueR0AUS2J = [-1, -1, -1]
passPos = [-600.000,100.000,700.000,-180.000,0.000,90.000]
endPos = [-800.000,-100.000,700.000,-180.000,0.000,90.000]
movc(passPos, endPos, 0, 250, 1200, 0, 1, endCon_GPiBONpvTms1as0TVpus,0,1,0) # 11 parameters
move_ext
Command Syntax:
move_ext(ext_id,var_pos, rel_flag, vel, acc, tol,end_cond, planner_type)
Description:
Used to set external axle motion commands.
Parameters:
|
Integer ID of the external-axis motion unit. |
|---|---|
|
Target position array whose dimension matches the external axis degrees of freedom. A target position ID (integer) may also be supplied. |
|
Motion mode: |
|
Commanded speed. The unit is mm/s for a linear external axis and deg/s for a rotary external axis. |
|
Commanded acceleration. The unit is mm/s2 for a linear external axis and deg/s2 for a rotary external axis. |
|
End-point tolerance. |
|
Optional three-element stop-condition array: |
|
Optional velocity-planning mode: |
Return Value:
None
Example:
# External-axis motion example
endCon_FSnDVILoIRCaoIsHCCcO = [-1, -1, -1]
end_ext_0 = [50]
move_ext(0, end_ext_0, 0, 80, 80, 0, endCon_FSnDVILoIRCaoIsHCCcO,0)
set_move_multi_info
Command Syntax:
set_move_multi_info(move_info_string, move_unit_type, motion_type, move_unit_id, motion_cmd_info)
Description:
The action segment information used to set up the motion module for synergetic motion.
Parameters:
move_info_string |
String type, which represents the label for naming the movement segment information, may be named but is not limited to: “movj_rob_0”, “movj_ext_0”, “movl_rob_0”, “movc_rob_0”. |
|---|---|
move_unit_type |
Int type, indicating type of motor unit: · 0 for robots; • 1 is an external axis. |
motion_type |
Integer specifying the motion type: 0 for joint motion, 1 for linear motion, and 2 for circular motion. When |
move_unit_id |
Int, which indicates that the motor unit is in the controller id. |
motion_cmd_info |
Motion-segment command data. Its argument count and format depend on |
Return Value:
None
Example:
# Robot joint-motion example
endPosJ = [0.000 ,90.000 ,90.000 ,90.000 ,90.000 ,0.000]
set_move_multi_info( "movj_rob_0", 0, 0, 0, endPosJ, 0, 60, 200, 0)
# Robot linear-motion example
endPosL = [-356.145 ,-245.514 ,587.150 ,0.000 ,0.000 ,-40.000]
set_move_multi_info("movl_rob_0", 0, 1, 0, endPosL, 0, 60, 200, 0,180,720)
# Robot circular-motion example
passPos = [-356.145,-245.514,587.150,0.000,0.000,-40.000]
endPos = [-300.000,-240.000,587.150,0.000,0.000,-40.000]
set_move_multi_info("movc_rob_0", 0, 2, 0, passPos, endPos, 0, 60, 200, 0, 0,0)
# External-axis joint-motion example
end_ext_posJ_0 = [50]
set_move_multi_info("movj_ext_0", 1, 0, 0, end_ext_posJ_0, 0, 80, 80, 0)
move_multi
Command Syntax:
move_multi(var_move_seg_num, move_info_string1, move_info_string2,... ,end_cond, planner_type)
Description:
To set the synergetic motion command to be used in conjunction with the set_move_multi_info command.
Parameters:
var_move_seg_num |
Int type, the total number of labels, i.e., how many sports modules/sports the synergetic exercise contains, may not be greater than 10. |
|---|---|
move_info_string1, move_info_string2,… |
is the parameter “move_info_stream” in the set_move_multi_info command, stanning type, movement segment information labels, numbers corresponding to var_move_seg_num. |
end_cond |
The paragraph directs the cessation conditions, with the optional parameters being an array consisting of three parameters, including: di_type: IO type and module ID (Note: Modular ID applies to robotic master stations extending multiple IO modules from 0 to 0 starting index) complex fields with 16 below IO type and 16 above IO type (or 0 if not applicable). The IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations di_index: IO address. di_state: IO meets condition status 0/1. |
planner_type |
The type of speed planning is an optional parameter, which is selected flexibly according to the different scenarios. 0: Use of rhythm priority speed planning; 1: Adopt a soft-priority, fast-planning approach. |
Return Value:
None
Example:
# Coordinated joint-motion example for a robot and an external axis
endCon_ozAy4xNbJVWhp9r7qvnS = [-1, -1, -1]
endPosJ = [0.000 ,90.000 ,90.000 ,90.000 ,90.000 ,0.000]
set_move_multi_info( "movj_rob_0", 0, 0, 0, endPosJ, 0, 60, 200, 0)
end_ext_posJ_0 = [50]
set_move_multi_info("movj_ext_0", 1, 0, 0, end_ext_posJ_0, 0, 80, 80, 0)
move_multi(2, "movj_rob_0", "movj_ext_0", endCon_ozAy4xNbJVWhp9r7qvnS,0)
get_atl_joint_pose
Command Syntax:
atlJntPos = get_atl_joint_pose()
Description:
is used to retrieve the actual joint position of the current robot.
Return Value:
Returns the current actual joint position.
get_atl_tcp_pose
Command Syntax:
atlTcpPos = get_atl_tcp_pose()
Description:
The central position for the actual end-of-the-manufacturance tool of the current robot.
Return Value:
Returns the center position at the end of the current actual tool.
get_atl_flange_pose
Command Syntax:
atlFlangePos = get_atl_flange_pose()
Description:
This is used to get a position at the centre of the current end of the robot.
Return Value:
Returns the current position at the end of the actual French centre.
enable_speed_override
Command Syntax:
enable_speed_override(type, vel, acc)
enable_speed_override(type, vel, acc, ori_vel, ori_acc)
Description:
to set the speed and acceleration of a function block.
Parameters:
type |
|
|---|---|
vel |
Double type data, which indicates the speed of the coverage set. |
acc |
Double type data, which is the acceleration of the range set. |
ori_vel |
Double type data, which indicates the orientation speed of the overlay set. Default value: 90.0 |
ori_acc |
Double type data, which is the orientation acceleration of the overlay set. Default value: 180.0 |
Return Value:
None
disable_speed_override
Command Syntax:
disable_speed_override(type)
Description:
to cancel the speed and acceleration settings of the function block.
Parameters:
type |
|
Return Value:
None
enable_planner_override
Command Syntax:
enable_planner_override(type)
Description:
Sets the type of global speed planner.
Parameters:
type |
The type of global speed planning, with flexibility to choose according to the different scenes. 0: Use of rhythm priority speed planning; 1: Adopt a soft-priority, fast-planning approach. The speed planning parameters in a single instruction will expire when the global speed planning command is used. |
Return Value:
None
disable_planner_override
Command Syntax:
disable_planner_override()
Description:
to cancel the setup for the global speed planner type.
Return Value:
None
vib_suppress_on
Command Syntax:
vib_suppress_on (var_freq)
Description:
To open a vibration inhibition, the vibration inhibition takes effect in the sports section after the directive and before vib_suppress_off.
Parameters:
var_freq |
The double type, dithered inhibition frequency. The active range is [2.5, 50.0] Hz, which is automatically limited to the boundary value when out of range. |
Return Value:
None
vib_suppress_off
Command Syntax:
vib_suppress_off ()
Description:
Close the vibration inhibition.
Return Value:
None
movs
Command Syntax:
movs(coefs_a, coefs_b, coefs_c, coefs_d, coef_time)
movs(coefs_a, coefs_b, coefs_c, coefs_d, coef_time, smooth_space)
movs(coefs_a, coefs_b, coefs_c, coefs_d, coef_time, smooth_space, robot_id)
Description:
To control robots in the implementation of multi-track trajectories (for the planning of axle tracks by a given multi-form coefficient).
Parameters:
velcoefs_a/coefs_b/coefs_c/coefs_d |
Multiple coefficient arrays (6 or 7 elements, corresponding axes) to support array or system variables. |
|---|---|
coef_time |
Sports time, units. |
smooth_space |
Optional parameter, space type: 0 is joint space 1 is Cartesian space. |
robot_id |
Optional parameter, robot ID, default zero. |
Return Value:
None
movs_vel_settings
Command Syntax:
Description:
To set the synchronous speed and acceleration limits of the movs movement.
Parameters:
movs_syn_vel |
Synchronization speed, not less than 0.001 |
|---|---|
movs_enable_jacc |
Whether or not to enable the additional acceleration limit: . 1 is enabled. 0 is disabled. |
robot_id |
Robot ID. |
Return Value:
None
kine_inverse_ext
Command Syntax:
Description:
This directive is used to calculate the motor reverse (expanded version) and to support extended information such as external axes on the basis of kine_inverse.
Parameters:
posJ |
posJ is a reference joint value for determining the selection of the reverse solvency. |
|---|---|
posP |
There is a need for a reverse cartesian position. |
Return Value:
Returns the results of the countermotion calculation. When the reversal fails, the error is terminated.
Conveyor Tracking
enable_conveyor_linear_track
Command Syntax:
enable_conveyor_linear_track(dir, mm_per_pulse, trigger, com_dis, max_dis)
Description:
It’s used to enable straight-line transfer belt tracking.
Parameters:
|
Tracking-direction array containing at least three elements. For example, |
|---|---|
|
Encoder scale in millimetres of conveyor travel per pulse. |
|
Optional distance from the robot motion start point to the conveyor-tracking start point, used to define where tracking begins. Range: 0–3000 mm. |
|
Compensation for the difference between the actual and taught positions. Range: ±100 mm. |
|
Optional distance from the robot motion start point to the end point, used to limit tracking travel and prevent the robot from leaving the conveyor workspace or reaching a singularity. Range: 1–3000 mm. |
Return Value:
None
enable_conveyor_circular_track
Command Syntax:
enable_conveyor_circular_track(convey_P1, convey_P2, convey_P3, rad_per_pulse, rotate_tool, com_dis, max_dis)
Description:
It’s used to track a circular conveyor belt.
Parameters:
|
Three coplanar points on the circular conveyor, expressed in the world frame and selected in the conveyor’s direction of rotation. Each point is a three-element position vector. The points determine the conveyor-center frame transformation. |
|---|---|
|
Encoder scale in degrees per count (°/cnt), positive about the conveyor frame’s Oz axis according to the right-hand rule. |
|
|
|
Compensation for the difference between the actual and taught positions, within ±20°. |
|
Tracking-angle limit from the motion start to end, within 1–20°. Values above 20° are executed as 20°. |
Return Value:
None
disable_convayor_track
Command Syntax:
disable_convayor_track()
Description:
To turn off the transfer belt tracking.
Return Value:
None
record_pulse_cond()
Command Syntax:
record_pulse_cond(type, index, state)
Description:
When this command is used, the information on the location of the material that triggers the IO is recorded in the controller, and the information on the location of the stored material is obtained in the order in which it is stored.
Parameters:
type |
The IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
The numbering of the controlled number output, indexing from 0. |
state |
|
Return Value:
None
get_pulse_cond()
Command Syntax:
get_pulse_cond()
Description:
Use to retrieve stored conveyor pulse Queue information
Return Value:
None
clear_pulse_cond()
Command Syntax:
clear_pulse_cond()
Description:
Transfer belt pulse queue information used to empty storage
Return Value:
None
record_pos_cond()
Command Syntax:
record_cond(array)
Description:
Queue of variables used to store bit position sets, which can be matched with a conveyor belt for visual follow-up, and store position information from the camera
Parameters:
array |
location variable or program variable, which must be a 12-digit array. |
Return Value:
None
get_pos_cond()
Command Syntax:
get_pos_cond()
Description:
It’s used to get stored position line information.
Return Value:
Bit Queue Variables retrieved from Bit Queue
clear_pos_cond()
Command Syntax:
clear_pos_cond()
Description:
Queue information for empty storage
Return Value:
None
get_pulse_num()
Command Syntax:
get_pulse_num()
Description:
Number of targets to access stored in the current transport belt pulse queue
Return Value:
Number of objects stored in the current conveyor band pulse queue
get_pos_num()
Command Syntax:
get_pos_num()
Description:
Number of targets to store in the current position queue
Return Value:
Number of targets stored in the current position queue
Compliant Motion Control
set_compliance_ft_config
Command Syntax:
set_compliance_ft_config(id, admitctrlconfig, immed)
Description:
For a constant smooth control configuration. admitctrlconfig is the configuration parameter array.
Parameters:
id |
Representative Configuration Axis Number [0, 5] |
|---|---|
admitctrlconfig |
= [opt, FTuser, FTreboundK, FTconstant, FTnormalTrack] opt: Whether or not to open the constant softness in this direction (direction of the axis specified by the id parameters), 1 for opening and 0 for not opening. FTuser: The rigidity shown by robots in the process of constant and smooth control requires more than 5 in the direction of the general force and more than 0.2 in the direction of the force. FTreboundK: The elasticity factor that occurs when deviating from the original position creates a tendency to bounce back to the original position. You need to set a non-negative number in which zero means no rebound. FTconstant: represents target persistence. FTnormalTrack: Internal preset parameters shall be given a fixed value of 0. |
immed |
For internal prefixing parameters, a fixed value 1 must be given. |
Return Value:
None
disable_force_control
Command Syntax:
disable_force_control()
Description:
It’s used to shut down power control.
Return Value:
None
enable_force_control
Command Syntax:
enable_force_control(type, compensation, robot_id=0)
Description:
For flexible control type configuration and sensor compensation.
Parameters:
type |
Presets the parameters and the current version is not effective. |
|---|---|
compensation |
Presets the parameters and the current version is not effective. |
robot_id optional parameter, robotic ID, default 0. = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = *
Return Value:
None
set_end_force_condition
Command Syntax:
condition = [enableEndCond, lowFlag, lowLimitForce, upFlag, upLimitForce]
set_end_force_condition(axis, condition, robot_id)
Description:
When this termination is triggered, the motor command will be terminated immediately and the program will jump to the next line of the motor directive to continue.
Parameters:
axis |
Axis, range [0, 5] |
|---|---|
enableEndCond |
Whether or not to enable, 1 is effective, 0 is the opposite. |
lowFlag |
Motion-termination lower effective mark, 1 is effective, 0 is not. |
lowLimitForce |
The minimum limit for the end of movement. |
upFlag |
Motion-termination cap sign, 1 is effective, 0 is not. |
upLimitForce |
Motion termination limit |
robot_id |
Optional parameter, robot ID, default zero. |
Return Value:
None
set_force_control_frame
Command Syntax:
set_force_control_frame(ftFrame, robot_id)
Description:
This function is used to set the power-controlled coordinate system.
Parameters:
|
Force-control frame: |
|---|---|
|
Optional robot ID; default: |
Return Value:
None
get_sensor_torque
Command Syntax:
torq = get_sensor_torque(type, sensor_id)
Description:
Returns the force/torque values measured by the force/torque sensor or at the robot flange. The returned values are net values after compensation for the end payload.
Parameters:
|
|
|---|---|
|
Optional sensor ID; default: |
Return Value:
Six-axis force/torque sensor readings returned as a six-element array.
set_force_sensor_zero
Command Syntax:
set_force_sensor_zero()
Description:
End-force sensor zero.
Parameters:
None
Return Value:
None
Interface Configuration and Query
I/O Control and Query
set_digital_output
Command Syntax:
set_digital_output(type, index, tarState, immed)
Description:
to control the digital output signal.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
The numbering of the controlled number output, indexing from 0. |
tarState |
|
immed |
|
Note:
The IO Directive interrupts the transfer between the different motion segments and is not immediately limited to the control cabinet DO/AO available.
Return Value:
None
set_analog_output
Command Syntax:
set_analog_output(type, index, tarValue, immed)
Description:
to control the analogue output signal.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Controls the numbering of the simulated output, indexing from 0. |
tarValue |
Real type value to specify the target value for the simulation output. |
immed |
|
Note:
The IO directives interrupt the transfer between the different parts of the movement.
Return Value:
None
get_digital_output
Command Syntax:
get_digital_output(type, index)
Description:
The status of the given number output.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Digital Output Index |
Return Value:
Function returns query result: 0-> off, 1-> on
get_analog_output
Command Syntax:
get_analog_output(type, index)
Description:
to get the specified state of the simulation output.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Simulation Output Index |
Return Value:
function returns the search result of the double type.
get_digital_input
Command Syntax:
get_digital_input(type, index)
Description:
Gets the state of the specified number input.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Digital Input Index |
Return Value:
function returns the query result: 0 is off, 1 is open.
get_analog_input
Command Syntax:
get_analog_input(type, index)
Description:
Gets the specified state of the simulated input.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Simulate Input Index |
Return Value:
function returns the search result of the double type.
set_multiple_digital_outputs
Command Syntax:
set_multiple_digital_outputs(type, indexArr, valueArr, syncFlag)
Description:
Sets the status values for multiple DOs.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
valueArr |
The target numerical array of the control IO is open for single IO state 1 and closed for zero. |
syncFlag |
Synchronization sign slots, when syncFlag is one, waits for all pre-order instructions to be executed (which interrupts the pre- and post-command movement transfer), and when syncFlag is zero, for implementation. |
Note:
The directive does not support the buffer order, i.e., the batch setting of IOs without affecting the transfer.
Return Value:
None
set_multiple_analog_outputs
Command Syntax:
set_multiple_analog_outputs(type, indexArr, valueArr, syncFlag)
Description:
Sets the target values for multiple simulated output channels in batches.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
valueArr |
The target value array of the corresponding channel (floating point values, units depending on the range). |
syncFlag |
Synchronization sign slots, when syncFlag is one, waits for all pre-order instructions to be executed (which interrupts the pre- and post-command movement transfer), and when syncFlag is zero, for implementation. |
Note:
The directive does not support the buffer order, i.e., the batch setting of IOs without affecting the transfer.
Return Value:
None
get_multiple_digital_outputs
Command Syntax:
retArr = get_multiple_digital_outputs(type, indexArr)
Description:
The current status of multiple digital output channels for batch reading.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
Return Value:
An array of status values for the corresponding channel (0/1, 0, off, 1 on).
get_multiple_analog_outputs
Command Syntax:
retArr = get_multiple_analog_outputs(type, indexArr)
Description:
The current output value used to read multiple analogue output channels in bulk.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
Return Value:
The current output value array (floating point) of the corresponding channel.
get_multiple_digital_inputs
Command Syntax:
retArr = get_multiple_digital_inputs(type, indexArr)
Description:
The current status of multiple digital input channels for batch reading.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
Return Value:
The input status array of the corresponding channel (0/1, 0 off, 1 on).
get_multiple_analog_inputs
Command Syntax:
retArr = get_multiple_analog_inputs(type, indexArr)
Description:
Batch reading of current input values for multiple simulated input channels.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
indexArr |
Controlled IO index arrays (the same module), index counts from 0. |
Return Value:
The input value array (floating point) of the corresponding channel.
wait_input
Command Syntax:
wait_input(type, index, state, time)
Description:
Waits for the specified input to become a specified state, and if the maximum waiting time is exceeded, the TIMEUT status mark can be used to query the GETTIMEUT function.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Index entered |
state |
Expected input status |
time |
The maximum waiting time is 0 for unlimited waiting. |
Return Value:
None
get_timeout
Command Syntax:
get_timeout()
Description:
This function is used to obtain the results of the execution of the wait_input command.
1 For waiting time out, 0 for successfully waiting until the signal within the specified time.
Return Value:
None
set_motion_digital_output
Command Syntax:
set_motion_digital_output(type, index, refpoint, distance, tarState)
Description:
To control the output of a digital signal during motion.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
The numbering of the controlled number output, indexing from 0. |
refpoint |
Signal trigger distance from selected reference point 0 as the starting point • 1 is the end point |
distance |
Signal trigger distance. |
tarState |
|
Note:
You can set up an IO directive in up to eight of the two sports directives.
Return Value:
None
set_motion_analog_output
Command Syntax:
set_motion_analog_output(type, index, refpoint, distance, tarValue)
Description:
is used to control the output of analogue signals during motion.
Parameters:
type |
IO type and Modular ID (Note: Modular ID applies to robotic home station extension of multiple IO modules, indexing from 0), complex fields with 16 below IO type and 16 above module ID (or 0 if not applicable). IO type is defined as follows: - 0: Standard IO (control cabinet IO) - 1: Tools IO - 2: Modbus Extension IO. - 4: Modbus IO. - 5: Profinet IO. - 6:EtherNet/IP IO - 9: Profinet Extension IO. - 12:30 CCLink IO - 13:EtherCAT extends the IO. - 3, 7, 8, 10, 11: Reservations |
|---|---|
index |
Controls the numbering of the simulated output, indexing from 0. |
refpoint |
Signal trigger distance from selected reference point 0 as the starting point • 1 is the end point |
distance |
Signal trigger distance. |
tarValue |
Real type value to specify the target value for the simulation output. |
Note:
You can set up an IO directive in up to eight of the two sports directives.
Return Value:
None
TIO+Control and Query
tio_update_signal
Command Syntax:
tio_update_signal(strId, freq)
Description:
Use to refresh the specified TIO Modbus RRU signal with a specified period of time.
Parameters:
strId |
Identifier for Signal Volume |
|---|---|
freq |
For 0:00, only once; For other positives, the frequency is refreshed and the internal frequency is automatically limited to the CAN communication bottlenecks. |
Return Value:
None
tio_get_signal_value
Command Syntax:
res = tio_get_signal_value(strId)
Description:
The value that you want to use to get the specified signal.
Parameters:
strId |
Identifier for Signal Volume |
Return Value:
Returns the value of the signal.
tio_send_command
Command Syntax:
tio_send_command(chnId, cmdBuf, crcType, immed)
Description:
to send byte data to the specified TIO RS485 channel.
Parameters:
chnId |
Channel number. 0 for RS485 Channel 1 1 for RS 485 Channel 2 |
|---|---|
cmdBuf |
Bytes |
crcType |
Sends data type, effective when the channel specified is RS485. Modbus RRU writes 0. |
immed |
0 is an immediate instruction and 1 is an immediacy directive. If it is an immediacy directive, the practical implementation of the directive will take place before the next movement directive. |
Return Value:
None
Network Communication
socket_open
Command Syntax:
sockid = socket_open(ip, port, ssl_enable, keepAlive, keepIdle, keepInterval, keepCount)
Description:
To open the specified IP and port numbers and to save the created SOCKET sentence handle in the variable and return.
Parameters:
ip |
String type TCP server address, e.g. “192.168.1.10 “ |
|---|---|
port |
TCP Server Port |
ssl_enable |
Whether ssl, 0 is not enabled and 1 is enabled |
keepAlive |
optional parameters, whether to enable TCP safe job (SO_KEPALIVE), 0 or 1 |
keepIdle |
Optional parameter, free time (sec). |
keepInterval |
Optional parameters, live detection interval (sec). |
keepCount |
Optional parameters, number of live detections. |
Return Value:
Backsocket handle
socket_close
Command Syntax:
socket_close(sockid)
Description:
to close the specified patch.
Parameters:
sockid |
Socket connection to close |
Return Value:
None
socket_get_var
Command Syntax:
varname = socket_get_var(sockid, type, argname, timeout,timeopt,defaultvalue)
Description:
to request a remote-to-parameter setting.
Parameters:
sockid |
Socket ID, created in advance. |
|---|---|
type |
Parameter type. … … . • 1 is floating point 2 is a string |
argname |
The name of the variable of the string type, which is the value of the variable you want to acquire. Form is “argname” or <argname> |
timeout |
Obtaining feedback waits for overtime, 0 for permanent waiting. |
timeopt |
Optional parameter, default value 2. Operation after timeout to receive the variable: 0: Discontinuation after timeout of the receiving variable 1: Timeout after reception 2: Collect variable after time has elapsed and continues to run |
defaultvalue |
Optional parameter. When an anomaly occurs, such as overtime, it is the return value of the receiving command. |
Return Value:
Returns the value to store the variable.
This function will send a string set <arg_varname> through socket and expect to receive the data format <arg_varname><value>. The default timeout of 2s returns 0 after timeout.
When an array is expected to be sent, the above-spaced format is as follows:
<arrName><{num1, num2, …, numN}>
When a string is expected to be sent, the above-placed machine sends in the following format:
<strName><”stringValue”>
Example:
\_b41s50sf7mpd9j5j = [-99.991,-399.991,300,180,0.0,90.008,92.016,82.182,120.004,67.814,-90.000,92.008]
\_jaka_socket_server_1 = socket_open("192.168.58.1", 1000, 0)
\_xs7fOkKGQRfrBycO9rAx = socket_get_var(_jaka_socket_server_1, 0, "pos1", 1, 2, \_b41s50sf7mpd9j5j)
\_b41s50sf7mpd9j5j = \_xs7fOkKGQRfrBycO9rAx
socket_close(_jaka_socket_server_1)
socket_read_real
Command Syntax:
res = socket_read_real(sockid, num, timeout, timeopt, defaultvalue)
Description:
The number (set) is to be obtained from the outside through a defined socket and stored in an array of variables.
Parameters:
sockid |
Socket ID, created in advance. |
|---|---|
num |
Number expected to receive. |
timeout |
Get feedback waiting time out of time, in seconds, and 0 for permanent. |
timeopt |
Optional parameter, default value 2. Operation after timeout of the acceptance variable: 0, stop running after timeout of the recipient variable 1. Timeout after reception Two, take over time and continue. |
defautvalue |
Optional parameter. The return value for the receiving command after an anomaly such as overtime occurs. |
Return Value:
Results of data received.
If the acceptance fails, the target 0 is returned, and the successful acceptance is in arrays.
Defaults for 2s timeout, if reception fails, returns 0.
Example:
\_1c25p8d6c3kkeche = [1,2,3,4,5]
\_jaka_socket_server_1 = socket_open("192.168.58.1", 1000, 0)
\_xV0CEY1c02D5XkiCQKLa = socket_read_real(_jaka_socket_server_1, 5, 1)
\_1c25p8d6c3kkeche = \_xV0CEY1c02D5XkiCQKLa
socket_close(_jaka_socket_server_1)
socket_read_string
Command Syntax:
res = socket_read_string(sockid, prefix, suffix, timeout)
Description:
to retrieve a string from the outside and store it in a variable by a specified socket.
function is formatted as Get#string#prefix#suffix# and expected to be formatted as prefixSTRINGsuffix.
Parameters:
sockid |
Socket ID, created in advance. |
|---|---|
prefix |
Expects to receive a prefix requirement for a string. |
suffix |
The suffix requirement for the expected recipient string. |
timeout |
Obtaining feedback waits for overtime, 0 for permanent waiting. |
Return Value:
Results of data received.
Default timeout of 2s returns an empty string if the reception fails.
Example:
sockid = socket_open("192.168.58.1", 1000, 0)
prefix = "abc"
suffix = "xyz"
res = socket_read_string(sockid, prefix, suffix, 3)
# Serverend to send abcSTRINGxyz
# res = "STRING"
socket_close(sockid)
socket_send
Command Syntax:
res = socket_send(sockid, var)
Description:
to send the value of a variable as a string through the specified SOCKET.
Parameters:
sockid |
Socket ID, created in advance. |
|---|---|
var |
The variable that you want to send, the variable currently supports Number, Number arrays, and the String type. When sending arrays, the string format for sending is “{Num1, Num2, …}” |
Return Value:
Res sends the result sign.
Defaults to send 2s overtime. If sent successfully, returns the number of bytes (positive integers) actually sent, otherwise returns 0.
The data format sent is:
<varName><varValue>
<intVar><12>
<strVar><”string”>
<listVar><{ele1, ele2, ele3, …}>
socket_recv
Command Syntax:
res = socket_recv(sockid, timeout, timeopt, defaultvalue)
Description:
For receiving data from specified socket, the user sets the timeout.
Note:
The directive is simply intended to receive data and does not send a request to another interface.
Parameters:
sockid |
Socket ID, created in advance. |
|---|---|
timeout |
Receives timeout settings in seconds. 0 is permanent waiting and never timeout. |
timeopt |
Optional parameter, default value 2. Operation after timeout of the acceptance variable: 0, stop running after timeout of the recipient variable 1. Timeout after reception Two, take over time and continue. |
defautvalue |
Optional parameter. The return value for the receiving command after an anomaly such as overtime occurs. |
Return Value:
normal receiving, the function returns the received string.
returns an empty string if the data is not received over time;
If there is a network problem, then the target number 1 is returned.
Example:
\_dlg3d1h0c2fpamhe = " "
\_jaka_socket_server_1 = socket_open("192.168.58.1", 1000, 0)
\_bkzsRALzcKwvhGauKlsa = socket_recv(_jaka_socket_server_1, 1) # Receive string, timeout=1
\_dlg3d1h0c2fpamhe = \_bkzsRALzcKwvhGauKlsa
socket_close(_jaka_socket_server_1)
Parameter Configuration and Query
Payload Configuration and Query
set_payload
Command Syntax:
set_payload(m, centriod)
Description:
to set the current robot load.
Parameters:
m |
Load mass, unitkg. |
|---|---|
centroid |
Load mass core, consisting of an array of x, y, z of three points, in mm. |
Note:
The directive is synchronized and the switch is interrupted.
Return Value:
None
get_payload
Command Syntax:
payload = get_payload()
Description:
To get the current robot load.
Return Value:
Returns the total load at the end of the robot Frank.
Payload [0] is load mass (in kg) and Payload[1] ~[3] is load mass (in mm).
Example:
payload = [100, 100, 0]
set_payload(3, payload)
payload_res = get_payload()
# Result
#payload_res = [3.0, 100.0, 100.0, 0.0]
config_payload
Command Syntax:
config_payload(payload_id, switch_interval)
Description:
Sets the load ID used by the current robot, and sets a smooth transition time for the load switch. The directive mainly addresses the problem of possible misreporting of collisions due to the difference in the actual load of the load-to-load moment robot and the load of the load used in the control model.
Parameters:
payload_id |
Anticipated use of load ID. |
|---|---|
switch_interval |
Requested smooth transition time in seconds, in the range [0, 1]. When enabled, the system limits torque-change slopes to reduce vibration during payload switching. |
Note:
The directive is synchronized and the switch is interrupted.
Return Value:
None
Collision-Level Configuration and Query
set_collision_level
Command Syntax:
set_collision_level(clsnLevel)
Description:
The command is not supported by default.
If the JKS program that is performed contains the instruction, the main line is reported when the instruction is deciphered, and skips the instruction and continues with the subsequent instruction; when the sub-linee is deciphered, the subsequent instruction is continued (the instruction that no movement is handled in the sub-linear and that the motion parameters are modified).
Return Value:
None
get_collision_level
Command Syntax:
res = get_collision_level()
Description:
It is used to obtain sensitivity for current impact detection.
Return Value:
Returns the sensitivity of the current collision.
Tool-Frame Configuration and Query
set_tool
Command Syntax:
set_tool(var_tool)
Description:
Sets the position of the end of the tool relative to the end of the Frank.
The French coordinates are vertically oriented to the x-axis in a positive direction, and the tool IO connector port is y-axis in the negative direction.
Parameters:
var_tool |
At the end of the tool is the bias relative to the French coordinate system, which is the 6-element array. |
Return Value:
None
set_tool_id
Command Syntax:
set_tool_id(id)
Description:
to set the tool coordinate id.
Parameters:
id |
Value [-1, 15]. The maximum support [0,15] within the control system consists of 16 tool frames, which specify the tool bias values currently in use by setting id. When id is 0, the default tool frame overlaps with the French coordinates. id is -1 only for the Al12 type and uses the coordinates of the inner camera at the end of the type. |
Return Value:
None
get_tool_offsets
Command Syntax:
res = get_tool_offsets()
Description:
is the value for which the current tool coordinates are biasd.
Return Value:
Returns a 6-Element array.
get_tool_offsets_of
Command Syntax:
res = get_tool_offsets_of(id)
Description:
The given tool coordinates are given a bias value.
Parameters:
id |
The specified tool frame with a range of [1, 15]. |
Return Value:
Returns a 6-Element array.
User-Frame Configuration and Query
set_user_frame
Command Syntax:
set_user_frame(user_frame)
Description:
to set the user-coordinate system.
Sets the tool ID will be set to 1 and the program will not be saved when set up. (The application only takes effect during running).
Parameters:
user_frame |
The user coordinate value, which is a group of six elements. |
Return Value:
None
set_user_frame_id
Command Syntax:
set_user_frame_id(id)
Description:
to set the user coordinates id.
Parameters:
id |
Taking value [0, 15]. The control system supports the top 16 user-coordinates by setting ID to specify the currently used user-coordinate bias value. When id is 0, the user-defined coordinate system is not used, but the default world-coordinate system. |
Return Value:
None
get_user_frame
Command Syntax:
res = get_user_frame()
Description:
is the current user-coordinate bias value.
Return Value:
Returns a 6-Element array.
get_user_frame_of
Command Syntax:
res = get_user_frame_of(id)
Description:
A given user-coordinate bias value.
Parameters:
id |
The specified user coordinates range is [1, 15]. |
Return Value:
Returns a 6-Element array.
Utility Function Library
Math Library
Prototype of function |
Function description |
|---|---|
res = abs(arg) |
Calculates the absolute value of the expression |
res = atan2(arg_y, arg_x) |
This instruction is used to calculate the angle of the point of calculation (arg_x, arg_y) relative to the point of origin (°) with an output angle range (-180°, 180°) |
res = atan(arg) |
This command is used to calculate the arc tangent of the input value arg (angular, in °) with an output angle range (-180°, 180°) |
res = acos(arg) |
Arc cosine function, return value in ° |
res = asin(arg) |
Thin function, return value in ° |
res = cos(arg) |
Cosine function, parameter in ° |
res = sin(arg) |
Sine function, parameter in ° |
res = tan(arg) |
Tangent function, parameter in ° |
res = floor(arg) |
Remove Down |
res = ceil(arg) |
Lift Up |
res = round(arg) |
Rounded and rounded |
res = sqrt(arg) |
Take Square Roots |
res = ln(x) |
Calculates the natural logarithm of the given value, i.e. “How many inches equal to x” and e is a natural constant. x: Enter a value that must be positive (x > 0) |
res=exp(x) |
To calculate the natural index function, i.e. “x-side” for “e” and “e” for natural constants |
res = rad2deg(arg) |
radarithmic |
res = deg2rad(arg) |
Angle radians |
Pose Operations
pose_add
Command Syntax:
res = pose_add(pos1, pos2)
Description:
is used to calculate the sum of the two bits and to return the calculation.
A simple cumulative calculation of the location;
The orientation calculation is R_res = R_pos2 * R_pos1.
Note:
R indicates the rotation matrix.
Return Value:
Returns the result of the calculation.
Example:
# (S5 Type)
pos1 = [200.0 ,0.0 ,600.0 ,90.0 , -0.0, 0.0]
pos2 = [-300, -400, -300, 90, 0, 90]
add_res = pose_add(pos1, pos2)
# Result
# add_res = [-100.0 -400.0 300.0 180.0 0.0 90.0]
pose_sub
Command Syntax:
res = pose_sub(pos1, pos2)
Description:
is used to calculate the difference between the two positions and to return the calculation result.
a simple subtraction calculation of the location;
The orientation calculation is R_res = inv(R_pos2) * R_pos1.
Note:
R indicates the rotation matrix.
Return Value:
Returns the result of the calculation.
Example:
# (S5 Type)
pos1 = [-100,-400,300,180,0,90]
pos2 = [-300,-400,-300,90,0,90]
res = pose_sub(pos1, pos2)
# Result
# res = [ 200.0 0.0 600.0 90.0 -0.0 0.0]
pose_dist
Command Syntax:
res = pose_dist(pos1, pos2)
Description:
For the calculation of the distance between the two positions, only the coordinates of the position are taken into account.
Return Value:
Returns the result of the calculation.
Example:
# (S5 Type)
pos1 = [-100,-400,300,180,0,90]
pos2 = [-300,-400,-300,90,0,90]
Dist_res = pose_dist(pos1, pos2)
# Results sqrt (-100-(-300)) + sqr (300- (-300))
# Dist_res = 632.45550537109
pose_inv
Command Syntax:
res = pose_inv(pos)
Description:
to calculate the reverse transformation of a given position.
Return Value:
Returns the result of the calculation in the form of apose.
Example:
# (S5 Type)
basePose = [-100,-400,300,180,0,90]
transPose = [100,100,0,90,45,0]
Pi_res= pose_inv(transPose)
PT_res = pose_trans(basePose, transPose) # Change
res = pose_trans(PT_res, Pi_res) # Reverse the result after the change
# Result
# Pi_res =[ -70.711 -70.711 100.0 -90.0 -0.0 45.0]
# PT_res =[ 0.0 -300.0 300.0 -90.0 -45.0 90.0]
# res = [-100.0 -400.0 300.0 180.0 0.0 90.0 ]
pose_trans
Command Syntax:
res = pose_trans(p_from, p_from_to)
Description:
For the computation of position transformations, p_from is the starting position of the transformation and p_from_to is the increase of the position of the transformation.
The calculation is p_res = p_from * p_from_to.
Return Value:
Returns the result of the position.
Example:
# (S5 Type)
basePose = [-100,-400,300,180,0,90]
transPose = [100,100,0,90,45,0]
PT_res = pose_trans(basePose, transPose)
# Result
# PT_res = 0 -300.0 300.0 -90.0 45.0 90.0
pose_intpl
Command Syntax:
res = pose_intpl(pos1, pos2, alpha)
Description:
is used to calculate the plug-in point between the two points according to the given coefficient.
The formula is: p_res = pos1 + (pos2 - pos1) * alpha
where alpha > = 0 and alpha < = 1 contains orientation and its insertion method is the same linear interpolation.
Return Value:
Returns the location variable of the plug-in point.
Example:
# (S5 Type)
pos1 = [-100,-400,300,180,0,90]
pos2 = [-300,-400,-300,90,0,90]
alpha = 0.5
res = pose_intpl(pos1, pos2, alpha)
# Result
# res =[ -200.0 -400.0 0.0 135.0 0.0 90.0]
xy_plane_trans
Command Syntax:
res = xy_plane_trans(posebase, dx, dy, drz)
Description:
Transforms posebase in its XY plane: rotate by drz degrees about the local Z axis, then translate by dx along the local X axis and by dy along the local Y axis.
Return Value:
returns the changed position.
Example:
# (S5 Type)
posebase = [-100,-400,300,180,0,90]
dx = 100
dy = 100
drz = 90
xyT_res= xy_plane_trans(posebase, dx, dy, drz)
# Results:
#xyT_res = [ -0 -300.0 300.0 180.0 -0.0 180.0]
Note: Attitudinal changes following rotation around the axis cannot be simply compared, but if verified, can be calculated using the following formula:
First convert the RPY orientation of posebase to a rotation matrix. Use the Z axis of posebase, expressed in the user frame, as the rotation axis. The following equations give the transform for the specified rotation angle:
There are:
The orientation change calculation formula is as follows:
The position transformation formula is as follows:
yz_plane_trans
Command Syntax:
res = yz_plane_trans(posebase, dy, dz, drx)
Description:
Transforms posebase in its YZ plane: rotate by drx degrees about the local X axis, then translate by dy along the local Y axis and by dz along the local Z axis.
Return Value:
returns the changed position.
Example:
# (S5 Type)
posebase = [-100,-400,300,180,0,90]
dy = 100
dz = 100
drx = 90
res = yz_plane_trans(posebase, dy, dz, drx)
# Results:
#res = [ -100.0 -300.0 400.0 -90.0 -90.0 0.0]
Note: Attitudinal changes following rotation around the axis cannot be simply compared, but if verified, can be calculated using the following formula:
First convert the RPY orientation of posebase to a rotation matrix. Use the X axis of posebase, expressed in the user frame, as the rotation axis. The following equations give the transform for the specified rotation angle:
There are:
The orientation change calculation formula is as follows:
The position transformation formula is as follows:
zx_plane_trans
Command Syntax:
res = zx_plane_trans(posebase, dz, dx, dry)
Description:
Transforms posebase in its ZX plane: rotate by dry degrees about the local Y axis, then translate by dz along the local Z axis and by dx along the local X axis.
Return Value:
returns the changed position.
Example:
# (S5 Type)
posebase = [-100,-400,300,180,0,90]
dz = 100
dx = 100
dry = 90
zxT_res= zx_plane_trans(posebase, dz, dx, dry)
# Results:
#zxT_res = [0.0 -400.0 400.0 -90.0 -0.0 90.0]
Note: Attitudinal changes following rotation around the axis cannot be simply compared, but if verified, they can be calculated using the following formula:
First convert the RPY orientation of posebase to a rotation matrix. Use the Y axis of posebase, expressed in the user frame, as the rotation axis. The following equations give the transform for the specified rotation angle:
There are:
The orientation change calculation formula is as follows:
The position transformation formula is as follows:
kine_inverse
Command Syntax:
res = kine_inverse(posJ, posP)
Description:
The directive is used to calculate motor reverses.
The function is to calculate the joint space position corresponding to the posP of the Cartesian space position entered.
posJ is a set of joint values near this resolved joint value to determine the selection of the resolved function oversolved.
Return Value:
Returns the results of the counter-motorization calculation.
When a reversal fails, the error is terminated.
Example:
# (S5 Type)
posP = [-100,-400,300,180,0,90]
PosJ = [91.34,108.433,90.751,70.816,-90,91.34]
kI_res = kine_inverse(posJ, posP)
# Result
#kI_res = [92.015 82.184 120.003 67.813 -90.0 92.015]
kine_forward
Command Syntax:
res = kine_forward(posJ)
Description:
It’s for computational motor science.
The function is to calculate the joint angle entered for the Cartesian space position.
Return Value:
Returns the result of a positive athletic calculation.
Example:
# (S5 Type)
posJ = [91.34,108.433,90.751,70.816,-90, 91.34]
res = kine_forward(posJ)
# Result
# res = [-100,-600.00310646982,300,180.0,-0.0,90.0]
is_pose_reachable
Command Syntax:
res = is_pose_reachable(posP)
With reference joint angles, use the following command:
res = is_pose_reachable_refjpos (posP)
Description:
It is used to determine whether, in the current position, it is possible to move through Cartesian space to the posP.
Return Value:
If so, return 1 (requirement genuine);
If not, return 0 (subject to leave).
Example:
# S5 robotics, current joint positions [91.34, 108.433, 90.751, 70.816, 90, 91.34]
posP = [-100,-400,300,180,0,90]
res = is_pose_reachable(posP) # Reference joint angle default to current joint position
# Result
#res = 1
is_pose_reachable_refjpos
Command Syntax:
res = is_pose_reachable_refjpos (posP, ref_jointPos)
Description:
This instruction is used to query whether the given Cartesian space position is available at the given reference angle, ref_jointPos: to provide a reference for posP reverse.
Return Value:
If so, return 1 (requirement genuine);
If not, return 0 (subject to leave).
Example:
# S5 robotics.
posP = [-100,-400,300,180,0,90]
ref_posJ = [91.34,108.433,90.751,70.816,-90,91.34]
res = is_pose_reachable_refjpos(posP,ref_posJ)
# Result
#res = 1
set_target_pose
Command Syntax:
set_target_pose(poseID, fieldType, <...>)
Description:
Sets the value or specific field value for which the target pose is specified.
Parameters:
poseID |
Specifies the ID of the target pose, the integer value, with a range of [0,65535]. |
|---|---|
fieldType |
Identification of the desired field of the target pose. Integer values, the value range is: 1, [1, 10]. The values are defined as follows: -1: All fields; - 1: Target position name, target pose name, type of string - 2: Cartesian pose, the field corresponds to an array of six lengths, [x,y,z,a,b,c] - 3: Tool rame ID, the field corresponds to the utility coordinates ID - 4: User frame ID, this field corresponds to the user coordinates ID - 5: SEW configuration, the field corresponds to an array of three lengths, [s,e,w] - 6: External axes, the field corresponds to an array of six lengths, [x,y,z,a,b,c] - 7: Joint position, the field corresponds to an array of nine lengths and less than nine joints plus zero. - 8: Tool zone amongfset, the field corresponds to a 6-length array, [x,y,z,a,b,c] - 9: User frame input, the field corresponds to a 6-length array, [x,y,z,a,b,c] - 10: Varaible, 0 read-only, 1 readable |
… |
When FieldType is one, all parameter values for field 1-10 should be provided; When FieldType is a value between [1,10], only the parameter values of the corresponding field should be provided. |
Return Value:
None.
Errors are reported and the program is terminated when setting an error, if the poseID is invalid, if the name conflict or value is invalid.
get_target_pose
Command Syntax:
<...> = get_target_pose(poseID, fieldType)
Description:
Querys the value or specific field value for which the target pose is specified.
Parameters:
poseID |
Specifies the ID of the target pose, the integer value, with a range of [0,65535]. |
|---|---|
fieldType |
Identification of the desired field of the target pose. Integer values, the value range is: 1, [1, 10]. The values are defined as follows: -1: All fields; - 1: Target position name, target pose name, type of string - 2: Cartesian pose, the field corresponds to an array of six lengths, [x,y,z,a,b,c] - 3: Tool rame ID, the field corresponds to the utility coordinates ID - 4: User frame ID, this field corresponds to the user coordinates ID - 5: SEW configuration, the field corresponds to an array of three lengths, [s,e,w] - 6: External axes, the field corresponds to an array of six lengths, [x,y,z,a,b,c] - 7: Joint position, the field corresponds to an array of nine lengths and less than nine joints plus zero. - 8: Tool zone amongfset, the field corresponds to a 6-length array, [x,y,z,a,b,c] - 9: User frame input, the field corresponds to a 6-length array, [x,y,z,a,b,c] - 10: Varaible, 0 read-only, 1 readable |
Return Value:
The value of all fields or specific fields at the target pose of the query. When an error in the query is invalid, the error is reported and the application is terminated. Note: Multiple return values exist when the field value of the target pose of the query is FieldType.
get_target_pose_to_array
Command Syntax:
dataArray = get_target_pose_to_array(poseID)
Description:
Retrieving all data fields specified as poseID and forming arrays returns.
Parameters:
poseID |
Specifies the ID of the target pose, the integer value, with a range of [0,65535]. |
Return Value:
returns a single array containing all data at this target pose in a data format that:
[PointID,Label,X,Y,Z,Rx,Ry,Rz,Tool,Frame,Shoulder,Elbow,Wrist,ExJ1,ExJ2,ExJ3,ExJ4,ExJ5,ExJ6,J1,J2,J3,J4,J5,J6,J7,J8,J9,toolOffX,toolOffY,toolOffZ,toolOffRx,toolOffRy,toolOffRz,userOffX,userOffY,userOffZ,userOffRx,userOffRy,userOffRz,Variable]
If you specify that the target pose of aposeID does not exist, the application is misreported and the running is terminated.
delete_target_pose
Command Syntax:
delete_target_pose(poseID)
Description:
Deletes the given target pose of the posteID.
Parameters:
poseID |
Specifies the ID of the target pose, the integer value, with a range of [0,65535]. |
Return Value:
None.
When you specify the target pose of aposeID does not exist, the program will run properly; when aposeID is invalid, the program will report the error and terminate the operation.
target_pose_exists
Command Syntax:
target_pose_exists(poseID)
Description:
Ask if you have specified the target pose of the posteID.
Parameters:
poseID |
Specifies the ID of the target pose, the integer value, with a range of [0,65535]. |
Return Value:
Query result 0 is non-existent, 1 is non-existent.
When a posteID is invalid, the application is misreported and the running is terminated.
String Operations
sprintf
Command Syntax:
resLen,bufferOut = sprintf(stringFormat, …)
Description:
For formatting the output of a string, you are about to specify that the data will be output as a string in the specified format.
Parameters:
stringFormat |
Defines the format string, which currently only supports the variable form. Supports formatting of three types of variables: %f, %d, %s. Formats such as: %f, %s, %d |
|---|---|
… |
To format variables, variable parameters. Supports integer, floating point and string type variables, or constants. |
Return Value:
sstrLen: returns the length of the string if the formatting is successful, otherwise returns 1.
struut: returns a string.
Example:
num1 = 66
num2 = 55.3
num3 = 0.3
formatStr = "%f,%f,%f"
resLen,strOut = sprintf(formatStr, num1,num2,num3)
# Results:
#strOut = "66,55.3,0.3"
sscanf
Command Syntax:
resNum,... = sscanf(bufferIn, stringFormat)
Description:
For formatting a string, a string that matches a certain format enters the data into a variable.
Parameters:
bufferIn |
Strings to be matched, only variable formats are currently supported. |
|---|---|
stringFormat |
Defines the format string, which currently only supports the variable form. Supports formatting of three types of variables: %f, %d, %s. Formats such as: %f, %d, %s %f matches a floating point number; %d matches the decimal integer, the + or -optional before the number; %s matches a string and reads a continuous character until you encounter a space character (space, line breaks, tabs, etc.) or the next matching character in a formatted string (non %s, %f, %d). |
Return Value:
ResNum: returns the number of matching variables if the formatting is successful, otherwise returns 1.
…: Variables used to receive formatted outputs, variable parameters, and the number and type of variables predefined in stingFormat. Variables of integer, floating point and string types are supported.
Example:
strIn = "1#2#3#4#5#6#7#8"
a1,a2,a3,a4,a5,a6,a7,a8=0,0,0,0,0,0,0,0
resNum,a1,a2,a3,a4,a5,a6,a7,a8 = sscanf(strIn,"%d#%d#%d#%d#%d#%d#%d#%d")
# Result
#resNum = 8
# a1,a2,a3,a4,a5,a6,a7,a8 = 1 2 3 4 5 6 7 8
string_concat
Command Syntax:
strRes = string_concat(str1, str2)
Description:
is used to close two numbers or strings in a string and to return the string after the spell.
Parameters:
str1 |
substrings, variables, or constants. |
|---|---|
str2 |
substrings, variables, or constants. |
Return Value:
strRes: String-string results.
Example:
str1 = "str1"
str2 = "str2"
concatStr = string_concat(str1, str2)
# Result
#concatStr = "str1str2"
get_string_from_array
Command Syntax:
resLen,stringOut = get_string_from_array(arrayIn, splittingToken)
Description:
is used to convert array elements into string form and to create a full string by enslaving the separator you enter.
Parameters:
arrayIn |
The array given by the user. |
|---|---|
splittingToken |
String-format separator. |
Return Value:
ResLen: returns the length of the string (not containing cut-offs) if the conversion is successful;
If you fail, go back to 1.
stringout: a string that is successfully converted.
Example:
arrIn=[1,2,3,4,5,6,7,8]
sep="#"
ret,strOut = get_string_from_array(arrIn,sep)
# Implementation result:
#ret = 15
#strOut = "1#2#3#4#5#6#7#8"
get_array_from_string
Command Syntax:
resNum,arrayOut = get_array_from_string(stringIn, splittingToken)
Description:
to convert a given string to an array variable.
Parameters:
stringIn |
The string given by the user (includes data in an array). |
|---|---|
splittingToken |
String-format separator. |
Return Value:
ResNum: returns the number of elements of the array if the conversion is successful;
If you fail, go back to 1.
arayout: converts a successful array.
Example:
strIn = "1,2,3,4,5,6"
sep=","
ret,arrOut = get_array_from_string(strIn,sep)
# Results:
# ret = 6
# arrOut = [1,2,3,4,5,6]
get_length
Command Syntax:
len = get_length(str_or_arr)
Description:
The length of the string or array that you use to get.
Return Value:
If the parameter data type is not an array or string, returns 1, without error, the program continues to perform normally.
Example:
len = get_length(int_val)
# Parameter int_val is an integer variable, and the result of the command execution is len = -1.
strcmp
Command Syntax:
res = strcmp(str1, str2)
Description:
is used for a comparison between two strings.
Return Value:
If str1 = str2, returns zero;
If str1<str2, returns negative;
If sstr1>str2, returns the positive number.
Program Control and Debugging
log_message
Command Syntax:
log_message(level, message)
Description:
Use the user to add log information on your own.
Parameters:
level |
Log message type. Specific definitions are as follows: ·INFO:1 ·WARNING:2 ·ERROR:3 |
|---|---|
message |
Log message text. |
Return Value:
None
get_system_clock
Command Syntax:
clock = get_system_clock()
Description:
For users to access the system in real time clocks.
Return Value:
is the number of double-type floating points in ms (ms) precise to 10 ns.
At the bottom, CLONK_MONOOTONIC is used, i.e., the number of hours passed after the system was activated.
sleep
Command Syntax:
sleep(time)
Description:
A period of time for the duration of the procedure.
Parameters:
time |
Length of delay, units. Time = 0 indicates unlimited waiting. |
Note:
The directive would interrupt the transfer between the different parts of the movement.
Return Value:
None
pause
Command Syntax:
pause()
Description:
All threads will be suspended when the command is called.
Return Value:
None
exit
Command Syntax:
exit()
Description:
Used to control the termination of the operating procedures.
Return Value:
None
execute_script
Command Syntax:
execute_script ( jks_file_path )
Description:
This instruction is used to load the specified jks script document and to continue the instructions after the specified document has been completed.
Parameters:
file_path |
Enter the desired jks script file path. |
It should be noted that the jks script executed by execute_script defaults on the definition of a function in the main-line environment, and if, when a graphical program is used, the corresponding jks file of the other work project file is selected and defined as a separate function, the error function is not defined at the time of execution.
Return Value:
None
call_function
Command Syntax:
succ, <...> = call_function(func_name, <arg1, ..., argN>)
Description:
The function is called by reference to the given function name and the given function.
Parameters:
func_name |
Name of function to call |
|---|---|
arg1, …, argN |
Conditional input parameters, for all input parameters required for the called function |
Return Value:
succ |
Function Call Success, 0 for Call Failed, 1 for Call Success |
|---|---|
… |
When succ is 1 the call is successful, the return value of the second or subsequent is the return value of the called function; when succ is 0 the call fails, the second return parameter is the call error information. |
slice
Command Syntax:
res = slice(array, startIndex, endIndex, step)
Description:
Slice access to arrays.
Parameters:
array |
Enter the array to be visited by the slice, note: This command does not support a string. |
|---|---|
startIndex |
The starting index (included) of the series of slices accessed with a value range of [0,N], in which the N-group length, |
endIndex |
The end index (excluding) of the array slices accessed, with the value range [startIndex+1, N], of which the N-group length. |
step |
Slice step. The default is |
Return Value:
Returns an array of slices to access an array of results.
Note:
When step > 0, endIndex < = startIndex and endIndex > = 0;
When step < 0, endIndex > = startIndex and endIndex < N.
# Example 1:
array= [1,2,3,4,5,6,7,8]
startIndex = 0
endIndex = 7
step = 2
res = slice(array, startIndex, endIndex, step)
# Result: res=[1,3,5,7]
# Example 2:
startIndex = 7
endIndex = 0
step = -2
res = slice(array, startIndex, endIndex, step)
# Result: res=[8,6,4,2]
Multithreading Commands
thread_create
Command Syntax:
thread_create(thread_file_path, thread_name, detach)
Description:
to create a sub-routine and start a thread run.
Parameters:
|
Absolute path of the thread program file. It must be stored under |
|---|---|
|
Unique string identifying the thread. Creating another thread with the same name fails. |
|
Optional Boolean; default: |
Return Value:
None
thread_join
Command Syntax:
thread_join(thread_name)
Description:
The function is used to synchronize the operation that specifies the thread, which is only effective in the main thread.
Parameters:
thread_name |
Thread recognition is the only string. Repeating a thread name will prompt the creation failure. |
Return Value:
None
thread_destroy
Command Syntax:
thread_destroy(thread_name)
Description:
The function is used to destroy a given thread, which is only effective in the main thread.
Parameters:
thread_name |
Thread recognition is the only string. Repeating a thread name will prompt the creation failure. |
Return Value:
None
thread_enter_critical
Command Syntax:
thread_enter_critical()
Description:
For linear access to critical areas.
Return Value:
None
thread_exit_critical
Command Syntax:
thread_exit_critical()
Description:
is used for a linear exit critical area operation.
Return Value:
None
Shanghai JAKA Robotics Ltd.
Address: 610 Sawakawa Road, Shanghai, 33-35
Telephone: 400-006-2665
Website: www.jaka.com






