3hac050947 TRM Rapid Overview RW 6-En
3hac050947 TRM Rapid Overview RW 6-En
3hac050947 TRM Rapid Overview RW 6-En
Table of contents
Overview of this manual ................................................................................................................... 7
How to read this manual ................................................................................................................... 9
3 Glossary 161
Index 163
Usage
This manual should be read during programming.
Organization of chapters
The manual is organized in the following chapters:
Chapter Contents
Basic RAPID program- Answers questions like "Which instruction should I use?" or "What
ming does this instruction mean?". This chapter briefly describes all in-
structions, functions, and data types grouped in accordance with
the instruction pick-lists you use when programming. It also includes
a summary of the syntax, which is particularly useful when program-
ming offline. It also explains the inner details of the language.
Motion and I/O pro- This chapter describes the coordinate systems of the robot, its ve-
gramming locity and other motion characteristics during execution.
Glossary A glossary to make things easier to understand.
References
Reference Document ID
Operating manual - IRC5 with FlexPendant 3HAC050941-001
Technical reference manual - RAPID Instructions, Functions and 3HAC050917-001
Data types
Technical reference manual manual - RAPID kernel 3HAC050946-001
Technical reference manual - System parameters 3HAC050948-001
Application manual - Controller software IRC5 3HAC050798-001
Revisions
Revision Description
- Released with RobotWare 6.0.
A Released with RobotWare 6.01.
• Added instruction TriggJIOs, see Activating outputs or interrupts
at specific positions on page 56.
Revision Description
B Released with RobotWare 6.02.
• Added trigonometric functions for data type dnum, see Arithmetic
functions on page 82.
• Added TriggDataCopy, TriggDataReset, and TriggDataValid,
see Activating outputs or interrupts at specific positions on page 56.
• Added instruction SaveCfgData, see Save configuration data on
page 88.
C Released with RobotWare 6.03.
• The signal data types are now of the data type semi value, see Non-
value data types on page 27 and Input and output signals on page 63.
D Released with RobotWare 6.04.
• Updated the data declaration sections Variable declaration on
page 30 and Persistent declaration on page 31.
• Minor corrections.
E Released with RobotWare 6.05.
• Removed the instructions DitherAct and DitherDeact.
• Added Matrix functions on page 84.
• Minor corrections.
F Released with RobotWare 6.06.
• Updated RAPID support instructions on page 87.
• Updated Behavior of the backward execution on page 100.
• Updated Singularities on page 148.
• Minor corrections.
G Released with RobotWare 6.07.
• Added CrossProd, Max and Min to Arithmetic functions on page 82.
H Released with RobotWare 6.08.
• Minor corrections.
• Updated section Interpolation of corner paths on page 120.
Syntax rules
Instructions and functions are described using both simplified syntax and formal
syntax. If you use the FlexPendant to program, you generally only need to know
the simplified syntax, since the robot automatically makes sure that the correct
syntax is used.
• Arguments that are mutually exclusive, that is cannot exist in the instruction
at the same time, are separated by a vertical bar |.
• Arguments that can be repeated an arbitrary number of times are enclosed
in curly brackets { }.
• Symbols that are written in order to obtain the correct syntax are enclosed
in single quotation marks (apostrophes) ' '.
• The data type of the argument and other characteristics are enclosed in angle
brackets < >. See the description of the parameters of a routine for more
detailed information.
The basic elements of the language and certain instructions are written using a
special syntax, EBNF. This is based on the same rules, but with some additions.
• The symbol ::= means is defined as.
• Text enclosed in angle brackets < > is defined in a separate line.
Example
GOTO <identifier> ';'
<identifier> ::= <ident> | <ID>
<ident> ::= <letter> {<letter> | <digit> | '_'}
1.1.1 Introduction
Instructions
The program consists of a number of instructions which describe the work of the
robot. Thus, there are specific instructions for the various commands, such as one
to move the robot, one to set an output, etc.
The instructions generally have a number of associated arguments which define
what is to take place in a specific instruction. For example, the instruction for
resetting an output contains an argument which defines which output is to be reset;
for example Reset do5. These arguments can be specified in one of the following
ways:
• as a numeric value, for example 5 or 4.6
• as a reference to data, for example reg1
• as an expression, for example 5+reg1*2
• as a function call, for example Abs(reg1)
• as a string value, for example "Producing part A"
Routines
There are three types of routines – procedures, functions and trap routines.
• A procedure is used as a subprogram.
• A function returns a value of a specific type and is used as an argument of
an instruction.
• Trap routines provide a means of responding to interrupts. A trap routine
can be associated with a specific interrupt; for example when an input is set,
it is automatically executed if that particular interrupt occurs.
Data
Information can also be stored in data, for example tool data (which contains all
information on a tool, such as its TCP and weight) and numerical data (which can
be used, for example, to count the number of parts to be processed). Data is
grouped into different data types which describe different types of information,
such as tools, positions and loads. As this data can be created and assigned
arbitrary names, there is no limit (except that imposed by memory) on the number
of data. These data can exist either globally in the program or locally within a
routine.
There are three kinds of data – constants, variables and persistents.
• A constant represents a static value and can only be assigned a new value
manually.
• A variable can also be assigned a new value during program execution.
Other features
Other features in the language are:
• Routine parameters
• Arithmetic and logical expressions
• Automatic error handling
• Modular programs
• Multitasking
The language is not case sensitive, for example upper case and lower case letters
are considered the same.
Identifiers
Identifiers are used to name modules, routines, data, and labels, for example:
MODULE module_name
PROC routine_name()
VAR pos data_name;
label_name:
The first character in an identifier must be a letter. The other characters can be
letters, digits, or underscores (_).
The maximum length of any identifier is 32 characters, each of these characters
being significant. Identifiers that are the same except that they are typed in the
upper case, and vice versa, are considered the same.
Reserved words
The words listed below are reserved. They have a special meaning in the RAPID
language and thus must not be used as identifiers.
There are also a number of predefined names for data types, system data,
instructions, and functions, that must not be used as identifiers.
ALIAS AND BACKWARD CASE
CONNECT CONST DEFAULT DIV
DO ELSE ELSEIF ENDFOR
ENDFUNC ENDIF ENDMODULE ENDPROC
ENDRECORD ENDTEST ENDTRAP ENDWHILE
ERROR EXIT FALSE FOR
FROM FUNC GOTO IF
INOUT LOCAL MOD MODULE
NOSTEPIN NOT NOVIEW OR
PERS PROC RAISE READONLY
RECORD RETRY RETURN STEP
SYSMODULE TEST THEN TO
TRAP TRUE TRYNEXT UNDO
VAR VIEWONLY WHILE WITH
XOR
New-line, tab and form-feed characters can be used wherever a space can be used,
except for within comments.
Identifiers, reserved words, and numeric values must be separated from one another
by a space, a new-line, tab, or form-feed character.
Numeric values
A numeric value can be expressed as:
• an integer, for example 3, -100, 3E2
• a decimal number, for example 3.5, -0.345, -245E-2
The value must be in the range specified by the ANSI IEEE 754 Standard for
Floating-Point Arithmetic.
Logical values
A logical value can be expressed as TRUE or FALSE.
String values
A string value is a sequence of characters (ISO 8859-1 (Latin-1)) and control
characters (non-ISO 8859-1 (Latin-1) characters in the numeric code range 0-255).
Character codes can be included, making it possible to include non-printable
characters (binary data) in the string as well. String length can be maximum 80
characters.
Example:
"This is a string"
"This string ends with the BEL control character \07"
If a backslash (which indicates character code) or double quote character is
included, it must be written twice.
Example:
"This string contains a "" character"
"This string contains a \\ character"
Comments
Comments are used to make the program easier to understand. They do not affect
the meaning of the program in any way.
A comment starts with an exclamation mark (!) and ends with a new-line character.
It occupies the remainder of the line (starting from the exclamation mark) and
cannot occur outside a module declaration.
! comment
IF reg1 > 5 THEN
! comment
reg2 := 0;
ENDIF
Placeholders
Placeholders can be used to temporarily represent parts of a program that are not
yet defined. A program that contains placeholders is syntactically correct and may
be loaded into the program memory.
Placeholder Description
<TDN> data type definition
<DDN> data declaration
<RDN> routine declaration
<PAR> formal optional alternative parameter
<ALT> optional formal parameter
<DIM> formal (conformant) array dimension
<SMT> instruction
<VAR> data object (variable, persistent or parameter) refer-
ence
<EIT> else if clause of if instruction
<CSE> case clause of test instruction
<EXP> expression
<ARG> procedure call argument
<ID> identifier
File header
A program file can start with the following file header (it is not required):
%%%
VERSION:1
LANGUAGE:ENGLISH
%%%
Syntax
Identifiers
<identifier> ::= <ident> | <ID>
<ident> ::= <letter> {<letter> | <digit> | '_'}
Numeric values
<num literal> ::=
<integer> [ <exponent> ]
| <decimal integer>) [<exponent>]
| <hex integer> | <octal integer>
| <binary integer>
| <integer> '.' [ <integer> ] [ <exponent> ]
| [ <integer> ] '.' <integer> [ <exponent> ]
<integer> ::= <digit> {<digit>}
<hex integer> ::= '0' ('X' | 'x')
<hex digit> {<hex digit>}
<octal integer> ::= '0' ('O' | 'o') <octal digit> {<octal digit>}
<binary integer> ::= '0' ('B' | 'b') <binary digit> {<binary digit>}
<exponent> ::= ('E' | 'e') ['+' | '-'] <integer>
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<hex digit> ::= <digit> | A | B | C | D | E | F | a | b | c | d |
e | f
<octal digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
<binary digit> ::= 0 | 1
Logical values
<bool literal> ::= TRUE | FALSE
String values
<string literal> ::= '"' {<character> | <character code> } '"'
<character code> ::= '\' <hex digit> <hex digit>
<hex digit> ::= <digit> | A | B | C | D | E | F | a | b | c | d |
e | f
Comments
<comment> ::= '!' {<character> | <tab>} <newline>
Characters
<character> ::= -- ISO 8859-1 (Latin-1)--
<newline> ::= -- newline control character --
<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
<letter> ::= <upper case letter> | <lower case letter>
<upper case letter> ::=
A | B | C | D | E | F | G | H | I | J
| K | L | M | N | O | P | Q | R | S | T
| U | V | W | X | Y | Z | À | Á | Â | Ã
| Ä | Å | Æ | Ç | È | É | Ê | Ë | Ì | Í
| Î | Ï | 1) | Ñ | Ò | Ó | Ô | Õ | Ö | Ø
| Ù | Ú | Û | Ü | 2) | 3) | ß
<lower case letter> ::=
a | b | c | d | e | f | g | h | i | j
| k | l | m | n | o | p | q | r | s | t
| u | v | w | x | y | z | ß | à | á | â | ã
| ä | å | æ | ç | è | é | ê | ë | ì | í
| î | ï | 1) | ñ | ò | ó | ô | õ | ö | ø
| ù | ú | û | ü | 2) | 3) | ÿ
1)
Icelandic letter eth.
2)
Letter Y with acute accent.
3)
Icelandic letter thorn.
1.1.3 Modules
Introduction
The program is divided into program modules and system modules.
xx1100000550
Program modules
A program module can consist of different data and routines. Each module, or the
whole program, can be copied to diskette, RAM disk, etc., and vice versa.
One of the modules contains the entry procedure, a global procedure called Main.
Executing the program means, in actual fact, executing the Main procedure. The
program can include many modules, but only one of these will have a main
procedure.
A module may, for example, define the interface with external equipment or contain
geometrical data that is either generated from CAD systems or created on-line by
digitizing (teach programming).
Whereas small installations are often contained in one module, larger installations
may have a main module that references routines and/or data contained in one or
several other modules.
System modules
System modules are used to define common, system-specific data and routines,
such as tools. They are not included when a program is saved, meaning that any
update made to a system module will affect all existing programs currently in, or
loaded at a later stage into the program memory.
Module declarations
A module declaration specifies the name and attributes of that module. These
attributes can only be added off-line, not using the FlexPendant. The following are
examples of the attributes of a module:
Attribute If specified
SYSMODULE The module is a system module, otherwise a program module
NOSTEPIN The module cannot be entered during stepwise execution
VIEWONLY The module cannot be modified
READONLY The module cannot be modified, but the attribute can be re-
moved
NOVIEW The module cannot be viewed, only executed. Global routines
can be reached from other modules and are always run as
NOSTEPIN. The current values for global data can be reached
from other modules or from the data window on the FlexPend-
ant. NOVIEW can only be defined offline from a PC.
For example:
MODULE module_name (SYSMODULE, VIEWONLY)
!data type definition
!data declarations
!routine declarations
ENDMODULE
A module may not have the same name as another module or a global routine or
data.
Syntax
Module declaration
<module declaration> ::=
MODULE <module name> [ <module attribute list> ]
<type definition list>
<data declaration list>
<routine declaration list>
ENDMODULE
<module name> ::= <identifier>
SYSMODULE
| NOVIEW
| NOSTEPIN
| VIEWONLY
| READONLY
Note
If two or more attributes are used they must be in the above order, the NOVIEW
attribute can only be specified alone or together with the attribute SYSMODULE.
<type definition list> ::= { <type definition> }
<data declaration list> ::= { <data declaration> }
<routine declaration list> ::= { <routine declaration> }
Introduction
In order to simplify programming, predefined data is supplied with the robot. This
data does not have to be created and, consequently, can be used directly.
If this data is used, initial programming is made easier. It is, however, usually better
to give your own names to the data you use, since this makes the program easier
for you to read.
Contents
User contains five numerical data (registers), one work object data, one clock, and
two symbolic values for digital signals.
Name Data type Declaration
reg1 num VAR num reg1:=0
reg2 num VAR num reg2:=0
reg3 num VAR num reg3:=0
reg4 num VAR num reg4:=0
reg5 num VAR num reg5:=0
clock1 clock VAR clock clock1
User is a system module, which means that it is always present in the memory of
the robot regardless of which program is loaded.
1.1.5 Routines
Introduction
There are three types of routines (subprograms): procedures, functions, and traps.
• Procedures do not return a value and are used in the context of instructions.
• Functions return a value of a specific type and are used in the context of
expressions.
• Trap routines provide a means of dealing with interrupts. A trap routine can
be associated with a specific interrupt and then, if that particular interrupt
occurs at a later stage, will automatically be executed. A trap routine can
never be explicitly called from the program.
Routine scope
The scope of a routine denotes the area in which the routine is visible. The optional
local directive of a routine declaration classifies a routine as local (within the
module), otherwise it is global.
Example:
LOCAL PROC local_routine (...
PROC global_routine (...
The following scope rules apply to routines:
• The scope of a global routine may include any module in the task.
• The scope of a local routine comprises the module in which it is contained.
• Within its scope, a local routine hides any global routine or data with the
same name.
• Within its scope, a routine hides instructions and predefined routines and
data with the same name.
xx1100000551
In the example above, the following routines can be called from Routine h:
• Module1: Routine c, d.
• Module2: All routines.
A routine may not have the same name as another routine, data, or data type in
the same module. A global routine may not have the same name as a module or
a global routine, global data or global data type in another module.
Parameters
The parameter list of a routine declaration specifies the arguments (actual
parameters) that must/can be supplied when the routine is called.
There are four different types of parameters (in the access mode):
• Normally, a parameter is used only as an input and is treated as a routine
variable. Changing this variable will not change the corresponding argument.
• An INOUT parameter specifies that a corresponding argument must be a
variable (entire, element or component) or an entire persistent which can be
changed by the routine.
• A VAR parameter specifies that a corresponding argument must be a variable
(entire, element or component) which can be changed by the routine.
• A PERS parameter specifies that a corresponding argument must be an entire
persistent which can be changed by the routine.
If an INOUT, VAR or PERS parameter is updated, this means, in actual fact, that the
argument itself is updated, that is it makes it possible to use arguments to return
values to the calling routine.
Example:
PROC routine1 (num in_par, INOUT num inout_par,
VAR num var_par, PERS num pers_par)
A parameter can be optional and may be omitted from the argument list of a routine
call. An optional parameter is denoted by a backslash (\) before the parameter.
Example:
PROC routine2 (num required_par \num optional_par)
The value of an optional parameter that is omitted in a routine call may not be
referenced. This means that routine calls must be checked for optional parameters
before an optional parameter is used.
Two or more optional parameters may be mutually exclusive (that is declared to
exclude each other), which means that only one of them may be present in a routine
call. This is indicated by a stroke (|) between the parameters in question.
Example:
PROC routine3 (\num exclude1 | num exclude2)
The special type, switch, may (only) be assigned to optional parameters and
provides a means to use switch arguments, that is arguments that are only specified
by names (not values). A value cannot be transferred to a switch parameter. The
only way to use a switch parameter is to check for its presence using the
predefined function, Present.
Example:
PROC routine4 (\switch on | switch off)
...
IF Present (off ) THEN
...
ENDPROC
Arrays may be passed as arguments. The degree of an array argument must comply
with the degree of the corresponding formal parameter. The dimension of an array
parameter is conformant (marked with *). The actual dimension thus depends on
Continues on next page
22 Technical reference manual - RAPID overview
3HAC050947-001 Revision: H
© Copyright 2004-2018 ABB. All rights reserved.
1 Basic RAPID programming
1.1.5 Routines
Continued
Routine termination
The execution of a procedure is either explicitly terminated by a RETURN instruction
or implicitly terminated when the end (ENDPROC, BACKWARD, ERROR, or UNDO) of
the procedure is reached.
The evaluation of a function must be terminated by a RETURN instruction.
The execution of a trap routine is explicitly terminated using the RETURN instruction
or implicitly terminated when the end (ENDTRAP, ERROR, or UNDO) of that trap routine
is reached. Execution continues from the point where the interrupt occurred.
Routine declarations
A routine can contain routine declarations (including parameters), data, a body, a
backward handler (only procedures), an error handler, and an undo handler. Routine
declarations cannot be nested, that is it is not possible to declare a routine within
a routine.
xx1100000553
Procedure declaration
For example, multiply all elements in a num array by a factor:
PROC arrmul( VAR num array{*}, num factor)
FOR index FROM 1 TO dim( array, 1 ) DO
array{index} := array{index} * factor;
ENDFOR
ENDPROC
Function declaration
A function can return any data type value, but not an array value.
Trap declaration
For example, respond to feeder empty interrupt:
TRAP feeder_empty
wait_feeder;
RETURN;
ENDTRAP
Procedure call
When a procedure is called, the arguments that correspond to the parameters of
the procedure shall be used:
• Mandatory parameters must be specified. They must also be specified in the
correct order.
• Optional arguments can be omitted.
• Conditional arguments can be used to transfer parameters from one routine
call to another.
See Using function calls in expressions on page 40.
The procedure name may either be statically specified by using an identifier (early
binding) or evaluated during runtime from a string type expression (late binding).
Even though early binding should be considered to be the normal procedure call
form, late binding sometimes provides very efficient and compact code. Late binding
is defined by putting percent signs before and after the string that denotes the
name of the procedure.
Example:
! early binding
TEST products_id
CASE 1:
proc1 x, y, z;
CASE 2:
proc2 x, y, z;
CASE 3:
...
! same example using late binding
% “proc” + NumToStr(product_id, 0) % x, y, z;
...
! same example again using another variant of late binding
VAR string procname {3} :=[“proc1”, “proc2”, “proc3”];
...
% procname{product_id} % x, y, z;
...
Note that the late binding is available for procedure calls only, and not for function
calls. If a reference is made to an unknown procedure using late binding, the system
variable ERRNO is set to ERR_REFUNKPRC. If a reference is made to a procedure
call error (syntax, not procedure) using late binding, the system variable ERRNO is
set to ERR_CALLPROC.
Syntax
Routine declaration
<routine declaration> ::=
[LOCAL] ( <procedure declaration>
| <function declaration>
| <trap declaration> )
| <comment>
| <RDN>
Parameters
<parameter list> ::=
<first parameter declaration> { <next parameter declaration> }
<first parameter declaration> ::=
<parameter declaration>
| <optional parameter declaration>
| <PAR>
<next parameter declaration> ::=
',' <parameter declaration>
| <optional parameter declaration>
| ','<optional parameter declaration>
| ',' <PAR>
<optional parameter declaration> ::=
'\' ( <parameter declaration> | <ALT> )
{ '|' ( <parameter declaration> | <ALT> ) }
<parameter declaration> ::=
[ VAR | PERS | INOUT] <data type>
<identifier> [ '{' ( '*' { ',' '*' } ) | <DIM>] '}'
| 'switch' <identifier>
Procedure declaration
<procedure declaration> ::=
PROC <procedure name>
'(' [ <parameter list> ] ')'
<data declaration list>
<instruction list>
[ BACKWARD <instruction list> ]
[ ERROR <instruction list> ]
[ UNDO <instruction list> ]
ENDPROC
<procedure name> ::= <identifier>
<data declaration list> ::= {<data declaration>}
Function declaration
<function declaration> ::=
FUNC <value data type>
<function name>
'(' [ <parameter list> ] ')'
<data declaration list>
<instruction list>
[ ERROR <instruction list> ]
[ UNDO <instruction list> ]
ENDFUNC
<function name> ::= <identifier>
Procedure call
<procedure call> ::= <procedure> [ <procedure argument list> ] ';'
<procedure> ::=
<identifier>
| '%' <expression> '%'
<procedure argument list> ::= <first procedure argument> {
<procedure argument> }
<first procedure argument> ::=
<required procedure argument>
| <optional procedure argument>
| <conditional procedure argument>
| <ARG>
<procedure argument> ::=
',' <required procedure argument>
| <optional procedure argument>
| ',' <optional procedure argument>
| <conditional procedure argument>
| ',' <conditional procedure argument>
| ',' <ARG>
<required procedure argument> ::= [ <identifier> ':=' ] <expression>
<optional procedure argument> ::= '\' <identifier> [ ':='
<expression> ]
<conditional procedure argument> ::= '\' <identifier> '?' (
<parameter> | <VAR> )
Introduction
There are three different kinds of data types:
• An atomic type is atomic in the sense that it is not defined based on any
other type and cannot be divided into parts or components, for example num.
• A record data type is a composite type with named, ordered components,
for example pos. A component may be of an atomic or record type.
A record value can be expressed using an aggregate representation, for
example [ 300, 500, depth ] pos record aggregate value.
A specific component of a record data can be accessed by using the name
of that component, for example pos1.x := 300; assignment of the x-component
of pos1.
• An alias data type is by definition equal to another type. Alias types make it
possible to classify data objects.
Syntax
<type definition>::=
[LOCAL] ( <record definition>
| <alias definition> )
| <comment>
| <TDN>
<record definition>::=
RECORD <identifier>
<record component list>
ENDRECORD
Introduction
There are three kinds of data:
• A variable can be assigned a new value during program execution.
• A persistent can be described as a persistent variable. This is accomplished
by letting an update of the value of a persistent automatically cause the
initialization value of the persistent declaration to be updated. (When a
program is saved the initialization value of any persistent declaration reflects
the current value of the persistent.)
• A constant represents a static value and cannot be assigned a new value.
A data declaration introduces data by associating a name (identifier) with a data
type. Except for predefined data and loop variables, all data used must be declared.
Data scope
The scope of data denotes the area in which the data is visible. The optional local
directive of a data declaration classifies data as local (within the module), otherwise
it is global. Note that the local directive may only be used at module level, not
inside a routine.
Example
LOCAL VAR num local_variable;
VAR num global_variable;
Program data
Data declared outside a routine is called program data. The following scope rules
apply to program data:
• The scope of predefined or global program data may include any module.
• The scope of local program data comprises the module in which it is
contained.
• Within its scope, local program data hides any global data or routine with
the same name (including instructions and predefined routines and data).
Program data may not have the same name as other data or a routine in the same
module. Global program data may not have the same name as other global data
or a routine in another module.
Routine data
Data declared inside a routine is called routine data. Note that the parameters of
a routine are also handled as routine data. The following scope rules apply to
routine data:
• The scope of routine data comprises the routine in which it is contained.
• Within its scope, routine data hides any other routine or data with the same
name.
Routine data may not have the same name as other data or a label in the same
routine.
Example
In this example, the following data can be called from routine e:
• Module1: Data c, d.
• Module2: Data a, f, g, e1.
The following data can be called from routine h:
• Module1: Data d.
• Module2: Data a, f, g, h1, c.
xx1100000554
Variable declaration
A variable is introduced by a variable declaration and can be declared as global
(no prescript needed) or local.
Example:
MainModule is loaded into task T_ROB1.
MODULE MainModule
! The scope of this variable is within T_ROB1, i.e. it can be
! accessed from any module in T_ROB1.
VAR num global_var := 123;
PROC main()
! The scope of this variable is within this procedure.
VAR num local_var2 := 321;
...
ENDPROC
ENDMODULE
A variable declared in a module that’s installed shared can be declared with the
prescript TASK, see Technical reference manual - System parameters, topic
Controller, type Automatic Loading of Modules. Such a variable will be accessible
from all tasks but will have a unique value for each task. For example changing
the variables value from one task will have no affect for other tasks.
Example:
SharedModule is installed shared in the system.
MODULE SharedModule(SYSMODULE)
! This variable is accessible from all tasks, but has a
! unique value for each task.
TASK VAR num global_var := 123;
...
ENDMODULE
Using the TASK prescript in a module that is not installed shared will have no effect.
Variables of any type can be given an array (of degree 1, 2 or 3) format by adding
dimensional information to the declaration. A dimension is an integer value greater
than 0.
Example:
VAR pos pallet{14, 18};
Variables with value types may be initialized (given an initial value). The expression
used to initialize a program variable must be constant. Note that the value of an
uninitialized variable may be used, but it is undefined, that is set to zero if it is a
num. A string is set to empty string, and a boolean is set to FALSE.
Example:
VAR string author_name := "John Smith";
VAR pos start := [100, 100, 50];
VAR num maxno{10} := [1, 2, 3, 9, 8, 7, 6, 5, 4, 3];
The initialization value is set when:
• the program/module is loaded.
• the program pointer is reset, for example program pointer to main.
Persistent declaration
Persistents can only be declared at module level, not inside a routine. Persistents
can be declared as system global (no prescript needed), task global, or local.
Example:
The following module is loaded into both T_ROB1 and T_ROB2.
MODULE MainModule
! The scope of this persistent is within the task it’s been
! loaded to. But, it will share the current value with any
! other task declaring the same persistent. I.e. changing the
! value in T_ROB1 will automatically change the value in T_ROB2.
PERS num globalpers := 123;
...
ENDMODULE
Local and task global persistents must be given an initialization value. For system
global persistents the initial value may be omitted. The initialization value must be
a single value (without data references or operands), or a single aggregate with
members which, in turn, are single values or single aggregates.
Example:
PERS pos refpnt := [100.23, 778.55, 1183.98];
Persistents of any type can be given an array (of degree 1, 2 or 3) format by adding
dimensional information to the declaration. A dimension is an integer value greater
than 0.
Example:
PERS pos pallet{14, 18} := [...];
Note that if the current value of a persistent is changed, this causes the initialization
value (if not omitted) of the persistent declaration to be updated. However, due to
performance issues this update will not take place during program execution. The
initial value will be updated when the module is saved (Backup, Save Module, Save
Program). It will also be updated when editing program. The program data window
on the FlexPendant will always show the current value of the persistent.
Example:
PERS num reg1 := 0;
...
reg1 := 5;
After module save, if the code was executed, the saved module looks like this:
PERS num reg1 := 5;
...
reg1 := 5;
Constant declaration
A constant is introduced by a constant declaration. The value of a constant cannot
be modified.
Example:
CONST num pi := 3.141592654;
A constant of any type can be given an array (of degree 1, 2 or 3) format by adding
dimensional information to the declaration. A dimension is an integer value greater
than 0.
CONST pos seq{3} := [[614, 778, 1020], [914, 998, 1021], [814, 998,
1022]];
Initiating data
The initialization value for a constant or variable can be a constant expression.
The initialization value for a persistent can only be a literal expression.
Example:
CONST num a := 2;
CONST num b := 3;
!Correct syntax
CONST num ab := a + b;
Continues on next page
32 Technical reference manual - RAPID overview
3HAC050947-001 Revision: H
© Copyright 2004-2018 ABB. All rights reserved.
1 Basic RAPID programming
1.2.2 Data declarations
Continued
Storage class
The storage class of a data object determines when the system allocates and
de-allocates memory for the data object. The storage class of a data object is
determined by the kind of data object and the context of its declaration and can
be either static or volatile.
Constants, persistents, and module variables are static, that is they have the same
storage during the lifetime of a task. This means that any value assigned to an
persistent or a module variable, always remains unchanged until the next
assignment.
Routine variables are volatile. The memory needed to store the value of a volatile
variable is allocated first upon the call of the routine in which the declaration of the
variable is contained. The memory is later de-allocated at the point of the return
to the caller of the routine. This means that the value of a routine variable is always
undefined before the call of the routine and is always lost (becomes undefined) at
the end of the execution of the routine.
In a chain of recursive routine calls (a routine calling itself directly or indirectly)
each instance of the routine receives its own memory location for the same routine
variable - a number of instances of the same variable are created.
Syntax
Data declaration
<data declaration> ::=
[LOCAL] ( <variable declaration>
| <persistent declaration>
| <constant declaration> )
| TASK <persistent declaration>
| <comment>
| <DDN>
Variable declaration
<variable declaration> ::=
VAR <data type> <variable definition> ';'
<variable definition> ::=
<identifier> [ '{' <dim> { ',' <dim> } '}' ]
[ ':=' <constant expression> ]
<dim> ::= <constant expression>
Persistent declaration
<persistent declaration> ::=
PERS <data type> <persistent definition> ';'
<persistent definition> ::=
<identifier> [ '{' <dim> { ',' <dim> } '}' ]
[ ':=' <literal expression> ]
Note
The literal expression may only be omitted for system global persistents.
Constant declaration
<constant declaration> ::=
CONST <data type> <constant definition> ';'
<constant definition> ::=
<identifier> [ '{' <dim> { ',' <dim> } '}' ]
':=' <constant expression>
<dim> ::= <constant expression>
1.3 Expressions
Description
An expression specifies the evaluation of a value. It can be used, for example:
in an assignment instruction for example: a:=3*b/c;
as a condition in an IF instruction for example: IF a>=3 THEN ...
as an argument in an instruction for example: WaitTime time;
as an argument in a function call for example: a:=Abs(3*b);
Arithmetic expressions
An arithmetic expression is used to evaluate a numeric value.
Example:
2*pi*radius
Logical expressions
A logical expression is used to evaluate a logical value (TRUE/FALSE).
Example:
a>5 AND b=3
xx1100000555
String expressions
A string expression is used to carry out operations on strings.
Example: “IN” + “PUT” gives the result “INPUT”
Operator Operation Operand types Result type
+ string concatenation string + string string
Introduction
An entire variable, persistent or constant can be a part of an expression.
Example:
2*pi*radius
Arrays
A variable, persistent or constant declared as an array can be referenced to the
whole array or a single element.
An array element is referenced using the index number of the element. The index
is an integer value greater than 0 and may not violate the declared dimension.
Index value 1 selects the first element. The number of elements in the index list
must fit the declared degree (1, 2 or 3) of the array.
Example:
VAR num row{3};
VAR num column{3};
VAR num value;
Records
A variable, persistent or constant declared as a record can be referenced to the
whole record or a single component.
A record component is referenced using the component name.
Example:
VAR pos home;
VAR pos pos1;
VAR num yvalue;
..
! get the Y component only
yvalue := home.y;
Introduction
An aggregate is used for record or array values.
Example:
! pos record aggregate
pos := [x, y, 2*x];
Prerequisites
It must be possible to determine the data type of an aggregate the context. The
data type of each aggregate member must be equal to the type of the corresponding
member of the determined type.
Example (aggregate type pos - determined by p1):
VAR pos pl;
p1 :=[1, -100, 12];
Example of what is not allowed (not allowed since the data type of neither of the
aggregates can be determined by the context):
VAR pos pl;
IF [1, -100, 12] = [a,b,b,] THEN
Introduction
A function call initiates the evaluation of a specific function and receives the value
returned by the function.
Example:
Sin(angle)
Arguments
The arguments of a function call are used to transfer data to (and possibly from)
the called function. The data type of an argument must be equal to the type of the
corresponding parameter of the function. Optional arguments may be omitted but
the order of the (present) arguments must be the same as the order of the formal
parameters. In addition, two or more optional arguments may be declared to exclude
each other, in which case, only one of them may be present in the argument list.
A required (compulsory) argument is separated from the preceding argument by
a comma “,”. The formal parameter name may be included or omitted.
Example Description
Polar(3.937, 0.785398) Two required arguments, without or with the
Polar(Dist:=3.937, parameter name.
Angle:=0.785398)
Cosine(45) One required argument, without or with one
Cosine(0.785398\Rad) switch.
An optional argument must be preceded by a backslash “\” and the formal parameter
name. A switch type argument is somewhat special; it may not include any argument
expression. Instead, such an argument can only be either "present" or "not present".
Conditional arguments are used to support smooth propagation of optional
arguments through chains of routine calls. A conditional argument is considered
to be “present” if the specified optional parameter (of the calling function) is present,
otherwise it is simply considered to be omitted. Note that the specified parameter
must be optional.
Example:
PROC Read_from_file (iodev File \num Maxtime)
..
character:=ReadBin (File \Time?Maxtime);
! Max. time is only used if specified when calling the routine
! Read_from_file
..
ENDPROC
Parameters
The parameter list of a function assigns an access mode to each parameter. The
access mode can be either in, inout, var, or pers:
• An IN parameter (default) allows the argument to be any expression. The
called function views the parameter as a constant.
• An INOUT parameter requires the corresponding argument to be a variable
(entire, array element or record component) or an entire persistent. The called
function gains full (read/write) access to the argument.
• A VAR parameter requires the corresponding argument to be a variable (entire,
array element or record component). The called function gains full (read/write)
access to the argument.
• A PERS parameter requires the corresponding argument to be an entire
persistent. The called function gains full (read/update) access to the argument.
Priority rules
The relative priority of the operators determines the order in which they are
evaluated. Parentheses provide a means to override operator priority. The rules
below imply the following operator priority:
Priority Operators
Highest * / DIV MOD
+ -
< > <> <= >= =
AND
Lowest XOR OR NOT
An operator with high priority is evaluated prior to an operator with low priority.
Operators of the same priority are evaluated from left to right.
Example expression Evaluation order Comment
a + b + c (a + b) + c Left to right rule
a + b * c a + (b * c) * higher than +
a OR b OR c (a OR b) OR c Left to right rule
a AND b OR c AND d (a AND b) OR (c AND d) AND higher than OR
a < b AND c < d (a < b) AND (c < d) < higher than AND
1.3.6 Syntax
Expressions
<expression> ::= <expr> | <EXP>
<expr> ::= [ NOT ] <logical term> { ( OR | XOR ) <logical term> }
<logical term> ::= <relation> { AND <relation> }
<relation> ::= <simple expr> [ <relop> <simple expr> ]
<simple expr> ::= [ <addop> ] <term> { <addop> <term> }
<term> ::= <primary> { <mulop> <primary> }
<primary> ::=
<literal>
| <variable>
| <persistent>
| <constant>
| <parameter>
| <function call>
| <aggregate>
| '(' <expr> ')'
Operators
<relop> ::= '<' | '<=' | '=' | '>' | '>=' | '<>'
<addop> ::= '+' | '-'
<mulop> ::= '*' | '/' | DIV | MOD
Constant values
<literal> ::= <num literal>
| <string literal>
| <bool literal>
Data
<variable> ::=
<entire variable>
| <variable element>
| <variable component>
<entire variable> ::= <ident>
<variable element> ::= <entire variable> '{' <index list> '}'
<index list> ::= <expr> { ',' <expr> }
<variable component> ::= <variable> '.' <component name>
<component name> ::= <ident>
<persistent> ::=
<entire persistent>
| <persistent element>
| <persistent component>
<constant> ::=
<entire constant>
| <constant element>
| <constant component>
Aggregates
<aggregate> ::= '[' <expr> { ',' <expr> } ']'
Function calls
<function call> ::= <function> '(' [ <function argument list> ]
')'
<function> ::= <ident>
<function argument list> ::= <first function argument> { <function
argument> }
<first function argument> ::=
<required function argument>
| <optional function argument>
| <conditional function argument>
<function argument> ::=
',' <required function argument>
| <optional function argument>
| ',' <optional function argument>
| <conditional function argument>
| ',' <conditional function argument>
<required function argument> ::= [ <ident> ':=' ] <expr>
<optional function argument> ::= '\' <ident> [ ':=' <expr> ]
<conditional function argument> ::= '\' <ident> '?' <parameter>
Special expressions
<constant expression> ::= <expression>
<literal expression> ::= <expression>
<conditional expression> ::= <expression>
Parameters
<parameter> ::=
<entire parameter>
| <parameter element>
| <parameter component>
1.4 Instructions
Description
Instructions are executed in succession unless a program flow instruction or an
interrupt or error causes the execution to continue at some other place.
Most instructions are terminated by a semicolon “;”. A label is terminated by a
colon “:”. Some instructions may contain other instructions and are terminated by
specific keywords:
Instruction Termination word
IF ENDIF
FOR ENDFOR
WHILE ENDWHILE
TEST ENDTEST
Example:
WHILE index < 100 DO
.
index := index + 1;
ENDWHILE
Pick lists
All instructions are collected into specific groups, which are described in the
following sections. This grouping is the same as can be found in the pick lists used
when adding new instructions to a program on the FlexPendant program editor.
Syntax
<instruction list> ::= { <instruction> }
<instruction> ::=
[<instruction according to separate chapter in this manual>
| <SMT>
Introduction
The program is executed sequentially as a rule, that is instruction by instruction.
Sometimes, instructions which interrupt this sequential execution and call another
instruction are required to handle different situations that may arise during
execution.
Programming principles
The program flow can be controlled according to five different principles:
• By calling another routine (procedure) and, when that routine has been
executed, continuing execution with the instruction following the routine call.
• By executing different instructions depending on whether or not a given
condition is satisfied.
• By repeating a sequence of instructions a number of times or until a given
condition is satisfied.
• By going to a label within the same routine.
• By stopping program execution.
Instruction Used to
ProcCall Call (jump to) another routine
CallByVar Call procedures with specific names
RETURN Return to the original routine
Instruction Used to
Compact IF Execute one instruction only if a condition is satisfied
IF Execute a sequence of different instructions depending on
whether or not a condition is satisfied
FOR Repeat a section of the program a number of times
WHILE Repeat a sequence of instructions as long as a given condition
is satisfied
TEST Execute different instructions depending on the value of an
expression
GOTO Jump to a label
label Specify a label (line name)
Instruction Used to
Stop Stop program execution
EXIT Stop program execution when a program restart is not allowed
Instruction Used to
Break Stop program execution temporarily for debugging purposes
SystemStopAction Stop program execution and robot movement
Instruction Used to
ExitCycle Stop the current cycle and move the program pointer to the
first instruction in the main routine.
When the execution mode CONT is selected, execution will
continue with the next program cycle.
Introduction
Various instructions are used to
• assign values to data
• wait a given amount of time or wait until a condition is satisfied
• insert a comment into the program
• load program modules.
Instruction Used to
:= Assign a value to data
Wait
The robot can be programmed to wait a given amount of time, or to wait until an
arbitrary condition is satisfied; for example, to wait until an input is set.
Instruction Used to
WaitTime Wait a given amount of time or to wait until the robot stops
moving
WaitUntil Wait until a condition is satisfied
WaitDI Wait until a digital input is set
WaitDO Wait until a digital output is set
Comments
Comments are only inserted into the program to increase its readability. Program
execution is not affected by a comment.
Instruction Used to
! Comment on the program. A line starting with ! is a comment
and is discarded by the program execution.
Instruction Used to
CancelLoad Cancel the loading of a module that is being or has been loaded
with the instruction StartLoad
CheckProgRef Check program references
Save Save a program module
EraseModule Erase a module from the program memory
Various functions
Instruction Used to
TryInt Test if data object is a valid integer
Function Used to
OpMode Read the current operating mode of the robot
RunMode Read the current program execution mode of the robot
NonMotionMode Read the current Non-Motion execution mode of the program
task
Dim Obtain the dimensions of an array
Present Find out whether an optional parameter was present when a
routine call was made
Type Returns the data type name for a specified variable
IsPers Check whether a parameter is a persistent
IsVar Check whether a parameter is a variable
Basic data
Conversion function
Function Used to
ByteToStr Convert a byte to a string data with a defined byte data format.
StrToByte Convert a string with a defined byte data format to a byte data.
Introduction
Some of the motion characteristics of the robot are determined using logical
instructions that apply to all movements:
• Maximum TCP speed
• Maximum velocity and velocity override
• Acceleration
• Management of different robot configurations
• Payload
• Behavior close to singular points
• Program displacement
• Soft servo
• Tuning values
• Activation and deactivation of event buffer
• Suppress corner path warnings
Programming principles
The basic characteristics of the robot motion are determined by data specified for
each positioning instruction. Some data, however, is specified in separate
instructions which apply to all movements until that data changes.
The general motion settings are specified using a number of instructions, but can
also be read using the system variable C_MOTSET or C_PROGDISP.
Default values are automatically set (by executing the routine SYS_RESET in system
module BASE_SHARED)
• when using the restart mode Reset system,
• when a new program is loaded,
• when the program is started from the beginning.
Function Used to
MaxRobSpeed Return the maximum TCP speed for the used robot type
Defining velocity
The absolute velocity is programmed as an argument in the positioning instruction.
In addition to this, the maximum velocity and velocity override (a percentage of
the programmed velocity) can be defined.
A limitation of the speed can also be set, and it is later on limited when a system
input signal is set.
Instruction Used to define
VelSet The maximum velocity and velocity override
SpeedRefresh Update speed override for ongoing movement
Defining acceleration
When fragile parts, for example, are handled, the acceleration can be reduced for
part of the program.
Instruction Used to
AccSet Define the maximum acceleration.
WorldAccLim Limiting the acceleration/deceleration of the tool (and gripload)
in the world coordinate system.
PathAccLim Set or reset limitations on TCP acceleration and/or TCP decel-
eration along the movement path.
Displacing a program
When part of the program must be displaced, for example following a search, a
program displacement can be added.
Instruction Used to
PDispOn Activate program displacement
PDispSet Activate program displacement by specifying a value
PDispOff Deactivate program displacement
EOffsOn Activate an additional axis offset
EOffsSet Activate an additional axis offset by specifying a value
EOffsOff Deactivate an additional axis offset
Function Used to
DefDFrame Calculate a program displacement from three positions
DefFrame Calculate a program displacement from six positions
ORobT Remove program displacement from a position
DefAccFrame Define a frame from original positions and displaced positions
Soft servo
One or more of the robot axes can be made “soft”. When using this function, the
robot will be compliant and can replace, for example, a spring tool.
Instruction Used to
SoftAct Activate the soft servo for one or more axes
SoftDeact Deactivate the soft servo
Instruction Used to
TuneReset Reset tuning to normal
PathResol Adjust the geometric path resolution
CirPathMode Choose the way the tool reorientates during circular interpola-
tion.
World zones
Up to 10 different volumes can be defined within the working area of the robot.
These can be used for:
• Indicating that the robot’s TCP is a definite part of the working area.
• Delimiting the working area for the robot and preventing a collision with the
tool.
• Creating a working area common to two robots. The working area is then
available only to one robot at a time.
The instructions in the table below are only available when the robot is equipped
with the option World Zones.
Instruction Used to
WZBoxDef Define a box-shaped global zone
WZCylDef Define a cylindrical global zone
WZSphDef Define a spherical global zone
WZHomeJointDef Define a global zone in joints coordinates
WZLimJointDef Define a global zone in joints coordinates for limitation of
working area.
WZLimSup Activate limit supervision for a global zone
WZDOSet Activate global zone to set digital outputs
WZDisable Deactivate supervision of a temporary global zone
WZEnable Activate supervision of a temporary global zone
WZFree Erase supervision of a temporary global zone
wztemporary Identify a temporary global zone
wzstationary Identify a stationary global zone
shapedata Describe the geometry of a global zone
Instruction Used to
WaitRob Wait until the robot and additional axis have reached stop point
or have zero speed.
1.8 Motion
Programming principles
The basic motion characteristics, such as the type of path, are specified by choosing
the appropriate positioning instruction.
The remaining motion characteristics are specified by defining data which are
arguments of the instruction:
• Position data (end position for robot and additional axes)
• Speed data (desired speed)
• Zone data (position accuracy)
• Tool data (for example the position of the TCP)
• Work object data (for example the current coordinate system)
Some of the motion characteristics of the robot are determined using logical
instructions which apply to all movements (see Motion settings on page 50):
• Maximum velocity and velocity override
• Acceleration
• Management of different robot configurations
• Payload
• Behavior close to singular points
• Program displacement
• Soft servo
• Tuning values
• Activation and deactivation of event buffer
Both the robot and the additional axes are positioned using the same instructions.
The additional axes are moved at a constant velocity, arriving at the end position
at the same time as the robot.
Positioning instructions
Searching
During the movement, the robot can search for the position of a work object, for
example. The searched position (indicated by a sensor signal) is stored and can
be used later to position the robot or to calculate a program displacement.
Instruction Type of movement
SearchC TCP along a circular path.
SearchL TCP along a linear path.
SearchExtJ Joint movement of mechanical unit without TCP.
Instruction Used to
TriggJIOs Run the robot (TCP) axis-by-axis with an activated I/O trigg
condition.
TriggInt Define a trigg condition to execute a trap routine at a given
position
TriggIO Define a trigg condition to set an output at a given position
TriggL Run the robot (TCP) linearly with an activated trigg condition.
TriggLIOs Run the robot (TCP) linearly with an activated I/O trigg condi-
tion.
StepBwdPath Move backwards on its path in a RESTART event routine.
TriggStopProc Create an internal supervision process in the system for zero
setting of specified process signals and the generation of re-
start data in a specified persistent variable at every program
stop (STOP) or emergency stop (QSTOP) in the system.
Functions Used to
TriggDataValid Check if the content in a triggdata variable is valid
Instruction Used to
TriggSpeed Define conditions and actions for control of an analog output
signal with output value proportional to the actual TCP speed.
Instruction Used to
ClearPath Clear the whole motion path on the current motion path level.
PathLevel Get the current path level.
SyncMoveSuspend i Suspend synchronized coordinated movements on StorePath
level.
SyncMoveResume i Resume synchronized coordinated movements on StorePath
level
i If the robot is equipped with the option MultiMove Coordinated.
Function Used to
IsStopMoveAct Get status of the stop move flags.
Data Used to
ROB_ID Get data containing a reference to the controlled robot in cur-
rent program task, if any.
Function Used to
GetMotorTorque Reads the current torque of the robot and external axes motors,
and can be used to detect if a servo gripper holds a load or
not.
GetNextMechUnit Retrieving name of mechanical units in the robot system
IsMechUnitActive Check whether a mechanical unit is activated or not
Independent axes
The robot axis 6 (and 4 on IRB 1600, 2600 and 4600 except ID versions) or an
additional axis can be moved independently of other movements. The working
area of an axis can also be reset, which will reduce the cycle times.
The instructions in the table below are only available when the robot is equipped
with the option Independent Axis.
Instruction Used to
IndAMove Change an axis to independent mode and move the axis to an
absolute position.
Instruction Used to
IndCMove Change an axis to independent mode and start the axis moving
continuously.
IndDMove Change an axis to independent mode and move the axis a
delta distance.
IndRMove Change an axis to independent mode and move the axis to a
relative position (within the axis revolution).
IndReset Change an axis to dependent mode or/and reset the working
area.
HollowWristReset i Reset the position of the wrist joints on hollow wrist manipulat-
ors, such as IRB 5402 and IRB 5403.
i Can only be used on IRB 5402 and IRB 5403.
The functions in the table below are only available when the robot is equipped with
the option Independent Axis.
Function Used to
IndInpos Check whether an independent axis is in position.
IndSpeed Check whether an independent axis has reached programmed
speed.
Path correction
The instructions, functions, and data types in the tables below are only available
when the robot is equipped with the options Path offset or RobotWare-Arc sensor.
Instruction Used to
CorrCon Check whether an independent axis is in position
CorrWrite Check whether an independent axis has reached programmed
speed
CorrDiscon Disconnect from a previously connected correction generator
CorrClear Remove all connected correction generators
Function Used to
CorrRead Read the total corrections delivered by all connected correction
generators
Path Recorder
The instructions, functions, and data types in the tables below are only available
when the robot is equipped with the option Path Recovery.
Instruction Used to
PathRecStart Start recording the robot’s path
PathRecStop Stop recording the robot’s path
PathRecMoveBwd Move the robot backwards along a recorded path
PathRecMoveFwd Move the robot back to the position where PathRecMoveBwd
was executed
Function Used to
PathRecValidBwd Check if the path recorder is active and if a recorded backward
path is available
PathRecValidFwd Check if the path recorder can be used to move forward
Conveyor tracking
The instructions in the table below are only available when the robot is equipped
with the option Conveyor tracking.
Instruction Used to
WaitWObj Wait for work object on conveyor
DropWObj Drop work object on conveyor
Sensor synchronization
Sensor Synchronization, is the function whereby the robot speed follows a sensor
which can be mounted on a moving conveyor or a press motor axis.
The instructions in the table below are only available when the robot is equipped
with the option Sensor Synchronization.
Instruction Used to
WaitSensor Connect to an object in the start window on a sensor mechan-
ical unit.
SyncToSensor Start or stop synchronization of robot movement to sensor
movement.
DropSensor Disconnect from the current object.
Instruction Used to
MotionSup i Deactivates/activates motion supervision
ParIdPosValid Valid robot position for parameter identification
ParIdRobValid Valid robot type for parameter identification
LoadId Load identification of tool or payload
ManLoadId Load identification of external manipulator
i Only if the robot is equipped with the option Collision Detection.
Position functions
Function Used to
Offs Add an offset to a robot position, expressed in relation to the
work object
RelTool Add an offset, expressed in the tool coordinate system
CalcRobT Calculates robtarget from jointtarget
CPos Read the current position (only x, y, z of the robot)
CRobT Read the current position (the complete robtarget)
CJointT Read the current joint angles
ReadMotor Read the current motor angles
CTool Read the current tooldata value
CWObj Read the current wobjdata value
ORobT Remove a program displacement from a position
MirPos Mirror a position
CalcJointT Calculates joint angles from robtarget
Distance The distance between two positions
Function Used to
PFRestart Check if the path has been interrupted at power failure.
Status functions
Function Used to
CSpeedOverride Read the speed override set by the operator from the Program
Editor or Production Window.
Motion data
Motion data is used as an argument in the positioning instructions.
Data type Used to define
robtarget The end position
jointtarget The end position for a MoveAbsJ or MoveExtJ instruction
speeddata The speed
zonedata The accuracy of the position (stop point or fly-by point)
tooldata The tool coordinate system and the load of the tool
wobjdata The work object coordinate system
stoppointdata The termination of the position
identno A number used to control synchronizing of two or more coordin-
ated synchronized movement with each other
Related information
Options Described in
Collision Detection Application manual - Controller software IRC5
Sensor Synchronization
Independent Axis
Path Offset
Path Recovery
Conveyor tracking Application manual - Conveyor tracking
MultiMove Application manual - MultiMove
RobotWare-Arc Application manual - Arc and Arc Sensor
Signals
The robot can be equipped with a number of digital and analog user signals that
can be read and changed from within the program.
Programming principles
The signal names are defined in the system parameters. These names are always
available in the program for reading or setting I/O operations.
The value of an analog signal or a group of digital signals is specified as a numeric
value.
1.10 Communication
Programming principles
The decision whether to use character-based or binary information depends on
how the equipment with which the robot communicates handles that information.
A file, for example, can have data that is stored in character-based or binary form.
If communication is required in both directions simultaneously, binary transmission
is necessary.
Each serial channel or file used must first be opened. On doing this, the channel/file
receives a descriptor that is then used as a reference when reading/writing. The
FlexPendant can be used at all times and does not need to be opened.
Both text and the value of certain types of data can be printed.
Instruction Used to
TPErase Clear the FlexPendant operator display
TPWrite Write text on the FlexPendant operator display
ErrWrite Write text on the FlexPendant display and simultaneously store
that message in the progam’s error log.
TPReadFK Label the function keys and to read which key is pressed
TPReadDnum Read a numeric value from the FlexPendant
TPReadNum Read a numeric value from the FlexPendant
TPShow Choose a window on the FlexPendant from RAPID
tpnum Represent FlexPendant window with a symbolic constant
Instruction Used to
UIMsgBox Write message to FlexPendant
Read pressed button from FlexPendant
Type basic
Instruction Used to
UIShow Open an application on the FlexPendant from RAPID
Function Used to
UIMessageBox Write message to FlexPendant
Read pressed button from FlexPendant
Type advanced
UIDnumEntry Read a numeric value from the FlexPendant
UIDnumTune Tune a numeric value from the FlexPendant
UINumEntry Read a numeric value from the FlexPendant
UINumTune Tune a numeric value from the FlexPendant
UIAlphaEntry Read text from the FlexPendant
UIListView Select item in a list from the FlexPendant
UIClientExist Is the FlexPendant connected to the system
Instruction Used to
Open Open a channel/file for reading or writing
Write Write text to the channel/file
Close Close the channel/file
Function Used to
ReadNum Read a numeric value
ReadStr Read a text string
Instruction Used to
Open Open a serial channel/file for binary transfer of data
WriteBin Write to a binary serial channel/file
WriteAnyBin Write to any binary serial channel/file
WriteStrBin Write a string to a binary serial channel/file
Rewind Set the file position to the beginning of the file
Close Close the channel/file
ClearIOBuff Clear input buffer of a serial channel
Instruction Used to
ReadAnyBin Read from any binary serial channel
WriteRawBytes Write data of type rawbytes to a binary serial channel/file/field
bus
ReadRawBytes Read data of type rawbytes from a binary serial chan-
nel/file/field bus
Function Used to
ReadBin Read from a binary serial channel
ReadStrBin Read a string from a binary serial channel/file
Instruction Used to
ClearRawBytes Set a rawbytes variable to zero
CopyRawBytes Copy from one rawbytes variable to another
PackRawBytes Pack the contents of a variable into a “container” of type raw-
bytes
UnPackRawBytes Unpack the contents of a “container” of type rawbytes to a
variable
PackDNHeader Pack the header of a DeviceNet message into a “container” of
rawbytes
Function Used to
RawBytesLen Get the current length of valid bytes in a rawbyte variable
Instruction Used to
SocketCreate Create a new socket
SocketConnect Connect to remote computer (only client applications)
SocketSend Send data to remote computer
SocketSendTo Send data to remote computer
SocketReceive Receive data from remote computer
SocketReceiveFrom Receive data from remote computer
SocketClose Close the socket
Instruction Used to
SocketBind Bind a socket to a port (only server applications)
SocketListen Listen for connections (only server applications)
SocketAccept Accept connections (only server applications)
Function Used to
SocketGetStatus Get current socket state
SocketPeek Test for the presence of data on a socket
Function Used to
RMQGetSlotName i Get the name of a RAPID Message Queue client from a given
identity number, that is from a given rmqslot
i Only if the robot is equipped with at least one of the options FlexPendant Interface, PC Interface,
or Multitasking.
1.11 Interrupts
Introduction
Interrupts are program-defined events, identified by interrupt numbers. An interrupt
occurs when an interrupt condition is true. Unlike errors, the occurrence of an
interrupt is not directly related to (synchronous with) a specific code position. The
occurrence of an interrupt causes suspension of the normal program execution
and control is passed to a trap routine.
Even though the robot immediately recognizes the occurrence of an interrupt (only
delayed by the speed of the hardware), its response – calling the corresponding
trap routine – can only take place at specific program positions, namely:
• when the next instruction is entered,
• any time during the execution of a waiting instruction, for example
WaitUntil,
• any time during the execution of a movement instruction, for example MoveL.
This normally results in a delay of 2-30 ms between interrupt recognition and
response, depending on what type of movement is being performed at the time of
the interrupt.
The raising of interrupts may be disabled and enabled. If interrupts are disabled,
any interrupt that occurs is queued and not raised until interrupts are enabled
again. Note that the interrupt queue may contain more than one waiting interrupt.
Queued interrupts are raised in FIFO order (first in, first out). Interrupts are always
disabled during the execution of a trap routine.
When running stepwise and when the program has been stopped, no interrupts
will be handled. Interrupts in queue at stop will be thrown away and any interrupts
generated under stop will not be dealt, except for safe interrupts, see Safe Interrupt
on page 72.
The maximum number of defined interrupts at any one time is limited to 100 per
program task.
Programming principles
Each interrupt is assigned an interrupt identity. It obtains its identity by creating a
variable (of data type intnum) and connecting this to a trap routine.
The interrupt identity (variable) is then used to order an interrupt, that is to specify
the reason for the interrupt. This may be one of the following events:
• An input or output is set to one or to zero.
• A given amount of time elapses after an interrupt is ordered.
• A specific position is reached.
When an interrupt is ordered, it is also automatically enabled, but can be temporarily
disabled. This can take place in two ways:
• All interrupts can be disabled. Any interrupts occurring during this time are
placed in a queue and then automatically generated when interrupts are
enabled again.
Instruction Used to
CONNECT Connect a variable (interrupt identity) to a trap routine
Ordering interrupts
Cancelling interrupts
Instruction Used to
IDelete Cancel (delete) an interrupt
Enabling/disabling interrupts
Instruction Used to
ISleep Deactivate an individual interrupt
IWatch Activate an individual interrupt
IDisable Disable all interrupts
IEnable Enable all interrupts
Interrupt data
Instruction Used to
GetTrapData in a trap routine to obtain all information about the interrupt
that caused the trap routine to be executed.
ReadErrData in a trap routine, to obtain numeric information (domain, type
and number) about an error, a state change, or a warning, that
caused the trap routine to be executed.
Safe Interrupt
Some instructions, for example ITimer and ISignalDI, can be used together
with Safe Interrupt. Safe Interrupts are interrupts that will be queued if they arrive
during stop or stepwise execution.The queued interrupts will be dealt with as soon
as continuos execution is started, they will be handled in FIFO order. Interrupts in
queue at stop will also be dealt with. The instruction ISleep can not be used
together with safe interrupts.
Interrupt manipulation
Defining an interrupt makes it known to the system. The definition specifies the
interrupt condition and activates and enables the interrupt.
Example:
VAR intnum sig1int;
ISignalDI di1, high, sig1int;
An activated interrupt may in turn be deactivated (and vice versa).
During the deactivation time, any generated interrupts of the specified type are
thrown away without any trap execution.
Example:
! deactivate
ISleep sig1int;
! activate
IWatch sig1int;
An enabled interrupt may in turn be disabled (and vice versa).
During the disable time, any generated interrupts of the specified type are queued
and raised first when the interrupts are enabled again.
Example:
! disable
IDisable sig1int;
1 enable
IEnable sig1int;
Deleting an interrupt removes its definition. It is not necessary to explicitly remove
an interrupt definition, but a new interrupt cannot be defined to an interrupt variable
until the previous definition has been deleted.
Example:
IDelete sig1int;
Trap routines
Trap routines provide a means of dealing with interrupts. A trap routine can be
connected to a particular interrupt using the CONNECT instruction. When an interrupt
occurs, control is immediately transferred to the associated trap routine (if any). If
an interrupt occurs, that does not have any connected trap routine, this is treated
as a fatal error, that is causes immediate termination of program execution.
Example:
VAR intnum empty;
VAR intnum full;
PROC main()
! Connect trap routines
CONNECT empty WITH etrap;
CONNECT full WITH ftrap;
! Define feeder interrupts
ISignalDI di1, high, empty;
ISignalDI di3, high, full;
...
! Delete interrupts
IDelete empty;
IDelete full;
ENDPROC
! Responds to “feeder empty” interrupt
TRAP etrap
open_valve;
RETURN;
ENDTRAP
! Responds to “feeder full” interrupt
TRAP ftrap
close_valve;
RETURN;
ENDTRAP
Several interrupts may be connected to the same trap routine. The system variable
INTNO contains the interrupt number and can be used by a trap routine to identify
an interrupt. After the necessary action has been taken, a trap routine can be
terminated using the RETURN instruction or when the end (ENDTRAP or ERROR) of
the trap routine is reached. Execution continues from the place where the interrupt
occurred.
Introduction
Many of the errors that occur when a program is being executed can be handled
in the program, which means that program execution does not have to be
interrupted. These errors are either of a type detected by the system, such as
division by zero, or of a type that is raised by the program, such as a program
raising an error when an incorrect value is read by a bar code reader.
An execution error is an abnormal situation, related to the execution of a specific
piece of a program. An error makes further execution impossible (or at least
hazardous). “Overflow” and “division by zero” are examples of errors.
Error numbers
Errors are identified by their unique error number and are always recognized by
the system. The occurrence of an error causes suspension of the normal program
execution and the control is passed to an error handler. The concept of error
handlers makes it possible to respond to and, possibly, recover from errors that
arise during program execution. If further execution is not possible, the error handler
can at least assure that the program is given a graceful abortion.
Programming principles
When an error occurs, the error handler of the routine is called (if there is one). It
is also possible to create an error from within the program and then jump to the
error handler.
In an error handler, errors can be handled using ordinary instructions. The system
data ERRNO can be used to determine the type of error that has occurred. A return
from the error handler can then take place in various ways (RETURN, RETRY,
TRYNEXT, and RAISE).
If the current routine does not have an error handler, the internal error handler of
the robot takes over directly. The internal error handler gives an error message
and stops program execution with the program pointer at the faulty instruction.
Instruction Used to
RAISE “Create” an error and call the error handler
Instruction Used to
BookErrNo Book a new RAPID system error number.
Instruction Used to
EXIT Stop program execution in the event of a fatal error
Instruction Used to
RAISE Call the error handler of the routine that called the current
routine
RETRY Re-execute the instruction that caused the error
TRYNEXT Execute the instruction following the instruction that caused
the error
RETURN Return to the routine that called the current routine
RaiseToUser From a NOSTEPIN routine, the error is raised to the error
handler at user level.
StartMoveRetry An instruction that replaces the two instructions StartMove and
RETRY. It both resumes movements and re-execute the instruc-
tion that caused the error.
SkipWarn Skip the latest requested warning message.
ResetRetryCount Reset the number of counted retries.
Function Used to
RemainingRetries Remaining retries left to do.
Instruction Used to
ErrLog Display an error message on the FlexPendant and write it in
the robot message log.
ErrRaise Create an error in the program and then call the error handler
of the routine.
Function Used to
ProcerrRecovery Generate process error during robot movement.
Error handlers
Any routine may include an error handler. The error handler is really a part of the
routine, and the scope of any routine data also comprises the error handler of the
routine. If an error occurs during the execution of the routine, control is transferred
to its error handler.
Example:
FUNC num safediv( num x, num y)
RETURN x / y;
ERROR
IF ERRNO = ERR_DIVZERO THEN
TPWrite "The number cannot be equal to 0";
RETURN x;
ENDIF
ENDFUNC
The system variable ERRNO contains the error number of the (most recent) error
and can be used by the error handler to identify that error. After any necessary
actions have been taken, the error handler can:
• Resume execution, starting with the instruction in which the error occurred.
This is done using the RETRY instruction. If this instruction causes the same
error again, up to four error recoveries will take place; after that execution
will stop. To be able to make more than four retries, you have to configure
the system parameter No Of Retry, see Technical reference manual - System
parameters.
• Resume execution, starting with the instruction following the instruction in
which the error occurred. This is done using the TRYNEXT instruction.
• Return control to the caller of the routine using the RETURN instruction. If the
routine is a function, the RETURN instruction must specify an appropriate
return value.
• Propagate the error to the caller of the routine using the RAISE instruction.
1.13 UNDO
Introduction
RAPID routines may contain an UNDO handler. The handler is executed automatically
if the program pointer is moved out of the routine. This is supposed to be used for
cleaning up remaining side-effects after partially executed routines, for example
canceling modal instructions (such as opening a file). Most parts of the RAPID
language can be used in an UNDO handler, but there are some limitations, for
example motion instructions.
Terminology
The following terms are related to UNDO.
• UNDO: The execution of cleaning up code prior to a program reset.
• UNDO handler: An optional part of a RAPID procedure or function containing
RAPID code that is executed on an UNDO.
• UNDO routine: A procedure or a function with an UNDO handler.
• Call-chain: All procedures or functions currently associated to each other
through not-yet finished routine invocations. Assumed to start in the routine
Main if nothing else is specified.
• UNDO context: When the current routine is part of a call-chain starting in an
UNDO handler.
bottom-up. The UNDO-handler closest to the end of the call-chain will execute first
and the one closest to Main will execute last.
Limitations
An UNDO-handler can access any variable or symbol reachable from the normal
routine body, including locally declared variables. RAPID code that are to be
executed in UNDO context has however limitations.
An UNDO-handler must not contain STOP, BREAK, RAISE, or RETURN. If an attempt
is made to use any of these instructions in UNDO context, the instruction will be
ignored and an ELOG warning is generated.
Motion instructions, for example MoveL, are not allowed in UNDO context either.
The execution is always continuous in UNDO, it is not possible to step. When UNDO
starts, the execution mode is set to continuous automatically. After the UNDO session
is finished, the old execution mode is restored.
If the program is stopped while executing an UNDO-handler, the rest of the handler
will not be executed. If there are additional UNDO-handlers in the call-chain that
have not yet been executed, they will be ignored as well. This will result in an ELOG
warning. This also includes stopping due to a runtime error.
The program pointer is not visible in an UNDO-handler. When UNDO executes, the
program pointer remains at its old location, but is updated when the
UNDO-handler(s) are finished.
An EXIT instruction aborts UNDO in similar way as a Run-time error or a Stop. The
rest of the UNDO-handlers are ignored and the program pointer is moved to Main.
Example
The program:
PROC B
TPWrite "In Routine B";
Exit;
UNDO
TPWrite "In UNDO of routine B";
ENDPROC
PROC A
TPWrite "In Routine A";
B;
ENDPROC
PROC main
TPWrite "In main";
A;
UNDO
TPWrite "In UNDO of main";
ENDPROC
The output:
In main
In Routine A
In Routine B
In UNDO of routine B
In UNDO of main
xx1100000588
Description
System and time instructions allow the user to measure, inspect and record time.
Programming principles
Clock instructions allow the user to use clocks that function as stopwatches. In
this way the robot program can be used to time any desired event.
The current time or date can be retrieved in a string. This string can then be
displayed to the operator on the FlexPendant display or used to time and date-stamp
log files.
It is also possible to retrieve components of the current system time as a numeric
value. This allows the robot program to perform an action at a certain time or on
a certain day of the week.
Instruction Used to
ClkReset Reset a clock used for timing
ClkStart Start a clock used for timing
ClkStop Stop a clock used for timing
Function Used to
ClkRead Read a clock used for timing
Function Used to
CDate Read the current date as a string
CTime Read the current time as a string
GetTime Read the current time as a numeric value
Function Used to
FileTimeDnum Retrieve the last time for modification of a file.
ModTimeDnum Retrieve file modify time for the loaded module.
ModExist Check if program module exist.
Function Used to
ProgMemFree Retrieve the size of free program memory.
1.15 Mathematics
Description
Mathematical instructions and functions are used to calculate and change the value
of data.
Programming principles
Calculations are normally performed using the assignment instruction, for example
reg1:= reg2 + reg3 / 5. There are also some instructions used for simple
calculations, such as to clear a numeric variable.
Instruction Used to
Clear Clear the value
Add Add or subtract a value
Incr Increment by 1
Decr Decrement by 1
Instruction Used to
:= Perform calculations on any type of data.
Arithmetic functions
Function Used to
Abs Calculate the absolute value
AbsDnum Calculate the absolute value
Round Round a numeric value
RoundDnum Round a numeric value
Trunc Truncate a numeric value
TruncDnum Truncate a numeric value
Max Returns the largest of two values.
Min Returns the smallest of two values.
Sqrt Calculate the square root
SqrtDnum Calculate the square root
Exp Calculate the exponential value with the base “e”
Pow Calculate the exponential value with an arbitrary base
PowDnum Calculate the exponential value with an arbitrary base
ACos Calculate the arc cosine value
ACosDnum Calculate the arc cosine value
ASin Calculate the arc sine value
Function Used to
ASinDnum Calculate the arc sine value
ATan Calculate the arc tangent value in the range [-90,90]
ATanDnum Calculate the arc tangent value in the range [-90,90]
ATan2 Calculate the arc tangent value in the range [-180,180]
ATan2Dnum Calculate the arc tangent value in the range [-180,180]
Cos Calculate the cosine value
CosDnum Calculate the cosine value
Sin Calculate the sine value
SinDnum Calculate the sine value
Tan Calculate the tangent value
TanDnum Calculate the tangent value
EulerZYX Calculate Euler angles from an orientation
OrientZYX Calculate the orientation from Euler angles
PoseInv Invert a pose
PoseMult Multiply a pose
PoseVect Multiply a pose and a vector
VectMagn Calculate the magnitude of a pos vector
DotProd Calculate the dot (or scalar) product of two pos vectors
CrossProd Calculate the cross (or vector) product of two pos vectors
NOrient Normalize unnormalized orientation (quaternion)
Function Used to
StrDigCmp Numeric compare of two strings with only digits
StrDigCalc Arithmetic operations on two strings with only digits
Bit functions
Instruction Used to
BitClear Clear a specified bit in a defined byte or dnum data.
BitSet Set a specified bit to 1 in a defined byte or dnum data.
Function Used to
BitCheck Check if a specified bit in a defined byte data is set to 1.
BitCheckDnum Check if a specified bit in a defined dnum data is set to 1.
BitAnd Execute a logical bitwise AND operation on data types byte.
BitAndDnum Execute a logical bitwise AND operation on data types dnum.
Function Used to
BitNeg Execute a logical bitwise NEGATION operation on data types
byte.
BitNegDnum Execute a logical bitwise NEGATION operation on data types
dnum.
BitOr Execute a logical bitwise OR operation on data types byte.
BitOrDnum Execute a logical bitwise OR operation on data types dnum.
BitXOr Execute a logical bitwise XOR operation on data types byte.
BitXOrDnum Execute a logical bitwise XOR operation on data types dnum.
BitLSh Execute a logical bitwise LEFT SHIFT operation on data types
byte.
BitLShDnum Execute a logical bitwise LEFT SHIFT operation on data types
dnum.
BitRSh Execute a logical bitwise RIGHT SHIFT operation on data types
byte.
BitRShDnum Execute a logical bitwise RIGHT SHIFT operation on data types
dnum.
Matrix functions
Instruction Used to
MatrixSolve Solve linear equation systems on the form A*x=b.
MatrixSolveQR Compute a QR-factorization of an (m x n) matrix A.
MatrixSVD Compute a singular value decomposition (SVD).
Description
The robot can be controlled from a superordinate computer. In this case, a special
communications protocol is used to transfer information.
Programming principles
As a common communications protocol is used to transfer information from the
robot to the computer and vice versa, the robot and computer can understand each
other and no programming is required. The computer can, for example, change
values in the program’s data without any programming having to be carried out
(except for defining this data). Programming is only necessary when
program-controlled information has to be sent from the robot to the superordinate
computer.
Instruction Used to
SCWrite i Send a message to the superordinate computer
i Only if the robot is equipped with the option PC interface/backup.
Instructions
Instruction Used to
MakeDir Create a new directory.
RemoveDir Remove a directory.
OpenDir Open a directory for further investigation.
CloseDir Close a directory in balance with OpenDir.
RemoveFile Remove a file.
RenameFile Rename a file.
CopyFile Copy a file.
Functions
Function Used to
ISFile Check the type of a file.
FSSize Retrieve the size of a file system.
FileSize Retrieve the size of a specified file.
ReadDir Read next entry in a directory.
Data types
Description
Various functions for supporting of the RAPID language:
• Get system data
• Read configuration data
• Write configuration data
• Restart the controller
• Test system data
• Get object name
• Get task name
• Search for symbols
• Get current event type, execution handler or execution level
• Read service information
Function Used to
IsSysID Test the system identity.
IsStopStateEvent Get information about the movement of the program pointer
(PP).
PPMovedInManMode Test whether the program pointer is moved in manual mode.
RobOS Check if the execution is performed on robot controller (RC)
or virtual controller (VC).
Function Used to
ProgMemFree Get the size of free program memory
Instruction Used to
WarmStart Restart the controller for example when you have changed
system parameters from RAPID.
Instruction Used to
TextTabInstall Install a text table in the system.
Function Used to
TextTabGet Get the text table number of a user defined text table.
TextGet Get a text string from the system text tables.
TextTabFreeToUse Test whether the text table name (text resource string) is free
to use or not.
Function Used to
GetTaskName Get the identity of the current program task, with its name and
number.
MotionPlannerNo Get the number of the current motion planner.
TaskIsExecuting Check if a task is executing
Function Used to
EventType Get current event routine type.
ExecHandler Get type of execution handler.
ExecLevel Get execution level.
Function Used to
GetTSPStatus Get current task selection panel status
TaskIsActive Check if a normal task is active
Function Used to
GetNextSym Together with SetDataSearch data objects can be retrieved
from the system.
Instruction Used to
GetServiceInfo Read service information from the system.
Description
A number of instructions are available to calibrate and test the robot system.
Instruction Used to
MToolRotCalib Calibrate the rotation of a moving tool.
MToolTCPCalib Calibrate tool center point (TCP) for a moving tool.
SToolRotCalib Calibrate tool center point (TCP) and rotation of a stationary
tool.
SToolTCPCalib Calibrate tool center point (TCP) for a stationary tool
Function Used to
CalcRotAxisFrame Calculate the user coordinate system of a rotational axis type.
CalcRotAxFrameZ Calculate the user coordinate system of a rotational axis type
when the master robot and the additional axis are located in
different RAPID tasks.
DefAccFrame Define a frame from original positions and displaced positions.
Function Used to
TestSignRead Read test signal value
Recording of an execution
The recorded data is stored in a file for later analysis, and is intended for debugging
RAPID programs, specifically for multi-tasking systems.
Instruction Used to
SpyStart Start the recording of instruction and time data during execu-
tion.
SpyStop Stop the recording of time data during execution.
Description
String functions are used for operations with strings such as copying, concatenation,
comparison, searching, conversion, etc.
Basic operations
Instruction/operator Used to
:= Assign a value (copy of string)
+ String concatenation
Function Used to
StrLen Find string length
StrPart Obtain part of a string
Operator Used to
= Test if equal to
<> Test if not equal to
Function Used to
StrMemb Check if character belongs to a set
StrFind Search for character in a string
StrMatch Search for pattern in a string
StrOrder Check if strings are in order
Conversion
Function Used to
DnumToNum Convert a dnum numeric value to a num numeric value
DnumToStr Convert a numeric value to a string
NumToDnum Convert a num numeric value to a dnum numeric value
NumToStr Convert a numeric value to a string
ValToStr Convert a value to a string
StrToVal Convert a string to a value
StrMap Map a string
StrToByte Convert a string to a byte
ByteToStr Convert a byte to string data
Function Used to
DecToHex Convert a number specified in a readable string in the base 10
to the base 16
HexToDec Convert a number specified in a readable string in the base 16
to the base 10
1.21 Multitasking
Description
The events in a robot cell are often in parallel, so why are the programs not in
parallel?
Multitasking RAPID is a way to execute programs in (pseudo) parallel. One parallel
program can be placed in the background or foreground of another program. It
can also be on the same level as another program.
For all settings, see Technical reference manual - System parameters.
Limitations
There are a few restrictions on the use of Multitasking RAPID.
• Do not mix up parallel programs with a PLC. The response time is the same
as the interrupt response time for one task. This is true, of course, when the
task is not in the background of another busy program.
• When running a Wait instruction in manual mode, a simulation box will come
up after 3 seconds. This will only occur in a NORMAL task.
• Move instructions can only be executed in the motion task (the task bind to
program instance 0, see Technical reference manual - System parameters).
• The execution of a task will halt during the time that some other tasks are
accessing the file system, that is if the operator chooses to save or open a
program, or if the program in a task uses the load/erase/read/write
instructions.
• The FlexPendant cannot access other tasks than a NORMAL task. So, the
development of RAPID programs for other SEMISTATIC or STATIC tasks
can only be done if the code is loaded into a NORMAL task, or offline.
Basics
To use this function the robot must be configured with one extra TASK for each
additional program. Each task can be of type NORMAL, STATIC, or SEMISTATIC.
Up to 20 different tasks can be run in pseudo parallel. Each task consists of a set
of modules, in the same way as the normal program. All the modules are local in
each task.
Variables, constants, and persistents are local in each task, but global persistents
are not. A persistent is global by default, if not declared as LOCAL or TASK. A
global persistent with the same name and type is reachable in all tasks that it is
declared in. If two global persistents have the same name, but their type or size
(array dimension) differ, a runtime error will occur.
A task has its own trap handling and the event routines are triggered only on its
own task system states (for example Start/Stop/Restart....).
Instruction Used to
WaitSyncTask i Synchronize several program tasks at a special point in each
program
i If the robot is equipped with the option MultiTasking.
Function Used to
TestAndSet Retrieve exclusive right to specific RAPID code areas or system
resources (type user poll)
WaitTestAndSet Retrieve exclusive right to specific RAPID code areas or system
resources (type interrupt control)
TaskRunMec Check if the program task controls any mechanical unit.
TaskRunRob Check if the program task controls any TCP-robot
GetMecUnitName Get the name of the mechanical unit
Instruction Used to
SyncMoveOn i Start a sequence of synchronized movements
SyncMoveOff To end synchronized movements
SyncMoveUndo Reset synchronized movements
i If the robot is equipped with the option MultiMove Coordinated.
Function Used to
IsSyncMoveOn Tell if the current task is in synchronized mode
TasksInSync Returns the number of synchronized tasks
Example
TASK 1:
MODULE module1
PERS bool startsync:=FALSE;
PROC main()
startsync:= TRUE;
ENDPROC
ENDMODULE
TASK 2:
MODULE module2
PERS bool startsync:=FALSE;
PROC main()
WaitUntil startsync;
ENDPROC
ENDMODULE
Example
TASK 1:
MODULE module1
PROC main()
SetDO do1,1;
ENDPROC
ENDMODULE
TASK 2:
MODULE module2
VAR intnum isiint1;
PROC main()
CONNECT isiint1 WITH isi_trap;
ISignalDO do1, 1, isiint1;
WHILE TRUE DO
WaitTime 200;
ENDWHILE
IDelete isiint1;
ENDPROC
TRAP isi_trap
.
ENDTRAP
ENDMODULE
Intertask communication
All types of data can be sent between two (or more) tasks with global persistent
variables.
A global persistent variable is global in all tasks. The persistent variable must be
of the same type and size (array dimension) in all tasks that declared it. Otherwise
a runtime error will occur.
Example
TASK 1:
MODULE module1
PERS bool startsync:=FALSE;
PERS string stringtosend:=””;
PROC main()
stringtosend:=”this is a test”;
startsync:= TRUE
ENDPROC
ENDMODULE
TASK 2:
MODULE module2
PERS bool startsync:=FALSE;
PERS string stringtosend:=””;
PROC main()
WaitUntil startsync;
!read string
IF stringtosend = “this is a test” THEN
...
ENDIF
ENDPROC
ENDMODULE
Type of task
Each task can be of type NORMAL, STATIC or SEMISTATIC.
STATIC and SEMISTATIC tasks are started in the system startup sequence. If the
task is of type STATIC, it will be restarted at the current position (where PP was
when the system was powered off). If the type is set to SEMISTATIC, it will be
started from the beginning each time the power is turned on, and modules specified
in the system parameters will be reloaded if the module file is newer that the loaded
module.
Tasks of type NORMAL will not be started at startup. They are started in the normal
way, for example, from the FlexPendant.
Priorities
The way to run the tasks as default is to run all tasks at the same level in a round
robbin way (one basic step on each instance). But it is possible to change the
priority of one task by putting the task in the background of another. Then the
background will only execute when the foreground is waiting for some events, or
has stopped the execution (idle). A robot program with move instructions will be
in an idle state most of the time.
The example below describes some situations where the system has 10 tasks (see
Figure 9).
Round robbin chain 1: tasks 1, 2, and 9 are busy.
Round robbin chain 2: tasks 1, 4, 5, 6 and 9 are busy tasks 2 and 3 are idle.
Round robbin chain 3: tasks 3, 5 and 6 are busy tasks 1, 2, 9 and 10 are idle.
Round robbin chain 4: tasks 7 and 8 are busy tasks 1, 2, 3, 4, 5, 6, 9 and 10 are
idle.
xx1100000589
TrustLevel
TrustLevel handles the system behavior when a SEMISTATIC or STATIC task is
stopped for some reason or not executable.
• SysFail - This is the default behavior, all other NORMAL tasks will also stop,
and the system is set to state SYS_FAIL. All jog and program start orders
will be rejected. Only a new warm start reset the system. This should be used
when the task has some security supervisions.
• SysHalt - All NORMAL tasks will be stopped. The system is forced to motors
off. When taking up the system to motors on it is possible to jog the robot,
but a new attempt to start the program will be rejected. A new warm start will
reset the system.
• SysStop - All NORMAL tasks will be stopped, but can be restarted. Jogging
is also possible.
• NoSafety - Only the actual task itself will stop.
See Technical reference manual - System parameters, topic Controller, type Task.
Recommendation
When specifying task priorities, think about the following:
• Always use the interrupt mechanism or loops with delays in supervision
tasks. Otherwise the FlexPendant will never get any time to interact with the
user. And if the supervision task is in foreground, it will never allow another
task in background to execute.
Description
A program can be executed backwards one instruction at a time. The following
general restrictions are valid for backward execution:
• It is not possible to step backwards out of a IF, FOR, WHILE and TEST
statement.
• It is not possible to step backwards out of a routine when reaching the
beginning of the routine.
• Motion settings instructions, and some other instructions affecting the motion,
cannot be executed backwards. If attempting to execute such an instruction
a warning will be written in the event log.
Backward handlers
Procedures may contain a backward handler that defines the backward execution
of a procedure call. If calling a routine inside the backward handler, the routine is
executed forward.
The backward handler is really a part of the procedure and the scope of any routine
data also comprises the backward handler of the procedure.
Instructions in the backward or error handler of a routine may not be executed
backwards. Backward execution cannot be nested, that is two instructions in a call
chain may not simultaneously be executed backwards.
A procedure with no backward handler cannot be executed backwards. A procedure
with an empty backward handler is executed as “no operation”.
Example 1
PROC MoveTo ()
MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p4,v500,z10,tool1;
BACKWARD
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
ENDPROC
When the procedure is called during forward execution, the following occurs:
MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p4,v500,z10,tool1;
Example 2
PROC MoveTo ()
MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p4,v500,z10,tool1;
BACKWARD
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
ENDPROC
When the procedure is called during forward execution, the following code is
executed (the code of the procedure until the backward handler):
MoveL p1,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p4,v500,z10,tool1;
When the procedure is called during backwards execution, the following code is
executed (the code in the backward handler):
MoveL p4,v500,z10,tool1;
MoveC p2,p3,v500,z10,tool1;
MoveL p1,v500,z10,tool1;
xx1100000633
Note that the order of CirPoint p2 and ToPoint p3 in the MoveC should be the
same.
Move instructions includes all instructions that result in some movement of the
robot or additional axes, such as MoveL, SearchC, TriggJ, ArcC, or PaintL.
WARNING
Any departures from this programming limitation in the backward handler can
result in faulty backward movement. Linear movement can result in circular
movement and vice versa, for some part of the backward path.
Example
This example illustrates the behavior when stepping backwards through move
instructions. The program pointer and motion pointer helps you keep track of where
the RAPID execution is and where the robot is.
xx1100000634
A Program pointer
B Motion pointer
C Highlighting of the robtarget that the robot is moving towards, or already
have reached
1 The program is stepped forward until the robot is in p5. The motion pointer
will indicate p5 and the program pointer will indicate the next move instruction
(MoveL p6).
2 The first press of the backward button will not move the robot, but the program
pointer will move to the previous instruction (MoveC p3, p4). This indicates
that this is the instruction that will be executed the next time backward button
is pressed.
3 The second press of the backward button will move the robot to p4 linearly
with the speed v300. The target for this movement (p4) is taken from the
MoveC instruction. The type of movement (linear) and the speed are taken
from the instruction below (MoveL p5). The motion pointer will indicate p4
and the program pointer will move up to MoveL p2.
4 The third press of the backward button will move the robot circularly, via p3,
to p2 with the speed v100. The target p2 is taken from the instruction MoveL
p2. The type of movement (circular), the circular point (p3) and the speed
are taken from the MoveC instruction. The motion pointer will indicate p2 and
the program pointer will move up to MoveL p1.
5 The fourth press of the backward button will move the robot linearly to p1
with the speed v200. The motion pointer will indicate p1 and the program
pointer will move up to MoveJ p0.
6 The first press of the forward button will not move the robot, but the program
pointer will move to the next instruction (MoveL p2).
7 The second press of the forward button will move the robot to p2 with the
speed v200.
Description
The position of the robot and its movements are always related to the tool center
point (TCP). This point is normally defined as being somewhere on the tool, for
example in the muzzle of a glue gun, at the center of a gripper or at the end of a
grading tool.
Several TCPs (tools) may be defined, but only one may be active at any one time.
When a position is recorded, it is the position of the TCP that is recorded. This is
also the point that moves along a given path, at a given velocity.
If the robot is holding a work object and working on a stationary tool, a stationary
TCP is used. If that tool is active, the programmed path and speed are related to
the work object. See Stationary TCPs on page 113.
Related information
Described in
Definition of the world coordinate system Technical reference manual - System paramet-
ers
Definition of the user coordinate system Operating manual - IRC5 with FlexPendant
Definition of the object coordinate system Operating manual - IRC5 with FlexPendant
Definition of the tool coordinate system Operating manual - IRC5 with FlexPendant
Definition of a tool center point Operating manual - IRC5 with FlexPendant
Definition of displacement frame Operating manual - IRC5 with FlexPendant
Jogging in different coordinate systems Operating manual - IRC5 with FlexPendant
Description
The tool (TCP) position can be specified in different coordinate systems to facilitate
programming and adjustment of programs.
The coordinate system defined depends on what the robot has to do. When no
coordinate system is defined, the robot’s positions are defined in the base
coordinate system.
xx1100000611
system when the positions are to be related to a fixed point in the workshop. See
the example in Figure 11.
xx1100000612
Figure 11: Two robots (one of which is suspended) with a common world coordinate system
xx1100000613
Figure 12: Two user coordinate systems describe the position of two different fixtures
xx1100000614
Figure 13: Two object coordinate systems describe the position of two different work objects located
in the same fixture
xx1100000615
xx1100000616
Figure 15: A user coordinate system, defined to follow the movements of a 3-axis external mechanical
unit
.
xx1100000617
Figure 16: Coordinated interpolation with a track moving the base coordinate system of the robot.
To be able to calculate the user and the base coordinate systems when involved
units are moved, the robot must be aware of:
• The calibration positions of the user and the base coordinate systems
• The relations between the angles of the additional axes and the translation/
rotation of the user and the base coordinate systems.
• These relations are defined in the system parameters.
Description
The orientation of a tool at a programmed position is given by the orientation of
the tool coordinate system. The tool coordinate system is referenced to the wrist
coordinated system, defined at the mounting flange on the wrist of the robot.
xx1600000580
The wrist coordinate system cannot be changed and is always the same as the
mounting flange of the robot in the following respects:
• The origin is situated at the center of the mounting flange (on the mounting
surface).
• The x-axis points in the opposite direction, towards the control hole of the
mounting flange.
• The z-axis points outwards, at right angles to the mounting flange.
The TCP (origin) is selected as the point on the tool that must be correctly
positioned, for example the muzzle on a glue gun. The tool coordinate axes are
defined as those natural for the tool in question.
xx1600000581
Figure 18: Tool coordinate system, as usually defined for an arc-welding gun (left) and a spot welding
gun (right).
The tool coordinate system is defined based on the wrist coordinate system (see
Figure 19).
xx1600000582
Figure 19: The tool coordinate system is defined relative to the wrist coordinate system, here for a
gripper.
Stationary TCPs
If the robot is holding a work object and working on a stationary tool, a stationary
TCP is used. If that tool is active, the programmed path and speed are related to
the work object held by the robot.
This means that the coordinate systems will be reversed, as in Figure 20.
xx1100000635
Figure 20: If a stationary TCP is used, the object coordinate system is usually based on the wrist
coordinate system
In the example in Figure 20, neither the user coordinate system nor program
displacement is used. It is, however, possible to use them and, if they are used,
they will be related to each other as shown in Figure 21.
xx1100000636
Figure 21: Program displacement can also be used together with stationary TCPs
2.2.1 Introduction
WARNING
Related information
Described in:
Definition of speed Technical reference manual - RAPID Instructions,
Functions and Data types
Definition of zones (corner paths) Technical reference manual - RAPID Instructions,
Functions and Data types
Instruction for joint interpolation Technical reference manual - RAPID Instructions,
Functions and Data types
Instruction for linear interpolation Technical reference manual - RAPID Instructions,
Functions and Data types
Instruction for circular interpolation Technical reference manual - RAPID Instructions,
Functions and Data types
Instruction for modified interpola- Technical reference manual - RAPID Instructions,
tion Functions and Data types
Singularity Singularities on page 148
Described in:
Concurrent program execution Synchronization with logical instructions on page 130
CPU Optimization Technical reference manual - System parameters
Joint interpolation
When path accuracy is not too important, this type of motion is used to move the
tool quickly from one position to another. Joint interpolation also allows an axis to
move from any location to another within its working space, in a single movement.
All axes move from the start point to the destination point at constant axis velocity
(see Figure 22).
xx1100000637
Figure 22: Joint interpolation is often the fastest way to move between two points as the robot axes
follow the closest path between the start point and the destination point (from the perspective of the
axis angles)
.
The velocity of the tool center point is expressed in mm/s (in the object coordinate
system). As interpolation takes place axis-by-axis, the velocity will not be exactly
the programmed value.
During interpolation, the velocity of the limiting axis, that is the axis that travels
fastest relative to its maximum velocity in order to carry out the movement, is
determined. Then, the velocities of the remaining axes are calculated so that all
axes reach the destination point at the same time.
All axes are coordinated in order to obtain a path that is independent of the velocity.
Acceleration is automatically optimized to the max performance of the robot.
Linear interpolation
During linear interpolation, the TCP travels along a straight line between the start
and destination points (see Figure 23).
xx1100000638
To obtain a linear path in the object coordinate system, the robot axes must follow
a non-linear path in the axis space. The more non-linear the configuration of the
robot is, the more accelerations and decelerations are required to make the tool
move in a straight line and to obtain the desired tool orientation. If the configuration
is extremely non-linear (for example in the proximity of wrist and arm singularities),
one or more of the axes will require more torque than the motors can give. In this
case, the velocity of all axes will automatically be reduced.
The orientation of the tool remains constant during the entire movement unless a
reorientation has been programmed. If the tool is reorientated, it is rotated at
constant velocity.
A maximum rotational velocity (in degrees per second) can be specified when
rotating the tool. If this is set to a low value, reorientation will be smooth, irrespective
of the velocity defined for the tool center point. If it is a high value, the reorientation
velocity is only limited by the maximum motor speeds. As long as no motor exceeds
the limit for the torque, the defined velocity will be maintained. If, on the other hand,
one of the motors exceeds the current limit, the velocity of the entire movement
(with respect to both the position and the orientation) will be reduced.
All axes are coordinated in order to obtain a path that is independent of the velocity.
Acceleration is optimized automatically.
Circular interpolation
A circular path is defined using three programmed positions that define a circle
segment. The first point to be programmed is the start of the circle segment. The
next point is a support point (circle point) used to define the curvature of the circle,
and the third point denotes the end of the circle (see Figure 24).
The three programmed points should be dispersed at regular intervals along the
arc of the circle to make this as accurate as possible.
The orientation defined for the support point is used to select between the short
and the long twist for the orientation from start to destination point.
If the programmed orientation is the same relative to the circle at the start and the
destination points, and the orientation at the support is close to the same orientation
relative to the circle, the orientation of the tool will remain constant relative to the
path.
xx1100000639
Figure 24: Circular interpolation with a short twist for part of a circle (circle segment) with a start point,
circle point and destination point
xx1100000640
Figure 25: Circular interpolation with a long twist for orientation is achieved by defining the orientation
in the circle point in the opposite direction compared to the start point.
As long as all motor torques do not exceed the maximum permitted values, the
tool will move at the programmed velocity along the arc of the circle. If the torque
of any of the motors is insufficient, the velocity will automatically be reduced at
those parts of the circular path where the motor performance is insufficient.
All axes are coordinated in order to obtain a path that is independent of the velocity.
Acceleration is optimized automatically.
SingArea\Wrist
During execution in the proximity of a singular point, linear or circular interpolation
may be problematic. In this case, it is best to use modified interpolation, which
means that the wrist axes are interpolated axis-by-axis, with the TCP following a
linear or circular path. The orientation of the tool, however, will differ somewhat
from the programmed orientation. The resulting orientation in the programmed
point may also differ from the programmed orientation due to two singularities.
xx1100000641
The first singularity is when TCP is straight ahead from axis 2 (a2 in the figure
above). The TCP cannot pass to the other side of axis 2, instead will axis 2 and 3
fold a bit more to keep the TCP on the same side and the end orientation of the
move will then be turned away from the programmed orientation with the same
size.
The second singularity is when TCP will pass near the z-axis of axis 1 (z1 in the
figure above). The axis 1 will in this case turn around with full speed and the tool
reorientation will follow in the same way. The direction of the turn is dependent of
what side the TCP will go. We recommend to change to joint interpolation (MoveJ)
near the z-axis. Note that it’s the TCP that make the singularity not the WCP as
when SingArea\Off is used.
In the SingArea\Wrist case the orientation in the circle support point will be the
same as programmed. However, the tool will not have a constant direction relative
to the circle plane as for normal circular interpolation. If the circle path passes a
singularity, the orientation in the programmed positions sometimes must be
modified to avoid big wrist movements, which can occur if a complete wrist
re-configuration is generated when the circle is executed (joints 4 and 6 moved
180 degrees each).
Description
Corner paths are used to get continuous movements past programmed positions.
In this way, positions can be passed at high speed without having to reduce the
speed unnecessarily. A fly-by point generates a corner path (parabola path) past
the programmed position. The beginning and end of this corner path are defined
by a zone around the programmed position (see Figure 26).
Corner zone
for the TCP path Programmed
position
Corner path
xx1100000643
Figure 26: A fly-by point generates a corner path to pass the programmed position.
All axes are coordinated in order to obtain a path that is independent of the velocity.
Speed and acceleration are optimized automatically.
A B
p2
C
E
p1 p3
xx1100000647
Figure 29a: If three positions with different tool orientations are programmed as stop points, program
execution will look like this.
Reorientation and
additional axis zone
Position zone
p2
C
E
p1 p3
xx1100000648
Figure 29b: If the middle position is a fly-by point, program execution will look like this.
The reorientation and additional axis zone is normally expressed in mm. In this
way, you can determine directly where on the path the zone begins and ends. If
the tool is not moved, the size of the zone is expressed in angle of rotation degrees
instead of TCP-mm.
The reorientation and additional axis zone is also used for additional axes, in the
same manner as for orientation. If the reorientation and additional axis zone is set
to be larger than the position zone, the interpolation of the additional axes towards
the destination of the next programmed position, will be started before the TCP
position corner path starts. This can be used for smoothing additional axes
movements in the same way as the tool orientation is used for the smoothing of
the wrist movements.
xx1100000649
Figure 30: Interpolation when changing from one interpolation method to another. Linear interpolation
has been programmed between p1 and p2; joint interpolation between p2 and p3; and Sing Area\Wrist
interpolation between p3 and p4.
Generated
path
p2 p4
p1
Programmed
position zone
p3
Corner zone as
calculated by the robot
xx1800000780
Interpolation with too large position zones. The zone around p3 is larger than half the distance from
p2 to p3. Thus, the robot reduces the size of the zone to make it equal to half the distance from p2 to
p3, thereby generating a symmetrical corner path within the zone.
Both the position zone and the reorientation and additional axis zone can overlap.
As soon as one of these corner path zones is too big, that zone is reduced.
Note
The corner zone can be allowed to reach more than half the distance to a
neighboring fine point by changing the system parameter Relative zone size with
finepoint (topic Motion, type Motion Planner).
The corner zone size can be different for inbound and outbound path by setting
the system parameter Allow asymmetric zones (topic Motion, type Motion
Planner).
See Technical reference manual - System parameters.
Description
An independent axis is an axis moving independently of other axes in the robot
system. It is possible to change an axis to independent mode and later back to
normal mode again.
A special set of instructions handles the independent axes. Four different move
instructions specify the movement of the axis. For instance, the IndCMove
instruction starts the axis for continuous movement. The axis then keeps moving
at a constant speed (regardless of what the robot does) until a new
independent-instruction is executed.
To change back to normal mode a reset instruction, IndReset, is used. The reset
instruction can also set a new reference for the measurement system - a type of
new synchronization of the axis. Once the axis is changed back to normal mode
it is possible to run it as a normal axis.
Program execution
An axis is immediately change to independent mode when an Ind_Move instruction
is executed. This takes place even if the axis is being moved at the time, such as
when a previous point has been programmed as a fly-by point, or when
simultaneous program execution is used.
If a new Ind_Move instruction is executed before the last one is finished, the new
instruction immediately overrides the old one.
If a program execution is stopped when an independent axis is moving, that axis
will stop. When the program is restarted the independent axis starts automatically.
No active coordination between independent and other axes in normal mode takes
place.
If a loss of voltage occurs when an axis is in independent mode, the program
cannot be restarted. An error message is then displayed, and the program must
be started from the beginning.
Note that a mechanical unit may not be deactivated when one of its axes is in
independent mode.
Stepwise execution
During stepwise execution, an independent axis is executed only when another
instruction is being executed. The movement of the axis will also be stepwise in
line with the execution of other instruments, see Figure 33.
xx1100000652
Jogging
Axes in independent mode cannot be jogged. If an attempt is made to execute the
axis manually, the axis does not move and an error message is displayed. Execute
an IndReset instruction or move the program pointer to main, in order to leave
the independent mode.
Working range
The physical working range is the total movement of the axis.
The logical working range is the range used by RAPID instructions and read in the
jogging window.
After synchronization (updated revolution counter), the physical and logical working
range coincide. By using the IndReset instruction the logical working area can
be moved, see Figure 34.
xx1100000653
Figure 34: The logical working range can be moved, using the instruction IndReset.
The resolution of positions is decreased when moving away from logical position
0. Low resolution together with stiff tuned controller can result in unacceptable
torque, noise and controller instability. Check the controller tuning and axis
performance close to the working range limit at installation. Also check if the
position resolution and path performance are acceptable.
Robot axes
Only robot axis 6 can be used as an independent axis. Normally the IndReset
instruction is used only for this axis. However, the IndReset instruction can also
be used for axis 4 on IRB 1600, 2600 and 4600 models (not for ID versions). If
IndReset is used for robot axis 4, then axis 6 must not be in the independent
mode.
If axis 6 is used as an independent axis, singularity problems may occur because
the normal 6-axes coordinate transform function is still used. If a problem occurs,
execute the same program with axis 6 in normal mode. Modify the points or use
SingArea\Wrist or MoveJ instructions.
The axis 6 is also internally active in the path performance calculation. A result of
this is that an internal movement of axis 6 can reduce the speed of the other axes
in the system.
The independent working range for axis 6 is defined with axis 4 and 5 in home
position. If axis 4 or 5 is out of home position the working range for axis 6 is moved
due to the gear coupling. However, the position read from FlexPendant for axis 6
is compensated with the positions of axis 4 and 5 via the gear coupling.
Description
In some applications there is a need for a servo, which acts like a mechanical
spring. This means that the force from the robot on the work object will increase
as a function of the distance between the programmed position (behind the work
object) and the contact position (robot tool - work object).
Softness
The relationship between the position deviation and the force, is defined by a
parameter called softness. The higher the softness parameter, the larger the position
deviation required to obtain the same force.
The softness parameter is set in the program and it is possible to change the
softness values anywhere in the program. Different softness values can be set for
different joints and it is also possible to mix joints having normal servo with joints
having soft servo.
Activation and deactivation of soft servo as well as changing of softness values
can be made when the robot is moving. When this is done, a tuning will be made
between the different servo modes and between different softness values to achieve
smooth transitions. The tuning time can be set from the program with the parameter
ramp. With ramp = 1, the transitions will take 0.5 seconds, and in the general case
the transition time will be ramp x 0.5 in seconds.
Note
Deactivation of soft servo should not be done when there is a force between the
robot and the work object.
Note
With high softness values there is a risk that the servo position deviations may
be so big that the axes will move outside the working range of the robot.
Stopping movement
A movement can be stopped in three different ways:
• For a normal stop, the robot will stop on the path, which makes a restart
easy.
• For a stiff stop, the robot will stop in a shorter time than for the normal stop,
but the deceleration path will not follow the programmed path. This stop
method is, for example, used for search stop when it is important to stop the
motion as soon as possible.
For a stiff stop, the robot will stop in a shorter time than for the soft stop, but
the deceleration path will not follow the programmed path. This stop method
is, for example, used for search stop when it is important to stop the motion
as soon as possible.
• For a quick-stop, the mechanical brakes are used to achieve a deceleration
distance, which is as short as specified for safety reasons. The path deviation
will usually be bigger for a quick-stop than for a stiff stop.
Starting movement
After a stop (any of the types above) a restart can always be made on the interrupted
path. If the robot has stopped outside the programmed path, the restart will begin
with a return to the position on the path, where the robot should have stopped.
A restart following a power failure is equivalent to a restart after a quick-stop. It
should be noted that the robot will always return to the path before the interrupted
program operation is restarted, even in cases when the power failure occurred
while a logical instruction was running. When restarting, all times are counted from
the beginning; for example, positioning on time or an interruption in the instruction
WaitTime.
Logical instructions
Instructions are normally executed sequentially in the program. Nevertheless,
logical instructions can also be executed at specific positions or during an ongoing
movement.
A logical instruction is any instruction that does not generate a robot movement
or an additional axis movement, for example an I/O instruction.
xx1100000654
Figure 35: A logical instruction after a stop point is not executed until the destination position has been
reached.
xx1100000655
Figure 36: A logical instruction following a fly-by point is executed before reaching the largest zone.
xx1100000656
Figure 37: A logical instruction following a fly-by point is executed before reaching the largest zone.
The time at which they are executed (DT) comprises the following time components:
• The time it takes for the robot to plan the next move: approximately 0.1
seconds.
• The robot delay (servo lag) in seconds: 0 -1.0 seconds depending on the
velocity and the actual deceleration performance of the robot.
If the previous positioning instruction ends at a fly-by point, the logical instructions
are executed at a given time (DT) before reaching the largest zone (for position,
orientation or additional axes). See Figure 39.
xx1100000657
Figure 38: In the case of concurrent program execution after a stop point, a positioning instruction and
subsequent logical instructions are started at the same time.
xx1100000658
Figure 39: In the case of concurrent program execution after a fly-by point, the logical instructions start
executing before the positioning instructions with the argument \Conc are started.
Instructions which indirectly affect movements, such as ConfL and SingArea, are
executed in the same way as other logical instructions. They do not, however,
affect the movements ordered by previous positioning instructions.
If several positioning instructions with the argument \Conc and several logical
instructions in a long sequence are mixed, the following applies:
• Logical instructions are executed directly, in the order they were programmed.
This takes place at the same time as the movement (see Figure 40) which
means that logical instructions are executed at an earlier stage on the path
than they were programmed.
xx1100000659
Figure 40 If several positioning instructions with the argument \Conc are programmed in sequence, all
connected logical instructions are executed at the same time as the first position is executed.
Path synchronization
In order to synchronize process equipment (for applications such as gluing, painting
and arc welding) with the robot movements, different types of path synchronization
signals can be generated.
With a so-called positions event, a trig signal will be generated when the robot
passes a predefined position on the path. With a time event, a signal will be
generated in a predefined time before the robot stops at a stop position. Moreover,
the control system also handles weave events, which generate pulses at predefined
phase angles of a weave motion.
All the position synchronized signals can be achieved both before (look ahead
time) and after (delay time) the time that the robot passes the predefined position.
The position is defined by a programmed position and can be tuned as a path
distance before the programmed position.
Continues on next page
Technical reference manual - RAPID overview 133
3HAC050947-001 Revision: H
© Copyright 2004-2018 ABB. All rights reserved.
2 Motion and I/O programming
2.3 Synchronization with logical instructions
Continued
Typical repeat accuracy for a set of digital outputs on the path is +/- 2 ms.
In the event of a power failure and restart in a Trigg instruction, all trigg events
will be generated once again on the remaining movement path for the Trigg
instruction.
Related information
Described in:
Positioning instructions Motion on page 55
Definition of zone size Technical reference manual - RAPID Instructions, Functions and
Data types
xx1100000660
Figure 41: Two different arm configurations used to attain the same position and orientation. The
configuration on the right side is attained by rotating the arm backward. Axis 1 is rotated 180 degrees.
Some robots may also get to that position from above and below while using the
same axis 1 direction. This is possible for robot types with extended axis 3 working
range (see Figure 42).
xx1100000661
Figure 42: IRB 140 with two different arm configurations used to attain same position and orientation.
The Axis 1 angle is the same for both configurations.The configuration on the right side is attained by
rotating the lower arm forward and the upper arm backward.
This can also be achieved by turning the front part of the robot upper arm (axis 4)
upside down while rotating axes 5 and 6 to the desired position and orientation
(see Figure 43).
xx1100000662
Figure 43: Two different wrist configurations used to attain the same position and orientation. In the
configuration in which the front part of the upper arm points upwards (lower), axis 4 has been rotated
180 degrees, axis 5 through 180 degrees and axis 6 through 180 degrees in order to attain the
configuration in which the front part of the upper arm points downwards (upper).
xx1100000663
xx1100000664
Related information
Described in:
Definition of robot configuration Technical reference manual - RAPID Instruc-
tions, Functions and Data types
Activating/deactivating the configuration Motion on page 55
supervision
Robot kinematics
The position and orientation of a robot is determined from the kinematic model of
its mechanical structure. The specific mechanical unit models must be defined for
each installation. For standard ABB master and external robots, these models are
predefined in the controller.
Master robot
The kinematic model of the master robot models the position and orientation of
the tool of the robot relative to its base as function of the robot joint angles.
The kinematic parameters specifying the arm lengths, offsets and joint attitudes,
are predefined in the configuration file for each robot type.
xx1100000666
A calibration procedure supports the definition of the base frame of the master
robot relative to the world frame.
xx1100000667
External robot
Coordination with an external robot also requires a kinematic model for the external
robot. A number of predefined classes of 2 and 3 dimensional mechanical structures
are supported.
xx1100000668
Figure 48: Kinematic structure of an ORBIT 160B robot using predefined model
Calibration procedures to define the base frame relative to the world frame are
supplied for each class of structures.
xx1100000669
xx1100000670
Figure 50: Reference points on turntable for base frame calibration of an ORBIT_160B robot in the
home position using predefined model
General kinematics
Mechanical structures not supported by the predefined structures may be modelled
by using a general kinematic model. This is possible for external robots.
Modelling is based on the Denavit-Hartenberg convention according to Introduction
to Robotics, Mechanics & Control, by John J. Craigh (Addison-Wesley 1986).
xx1100000671
Figure 51: Kinematic structure of an ORBIT 160B robot using general kinematics model
A calibration procedure supports the definition of the base frame of the external
robot relative to the world frame.
xx1100000672
Figure 52: Base frame of an ORBIT_160B robot using general kinematics model
xx1100000673
Figure 53: Reference points on turntable for base frame calibration of an ORBIT_160B robot in the
home position (joints = 0 degrees)
Related information
Described in:
Definition of general kinematics of an ex- Technical reference manual - System paramet-
ternal robot ers
Introduction
Motion supervision is the name of a collection of functions for high sensitivity,
model-based supervision of the robot’s movements. Motion supervision includes
functionality for the detection of collision, jamming, and incorrect load definition.
This functionality is called collision detection (option Collision Detection).
The collision detection may trig if the data for the loads mounted on the robot are
not correct. This includes load data for tools, payloads and arm loads. If the tool
data or payload data are not known, the load identification functionality can be
used to define it. Arm load data cannot be identified.
When the collision detection is triggered, the motor torques are reversed and the
mechanical brakes applied in order to stop the robot. The robot then backs up a
short distance along the path in order to remove any residual forces which may
be present if a collision or jam occurred. After this, the robot stops again and
remains in the motors on state. A typical collision is illustrated in the figure below.
The motion supervision is by default active only when at least one axis (including
additional axes) is in motion. When all axes are standing still, the function is
deactivated. This is to avoid unnecessary triggering due to external process forces.
The system parameter Collision detection at standstill enables the detection of any
collision even at standstill, for more information see Technical reference
manual - System parameters.
150% and the tune value is set to 200% in the RAPID instruction the resulting tune
level will be 300%.
xx1100000674
There is a maximum level to which the total collision detection tune level can be
changed. This value is set by default to 300% but it can be modified via the system
parameter motion_sup_max_level.
2 Tap the Task list and select a task. If you have more than one task, you need
to set the desired values for each task separately.
3 Tap OFF/ON to remove or activate path supervision. Tap -/+ to adjust
sensitivity. The sensitivity can be set between 0 and 300. Unless you have
the option Collision Detection installed, path supervision only affects the
robot in auto and manually full speed mode.
4 Tap OFF/ON to remove or activate jog supervision. Tap -/+ to adjust
sensitivity. The sensitivity can be set between 0 and 300. This setting has
no effect, unless you have the option Collision Detection installed.
For more information on Collision Detection, see Application manual - Controller
software IRC5.
Digital outputs
The digital output MotSupOn is high when the collision detection function is active
and low when it is not active. Note that a change in the state of the function takes
effect when a motion starts. Thus, if the collision detection is active and the robot
is moving, MotSupOn is high. If the robot is stopped and the function turned off,
MotSupOn is still high. When the robot starts to move, MotSupOn switches to low.
The digital output MotSupTrigg goes high when the collision detection triggers.
It stays high until the error code is acknowledged, either from the FlexPendant or
through the digital input AckErrDialog.
The digital outputs are described in more detail in the Operating manual - IRC5
with FlexPendant and Technical reference manual - System parameters.
Limitations
The motion supervision is only available for the robot axes. It is not available for
track motions, orbit stations, or any other external manipulators.
The collision detection is deactivated when at least one axis is run in independent
joint mode. This is also the case even when it is an additional axis which is run as
an independent joint.
The collision detection may trigger when the robot is used in soft servo mode.
Therefore, it is advisable to turn the collision detection off when the robot is in soft
servo mode.
If the RAPID instruction MotionSup is used to turn off the collision detection, this
will only take effect once the robot starts to move. As a result, the digital output
MotSupOn may temporarily be high at program start before the robot starts to
move.
The distance the robot backs up after a collision is proportional to the speed of the
motion before the collision. If repeated low speed collisions occur, the robot may
not back up sufficiently to relieve the stress of the collision. As a result, it may not
be possible to jog the robot without the supervision triggering. In this case use the
jog menu to turn off the collision detection temporarily and jog the robot away from
the obstacle.
In the event of a stiff collision during program execution, it may take a few seconds
before the robot starts to back up.
If the robot is mounted on a track the collision detection should be set to off when
the track is moving. If it is not turned off the collision detection may trigger when
the track moves, even if there is no collision.
Related information
Described in:
RAPID instruction MotionSup Motion on page 55
System parameters for tuning Technical reference manual - System parameters
Motion supervision I/O signals Technical reference manual - System parameters
Collision detection at standstill Technical reference manual - System parameters
Load identification Operating manual - IRC5 with FlexPendant
2.7 Singularities
Description
Some positions in the robot working space can be attained using an infinite number
of robot configurations to position and orient the tool. These positions, known as
singular points (singularities), constitute a problem when calculating the robot arm
angles based on the position and orientation of the tool.
Generally speaking, a robot has two types of singularities:
• arm singularities
• wrist singularities
Arm singularities are all configurations where the wrist center (the intersection of
axes 4, 5, and 6) ends up directly above axis 1 (see Figure 54). Wrist singularities
are configurations where axis 4 and axis 6 are on the same line, that is axis 5 has
an angle equal to 0 (see Figure 55).
xx1100000675
Figure 54: Arm singularity occurs where the wrist center and axis 1 intersect
xx1100000676
xx1100000677
path of the robot tool. An orientation error compared to the full linear interpolation
is however introduced.
Note that the robot configuration changes dramatically when the robot passes
close to a singularity with linear or circular interpolation. To avoid the
re-configuration, the first position on the other side of the singularity should be
programmed with an orientation that makes the re-configuration unnecessary.
Also, it should be noted that the robot must not be in its singularity when only
external joints are moved. This may cause robot joints to make unnecessary
movements.
For robots with 7 axes or more, the robot may be able to automatically adjust the
arm angle in order to avoid some singularities. Please see the operating manual
for your robot for more information.
Related information
Described in:
Controlling how the robot is to act on exe- Technical reference manual - RAPID Instruc-
cution near singular points tions, Functions and Data types
Description
The acceleration and speed of the robot is continuously controlled so that the
defined limits are not exceeded.
The limits are defined by the user program (for example programmed speed or
AccSet) or defined by the system itself (for example maximum torque in gearbox
or motor, maximum torque or force in robot structure).
Load data
As long as the load data (mass, center of gravity, and inertia) is within the limits
on the load diagram and correctly entered into the tool data, then no user defined
acceleration limits are needed and the service life of the robot is automatically
ensured.
If the load data lies outside the limits on the load diagram, then special restrictions
may be necessary, that is AccSet or lower speed, as specified on request from
ABB.
TCP acceleration
TCP acceleration and speed are controlled by the path planner with the help of a
complete dynamic model of the robot arms, including the user defined loads.
The TCP acceleration and speed depends on the position, speed, and acceleration
of all the axes at any instant in time and thus the actual acceleration varies
continuously. In this way the optimal cycle time is obtained, that is one or more of
the limits is at its maximum value at every instant. This means that the robot motors
and structure are utilized to their maximum capability at all times.
WARNING
For safety reasons, this software shall not be used for protection of personnel.
Use hardware protection equipment for that.
xx1100000678
A World Zone can be defined to be inside or outside the shape of the box, sphere,
or the cylinder.
World Zone can also be defined in joints. The zone is to be defined between (inside)
or not between (outside) two joint values for any robot or additional axes.
xx1100000679
The movement of the tool center point is supervised and not any other points on
the robot.
The TCP is always supervised irrespective of the mode of operation, for example,
program execution and jogging.
Stationary TCPs
If the robot is holding a work object and working on a stationary tool, a stationary
TCP is used. If that tool is active, the tool will not move and if it is inside a World
Zone then it is always inside.
Actions
Set a digital output when the TCP is inside a World Zone
This action sets a digital output when the TCP is inside a World Zone. It is useful
to indicate that the robot has stopped in a specified area.
xx1100000680
xx1100000681
xx1100000682
When the robot has been moved into a World Zone defined as an outside work
area, for example, by releasing the brakes and manually pushing, then the only
ways to get out of the Zone are by jogging or by manual pushing with the brakes
released.
xx1100000683
If the same digital output is used for more than one World Zone, the distance
between the Zones must exceed the minimum size, as shown in the table above,
to avoid an incorrect status for the output.
It is possible that the robot can pass right through a corner of a zone without it
being noticed, if the time that the robot is inside the zone is too short. Therefore,
make the size of the zone larger than the dangerous area.
xx1100000684
If World Zones are used in combination soft servo, the zone size must be additional
increased to compensate for the lag from soft servo. The soft servo lag is the
distance between the TCP of the robot and supervision of world zone at interpolation
time. The soft servo lag will be increased with higher softness defined with the
instruction SoftAct.
Related information
Description
The robot generally has one or more I/O boards. Each of the boards has several
digital and/or analog channels which must be connected to logical signals before
they can be used. This is carried out in the system parameters and has usually
already been done using standard names before the robot is delivered. Logical
signals must always be used during programming.
A physical channel can be connected to several logical signals, but can also have
no logical connections (see Figure 57).
xx1100000685
Figure 57: To be able to use an I/O board, its channels must be given logical signals. In the above
example, the physical output 2 is connected to two different logical signals. IN16, on the other hand,
has no logical signal and thus cannot be used.
Signal characteristics
The characteristics of a signal are depend on the physical channel used as well
as how the channel is defined in the system parameters. The physical channel
determines time delays and voltage levels (see the Product specification). The
characteristics, filter times and scaling between programmed and physical values,
are defined in the system parameters.
When the power supply to the robot is switched on, all signals are set to zero. They
are not, however, affected by emergency stops or similar events.
An output can be set to one or zero from within the program. This can also be done
using a delay or in the form of a pulse. If a pulse or a delayed change is ordered
for an output, the program execution continues. The change is then carried out
without affecting the rest of the program execution. If, on the other hand, a new
change is ordered for the same output before the given time elapses, the first
change is not carried out (see Figure 58).
xx1100000686
Figure 58: The instruction SetDO is not carried out at all because a new command is given before the
time delay has elapsed.
System signals
Logical signals can be interconnected by means of special system functions. If,
for example, an input is connected to the system function Start, a program start
is automatically generated as soon as this input is enabled. These system functions
are generally only enabled in automatic mode.
Cross connections
Digital signals can be interconnected in such a way that they automatically affect
one another:
• An output signal can be connected to one or more input or output signals.
Limitations
A maximum of 10 signals can be pulsed at the same time and a maximum of 20
signals can be delayed at the same time.
Related information
Described in
Definition of I/O boards and signals Technical reference manual - System parameters
Instructions for handling I/O Input and output signals on page 63
Manual manipulation of I/O Operating manual - IRC5 with FlexPendant
3 Glossary
Glossary
Term Description
Argument The parts of an instruction that can be changed, that is everything
except the name of the instruction.
Automatic mode The applicable mode when the operating mode selector is set to
xx1100000688
xx1100000687
Term Description
Motors On/Off The state of the robot, that is whether or not the power supply to
the motors is switched on.
Operator panel The panel located on the front of the controller.
Orientation The direction of an end effector.
Parameter The input data of a routine, sent with the routine call. It corres-
ponds to the argument of an instruction.
Persistent A variable, the value of which is persistent.
Procedure A routine which, when called, can independently form an instruc-
tion.
Program The set of instructions and data which define the task of the robot.
Programs do not, however, contain system modules.
Program data Data that can be accessed in a complete module or in the complete
program.
Program module A module included in the robot’s program and which is transferred
when copying the program to a diskette.
Record A compound data type.
Routine A subprogram.
Routine data Local data that can only be used in a routine.
Start point The instruction that will be executed first when starting program
execution.
Stop point A point at which the robot stops before it continues on to the next
point.
System module A module that is always present in the program memory. When a
new program is read, the system modules remain in the program
memory.
System parameters The settings which define the robot equipment and properties;
configuration data in other words.
Tool Center Point (TCP) The point, generally at the tip of a tool, that moves along the pro-
grammed path at the programmed velocity.
Trap routine The routine that defines what is to be done when a specific inter-
rupt occurs.
Variable Data that can be changed from within a program, but which loses
its value (returns to its initial value) when a program is started
from the beginning.
Window The robot is programmed and operated using windows (or views)
on the FlexPendant, for example the Program Editor window and
the Calibration window. A window can be exited by switching to
another window or by tapping the close button in the upper right
corner.
Zone The spherical space that surrounds a fly-by point. As soon as the
robot enters this zone, it starts to move to the next position.
Index D
data, 27
assigning values, 48
7 constant, 29
7 axes robots, 149
declarations, 29
A description, 11
additional axes, 58, 109 initiating, 32
aggregate, 27 persistent, 29
aggregates program, 29
expressions, 39 routine, 29
alias data types, 27 scope, 29
AND, 36 storage class, 33
argument, 161 used in expressions, 38
conditional, 40 variable, 29
arguments data types, 27
description, 11 aggregates, 27
arithmetic expressions, 35 alias, 27
arithmetic functions, 82 atomic, 27
arrays components, 27
expressions, 38 non-value, 27
variables, 31 record, 27
assigning value to data, 48 semi value, 27
atomic data type, 27 declaration, 161
automatic mode, 161 module, 18
axis configuration, 135 routine, 23
declarations
B constants, 32
backward execution, 99 persistents, 31
backward handler, 99 variables, 30
base coordinate system, 104, 110 dialog box, 161
binary communication, 67 displacement coordinate system, 108
bit functions, 83 DIV, 35
bool, 49 dnum, 49
C E
calibration, 90 equal data types, 27
case sensitivity, 12 ERRNO, 76
circular interpolation, 117 error handler, 161
circular movement, 55, 117 error handlers, 75
clock, 81 error numbers, 74
collision detection, 61, 144 error recovery, 74
comment, 14 event log, 77
comments, 48 event type, 89
communication, 85 execution handler, 89
communication instructions, 66 execution level, 89
component of a record, 27, 161 expression, 161
concurrent execution, 131 expressions, 35
conditional argument, 40 arithmetic, 35
confdata, 136 logical, 36
configuration, 161 string, 37
robot, 135
configuration data, 88 F
ConfJ, 138 file header, 15
ConfL, 138 file instructions, 67
CONST, 32 file operation functions, 86
constant, 29, 161 fly-by point, 120, 130, 161
constants, 32 function, 21, 161
initialization values, 32 function calls, 40
conversion, 91 function declaration, 23
conversions, 49
conveyor tracking, 60
G
global
coordinated additional axes, 109
data, 29
coordinate systems, 103, 139
routine, 21
corner path, 120, 161
glossary, 161
cross connections, 158
group signal, 161
I O
I/O, 161 object coordinate system, 107
I/O principles, 157 operator panel, 162
I/O signals, 63 operator priority, 42
I/O synchronization, 130 optional parameter, 22
identifiers, 13 OR, 36
independent axes, 58, 125 orientation, 162
indexing conveyor, 60 output signals, 63
initiating data, 32
INOUT, 22 P
input signals, 63 parameter, 22, 162
instructions path correction, 59
description, 11 path recorder, 59
pick lists, 45 path synchronization, 133
program flow, 46 PERS, 31
interpolation, 116, 120 persistent, 29, 162
interrupt, 161 persistents, 31
interrupted path, 61 initialization values, 32
interrupts, 56, 70 pick lists, 45
placeholders, 15
J position fix I/O, 133
joint interpolation, 116 position functions, 61
joint movement, 55, 116 positioning instructions, 55
priority
K operators, 42
kinematic models, 139 tasks, 97
procedure, 21, 162
L procedure call, 24
linear interpolation, 116 procedure declaration, 23
linear movement, 55, 116 program, 17, 162
load identification, 61 program data, 27, 29, 162
loading modules, 48 program flow instructions, 46
local program module, 17, 162
data, 29
routine, 21 Q
logical expressions, 36 quarter revolutions, 136
logical values, 14
R
M RAPID Message Queues, 69
main routine, 17, 161 rawbytes communication, 68
manual mode, 161 record, 27, 162
mathematical instructions, 82 records
mechanical unit, 161 expressions, 38
memory, 87 reserved words, 13
MOD, 35 restart the controller, 88
modified linear interpolation, 119 robot configuration, 135
module, 161 robot configuration supervision, 137
module declaration, 18 robot kinematics, 139
modules, 17 routine, 21, 162
description, 17 routine data, 29, 162
motion, 55 routine declaration, 23
motion data, 62 routines
motion instructions, 55 description, 11
motion settings
instructions, 50 S
motion supervision, 144 scope
motors on/off, 162 data, 29
move instructions, 55 routine, 21
MultiMove, 58, 94 search instructions, 56
Multitasking, 93 semi value data types, 27
sensor synchronization, 60
N serial channel communication, 67
non-value data types, 27 serial link robot, 149
NOT, 36 service, 90
num, 49 service information, 89
numeric values, 14 servo tracking, 60
signals, 63, 157
ABB Inc.
Robotics and Motion
1250 Brown Road
Auburn Hills, MI 48326
USA
Telephone: +1 248 391 9000
abb.com/robotics
3HAC050947-001, Rev H, en