You are on page 1of 879

RAPID Reference Manual

Overview / System Data Types and Routines
3HAC 7783-1 / 7774-1 For BaseWare OS 4.0

ABB Flexible Automation

3HAC 7774-1 For BaseWare OS 4.0

Data Types and System Data

System Data Types and Routines

Instructions

Functions

Index

The information in this document is subject to change without notice and should not be construed as a commitment by ABB Robotics AB. ABB Robotics AB assumes no responsibility for any errors that may appear in this document. In no event shall ABB Robotics AB be liable for incidental or consequential damages arising from use of this document or of the software and hardware described in this document. This document and parts thereof must not be reproduced or copied without ABB Robotics AB´s written permission, and contents thereof must not be imparted to a third party nor be used for any unauthorized purpose. Contravention will be prosecuted. Additional copies of this document may be obtained from ABB Robotics AB at its then current charge.

© ABB Robotics AB Article number: 3HAC 7774-1 Issue: For BaseWare OS 4.0 ABB Robotics AB S-721 68 Västerås Sweden

Data Types
CONTENTS

aiotrigg bool byte clock confdata dionum errnum extjoint intnum iodev jointtarget loaddata loadsession mecunit motsetdata num o_jointtarget orient o_robtarget pos pose progdisp robjoint robtarget shapedata signalxx speeddata stoppointdata string symnum System Data taskid testsignal tooldata tpnum triggdata

Analog I/O trigger condition Logical values Decimal values 0 - 255 Time measurement Robot configuration data Digital values 0 - 1 Error number Position of external joints Interrupt identity Serial channels and files Joint position data Load data Program load session Mechanical unit Motion settings data Numeric values (registers) Original joint position data Orientation Original position data Positions (only X, Y and Z) Coordinate transformations Program displacement Joint position of robot axes Position data World zone shape data Digital and analog signals Speed data Stop point data Strings Symbolic number Task identification Test signal Tool data Teach Pendant Window number Positioning events - trigg

System Data Types and Routines

1-3

Data Types

tunetype wobjdata wzstationary wztemporary zonedata

Servo tune type Work object data Stationary world zone data Temporary world zone data Zone data

1-4

System Data Types and Routines

Data Types

aiotrigg

aiotrigg

Analog I/O trigger condition

aiotrigg (Analog I/O Trigger) is used to define the condition to generate an interrupt for an analog input or output signal.

Description
Data of the type aiotrigg defines the way a low and a high threshold will be used to determine whether the logical value of an analog signal satisfies a condition to generate an interrupt.

Example
VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalAI \Single, ai1, AIO_BETWEEN, 1.5, 0.5, 0, sig1int; Orders an interrupt which is to occur the first time the logical value of the analog input signal ai1 is between 0.5 and 1.5. A call is then made to the iroutine1 trap routine.

Predefined data
The following symbolic constants of the data type aiotrigg are predefined and can be used when specifying a condition for the instructions ISignalAI and ISignalAO.

Value 1 2 3 4 5

Symbolic constant AIO_ABOVE_HIGH AIO_BELOW_HIGH AIO_ABOVE_LOW AIO_BELOW_LOW AIO_BETWEEN

Comment Signal will generate interrupts if above specified high value Signal will generate interrupts if below specified high value Signal will generate interrupts if above specified low value Signal will generate interrupts if below specified low value Signal will generate interrupts if between specified low and high values Signal will generate interrupts if below specified low value or above specified high value Signal will always generate interrupts

6

AIO_OUTSIDE

7

AIO_ALWAYS

System Data Types and Routines

1-aiotrigg-5

aiotrigg

Data Types

Characteristics
aiotrigg is an alias data type for num and consequently inherits its characteristics.

Related information
Described in: Interrupt from analog input signal Interrupt from analog output signal Data types in general, alias data types Instructions - ISignalAI Instructions - ISignalAO Basic Characteristics - Data Types

1-aiotrigg-6

System Data Types and Routines

Data Types

bool

bool

Logical values
Bool is used for logical values (true/false).

Description
The value of data of the type bool can be either TRUE or FALSE.

Examples
flag1 := TRUE; flag is assigned the value TRUE. VAR bool highvalue; VAR num reg1; . highvalue := reg1 > 100; highvalue is assigned the value TRUE if reg1 is greater than 100; otherwise, FALSE is assigned. IF highvalue Set do1; The do1 signal is set if highvalue is TRUE. highvalue := reg1 > 100; mediumvalue := reg1 > 20 AND NOT highvalue; mediumvalue is assigned the value TRUE if reg1 is between 20 and 100.

Related information
Described in: Logical expressions Operations using logical values Basic Characteristics - Expressions Basic Characteristics - Expressions

System Data Types and Routines

1-bool-7

bool

Data Types

1-bool-8

System Data Types and Routines

Data Types

byte

byte

Decimal values 0 - 255
Byte is used for decimal values (0 - 255) according to the range of a byte. This data type is used in conjunction with instructions and functions that handle the bit manipulations and convert features.

Description
Data of the type byte represents a decimal byte value.

Examples
CONST num parity_bit := 8; VAR byte data1 := 130; Definition of a variable data1 with a decimal value 130. BitClear data1, parity_bit; Bit number 8 (parity_bit) in the variable data1 will be set to 0, e.g. the content of the variable data1 will be changed from 130 to 2 (decimal representation).

Error handling
If an argument of the type byte has a value that is not in the range between 0 and 255, an error is returned on program execution.

Characteristics
Byte is an alias data type for num and consequently inherits its characteristics.

Related information
Described in: Alias data types Bit functions Basic Characteristics- Data Types RAPID Summary - Bit Functions

System Data Types and Routines

1-byte-9

byte

Data Types

1-byte-10

System Data Types and Routines

Data Types

clock

clock

Time measurement
Clock is used for time measurement. A clock functions like a stopwatch used for timing.

Description
Data of the type clock stores a time measurement in seconds and has a resolution of 0.01 seconds.

Example
VAR clock clock1; ClkReset clock1; The clock, clock1, is declared and reset. Before using ClkReset, ClkStart, ClkStop and ClkRead, you must declare a variable of data type clock in your program.

Limitations
The maximum time that can be stored in a clock variable is approximately 49 days (4,294,967 seconds). The instructions ClkStart, ClkStop and ClkRead report clock overflows in the very unlikely event that one occurs. A clock must be declared as a VAR variable type, not as a persistent variable type.

Characteristics
Clock is a non-value data type and cannot be used in value-oriented operations.

Related Information
Described in: Summary of Time and Date Instructions Non-value data type characteristics RAPID Summary - System & Time Basic Characteristics - Data Types

System Data Types and Routines

1-clock-11

clock

Data Types

1-clock-12

System Data Types and Routines

Data Types

confdata

confdata

Robot configuration data

Confdata is used to define the axis configurations of the robot.

Description
All positions of the robot are defined and stored using rectangular coordinates. When calculating the corresponding axis positions, there will often be two or more possible solutions. This means that the robot is able to achieve the same position, i.e. the tool is in the same position and with the same orientation, with several different positions or configurations of the robots axes. Some robot types use iterative numerical methods to determine the robot axes positions. In these cases the configuration parameters may be used to define good starting values for the joints to be used by the iterative procedure. To unambiguously denote one of these possible configurations, the robot configuration is specified using four axis values. For a rotating axis, the value defines the current quadrant of the robot axis. The quadrants are numbered 0, 1, 2, etc. (they can also be negative). The quadrant number is connected to the current joint angle of the axis. For each axis, quadrant 0 is the first quarter revolution, 0 to 90°, in a positive direction from the zero position; quadrant 1 is the next revolution, 90 to 180°, etc. Quadrant -1 is the revolution 0° to (-90°), etc. (see Figure 1).

-4

-1

0

3

-3

-2

1

2

Figure 1 The configuration quadrants for axis 6.

For a linear axis, the value defines a meter interval for the robot axis. For each axis, value 0 means a position between 0 and 1 meters, 1 means a position between 1 and 2 meters. For negative values, -1 means a position between -1 and 0 meters, etc. (see Figure 2).

System Data Types and Routines

1-confdata-13

confdata

Data Types

-3.0 -3

-2.0 -2

-1.0 -1

0.0
0

1.0 1

2.0 2

3.0

x (m)

Configuration value

Figure 2 Configuration values for a linear axis.

Robot Configuration data for IRB140
There are three singularities within the robot’s working range (See Motion and I/O Principles - Singularities). cf1 is the quadrant number for axis 1. cf4 is the quadrant number for axis 4. cf6 is the quadrant number for axis 6. cfx is used to select one of eight possible robot configurations numbered from 0 through 7. The table below describes each one of them in terms of how the robot is positioned relative to the three singularities.
cfx 0 1 2 3 4 5 6 7 Wrist centre relative to axis 1 In front of In front of In front of In front of Behind Behind Behind Behind Wrist centre relative to lower arm In front of In front of Behind Behind In front of In front of Behind Behind Axis 5 angle Positive Negative Positive Negative Positive Negative Positive Negative

The pictures below give an example of how the same tool position and orientation is

1-confdata-14

System Data Types and Routines

Data Types
attained by using the eight different configurations: Axis 1 Lower arm Axis 1 Lower arm
ABB

confdata

ABB

beta

-beta

Wrist centre

Wrist centre

cfx = 0

cfx = 1
Figure 3 Example of robot configuration 0 and 1. Note the different signs of the axis 5 angle.

Axis 1 beta
ABB

Axis 1 -beta
ABB

Wrist centre

Wrist centre

Lower arm

Lower arm

cfx = 2

cfx = 3
Figure 4 Example of robot configuration 2 and 3. Note the different signs of the axis 5 angle.

System Data Types and Routines

1-confdata-15

confdata

Data Types

Axis 1

Wrist centre beta

Axis 1

Wrist centre -beta
AB B

AB B

Lower arm

Lower arm

cfx = 4

cfx = 5
Figure 5 Example of robot configuration 4 and 5. Note the different signs of the axis 5 angle.

Axis 1

Lower arm

Axis 1

Lower arm

beta

ABB

-beta

cfx = 6

Figure 6 Example of robot configuration 6 and 7. Note the different signs of the axis 5 angle.

Robot Configuration data for IRB540, 640
Only the configuration parameter cf6 is used.

Robot Configuration data for IRB1400, 2400, 3400, 4400, 6400
Only the three configuration parameters cf1, cf4 and cf6 are used.

1-confdata-16

ABB

Wrist centre

Wrist centre

cfx = 7

System Data Types and Routines

cf4. and 6 respectively and cfx for joint 5. cf6 for joints 1.Data Types confdata Robot Configuration data for IRB5400 All four configuration parameters are used. System Data Types and Routines 1-confdata-17 . cx is of less importance. 5423 The robots have two linear axes (arms 1 and 2) and one or two rotating axes (arms 4 and 5) (Arm 3 locked) cf1 is used for the linear axis 1 cfx is used for the linear axis 2 cf4 is used for the rotating axis 4 cf6 is not used Robot configuration data for IRB840 The robot has three linear axes (arms 1. Robot configuration data for IRB5404. 2 and 3) and one rotating axis (arm 4). cf1 is used for the rotating axis 1 cfx is used for the rotating axis 2 cf4 and cf6 are not used Robot Configuration data for IRB5413. 4. 5414. cf1. the correct setting of the configuration parameters c1. 5406 The robots have two rotation axes (arms 1 and 2) and one linear axis (arm 3). cf1 is used for the linear axis 1 cfx is used for the linear axis 2 cf4 is used for the rotating axis 4 cf6 is not used Because the robot’s structure is mainly linear.

cfx Rotating axis: For the IRB140. Linear axis: The current meter interval of axis 2. expressed as a positive or negative integer. using the current quadrant of axis 2. expressed as a positive or negative integer.confdata Data Types Components cf1 Rotating axis: The current quadrant of axis 1. expressed as a positive or negative integer. Linear axis: The current meter interval of axis 1. Linear axis: The current meter interval of axis 4. expressed as a positive or negative integer. expressed as a positive or negative integer. For other robots. expressed as an integer in the range from 0 to 7. the current quadrant of axis 5. Data type: num Data type: num Data type: num Data type: num 1-confdata-18 System Data Types and Routines . expressed as a positive or negative integer. cf6 Rotating axis: The current quadrant of axis 6. expressed as a positive or negative integer. Linear axis: The current meter interval of axis 6. expressed as a positive or negative integer. For the IRB5400. expressed as a positive or negative integer. cf4 Rotating axis: The current quadrant of axis 4. the current robot configuration.

i. i. 0.90o. 0 .The axis configuration of the robot axis 6 is quadrant 0. 0-(-90o). i. . . 90-180o.90o.e. 0 .e.The axis configuration of the robot axis 5 is quadrant 0.The axis configuration of the robot axis 4 is quadrant -1.Robot Configuration System Data Types and Routines 1-confdata-19 . Structure < dataobject of confdata > < cf1 of num > < cf4 of num > < cf6 of num > < cfx of num > Related information Described in: Coordinate systems Handling configuration data Motion and I/O Principles Coordinate Systems Motion and I/O Principles .The axis configuration of the robot axis 1 is quadrant 1.e.Data Types confdata Example VAR confdata conf15 := [1. -1.e. i. . 0] A robot configuration conf15 is defined as follows: .

confdata Data Types 1-confdata-20 System Data Types and Routines .

Description Data of the type dionum represents a digital value 0 or 1.System Parameters Basic Characteristics. Related information Described in: Summary input/output instructions Configuration of I/O Alias data types RAPID Summary Input and Output Signals User’s Guide . Error handling If an argument of the type dionum has a value that is neither equal to 0 nor 1. Examples CONST dionum close := 1. close. Definition of a constant close with a value equal to 1. i. This data type is used in conjunction with instructions and functions that handle digital input or output signals. SetDO grip1. 1. an error is returned on program execution.1 Dionum (digital input output numeric) is used for digital values (0 or 1).e.Data Types System Data Types and Routines 1-dionum-21 . Characteristics Dionum is an alias data type for num and consequently inherits its characteristics.Data Types dionum dionum Digital values 0 . The signal grip1 is set to close.

dionum Data Types 1-dionum-22 System Data Types and Routines .

CONST errnum machine_error := 1. This error. An error can also be created from within the program using the RAISE instruction. the robot detects an error when division is taking place. System Data Types and Routines 1-errnum-23 . Examples reg1 := reg2 / reg3. A jump is made to the error handler in the routine which. The error handler may be able to correct an error by reading this variable and then program execution can continue in the correct way. machine_error. An error occurs in a machine (detected by means of the input signal di1). ERROR IF ERRNO=machine_error RAISE. is thus assigned different values depending on the nature of an error.Data Types errnum errnum Error number Errnum is used to describe all recoverable (non fatal) errors that occur during program execution. IF di1=0 RAISE machine_error. . this can be dealt with in the error handler of the routine. . ERROR IF ERRNO = ERR_DIVZERO THEN reg3 := 1. can be detected and corrected by assigning reg3 the value 1. the division can be performed again and program execution can continue. This particular type of error can be detected in the error handler by specifying an error number (within the range 1-90 or booked with instruction BookErrNo) as an argument to RAISE. Description If the robot detects an error during program execution. . in turn. Examples of such errors are values that are too high and division by zero. ENDIF If reg3 = 0. The system variable ERRNO. The constant. calls the error handler of the calling routine where the error may possibly be corrected. such as division by zero. Following this. RETRY. is used to let the error handler know exactly what type of error has occurred. of type errnum. however.

Limit StepBwdPath If an IOEnable or IODisable request is interrupted by another request to the same unit Procedure call error (not procedure) at runtime (late binding) Type mismatch . not present or of type switch when executing ArgName Argument is not a persistent reference Argument is not a variable reference Axis is not active Axis is not independent Axis is moving Parameter axis in instruction TestSign and SetCurrRef is wrong. ReadNum or a ReadStr instruction Division by zero An attempt was made to execute an instruction using a place holder A file is accessed incorrectly A file cannot be opened File not found No return value 1-errnum-24 System Data Types and Routines . Timeout when executing a ReadBin. WriteCfgData Data limit .errnum Data Types Predefined data The system variable ERRNO can be used to read the latest error that occurred. The WaitWobj instruction is already active. WriteCfgData CONNECT target is not a variable reference The conveyor is not activated. Name ERR_ALRDYCNT ERR_ARGDUPCND ERR_ARGNAME ERR_ARGNOTPER ERR_ARGNOTVAR ERR_AXIS_ACT ERR_AXIS_IND ERR_AXIS_MOVING ERR_AXIS_PAR ERR_BWDLIMIT ERR_CALLIO_INTER ERR_CALLPROC ERR_CFG_ILLTYPE ERR_CFG_LIMIT ERR_CFG_NOTFND ERR_CNTNOTVAR ERR_CNV_NOT_ACT ERR_CNV_CONNECT ERR_CNV_DROPPED ERR_DEV_MAXTIME ERR_DIVZERO ERR_EXECPHR ERR_FILEACC ERR_FILEOPEN ERR_FILNOTFND ERR_FNCNORET Cause of error The interrupt variable is already connected to a TRAP routine More than one present conditional argument for the same parameter Argument is expression. A number of predefined constants can be used to determine the type of error that has occurred.ReadCfgData. The object that the instruction WaitWobj was waiting for has been dropped.WriteCfgData Not found .ReadCfgData.

despite the fact that the corresponding argument was not used at the routine call The array index is outside the permitted limits Clock overflow Missing destination path in instruction Save Too long regain distance for StartMove instruction Only internal use in LoadId Error from ParIdRobValid or ParIdPosValid Checksum error detected at data transfer with instruction ReadAnyBin End of file is detected before all bytes are read in instruction ReadAnyBin An attempt was made to read non numeric data with ReadNum Reference to unknown entire data object Reference to unknown function Reference to unknown procedure at linking time or at run time (late binding) Reference to unknown trap Error when sending to external computer The signal has already a positive value at the beginning of the search process Parameter Step in SetCurrRef is wrong ERR_OUTOFBND ERR_OVERFLOW ERR_PATH ERR_PATHDIST ERR_PID_MOVESTOP ERR_PID_RAISE_PP ERR_RANYBIN_CHK ERR_RANYBIN_EOF ERR_RCVDATA ERR_REFUNKDAT ERR_REFUNKFUN ERR_REFUNKPRC ERR_REFUNKTRP ERR_SC_WRITE ERR_SIGSUPSEARCH ERR_STEP_PAR System Data Types and Routines 1-errnum-25 .Data Types ERR_FRAME ERR_ILLDIM ERR_ILLQUAT ERR_ILLRAISE ERR_INOMAX ERR_IODISABLE ERR_IOENABLE ERR_IOERROR ERR_LOADED ERR_LOADID_FATAL ERR_LOADID_RETRY ERR_MAXINTVAL ERR_MODULE ERR_NAME_INVALID ERR_NEGARG ERR_NOTARR ERR_NOTEQDIM ERR_NOTINTVAL ERR_NOTPRES errnum Unable to calculate new frame Incorrect array dimension Attempt to use illegal orientation (quaternion) valve Error number in RAISE out of range No more interrupt numbers available Timeout when executing IODisable Timeout when executing IOEnable I/O Error from instruction Save The program module is already loaded Only internal use in LoadId Only internal use in LoadId The integer value is too large Incorrect module name in instruction Save If the unit name does not exist or if the unit is not allowed to be disabled Negative argument is not allowed Data is not an array The array dimension used when calling the routine does not coincide with its parameters Not an integer value A parameter is used.

Data Types 1-errnum-26 System Data Types and Routines .Error Recovery Basic Characteristics . Related information Described in: Error recovery Data types in general. alias data types RAPID Summary .Error Recovery Basic Characteristics .errnum ERR_STRTOOLNG ERR_SYM_ACCESS ERR_TP_DIBREAK ERR_TP_MAXTIME ERR_UNIT_PAR ERR_UNKINO ERR_UNKPROC ERR_UNLOAD ERR_WAIT_MAXTIME ERR_WHLSEARCH Data Types The string is too long Symbol read/write access error A TPRead instruction was interrupted by a digital input Timeout when executing a TPRead instruction Parameter Mech_unit in TestSign and SetCurrRef is wrong Unknown interrupt number Incorrect reference to the load session in instruction WaitLoad Unload error in instruction UnLoad or WaitLoad Timeout when executing a WaitDI or WaitUntil instruction No search stop Characteristics Errnum is an alias data type for num and consequently inherits its characteristics.

For linear axes – the position is defined as the distance in mm from the calibration position. e. the positions are specified in the ExtOffs coordinate system.If the position is not defined in the position data (value is 9E9).Data Types extjoint extjoint Position of external joints Extjoint is used to define the axis positions of external axes.For rotating axes – the position is defined as the rotation in degrees from the calibration position. The six external axes are logically denoted: a. If an external axis offset is used (instruction EOffsOn or EOffsSet). it will result in an error. although the axis is not connected. the following applies: . f. Each such logical axis can be connected to a physical axis and. i. But if the axis is activated. If the stored position value does not comply with the actual axis connection. d. For each logical axis connected to a physical axis. in this case. the value 9E9 is used as a position value. positioners or workpiece manipulators. the connection is defined in the system parameters. the position is defined as follows: . a total of twelve axes. If a logical axis is not connected to a physical one.e. the value will be ignored.If the position is defined in the position data. System Data Types and Routines 1-extjoint-27 . the position data of each axis is checked and it is checked whether or not the corresponding axis is connected. c. Data of the type extjoint is used to hold position values for each of the logical axes a .f. b. . At the time of execution. indicating that the axis is not connected. Description The robot can control up to six external axes in addition to its six internal axes. the value will be ignored if the axis is connected and not activated. .

The position of the external logical axis “a” is set to 11.The position of the external logical axis “b” is set to 12.extjoint Data Types Components eax_a (external axis a) Data type: num The position of the external logical axis “a”. Example VAR extjoint axpos10 := [ 11.3. axpos10. expressed in degrees or mm (depending on the type of axis). eax_f (external axis f) Data type: num The position of the external logical axis “f”..Axes c to f are undefined. 9E9. 12. is defined as follows: . expressed in degrees or mm (depending on the type of axis). eax_b (external axis b) Data type: num The position of the external logical axis “b”. expressed in degrees or mm (depending on the type of axis). 9E9. The position of an external positioner. Structure < dataobject of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > 1-extjoint-28 System Data Types and Routines . 9E9. expressed in degrees or mm (depending on the type of axis). . .3. . 9E9] .. expressed in degrees or mm (depending on the type of axis).

robtarget Instructions .EOffsOn System Data Types and Routines 1-extjoint-29 .Data Types extjoint Related information Described in: Position data ExtOffs coordinate system Data Types .

extjoint Data Types 1-extjoint-30 System Data Types and Routines .

Data Types intnum intnum Interrupt identity Intnum (interrupt numeric) is used to identify an interrupt. This variable is then used in all dealings with the interrupt. The system variable INTNO can thus be used in a trap routine to determine the type of interrupt that occurs. . More than one interrupt identity can be connected to the same trap routine. Description When a variable of type intnum is connected to a trap routine. System Data Types and Routines 1-intnum-31 . feeder_error. ISignalDI di1. such as when ordering or disabling an interrupt. Examples VAR intnum feeder_error. CONNECT feeder_error WITH correct_feeder. An interrupt is generated when the input di1 is set to 1. 1. a call is made to the correct_feeder trap routine. When this happens. it is given a specific value identifying the interrupt.

is limited to 30. ENDTRAP Data Types An interrupt is generated when either of the inputs di1 or di2 is set to 1. VAR intnum feeder2_error. ELSE . The system variable INTNO is used in the trap routine to find out which type of interrupt has occurred. 1. .The maximum number of interrupts. Characteristics Intnum is an alias data type for num and thus inherits its properties. A call is then made to the correct_feeder trap routine. ENDIF . TRAP correct_feeder IF INTNO=feeder1_error THEN . CONNECT feeder2_error WITH correct_feeder. in the queue for execution of TRAP routine at any one time. CONNECT feeder1_error WITH correct_feeder. feeder2_error. feeder1_error. . 1. ENDPROC . PROC init_interrupt(). Related information Described in: Summary of interrupts Alias data types RAPID Summary . Limitations The maximum number of active variables of type intnum at any one time (between CONNECT and IDelete) is limited to 40. ISignalDI di2.intnum VAR intnum feeder1_error. .Interrupts Basic CharacteristicsData Types 1-intnum-32 System Data Types and Routines . ISignalDI di1.

Characteristics Iodev is a non-value data type. input := ReadNum(file). When reading from the file. The file INFILE.Communication User’s Guide .DOC is opened for reading.System Parameters Basic Characteristics . such as printers and files.Data Types System Data Types and Routines 1-iodev-33 . Related information Described in: Communication via serial channels Configuration of serial channels Characteristics of non-value data types RAPID Summary . file\Read. file is used as a reference instead of the file name. Description Data of the type iodev contains a reference to a file or serial channel.DOC”. . It can be linked to the physical unit by means of the instruction Open and then used for reading and writing. Open “HOME:/LOGDIR/INFILE. Example VAR iodev file.Data Types iodev iodev Serial channels and files Iodev (I/O device) is used for serial channels.

iodev Data Types 1-iodev-34 System Data Types and Routines .

eax_b .. the value is ignored.. The value 9E9 is defined for axes which are not connected. Data type: extjoint System Data Types and Routines 1-jointtarget-35 .. . for both the robot and the external axes. But if the axis is activated it will result in error. If the axes defined in the position data differ from the axes that are actually connected on program execution.For linear axes. the following applies: . if the axis is connected and not activated.For rotating axes. . Components robax (robot axes) Data type: robjoint Axis positions of the robot axes in degrees. How the logical axis number and the physical axis number are related to each other is defined in the system parameters. Axis position is defined as the rotation in degrees for the respective axis (arm) in a positive or negative direction from the axis calibration position.Data Types jointtarget jointtarget Joint position data Jointtarget is used to define the position that the robot and the external axes will move to with the instruction MoveAbsJ.If the position is defined in the position data yet the axis is not connected. Description Jointtarget defines each individual axis position. the position is defined as the rotation in degrees from the calibration position. eax_f): . the position is defined as the distance in mm from the calibration position. extax (external axes) The position of the external axes.If the position is not defined in the position data (value 9E9) the value will be ignored. are logical axes. The position is defined as follows for each individual axis (eax_a. External axes eax_a ..

System Parameters 1-jointtarget-36 System Data Types and Routines .MoveAbsJ RAPID Summary .jointtarget Data Types Examples CONST jointtarget calib_pos := [ [ 0. 9E9] ]. 0. Structure < dataobject of jointtarget > < robax of robjoint > < rax_1 of num > < rax_2 of num > < rax_3 of num > < rax_4 of num > < rax_5 of num > < rax_6 of num > < extax of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > Related information Described in: Move to joint position Positioning instructions Configuration of external axes Instructions . [ 0. 0. The external axes b to f are undefined.Motion User’s Guide . 9E9. 9E9. 0. 9E9. The normal calibration position for IRB2400 is defined in calib_pos by the data type jointtarget. 9E9. The normal calibration position 0 (degrees or mm) is also defined for the external logical axis a. 0. 0].

System Data Types and Routines 1-loaddata-37 . the load held in the robot gripper. i. Incorrect definitions of load data can result in overloading of the robot mechanical structure. -> The robot will not be used to its maximum capacity -> Impaired path accuracy including a risk of overshooting -> Risk of overloading the mechanical structure . Load data usually defines the payload (grip load is defined by the instruction GripLoad) of the robot.e. Description Specified loads are used to set up a model of the dynamics of the robot so that the robot movements can be controlled in the best possible way.If the value in the specified load data is less than the value of the true load.Data Types loaddata loaddata Load data Loaddata is used to describe loads attached to the mechanical interface of the robot (the robot’s mounting flange). it means the centre of gravity for the tool holding the work object. The tool load is specified in the tool data (tooldata) which includes load data. It is important to always define the actual tool load and when used. -> Impaired path accuracy including a risk of overshooting -> Risk of overloading the mechanical structure The payload is connected/disconnected using the instruction GripLoad. The object coordinate system when a stationary tool is used. Components mass The weight of the load in kg. the payload of the robot too. cog (centre of gravity) Data type: pos Data type: num The centre of gravity of a tool load expressed in the wrist coordinate system. When incorrect load data is specified. The centre of gravity of a payload expressed in the tool coordinate system.If the value in the specified load data is greater than that of the value of the true load. If a stationary tool is used. it can often lead to the following consequences: .

0. 0. q2. q2. q3. The orientation of the payload coordinate system must coincide with the orientation of the wrist coordinate system. Expressed in the tool coordinate system as a quaternion (q1. q4). q4). q3. The object coordinate system if a stationary tool is used. Pay load (Ref. Expressed in the wrist coordinate system as a quaternion (q1. 0. the best way is to define the orientation of the tool coordinate system (tool frame) to coincide with the orientation of the wrist coordinate system. If a stationary tool is used. 0. it means the inertial axes for the tool holding the work object. The wrist coordinate system Y Z IY Tool load coordinate system Inertial axes of tool load IZ Y’ Z’ X IX TCP X’ IY’ IZ’ Payload coordinate system Inertial axes of payload IX’ Figure 7 Restriction on the orientation of tool load and payload coordinate system. It must always be set to 1. to Figure 7) (axes of moment) Data Types Data type: orient The orientation of the coordinate system defined by the inertial axes of the tool load. The orientation of the tool load coordinate system must coincide with the orientation of the wrist coordinate system. Tool coordinate system 1-loaddata-38 System Data Types and Routines . to figure 1 and 2) The orientation of the coordinate system defined by the inertial axes of the payload. It must always be set to 1. Because of this limitation.loaddata aom Tool load (Ref. 0. 0.

payload distance x dimension Figure 9 The moment of inertia must normally be defined when the distance is less than the load dimension. Correct definition of the inertial moments will allow optimal utilisation of the path planner and axes control. This may be of special importance when handling large sheets of metal. iy (inertia y) Data type: num The inertial moment of the load around the y-axis. ix (inertia x) Data type: num The moment of inertia of the load around the x-axis of the tool load or payload coordinate system in kgm2. expressed in kgm2. All inertial moments of inertia ix. etc. iy and iz equal to 0 kgm2 imply a point mass. System Data Types and Routines 1-loaddata-39 . Normally. the inertial moments must only be defined when the distance from the mounting flange to the centre of gravity is less than the dimension of the load (see Figure 9).Data Types loaddata Wrist coordinate system Y Z Y Y’ X Gripper Tool coordinate system Z Payload coordinate Z’ system Inertial axes of payload Payload X’ The centre of gravity of the payload X Figure 8 The centre of gravity and inertial axes of the payload.

piece1. 0. iz (inertia z) Data Types Data type: num The inertial moment of the load around the z-axis. 0. specified at the same time as the robot releases a payload. Arguments of the type load data in the GripLoad instruction should only be an entire persistent (not array element or record component). For more information. Disconnection of a payload. [1. 50]. see ix. . Examples PERS loaddata piece1 := [ 5.loaddata For more information. [50. 0. y = 0 and z = 50 mm in the tool coordinate system.3. Set gripper. WaitTime 0.3. 0.The payload is a point mass. . GripLoad piece1. 0]. WaitTime 0. The payload in Figure 7 is described using the following values: . 0.Weight 5 kg. specified at the same time as the robot grips the load piece1. 1-loaddata-40 System Data Types and Routines . see ix. Limitations The payload should only be defined as a persistent variable (PERS) and not within a routine. Reset gripper. GripLoad load0. Connection of the payload. 0]. Current values are then saved when storing the program on diskette and are retrieved on loading.The centre of gravity is x = 50. expressed in kgm2.

This load is used as the argument in the instruction GripLoad to disconnect a payload.001. 0]. 0.0 ].tooldata Instructions .GripLoad System Data Types and Routines 1-loaddata-41 .Data Types loaddata Predefined data The load load0 defines a payload.0. The load load0 can always be accessed from the program. [1. 0. but cannot be changed (it is stored in the system module BASE). PERS loaddata load0 := [ 0. 0 . [0. 0. the weight of which is equal to 0 kg. no load at all. i.e. 0.001].Coordinate Systems Data Types . Structure < dataobject of loaddata > < mass of num > < cog of pos > < x of num > < y of num > < z of num > < aom of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < ix of num > < iy of num > < iz of num > Related information Described in: Coordinate systems Definition of tool loads Activation of payload Motion and I/O Principles .

loaddata Data Types 1-loaddata-42 System Data Types and Routines .

WaitLoad Basic Characteristics . to identify the load session. Characteristics Loadsession is a non-value data type and cannot be used in value-oriented operations.Data Types System Data Types and Routines 1-loadsession-43 . Loadsession only contains a reference to the load session.Data Types loadsession loadsession Program load session Loadsession is used to define different load sessions of RAPID program modules.StartLoad. Description Data of the type loadsession is used in the instructions StartLoad and WaitLoad. Related information Described in: Loading program modules during execution Characteristics of non-value data types Instructions .

loadsession Data Types 1-loadsession-44 System Data Types and Routines .

must not be defined in the program. on the other hand. Description Data of the type mecunit only contains a reference to the mechanical unit. consequently. Limitations Data of the type mecunit must not be defined in the program. Predefined data The mechanical units defined in the system parameters can always be accessed from the program (installed data). This means that data of this type does not permit value-oriented operations. Characteristics Mecunit is a non-value data type.Data Types System Data Types and Routines 1-mecunit-45 . DeactUnit User’s Guide .ActUnit. The names of the mechanical units are defined in the system parameters and. Related information Described in: Activating/Deactivating mechanical units Configuration of mechanical units Characteristics of non-value data types Instructions .Data Types mecunit mecunit Mechanical unit Mecunit is used to define the different mechanical units which can be controlled and accessed from the robot and the program.System Parameters Basic Characteristics . The data type can. be used as a parameter when declaring a routine.

mecunit Data Types 1-mecunit-46 System Data Types and Routines .

acc.Data Types motsetdata motsetdata Motion settings data Motsetdata is used to define a number of motion settings that affect all positioning instructions in the program: . PathResol and MotionSup.Motion supervision This data type does not normally have to be used since these settings can only be set using the instructions VelSet. acc.Override of path resolution .Acceleration data . SingArea.Behavior around singular points .ramp Data type: accdata/num The rate by which acceleration and deceleration increases as a percentage of the normal values.Max. Description The current motion settings (stored in the system variable C_MOTSET) affect all movements. The current values of these motion settings can be accessed using the system variable C_MOTSET. vel. ConfL. velocity and velocity override . AccSet.Management of different robot configurations .acc Data type: accdata/num Data type: veldata/num Data type: veldata/num Acceleration and deceleration as a percentage of the normal values.oride Velocity as a percentage of programmed velocity. ConfJ. System Data Types and Routines 1-motsetdata-47 .max Maximum velocity in mm/s. Components vel.

ax4 Data type: confsupdata/num Maximum permitted deviation in degrees for axis 4 (not used in this version). conf.ax6 Data type: confsupdata/num Maximum permitted deviation in degrees for axis 6 (not used in this version). sing. conf. sing.arm Data type: singdata/bool The orientation of the tool is allowed to deviate somewhat in order to prevent arm singularity (not implemented). Limitations One and only one of the components sing. pathresol Data type: num Current override in percentage of the configured path resolution.lsup Data type: confsupdata/bool Supervision of joint configuration is active during linear and circular movement.ax1 Data type: confsupdata/num Maximum permitted deviation in degrees for axis 1 (not used in this version). motionsup Data type: bool Mirror RAPID status (TRUE = On and FALSE = Off) of motion supervision function. 1-motsetdata-48 System Data Types and Routines .wrist Data Types Data type: singdata/bool The orientation of the tool is allowed to deviate somewhat in order to prevent wrist singularity. conf. sing.base may have a value equal to TRUE.base Data type: singdata/bool The orientation of the tool is not allowed to deviate. conf. conf. tunevalue Data type: num Current RAPID override as a percentage of the configured tunevalue for the motion supervision function.wrist.jsup Data type: confsupdata/bool Supervision of joint configuration is active during joint movement.arm or sing.motsetdata sing.

-> confsupdata [100 ].-> tunevalue System Data Types and Routines 1-motsetdata-49 . TRUE. 90].-> singdata [ TRUE.when starting program execution from the beginning. 30. 500 ].-> accdata [ FALSE.vel. 100 ].-> veldata [ 100.-> motionsup [100 ] ].when a new program is loaded . ELSE .oride > 50 THEN . 45. FALSE. ENDIF Different parts of the program are executed depending on the current velocity override. PERS motsetdata C_MOTSET := [ [ 100.... TRUE ].-> path resolution [TRUE ]. on the other hand.at a cold start-up .. The following default values for motion parameters are set . not by assignment. Predefined data C_MOTSET describes the current motion settings of the robot and can always be accessed from the program (installed data). C_MOTSET. can only be changed using a number of instructions.Data Types motsetdata Example IF C_MOTSET.

motsetdata Data Types Structure <dataobject of motsetdata> <vel of veldata > < oride of num > < max of num > <acc of accdata > < acc of num > < ramp of num > <sing of singdata > < wrist of bool > < arm of bool > < base of bool > <conf of confsupdata > < jsup of bool > <lsup of bool > < ax1 of num > < ax4 of num > < ax6 of num > <pathresol of num> <motionsup of bool> <tunevalue of num> -> Affected by instruction VelSet -> Affected by instruction AccSet -> Affected by instruction SingArea -> Affected by instructions ConfJ and ConfL -> Affected by instruction PathResol -> Affected by instruction MotionSup -> Affected by instruction MotionSup Related information Described in: Instructions for setting motion parameters RAPID Summary Motion Settings 1-motsetdata-50 System Data Types and Routines .

. e. Description The value of the num data type may be . b := 5. 3. Integer division where a is assigned an integer (=3) and b is assigned the remainder (=1).an integer.025). In the case of divisions. It may also be written exponentially.g. IF a/b=2 THEN .Data Types num num Numeric values (registers) Num is used for numeric values. counters. a := 10. As the result of a/b is not an integer.5E-2 (= 0. E. . System Data Types and Routines 1-num-51 . therefore. this condition is not necessarily satisfied.e. not an exact integer. Example VAR num reg1. Integers between -8388607 and +8388608 are always stored as exact integers. b := 10 MOD 3.g.a decimal number.g. Decimal numbers are only approximate numbers and should not.2E3 (= 2*103 = 2000). 2.g. be used in is equal to or is not equal to comparisons..g. . the result will also be a decimal number. and operations using decimal numbers. e. a := 10 DIV 3. e. reg1 is assigned the value 3. reg1 := 3. i. e. -5.45.

998E36. CONST num EOF_NUM := 9.num Data Types Predefined data The constant pi (π) is already defined in the system module BASE. Related information Described in: Numeric expressions Operations using numeric values Basic Characteristics . CONST num pi := 3.Expressions Basic Characteristics . The constants EOF_BIN and EOF_NUM are already defined in the system. CONST num EOF_BIN := -1.1415926.Expressions 1-num-52 System Data Types and Routines .

0]. 9E9. 0. MoveAbsJ jpos40. 0. the robot can monitor that further Modpos of the point in question are within the acceptable limits from the original programmed point. 0. 0. 9E9.. The same program after ModPos in which the point jpos40 is corrected to 2 degrees for robot axis 1: CONST jointtarget jpos40 := [[2. 9E9]]. . By saving the original programmed point. tool1. v1000. 9E9. . 9E9. The original programmed point has now been saved in o_jpos40 (by the data type o_jointtarget) and the modified point saved in jpos40 (by the data type jointtarget). 0. System Data Types and Routines 1-o_jointtarget-53 . 9E9. 0. tool1. [0. MoveAbsJ jpos40. the original position is stored as a data of the type o_jointtarget.. 9E9]]. 0. 9E9.. CONST o_jointtarget o_jpos40 := [[0. then the original programmed position is saved. 0.. [0. v1000. z50. [0. When this function is used to modify a position. The fixed name convention means that an original programmed point with the name xxxxx is saved with the name o_xxxxx by using Absolute Limit Modpos. 9E9. 9E9. Description If the function Absolute Limit Modpos is activated and a named position in a movement instruction is modified with the function Modpos. 0. 9E9. 0. 0. 0]. 0.Data Types o_jointtarget o_jointtarget Original joint position data o_jointtarget (original joint target) is used in combination with the function Absolute Limit Modpos. 9E9. z50. 0]. 9E9. 9E9. Example of a program before Modpos: CONST jointtarget jpos40 := [[0. 9E9]].

extax (external axes) The position of the external axes.System Parameters 1-o_jointtarget-54 System Data Types and Routines .Jointtarget User’s Guide .o_jointtarget Data Types Components robax (robot axes) Data type: robjoint Axis positions of the robot axes in degrees. Data type: extjoint Structure < dataobject of o_jointtarget > < robax of robjoint> < rax_1 of num > < rax_2 of num > < rax_3 of num > < rax_4 of num > < rax_5 of num > < rax_6 of num > < extax of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > Related information Described in: Position data Configuration of Limit Modpos Data Types .

Data type: num Data type: num Data type: num Data type: num Example VAR orient orient1. 0. Components q1 Quaternion 1. Description The orientation is described in the form of a quaternion which consists of four elements: q1. see below. orient1 := [1. q3 Quaternion 3. For more information on how to calculate these. q4 Quaternion 4. q3 and q4. . q2 Quaternion 2. this corresponds to no rotation. 0.e. q2. 0].Data Types orient orient Orientation Orient is used for orientations (such as the orientation of a tool) and rotations (such as the rotation of a coordinate system). Limitations The orientation must be normalised. q2-q4=0. The orient1 orientation is assigned the value q1=1. i. the sum of the squares must equal 1: 2 2 2 2 q 1 + q2 + q3 + q4 = 1 System Data Types and Routines 1-orient-55 .

where each of the vectors form one of the columns: x1 y1 x2 y2 z1 z2 x3 y3 z3 A quaternion is just a more concise way to describe this rotational matrix. x3) y = (y1. y2. z3) This means that the x-component of the x-vector in the reference coordinate system will be x1. y. y3) z = (z1. These three vectors can be put together in a matrix. z2.orient Data Types What is a Quaternion? The orientation of a coordinate system (such as that of a tool) can be described by a rotational matrix that describes the direction of the axes of the coordinate system in relation to a reference system (see Figure 10). a rotational matrix. z z x Reference coordinate system y x Rotated coordinate system y Figure 10 The rotation of a coordinate system is described by a quaternion. the y-component will be x2. the quaternions are calculated based on the elements of the rotational matrix: x1 + y2 + z3 + 1 q1 = ---------------------------------------2 x 1 – y2 – z3 + 1 q2 = ---------------------------------------2 y 2 – x1 – z3 + 1 q3 = ---------------------------------------2 z3 – x 1 – y2 + 1 q4 = ---------------------------------------2 sign q2 = sign (y3-z2) sign q3 = sign (z1-x3) sign q4 = sign (x2-y1) 1-orient-56 System Data Types and Routines . z) are vectors which can be expressed in the reference coordinate system as follows: x = (x1. The rotated coordinate systems axes (x. etc. x2.

= -----. the orientation is related to the base coordinate system. -1) y’ = y = (0.707 2 2 0–1–0+1 q2 = --------------------------------.= 0 2 1–0–0+1 2 q3 = --------------------------------. no work object is used and the base coordinate system is equal to the world coordinate system.= 0. 0.= 0 2 sign q3 = sign (1+1) = + Example 2 The direction of the tool is rotated 30o about the X’.= 0.707 2 2 0–0–1+1 q4 = --------------------------------. Thus. 0) Which corresponds to the following rotational matrix: 0 0 1 0 1 0 –1 0 0 The rotational matrix provides a corresponding quaternion: 0+1+0+1 2 q1 = ---------------------------------. The Y’-axis of the tool corresponds to the Yaxis of the base coordinate system (see Figure 11). In this example. How is the orientation of the tool defined in the tool data? System Data Types and Routines 1-orient-57 .= -----. How is the orientation of the tool defined in the position data (robtarget)? The orientation of the tool in a programmed position is normally related to the coordinate system of the work object used. 0.Data Types Example 1 orient A tool is orientated so that its Z’-axis points straight ahead (in the same direction as the X-axis of the base coordinate system).and Z’-axes in relation to the wrist coordinate system (see Figure 11). Z´ X´ Z X Figure 11 The direction of a tool in accordance with example 1. The axes will then be related as follows: x’ = -z = (0. 1. 0) z’ = x = (1.

= 0 2 sign q3 = sign (sin30o+sin30o) = + Structure <dataobject of orient> <q1 of num> <q2 of num> <q3 of num> <q4 of num> Related information Described in: Operations on orientations Basic Characteristics .258819 2 cos 30° – cos 30° – 1 + 1 q4 = --------------------------------------------------------------. cos30o) Which corresponds to the following rotational matrix: cos 30 ° 0 sin 30 ° 0 1 0 – sin 30 ° 0 cos 30 ° The rotational matrix provides a corresponding quaternion: cos 30 ° + 1 + cos 30° + 1 q1 = ---------------------------------------------------------------.Expressions 1-orient-58 System Data Types and Routines . 0. -sin30o) x’ = (0. 0) x’ = (sin30o.= 0. The axes will then be related as follows: x’ = (cos30o. 0.965926 2 cos 30° – 1 – cos 30° + 1 q2 = --------------------------------------------------------------. 1.= 0 2 1 – cos 30° – cos 30° + 1 q3 = --------------------------------------------------------------.= 0.orient Data Types Z Z´ X´ X Figure 12 The direction of the tool in accordance with example 2.

9E9. 9E9] ]. When this function is used to modify a position. 500.. 0. then the original programmed position is saved. . 0. 0. 9E9. 0]. 9E9] ]. z50. The fixed name convention means that an original programmed point with the name xxxxx is saved with the name o_xxxxx by using Absolute Limit Modpos. 0]. tool1. The original programmed point has now been saved in o_p50 (by the data type o_robtarget) and the modified point saved in p50 (by the data type robtarget). z50. 0. 1.Data Types o_robtarget o_robtarget Original position data o_robtarget (original robot target) is used in combination with the function Absolute Limit Modpos. 9E9. MoveL p50. Description If the function Absolute Limit Modpos is activated and a named position in a movement instruction is modified with the function Modpos. 500]. 9E9. Example of a program before Modpos: CONST robtarget p50 := [[500. MoveL p50. [1. 0. 0. the robot can monitor that further Modpos of the point in question are within the acceptable limits from the original programmed point. v1000. 9E9. 9E9] ]. 0].. 0. By saving the original programmed point. v1000. 0]. Components trans (translation) Data type: pos The position (x. 9E9. 1. [500. 9E9. 9E9. [1. [1. 9E9. 500]. The same program after ModPos in which the point p50 is corrected to 502 in the xdirection: CONST robtarget p50 := [[502. CONST o_robtarget o_p50 := [[500. 9E9. [1. 1. 500. [ 500. 0]. [1. 0.. tool1. 9E9. [1. y and z) of the tool centre point expressed in mm. 0. 9E9. the original position is stored as a data of the type o_robtarget. 500]. . 0]. [500.. 500. System Data Types and Routines 1-o_robtarget-59 .

q3 and q4). robconf (robot configuration) Data type: confdata The axis configuration of the robot (cf1. extax (external axes) The position of the external axes.System Parameters 1-o_robtarget-60 System Data Types and Routines .Robtarget User’s Guide . cf6 and cfx). q2. expressed in the form of a quaternion (q1. Data type: extjoint Structure < dataobject of o_robtarget > < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < robconf of confdata > < cf1 of num > < cf4 of num > < cf6 of num > < cfx of num > < extax of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > Related information Described in: Position data Configuration of Limit Modpos Data Types .o_robtarget rot (rotation) Data Types Data type: orient The orientation of the tool. cf4.

940]. Z=940 mm. y The Y-value of the position. pos1. Y and Z. The pos1 position is assigned the value: X=500 mm. Description Data of the type pos describes the coordinates of a position: X. Components x The X-value of the position.Data Types pos pos Positions (only X. Structure <dataobject of pos> <x of num> <y of num> <z of num> System Data Types and Routines 1-pos-61 .x := pos1. Data type: num Data type: num Data type: num Examples VAR pos pos1. The robtarget data type is used for the robot’s position including the orientation of the tool and the configuration of the axes.x + 50. Y=0 mm. 0. Y and Z). pos1 := [500. The pos1 position is shifted 50 mm in the X-direction. . z The Z-value of the position. Y and Z) Pos is used for positions (only X.

Expressions Data Types.robtarget 1-pos-62 System Data Types and Routines .pos Data Types Related information Described in: Operations on positions Robot position including orientation Basic Characteristics .

0. frame1. y and z) of the coordinate system. where X=50 mm. Structure <dataobject of pose> <trans of pos> <rot of orient> Related information Described in: What is a Quaternion? Data Types . Y=0 mm. Data type: orient Example VAR pose frame1. describe how the tool coordinate system is located and oriented in relation to the wrist coordinate system. 0].Data Types pose pose Coordinate transformations Pose is used to change from one coordinate system to another.rot := [1. there is.trans := [50. 0. 0. no rotation. 40]. Components trans (translation) Data type: pos The displacement in position (x. for example.orient System Data Types and Routines 1-pose-63 . Z=40 mm. however. frame1. Description Data of the type pose describes how a coordinate system is displaced and rotated around another coordinate system. . The frame1 coordinate transformation is assigned a value that corresponds to a displacement in position. rot (rotation) The rotation of the coordinate system. The data can.

pose Data Types 1-pose-64 System Data Types and Routines .

the value is expressed in degrees. EOffsSet and EOffsOn. This data type does not normally have to be used since the data is set using the instructions PDispSet. it is temporarily deactivated by storing the value in the variable progdisp1 and. EOffsOff. tool1. EOffsSet progdisp1. eoffs (external offset) Data type: extjoint The offset for each of the external axes. *. EOffsOn \ExeP:=psearch. . Example VAR progdisp progdisp1. For more information. PDispSet progdisp1. If the axis is linear. *. Components pdisp (program displacement) Data type: pose The program displacement for the robot. SearchL sen1. PDispOn. psearch. . the value is expressed in mm. PDispOn. if it is rotating. EOffsSet. EOffsOn and EOffsOff.pdisp. see the instructions PDispSet. Then.Data Types progdisp progdisp Program displacement Progdisp is used to store the current program displacement of the robot and the external axes. progdisp1:=C_PROGDISP. PDispOff. First. re-activated using the instructions PDispSet and EOffsSet. . tool1. a program displacement is activated from a searched position. p10. System Data Types and Routines 1-progdisp-65 . PDispOn \ExeP:=psearch. The translation is expressed in mm. expressed using a translation and an orientation. later on. v100. It is only used to temporarily store the current value for later use. PDispOff. Description The current values for program displacement can be accessed using the system variable C_PROGDISP.eoffs.

Structure < dataobject of progdisp > <pdisp of pose> < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < eoffs of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > Related information Described in: Instructions for defining program displacement RAPID Summary . C_PROGDISP. and can always be accessed from the program (installed data).progdisp Data Types Predefined data The system variable C_PROGDISP describes the current program displacement of the robot and external axes. on the other hand. not by assignment. can only be changed using a number of instructions.Motion Settings Coordinate systems Motion and I/O Principles Coordinate Systems 1-progdisp-66 System Data Types and Routines .

Axis position is defined as the rotation in degrees for the respective axis (arm) in a positive or negative direction from the axis calibration position. Structure < dataobject of robjoint > < rax_1 of num > < rax_2 of num > < rax_3 of num > < rax_4 of num > < rax_5 of num > < rax_6 of num > Related information Described in: Joint position data Move to joint position Data Types .MoveAbsJ System Data Types and Routines 1-robjoint-67 .. Description Data of the type robjoint is used to store axis positions in degrees of the robot axes 1 to 6.Data Types robjoint robjoint Joint position of robot axes Robjoint is used to define the axis position in degrees of the robot axes. rax_6 (robot axis 6) Data type: num The position of robot axis 6 in degrees from the calibration position. Components rax_1 (robot axis 1) Data type: num The position of robot axis 1 in degrees from the calibration position. ..jointtarget Instructions .

robjoint Data Types 1-robjoint-68 System Data Types and Routines .

If the position is programmed with some other work object than the one used in the instruction. System Data Types and Routines 1-robtarget-69 . If no work object is specified.if axis 6 has a negative or positive revolution. this is the world coordinate system. the robot will not move in the expected way. rot (rotation) Data type: orient The orientation of the tool.if axis 4 points downwards or upwards. The position is specified in relation to the current object coordinate system. Make sure that you use the same work object as the one used when programming positioning instructions. including program displacement. This defines the axis values if these are in any way ambiguous. Components trans (translation) Data type: pos The position (x.Data Types robtarget robtarget Position data Robtarget (robot target) is used to define the position of the robot and external axes. the axis configuration is also specified. this is the world coordinate system. for example: .if the robot is in a forward or backward position. including any program displacement. including program displacement. The position is defined based on the coordinate system of the work object. The orientation is specified in relation to the current object coordinate system. Description Position data is used to define the position in the positioning instructions to which the robot and external axes are to move. As the robot is able to achieve the same position in several different ways. If no work object is specified. q3 and q4). . expressed in the form of a quaternion (q1. y and z) of the tool centre point expressed in mm. q2. Incorrect use can injure someone or damage the robot or other equipment. .

0].. The first positive quarter revolution 0 to 90 o is defined as 0. the value will be ignored. the position is defined as the distance in mm from the calibration position.For rotating axes. cf4. expressed in degrees or mm (depending on the type of axis). But if the axis is activated. . 0. This is defined in the form of the current quarter revolution of axis 1.The position of the external logical axes. 12. 1. the following applies: .If the position is not defined in the position data (value 9E9)..3]. 225. 1-robtarget-70 System Data Types and Routines . The value 9E9 is defined for axes which are not connected. A position p15 is defined as follows: . The component cfx is only used for the robot model IRB5400. eax_f): . . if the axis is connected and not activated.The orientation of the tool in the same direction as the object coordinate system. the value is ignored. For more information.For linear axes. 9E9] ]. axis 6 in position 0-90o. If the axes defined in the position data differ from the axes that are actually connected on program execution. 500.The position of the robot: x = 600. .3 mm in the object coordinate system. [ 11. .. axis 4 and axis 6.3. 0]. it will result in an error. How the logical axis number and the physical axis number are related to each other is defined in the system parameters. .The axis configuration of the robot: axes 1 and 4 in position 90-180o. see data type confdata. Data type: extjoint Examples CONST robtarget p15 := [ [600. extax (external axes) The position of the external axes. The position is defined as follows for each individual axis (eax_a. eax_b . [1.If the position is defined in the position data although the axis is not connected. cf6 and cfx).. Axes c to f are undefined. [1. are logical axes. 0. 9E9. y = 500 and z = 225. 0. a and b. External axes eax_a .robtarget robconf (robot configuration) Data Types Data type: confdata The axis configuration of the robot (cf1. 9E9. the position is defined as the rotation in degrees from the calibration position. 9E9.

p20 := Offs(p20. the number of characters in the name of the data of the type robtarget. is limited to 14 (in other cases 16)..0). The position is then moved 10 mm in the x-direction.0..Data Types VAR robtarget p20. Structure < dataobject of robtarget > < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < robconf of confdata > < cf1 of num > < cf4 of num > < cf6 of num > < cfx of num > < extax of extjoint > < eax_a of num > < eax_b of num > < eax_c of num > < eax_d of num > < eax_e of num > < eax_f of num > System Data Types and Routines 1-robtarget-71 . p20 := CRobT(). Limitations When using the configurable edit function Absolute Limit Modpos. robtarget The position p20 is set to the same position as the current position of the robot by calling the function CRobT. .10.

robtarget Data Types Related information Described in: Positioning instructions Coordinate systems Handling configuration data Configuration of external axes What is a quaternion? RAPID Summary .Motion Motion and I/O Principles Coordinate Systems Motion and I/O Principles .Robot Configuration User’s Guide .Orient 1-robtarget-72 System Data Types and Routines .System Parameters Data Types .

a cylinder. WZLimSup \Stat... ENDPROC A conveyor is defined as a box and the supervision for this area is activated. .a straight box. A pole is defined as a cylinder and the supervision of this zone is also activated. . the motion is stopped. VAR shapedata volume.. 2500. p_corner2. Characteristics shapedata is a non-value data type. If the robot reaches one of these areas. defined by a WZSphDef instruction . WZLimSup \Stat.. p_corner1.Data Types shapedata shapedata World zone shape data shapedata is used to describe the geometry of a world zone. volume. volume. PROC . pole. parallel to the z axis of the world coordinate system and defined by a WZCylDef instruction The geometry of a world zone is defined by one of the previous instructions and the action of a world zone is defined by the instruction WZLimSup or WZDOSet. Example VAR wzstationary pole.. System Data Types and Routines 1-shapedata-73 . VAR wzstationary conveyor. with all sides parallel to the world coordinate system and defined by a WZBoxDef instruction . p_center. Description World zones can be defined in 3 different geometrical shapes: . WZCylDef \Inside. WZBoxDef \Inside.. conveyor.a sphere. 200. volume. volume.

WZLimSup Instructions .WZSphDef Instructions .shapedata Data Types Related information Described in: World Zones World zone shape Define box-shaped world zone Define sphere-shaped world zone Define cylinder-shaped world zone Activate world zone limit supervision Activate world zone digital output set Motion and I/O Principles World Zones Data Types .WZBoxDef Instructions .WZDOSet 1-shapedata-74 System Data Types and Routines .shapedata Instructions .WZCylDef Instructions .

Variables of the type signalxi contain a reference to a signal as well as the possibility to retrieve the value directly in the program.Data Types signalxx signalxx Digital and analog signals Data types within signalxx are used for digital and analog input and output signals.. if used in value context. an error message will be displayed as soon as an instruction or function that refers to this signal is executed. on the other hand.g.2 THEN . Limitations Data of the data type signalxx must not be defined in the program. The value of an input signal can be read directly in the program. DOutput. The names of the signals are defined in the system parameters and are consequently not to be defined in the program. System Data Types and Routines 1-signalxx-75 . The value is set using an instruction. : ! Digital input IF di1 = 1 THEN ... be used as a parameter when declaring a routine.. ! Digital group input IF gi1 = 5 THEN . ! Analog input IF ai1 > 5. Description Data type signalai signalao signaldi signaldo signalgi signalgo Used for analog input signals analog output signals digital input signals digital output signals groups of digital input signals groups of digital output signals Variables of the type signalxo only contain a reference to the signal. e.g. However. The data type can.. e. if this is in fact done..

Characteristics Signalxo is a non-value data type. Related information Described in: Summary input/output instructions Input/Output functionality in general Configuration of I/O Characteristics of non-value data types RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide . Thus. data of this type does not permit valueoriented operations. these signals cannot be used.signalxx Data Types Predefined data The signals defined in the system parameters can always be accessed from the program by using the predefined signal variables (installed data). It should however be noted that if other data with the same name is defined.System Parameters Basic Characteristics . Signalxi is a semi-value data type.Data Types 1-signalxx-76 System Data Types and Routines .

of the reorientation of the tool. the velocity is specified relative to the work object. v_leax (velocity linear external axes) Data type: num The velocity of linear external axes in mm/s.Data Types speeddata speeddata Speed data Speeddata is used to specify the velocity at which both the robot and the external axes move.at which the tool centre point moves. v_reax (velocity rotational external axes) Data type: num The velocity of rotating external axes in degrees/s. depending on the type of robot and the path of movement. The velocity is also restricted by the performance of the robot. Description Speed data defines the velocity: . This differs. System Data Types and Routines 1-speeddata-77 .at which linear or rotating external axes move. v_ori (velocity orientation) Data type: num Data type: num The velocity of reorientation about the TCP expressed in degrees/s. one of the velocities often limits all movements. Components v_tcp (velocity tcp) The velocity of the tool centre point (TCP) in mm/s. The velocity of the other movements will be reduced in such a way that all movements will finish executing at the same time. When several different types of movement are combined. If a stationary tool or coordinated external axes are used. the velocity is specified relative to the work object. . If a stationary tool or coordinated external axes are used. .

axis 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 5000 mm/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1000o/s 1-speeddata-78 System Data Types and Routines . Name v5 v10 v20 v30 v40 v50 v60 v80 v100 v150 v200 v300 v400 v500 v600 v800 v1000 v1500 v2000 v2500 v3000 v4000 v5000 vmax v6000 v7000 TCP speed 5 mm/s 10 mm/s 20 mm/s 30 mm/s 40 mm/s 50 mm/s 60 mm/s 80 mm/s 100 mm/s 150 mm/s 200 mm/s 300 mm/s 400 mm/s 500 mm/s 600 mm/s 800 mm/s 1000 mm/s 1500 mm/s 2000 mm/s 2500 mm/s 3000 mm/s 4000 mm/s 5000 mm/s 5000 mm/s 6000 mm/s 7000 mm/s Orientation 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s 500o/s o 500 /s Linear ext.v_tcp := 900. The speed data vmedium is defined with the following velocities: .1000 mm/s for the TCP. 30. . .15 degrees/s for rotating external axes.speeddata Data Types Example VAR speeddata vmedium := [ 1000.30 degrees/s for reorientation of the tool. 200. The velocity of the TCP is changed to 900 mm/s. Predefined data A number of speed data are already defined in the system module BASE. 15 ]. . axis Rotating ext. vmedium.200 mm/s for linear external axes.

System Parameters Product Specification System Data Types and Routines 1-speeddata-79 .Data Types speeddata Structure < dataobject of speeddata > < v_tcp of num > < v_ori of num > < v_leax of num > < v_reax of num > Related information Described in: Positioning instructions Motion/Speed in general Defining maximum velocity Configuration of external axes Motion performance RAPID Summary .Positioning during Program Execution Instructions .VelSet User’s Guide .Motion Motion and I/O Principles .

speeddata Data Types 1-speeddata-80 System Data Types and Routines .

The robot is considered to have reached a stop point when the convergence criteria of the point are satisfied.Data Types stoppointdata stoppointdata Stop point data Stoppointdata is used to specify how a position is to be terminated. The in-position type also uses a minimum and a maximum time. If the movement is synchronised. The robot waits for at least the minimum time and at most the maximum time. When the “prefetch” event arrives. the RAPID execution waits for the robot to come into position. the robot still has a long way to move. If the movement is not synchronised. how close to the programmed position the axes must be before moving towards the next position. It is also possible to specify timing criteria. .e.The in-position type of stop point is defined as a percentage of the convergence criteria for the fine point. When the program server receives an “in-pos” or a “prefetch” event. the RAPID execution gets a “prefetch” event almost a half second before the physical robot reaches the programmed position. A zone is specified in the instruction for the movement. A fly-by point means that the programmed position is never reached. . defining a corner path. it continues with the next instruction. The stoppointdata also determines whether the movement shall be synchronised with the RAPID execution or not. Description A position can be terminated either in the form of a fly-by point or a stop point. When the “in-pos” event arrives. . Three types of stop points can be defined by the stoppointdata.The follow time type of stop point is a special type of stop point used to coordinate the robot movement with an external manipulator. the direction of the motion is formed into the corner path before the position is reached. Instead of heading for the programmed position. the System Data Types and Routines 1-stoppointdata-81 . The convergence criteria are speed and position. i.The stop time type of stop point always waits in the stop point for the given time. for the position and speed criteria to be satisfied. A stop point means that the robot and external axes must reach the specified position before the robot/external axes continues with the next movement.

1 seconds. except followtime. The robot speed does not decrease linearly. Figure 13 Termination of stop points Data Types Speed Robot speed In-pos Reference speed h Constant lag Min/max time Stop time The termination of the stop points is described in the figure above. The time measurement starts when the reference speed is zero. The constant lag is about 0.stoppointdata robot is close to the programmed position. 1-stoppointdata-82 System Data Types and Routines . The timing elements of stoppointdata use the reference speed as a trigger. Consequently there is no sense in using values less than the constant lag. The robot controller is always ahead of the physical robot. Therefore. the time in the timing elements always includes the constant lag. It is shown as the constant lag in the figure above.

The movement terminates as a follow-time. Predefined values are: Value 1 2 3 in-pos stoptime followtime Symbolic constant Comment In position type number Stop time type number Follow time type number stoppointdata type (type of stop point) Defines the type of stop point to use. The program starts the execution of the next instruction before the stop point has been reached. It is used to choose the type of stop point or which data elements to use in the stoppointdata. The zone data in the instruction is used when the robot leaves the manipulator.position The position condition (the radius) for the TCP as a percentage of a normal fine stop point. an external manipulator coordinated. Enables the followtime element in stoppointdata. The zone data in the instruction is not used. (position condition for TCP) Data type: num - inpos. Enables the stoptime element in stoppointdata. Enables the inpos element in stoppointdata. 1 (inpos) The movement terminates as an in-position type of stop point. The program do not start to execute the next instruction until the stop point has been reached. use z0. System Data Types and Routines 1-stoppointdata-83 . The zone data in the instruction is not used. FALSE -> The movement is not synchronised with RAPID execution. fine point. use z0. The movement terminates as a stop-time type of stop point. TRUE -> The movement is synchronised with RAPID execution. (program synchronisation) Data type: bool Data type: stoppoint 2 (stoptime) 3 (followtime) progsynch Synchronisation with RAPID program execution.Data Types stoppointdata Components stoppoint Stoppoint is an alias data type for num.

Maximum value is 20. Used to make the robot wait at the point for at least the specified time. inpos. stoptime (stop time) Data type: num The time in seconds the TCP stands still in position before starting the next movement. inpos.stoppointdata inpos. Maximum value is 20. Data type: num Data type: num Data type: num 1-stoppointdata-84 System Data Types and Routines .maxtime (maximum wait time) Data type: num The maximum wait time in seconds for convergence criteria to be satisfied. x1 () Reserved for future use. x3 () Reserved for future use.speed (speed condition for TCP) Data Types Data type: num The speed condition for the TCP as a percentage of a normal fine stop point.0 seconds. followtime (follow time) Data type: num The time in seconds the TCP follows the movement of the external manipulator. Used to assure that the robot does not get stuck in the point if the speed and position conditions are set too tight. x2 () Reserved for future use.0 seconds. Maximum value is 20.mintime (minimum wait time) Data type: num The minimum wait time in seconds before in position.0 seconds.

The stop point distance criteria is 25% of the distance defined for the stop point fine. If it is a move-instruction the robot stops for 1. TRUE. MoveL *. grip4.45 s. . inpos. . 0. 0. 25. 0. MoveL *.The maximum time to wait on convergence is 5 s.inpos. FALSE. The stop point data my_inpos is defined by means of the following characteristics: . 5]. 0. 40. 0. v1000. FALSE.position := 40. 0.The stop point speed criteria is 40% of the speed defined for the stop point fine. 0]. 0.The wait time in position is 1.45. the criteria is satisfied when the robot has 25% of the speed .Data Types stoppointdata Examples In-pos VAR stoppointdata my_inpos := [ inpos. v1000.1. 0.The minimum time to wait before convergence is 100 ms. 40. MoveL *. TRUE.45 seconds before it starts the next motion. 1. stoptime.The type of stop point is stop-time type. The next RAPID instruction executes. The robot moves towards the programmed position until the prefetch event arrives.stoptime := 6. z0\Inpos:=my_stoptime. . I. 0. 0].The stop point will not be synchronised with the RAPID program execution. my_inpos. The stop point data my_stoptime is defined by means of the following characteristics: . 0.The type of stop point is in-position type. System Data Types and Routines 1-stoppointdata-85 . grip4. z0\Inpos:=my_inpos. 0. The stop point distance criteria is adjusted to 40%. [ 25.1. The robot moves towards the programmed position until one of the criteria position or speed is satisfied.e. Stop time VAR stoppointdata my_stoptime := [ stoptime. [ 0. my_inpos. grip4.The stop point will be synchronised with the RAPID program execution. . . v1000. .66. 5. 0]. z0\Inpos:=my_inpos.

0 s 1. TRUE.5. grip4.66 seconds. my_inpos. z0\Inpos:=my_waittime. v1000.5 s 0s 0s 0s 1-stoppointdata-86 System Data Types and Routines . MoveL *.4 s. . If the next RAPID instruction is a move-instruction.5 s 1. grip6. Follow time VAR stoppointdata my_followtime := [ followtime. the robot stops for 6. 0. 0.66 s. 0]. followtime.The type of stop point is follow-time type. [ 0. . Predefined data A number of stop point data are already defined in the system module BASE. 0. 0. z50\Inpos:=my_followtime.4.followtime := 0. The stop point data my_followtime is defined by means of the following characteristics: . 0. Data Types The stop point stop time is adjusted to 6. 0.The stop point will be synchronised with the RAPID program execution. 0. 0]. TRUE.The stop point follow time is 500 ms.5. z50. The robot will follow the external manipulator for 500 ms before leaving it with the zone 50 mm.stoppointdata MoveL *. In position stop points Name Progsynch Position Speed Mintime MaxtimeWaittime Followtime 20% 50% 100% 20% 50% 100% 0s 0s 0s 20 s 20 s 20 s 0s 0s 0s 0s 0s 0s inpos20 TRUE inpos50 TRUE inpos100 TRUE (inpos100 = finep) Wait time stop points Name stoptime0_5 stoptime1_0 stoptime1_5 Progsynch Position Speed Mintime MaxtimeWaittime Followtime FALSE FALSE FALSE 0% 0% 0% 0% 0% 0% 0s 0s 0s 0s 0s 0s 0. The stop point follow time is adjusted to 0. v1000.

0 s 1.zonedata System Data Types and Routines 1-stoppointdata-87 .5 s 1.System Parameters Rapid Reference manual .Motion Motion and I/O Principles .Data Types Follow time stop points Name stoppointdata Progsynch Position Speed Mintime MaxtimeWaittime Followtime 0% 0% 0% 0% 0% 0% 0s 0s 0s 0s 0s 0s 0s 0s 0s 0.5 s followtime0_5 TRUE followtime1_0 TRUE followtime1_5 TRUE Structure < data object of stoppointdata > < type of num > < progsynch of bool > < inpos of inposdata > < position of num > < speed of num > < mintime of num > < maxtime of num > < stoptime of num > < followtime of num > < x1 of num > < x2 of num > < x3 of num > Related information Described in: Positioning instructions Movements/Paths in general Configuration of external axes Fly-by points RAPID Summary .Positioning during Program Execution User’s Guide .

stoppointdata Data Types 1-stoppointdata-88 System Data Types and Routines .

Limitations A string may have from 0 to 80 characters.Data Types string string Strings String is used for character strings. e. . “This is a character string”. they must be written twice.g. e. A string may contain any of the characters specified by ISO 8859-1 as well as control characters (non-ISO 8859-1 characters with a numeric code between 0-255). System Data Types and Routines 1-string-89 . Description A character string consists of a number of characters (a maximum of 80) enclosed by quotation marks (“”).g.g. TPWrite text. If the back slash are to be included in the string. If the quotation marks are to be included in the string. “This string contains a ““character”. Example VAR string text. inclusive of extra quotation marks or back slash. it must be written twice. text := “start welding pipe 1”. “This string contains a \\ character”. The text start welding pipe 1 is written on the teach pendant. e.

CONST string disktemp := “TEMP:”. CONST string flp1 := “flp1:”. i. 1-string-90 System Data Types and Routines . Structure String is an atomic data type. The following constants are already defined in the system module BASE: CONST string diskhome := “HOME:”. Name STR_DIGIT STR_UPPER Character set <digit> ::= 0|1|2|3|4|5|6|7|8|9 <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) | ß | ÿ <blank character> ::= STR_LOWER STR_WHITE 1) Icelandic letter eth. CONST string stEmpty := “”. 2) Letter Y with acute accent. 3) Icelandic letter thorn.string Data Types Predefined data A number of predefined string constants are available in the system and can be used together with string functions.e. does not consist of other data types. ! For old programs from S4C system CONST string ram1disk := “HOME:”.

Expressions Basic Characteristics .Basic Elements System Data Types and Routines 1-string-91 .Data Types string Related information Described in: Operations using strings String values Basic Characteristics .

string Data Types 1-string-92 System Data Types and Routines .

. Value 0 1 2 3 4 Symbolic constant RUN_UNDEF RUN_CONT_CYCLE RUN_INSTR_FWD RUN_INSTR_BWD RUN_SIM Comment Undefined running mode Continuous or cycle running mode Instruction forward running mode Instruction backward running mode Simulated running mode Value 0 1 2 OP_UNDEF OP_AUTO Symbolic constant Comment Undefined operating mode Automatic operating mode Manual operating mode max. ENDIF Predefined data The following symbolic constants of the data type symnum are predefined and can be used when checking return values from the functions OpMode and RunMode. Description A symnum constant is intended to be used when checking the return value from the functions OpMode and RunMode.Data Types symnum symnum Symbolic number Symnum is used to represent an integer with a symbolic constant. See example below. ELSE . . 250 mm/s Manual operating mode full speed. Example IF RunMode() = RUN_CONT_CYCLE THEN . 100% OP_MAN_PROG 3 OP_MAN_TEST System Data Types and Routines 1-symnum-93 .

Related information Described in: Data types in general.symnum Data Types Characteristics Symnum is an alias data type for num and consequently inherits its characteristics.Data Types 1-symnum-94 System Data Types and Routines . alias data types Basic Characteristics .

Name C_MOTSET Description Current motion settings.PDispOff Instructions .VelSet .EOffsOff The robot See also Data Types .progdisp Instructions .g.PDispSet Instructions .movement about singular points . The following table contains a list of all system data.PDispOn Instructions . ConfJ Instructions .EOffsOff Data Types .ConfL.MotionSup Instructions .PathResol Instructions . e. acceleration .motsetdata Instructions .EOffsSet .AccSet .errnum RAPID Summary Error Recovery Data Types .ConfL.VelSet Instructions .SingArea Instructions . i.monitoring the axis configuration .max.: .Data Types System Data System Data System data is the internal data of the robot that can be accessed and read by the program.PDispOn .MotionSup Data Types .SingArea .ConfJ .intnum RAPID Summary -Interrupts C_PROGDISP progdisp ERRNO The latest error that occurred errnum INTNO The latest interrupt that occurred intnum The robot System Data Types and Routines 1-System Data-95 .e.path resolution .max. It can be used to read the current status. velocity and velocity override .PDispSet . Data Type motsetdata Changed by Instructions .motion supervision with tunevalue Current program displacement for robot and external axes. the current maximum velocity.EOffsOn Instructions .EOffsOn .PDispOff .AccSet Instructions .EOffsSet Instructions .PathResol .

System Data Data Types 1-System Data-96 System Data Types and Routines .

TSK1Id etc. The names of the program tasks are defined in the system parameters and. TSK1 . predefined variables of the data type taskid will be available.g.System Parameters Basic Characteristics .Data Types System Data Types and Routines 1-taskid-97 . Characteristics Taskid is a non-value data type. Description Data of the type taskid only contains a reference to the program task. for MAIN task the variable identity will be MAINId. This means that data of this type does not permit valueoriented operations. be used as a parameter when declaring a routine. Related information Described in: Saving program modules Configuration of program tasks Characteristics of non-value data types Instruction .Save User’s Guide . The variable identity will be "taskname"+"Id". For all program tasks in the system. on the other hand. must not be defined in the program. consequently. Limitations Data of the type taskid must not be defined in the program. The data type can. e. Predefined data The program tasks defined in the system parameters can always be accessed from the program (installed data).Data Types taskid taskid Task identification Taskid is used to identify available program tasks in the system.

taskid Data Types 1-taskid-98 System Data Types and Routines .

The testsignal data type is available in order to simplify programming of instruction TestSignDefine. := 102. All data is in SI units and measured on the motor side of the axis. CONST testsignal speed CONST testsignal torque_ref CONST testsignal resolver_angle CONST testsignal speed_ref CONST testsignal dig_input1 CONST testsignal dig_input2 := 6. := 103.TestSignDefine Functions . 2. := 1. Examples TestSignDefine 2. Predefined data The following test signals for external manipulator axes are predefined in the system. := 20. Description A number of predefined test signals are available in the robot system. 0. speed is a constant of the testsignal data type.TestSignReset System Data Types and Routines 1-testsignal-99 .Data Types testsignal testsignal Test signal The data type testsignal is used when a test of the robot motion system is performed. speed. := 9. ! rad/s ! Nm ! rad ! rad/s ! 0 or 1 ! 0 or 1 Characteristics Testsignal is an alias data type for num and consequently inherits its characteristics.TestSignRead Instructions . Related information Described in: Define test signal Read test signal Reset test signals Instructions . Orbit.

testsignal Data Types 1-testsignal-100 System Data Types and Routines .

e.Programmed positions refer to the position of the current TCP and the orientation in relation to the tool coordinate system. . This means that if. the programmed speed and path will relate to the work object. .If the value in the specified load is less than the value of the true load.Define the tool coordinate system in order to facilitate moving in or rotating about the tool directions.If the value in the specified load is greater than that of the value of the true load. the payload of the robot too. for example. a welding gun or a gripper. Incorrect definitions of load data can result in overloading of the robot mechanical structure. the old program can still be used if the tool coordinate system is redefined.The tool centre point (TCP) refers to a point that will satisfy the specified path and velocity performance.If a stationary tool is used. . When incorrect tool load data is specified.g. If the tool is reorientated or if coordinated external axes are used. -> The robot will not be used to its maximum capacity -> Impaired path accuracy including a risk of overshooting . common tool data is defined for this tool and the gripper holding the work object. it can often lead to the following consequences: . If the tool is fixed in space (a stationary tool).Define the TCP that is not to move when the tool is reorientated. Tool data is also used when jogging the robot to: .Data Types tooldata tooldata Tool data Tooldata is used to describe the characteristics of a tool. a tool is replaced because it is damaged. -> Impaired path accuracy including a risk of overshooting -> Risk of overloading the mechanical structure System Data Types and Routines 1-tooldata-101 . Description Tool data affects robot movements in the following ways: . only this point will follow the desired path at the programmed velocity. It is important to always define the actual tool load and when used.

tooldata Data Types Components robhold (robot hold) Data type: bool Defines whether or not the robot is holding the tool: .e. the definition is defined in relation to the world coordinate system.: .FALSE tframe -> The robot is holding the tool. (tool frame) Data type: pose The tool coordinate system. the tool coordinate system and the wrist coordinate system will coincide. . a stationary tool. The control hole The wrist coordinate system Y Z The tool coordinate system TCP X Y’ X’ Z’ Figure 14 Definition of the tool coordinate system. If a stationary tool is used. expressed in the wrist coordinate system as a quaternion (q1.TRUE . 1-tooldata-102 System Data Types and Routines . expressed in the wrist coordinate system (See figure 1).e. y and z) in mm. i. q2. i.The position of the TCP (x. If the direction of the tool is not specified. -> The robot is not holding the tool.The orientation of the tool coordinate system. q3 and q4) (See figure 1).

e.The centre of gravity of the tool (x. 0. expressed in the wrist coordinate system . The wrist coordinate system IY Y Tool load coordinate system Inertial axes of tool load Z IZ TCP Y’ X’ Z’ Figure 15 Tool load parameter definitions X IX Tool coordinate systeem For more information (such as coordinate system for stationary tool or restrictions). System Data Types and Routines 1-tooldata-103 . If all inertial components are defined as being 0 kgm2. Note that only the load of the tool is to be specified. If a stationary tool is used.Data Types tload (tool load) The load of the tool.The moments of inertia of the tool relative to its centre of mass around the tool load coordinate axes in kgm2. i. 0. the tool is handled as a point mass. .The orientation of the tool load coordinate system expressed in the wrist coordinate system. the load of the gripper holding the work object must be defined. This must always be set to 1.: . y and z) in mm. tooldata Data type: loaddata . defining the inertial axes of the tool. The orientation of the tool load coordinate system must coincide with the orientation of the wrist coordinate system. The payload handled by a gripper is connected and disconnected by means of the instruction GripLoad.The weight of the tool in kg. see the data type loaddata. 0.

0] ]. 0].001. 0.trans. 0]]. is adjusted to 225.1].1 mm straight out from axis 6 and 97. [23. [1. [1.z := 225. 0. [1. 223. 0.0]]. PERS tooldata tool0 := [ TRUE. Limitations The tool data should be defined as a persistent variable (PERS) and should not be defined within a routine. [0. [0. 0. 0 .2. 75]. 0]. 0. 0.2 in the z-direction.001]. i. The tool in Figure 14 is described using the following values: .The robot is holding the tool. but can never be changed (it is stored in system module BASE). [0. 0. 0. gripper. The TCP of the tool. 0. . 1-tooldata-104 System Data Types and Routines . 0. . 0. The current values are then saved when the program is stored on diskette and are retrieved on loading. [[97. .The X and Z directions of the tool are rotated 45o in relation to the wrist coordinate system.e. 0.924. gripper. 0. 0. . 0. with the origin being the centre of the mounting flange. [ [0. Predefined data The tool tool0 defines the wrist coordinate system. without any moment of inertia. Tool0 can always be accessed from the program.tframe. 0. .The TCP is located at a point 223. 0]. Arguments of the type tool data in any motion instruction should only be an entire persistent (not array element or record component).tooldata Data Types Examples PERS tooldata gripper := [ TRUE.4.The load can be considered a point mass. 0] ]. [5.4 mm along the X-axis of the wrist coordinate system.383 .The centre of gravity is located at a point 75 mm straight out from axis 6 and 23 mm along the X-axis of the wrist coordinate system.The tool weighs 5 kg.

Motion Motion and I/O Principles .Gripload Data types .Coordinate Systems Instructions .Load data System Data Types and Routines 1-tooldata-105 .Data Types tooldata Structure < dataobject of tooldata > < robhold of bool > < tframe of pose > < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < tload of loaddata > < mass of num > < cog of pos > < x of num > < y of num > < z of num > < aom of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < ix of num > < iy of num > < iz of num > Related information Described in: Positioning instructions Coordinate systems Definition of payload Definition of load RAPID Summary .

tooldata Data Types 1-tooldata-106 System Data Types and Routines .

Data Types tpnum tpnum Teach Pendant Window number tpnum is used to represent the Teach Pendant Window number with a symbolic constant. Example TPShow TP_PROGRAM. The Production Window will be active if the system is in AUTO mode and the Program Window will be active if the system is in MAN mode. after execution of this instruction. if this option is active 2 3 TP_LATEST TP_SCREENVIEWER Characteristics tpnum is an alias data type for num and consequently inherits its characteristics. Description A tpnum constant is intended to be used in instruction TPShow. See example below. System Data Types and Routines 1-tpnum-107 . Predefined data The following symbolic constants of the data type tpnum are predefined and can be used in instruction TPShow: Value 1 Symbolic constant TP_PROGRAM Comment AUTO: Production Window MAN: Program Window Latest used Teach Pendant Window Screen Viewer window.

alias data types Communicating using the teach pendant Switch window on the teach pendant Basic Characteristics .tpnum Data Types Related information Described in: Data types in general.TPShow 1-tpnum-108 System Data Types and Routines .Data Types RAPID Summary .Communication Instructions .

Example VAR triggdata gunoff. variables of the type triggdata are used. gunoff. 5 \DOp:=gun. Description To define the conditions for the respective measures at a positioning event. TriggIO gunoff. fine. gun1. off.trigg Triggdata is used to store data about a positioning event during a robot movement. TriggL p1. TriggInt Instructions . The digital output signal gun is set to the value off when the TCP is at a position 5 mm before the point p1. TriggJ Basic Characteristics.TriggL. Characteristics Triggdata is a non-value data type. TriggC or TriggJ.Data Types System Data Types and Routines 1-triggdata-109 . Related information Described in: Definition of triggs Use of triggs Characteristics of non-value data types Instructions . A positioning event can take the form of setting an output signal or running an interrupt routine at a specific position along the movement path of the robot. The data contents of the variable are formed in the program using one of the instructions TriggIO or TriggInt.Data Types triggdata triggdata Positioning events . TriggC. v500.TriggIO. and are used by one of the instructions TriggL.

triggdata Data Types 1-triggdata-110 System Data Types and Routines .

Predefined data The following symbolic constants of the data type tunetype are predefined and can be used as argument for the instruction TuneServo. 110 \Type:= TUNE_KP. See example below. System Data Types and Routines 1-tunetype-111 . Example TuneServo MHA160R1. Value 0 1 2 3 4 5 6 7 8 9 10 TUNE_DF TUNE_KP TUNE_KV TUNE_TI Symbolic constant Comment Reduces overshoots Affects position control gain Affects speed control gain Affects speed control integration time Affects friction compensation level Affects friction compensation ramp Reduces overshoots Reduces vibrations with heavy loads Reduces path errors Only for ABB internal use Only for ABB internal use TUNE_FRIC_LEV TUNE_FRIC_RAMP TUNE_DG TUNE_DH TUNE_DI TUNE_DK TUNE_DL Characteristics Tunetype is an alias data type for num and consequently inherits its characteristics. 1.Data Types tunetype tunetype Servo tune type Tunetype is used to represent an integer with a symbolic constant. Description A tunetype constant is intended to be used as an argument to the instruction TuneServo.

tunetype Data Types Related information Described in: Data types in general.Data Types Instructions .TuneServo 1-tunetype-112 System Data Types and Routines . alias data types Use of data type tunetype Basic Characteristics .

For this. . System Data Types and Routines 1-wobjdata-113 . only the user coordinate system has to be redefined.FALSE ufprog -> The robot is holding the work object. however. for example.If position data is entered manually.FALSE -> Fixed user coordinate system. i. -> Movable user coordinate system. The advantages of this are as follows: .Programs can be reused quickly following changes in the robot installation. processes. -> The robot is not holding the work object. etc. some sort of sensor will be required to position the work object. the position will be based on the coordinates of the work object. Description If work objects are defined in a positioning instruction. using a stationary tool.The current position displayed is based on the coordinate system of the work object. since the path and velocity would then be related to the work object instead of the TCP. . (user frame programmed) Data type: bool Defines whether or not a fixed user coordinate system is used: . i.e. the values can often be taken from a drawing.Data Types wobjdata wobjdata Work object data Wobjdata is used to describe the work object that the robot welds. the fixture is moved.TRUE . Components robhold (robot hold) Data type: bool Defines whether or not the robot is holding the work object: . the robot is holding the tool.e. i.The robot can be jogged in the directions of the work object.e. moves within. such as in off-line programming. If. coordinated external axes are used. Work object data can also be used for jogging: . If a stationary tool or coordinated external axes are used the work object must be defined. .Variations in how the work object is attached can be compensated for.TRUE .

y and z) in mm.e. the position of the current work object (see Figure 16): . Only specified in the case of movable user coordinate systems (ufprog is FALSE). X Z Tool coordinates Y TCP Z Y User coordinates Z X Z Object coordinates Y Y X Z Base coordinates Y X World coordinates X Figure 16 The various coordinate systems of the robot (when the robot is holding the tool). q4).The position of the origin of the coordinate system (x. expressed as a quaternion (q1. Specified with the name that is defined in the system parameters. The object coordinate system is defined in the user coordinate system.The position of the origin of the coordinate system (x.g. i. the user coordinate system is defined in the system parameters. uframe (user frame) Data type: pose The user coordinate system. q3. .The rotation of the coordinate system. When coordinated external axes are used (ufprog is FALSE). If the robot is holding the tool. "orbit_a". e. q2. . expressed as a quaternion (q1. the user coordinate system is defined in the world coordinate system (in the wrist coordinate system if a stationary tool is used).The rotation of the coordinate system.e. 1-wobjdata-114 System Data Types and Routines . the position of the current work surface or fixture (see Figure 16): . q4). q2. i. y and z) in mm. q3.wobjdata ufmec (user frame mechanical unit) Data Types Data type: string The mechanical unit with which the robot movements are coordinated. oframe (object frame) Data type: pose The object coordinate system.

[ [0. y= 200 and z= 30 mm in the user coordinate system. y = 600 and z = 200 mm in the world coordinate system. 0. The current values are then saved when the program is stored on diskette and are retrieved on loading. 0.0] ] ].The object coordinate system is not rotated and the coordinates of its origin are x= 0. Limitations The work object data should be defined as a persistent variable (PERS) and should not be defined within a routine. 200].0] ].The robot is not holding the work object.oframe.trans. . [ [0. 0 . The robot does not hold the work object. 0].Data Types wobjdata Example PERS wobjdata wobj2 :=[ FALSE. 0. TRUE. . PERS wobjdata wobj0 := [ FALSE. 0 . [1. . .The position of the work object wobj2 is adjusted to 38. 0 .The user coordinate system is not rotated and the coordinates of its origin are x= 300.3 mm in the z-direction. wobj2. 30]. 200. 0. The work object in Figure 16 is described using the following values: . [1. "". 0].0] ] ]. but can never be changed (it is stored in system module BASE).The fixed user coordinate system is used. "".3.z := 38. Arguments of the type work object data in any motion instruction should only be an entire persistent (not array element or record component). [ [0. System Data Types and Routines 1-wobjdata-115 . [1. 0. [ [300. 600. Predefined data The work object data wobj0 is defined in such a way that the object coordinate system coincides with the world coordinate system. 0 .0] ]. [1. TRUE. 0. Wobj0 can always be accessed from the program.

Coordinate Systems User’s Guide .System Parameters 1-wobjdata-116 System Data Types and Routines .Coordinate Systems Motion and I/O Principles .Motion Motion and I/O Principles .wobjdata Data Types Structure < dataobject of wobjdata > < robhold of bool > < ufprog of bool> < ufmec of string > < uframe of pose > < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > < oframe of pose > < trans of pos > < x of num > < y of num > < z of num > < rot of orient > < q1 of num > < q2 of num > < q3 of num > < q4 of num > Related information Described in: Positioning instructions Coordinate systems Coordinated external axes Calibration of coordinated external axes RAPID Summary .

. A world zone is supervised during robot movements both during program execution and jogging. Stationary world zones should be active from power on and should be defined in a POWER ON event routine or a semistatic task. conveyor. System Data Types and Routines 1-wzstationary-117 .. p_corner1. If the robot’s TCP reaches this world zone. WZLimSup or WZDOSet gives the variable or the persistent of data type stationary a numeric value. VAR shapedata volume. but not local within a routine. Limitations A wzstationary data can be defined as a variable (VAR) or as a persistent (PERS). PROC . A stationary world zone is always active and is only erased by a warm start (switch power off then on. p_corner2... WZLimSup \Stat. activate or erase a stationary world zone via RAPID instructions. volume. ENDPROC A conveyor is defined as a straight box (the volume below the belt). Example VAR wzstationary conveyor. WZBoxDef \Inside. . It can be global in task or local within module. the movement is stopped or a digital output signal is set or reset. volume.. If the robot reaches this volume..Data Types wzstationary wzstationary Stationary world zone data wzstationary (world zone stationary) is used to identify a stationary world zone and can only be used in an event routine connected to the event POWER ON. The value identifies the world zone. . the movement is stopped. It is not possible to deactivate. or change system parameters). Description A wzstationary world zone is defined and activated by a WZLimSup or a WZDOSet instruction. Arguments of the type wzstationary should only be entire data (not array element or record component).

Characteristics wzstationary is an alias data type of wztemporary and inherits its characteristics.WZDOSet 1-wzstationary-118 System Data Types and Routines . e. PERS wzstationary share_workarea := [0].g. set the init value to 0 in both tasks.wztemporary Instructions . When there is a need to use a persistent variable in a multi-tasking system.wzstationary Data Types An init value for data of the type wzstationary is not used by the control system.WZLimSup Instructions . Related information Described in: World Zones World zone shape Temporary world zone Activate world zone limit supervision Activate world zone digital output set Motion and I/O Principles World Zones Data Types . Example For a complete example see instruction WZLimSup.shapedata Data Types .

1000.. the movement is stopped.. Description A wztemporary world zone is defined and activated by a WZLimSup or a WZDOSet instruction. roll.. It can be global in a task or local within a module. 400. WZLimSup or WZDOSet gives the variable or the persistent of data type wztemporary a numeric value.when a new program is loaded in the MAIN task . WZLimSup \Temp. Limitations A wztemporary data can be defined as a variable (VAR) or as a persistent (PERS).when starting program execution from the beginning in the MAIN task Example VAR wztemporary roll. t_center. If the robot reaches this volume. CONST pos t_center := [1000. The value identifies the world zone.. 1000].. System Data Types and Routines 1-wztemporary-119 . is defined as a cylinder. If the robot’s TCP reaches this world zone. Once defined and activated. . WZCylDef \Inside. All temporary world zones in the MAIN task are automatically erased and all data objects of type wztemporary in the MAIN task are set to 0: .. and erased by WZFree. roll. . a temporary world zone can be deactivated by WZDisable. volume. but not local within a routine. activated again by WZEnable. the movement is stopped or a digital output signal is set or reset. PROC . VAR shapedata volume. volume. ENDPROC A wztemporary variable. A world zone is supervised during robot movements both during program execution and jogging.Data Types wztemporary wztemporary Temporary world zone data wztemporary (world zone temporary) is used to identify a temporary world zone and can be used anywhere in the RAPID program for the MAIN task. 1000.

Definitions of temporary world zones in the background would affect the program execution in the MAIN task The instructions WZDisable and WZEnable can be used in the background task. Structure <dataobject of wztemporary> <wz of num> Related information Described in: World Zones World zone shape Stationary world zone Activate world zone limit supervision Activate world zone digital output set Deactivate world zone Activate world zone Erase world zone Motion and I/O Principles World Zones Data Types .WZLimSup Instructions .WZDOSet Instructions .WZEnable Instructions .wztemporary Data Types Arguments of the type wztemporary must only be entire data.WZDisable Instructions . Example For a complete example see instruction WZDOSet. A temporary world zone must only be defined (WZLimSup or WZDOSet) and free (WZFree) in the MAIN task. set the init value to 0 in both tasks.WZFree 1-wztemporary-120 System Data Types and Routines .g. e.wzstationary Instructions . not an array element or record component. PERS wztemporary share_workarea := [0].shapedata Data Types . When there is a need to use a persistent variable in a multi-tasking system.

i. The zone size cannot be larger than half the distance to the closest position (forwards or backwards). The zone for the TCP path Programmed position Start of reorientation towards next position Start of TCP corner path The extended zone Figure 17 The zones for a fly-by point. but the zone size may differ somewhat from the one programmed. It is also possible to define stop points other than the predefined fine. The stop criteria. If a larger zone is specified. Description A position can be terminated either in the form of a stop point or a fly-by point. A fly-by point means that the programmed position is never attained. . Zones function in the same way during joint movement. the robot automatically reduces it. Two different zones (ranges) can be defined for each position: . that tells if the robot is considered to have reached the point. Instead. System Data Types and Routines 1-zonedata-121 .Data Types zonedata zonedata Zone data Zonedata is used to specify how a position is to be terminated. A stop point means that the robot and external axes must reach the specified position (stand still) before program execution continues with the next instruction. can be manipulated using the stoppointdata. the direction of motion is changed before the position is reached.The extended zone for reorientation of the tool and for external axes. how close to the programmed position the axes must be before moving towards the next position.The zone for the TCP path.e.

and there is less of a risk of having to reduce the velocity to carry out the reorientation. The tool is reoriented in such a way that the orientation is the same leaving the zone as it would have been in the same position if stop points had been programmed. Figure 18b If all positions were stop points. the extended zone and even the TCP zone can be reduced by the robot. In this way. program execution would look like this. Reduced zone With large reorientations of the tool or with large movements of the external axes. The zone will be defined as the smallest relative size of the zone based upon the zone components (see next page) and the programmed motion. 1-zonedata-122 System Data Types and Routines . the last with different tool orientation. The zone for reorientation of the tool Reorientation starts as soon as the TCP reaches the extended zone. program execution would look like this The zone for external axes External axes start to move towards the next position as soon as the TCP reaches the extended zone. Figure 18a Three positions are programmed. a slow axis can start accelerating at an earlier stage and thus execute more evenly. Zone size Figure 18c If the middle position was a fly-by point.zonedata The zone for the TCP path Data Types A corner path (parabola) is generated as soon as the edge of the zone is reached (see Figure 17). Reorientation will be smoother if the zone size is increased.

P2 zone_ori ________________________ = 9o/60o = 15% angle of reorientation P1 .P2 zone_reax ________________________ angle of max reorientation of rotating ext. axis P1 .P2 60 mm pzone_tcp P2 9o zone_ori Figure 19 Example of reduced zone for reorientation of the tool to 36% of the motion due to zone_ori. 60 zone_ori the tool and with zone z60 P1 The relative sizes of the zone are pzone_tcp ________________________ = 60/200 = 30% length of movement P1 . System Data Types and Routines 1-zonedata-123 . For instance.P2 zone_ori ________________________ = 9o/25o = 36% angle of reorientation P1 .P2 NOTE: If the TCP zone is reduced because of zone_ori. P2 When external axes are active they affect the relative sizes of the zone according to these formulas: pzone_eax ________________________ length of movement P1 .Data Types zonedata 90 mm MoveL with 200 mm movements pzone_ori o of the tool.P2 zone_leax ________________________ length of max linear ext. 25 reorientation of P1 the tool and with zone z60 The relative sizes of the zone are pzone_tcp ________________________ = 60/200 = 30% length of movement P1 . If there is a TCP movement when in this mode the speed is not compensated for the curvature of the path in a corner zone. If this is a problem. 90 mm MoveL with 200 mm movements 60 mm o reorientation of pzone_ori pzone_tcp 9o of the tool. increase the limiting zone component. axis movement P1 .P2 pzone_ori ________________________ = 90/200 = 45% length of movement P1 . this will cause a 30% speed reduction in a 90 degree corner.P2 Figure 20 Example of reduced zone for reorientation of the tool and TCP path to 15% of the motion due to zone_ori. zone_leax or zone_reax the path planner enters a mode that can handle the case of no TCP movement.

The remaining components in the zone data are not used. zone_leax ( zone linear external axes) Data type: num The zone size for linear external axes in mm. If a lower value is specified. The size is defined as the distance of the TCP from the programmed point in mm. pzone_eax (path zone external axes) Data type: num The zone size (the radius) for external axes. If the robot is holding the work object. The size must be larger than the corresponding value for pzone_tcp. (path zone TCP) Data type: num pzone_tcp The size (the radius) of the TCP zone in mm. pzone_ori (path zone orientation) Data type: num The zone size (the radius) for the tool reorientation. the size is automatically increased to make it the same as pzone_tcp. The size must be larger than the corresponding value for pzone_tcp. this means an angle of rotation for the work object. 1-zonedata-124 System Data Types and Routines . zone_ori ( zone orientation) Data type: num The zone size for the tool reorientation in degrees.zonedata Data Types Components finep (fine point) Data type: bool Defines whether the movement is to terminate as a stop point (fine point) or as a fly-by point. the size is automatically increased to make it the same as pzone_tcp. zone_reax ( zone rotational external axes) Data type: num The zone size for rotating external axes in degrees. FALSE -> The movement terminates as a fly-by point. TRUE -> The movement terminates as a stop point. If a lower value is specified. The size is defined as the distance of the TCP from the programmed point in mm. The extended zone will be defined as the smallest relative size of the zone based upon the following components and the programmed motion.

The zone size for the TCP path is adjusted to 40 mm. . System Data Types and Routines 1-zonedata-125 . or there is a large external axis movement. . 35. with respect to the zone. 5 ].The zone size for linear external axes is 35 mm.The zone size for the tool reorientation is 40 mm (TCP movement). The zone data path is defined by means of the following characteristics: . 10. . or there is a large reorientation. 25.pzone_tcp := 40.The zone size for external axes is 40 mm (TCP movement). If the TCP is standing still.The zone size for the TCP path is 25 mm.Data Types zonedata Examples VAR zonedata path := [ FALSE. 40.The zone size for the tool reorientation is 10 degrees. the following apply instead: . . 40.The zone size for rotating external axes is 5 degrees. path.

3 mm 1 mm 8 mm 15 mm 23 mm 30 mm 45 mm 60 mm 75 mm 90 mm 120 mm 150 mm 225 mm 300 mm 0.0 o 12 o 15 o 23 o 30 o TCP path Orientation Ext.5 o 9.5 o 2.5 o 2. axis Orientation Linear axis Rotating axis Structure < data object of zonedata > < finep of bool > < pzone_tcp of num > < pzone_ori of num > < pzone_eax of num > < zone_ori of num > < zone_leax of num > < zone_reax of num > 1-zonedata-126 System Data Types and Routines . Stop points Name fine 0 mm Fly-by points TCP movement Name z0 z1 z5 z10 z15 z20 z30 z40 z50 z60 z80 z100 z150 z200 0.5 o 6.1 o 0.3 o 3.0 o 7.1 o 0.3 mm 1 mm 5 mm 10 mm 15 mm 20 mm 30 mm 40 mm 50 mm 60 mm 80 mm 100 mm 150 mm 200 mm 0.0 o 12 o 15 o 23 o 30 o Tool reorientation 0.zonedata Data Types Predefined data A number of zone data are already defined in the system module BASE.0 o 4.5 o 6.3 o 3.5 o 9.03 o 0.8 o 1.0 o 7.8 o 1.3 mm 1 mm 8 mm 15 mm 23 mm 30 mm 45 mm 60 mm 75 mm 90 mm 120 mm 150 mm 225 mm 300 mm 0.03 o 0.0 o 4.3 mm 1 mm 8 mm 15 mm 23 mm 30 mm 45 mm 60 mm 75 mm 90 mm 120 mm 150 mm 225 mm 300 mm 0.

Data Types zonedata Related information Described in: Positioning instructions Movements/Paths in general Configuration of external axes Other Stop points RAPID Summary .Positioning during Program Execution User’s Guide .System Parameters Data Types stoppointdata System Data Types and Routines 1-zonedata-127 .Motion Motion and I/O Principles .

zonedata Data Types 1-zonedata-128 System Data Types and Routines .

. Increments by 1 System Data Types and Routines 2-129 ... then.. then .Instructions CONTENTS “:=” AccSet ActUnit Add AliasIO Break ProcCall CallByVar Clear ClearIOBuff ClkReset ClkStart ClkStop Close comment ConfJ ConfL CONNECT DeactUnit Decr EOffsOff EOffsOn EOffsSet ErrWrite EXIT ExitCycle FOR GetSysData GOTO GripLoad IDelete IDisable IEnable Compact IF IF Incr Assigns a value Reduces the acceleration Activates a mechanical unit Adds a numeric value Define I/O signal with alias name Break program execution Calls a new procedure Call a procedure by a variable Clears the value Clear input buffer of a serial channel Resets a clock used for timing Starts a clock used for timing Stops a clock used for timing Closes a file or serial channel Comment Controls the configuration during joint movement Monitors the configuration during linear movement Connects an interrupt to a trap routine Deactivates a mechanical unit Decrements by 1 Deactivates an offset for external axes Activates an offset for external axes Activates an offset for external axes using a value Write an Error Message Terminates program execution Break current cycle and start next Repeats a given number of times Get system data Goes to a new instruction Defines the payload of the robot Cancels an interrupt Disables interrupts Enables interrupts If a condition is met. (one instruction) If a condition is met.... otherwise .

Instructions InvertDO IODisable IOEnable ISignalAI ISignalAO ISignalDI ISignalDO ISleep ITimer IVarValue IWatch label Load MechUnitLoad MoveAbsJ MoveC MoveCDO MoveCSync MoveJ MoveJDO MoveJSync MoveL MoveLDO MoveL Sync Open PathResol PDispOff PDispOn PDispSet PulseDO RAISE ReadAnyBin Reset RestoPath RETRY RETURN Inverts the value of a digital output signal Disable I/O unit Enable I/O unit Interrupts from analog input signal Interrupts from analog output signal Orders interrupts from a digital input signal Interrupts from a digital output signal Deactivates an interrupt Orders a timed interrupt Orders a variable value interrupt Activates an interrupt Line name Load a program module during execution Defines a payload for a mechanical unit Moves the robot to an absolute joint position Moves the robot circularly Moves the robot circularly and sets digital output in the corner Moves the robot circularly and executes a RAPID procedure Moves the robot by joint movement Moves the robot by joint movement and sets digital output in the corner Moves the robot by joint movement and executes a RAPID procedure Moves the robot linearly Moves the robot linearly and sets digital output in the corner Moves the robot linearly and executes a RAPID procedure Opens a file or serial channel Override path resolution Deactivates program displacement Activates program displacement Activates program displacement using a value Generates a pulse on a digital output signal Calls an error handler Read data from a binary serial channel or file Resets a digital output signal Restores the path after an interrupt Restarts following an error Finishes execution of a routine 2-130 System Data Types and Routines .

.Instructions Rewind Save SearchC SearchL Set SetAO SetDO SetGO SingArea SoftAct SoftDeact SpyStart SpyStop StartLoad StartMove Stop StopMove StorePath TEST TestSignDefine TestSignReset TPErase TPReadFK TPReadNum TPShow TPWrite TriggC TriggEquip TriggInt TriggIO TriggL TriggJ TRYNEXT TuneReset TuneServo UnLoad Rewind file position Save a program module Searches circularly using the robot Searches linearly using the robot Sets a digital output signal Changes the value of an analog output signal Changes the value of a digital output signal Changes the value of a group of digital output signals Defines interpolation around singular points Activating the soft servo Deactivating the soft servo Start recording of execution time data Stop recording of time execution data Load a program module during execution Restarts robot motion Stops program execution Stops robot motion Stores the path when an interrupt occurs Depending on the value of an expression . Define test signal Reset all test signal definitions Erases text printed on the teach pendant Reads function keys Reads a number from the teach pendant Switch window on the teach pendant Writes on the teach pendant Circular robot movement with events Defines a fixed position-time I/O event Defines a position related interrupt Defines a fixed position I/O event Linear robot movements with events Axis-wise robot movements with events Jumps over an instruction which has caused an error Resetting servo tuning Tuning servos UnLoad a program module during execution System Data Types and Routines 2-131 ..

. Writes to a character-based file or serial channel Writes data to a binary serial channel or file Writes to a binary serial channel Writes attribute of a system parameter Writes a string to a binary serial channel Define a box-shaped world zone Define a cylinder-shaped world zone Deactivate temporary world zone supervision Activate world zone to set digital output Activate temporary world zone supervision Erase temporary world zone supervision Activate world zone limit supervision Define a sphere-shaped world zone 2-132 System Data Types and Routines ..Instructions WaitDI WaitDO WaitLoad WaitTime WaitUntil VelSet WHILE Write WriteAnyBin WriteBin WriteCfgData WriteStrBin WZBoxDef WZCylDef WZDisable WZDOSet WZEnable WZFree WZLimSup WZSphDef Waits until a digital input signal is set Waits until a digital output signal is set Connect the loaded module to the task Waits a given amount of time Waits until a condition is met Changes the programmed velocity Repeats as long as .

reg3.trans. The TCP for tool1 is shifted 20 mm in the X-direction. pallet{5.x + 20.trans. Arguments Data := Value Data The data that is to be assigned a new value. System Data Types and Routines 2-“:=”-133 . counter is incremented by one. reg1+5*reg3.tframe. Data type: Same as Data Data type: All Examples tool1. An element in the pallet matrix is assigned a value equal to the absolute value of the value variable. e. reg1 is assigned the value that the reg2-reg3 calculation returns.g. counter := counter + 1. reg1 is assigned the value 5. This value can be anything from a constant value to an arithmetic expression.x := tool1. Examples reg1 := 5.tframe. Value The desired value. reg1 := reg2 .Instructions “:=” “:=” Assigns a value The “:=” instruction is used to assign a new value to data.8} := Abs(value).

a constant .Data Types Basic Characteristics .Data Programming and Testing Programming and Testing 2-“:=”-134 System Data Types and Routines .a non-value data type.“:=” Instructions Limitations The data (whose value is to be changed) must not be . Syntax (EBNF) <assignment target> ’:=’ <expression> ’.Expressions Basic Characteristics .’ <assignment target> ::= <variable> | <persistent> | <parameter> | <VAR> Related information Described in: Expressions Non-value data types Assigning an initial value to data Manually assigning a value to data Basic Characteristics . The data and value must have similar (the same or alias) data types.

AccSet 100. The acceleration ramp is limited to 50% of the normal value. The acceleration is limited to 50% of the normal value. 30 Figure 21 Reducing the acceleration results in smoother movements. Maximum value: 100%. which results in smoother robot movements. Time System Data Types and Routines 2-AccSet-135 . Input value < 10% gives 10% of maximum rate.Instructions AccSet AccSet Reduces the acceleration AccSet is used when handling fragile loads. Ramp Data type: num The rate at which acceleration and deceleration increases as a percentage of the normal values (see Figure 21). 100% corresponds to maximum acceleration. Arguments AccSet Acc Acc Ramp Data type: num Acceleration and deceleration as a percentage of the normal values. 100 AccSet 100. Acceleration Time AccSet 100. 50.e. normal acceleration Acceleration Acceleration Time AccSet 30. It allows slower acceleration and deceleration. 100% corresponds to maximum rate. 100. Jerking can be restricted by reducing this value. Input value < 20% gives 20% of maximum acceleration. Maximum value: 100%. Examples AccSet 50. 100. i.

’ [ Ramp ’:=’ ] < expression (IN) of num > ’.at a cold start-up .’ Related information Described in: Positioning instructions RAPID Summary .when starting program executing from the beginning. The default values (100%) are automatically set .when a new program is loaded . Syntax AccSet [ Acc ’:=’ ] < expression (IN) of num > ’.Motion 2-AccSet-136 System Data Types and Routines .AccSet Instructions Program execution The acceleration applies to both the robot and external axes until a new AccSet instruction is executed.

Limitations Instruction ActUnit cannot be used in . the specified mechanical unit is activated. common drive units are used. Example ActUnit orbit_a. for example. activation of one of these mechanical units will also connect that unit to the common drive unit. System Data Types and Routines 2-ActUnit-137 .program sequence StorePath .Instructions ActUnit ActUnit Activates a mechanical unit ActUnit is used to activate a mechanical unit. Program execution When the robot and external axes have come to a standstill. It can be used to determine which unit is to be active when.. If several mechanical units share a common drive unit. Arguments ActUnit MecUnit MecUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit that is to be activated. Activation of the orbit_a mechanical unit. This means that it is controlled and monitored by the robot. should be terminated with a stop point in order to make a restart in this instruction possible following a power failure.. RestoPath .event routine RESTART The movement instruction previous to this instruction.

mecunit Instructions .DeactUnit 2-ActUnit-138 System Data Types and Routines .ActUnit Instructions Syntax ActUnit [MecUnit ’:=’ ] < variable (VAR) of mecunit> ’.’ Related information Described in: Deactivating mechanical units Mechanical units More examples Instructions .DeactUnit Data Types .

i. AddValue The value to be added. 3 is added to reg1. reg1:=reg1+3. Arguments Add Name The name of the variable or persistent to be changed. multiplication Instructions . -reg2.e. The value of reg2 is subtracted from reg1. Data type: num Name AddValue Data type: num Syntax Add [ Name ’:=’ ] < var or pers (INOUT) of num > ’.Incr Instructions . Examples Add reg1. reg1:=reg1-reg2.Decr Instructions .Instructions Add Add Adds a numeric value Add is used to add or subtract a value to or from a numeric variable or persistent. e.e.’ Related information Described in: Incrementing a variable by 1 Decrementing a variable by 1 Changing data using an arbitrary expression.’ [ AddValue ’:=’ ] < expression (IN) of num > ’.:= System Data Types and Routines 2-Add-139 .g. Add reg1. 3. i.

Add

Instructions

2-Add-140

System Data Types and Routines

Instructions

AliasIO

AliasIO

Define I/O signal with alias name

AliasIO is used to define a signal of any type with an alias name or to use signals in built-in task modules. Signals with alias names can be used for predefined generic programs, without any modification of the program before running in different robot installations. The instruction AliasIO must be run before any use of the actual signal. See example 1 below for loaded modules and example 2 below for builtin modules.

Example 1
VAR signaldo alias_do; PROC prog_start() AliasIO config_do, alias_do; ENDPROC The routine prog_start is connected to the START event in system parameters. The program defined digital output signal alias_do is connected to the configured digital output signal config_do at program start (start the program from beginning).

Arguments AliasIO FromSignal ToSignal
FromSignal Loaded modules: The signal identifier named according to the configuration (data type signalxx) from which the signal descriptor is copied. The signal must be defined in the IO configuration. Built-in modules: A reference (CONST, VAR, PERS or parameter of these) containing the name of the signal (data type string) from which the signal descriptor after search in the system is copied. The signal must be defined in the IO configuration. Data type: signalxx or string

System Data Types and Routines

2-AliasIO-141

AliasIO
ToSignal

Instructions
Data type: signalxx

The signal identifier according to the program (data type signalxx) to which the signal descriptor is copied. The signal must be declared in the RAPID program. The same data type must be used (or find) for the arguments FromSignal and ToSignal and must be one of type signalxx (signalai, signalao, signaldi, signaldo, signalgi or signalgo).

Program execution
The signal descriptor value is copied from the signal given in argument FromSignal to the signal given in argument ToSignal.

Example 2
VAR signaldi alias_di; PROC prog_start() CONST string config_string := "config_di"; AliasIO config_string, alias_di; ENDPROC The routine prog_start is connected to the START event in system parameters. The program defined digital output signal alias_di is connected to the configured digital output signal config_di (via constant config_string) at program start (start the program from the beginning).

Limitation
When starting the program, the alias signal cannot be used until the AliasIO instruction is executed. Instruction AliasIO must be placed - either in the event routine executed at program start (event START) - or in the program part executed after every program start (before use of the signal) Instruction AliasIO is not available for programming from the Teach Pendant (only from Program Maker). Option Developer’s Functions is required.

2-AliasIO-142

System Data Types and Routines

Instructions

AliasIO

Syntax
AliasIO [ FromSignal ’:=’ ] < reference (REF) of anytype> ’,’ [ ToSignal ’:=’ ] < variable (VAR) of anytype> ’;’

Related information
Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O Defining event routines Loaded/Built-in task modules RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide - System Parameters User’s Guide - System Parameters User’s Guide - System Parameters

System Data Types and Routines

2-AliasIO-143

AliasIO

Instructions

2-AliasIO-144

System Data Types and Routines

Instructions

Break

Break

Break program execution
Break is used to make an immediate break in program execution for RAPID program code debugging purposes.

Example
.. Break; ... Program execution stops and it is possible to analyse variables, values etc. for debugging purposes.

Program execution
The instruction stops program execution at once, without waiting for the robot and external axes to reach their programmed destination points for the movement being performed at the time. Program execution can then be restarted from the next instruction. If there is a Break instruction in some event routine, the routine will be executed from the beginning of the next event.

Syntax
Break’;’

Related information
Described in: Stopping for program actions Stopping after a fatal error Terminating program execution Only stopping robot movements Instructions - Stop Instructions - EXIT Instructions - EXIT Instructions - StopMove

System Data Types and Routines

2-Break-145

Break

Instructions

2-Break-146

System Data Types and Routines

Instructions

ProcCall

ProcCall

Calls a new procedure

A procedure call is used to transfer program execution to another procedure. When the procedure has been fully executed, program execution continues with the instruction following the procedure call. It is usually possible to send a number of arguments to the new procedure. These control the behaviour of the procedure and make it possible for the same procedure to be used for different things.

Examples
weldpipe1; Calls the weldpipe1 procedure. errormessage; Set do1; . PROC errormessage() TPWrite "ERROR"; ENDPROC The errormessage procedure is called. When this procedure is ready, program execution returns to the instruction following the procedure call, Set do1.

Arguments Procedure
Procedure The name of the procedure to be called. Argument Data type: In accordance with the procedure declaration

{ Argument }
Identifier

The procedure arguments (in accordance with the parameters of the procedure).

Example
weldpipe2 10, lowspeed; Calls the weldpipe2 procedure, including two arguments.

System Data Types and Routines

2-ProcCall-147

ProcCall
weldpipe3 10 \speed:=20;

Instructions

Calls the weldpipe3 procedure, including one mandatory and one optional argument.

Limitations
The procedure’s arguments must agree with its parameters: - All mandatory arguments must be included. - They must be placed in the same order. - They must be of the same data type. - They must be of the correct type with respect to the access-mode (input, variable or persistent). A routine can call a routine which, in turn, calls another routine, etc. A routine can also call itself, i.e. a recursive call. The number of routine levels permitted depends on the number of parameters, but more than 10 levels are usually permitted.

Syntax
(EBNF) <procedure> [ <argument list> ] ’;’ <procedure> ::= <identifier>

Related information
Described in: Arguments, parameters More examples Basic Characteristics - Routines Program Examples

2-ProcCall-148

System Data Types and Routines

Instructions

CallByVar

CallByVar

Call a procedure by a variable

CallByVar (Call By Variable) can be used to call procedures with specific names, e.g. proc_name1, proc_name2, proc_name3 ... proc_namex via a variable.

Example
reg1 := 2; CallByVar “proc”, reg1; The procedure proc2 is called.

Arguments CallByVar Name Number
Name Data type: string

The first part of the procedure name, e.g. proc_name. Number Data type: num

The numeric value for the number of the procedure. This value will be converted to a string and gives the 2:nd part of the procedure name e.g. 1. The value must be a positive integer.

Example
Static selection of procedure call TEST reg1 CASE 1: lf_door door_loc; CASE 2: rf_door door_loc; CASE 3: lr_door door_loc; CASE 4: rr_door door_loc; DEFAULT: EXIT; ENDTEST Depending on whether the value of register reg1 is 1, 2, 3 or 4, different procedures are called that perform the appropriate type of work for the selected door.

System Data Types and Routines

2-CallByVar-149

CallByVar
The door location in argument door_loc. Dynamic selection of procedure call with RAPID syntax reg1 := 2; %”proc”+NumToStr(reg1,0)% door_loc; The procedure proc2 is called with argument door_loc.

Instructions

Limitation: All procedures must have a specific name e.g. proc1, proc2, proc3. Dynamic selection of procedure call with CallByVar reg1 := 2; CallByVar “proc”,reg1; The procedure proc2 is called. Limitation: All procedures must have specific name, e.g. proc1, proc2, proc3, and no arguments can be used.

Limitations
Can only be used to call procedures without parameters. Execution of CallByVar takes a little more time than execution of a normal procedure call.

Error handling
In the event of a reference to an unknown procedure, the system variable ERRNO is set to ERR_REFUNKPRC. In the event of the procedure call error (not procedure), the system variable ERRNO is set to ERR_CALLPROC. These errors can be handled in the error handler.

Syntax
CallByVar [Name ‘:=’] <expression (IN) of string>’,’ [Number ‘:=‘] <expression (IN) of num>’;’

2-CallByVar-150

System Data Types and Routines

Instructions

CallByVar

Related information
Described in: Calling procedures Basic Characteristic - Routines User’s Guide - The programming language RAPID

System Data Types and Routines

2-CallByVar-151

CallByVar

Instructions

2-CallByVar-152

System Data Types and Routines

Instructions

Clear

Clear

Clears the value
Clear is used to clear a numeric variable or persistent , i.e. it sets it to 0.

Example
Clear reg1; Reg1 is cleared, i.e. reg1:=0.

Arguments Clear
Name The name of the variable or persistent to be cleared.

Name
Data type: num

Syntax
Clear [ Name ’:=’ ] < var or pers (INOUT) of num > ’;’

Related information
Described in: Incrementing a variable by 1 Decrementing a variable by 1 Instructions - Incr Instructions - Decr

System Data Types and Routines

2-Clear-153

Clear

Instructions

2-Clear-154

System Data Types and Routines

Instructions

ClearIOBuff

ClearIOBuff

Clear input buffer of a serial channel

ClearIOBuff (Clear I/O Buffer) is used to clear the input buffer of a serial channel. All buffered characters from the input serial channel are discarded.

Example
VAR iodev channel2; ... Open "sio1:", channel2 \Bin; ClearIOBuff channel2; The input buffer for the serial channel referred to by channel2 is cleared.

Arguments ClearIOBuff
IODevice

IODevice
Data type: iodev

The name (reference) of the serial channel whose input buffer is to be cleared.

Program execution
All buffered characters from the input serial channel are discarded. Next read instructions will wait for new input from the channel.

Limitations
This instruction can only be used for serial channels.

Syntax
ClearIOBuff [IODevice ’:=’] <variable (VAR) of iodev>’;’

System Data Types and Routines

2-ClearIOBuff-155

ClearIOBuff

Instructions

Related information
Described in: Opening a serial channel RAPID Summary - Communication

2-ClearIOBuff-156

System Data Types and Routines

it will be stopped and then reset. Arguments ClkReset Clock The name of the clock to reset.System & Time System Data Types and Routines 2-ClkReset-157 . Clock Data type: clock Program execution When a clock is reset. Example ClkReset clock1.’ Related Information Described in: Other clock instructions RAPID Summary . Syntax ClkReset [ Clock ’:=’ ] < variable (VAR) of clock > ’.Instructions ClkReset ClkReset Resets a clock used for timing ClkReset is used to reset a clock that functions as a stop-watch used for timing. it is set to 0. If a clock is running. The clock clock1 is reset. This instruction can be used before using a clock to make sure that it is set to 0.

ClkReset Instructions 2-ClkReset-158 System Data Types and Routines .

Arguments ClkStart Clock The name of the clock to start. For example. In this case. the program will not be able to “see” the event that occurred while the program was stopped. stopped or reset. A clock continues to run when the robot is powered down as long as the battery backup retains the program that contains the clock variable. Example VAR clock clock2. A clock continues to run when the program that started it is stopped. Clock Data type: clock Program execution When a clock is started. if the program was measuring the waiting time for an input. ClkStart clock2. However. The waiting time for di1 to become 1 is measured. WaitUntil DInput(di1) = 1. Example ClkStart clock1. System Data Types and Routines 2-ClkStart-159 . the event that you intended to time may no longer be valid. ClkStop clock2. ClkReset clock2. time:=ClkRead(clock2). If a clock is running it can be read. the input may have been received while the program was stopped. The clock clock1 is started.Instructions ClkStart ClkStart Starts a clock used for timing ClkStart is used to start a clock that functions as a stop-watch used for timing. it will run and continue counting seconds until it is stopped.

System & Time 2-ClkStart-160 System Data Types and Routines .ClkStart Instructions Error handling If the clock runs for 4.294.967 seconds (49 days 17 hours 2 minutes 47 seconds) it becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW. The error can be handled in the error handler. Syntax ClkStart [ Clock ’:=’ ] < variable (VAR) of clock > ’.’ Related Information Described in: Other clock instructions RAPID Summary .

Error handling If the clock runs for 4.967 seconds (49 days 17 hours 2 minutes 47 seconds) it becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW. Arguments ClkStop Clock The name of the clock to stop.’ System Data Types and Routines 2-ClkStop-161 . Syntax ClkStop [ Clock ’:=’ ] < variable (VAR) of clock > ’. The clock clock1 is stopped. The error can be handled in the error handler. Example ClkStop clock1. it will stop running. it can be read. started again or reset. If a clock is stopped.Instructions ClkStop ClkStop Stops a clock used for timing ClkStop is used to stop a clock that functions as a stop-watch used for timing. Clock Data type: clock Program execution When a clock is stopped.294.

System & Time Instructions .ClkStart 2-ClkStop-162 System Data Types and Routines .ClkStop Instructions Related Information Described in: Other clock instructions More examples RAPID Summary .

The serial channel referred to by channel2 is closed. If it is already closed. the instruction is ignored. Syntax Close [IODevice ’:=’] <variable (VAR) of iodev>’. Program execution The specified file or serial channel is closed and must be re-opened before reading or writing.’ Related information Described in: Opening a file or serial channel RAPID Summary . Arguments Close IODevice IODevice Data type: iodev The name (reference) of the file or serial channel to be closed.Communication System Data Types and Routines 2-Close-163 . Example Close channel2.Instructions Close Close Closes a file or serial channel Close is used to close a file or serial channel.

Close Instructions 2-Close-164 System Data Types and Routines .

Example ! Goto the position above pallet MoveL p100. v500. It has no effect on the execution of the program. Arguments ! Comment Comment Any text. Syntax (EBNF) ’!’ {<character>} <newline> Related information Described in: Characters permitted in a comment Comments within data and routine declarations Basic CharacteristicsBasic Elements Basic CharacteristicsBasic Elements System Data Types and Routines 2-comment-165 . z20.Instructions comment comment Comment Comment is only used to make the program easier to understand. tool1. A comment is inserted into the program to make it easier to understand. Text string Program execution Nothing happens when you execute this instruction.

comment Instructions 2-comment-166 System Data Types and Routines .

Instructions ConfJ ConfJ Controls the configuration during joint movement ConfJ (Configuration Joint) is used to specify whether or not the robot’s configuration is to be controlled during joint movement. program execution stops. the robot can sometimes use a different configuration than that which was programmed. \Off Data type: switch The robot always moves to the closest axis configuration. System Data Types and Routines 2-ConfJ-167 . If it is not controlled. If this is not possible using the programmed position and orientation. Program execution will not stop if it is impossible to reach the programmed axis configuration. If this is not possible. orientation and axis configuration. Examples ConfJ \Off. If this position can be reached in several different ways. program execution stops. The robot moves to the programmed position. The robot moves to the programmed position and orientation. v1000. Arguments ConfJ \On [\On] | [\Off] Data type: switch The robot always moves to the programmed axis configuration. MoveJ *. fine.it will search for a solution with the same main axes configuration as the current one. ConfJ \On. The IRB5400 robot will move to the pogrammed axis configuration or to an axis configuration close the the programmed one. with different axis configurations. With ConfJ\Off. MoveJ *. the robot cannot switch main axes configuration . fine. the closest possible position is chosen. tool1. v1000. It moves to the closest wrist configuration for axes 4 and 6. tool1.

If the argument \Off is chosen. the robot always moves to the programmed axis configuration. The control is active by default.’ Related information Described in: Handling different configurations Motion Principles Robot Configuration Robot configuration during linear movement Instructions . If this is not possible using the programmed position and orientation. Syntax ConfJ [ ’\’ On] | [ ’\’ Off] ’. This may be different to the programmed one if the configuration has been incorrectly specified manually. or if a program displacement has been carried out.when starting program executing from the beginning. This is automatically set . the robot always moves to the closest axis configuration. program execution stops before the movement starts.ConfL 2-ConfJ-168 System Data Types and Routines .when a new program is loaded .ConfJ Instructions Program execution If the argument \On (or no argument) is chosen.at a cold start-up .

SingArea \Wrist. Confl \On. MoveL *. Arguments ConfL \On The robot configuration is monitored. NOTE: For the IRB 6400 robot the monotoring is always off independant of the switch. ConfL \Off. fine. program execution stops. tool1. fine. orientation and wrist axis configuration. MoveL *. Program execution stops when the programmed configuration is not possible to reach from the current position. v1000. It may also result in unexpected sweeping robot movements when the mode is changed to joint movement. No error message is displayed when the programmed configuration is not the same as the configuration achieved by program execution.Instructions ConfL ConfL Monitors the configuration during linear movement ConfL (Configuration Linear) is used to specify whether or not the robot’s configuration is to be monitored during linear or circular movement. If it is not monitored. v1000. tool1. the configuration at execution time may differ from that at programmed time. [\On] | [\Off] Data type: switch \Off The robot configuration is not monitored. If this is not possible. MoveL *. v1000. Examples ConfL \On. fine. The robot moves to the programmed position. tool1. Data type: switch System Data Types and Routines 2-ConfL-169 .

ConfJ 2-ConfL-170 System Data Types and Routines . not only the wrist axes. Syntax ConfL [ ’\’ On] | [ ’\’ Off] ’. If SingArea\Wrist is also used.the configuration of the programmed position will not be attained from the current position. . This is automatically set .when starting program executing from the beginning.when a new program is loaded . However. If the argument \Off is chosen. there is no monitoring. the robot will check that the configurations of all axes are achieved.the needed reorientation of any one of the wrist axes to get to the programmed position from the current position exceeds a limit (140-180 degrees). Monitoring is active by default. then the program execution stops as soon as: . it is possible to restart the program again. At a stop point.ConfL Instructions Program execution During linear or circular movement. although the wrist axes may continue to the wrong configuration. the robot always moves to the programmed wrist axes configuration and at a stop point the remaining axes configurations will be checked.’ Related information Described in: Handling different configurations Robot configuration during joint movement Motion and I/O PrinciplesRobot Configuration Instructions .at a cold start-up . the robot always moves to the programmed position and orientation that has the closest possible axis configuration. If the argument \On (or no argument) is chosen.

CONNECT feeder_low WITH feeder_empty. ISignalDI di1. i. Identifier Program execution The variable is assigned an interrupt identity which can then be used when ordering or disabling interrupts. Thus. The interrupt is defined as input di1 is getting high. 1 . System Data Types and Routines 2-CONNECT-171 . This identity is also connected to the specified trap routine. the feeder_empty trap routine is executed. When an interrupt has been connected to a trap routine. Note that before an event can be handled. the trap routine is automatically executed. This must not be declared within a routine (routine data). can be connected to the same trap routine. Example VAR intnum feeder_low. when this signal becomes high. however. feeder_low. it cannot be reconnected or transferred to another routine. An interrupt identity feeder_low is created which is connected to the trap routine feeder_empty. an interrupt must also be ordered. the event specified. In other words. it must first be deleted using the instruction IDelete. Trap routine The name of the trap routine. when that event occurs.e. Limitations An interrupt (interrupt identity) cannot be connected to more than one trap routine. The interrupt is defined by ordering an interrupt event and specifying its identity. Arguments CONNECT Interrupt WITH Trap routine Interrupt Data type: intnum The variable that is to be assigned the identity of the interrupt. Different interrupts.Instructions CONNECT CONNECT Connects an interrupt to a trap routine CONNECT is used to find the identity of an interrupt and connect it to a trap routine.

Interrupts Basic Characteristics. the system variable ERRNO is set to ERR_CNTNOTVAR.CONNECT Instructions Error handling If the interrupt variable is already connected to a TRAP routine. the system variable ERRNO is set to ERR_INOMAX. the system variable ERRNO is set to ERR_ALRDYCNT. If no more interrupt numbers are available. If the interrupt variable is not a variable reference.’ <connect target> ::= <variable> | <parameter> | <VAR> <trap> ::= <identifier> Related information Described in: Summary of interrupts More information on interrupt management RAPID Summary . Syntax (EBNF) CONNECT <connect target> WITH <trap>‘. These errors can be handled in the ERROR handler.Interrupts 2-CONNECT-172 System Data Types and Routines .

ActUnit orbit2. v100. deactivation of one of the mechanical units will also disconnect that unit from the common drive unit. v100. v100. tool1. tool1. MoveL p20. the specified mechanical unit is deactivated. MoveL p10. System Data Types and Routines 2-DeactUnit-173 . fine. It can be used to determine which unit is to be active when. both the robot and track_motion will move to p40. DeactUnit track_motion.Instructions DeactUnit DeactUnit Deactivates a mechanical unit DeactUnit is used to deactivate a mechanical unit. ActUnit track_motion. tool1. DeactUnit orbit1. fine. After this. MoveL p20. MoveL p10. Program execution When the robot and external axes have come to a standstill. MoveL p30. tool1. Arguments DeactUnit MecUnit MecUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit that is to be deactivated. for example. v100. z10. v100. Deactivation of the orbit_a mechanical unit. tool1. z10. v100. If several mechanical units share a common drive unit. Examples DeactUnit orbit_a. MoveL p40. The unit orbit1 is deactivated and orbit2 activated. This means that it will neither be controlled nor monitored until it is re-activated. common drive units are used. z10. fine. The unit track_motion will be stationary when the robot moves to p20 and p30. tool1.

mecunit 2-DeactUnit-174 System Data Types and Routines .. should be terminated with a stop point in order to make a restart in this instruction possible following a power failure..’ Related information Described in: Activating mechanical units Mechanical units Instructions .in program sequence StorePath .ActUnit Data Types . The movement instruction previous to this instruction.DeactUnit Instructions Limitations Instruction DeactUnit cannot be used .in event routine RESTART . RestoPath .when one of the axes in the mechanical unit is in independent mode. Syntax DeactUnit [MecUnit ’:=’ ] < variable (VAR) of mecunit> ’.

Decr no_of_parts. i. reg1:=reg1-1. "How many parts should be produced? ". Example Decr reg1. ENDWHILE The operator is asked to input the number of parts to be produced. Arguments Decr Name Name Data type: num The name of the variable or persistent to be decremented.Instructions Decr Decr Decrements by 1 Decr is used to subtract 1 from a numeric variable or persistent.’ System Data Types and Routines 2-Decr-175 . The variable no_of_parts is used to count the number that still have to be produced.e. Syntax Decr [ Name ’:=’ ] < var or pers (INOUT) of num > ’. Example TPReadNum no_of_parts. 1 is subtracted from reg1. WHILE no_of_parts>0 DO produce_part.

multiplication Instructions .:= 2-Decr-176 System Data Types and Routines .Decr Instructions Related information Described in: Incrementing a variable by 1 Subtracting any value from a variable Changing data using an arbitrary expression.g.Incr Instructions . e.Add Instructions .

PDispOff System Data Types and Routines 2-EOffsOff-177 . The offset for external axes is activated by the instruction EOffsSet or EOffsOn and applies to all movements until some other offset for external axes is activated or until the offset for external axes is deactivated. z10. MoveL p20. but not to p40. tool1. z10. EOffsOff.EOffsSet Deactivation of the robot’s motion displacement Instructions . This displacement affects the movement to p20 and p30. Program execution Active offsets for external axes are reset.Instructions EOffsOff EOffsOff Deactivates an offset for external axes EOffsOff (External Offset Off) is used to deactivate an offset for external axes. v500. z10. MoveL p40. EOffsOn \ExeP:=p10. An offset is defined as the difference between the position of each axis at p10 and p11. v500. Deactivation of the offset for external axes. p11. Examples EOffsOff.EOffsOn Instructions . tool1. v500. Syntax EOffsOff ‘. tool1. tool1. v500. z10.’ Related information Described in: Definition of offset using two positions Definition of offset using values Instructions . MoveL p30. MoveL p10.

EOffsOff Instructions 2-EOffsOff-178 System Data Types and Routines .

v500. EOffsOn \ExeP:=p10. If ExeP has not been specified. the current position of the axes at the time of the program execution is used instead. the axes should not move when EOffsOn is executed. Activation of an offset for external axes. Program execution The offset is calculated as the difference between ExeP and ProgPoint for each separate external axis. the argument \ExeP does not have to be used. v500. Examples MoveL p10. Activation of an offset for external axes. The displacement is calculated on the basis of the difference between the actual position of each axis and the programmed point (*) stored in the instruction. If this argument is omitted. fine \Inpos := inpos50. Since it is the actual position of the axes that is used. p20. tool1. EOffsOn *. tool1. the current position of the axes at the time of the program execution is used. Arguments EOffsOn [ \ExeP ] ProgPoint [\ExeP ] (Executed Point) Data type: robtarget The new position of the axes at the time of the program execution. z10. This is calculated for each axis based on the difference between positions p10 and p20. This offset is then used to displace the position of external axes in subsequent position- System Data Types and Routines 2-EOffsOn-179 . MoveL p10.Instructions EOffsOn EOffsOn Activates an offset for external axes EOffsOn (External Offset On) is used to define and activate an offset for external axes using two positions. ProgPoint (Programmed Point) Data type: robtarget The original position of the axes at the time of programming. Since a stop point that is accurately defined has been used in the previous instruction.

A search is carried out in which the searched position of both the robot and the external axes is stored in the position psearch.EOffsOn Instructions ing instructions and remains active until some other offset is activated (the instruction EOffsSet or EOffsOn) or until the offset for external axes is deactivated (the instruction EOffsOff).when a new program is loaded .when starting program executing from the beginning. Syntax EOffsOn [ ‘\’ ExeP ’:=’ < expression (IN) of robtarget > ’. can be programmed one after the other and. v100. Any movement carried out after this starts from this position using a program displacement of both the robot and the external axes.PDispOn Motion Principles. if they are.Coordinate Systems 2-EOffsOn-180 System Data Types and Routines . PDispOn \ExeP:=psearch. on the other hand. Only one offset for each individual external axis can be activated at any one time. Several EOffsOn. the different offsets will be added. *. Example SearchL sen1. tool1. tool1. This is calculated based on the difference between the searched position and the programmed point (*) stored in the instruction. p10.’] [ ProgPoint ’:=’ ] < expression (IN) of robtarget > ’. *.EOffsOff Instructions . The external axes’ offset is automatically reset .’ Related information Described in: Deactivation of offset for external axes Definition of offset using values Displacement of the robot’s movements Coordinate Systems Instructions .at a cold start-up .EOffsSet Instructions . EOffsOn \ExeP:=psearch. psearch.

. Example VAR extjoint eax_a_p100 := [100. .Instructions EOffsSet EOffsSet Activates an offset for external axes using a value EOffsSet (External Offset Set) is used to define and activate an offset for external axes using values. 0. .As long as this offset is active. +X +X Arguments EOffsSet EAxOffs EAxOffs (External Axes Offset) Data type: extjoint The offset for external axes is defined as data of the type extjoint. all positions will be displaced 100 mm in the direction of the x-axis. expressed in: .The ExtOffs coordinate system is displaced 100 mm for the logical axis “a” (see Figure 22).mm for linear axes . 0. 0. 0]. EOffsSet eax_a_p100. Activation of an offset eax_a_p100 for external axes. meaning (provided that the external axis “a” is linear) that: .degrees for rotating axes System Data Types and Routines 2-EOffsSet-181 . 100 Normal Coordinate System 0 ExtOffs Coordinate System 0 Figure 22 Displacement of an external axis. 0.

EOffsSet Instructions . Syntax EOffsSet [ EAxOffs ’:=’ ] < expression (IN) of extjoint> ’.PDispOn Data Types .EOffsOff Instructions . Offsets cannot be added to one another using EOffsSet.at a cold start-up .when starting program executing from the beginning.Coordinate Systems 2-EOffsSet-182 System Data Types and Routines . The external axes’ offset is automatically reset .extjoint Motion Principles.EOffsSet Instructions Program execution The offset for external axes is activated when the EOffsSet instruction is activated and remains active until some other offset is activated (the instruction EOffsSet or EOffsOn) or until the offset for external axes is deactivated (the EOffsOff). Only one offset for external axes can be activated at any one time.’ Related information Described in: Deactivation of offset for external axes Definition of offset using two positions Displacement of the robot’s movements Definition of data of the type extjoint Coordinate Systems Instructions .when a new program is loaded .

[ \RL3] (Reason Line 3) Data type: string Reason for error (line 3 of max. “Fatal error in PLC” \RL2:=”Call service”. “ Search error”. 40 characters). 40 characters). “No hit for the first search”. Program execution then continues. Example ErrWrite “PLC error”. The message is also shown on the teach pendant display. ErrWrite \ W. A message is stored in the robot log.Instructions ErrWrite ErrWrite Write an Error Message ErrWrite (Error Write) is used to display an error message on the teach pendant and write it in the robot message log. [ \RL2] (Reason Line 2) Data type: string Data type: string Data type: string Reason for error (line 2 of max. A message is stored in the robot log only. 40 characters). Arguments ErrWrite [ \W ] Header Reason [ \RL2] [ \RL3] [ \RL4] [ \W ] (Warning) Data type: switch Gives a warning that is stored in the robot error message log only (not shown directly on the teach pendant display). RAISE try_search_again. System Data Types and Routines 2-ErrWrite-183 . Reason Reason for error (line 1 of max. 40 characters). 24 characters). Stop. Header Error message heading (max. [ \RL4] (Reason Line 4) Data type: string Reason for error (line 4 of max.

ErrWrite always generates the program error no. Syntax ErrWrite [ ’\’ W ’.ErrWrite Instructions Program execution An error message (max. Limitations Total string length (Header+Reason+\RL2+\RL3+\RL4) is limited to 145 characters. 5 lines) is displayed on the teach pendant and written in the robot message log.TPWrite Service 2-ErrWrite-184 System Data Types and Routines . 80001 or in the event of a warning (argument \W) generates no.’ ] [ Header ’:=’ ] < expression (IN) of string> ‘. 80002.’ Related information Described in: Display a message on the teach pendant only Message logs Instructions .’ [ Reason ’:=’ ] < expression (IN) of string> [ ’\’ RL2 ’:=’ < expression (IN) of string> ] [ ’\’ RL3 ’:=’ < expression (IN) of string> ] [ ’\’ RL4 ’:=’ < expression (IN) of string> ] ‘.

The EXIT instruction should be used when fatal errors occur or when program execution is to be stopped permanently. Program restart will then be blocked.’ Related information Described in: Stopping program execution temporarily Instructions . Syntax EXIT ’. the program can only be restarted from the first instruction of the main routine (if the start point is not moved manually). The Stop instruction is used to temporarily stop program execution. EXIT.Stop System Data Types and Routines 2-EXIT-185 . i."Illegal state".Instructions EXIT EXIT Terminates program execution EXIT is used to terminate program execution. Example ErrWrite "Fatal error".e. Program execution stops and cannot be restarted from that position in the program.

EXIT Instructions 2-EXIT-186 System Data Types and Routines .

On-going robot movements stops . ! start to do something intelligent . ENDPROC TRAP error_trap TPWrite “ERROR. If the program is executed in continuous mode.error_intno. the execution will stop at the first instruction in the main routine. Program execution Execution of ExitCycle in the MAIN program task. I will start on the next item”. VAR intnum error_intno.. ENDIF cyclecount:=cyclecount+1.. ExitCycle. PROC main() IF cyclecount = 0 THEN CONNECT error_intno WITH error_trap.The program pointer is moved to the first instruction in the main routine . it will start to execute the next cycle.All instructions that are started but not finished at all execution levels (both normal and TRAP level) are interrupted .All robot paths that are not performed at all path levels (both normal and StorePath level) are cleared .The program execution continues to execute the next cycle System Data Types and Routines 2-ExitCycle-187 .Instructions ExitCycle ExitCycle Break current cycle and start next ExitCycle is used to break the current cycle and move the PP back to the first instruction in the main routine. ISignalDI di_error. If the execution is in cycle mode. Example VAR num cyclecount:=0.1. results in the following in the MAIN task: . ENDTRAP This will start the next cycle if the signal di_error is set..

The actual value of variables or persistents .Open files.EXIT Instructions .Stop Instructions . etc.The program execution continues to execute the next cycle All other modal things in the program and system are not affected by ExitCycle such as: . world zones. etc.’ Related information Described in: Stopping after a fatal error Terminating program execution Stopping for program actions Finishing execution of a routine Instructions .The program pointer is moved to the first instruction in the main routine .RETURN 2-ExitCycle-188 System Data Types and Routines .All instructions that are started but not finished on all execution levels (both normal and TRAP level) are interrupted . .EXIT Instructions .Any motion settings such as StorePath-RestoPath sequence. .ExitCycle Instructions Execution of ExitCycle in some other program task (besides MAIN) results in the following in the actual task: . etc. directories.Defined interrupts. Syntax ExitCycle’.

(usually integer values) Step value Data type: Num Data type: Num Data type: Num The value by which the loop counter is to be incremented (or decremented) each loop. the WHILE instruction is used. Example FOR i FROM 1 TO 10 DO routine1. System Data Types and Routines 2-FOR-189 . If the instructions are to be repeated as long as a given condition is met. Arguments FOR Loop counter FROM Start value TO End value [STEP Step value] DO . Start value The desired start value of the loop counter. ENDFOR Repeats the routine1 procedure 10 times.. The data is declared automatically and its name should therefore not be the same as the name of any data that exists already. (usually integer values) If this value is not specified. ENDFOR Loop counter Identifier The name of the data that will contain the value of the current loop counter. (usually integer values) End value The desired end value of the loop counter.Instructions FOR FOR Repeats a given number of times FOR is used when one or several instructions are to be repeated a number of times. the step value will automatically be set to 1 (or -1 if the start value is greater than the end value)..

The loop counter is assigned the start value. Limitations The loop counter (of data type num) can only be accessed from within the FOR loop and consequently hides other data and routines that have the same name. 5. It can only be read (not updated) by the instructions in the FOR loop. The expressions for the start. 4. If the value of the loop counter is outside of this range. end or stop values. cannot be used (undefined whether or not the last loop is running). The loop counter is incremented (or decremented) in accordance with the step value. ENDFOR The values in an array are adjusted upwards so that a{10}:=a{9}. starting from point 3. The instructions in the FOR loop are executed. 2. in combination with exact termination conditions for the FOR loop. end and step values are calculated. Syntax (EBNF) FOR <loop variable> FROM <expression> TO <expression> [ STEP <expression> ] DO <instruction list> ENDFOR <loop variable> ::= <identifier> 2-FOR-190 System Data Types and Routines . The FOR loop is repeated. 6. Program execution 1. a{9}:=a{8} etc. Decimal values for start.FOR Instructions Example FOR i FROM 10 TO 2 STEP -1 DO a{i} := a{i-1}. or whether it is equal to the start or end value. the FOR loop stops and program execution continues with the instruction following ENDFOR. 3. The value of the loop counter is checked to see whether its value lies between the start and end value.

Expressions Basic Characteristics Basic Elements System Data Types and Routines 2-FOR-191 .Instructions FOR Related information Described in: Expressions Identifiers Basic Characteristics .

FOR Instructions 2-FOR-192 System Data Types and Routines .

System Data Types and Routines 2-GetSysData-193 . 0]]. The data type of this argument also specifies the type of system data (Tool or Work Object) to fetch. [0. Copy current active tool data value to the persistent variable curtoolvalue. 0. GetSysData curtoolvalue. With this instruction it is possible to fetch data for and the name of the current active Tool or Work Object. 0]. [1. 0.Instructions GetSysData GetSysData Get system data GetSysData fetches the value and optional symbol name for the current system data of specified data type. 0. Arguments GetSysData DestObject DestObject [\ ObjectName ] Data type: anytype Persistent for storage of current active system data value. 0]]. 0. [1. 0. GetSysData curtoolvalue \ObjectName := curtoolname. 0]. Copy also current active tool name to the variable curtoolname. 0. [[0. 0. Example PERS tooldata curtoolvalue := [TRUE. 0]. 0. VAR string curtoolname. [0. [\ObjectName] Data type: string Option argument (variable or persistent) to also fetch the current active system data name.

Current system data for Tool or Work Object is activated by execution of any move instruction or can be manually set in the jogging window.tooldata Data Types . Syntax GetSysData [ DestObject’:=’] < persistent(PERS) of anytype> [’\’ObjectName’:=’ < expression (INOUT) of string> ] ’.’ Related information Described in: Definition of tools Definition of work objects Data Types .wobjdata 2-GetSysData-194 System Data Types and Routines . If argument \ObjectName is used.GetSysData Instructions Program execution When running the instruction GetSysData the current data value is stored in the specified persistent in argument DestObject. the name of the current data is stored in the specified variable or persistent in argument ObjectName.

IF reg1>100 GOTO highvalue. ready: If reg1 is greater than 100. IF reg1<=5 GOTO next. The next program loop is executed five times. Examples GOTO next. lowvalue: .Instructions GOTO GOTO Goes to a new instruction GOTO is used to transfer program execution to another line (a label) within the same routine. GOTO ready. next: . reg1 := 1. the highvalue program loop is executed. System Data Types and Routines 2-GOTO-195 . reg1 := reg1 + 1. highvalue: . otherwise the lowvalue loop is executed. . Arguments GOTO Label Label Identifier The label from where program execution is to continue. next: Program execution continues with the instruction following next.

label RAPID Summary Controlling the Program Flow 2-GOTO-196 System Data Types and Routines . It is only possible to transfer program execution to a label within a FOR or WHILE instruction if the GOTO instruction is also located within that instruction. It is only possible to transfer program execution to a label within an IF or TEST instruction if the GOTO instruction is also located within the same branch of that instruction.GOTO Instructions Limitations It is only possible to transfer program execution to a label within the same routine. Syntax (EBNF) GOTO <identifier>’.’ Related information Described in: Label Other instructions that change the program flow Instructions .

If the value in the specified load data is greater than that of the value of the true load. -> Impaired path accuracy including a risk of overshooting -> Risk of overloading the mechanical structure Examples GripLoad piece1. Arguments GripLoad Load The load data that describes the current payload. The robot gripper releases all loads. it can often lead to the following consequences: . The robot gripper holds a load called piece1.Instructions GripLoad GripLoad Defines the payload of the robot GripLoad is used to define the payload which the robot holds in its gripper. When incorrect load data is specified. Incorrect definitions of load data can result in overloading of the robot mechanical structure. GripLoad load0. Load Data type: loaddata System Data Types and Routines 2-GripLoad-197 . Description It is important to always define the actual tool load and when used. the payload of the robot too. -> The robot will not be used to its maximum capacity -> Impaired path accuracy including a risk of overshooting If the value in the specified load data is less than the value of the true load.

’ Related information Described in: Definition of load data Definition of tool load Data Types .GripLoad Instructions Program execution The specified load affects the performance of the robot.tooldata 2-GripLoad-198 System Data Types and Routines . Syntax GripLoad [ Load ’:=’ ] < persistent (PERS) of loaddata > ’. The default load. is automatically set .at a cold start-up .loaddata Data Types .when a new program is loaded .when starting program executing from the beginning. 0 kg.

’ System Data Types and Routines 2-IDelete-199 . this is done automatically when . Example IDelete feeder_low. The interrupt feeder_low is cancelled. the instruction ISleep or IDisable should be used. The instruction should be preceded by a stop point. If the interrupt is to be only temporarily disabled. Interrupt Data type: intnum Program execution The definition of the interrupt is completely erased. To define it again. Interrupts do not have to be erased. Otherwise the interrupt will be deactivated before the end point is reached.the program pointer is moved to the start of a routine Syntax IDelete [ Interrupt ‘:=’ ] < variable (VAR) of intnum > ‘.Instructions IDelete IDelete Cancels an interrupt IDelete (Interrupt Delete) is used to cancel (delete) an interrupt. Arguments IDelete Interrupt The interrupt identity.the program is restarted from the beginning .a new program is loaded . it must first be re-connected to the trap routine.

IDisable 2-IDelete-200 System Data Types and Routines .IDelete Instructions Related information Described in: Summary of interrupts Temporarily disabling an interrupt Temporarily disabling all interrupts RAPID Summary .Interrupts Instructions .ISleep Instructions .

executed in “first in .first out” order in the queue. for example.Instructions IDisable IDisable Disables interrupts IDisable (Interrupt Disable) is used to disable all interrupts temporarily. It may. Syntax IDisable‘. the interrupt(s) of the program then immediately start generating. Program execution Interrupts which occur during the time in which an IDisable instruction is in effect are placed in a queue. be used in a particularly sensitive part of the program where no interrupts may be permitted to take place in case they disturb normal program execution. When interrupts are permitted once more. ENDFOR IEnable. No interrupts are permitted as long as the serial channel is reading.’ Related information Described in: Summary of interrupts Permitting interrupts RAPID Summary . FOR i FROM 1 TO 100 DO character[i]:=ReadBin(sensor). Example IDisable.Interrupt Instructions .IEnable System Data Types and Routines 2-IDisable-201 .

IDisable Instructions 2-IDisable-202 System Data Types and Routines .

Interrupts are always permitted when a program is started from the beginning. ENDFOR IEnable. Syntax IEnable‘. Interrupts disabled by the ISleep instruction are not affected by the IEnable instruction. No interrupts are permitted as long as the serial channel is reading. are placed in a queue. executed in “first in .Interrupts Instructions .IDisable System Data Types and Routines 2-IEnable-203 ..Program execution then continues in the ordinary program and interrupts which occur after this are dealt with as soon as they occur.’ Related information Described in: Summary of interrupts Permitting no interrupts RAPID Summary .first out” order in the queue. FOR i FROM 1 TO 100 DO character[i]:=ReadBin(sensor). the interrupt(s) of the program then immediately start generating. When it has finished reading. interrupts are once more permitted. When interrupts are permitted once more (IEnable).Instructions IEnable IEnable Enables interrupts IEnable (Interrupt Enable) is used to enable interrupts during program execution. Example IDisable. Program execution Interrupts which occur during the time in which an IDisable instruction is in effect.

IEnable Instructions 2-IEnable-204 System Data Types and Routines .

Instructions Compact IF Compact IF If a condition is met.Expressions Instructions .. Data type: bool Condition The condition that must be satisfied for the instruction to be executed. the IF instruction is used. Arguments IF Condition . then.IF System Data Types and Routines 2-Compact IF-205 . (one instruction) Compact IF is used when a single instruction is only to be executed if a given condition is met.. Syntax (EBNF) IF <conditional expression> ( <instruction> | <SMT>) ’..’ Related information Described in: Conditions (logical expressions) IF with several instructions Basic Characteristics . program execution continues at the next label. The do1 signal is set if counter > 10. IF counter > 10 Set do1. If different instructions are to be executed. If reg1 is greater than 5.. depending on whether the specified condition is met or not. Examples IF reg1 > 5 GOTO next.

Compact IF Instructions 2-Compact IF-206 System Data Types and Routines .

ELSE Reset do1. System Data Types and Routines 2-IF-207 . otherwise .] ENDIF Condition Data type: bool The condition that must be satisfied for the instructions between THEN and ELSE/ELSEIF to be executed.... {ELSEIF Condition THEN . ENDIF The do1 and do2 signals are set only if reg1 is greater than 5.Instructions IF IF If a condition is met. IF reg1 > 5 THEN Set do1.} [ELSE . Set do2. Reset do2.. Set do2.... ENDIF The do1 and do2 signals are set or reset depending on whether reg1 is greater than 5 or not. Arguments IF Condition THEN .. IF is used when different instructions are to be executed depending on whether a condition is met or not. Examples IF reg1 > 5 THEN Set do1.. then ...

ELSE counter := counter + 1. program execution continues with the instructions following ELSE. ELSEIF counter < 0 THEN counter := 0. only the instructions associated with the first of those conditions are executed. If more than one condition is met.IF Instructions Example IF counter > 100 THEN counter := 100. Program execution continues with the instructions associated with that condition. However.Expressions 2-IF-208 System Data Types and Routines . Program execution The conditions are tested in sequential order. Syntax (EBNF) IF <conditional expression> THEN <instruction list> {ELSEIF <conditional expression> THEN <instruction list> | <EIF>} [ELSE <instruction list>] ENDIF Related information Described in: Conditions (logical expressions) Basic Characteristics . until one of them is satisfied. ENDIF Counter is incremented by 1. if the value of counter is outside the limit 0-100. If none of the conditions are satisfied. counter is assigned the corresponding limit value.

i.e.Instructions Incr Incr Increments by 1 Incr is used to add 1 to a numeric variable or persistent. Syntax Incr [ Name ’:=’ ] < var or pers (INOUT) of num > ’. ENDWHILE The number of parts produced is updated on the teach pendant each cycle.’ Related information Described in: Decrementing a variable by 1 Adding any value to a variable Changing data using an arbitrary expression. 1 is added to reg1. Name Data type: num Example WHILE stop_production=0 DO produce_part.Add Instructions . Production continues to run as long as the signal stop_production is not set. e. Incr no_of_parts. Arguments Incr Name The name of the variable or persistent to be changed. TPWrite "No of produced parts= "\Num:=no_of_parts. reg1:=reg1+1.g. Example Incr reg1. multiplication Instructions .Decr Instructions .:= System Data Types and Routines 2-Incr-209 .

Incr Instructions 2-Incr-210 System Data Types and Routines .

: 1 Signal level 0 Execution of the instruction InvertDO Execution of the instruction InvertDO 1 Signal level 0 Figure 23 Inversion of a digital output signal.Instructions InvertDO InvertDO Inverts the value of a digital output signal InvertDO (Invert Digital Output) inverts the value of a digital output signal (0 -> 1 and 1 -> 0). Arguments InvertDO Signal The name of the signal to be inverted. The current value of the signal do15 is inverted. Example InvertDO do15.’ System Data Types and Routines 2-InvertDO-211 . Syntax InvertDO [ Signal ’:=’ ] < variable (VAR) of signaldo > ’. Signal Data type: signaldo Program execution The current value of the signal is inverted (see Figure 23).

InvertDO Instructions Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles System Parameters 2-InvertDO-212 System Data Types and Routines .

MaxTime Data type: num The maximum period of waiting time permitted. the execution will be stopped. Disable I/O unit with name cell1. To disable an I/O unit takes about 2-5 s. After disabling an I/O unit. 5. If there is no error handler. Examples CONST string cell1:=”cell1”. the error handler will be called. When required for some reason. I/O units are automatically enabled after start-up if they are defined in the system parameters. System Data Types and Routines 2-IODisable-213 . any setting of outputs in this unit will result in an error. Program execution The specified I/O unit starts the disable steps. IODisable cell1. expressed in seconds. If this time runs out before the I/O unit has finished the disable steps.Instructions IODisable IODisable Disable I/O unit IODisable is used to disable an I/O unit during program execution.Wait max. I/O units can be disabled or enabled during program execution. The instruction is ready when the disable steps are finished. with the error code ERR_IODISABLE. a recoverable error will be generated. 5 s. If the MaxTime runs out before the I/O unit has finished the disable steps. if there is one. Arguments IODisable UnitName UnitName MaxTime Data type: string The name of the I/O unit to be disabled (with same name as configured).

ELSEIF recover_flag = 2 THEN RETRY. 5. IODisable “cell1”.. With the robot at the home position. IODisable “cell1”. the I/O unit cell1 is disabled during robot movement to the home position. Stop.. the robot execution will stop with an error message. After the max. ! Start to disable I/O unit cell1 recover_flag := 1. . ERROR IF ERRNO = ERR_IODISABLE THEN IF recover_flag = 1 THEN TRYNEXT.. v1000. if the unit name don’t exist or if the unit isn’t allowed to be disabled. . ! Wait until disable of I/O unit cell1 is ready recover_flag := 2. The errors can be handled in an error handler. ENDIF ENDPROC To save cycle time. number of retries (5 with a waiting time of 5 s). “Not possible to disable I/O unit cell1”.. The same principle can be used with IOEnable (this will save more cycle time compared with IODisable). if an IOEnable or IODisable request is interrupted by another request to the same unit. Example PROC go_home() VAR num recover_flag :=0. The system variable ERRNO will be set to: ERR_IODISABLE ERR_CALLIO_INTER ERR_NAME_INVALID if the time out time runs out before the unit is disabled. ENDIF ELSEIF ERRNO = ERR_EXCRTYMAX THEN ErrWrite “IODisable error”. a test is done to establish whether or not the I/O unit cell1 is fully disabled. ! Move to home position MoveJ home. 2-IODisable-214 System Data Types and Routines .tool1.IODisable Instructions Error handling Following recoverable errors can be generated. 0.fine.

’ [ MaxTime ’:=’ ] < expression (IN) of num > ’.’ Related information Described in: Enabling an I/O unit Input/Output instructions Input/Output functionality in general Configuration of I/O Instructions .IOEnable RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .Instructions IODisable Syntax IODisable [ UnitName ’:=’ ] < expression (IN) of string> ’.System Parameters System Data Types and Routines 2-IODisable-215 .

IODisable Instructions 2-IODisable-216 System Data Types and Routines .

Arguments IOEnable UnitName UnitName MaxTime Data type: string The name of the I/O unit to be enabled (with same name as configured). Enable I/O unit with name cell1. 5 s. To enable an I/O unit takes about 2-5 s. with the error code ERR_IOENABLE. expressed in seconds. 5. If the MaxTime runs out before the I/O unit has finished the enable steps. MaxTime Data type: num The maximum period of waiting time permitted. After a sequence of IODisable . The instruction is ready when the enable steps are finished. Examples CONST string cell1:=”cell1”. I/O units can be disabled or enabled during program execution. the execution will be stopped. I/O units are automatically enabled after start-up if they are defined in the system parameters. IOEnable cell1. The errors can be handled in an error System Data Types and Routines 2-IOEnable-217 . a recoverable error will be generated. Error handling Following recoverable errors can be generated. When required for some reason. If this time runs out before the I/O unit has finished the enable steps. if there is one. all outputs for the current I/O unit will be set to the old values (before IODisable). the error handler will be called. Wait max.Instructions IOEnable IOEnable Enable I/O unit IOEnable is used to enable an I/O unit during program execution. Program execution The specified I/O unit starts the enable steps.IOEnable. If there is no error handler.

if the unit name don’t exist or if the unit isn’t allowed to be disabled.’ [ MaxTime ’:=’ ] < expression (IN) of num > ’. and a new retry is made. SetDO cell1_sig3. 1.. VAR num max_retry:=0. . Example IOEnable can also be used to check whether some I/O unit is disconnected for some reason. RETRY.IOEnable handler. ELSE RAISE. The system variable ERRNO will be set to: ERR_IOENABLE ERR_CALLIO_INTER ERR_NAME_INVALID Instructions if the time out time runs out before the unit is enabled. if an IOEnable or IODisable request is interrupted by another request to the same unit. max_retry := max_retry + 1.’ 2-IOEnable-218 System Data Types and Routines . a jump is made to the error handler. After 5 retry attempts the error ERR_IOENABLE is propagated to the caller of this routine.... ERROR IF ERRNO = ERR_IOENABLE THEN IF max_retry < 5 THEN WaitTime 1. a test is done by trying to enable the I/ O unit with timeout after 0 sec. Syntax IOEnable [ UnitName ’:=’ ] < expression (IN) of string> ’. IOEnable “cell1”. If the test fails. . 0. the program execution waits for 1 sec. ENDIF ENDIF Before using signals on the I/O unit cell1. In the error handler.

System Parameters System Data Types and Routines 2-IOEnable-219 .IODisable Instructions .IODisable RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .Instructions IOEnable Related information Described in: More examples Disabling an I/O unit Input/Output instructions Input/Output functionality in general Configuration of I/O Instructions .

IOEnable Instructions 2-IOEnable-220 System Data Types and Routines .

AIO_OUTSIDE. CONNECT sig1int WITH iroutine1. ISignalAI ai1. 0. and the absolute signal difference compared to the stored reference value is bigger than 0. sig1int. 0. an interrupt will occur each time its condition is satisfied. 0.5. Orders an interrupt which is to occur each time the logical value of the analog input signal ai1 is between 0. Orders an interrupt which is to occur each time the logical value of the analog input signal ai1 is lower than 0. ISignalAI \Single.Instructions ISignalAI ISignalAI Interrupts from analog input signal ISignalAI (Interrupt Signal Analog Input) is used to order and enable interrupts from an analog input signal.5. A call is then made to the iroutine1 trap routine. sig1int. ISignalAI ai1. and the absolute signal difference compared to the stored reference value is bigger than 0.1. 0. sig1int.5. 0.1. the interrupt occurs once at the most.1.5. If the argument Single is set. 1.5.1.5 and 1.5 and 1.5 or higher than 1.5. AIO_BETWEEN.5.5.5. If the argument is omitted. Example VAR intnum sig1int. 1. 0. ai1. Arguments ISignalAI [\Single] Signal Condition HighValue LowValue DeltaValue [\DPos] | [\DNeg] Interrupt [\Single] Data type: switch Specifies whether the interrupt is to occur once or cyclically. Data type: signalai System Data Types and Routines 2-ISignalAI-221 . Signal The name of the signal that is to generate interrupts. Orders an interrupt which is to occur the first time the logical value of the analog input signal ai1 is between 0. 1. AIO_BETWEEN.

AIO_ABOVE_HIGH: . both positive and negative differences will generate new interrupts.AIO_ALWAYS: logical value of the signal is above HighValue logical value of the signal is below HighValue logical value of the signal is above LowValue logical value of the signal is below LowValue logical value of the signal is between LowValue and HighValue logical value of the signal is above HighValue or below LowValue independently of HighValue and LowValue Data type: num HighValue High logical value to define the condition.AIO_BELOW_LOW: .AIO_BETWEEN: . The current signal value compared to the stored reference value must be greater than the specified DeltaValue before generation of a new interrupt. Data type: num DeltaValue Data type: num Defines the minimum logical signal difference before generation of a new interrupt.AIO_OUTSIDE: .ISignalAI Condition Instructions Data type: aiotrigg Specifies how HighValue and LowValue define the condition to be satisfied: .AIO_ABOVE_LOW: . 2-ISignalAI-222 System Data Types and Routines . Interrupt Data type: intnum The interrupt identity. LowValue Low logical value to define the condition. If none of \DPos and \DNeg argument is used. [\DPos] Data type: switch Specifies that only positive logical signal differences will give new interrupts. [\DNeg] Data type: switch Specifies that only negative logical signal differences will give new interrupts.AIO_BELOW_HIGH: . This interrupt should have previously been connected to a trap routine by means of the instruction CONNECT.

a new test of the specified conditions (both Condition and DeltaValue) is made at every sample of the signal value. program execution continues from where the interrupt occurred. compared to the current signal value and the last stored reference value. At the interrupt subscription time. if the following conditions are satisfied: . Conditions for interrupt generation Before the interrupt subscription is ordered. If the switch \Single (cyclic interrupt) is not used. An interrupt is also generated at the sample for update of the reference value. each time the signal is sampled. \DPos or \DNeg). to generate or not generate an interrupt. If the new read value satisfies the specified HighValue and LowValue Condition. saved. no interrupts will occur. to generate or not generate an interrupt. (argument \DPos or \DNeg). and later used as a reference value for the DeltaValue condition. no interrupt occurs. its value is then compared to HighValue and LowValue according to Condition and with consideration to DeltaValue.Instructions ISignalAI Program execution When the signal fulfils the specified conditions (both Condition and DeltaValue). If the signal difference is not in the specified direction.Argument DeltaValue (sufficient signal change in any direction. System Data Types and Routines 2-ISignalAI-223 . but its difference compared to the last stored reference value is less or equal to the DeltaValue argument. if the direction of the signal difference is in accordance with the specified argument (any direction. The stored reference value for the DeltaValue condition is updated with a newly read value for later use at any sample. independently of specified switch \DPos or \DNeg) The reference value is only updated at the sample time. a call is made to the corresponding trap routine. only one interrupt at the most will be generated. the value of the signal is read. When the \Single switch is used. When this has been executed.Argument Condition with specified HighValue and LowValue (within limits) . not at the interrupt subscription time. if specified DeltaValue = 0 and after the interrupt subscription time always at each time the signal is sampled.

ISignalAI Condition for interrupt generation at interrupt subscription time Sample before interrupt subscription RefValue := CurrentValue Interrupt False subscription Instructions CurrentValue tested against Condition HighValue and LowValue True False DeltaValue = 0 True Interrupt generated Continue 2-ISignalAI-224 System Data Types and Routines .

Instructions ISignalAI Condition for interrupt generation at each sample after interrupt subscription New Sample False CurrentValue checked against Condition HighValue and LowValue True True No DPos or DNeg specified and ABS(CurrentValue .RefValue) > DeltaValue False Interrupt generated True RefValue := CurrentValue Continue System Data Types and Routines 2-ISignalAI-225 .RefValue) > DeltaValue True False DNeg specified and (RefValue .RefValue) > DeltaValue False DPos specified and (CurrentValue .CurrentValue) > DeltaValue False RefValue := CurrentValue True ABS(CurrentValue .

AIO_BETWEEN. samples 7 to 10 will not generate any interrupt. sig1int.ISignalAI Example 1 of interrupt generation Instructions Signal logical value HighValue Signal Value LowValue 0 1 2 3 4 5 6 7 8 Time for order of interrupt subscription Storage of reference value 9 10 11 12 Samples Assuming the interrupt is ordered between sample 0 and 1.1. the following instruction will give the following results: ISignalAI ai1. because the signal difference compared to sample 6 is less than DeltaValue. because the signal value is between HighValue and LowValue and the signal difference compared to sample 1 is more than DeltaValue. because the signal difference is less than DeltaValue.2.0. 5 will not generate any interrupt. samples 3. 6. sample 2 will generate an interrupt. 2-ISignalAI-226 System Data Types and Routines . 2. because the signal value is between HighValue and LowValue and the signal difference compared to sample 0 is more than DeltaValue. because the signal is above HighValue sample 11 will not generate any interrupt. because the signal difference compared to sample 6 is equal to DeltaValue. sample 6 will generate an interrupt. sample 1 will generate an interrupt. sample 12 will not generate any interrupt. 4. 1.

2. because the signal value is between HighValue and LowValue and the signal difference in the positive direction compared to sample 2 is more than DeltaValue. sample 6 will generate an interrupt. because the signal is within limits and the absolute signal difference between the current value and the last stored reference value is greater than 1. the following instruction will give the following results: ISignalAI ai1.1.2.Instructions Example 2 of interrupt generation ISignalAI Signal logical value HighValue Signal Value LowValue 0 1 2 3 4 5 6 7 8 Time for order of interrupt subscription Storage of reference value 9 10 11 12 Samples Assuming the interrupt is ordered between sample 0 and 1. AIO_BETWEEN.0. No interrupt will be generated because the signal changes are in the negative direction. System Data Types and Routines 2-ISignalAI-227 . 1. 6. sig1int. A new reference value is stored at sample 1 and 2.0 \DPos.

because the signal is within limits and the absolute signal difference between the current value and the last stored reference value is greater than 1. AIO_OUTSIDE.2. 1.0 sample 8 will generate an interrupt. because the signal value is above HighValue and the signal difference in the positive direction compared to sample 7 is more than DeltaValue. 6.ISignalAI Example 3 of interrupt generation Instructions Signal logical value HighValue Signal Value LowValue 0 1 2 3 4 5 6 7 8 Time for order of interrupt subscription Storage of reference value 9 10 11 12 Samples Assuming the interrupt is ordered between sample 0 and 1. the following instruction will give the following results: ISignalAI \Single. ai1. A new reference value is stored at sample 7. 2.0 \DPos.1. sig1int. 2-ISignalAI-228 System Data Types and Routines .

1.2.Instructions Example 4 of interrupt generation ISignalAI Signal logical value HighValue Signal Value LowValue 0 1 2 3 4 5 6 7 8 Time for order of interrupt subscription Storage of reference value 9 10 11 12 Samples Assuming the interrupt is ordered between sample 0 and 1. because the signal difference in the positive direction compared to previous sample is more than DeltaValue. the following instruction will give the following results: ISignalAI ai1. A new reference value is stored at sample 11 and 12. sig1int. 6. A new reference value is stored at sample 1 and 2.0 sample 6 will generate an interrupt. even if only one or two bits in the analog value are changed.0 Error handling If there is a subscription of interrupt on an analog input signal. an interrupt will be given for every change in the analog value that satisfies the condition specified when ordering the interrupt subscription.0 \DPos. because the signal is within limits and the absolute signal difference between the current value and the last stored reference value is greater than 1. 1. sample 7 and 8 will generate an interrupt. because the signal difference in the positive direction compared to sample 2 is more than DeltaValue. System Data Types and Routines 2-ISignalAI-229 . because the signal is within limits and the absolute signal difference between the current value and the last stored reference value is greater than 1. many interrupts can be generated. 2. AIO_ALWAYS. If the analog value is noisy.

ISignalAI

Instructions

To avoid generating interrupts for small changes of the analog input value, set the DeltaValue to a level greater than 0. Then no interrupts will be generated until a change of the analog value is greater than the specified DeltaValue.

Limitations
The HighValue and LowValue arguments should be in the range: logical maximum value, logical minimum value defined for the signal. HighValue must be above LowValue. DeltaValue must be 0 or positive. The limitations for the interrupt identity are the same as for ISignalDI.

Syntax
ISignalAI [ ’\’Single’,’] [ Signal’:=’ ]<variable (VAR) of signalai>’,’ [ Condition’:=’ ]<expression (IN) of aiotrigg>’,’ [ HighValue’:=’ ]<expression (IN) of num>’,’ [ LowValue’:=’ ]<expression (IN) of num>’,’ [ DeltaValue’:=’ ]<expression (IN) of num> [ ’\’DPos] | [ ’\’DNeg] ’,’ [ Interrupt’:=’ ]<variable (VAR) of intnum>’;’

Related information
Described in: Summary of interrupts Definition of constants Interrupt from analog output signal Interrupt from digital input signal Interrupt from digital output signal More information on interrupt management More examples Related system parameters (filter) RAPID Summary - Interrupts Data Types - aiotrigg Instructions - ISignalAO Instructions - ISignalDI Instructions - ISignalDO Basic Characteristics - Interrupts Data Types - intnum System Parameters - IO Signals

2-ISignalAI-230

System Data Types and Routines

Instructions

ISignalAO

ISignalAO

Interrupts from analog output signal

ISignalAO (Interrupt Signal Analog Output) is used to order and enable interrupts from an analog output signal.

Example
VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalAO \Single, ao1, AIO_BETWEEN, 1.5, 0.5, 0, sig1int; Orders an interrupt which is to occur the first time the logical value of the analog output signal ao1 is between 0.5 and 1.5. A call is then made to the iroutine1 trap routine. ISignalAO ao1, AIO_BETWEEN, 1.5, 0.5, 0.1, sig1int; Orders an interrupt which is to occur each time the logical value of the analog output signal ao1 is between 0.5 and 1.5, and the absolute signal difference compared to the previous stored reference value is bigger than 0.1. ISignalAO ao1, AIO_OUTSIDE, 1.5, 0.5, 0.1, sig1int; Orders an interrupt which is to occur each time the logical value of the analog output signal ao1 is lower than 0.5 or higher than 1.5, and the absolute signal difference compared to the previous stored reference value is bigger than 0.1.

Arguments ISignalAO [\Single] Signal Condition HighValue LowValue DeltaValue [\DPos] | [\DNeg] Interrupt [\Single]
Data type: switch

Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs once at the most. If the argument is omitted, an interrupt will occur each time its condition is satisfied.

Signal
The name of the signal that is to generate interrupts.

Data type: signalao

System Data Types and Routines

2-ISignalAO-231

ISignalAO
Condition

Instructions
Data type: aiotrigg

Specifies how HighValue and LowValue define the condition to be satisfied: - AIO_ABOVE_HIGH: - AIO_BELOW_HIGH: - AIO_ABOVE_LOW: - AIO_BELOW_LOW: - AIO_BETWEEN: - AIO_OUTSIDE: - AIO_ALWAYS: logical value of the signal is above HighValue logical value of the signal is below HighValue logical value of the signal is above LowValue logical value of the signal is below LowValue logical value of the signal is between LowValue and HighValue logical value of the signal is above HighValue or below LowValue independently of HighValue and LowValue Data type: num

HighValue
High logical value to define the condition.

LowValue
Low logical value to define the condition.

Data type: num

DeltaValue

Data type: num

Defines the minimum logical signal difference before generation of a new interrupt. The current signal value compared to the previous stored reference value must be greater than the specified DeltaValue before generation of a new interrupt.

[\DPos]

Data type: switch

Specifies that only positive logical signal differences will give new interrupts.

[\DNeg]

Data type: switch

Specifies that only negative logical signal differences will give new interrupts. If neither of the \DPos and \DNeg arguments are used, both positive and negative differences will generate new interrupts.

Interrupt

Data type: intnum

The interrupt identity. This interrupt should have previously been connected to a trap routine by means of the instruction CONNECT.

2-ISignalAO-232

System Data Types and Routines

Instructions

ISignalAO

Program execution
See instruction ISignalAI for information about: - Program execution - Condition for interrupt generation - More examples Same principles are valid for ISignalAO as for ISignalAI.

Limitations
The HighValue and LowValue arguments should be in the range: logical maximum value, logical minimum value, defined for the signal. HighValue must be above LowValue. DeltaValue must be 0 or positive. The limitations for the interrupt identity are the same as for ISignalDO.

Syntax
ISignalAO [ ’\’Single’,’] [ Signal’:=’ ]<variable (VAR) of signalao>’,’ [ Condition’:=’ ]<expression (IN) of aiotrigg>’,’ [ HighValue’:=’ ]<expression (IN) of num>’,’ [ LowValue’:=’ ]<expression (IN) of num>’,’ [ DeltaValue’:=’ ]<expression (IN) of num> [ ’\’DPos] | [ ’\’DNeg] ’,’ [ Interrupt’:=’ ]<variable (VAR) of intnum>’;’

System Data Types and Routines

2-ISignalAO-233

ISignalAO

Instructions

Related information
Described in: Summary of interrupts Definition of constants Interrupt from analog input signal Interrupt from digital input signal Interrupt from digital output signal More information on interrupt management More examples Related system parameters (filter) RAPID Summary - Interrupts Data Types - aiotrigg Instructions - ISignalAI Instructions - ISignalDI Instructions - ISignalDO Basic Characteristics - Interrupts Data Types - intnum System Parameters - IO Signals

2-ISignalAO-234

System Data Types and Routines

Instructions

ISignalDI

ISignalDI

Orders interrupts from a digital input signal

ISignalDI (Interrupt Signal Digital In) is used to order and enable interrupts from a digital input signal. System signals can also generate interrupts.

Examples
VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalDI di1,1,sig1int; Orders an interrupt which is to occur each time the digital input signal di1 is set to 1. A call is then made to the iroutine1 trap routine. ISignalDI di1,0,sig1int; Orders an interrupt which is to occur each time the digital input signal di1 is set to 0. ISignalDI \Single, di1,1,sig1int; Orders an interrupt which is to occur only the first time the digital input signal di1 is set to 1.

Arguments ISignalDI
[ \Single ]

[ \Single ] Signal TriggValue Interrupt
Data type: switch

Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs once at the most. If the argument is omitted, an interrupt will occur each time its condition is satisfied. Signal The name of the signal that is to generate interrupts. Data type: signaldi

System Data Types and Routines

2-ISignalDI-235

ISignalDI
TriggValue

Instructions
Data type: dionum

The value to which the signal must change for an interrupt to occur. The value is specified as 0 or 1 or as a symbolic value (e.g. high/low). The signal is edge-triggered upon changeover to 0 or 1. TriggValue 2 or symbolic value edge can be used for generation of interrupts on both positive flank (0 -> 1) and negative flank (1 -> 0). Interrupt Data type: intnum

The interrupt identity. This should have previously been connected to a trap routine by means of the instruction CONNECT.

Program execution
When the signal assumes the specified value, a call is made to the corresponding trap routine. When this has been executed, program execution continues from where the interrupt occurred. If the signal changes to the specified value before the interrupt is ordered, no interrupt occurs (see Figure 24).
:

1 Signal level 0 Interrupt ordered Interrupt ordered 1 Signal level 0 Interrupt occurs

Interrupt occurs

Figure 24 Interrupts from a digital input signal at signal level 1.

2-ISignalDI-236

System Data Types and Routines

Instructions

ISignalDI

Limitations
The same variable for interrupt identity cannot be used more than once, without first deleting it. Interrupts should therefore be handled as shown in one of the alternatives below. PROC main ( ) VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalDI di1, 1, sig1int; WHILE TRUE DO : : ENDWHILE ENDPROC All activation of interrupts is done at the beginning of the program. These instructions are then kept outside the main flow of the program. PROC main ( ) VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalDI di1, 1, sig1int; : : IDelete sig1int; ENDPROC The interrupt is deleted at the end of the program, and is then reactivated. It should be noted, in this case, that the interrupt is inactive for a short period.

Syntax
ISignalDI [ ’\’ Single’,’] [ Signal ’:=’ ] < variable (VAR) of signaldi > ’,’ [ TriggValue ’:=’ ] < expression (IN) of dionum >’,’ [ Interrupt ’:=’ ] < variable (VAR) of intnum > ’;’

System Data Types and Routines

2-ISignalDI-237

ISignalDI

Instructions

Related information
Described in: Summary of interrupts Interrupt from an output signal More information on interrupt management More examples RAPID Summary - Interrupts Instructions - ISignalDO Basic Characteristics - Interrupts Data Types - intnum

2-ISignalDI-238

System Data Types and Routines

Instructions

ISignalDO

ISignalDO

Interrupts from a digital output signal

ISignalDO (Interrupt Signal Digital Out) is used to order and enable interrupts from a digital output signal. System signals can also generate interrupts.

Examples
VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalDO do1,1,sig1int; Orders an interrupt which is to occur each time the digital output signal do1 is set to 1. A call is then made to the iroutine1 trap routine. ISignalDO do1,0,sig1int; Orders an interrupt which is to occur each time the digital output signal do1 is set to 0. ISignalDO\Single, do1,1,sig1int; Orders an interrupt which is to occur only the first time the digital output signal do1 is set to 1.

Arguments ISignalDO
[ \Single ]

[ \Single ] Signal TriggValue Interrupt
Data type: switch

Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs once at the most. If the argument is omitted, an interrupt will occur each time its condition is satisfied. Signal The name of the signal that is to generate interrupts. Data type: signaldo

System Data Types and Routines

2-ISignalDO-239

ISignalDO
TriggValue

Instructions
Data type: dionum

The value to which the signal must change for an interrupt to occur. The value is specified as 0 or 1 or as a symbolic value (e.g. high/low). The signal is edge-triggered upon changeover to 0 or 1. TriggValue 2 or symbolic value edge can be used for generation of interrupts on both positive flank (0 -> 1) and negative flank (1 -> 0). Interrupt Data type: intnum

The interrupt identity. This should have previously been connected to a trap routine by means of the instruction CONNECT.

Program execution
When the signal assumes the specified value 0 or 1, a call is made to the corresponding trap routine. When this has been executed, program execution continues from where the interrupt occurred. If the signal changes to the specified value before the interrupt is ordered, no interrupt occurs (see Figure 25).
:

1 Signal level 0 Interrupt ordered Interrupt ordered 1 Signal level 0 Interrupt occurs

Interrupt occurs

Figure 25 Interrupts from a digital output signal at signal level 1.

2-ISignalDO-240

System Data Types and Routines

Instructions

ISignalDO

Limitations
The same variable for interrupt identity cannot be used more than once, without first deleting it. Interrupts should therefore be handled as shown in one of the alternatives below. VAR intnum sig1int; PROC main ( ) CONNECT sig1int WITH iroutine1; ISignalDO do1, 1, sig1int; WHILE TRUE DO : : ENDWHILE ENDPROC All activation of interrupts is done at the beginning of the program. These instructions are then kept outside the main flow of the program. PROC main ( ) VAR intnum sig1int; CONNECT sig1int WITH iroutine1; ISignalDO do1, 1, sig1int; : : IDelete sig1int; ENDPROC The interrupt is deleted at the end of the program, and is then reactivated. It should be noted, in this case, that the interrupt is inactive for a short period.

Syntax
ISignalDO [ ’\’ Single’,’] [ Signal ’:=’ ] < variable (VAR) of signaldo > ’,’ [ TriggValue ’:=’ ] < expression (IN) of dionum >’,’ [ Interrupt ’:=’ ] < variable (VAR) of intnum > ’;’

System Data Types and Routines

2-ISignalDO-241

ISignalDO

Instructions

Related information
Described in: Summary of interrupts Interrupt from an input signal More information on interrupt management More examples RAPID Summary - Interrupts Instructions - ISignalDI Basic Characteristics- Interrupts Data Types - intnum

2-ISignalDO-242

System Data Types and Routines

Instructions

ISleep

ISleep

Deactivates an interrupt
ISleep (Interrupt Sleep) is used to deactivate an individual interrupt temporarily. During the deactivation time, any generated interrupts of the specified type are discarded without any trap execution.

Example
ISleep sig1int; The interrupt sig1int is deactivated.

Arguments ISleep
Interrupt The variable (interrupt identity) of the interrupt.

Interrupt
Data type: intnum

Program execution
Any generated interrupts of the specified type are discarded without any trap execution, until the interrupt has been re-activated by means of the instruction IWatch. Interrupts which are generated while ISleep is in effect are ignored.

Example
VAR intnum timeint; CONNECT timeint WITH check_serialch; ITimer 60, timeint; . ISleep timeint; WriteBin ch1, buffer, 30; IWatch timeint; . TRAP check_serialch WriteBin ch1, buffer, 1; IF ReadBin(ch1\Time:=5) < 0 THEN TPWrite “The serial communication is broken”; EXIT; ENDIF

System Data Types and Routines

2-ISleep-243

ISleep
ENDTRAP

Instructions

Communication across the ch1 serial channel is monitored by means of interrupts which are generated every 60 seconds. The trap routine checks whether the communication is working. When, however, communication is in progress, these interrupts are not permitted.

Error handling
Interrupts which have neither been ordered nor enabled are not permitted. If the interrupt number is unknown, the system variable ERRNO will be set to ERR_UNKINO (see “Data types - errnum”). The error can be handled in the error handler.

Syntax
ISleep [ Interrupt ‘:=’ ] < variable (VAR) of intnum > ‘;’

Related information
Described in: Summary of interrupts Enabling an interrupt Disabling all interrupts Cancelling an interrupt RAPID Summary - Interrupts Instructions - IWatch Instructions - IDisable Instructions - IDelete

2-ISleep-244

System Data Types and Routines

Instructions

ITimer

ITimer

Orders a timed interrupt
ITimer (Interrupt Timer) is used to order and enable a timed interrupt. This instruction can be used, for example, to check the status of peripheral equipment once every minute.

Examples
VAR intnum timeint; CONNECT timeint WITH iroutine1; ITimer 60, timeint; Orders an interrupt that is to occur cyclically every 60 seconds. A call is then made to the trap routine iroutine1. ITimer \Single, 60, timeint; Orders an interrupt that is to occur once, after 60 seconds.

Arguments ITimer
[ \Single ]

[ \Single ] Time Interrupt
Data type: switch

Specifies whether the interrupt is to occur once or cyclically. If the argument Single is set, the interrupt occurs only once. If the argument is omitted, an interrupt will occur each time at the specified time. Time Data type: num The amount of time that must lapse before the interrupt occurs. The value is specified in second if Single is set, this time may not be less than 0.05 seconds. The corresponding time for cyclical interrupts is 0.25 seconds. Interrupt Data type: intnum

The variable (interrupt identity) of the interrupt. This should have previously been connected to a trap routine by means of the instruction CONNECT.

System Data Types and Routines

2-ITimer-245

ITimer

Instructions

Program execution
The corresponding trap routine is automatically called at a given time following the interrupt order. When this has been executed, program execution continues from where the interrupt occurred. If the interrupt occurs cyclically, a new computation of time is started from when the interrupt occurs.

Example
VAR intnum timeint; CONNECT timeint WITH check_serialch; ITimer 60, timeint; . TRAP check_serialch WriteBin ch1, buffer, 1; IF ReadBin(ch1\Time:=5) < 0 THEN TPWrite “The serial communication is broken”; EXIT; ENDIF ENDTRAP Communication across the ch1 serial channel is monitored by means of interrupts which are generated every 60 seconds. The trap routine checks whether the communication is working. If it is not, program execution is interrupted and an error message appears.

Limitations
The same variable for interrupt identity cannot be used more than once, without being first deleted. See Instructions - ISignalDI.

Syntax
ITimer [ ’\’Single ’,’] [ Time ’:=’ ] < expression (IN) of num >’,’ [ Interrupt ’:=’ ] < variable (VAR) of intnum > ’;’

2-ITimer-246

System Data Types and Routines

Instructions ITimer Related information Described in: Summary of interrupts More information on interrupt management RAPID Summary .Interrupts Basic Characteristics.Interrupts System Data Types and Routines 2-ITimer-247 .

ITimer Instructions 2-ITimer-248 System Data Types and Routines .

ArcL\On.6667.2.v100. IntAdap. adaptWd.16667. VAR intnum IntAdap..16667..2. ENDTRAP System Data Types and Routines 2-IVarValue-249 .adaptSm. ! Update active welddata PERS variable ‘adaptWd’ with ! new data from the arrays of predefined parameter arrays. wirefeed and speed arrays. for example.*.adaptWd.weld_wirefeed:=adptWfd{ArrInd}.18.8.2. PROC main() ! Setup the interrupt. This instruction can be used.14.z10. ENDPROC TRAP AdapTrap VAR num ArrInd.3333.20. LOCAL PERS num adptSpd{25}:=10.adaptSm.25[. gap_value.23.2.2.. ! Start welding ArcL\On.]..6.2. The trap routine AdapTrp will be called ! when the gap variable with number ‘GAP_VARIABLE_NO’ in ! the sensor interface has been changed.z10. !Request a refresh of AW parameters using the new data i adaptWd ArcRefresh..21. LOCAL CONST num GAP_VARIABLE_NO:=11.6. to get seam volume or gap values from a seam tracker.adaptWv.5.33333.2.4.].8. Examples LOCAL PERS num adtVlt{25}:=[1.16.. LOCAL PERS num adptWfd{25}:=[2. adaptWd. ! The scaled gap value is used as index in the voltage.2.3.3..12. CONNECT IntAdap WITH AdapTrp.2.weld_voltage:=adptVlt{ArrInd}. PERS num gap_value.1.].tool\j\Track:=track.Instructions IVarValue IVarValue Orders a variable value interrupt IVarVal(Interrupt Variable Value) is used to order and enable an interrupt when the value of a variable accessed via the serial sensor interface has been changed.5. IVarValue GAP_VARIABLE_NO.2.adaptWv.1.1. !Scale the raw gap value received ArrInd:=ArrIndx(gap_value).1.3..3..*.33333. adaptWd.4. The new value will be available ! in the PERS gp_value variable.weld_speed:=adptSpd{ArrInd}.v100.adaptWd.tool\j\Track:=track.

without first being deleted. Value Data type: num VarNo Value.Interrupts Basic Characteristics.’ Related information Described in: Summary of interrupts More information on interrupt management RAPID Summary .Interrupts 2-IVarValue-250 System Data Types and Routines . Syntax IVarValue [ VarNo ’:=’ ] < expression (IN) of num >’. program execution continues from where the interrupt occurred. This should have previously been connected to a trap routine by means of the instruction CONNECT.IVarValue Instructions Arguments IVarValue VarNo The number of the variable to be supervised. Program execution The corresponding trap routine is automatically called at a given time following the interrupt order. When this has been executed. Interrupt Data type: num A PERS variable which will hold the new value of Varno. Interrupt Data type: intnum The variable (interrupt identity) of the interrupt. Limitations The same variable for interrupt identity cannot be used more than five times.’ [ Interrupt ’:=’ ] < variable (VAR) of intnum > ’.’ [ Value ’:=’ ] < persistent(PERS) of num >’.

The error can be handled in the error handler. However. ISignalDI di1. are ignored. If the interrupt number is unknown.1. During execution of the weldpart1 routine. Interrupt Data type: intnum Program execution Re-activates interrupts of the specified type once again. no interrupts are permitted from the signal di1. the system variable ERRNO is set to ERR_UNKINO (see “Date types . interrupts generated during the time the ISleep instruction was in effect. The interrupt sig1int that was previously deactivated is activated.sig1int. CONNECT sig1int WITH iroutine1. ISleep sig1int. Example VAR intnum sig1int.errnum”). System Data Types and Routines 2-IWatch-251 . Example IWatch sig1int. weldpart1. Arguments IWatch Interrupt Variable (interrupt identity) of the interrupt. Error handling Interrupts which have not been ordered are not permitted. IWatch sig1int. .Instructions IWatch IWatch Activates an interrupt IWatch (Interrupt Watch) is used to activate an interrupt which was previously ordered but was deactivated with ISleep.

’ Related information Described in: Summary of interrupts Deactivating an interrupt RAPID Summary .ISleep 2-IWatch-252 System Data Types and Routines .Interrupts Instructions .IWatch Instructions Syntax IWatch [ Interrupt ‘:=’ ] < variable (VAR) of intnum > ‘.

any other label within the same routine. Syntax (EBNF) <identifier>’:’ System Data Types and Routines 2-label-253 . this name can then be used to move program execution.Instructions label label Line name Label is used to name a line in the program. Example GOTO next. .any data name within the same routine. Using the GOTO instruction. Arguments Label: Label The name you wish to give the line. next: Program execution continues with the instruction following next. Identifier Program execution Nothing happens when you execute this instruction. A label hides global data and routines with the same name within the routine it is located in. . Limitations The label must not be the same as .

label Instructions Related information Described in: Identifiers Moving program execution to a label Basic CharacteristicsBasic Elements Instructions .GOTO 2-label-254 System Data Types and Routines .

diskhome \File:="PART_A. diskhome is a predefined string constant "HOME:".MOD from the diskhome into the program memory.Instructions Load Load Load a program module during execution Load is used to load a program module into the program memory during execution. Example Load \Dynamic. Load the program module in the dynamic mode. Load the program module PART_A. Otherwise the load is in static mode. Arguments Load [\Dynamic] FilePath [\File] [\Dynamic] Data type: switch The switch enables load of a program module in dynamic mode. A program or system module can be loaded in static (default) or dynamic mode: Static mode Table 1 How different operations affects static loaded program or system modules Set PP to main from TP Program Module System Module Not affected Not affected Open new RAPID program Unloaded Not affected Dynamic mode Table 2 How different operations affects dynamic loaded program or system modules Set PP to main from TP Program Module System Module Unloaded Unloaded Open new RAPID program Unloaded Unloaded Both static and dynamic loaded modules can be unloaded by the instruction UnLoad.MOD". The loaded program module will be added to the already existing modules in the program memory. System Data Types and Routines 2-Load-255 .

when the program is started or the teach pendant function Program/File/ Check is used. Program execution Program execution waits for the program module to finish loading before proceeding with the next instruction. Examples Load \Dynamic. [\File] Data type: string When the file name is excluded in the argument FilePath then it must be defined with this argument.MOD from HOME: at the directory DOORDIR into the program memory. After the program module is loaded it will be linked and initialised. Load \Dynamic. "HOME:/DOORDIR/DOOR1. Loads the program module DOOR1. that is easy to understand and maintain. The file name shall be excluded when the argument \File is used. However.MOD". The initialisation of the loaded module sets all variables at module level to their init values. Same as the two examples above but the module is loaded in the static mode. Unresolved references will be accepted if the system parameter for Tasks is set (BindRef = NO). To obtain a good program structure. "HOME:" \File:="DOORDIR/DOOR1. There will be a run time error on execution of an unresolved reference.Load FilePath Instructions Data type: string The file path and the file name to the file that will be loaded into the program memory. Load "HOME:" \File:="DOORDIR/DOOR1. The program module is loaded in the dynamic mode.MOD". Same as above but another syntax. all loading and unloading of program modules should be done from the main module which is always present in the program memory during execution. 2-Load-256 System Data Types and Routines . no check for unresolved references will be done if the parameter BindRef = NO.MOD".

’ Related information Described in: Unload a program module Load a program module in parallel with another program execution Accept unresolved references Instructions . If the module already is loaded into the program memory then the system variable ERRNO is set to ERR_LOADED (see "Data types .Controller / Tasks / BindRef System Data Types and Routines 2-Load-257 . Avoid using the floppy disk for loading since reading from the floppy drive is very time consuming.errnum").’] [FilePath’:=’]<expression (IN) of string> [’\’File’:=’ <expression (IN) of string>]’. Error handling If the file in the Load instructions cannot be found. The errors above can be handled in an error handler.UnLoad Instructions . Syntax Load [‘\’Dynamic ‘.StartLoad-WaitLoad System Parameters .Instructions Load Limitations Loading a program module that contains a main routine is not allowed. Avoid ongoing robot movements during the loading. then the system variable ERRNO is set to ERR_FILNOTFND.

Load Instructions 2-Load-258 System Data Types and Routines .

The MechUnitLoad instruction should always be executed after execution of the instruction ActUnit. load0. Activate mechanical unit IRBP_L and define the payload workpiece1 corresponding to fixture and work piece named workpiece1 mounted on axis 1.Instructions MechUnitLoad MechUnitLoad Defines a payload for a mechanical unit MechUnitLoad is used to define a payload for an external mechanical unit. MechUnitLoad IRBP_L. workpiece1. ActUnit IRBP_L. fixture1. Activate mechanical unit IRBP_L and define the payload fixture1 corresponding to fixture fixture1 mounted on axis 1. ActUnit IRBP_L. MechUnitLoad IRBP_L. System Data Types and Routines 2-MechUnitLoad-259 . 1. Example IRBP_L axis 1 Figure 26 A mechanical unit named IRBP_L of type IRBP L. MechUnitLoad IRBP_L. ActUnit IRBP_L. 1. Activate mechanical unit IRBP_L and define the payload load0 corresponding to no load (at all) mounted on axis 1. 1. (The payload for the robot is defined with instruction GripLoad) This instruction should be used for all mechanical units with dynamic model in servo to achieve the best motion performance.

Program execution After execution of MechUnitLoad. This means that the payload is controlled and monitored by the control system. the specified load is defined for the specified mechanical unit and axis. X Fixture End-effector coordinate system for the mechanical unit Z Work piece The centre of gravity for the payload (fixture + work piece) Mechanical unit Figure 27 Payload mounted on the end-effector of a mechanical unit. Load Data type: loaddata The load data that describes the current payload to be defined. The defined payload will also survive a restart of the program after manual activation of some other mechanical units from the jogging window.MechUnitLoad Instructions Arguments MechUnitLoad MechUnit AxisNo Load MechUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit. When some other payload is used. for a certain mechanical unit type. the actual payload for the mechanical unit and axis should be redefined with this instruction. The default payload at cold start-up. within the mechanical unit. This should always be done after activation of the mechanical unit. when the robot and external axes have come to a standstill. that holds the load. is the predefined maximal payload for this mechanical unit type. Y 2-MechUnitLoad-260 System Data Types and Routines . The defined payload will survive a power failure restart. AxisNo (Axis Number) Data type: num The axis number.

workpiece2. 2. Defines payload workpiece1 on the mechanical unit IRBP_K axis 2. Limitations The movement instruction previous to this instruction should be terminated with a stop point in order to make a restart in this instruction possible following a power failure. MoveL homeside2.Instructions MechUnitLoad Example IRBP_K axis 2 axis 1 axis 3 Figure 28 A mechanical unit named IRBP_K of type IRBP K with three axes.’ [ Load ’:=’ ] < persistent (PERS) of loaddata > ’. ActUnit IRBP_K. v1000. 3. v1000. fine.’ System Data Types and Routines 2-MechUnitLoad-261 . MechUnitLoad IRBP_K. Defines payload workpiece2 on the mechanical unit IRBP_K axis 3. gun1 The axes of the mechanical unit IRBP_K move to the switch position homeside2 with mounted payload on both axes 2 and 3. MechUnitLoad IRBP_K.. MoveL homeside1. gun1. workpiece1. . The whole mechanical unit IRBP_K is activated.’ [AxisNo ‘:=’ ] <expression (IN) of num ‘. fine. Syntax MechUnitLoad [MechUnit ’:=’ ] < variable (VAR) of mecunit> ’..

mecunit Data Types .MechUnitLoad Instructions Related information Described in: Identification of payload for external mechanical units Mechanical units Definition of load data Definition of payload for the robot LoadID&CollDetect .GripLoad Data Types .tooldata 2-MechUnitLoad-262 System Data Types and Routines .prg Data Types .loaddata Instructions .Program muloadid.

The final position of the robot.for ambiguous positions on the IRB 6400C. during a movement with MoveAbsJ. the robot uses these data to calculating the load. is moved along a non-linear path to a stop point which is stored as an absolute axis position in the instruction (marked with an *). for example. z50. The robot and external axes move to the destination position along a non-linear path. fine. v1000. with velocity data v1000 and zone data z50. the number of movement instructions in succession is limited to 5. v1000\T:=5.g. The argument is used to shorten the cycle time when. The robot with the tool grip3. grip3. MoveAbsJ *.the end point is a singular point . However. All axes reach the destination position at the same time. tool2. System Data Types and Routines 2-MoveAbsJ-263 .Instructions MoveAbsJ MoveAbsJ Moves the robot to an absolute joint position MoveAbsJ (Move Absolute Joint) is used to move the robot to an absolute position. communicating with external equipment. if synchronisation is not required. movement instructions with the argument \Conc are not permitted. The robot with the tool tool2 is moved along a non-linear path to the absolute axis position. This instruction need only be used when: . TCP velocity. Arguments MoveAbsJ [ \Conc ] [ \Conc ] ToJointPos [\NoEOffs] Speed [ \V ] | [ \T ] Zone [ \Z ] [ \Inpos ] Tool [ \WObj ] (Concurrent) Data type: switch Subsequent instructions are executed while the robot is moving. The same tools can be used as in adjacent movement instructions. e. Using the argument \Conc. defined in axes positions. is neither affected by the given tool and work object. and the corner path. for movements with the tool over the robot. nor by active program displacement. In a program section that includes StorePath-RestoPath. Examples MoveAbsJ p50. The entire movement takes 5 s. p50.

The length of the corner path is given in mm. Tool The tool in use during the movement. then the movement with MoveAbsJ is not affected by active offsets for external axes. The position of the TCP and the load on the tool are defined in the tool data. [\Inpos] (In position) Data type: stoppointdata This argument is used to specify the convergence criteria for the position of the robots TCP in the stop point. It is then substituted for the corresponding velocity specified in the speed data. Speed data defines the velocity of the tool centre point. It is then substituted for the corresponding speed data. [ \Z ] (Zone) Data type: num This argument is used to specify the position accuracy of the robot TCP directly in the instruction. the tool reorientation and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). The TCP position is used to decide the velocity and the corner path for the movement. [ \NoEOffs ] (No External Offsets) Data type: switch If the argument NoEOffs is set. Speed Data type: speeddata The speed data that applies to movements. [ \V ] (Velocity) Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. Zone Data type: zonedata Zone data for the movement. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. Data type: tooldata 2-MoveAbsJ-264 System Data Types and Routines . the subsequent instruction is executed some time before the robot has reached the programmed zone. which is substituted for the corresponding zone specified in the zone data.MoveAbsJ Instructions If this argument is omitted and the ToPoint is not a stop point. ToJointPos (To Joint Position) Data type: jointtarget The destination absolute joint position of the robot and external axes. The stop point data substitutes the zone specified in the Zone parameter. Zone data describes the size of the generated corner path.

The tool is moved to the destination absolute joint position with interpolation of the axis angles. The tool. grip3. However. is defined in the work object. if the robot holds the work object. v2000\V:=2200. is moved along a non-linear path to an absolute joint position stored in the instruction. z40 \Z:=45. Without switch \NoEOffs. grip3. program execution only continues when the robot and external axes have reached the appropriate joint position. Generally speaking. It waits at most for 2 seconds for the conditions to be satisfied. or with coordinated external axes. The tool is reoriented and the external axes are moved at the same time as the TCP moves. See predefined data inpos50 of data type stoppointdata. This argument can be omitted if the tool is held by the robot.Instructions [ \WObj] (Work Object) MoveAbsJ Data type: wobjdata The work object used during the movement. The robot considers it to be in the point when 50% of the position condition and 50% of the speed condition for a stop point fine are satisfied. i. the velocity of the TCP will be reduced. v2000. is moved along a non-linear path to an absolute joint position p5. the data used by the system to decide the velocity and the corner path for the movement. The movement is carried out with data set to v2000 and z40. The tool. which results in a non-linear path. Examples MoveAbsJ *. In the case of a stationary tool or coordinated external axes. grip3. fine \Inpos := inpos50. If a stop point is specified in the zone data. System Data Types and Routines 2-MoveAbsJ-265 . then the argument must be specified. or for the external axes. MoveAbsJ p5. Program execution A movement with MoveAbsJ is not affected by active program displacement and if executed with switch \NoEOffs. A corner path is usually generated when movement is transferred to the next section of the path. the tool is stationary. The velocity and zone size of the TCP are 2200 mm/s and 45 mm respectively. cannot be attained. the TCP is moved at approximate programmed velocity. grip3.e. This means that each axis is moved with constant axis velocity and that all axes reach the destination joint position at the same time. there will be no offset for external axes. If the programmed velocity for reorientation. the external axes in the destination target are affected by active offset for external axes.

grip3. v2000.MoveAbsJ MoveAbsJ \Conc. grip3. MoveAbsJ \Conc. Subsequent logical instructions are executed while the robot moves. z40. 2-MoveAbsJ-266 System Data Types and Routines . Limitations In order to be able to run backwards with the instruction MoveAbsJ involved. a check is made that the arguments Tool and \WObj do not contain contradictory data with regard to a movable or a stationary tool respectively. GripLoad obj_mass. v2000. as follows (see Figure 1). The robot moves the work object obj in relation to the fixed tool grip3 along a non-linear path to an absolute axis position start. * \NoEOffs. it is essential that the subsequent instructions fulfil certain requirements. z40. Figure 1 Limitation for backward execution with MoveAbsJ. grip3. Singular point MoveAbsJ MoveJ Ambiguous area MoveAbsJ MoveAbsJ Any Move instr. v2000. grip3 \WObj:= obj. z40. *. is moved along a non-linear path to an absolute joint position stored in the instruction. and avoiding problems with singular points or ambiguous areas. Same movement as above but the movement is not affected by active offsets for external axes. MoveAbsJ start. Error handling When running the program. Instructions The tool.

zonedata Data Types .jointtarget Data Types .Motion Data Types .Instructions MoveAbsJ Syntax MoveAbsJ [ ’\’ Conc ’.stoppointdata Data Types .’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’.’ ] [ ToJointPos ’:=’ ] < expression (IN) of jointtarget > [ ’\’ NoEoffs ] ’.’ Related information Described in: Other positioning instructions Definition of jointtarget Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Motion in general Concurrent program execution RAPID Summary .’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’.speeddata Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Synchronisation Using Logical Instructions System Data Types and Routines 2-MoveAbsJ-267 .tooldata Data Types .’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Z ‘:=’ < expression (IN) of num > ] [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ] ‘.

MoveAbsJ Instructions 2-MoveAbsJ-268 System Data Types and Routines .

MoveC p4. v500. The TCP of the tool. This argument is used to shorten the cycle time when. During the movement. the orientation normally remains unchanged relative to the circle. tool1. z30. fine. the circle point p1 and the destination point p2. for example. grip3. The circle is defined from the start position. Arguments MoveC [ \Conc ] [ \Conc ] CirPoint ToPoint Speed [ \V ] | [ \T ] Zone [ \Z] [ \Inpos ] Tool [ \WObj ] [ \Corr ] (Concurrent) Data type: switch Subsequent instructions are executed at once. v500.Instructions MoveC MoveC Moves the robot circularly MoveC is used to move the tool centre point (TCP) circularly to a given destination. tool1. tool1. p3. The TCP of the tool. A complete circle is performed if the positions are the same as those shown in Figure 2. p2. v500. tool2. tool2. communicating with external equipment. The complete movement takes 5 seconds. grip3. fine. Examples MoveC p1. if synchronisation is not required. fine. p1. *. v500. is moved circularly to a fine point stored in the instruction (marked by the second *). MoveC *. p1 p4 p2 p3 Figure 2 A complete circle is performed by two MoveC instructions. with speed data v500 and zone data z30. z20. v500 \T:=5. is moved circularly to the position p2. MoveL p1. The circle point is also stored in the instruction (marked by the first *). MoveC p2. System Data Types and Routines 2-MoveC-269 .

The length of the corner path is given in mm. movement instructions with the argument \Conc are not permitted. Zone Data type: zonedata Zone data for the movement. Speed data defines the velocity of the TCP. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction). the number of movement instructions in succession is limited to 5. the tool reorientation and external axes. which is substituted for the corresponding zone specified in the zone data. The stop point data substitutes the zone specified in the Zone parameter. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Speed Data type: speeddata The speed data that applies to movements. [ \Z ] (Zone) Data type: num This argument is used to specify the position accuracy of the robot TCP directly in the instruction. it should be placed about halfway between the start and destination points. ToPoint Data type: robtarget The destination point of the robot and external axes. CirPoint Data type: robtarget The circle point of the robot. The position of the external axes are not used. It is then substituted for the corresponding speed data. [\Inpos] (In position) Data type: stoppointdata This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. and the ToPoint is not a Stop point the subsequent instruction is executed some time before the robot has reached the programmed zone. If this argument is omitted. the robot may give a warning. The circle point is a position on the circle between the start point and the destination point. Zone data describes the size of the generated corner path. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot and external axes move. It is then substituted for the corresponding velocity specified in the speed data. [ \V ] (Velocity) Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction.MoveC Instructions Using the argument \Conc. To obtain the best accuracy. In a program section that includes StorePath-RestoPath. 2-MoveC-270 System Data Types and Routines . If it is placed too close to the start or destination point.

CirPoint Tool orientation Start point ToPoint System Data Types and Routines 2-MoveC-271 . . if the orientation relative to the path is the same at the start and the destination points. Program execution The robot and external units are moved to the destination point as follows: . .Instructions Tool MoveC Data type: tooldata The tool in use when the robot moves. the relative orientation remains unchanged during the movement (see Figure 3). a stationary TCP or coordinated external axes are used. . if this argument is present. This argument can be omitted. the position is related to the world coordinate system. this argument must be specified in order for a circle relative to the work object to be executed. and if it is.The reorientation is performed relative to the circular path. on the other hand. Thus. [ \Corr] (Correction) Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. If.The TCP of the tool is moved circularly at constant programmed velocity. [ \WObj] (Work Object) Data type: wobjdata The work object (object coordinate system) to which the robot position in the instruction is related. from the orientation at the start position to the orientation at the destination point.The tool is reoriented at a constant velocity. The tool centre point is the point that is moved to the specified destination point.

grip3.Uncoordinated external axes are executed at constant velocity in order for them to arrive at the destination point at the same time as the robot axes. The TCP of the tool. A corner path is usually generated when movement is transferred to the next section of a path. The movement is carried out with data set to v500 and z40. is moved circularly to a position. The TCP of the tool. is moved circularly to a stop point p6. MoveC p5. fine \Inpos := inpos50. grip3. while the robot is stopped on a circular path. . See predefined data inpos50 of data type stoppointdata. grip3. If a stop point is specified in the zone data. MoveC \Conc. v2000. *. grip3. is moved circularly to a position stored in the instruction. The accuracy of the reorientation along the path depends only on the orientation at the start and destination points. Examples MoveC *. z40. MoveC cir1. is moved circularly to a position stored in the instruction. If it is not possible to attain the programmed velocity for the reorientation or for the external axes.The orientation at the circle point is not critical. The circle point is also stored in the instruction. The TCP of the tool. grip3 \WObj:=fixture. it is only used to distinguish between two possible directions of reorientation.MoveC Figure 3 Tool orientation during circular movement. p15. v500. z40 \Z:=45. the velocity and zone size of the TCP are 550 mm/s and 45 mm respectively. v500 \V:=550. The position in the circle position is not used. the velocity of the TCP will be reduced. Limitations A change of execution mode from forward to backward or vice versa. *. Instructions . z40. v500. via the circle point cir1. p6. 2-MoveC-272 System Data Types and Routines . is not permitted and will result in an error message. The robot considers it to be in the point when 50% of the position condition and 50% of the speed condition for a stop point fine are satisfied. p15. grip3. Subsequent logical instructions are executed while the robot moves. It waits at most for 2 seconds for the conditions to be satisfied. program execution only continues when the robot and external axes have reached the appropriate position. grip3. The TCP of the tool. These positions are specified in the object coordinate system for fixture. grip3. *.

wobjdata Instructions .stoppointdata Data Types .’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’.tooldata Data Types .’ ] [ CirPoint ’:=’ ] < expression (IN) of robtarget > ’. with TCP between the circle point and the end point.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Writes to a corrections entry Motion in general Coordinate systems Concurrent program execution RAPID Summary .speeddata Data Types .Motion Data Types .’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’. Make sure that the robot can reach the circle point during program execution and divide the circle segment if necessary. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared with that programmed).Instructions MoveC The instruction MoveC (or any other instruction including circular movement) should never be started from the beginning.zonedata Data Types .CorrWrite Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles Synchronisation Using Logical Instructions System Data Types and Routines 2-MoveC-273 .’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Z ’:=’ < expression (IN) of num > ] [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ] ‘. Syntax MoveC [ ’\’ Conc ’.

MoveC Instructions 2-MoveC-274 System Data Types and Routines .

do1. tool2. tool2. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction). The circle is defined from the start position. Output do1 is set in the middle of the corner path at p2. If it is placed too close to the start or destination point. To obtain the best accuracy. is moved circularly to the position p2. the circle point p1 and the destination point p2. v500. Speed Data type: speeddata The speed data that applies to movements. ToPoint Data type: robtarget The destination point of the robot and external axes. Examples MoveCDO p1. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot and external axes move. z30. the tool reorientation and external axes. the orientation normally remains unchanged relative to the circle. It is then substituted for the corresponding speed data. p2. The specified digital output is set/reset in the middle of the corner path at the destination point. The circle point is a position on the circle between the start point and the destination point. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). The TCP of the tool. During the movement. System Data Types and Routines 2-MoveCDO-275 . Speed data defines the velocity of the TCP. the robot may give a warning. Arguments MoveCDO CirPoint CirPoint ToPoint Speed [ \T ] Zone Tool [\WObj ] Signal Value Data type: robtarget The circle point of the robot.Instructions MoveCDO MoveCDO Moves the robot circularly and sets digital output in the corner MoveCDO (Move Circular Digital Output) is used to move the tool centre point (TCP) circularly to a given destination. The position of the external axes are not used. it should be placed about halfway between the start and destination points. with speed data v500 and zone data z30.1.

[ \WObj] (Work Object) Data type: wobjdata The work object (object coordinate system) to which the robot position in the instruction is related. Value The desired value of signal (0 or 1). this argument must be specified in order for a circle relative to the work object to be executed. The digital output signal is set/reset in the middle of the corner path for flying points. CirPoint Start point Set/Reset the signal ToPoint Zone Figure 4 Set/Reset of digital output signal in the corner path with MoveCDO. as shown in Figure 4. Signal The name of the digital output signal to be changed. Zone data describes the size of the generated corner path. on the other hand. Data type: dionum Data type: signaldo Program execution See the instruction MoveC for more information about circular movement. The tool centre point is the point that is moved to the specified destination point. we recommend the use of “normal” programming sequence with MoveC + SetDO.MoveCDO Zone Instructions Data type: zonedata Zone data for the movement. But when using stop point in instruction MoveCDO. If. and if it is. 2-MoveCDO-276 System Data Types and Routines . a stationary TCP or coordinated external axes are used. . the position is related to the world coordinate system. Next point For stop points. This argument can be omitted. Tool Data type: tooldata The tool in use when the robot moves. the digital output signal is set/reset when the robot reaches the stop point.

Syntax MoveCDO [ CirPoint ’:=’ ] < expression (IN) of robtarget > ’.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’.’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ [ Zone ’:=’ ] < expression (IN) of zonedata > ’.Instructions MoveCDO The specified I/O signal is set/reset in execution mode continuously and stepwise forward but not in stepwise backward.Motion Data Types . Limitations General limitations according to instruction MoveC.speeddata Data Types .’ [ Value ‘:=’ ] < expression (IN) of dionum > ] ’.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.zonedata Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles .Synchronisation Using Logical Instructions System Data Types and Routines 2-MoveCDO-277 .’ [ Signal ’:=’ ] < variable (VAR) of signaldo>] ‘.tooldata Data Types .’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems Movements with I/O settings RAPID Summary .

MoveCDO Instructions 2-MoveCDO-278 System Data Types and Routines .

Procedure proc1 is executed in the middle of the corner path at p2. Arguments MoveCSync CirPoint CirPoint ToPoint Speed [ \T ] Zone Tool [\WObj ] ProcName Data type: robtarget The circle point of the robot. the robot may give a warning. tool2. Speed Data type: speeddata The speed data that applies to movements. The TCP of the tool. The circle is defined from the start position. p2. with speed data v500 and zone data z30. The circle point is a position on the circle between the start point and the destination point. it should be placed about halfway between the start and destination points. is moved circularly to the position p2. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction).Instructions MoveCSync MoveCSync Moves the robot circularly and executes a RAPID procedure MoveCSync (Move Circular Synchronously) is used to move the tool centre point (TCP) circularly to a given destination. z30. ToPoint Data type: robtarget The destination point of the robot and external axes. System Data Types and Routines 2-MoveCSync-279 . Examples MoveCSync p1. the tool reorientation and external axes. the orientation normally remains unchanged relative to the circle. The position of the external axes are not used. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). To obtain the best accuracy. The specified RAPID procedure is executed at the middle of the corner path in the destination point. During the movement. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot and external axes move. v500. It is then substituted for the corresponding speed data. tool2. Speed data defines the velocity of the TCP. “proc1”. the circle point p1 and the destination point p2. If it is placed too close to the start or destination point.

The specified RAPID procedure is executed when the TCP reaches the middle of the corner path in the destination point of the MoveCSync instruction. my_proc is executed p1 Zone p3 p2 p4 Figure 5 Execution of user-defined RAPID procedure at the middle of the corner path. tool2. This argument can be omitted. Program execution See the instruction MoveC for more information about circular movements. Zone data describes the size of the generated corner path.MoveCSync Zone Instructions Data type: zonedata Zone data for the movement. ProcName (Procedure Name) Data type: string Name of the RAPID procedure to be executed at the middle of the corner path in the destination point. we recommend the use of “normal” programming sequence with MoveC + other RAPID instructions in sequence. the position is related to the world coordinate system. z30. v1000. this argument must be specified. as shown in Figure 5: MoveCSync p2. p3. [ \WObj] (Work Object) Data type: wobjdata The work object (object coordinate system) to which the robot position in the instruction is related. For stop points. 2-MoveCSync-280 System Data Types and Routines . When TCP is here. The tool centre point is the point that is moved to the specified destination point. a stationary TCP or coordinated external axes are used. If. Tool Data type: tooldata The tool in use when the robot moves. on the other hand. “my_proc”. and if it is.

Instruction MoveCSync cannot be used on TRAP level. This error can be avoided if the program is stopped with StopInstr before the mode switch.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’. This error tells the user that the mode switch can result in missed execution of a RAPID procedure in the queue for execution on the path.’ [ Zone ’:=’ ] < expression (IN) of zonedata > ’.’ [ ProcName ‘:=’ ] < expression (IN) of string > ] ’. The specified RAPID procedure cannot be tested with stepwise execution.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ System Data Types and Routines 2-MoveCSync-281 .’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’. Switching execution mode after program stop from continuously or cycle to stepwise forward or backward results in an error.Instructions MoveCSync Execution of the specified RAPID procedure in different execution modes: Execution mode: Continuously or Cycle Forward step Backward step Execution of RAPID procedure: According to this description In the stop point Not at all Limitation General limitations according to instruction MoveC. Syntax MoveCSync [ CirPoint ’:=’ ] < expression (IN) of robtarget > ’.

speeddata Data Types .Motion Data Types .MoveCSync Instructions Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems RAPID Summary .zonedata Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems 2-MoveCSync-282 System Data Types and Routines .tooldata Data Types .

Examples MoveJ p1. grip3. fine. the subsequent instruction is executed some time before the robot has reached the programmed zone. All axes reach the destination position at the same time. for example. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Speed data defines the velocity of the System Data Types and Routines 2-MoveJ-283 . Speed Data type: speeddata The speed data that applies to movements. If this argument is omitted and the ToPoint is not a stop point. vmax \T:=5. if synchronisation is not required. is moved along a non-linear path to the position. grip3. In a program section that includes StorePath-RestoPath. z30. The tool centre point (TCP) of the tool. MoveJ *. is moved along a non-linear path to a stop point stored in the instruction (marked with an *). Arguments MoveJ [ \Conc ] [ \Conc ] ToPoint Speed [ \V ] | [ \T ] Zone [ \Z ] [ \Inpos ] Tool [ \WObj ] (Concurrent) Data type: switch Subsequent instructions are executed while the robot is moving. p1. The TCP of the tool. The entire movement takes 5 seconds. tool2. The argument is used to shorten the cycle time when. communicating with external equipment. movement instructions with the argument \Conc are not permitted. Using the argument \Conc. with speed data vmax and zone data z30. the number of movement instructions in succession is limited to 5. The robot and external axes move to the destination position along a non-linear path.Instructions MoveJ MoveJ Moves the robot by joint movement MoveJ is used to move the robot quickly from one point to another when that movement does not have to be in a straight line. ToPoint Data type: robtarget The destination point of the robot and external axes. tool2. vmax.

[ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. [\Inpos] (In position) Data type: stoppointdata This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. The length of the corner path is given in mm.MoveJ tool centre point. Zone data describes the size of the generated corner path. Zone Data type: zonedata Zone data for the movement. which results in a non-linear path. which is substituted for the corresponding zone specified in the zone data. It is then substituted for the corresponding velocity specified in the speed data. and if it is. the tool reorientation and external axes. the TCP is moved at the approximate programmed velocity (regardless of whether or not the external axes are coordinated). Generally speaking. The tool is reoriented 2-MoveJ-284 System Data Types and Routines . on the other hand. This means that each axis is moved with constant axis velocity and that all axes reach the destination point at the same time. the position is related to the world coordinate system. The stop point data substitutes the zone specified in the Zone parameter. a stationary TCP or coordinated external axes are used. this argument must be specified. Program execution The tool centre point is moved to the destination point with interpolation of the axis angles. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. [ \V ] (Velocity) Instructions Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted. [ \Z ] (Zone) Data type: num This argument is used to specify the position accuracy of the robot TCP directly in the instruction. If. The tool centre point is the point moved to the specified destination point.

program execution only continues when the robot and external axes have reached the appropriate position. See predefined data inpos50 of data type stoppointdata. It waits at most for 2 seconds for the conditions to be satisfied. *. grip3. grip3. z40. This position is specified in the object coordinate system for fixture. MoveJ p5. v2000.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’. The TCP of the tool. z40 \Z:=45. start. is moved along a non-linear path to a position. The TCP of the tool. v2000. grip3. grip3. The movement is carried out with data set to v2000 and z40. The TCP of the tool.’ System Data Types and Routines 2-MoveJ-285 . is moved along a non-linear path to a position stored in the instruction. The TCP of the tool. If a stop point is specified in the zone data.’ ] [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’. Subsequent logical instructions are executed while the robot moves. the velocity of the TCP will be reduced. v2000. If the programmed velocity for reorientation. A corner path is usually generated when movement is transferred to the next section of the path. MoveJ start. z40. MoveJ \Conc.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’. is moved along a non-linear path to a position stored in the instruction. grip3 \WObj:=fixture. grip3. the velocity and zone size of the TCP are 2200 mm/s and 45 mm respectively. Examples MoveJ *.Instructions MoveJ and the external axes are moved at the same time as the TCP moves.’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Z ‘:=’ < expression (IN) of num > ] [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ] ‘. cannot be attained. or for the external axes. grip3. The robot considers it to be in the point when 50% of the position condition and 50% of the speed condition for a stop point fine are satisfied. Syntax MoveJ [ ’\’ Conc ’. is moved a non-linear path to a stop point p5. grip3. fine \Inpos := inpos50. v2000\V:=2200.

MoveJ Instructions Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Motion in general Coordinate systems Concurrent program execution RAPID Summary .Motion Data Types .zonedata Data Types .speeddata Data Types .stoppointdata Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles Synchronisation Using Logical Instructions 2-MoveJ-286 System Data Types and Routines .tooldata Data Types .

Zone Data type: zonedata Zone data for the movement. It is then substituted for the corresponding speed data. The specified digital output signal is set/reset at the middle of the corner path. vmax. Speed Data type: speeddata The speed data that applies to movements. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Output do1 is set in the middle of the corner path at p1. tool2. is moved along a non-linear path to the position. tool2. The tool centre point is the point moved to the specified destination point. Tool Data type: tooldata The tool in use when the robot moves. System Data Types and Routines 2-MoveJDO-287 . z30.Instructions MoveJDO MoveJDO Moves the robot by joint movement and sets digital output in the corner MoveJDO (Move Joint Digital Output) is used to move the robot quickly from one point to another when that movement does not have to be in a straight line. with speed data vmax and zone data z30. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. All axes reach the destination position at the same time. the tool reorientation and external axes. The tool centre point (TCP) of the tool. The robot and external axes move to the destination position along a non-linear path. 1. p1. Speed data defines the velocity of the tool centre point. Zone data describes the size of the generated corner path. do1. Examples MoveJDO p1. Arguments MoveJDO ToPoint Speed [ \T ] Zone Tool [ \WObj ] Signal Value ToPoint Data type: robtarget The destination point of the robot and external axes.

this argument must be specified. The digital output signal is set/reset in the middle of the corner path for flying points. For stop points. the position is related to the world coordinate system. as shown in Figure 6. do1. Value The desired value of signal (0 or 1). v1000. and if it is. we recommend the use of “normal” programming sequence with MoveJ + SetDO. The specified I/O signal is set/reset in execution mode continuously and stepwise forward but not in stepwise backward. If. Data type: dionum Data type: signaldo Program execution See the instruction MoveJ for more information about joint movement. This argument can be omitted. p1 p2 Zone Figure 6 Set/Reset of digital output signal in the corner path with MoveJDO. a stationary TCP or coordinated external axes are used. the digital output signal is set/reset when the robot reaches the stop point. on the other hand. Signal The name of the digital output signal to be changed. p3 Sets the signal do1 to 1 MoveJDO p2. 1.MoveJDO [ \WObj] (Work Object) Instructions Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. But when using stop point in instruction MoveJDO. 2-MoveJDO-288 System Data Types and Routines . z30. tool2.

Synchronisation Using Logical Instructions System Data Types and Routines 2-MoveJDO-289 .zonedata Data Types .’ [ Signal ’:=’ ] < variable (VAR) of signaldo>] ‘.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ [ Value ‘:=’ ] < expression (IN) of dionum > ] ’.’ MoveJDO Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems Movements with I/O settings RAPID Summary .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles .’ [ Zone ’:=’ ] < expression (IN) of zonedata > ’.Instructions Syntax MoveJDO [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’.speeddata Data Types .Motion Data Types .tooldata Data Types .

MoveJDO Instructions 2-MoveJDO-290 System Data Types and Routines .

tool2. Speed Data type: speeddata The speed data that applies to movements. Examples MoveJSync p1. The tool centre point (TCP) of the tool. System Data Types and Routines 2-MoveJSync-291 . p1. The robot and external axes move to the destination position along a non-linear path. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Arguments MoveJSync ToPoint ToPoint Speed [ \T ] Zone Tool [ \WObj ] ProcName Data type: robtarget The destination point of the robot and external axes. Procedure proc1 is executed in the middle of the corner path at p1. vmax. the tool reorientation and external axes. The specified RAPID procedure is executed at the middle of the corner path in the destination point. is moved along a non-linear path to the position. tool2. Tool Data type: tooldata The tool in use when the robot moves. Speed data defines the velocity of the tool centre point. “proc1”. Zone Data type: zonedata Zone data for the movement. Zone data describes the size of the generated corner path. z30. with speed data vmax and zone data z30. It is then substituted for the corresponding speed data. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves.Instructions MoveJSync MoveJSync Moves the robot by joint movement and executes a RAPID procedure MoveJSync (Move Joint Synchronously) is used to move the robot quickly from one point to another when that movement does not have to be in a straight line. All axes reach the destination position at the same time. The tool centre point is the point moved to the specified destination point.

the position is related to the world coordinate system. z30. For stop points. on the other hand. “my_proc”. 2-MoveJSync-292 System Data Types and Routines . v1000. a stationary TCP or coordinated external axes are used.MoveJSync [ \WObj] (Work Object) Instructions Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. tool2. and if it is. my_proc is executed Zone p2 p1 Figure 7 Execution of user-defined RAPID procedure in the middle of the corner path. Program execution See the instruction MoveJ for more information about joint movements. ProcName (Procedure Name) Data type: string Name of the RAPID procedure to be executed at the middle of the corner path in the destination point. If. as shown in Figure 7: MoveJSync p2. This argument can be omitted. we recommend the use of “normal” programming sequence with MoveJ + other RAPID instructions in sequence. p3 When TCP is here. this argument must be specified. The specified RAPID procedure is executed when the TCP reaches the middle of the corner path in the destination point of the MoveJSync instruction.

’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ [ Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Z ‘:=’ < expression (IN) of num > ] ’. This error can be avoided if the program is stopped with StopInstr before the mode switch. Instruction MoveJSync cannot be used on TRAP level.zonedata Data Types .’ [ ProcName‘:=’ ] < expression (IN) of string > ] ’.tooldata Data Types .Instructions MoveJSync Execution of the specified RAPID procedure in different execution modes: Execution mode: Continuously or Cycle Forward step Backward step Execution of RAPID procedure: According to this description In the stop point Not at all Limitation Switching execution mode after program stop from continuously or cycle to stepwise forward or backward results in an error.Motion Data Types . The specified RAPID procedure cannot be tested with stepwise execution.speeddata Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems System Data Types and Routines 2-MoveJSync-293 .’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems RAPID Summary . Syntax MoveJSync [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’. This error tells the user that the mode switch can result in missed execution of a RAPID procedure in the queue for execution on the path.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’.

MoveJSync Instructions 2-MoveJSync-294 System Data Types and Routines .

System Data Types and Routines 2-MoveL-295 . with speed data v1000 and zone data z30. Arguments MoveL [ \Conc ] [ \Conc ] ToPoint Speed [ \V ] | [ \T ] Zone [ \Z ] [ \Inpos ] Tool [ \WObj ] [ \Corr ] (Concurrent) Data type: switch Subsequent instructions are executed at once. ToPoint Data type: robtarget The destination point of the robot and external axes. Speed data defines the velocity for the tool centre point. Using the argument \Conc. When the TCP is to remain stationary. this instruction can also be used to reorientate the tool. is moved linearly to a fine point stored in the instruction (marked with an *). Speed Data type: speeddata The speed data that applies to movements. MoveL *. The complete movement takes 5 seconds. In a program section that includes StorePath-RestoPath. is moved linearly to the position p1. communicating with external equipment. tool2. grip3. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). movement instructions with the argument \Conc are not permitted. v1000\T:=5. Example MoveL p1. fine.Instructions MoveL MoveL Moves the robot linearly MoveL is used to move the tool centre point (TCP) linearly to a given destination. This argument is used to shorten the cycle time when. grip3. the tool reorientation and external axes. the subsequent instruction is executed some time before the robot has reached the programmed zone. the number of movement instructions in succession is limited to 5. for example. if synchronisation is not required. The TCP of the tool. The TCP of the tool. z30. v1000. tool2. If this argument is omitted and the ToPoint is not a stop point.

[\Inpos] (In position) Data type: stoppointdata This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. This argument can be omitted. which is substituted for the corresponding zone specified in the zone data. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. Zone data describes the size of the generated corner path. If. Tool Data type: tooldata The tool in use when the robot moves. if this argument is present. on the other hand. The stop point data substitutes the zone specified in the Zone parameter. this argument must be specified in order to perform a linear movement relative to the work object. [ \Corr] (Correction) Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. It is then substituted for the corresponding velocity specified in the speed data. It is then substituted for the corresponding speed data.MoveL [ \V ] (Velocity) Instructions Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. 2-MoveL-296 System Data Types and Routines . The tool centre point is the point moved to the specified destination position. a stationary tool or coordinated external axes are used. The length of the corner path is given in mm. [ \Z ] (Zone) Data type: num This argument is used to specify the position accuracy of the robot TCP directly in the instruction. the position is related to the world coordinate system. Zone Data type: zonedata Zone data for the movement. and if it is.

See predefined data inpos50 of data type stoppointdata. The TCP of the tool. grip3 \WObj:=fixture. . is moved linearly to a stop point p5. Examples MoveL *. Subsequent logical instructions are executed while the robot moves. . The robot considers it to be in the point when 50% of the position condition and 50% of the speed condition for a stop point fine are satisfied. grip3. v2000. The movement is carried out with data set to v2000 and z40. v2000.Instructions MoveL Program execution The robot and external units are moved to the destination position as follows: . v2000 \V:=2200. grip3. The TCP of the tool. z40. grip3. This position is specified in the object coordinate system for fixture. If a stop point is specified in the zone data. grip3.Uncoordinated external axes are executed at a constant velocity in order for them to arrive at the destination point at the same time as the robot axes. It waits at most for 2 seconds for the conditions to be satisfied. *. z40. System Data Types and Routines 2-MoveL-297 .The TCP of the tool is moved linearly at constant programmed velocity.The tool is reoriented at equal intervals along the path. grip3. z40 \Z:=45. is moved linearly to a position stored in the instruction. If it is not possible to attain the programmed velocity for the reorientation or for the external axes. start. is moved linearly to a position. program execution only continues when the robot and external axes have reached the appropriate position. The velocity and zone size of the TCP are 2200 mm/s and 45 mm respectively. MoveL p5. The TCP of the tool. is moved linearly to a position stored in the instruction. MoveL \Conc. A corner path is usually generated when movement is transferred to the next section of a path. grip3. fine \Inpos := inpos50. grip3. v2000. The TCP of the tool. MoveL start. the velocity of the TCP will be reduced.

’ ] [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’.tooldata Data Types .CorrWrite Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles Synchronisation Using Logical Instructions 2-MoveL-298 System Data Types and Routines .zonedata Data Types .Motion Data Types .MoveL Instructions Syntax MoveL [ ’\’ Conc ’.stoppointdata Data Types .’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Writes to a corrections entry Motion in general Coordinate systems Concurrent program execution RAPID Summary .wobjdata Instructions .’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Z ’:=’ < expression (IN) of num > ] [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ] ‘.speeddata Data Types .

The tool centre point is the point moved to the specified destination position. tool2. Output do1 is set in the middle of the corner path at p1. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. z30. Speed Data type: speeddata The speed data that applies to movements. When the TCP is to remain stationary. System Data Types and Routines 2-MoveLDO-299 . Tool Data type: tooldata The tool in use when the robot moves. do1. Zone data describes the size of the generated corner path. The specified digital output signal is set/reset at the middle of the corner path. Arguments MoveLDO ToPoint Speed [ \T ] Zone Tool [ \WObj ] Signal Value ToPoint Data type: robtarget The destination point of the robot and external axes. tool2. the tool reorientation and external axes. Speed data defines the velocity for the tool centre point.Instructions MoveLDO MoveLDO Moves the robot linearly and sets digital output in the corner MoveLDO (Move Linearly Digital Output) is used to move the tool centre point (TCP) linearly to a given destination. with speed data v1000 and zone data z30. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction).1. is moved linearly to the position p1. The TCP of the tool. Zone Data type: zonedata Zone data for the movement. v1000. this instruction can also be used to reorient the tool. Example MoveLDO p1.

z30. v1000. as shown in Figure 8. the position is related to the world coordinate system. The specified I/O signal is set/reset in execution mode continuously and stepwise forward but not in stepwise backward. 2-MoveLDO-300 System Data Types and Routines .MoveLDO [ \WObj] (Work Object) Instructions Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. p3 Sets the signal do1 to 1 MoveLDO p2. 1. The digital output signal is set/reset in the middle of the corner path for flying points. If. This argument can be omitted. p1 p2 Zone Figure 8 Set/Reset of digital output signal in the corner path with MoveLDO. Data type: dionum Data type: signaldo Program execution See the instruction MoveL for more information about linear movements. and if it is. the digital output signal is set/reset when the robot reaches the stop point. But when using stop point in instruction MoveLDO. tool2. Signal The name of the digital output signal to be changed. do1. we recommend the use of “normal” programming sequence with MoveL + SetDO. Value The desired value of signal (0 or 1). For stop points. on the other hand. this argument must be specified. a stationary TCP or coordinated external axes are used.

’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems Movements with I/O settings RAPID Summary .Motion Data Types .wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems Motion and I/O Principles .’ [ Signal ’:=’ ] < variable (VAR) of signaldo>] ‘.Synchronisation Using Logical Instructions System Data Types and Routines 2-MoveLDO-301 .’ [ Zone ’:=’ ] < expression (IN) of zonedata > ’.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.tooldata Data Types .Instructions MoveLDO Syntax MoveLDO [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.zonedata Data Types .’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’.’ [ Value ‘:=’ ] < expression (IN) of dionum > ] ’.speeddata Data Types .

MoveLDO Instructions 2-MoveLDO-302 System Data Types and Routines .

Zone data describes the size of the generated corner path. When the TCP is to remain stationary. v1000. Speed data defines the velocity for the tool centre point.Instructions MoveLSync MoveL Sync Moves the robot linearly and executes a RAPID procedure MoveLSync (Move Linearly Synchronously) is used to move the tool centre point (TCP) linearly to a given destination. with speed data v1000 and zone data z30.The specified RAPID procedure is executed at the middle of the corner path in the destination point. this instruction can also be used to reorient the tool. the tool reorientation and external axes. is moved linearly to the position p1. Zone Data type: zonedata Zone data for the movement. tool2. Tool Data type: tooldata The tool in use when the robot moves. System Data Types and Routines 2-MoveLSync-303 . It is then substituted for the corresponding speed data. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). “proc1”. Arguments MoveLSync ToPoint Speed [ \T ] Zone Tool [ \WObj ] ProcName ToPoint Data type: robtarget The destination point of the robot and external axes. The TCP of the tool. tool2. The tool centre point is the point moved to the specified destination position. Example MoveLSync p1. Procedure proc1 is executed in the middle of the corner path at p1. Speed Data type: speeddata The speed data that applies to movements. z30.

this argument must be specified. my_proc is executed Zone p2 p1 Figure 9 Execution of user-defined RAPID procedure in the middle of the corner path. “my_proc”.MoveLSync [ \WObj] (Work Object) Instructions Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. z30. and if it is. For stop points. a stationary TCP or coordinated external axes are used. 2-MoveLSync-304 System Data Types and Routines . Program execution See the instruction MoveL for more information about linear movements. The specified RAPID procedure is executed when the TCP reaches the middle of the corner path in the destination point of the MoveLSync instruction. If. the position is related to the world coordinate system. on the other hand. ProcName (Procedure Name) Data type: string Name of the RAPID procedure to be executed at the middle of the corner path in the destination point. tool2. This argument can be omitted. p3 When TCP is here. we recommend the use of “normal” programming sequence with MoveL + other RAPID instructions in sequence. v1000. as shown in Figure 9: MoveLSync p2.

’ [ ProcName‘:=’ ] < expression (IN) of string > ] ‘. The specified RAPID procedure cannot be tested with stepwise execution.Instructions MoveLSync Execution of the specified RAPID procedure in different execution modes: Execution mode: Continuously or Cycle Forward step Backward step Execution of RAPID procedure: According to this description In the stop point Not at all Limitation Switching execution mode after program stop from continuously or cycle to stepwise forward or backward results in an error.Motion Data Types . Instruction MoveLSync cannot be used on TRAP level.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’. This error tells the user that the mode switch can result in missed execution of a RAPID procedure in the queue for execution on the path. Syntax MoveLSync [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ Related information Described in: Other positioning instructions Definition of velocity Definition of zone data Definition of tools Definition of work objects Motion in general Coordinate systems RAPID Summary . This error can be avoided if the program is stopped with StopInstr before the mode switch.wobjdata Motion and I/O Principles Motion and I/O Principles Coordinate Systems System Data Types and Routines 2-MoveLSync-305 .’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.zonedata Data Types .tooldata Data Types .’ [ Zone ’:=’ ] < expression (IN) of zonedata > ’.speeddata Data Types .

MoveLSync Instructions 2-MoveLSync-306 System Data Types and Routines .

The file LOGFILE1.g. “HOME:/LOGDIR/LOGFILE.DOC".. defined when booting the system 2) User defined serial channel name. Arguments Open Object Object [\File] IODevice [\Read] | [\Write] | [\Append] [\Bin] Data type: string The I/O object (I/O device) that is to be opened. e. "flp1:"(option).. "LOGFILE1. "HOME:". logfile \Write. IODevice Data type: iodev A reference to the file or serial channel to open.Instructions Open Open Opens a file or serial channel Open is used to open a file or serial channel for reading or writing.g.DOC" The complete path can also be specified in the argument Object.DOC" or "LOGDIR/LOGFILE1.DOC in unit HOME:. "TEMP:". This reference is then used for reading from and writing to the file or serial channel. The reference name logfile is used later in the program when writing to the file. . defined in system parameters [\File] Data type: string The name of the file to be opened. Open "HOME:" \File:= "LOGFILE1. Example VAR iodev logfile.DOC". e. System Data Types and Routines 2-Open-307 . or “sio1:” Table 1 Different I/O device in the system I/O device name "HOME:" "TEMP:" "flp1:" "sio1:" 2) Full file path "/hd0a:/xxxx/" 1) "/hd0a:/temp/" "flp1:" Type of I/O device Flashdisk Flashdisk Floppy disk Serial channel 1) ”xxxx” means the system name. is opened for writing.

If the selected file already exists.. Open "sio1:".Open [\Read] Instructions Data type: switch Opens a file or serial channel for reading. \Write or \Append are specified. "This is a message to the printer\0D". Anything subsequently written is written at the start of the file. If none of the arguments \Read. 2-Open-308 System Data Types and Routines . \Write. printer \Bin. Open a file or serial channel with \Append and \Bin arguments. anything subsequently written is written at the end of the file. with the file pointer at the end of the file The set of instructions to access a binary file or serial channel is different from the set of instructions to access a character-based file. Open a file or serial channel with \Append and without the \Bin arguments. If none of these are specified. If the selected file already exists. Close printer. the instruction acts in the same way as the \Write argument for character-based files or a serial channel (instruction without \Bin argument) and in the same way as the \Append argument for binary files or a serial channel (instruction with \Bin argument). The instruction opens a character-based file or serial channel for writing. WriteStrBin printer. . Example VAR iodev printer. [\Bin] Data type: switch The file or serial channel is opened in a binary mode. When reading from a file. The instruction opens a binary file or serial channel for both reading and writing. The arguments \Read. \Append are mutually exclusive. its contents are deleted. [\Append] Data type: switch Opens a file or serial channel for writing. The reference name printer is used later when writing to and closing the serial channel.. the reading is started from the beginning of the file. [\Write] Data type: switch Opens a file or serial channel for writing. The serial channel sio1: is opened for binary reading and writing. the instruction opens a binary file or serial channel for both reading and writing.

Error handling If a file cannot be opened.’ [IODevice ’:=’] <variable (VAR) of iodev> [’\’Read] | [’\’Write] | [’\’Append] [’\’Bin] ’.g.Communication System Data Types and Routines 2-Open-309 . this file must be closed prior to issuing a new Open instruction with the same iodev variable. but each invocation of the Open instruction will return a different reference to the file (data type iodev). the system variable ERRNO is set to ERR_FILEOPEN.’ Related information Described in: Writing to and reading from files or serial channel RAPID Summary . it is possible to have one write pointer and one different read pointer to the same file at the same time. If it has been used previously to open a file. It is possible to open the same physical file several times at the same time.Instructions Open Program execution The specified file or serial channel is opened so that it is possible to read from or write to it. This error can then be handled in the error handler. E. The iodev variable used when opening a file or serial channel must be free from use. Syntax Open [Object ’:=’] <expression (IN) of string> [’\’File’:=’ <expression (IN) of string>] ’.

Open Instructions 2-Open-310 System Data Types and Routines .

Small circles or combined small movements with direction changes can decrease the path performance quality and increase the cycle time. With the robot at a stop point. Decrease the parameter PathSampleTime. Decrease the parameter PathSampleTime.Instructions PathResol PathResol Override path resolution PathResol (Path Resolution) is used to override the configured geometric path sample time defined in the system parameters for the manipulator.tool1. Example MoveJ p1. Gluing with large reorientations and small corner zones can cause speed variations. Low performance external axes may cause CPU load problems during coordination. The path accuracy is improved and the cycle time is often reduced when the parameter PathSampleTime is decreased. A value for parameter PathSampleTime which is too low. use of the standard configured path resolution (PathSampleTime 100%) will avoid CPU load problems and provide sufficient path accuracy in most situations.fine. Increase the parameter PathSampleTime. Increase the parameter PathSampleTime.v1000. Arc-welding with high frequency weaving may require high resolution of the interpolated path. high speed. combined joint motions close to the border of the work area) may cause CPU load problems. Decrease the parameter PathSampleTime. the path sample time is increased to 150% of the configured. Description The path resolution affects the accuracy of the interpolated path and the program cycle time. System Data Types and Routines 2-PathResol-311 . may however cause CPU load problems in some demanding applications. However. Example of PathResol usage: Dynamically critical movements (max payload. PathResol 150.

when starting program execution from the beginning. When there is a corner path in the program. Limitations The robot must be standing still at a stop point before overriding the path sample time.’ 2-PathResol-312 System Data Types and Routines . 100% corresponds to the configured path sample time. the system will instead create a stop point (warning 50146) and it is not possible to restart in this instruction following a power failure. The current override of path sample time can be read from the variable C_MOTSET (data type motsetdata) in the component pathresol.at a cold start-up .PathResol Instructions Arguments PathResol PathSampleTime PathSampleTime Data type: num Override as a percent of the configured path sample time. Program execution The path resolutions of all subsequent positioning instructions are affected until a new PathResol instruction is executed. Within the range 25-400%. The default value for override of path sample time is 100%. This will affect the path resolution during all program execution of movements (default path level and path level after StorePath) and also during jogging. Syntax PathResol [PathSampleTime ’:=’ ] < expression (IN) of num> ’. A lower value of the parameter PathSampleTime improves the path resolution (path accuracy). This value is automatically set .when a new program is loaded .

Movements RAPID Summary .Instructions PathResol Related information Described in: Positioning instructions Motion settings Configuration of path resolution Motion and I/O Principles.Motion Settings System Parameters CPU Optimization System Data Types and Routines 2-PathResol-313 .

PathResol Instructions 2-PathResol-314 System Data Types and Routines .

MoveL p10. but not to p40. tool1. Examples PDispOff.PDispSet System Data Types and Routines 2-PDispOff-315 . MoveL p40. PDispOff.Instructions PDispOff PDispOff Deactivates program displacement PDispOff (Program Displacement Off) is used to deactivate a program displacement. This displacement affects the movement to p20 and p30. tool1. Program execution Active program displacement is reset.’ Related information Described in: Definition of program displacement using two positions Definition of program displacement using values Instructions . p11. MoveL p20. z10. PDispOn \ExeP:=p10. v500. z10. tool1. This means that the program displacement coordinate system is the same as the object coordinate system. v500.PDispOn Instructions . Deactivation of a program displacement. MoveL p30. Program displacement is activated by the instruction PDispSet or PDispOn and applies to all movements until some other program displacement is activated or until program displacement is deactivated. and thus all programmed positions will be related to the latter. v500. z10. tool1. tool1. Syntax PDispOff ‘. v500. A program displacement is defined as the difference between the positions p10 and p11. z10.

PDispOff Instructions 2-PDispOff-316 System Data Types and Routines .

p20. tool1. v500. Since a stop point that is accurately defined has been used in the previous instruction. This is calculated based on the difference between positions p10 and p20. PDispOn \Rot \ExeP:=p10. [\ExeP ] (Executed Point) Data type: robtarget The robot’s new position at the time of the program execution. ProgPoint (Programmed Point) Data type: robtarget The robot’s original position at the time of programming. Activation of a program displacement including a rotation. MoveL p10. Activation of a program displacement (parallel movement). the robot’s current position at the time of the program execution is used. If this argument is omitted. tool1. PDispOn *. v500. This is calculated based on the difference between positions p10 and p20. Arguments PDispOn [ \Rot ] [ \ExeP ] ProgPoint Tool [ \WObj ] [\Rot ] (Rotation) Data type: switch The difference in the tool orientation is taken into consideration and this involves a rotation of the program. tool1. Examples MoveL p10. or when similar motion patterns are repeated at several different places in the program. the argument \ExeP does not have to be used. z10. tool1. after a search has been carried out. p20.Instructions PDispOn PDispOn Activates program displacement PDispOn (Program Displacement On) is used to define and activate a program displacement using two robot positions. fine \Inpos := inpos50. for example. Activation of a program displacement (parallel movement). System Data Types and Routines 2-PDispOn-317 . tool1. PDispOn \ExeP:=p10. Program displacement is used. The displacement is calculated on the basis of the difference between the robot’s actual position and the programmed point (*) stored in the instruction.

Since all positions are related to the ProgDisp coordinate system. can be programmed one after the other and. Program execution Program displacement means that the ProgDisp coordinate system is translated in relation to the object coordinate system.e. the different program displacements will be added. ProgPoint x Program displacement Program Displacement Coordinate System (ProgDisp) x Object Coordinate System Figure 10 Displacement of a programmed position using program displacement.PDispOn Tool Instructions Data type: tooldata The tool used during programming. if a stationary TCP or coordinated external axes are used. the current position of the robot at the time of the program execution is used instead. If ExeP has not been specified. Only one program displacement can be active at any one time. The arguments Tool and \WObj are used both to calculate the ProgPoint during programming and to calculate the current position during program execution if no ExeP argument is programmed. all programmed positions will also be displaced. Program displacement is activated when the instruction PDispOn is executed and remains active until some other program displacement is activated (the instruction PDispSet or PDispOn) or until program displacement is deactivated (the instruction PDispOff). i. If the argument \Rot is used. See Figure 10. in this case. on the other hand. Several PDispOn instructions. However. the robot should not move when PDispOn is executed. Program displacement is calculated as the difference between ExeP and ProgPoint. ExeP y Original position. this argument must be specified. Since it is the actual position of the robot that is used. the TCP to which the ProgPoint position is related. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the ProgPoint position is related. the position is related to the world coordinate system. if it is. y New position. the rotation is also calculated based on the tool orientation 2-PDispOn-318 System Data Types and Routines . This argument can be omitted and.

fine \Inpos := inpos50. ProgDisp. p20 and p30. draw_square. The program displacement is automatically reset . z10. The routine draw_square is used to execute the same motion pattern at three different positions. z10.when a new program is loaded . ENDPROC . v500. draw_square. MoveL *. tool1. tool1. draw_square. ExeP New orientation y y Original position. MoveL p10. MoveL p30. v500. v500. fine \Inpos := inpos50. tool1. MoveL *. fine \Inpos := inpos50. z10.Instructions PDispOn at the two positions. v500.at a cold start-up . System Data Types and Routines 2-PDispOn-319 . The displacement will be calculated in such a way that the new position (ExeP) will have the same position and orientation in relation to the displaced coordinate system. tool1. based on the positions p10. MoveL *. Example PROC draw_square() PDispOn *. See Figure 12. tool1. MoveL p20. MoveL *. tool1. ProgPoint Original orientation Program displacement x Program Displacement Coordinate System (ProgDisp) x Object Coordinate System Figure 11 Translation and rotation of a programmed position. as the old position (ProgPoint) had in relation to the original coordinate system (see Figure 11). tool1. v500. New position.when starting program executing from the beginning. v500. z10. v500. tool1. PDispOff.

motion patterns can be reused. v100. All positions are based on the fixture1 object coordinate system.’ Related information Described in: Deactivation of program displacement Definition of program displacement using values Coordinate systems Definition of tools Definition of work objects More examples Instructions . p10. PDispOn \ExeP:=psearch. Any movement carried out after this starts from this position using a program displacement (parallel movement). *.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata> [ ‘\’WObj ’:=’ < persistent (PERS) of wobjdata> ] ‘. A search is carried out in which the robot’s searched position is stored in the position psearch.PDispOn Instructions p10 p30 p20 Figure 12 Using program displacement. tool1\WObj:=fixture1. The latter is calculated based on the difference between the searched position and the programmed point (*) stored in the instruction. psearch.PDispSet Motion Principles . SearchL sen1. Syntax PDispOn [ [ ’\’ Rot ] [ ’\’ ExeP ’:=’ < expression (IN) of robtarget >] ’.Coordinate Systems Data Types .tooldata Data Types .PDispOff Instructions .’] [ ProgPoint ’:=’ ] < expression (IN) of robtarget > ’.PDispOff 2-PDispOn-320 System Data Types and Routines . tool1 \WObj:=fixture1.wobjdata Instructions .

0. all positions will be displaced 100 mm in the direction of the x-axis. meaning that: . System Data Types and Routines 2-PDispSet-321 . PDispSet xp100.The ProgDisp coordinate system is displaced 100 mm from the object coordinate system. 0. Program displacement is used. 0].As long as this program displacement is active. Object ProgDisp 100 X Figure 13 A 100 mm-program displacement along the x-axis. all programmed positions will also be displaced. Arguments PDispSet DispFrame DispFrame (Displacement Frame) Datatyp: pose The program displacement is defined as data of the type pose. 0] ]. . in the direction of the positive x-axis (see Figure 13).Instructions PDispSet PDispSet Activates program displacement using a value PDispSet (Program Displacement Set) is used to define and activate a program displacement using values. Activation of the xp100 program displacement. [1. 0. . Since all positions are related to the ProgDisp coordinate system. Example VAR pose xp100 := [ [100. See Figure 14. for example. Program execution Program displacement involves translating and/or rotating the ProgDisp coordinate system relative to the object coordinate system. when similar motion patterns are repeated at several different places in the program.

PDispSet . Program displacement is activated when the instruction PDispSet is executed and remains active until some other program displacement is activated (the instruction PDispSet or PDispOn) or until program displacement is deactivated (the instruction PDispOff). The program displacement is automatically reset . Instructions y y Original position Original orientation Program displacement New position New orientation x Program Displacement Coordinate System (ProgDisp) x Object Coordinate System Figure 14 Translation and rotation of a programmed position.PDispOn Data Types .Coordinate Systems Instructions .at a cold start-up . Only one program displacement can be active at any one time. Syntax PDispSet [ DispFrame ’:=’ ] < expression (IN) of pose> ’. Program displacements cannot be added to one another using PDispSet.PDispOff Instructions .when a new program is loaded .pose Motion Principles.when starting program executing from the beginning.PDispOn 2-PDispSet-322 System Data Types and Routines .’ Related information Described in: Deactivation of program displacement Definition of program displacement using two positions Definition of data of the type pose Coordinate systems Examples of how program displacement can be used Instructions .

A pulse of length 1.2 s. ! At almost the same time in program task BCK1 PulseDO \High.2 s is generated on the output signal do15. Examples PulseDO do15. Signal Data type: signaldo The name of the signal on which a pulse is to be generated.2 second pulse is generated. A pulse with a pulse length of 0. independently of its current state. If the argument is omitted. do3. Arguments PulseDO [ \High ] [ \High ] [ \PLength ] Signal (High level) Data type: switch Specifies that the signal value should always be set to high (value 1) when the instruction is executed. ignition. Program execution A pulse is generated with a specified pulse length (see Figure 15). PulseDO \PLength:=1.32s). Positive pulse (value 1) is generated on the signal do3 from two program tasks at almost the same time. It will result in one positive pulse with a pulse length longer than the default 0. ! Program task MAIN PulseDO \High. do3.0 s is generated on the signal ignition.Instructions PulseDO PulseDO Generates a pulse on a digital output signal PulseDO is used to generate a pulse on a digital output signal.0.1 . a 0.2 s or two positive pulses after each other with a pulse length of 0. System Data Types and Routines 2-PulseDO-323 . [ \PLength ] (Pulse Length) Data type: num The length of the pulse in seconds (0.

do5 from task2 Figure 15 Generation of a pulse on a digital output signal.PulseDO : Instructions Pulse length 1 Signal level 0 Execution of the instruction PulseDO Execution of the instruction PulseDO 1 Signal level 0 Pulse length 1 Signal level 0 Execution of the instruction PulseDO \High Execution of the instruction PulseDO \High 1 Signal level 0 y x 1 Signal level 0 Execution of the instruction PulseDO \High \PLength:=x. 2-PulseDO-324 System Data Types and Routines . do5 from task1 Execution of the instruction PulseDO \High \PLength:=y. The next instruction is executed directly after the pulse starts. The pulse can then be set/ reset without affecting the rest of the program execution.

Programmed values that differ from this are rounded off.System Parameters System Data Types and Routines 2-PulseDO-325 .’ Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .’ ] [ Signal ’:=’ ] < variable (VAR) of signaldo > ’. Syntax PulseDO [ [ ’\’High] [ ’\’PLength ’:=’ < expression (IN) of num >] ‘.Instructions PulseDO Limitations The length of the pulse has a resolution of 0.01 seconds.

PulseDO Instructions 2-PulseDO-326 System Data Types and Routines .

In this case. IF .Instructions RAISE RAISE Calls an error handler RAISE is used to create an error in the program and then to call the error handler of the routine. RAISE can also be used in the error handler to propagate the current error to the error handler of the calling routine.. RAISE escape1.. Arguments RAISE Error no. It is also possible to book an error number outside the range 1-90 with the instruction BookErrNo. the error number may not be specified. to the error handler in the main routine. This instruction can. If the instruction is present in a routine’s error handler. IF . The routine is interrupted to enable it to remove itself from a low level in the program. ERROR IF ERRNO=escape1 RAISE. A jump occurs to the error handler of the called routine. the error is propagated to the error handler of the calling routine. ] Data type: errnum Error number: Any number between 1 and 90 which the error handler can use to locate the error that has occurred (the ERRNO system variable).g. be used to jump back to a higher level in the structure of the program.. if an error occurs at a lower level. The error number must be specified outside the error handler in a RAISE instruction in order to be able to transfer execution to the error handler of that routine. System Data Types and Routines 2-RAISE-327 .. Example IF . for example. . [ Error no.. e..

program execution continues in the error handler of the routine that called the routine in question.BookErrNo 2-RAISE-328 System Data Types and Routines . After the error handler has been executed. the system variable ERRNO is set to ERR_ILLRAISE (see "Data types . If the RAISE instruction is present in a routine’s error handler. program execution can continue with: .’ <error number> ::= <expression> Related information Described in: Error handling Booking error numbers Basic Characteristics Error Recovery Instructions . . the error is dealt with by the system’s error handler. The same error number remains active. Error handling If the error number is out of range. If the RAISE instruction is present in a trap routine. This error can be handled in the error handler.errnum").RAISE Instructions Program execution Program execution continues in the routine’s error handler.the error handler of the routine that called the routine in question (RAISE). Syntax (EBNF) RAISE [<error number>] ’.the routine that called the routine in question (RETURN).

. VAR robtarget next_target. the max.Instructions ReadAnyBin ReadAnyBin Read data from a binary serial channel or file ReadAnyBin (Read Any Binary) is used to read any type of data from a binary serial channel or file. next_target. Program execution As many bytes as required for the specified data are read from the specified binary serial channel or file. If this time runs out before the read operation is finished. Data Data type: ANYTYPE The VAR or PERS to which the read data will be stored. Open "sio1:". the error handler will be called with the error code ERR_DEV_MAXTIME. The next robot target to be executed. is read from the channel referred to by channel2. The timeout function is in use also during program stop and will be noticed in the RAPID program at program start.. If there is no error handler. channel2 \Bin. the execution will be stopped. ReadAnyBin channel2. time is set to 60 seconds. Arguments ReadAnyBin IODevice IODevice Data [\Time]) Data type: iodev The name (reference) of the binary serial channel or file to be read. System Data Types and Routines 2-ReadAnyBin-329 . If this argument is not specified. . Example VAR iodev channel2. next_target. [\Time] Data type: num The max. time for the reading operation (timeout) in seconds.

! Wait for the opcode character input := ReadBin (channel \Time:= 0. or record data type. Therefore. VAR robtarget cur_robt. the system variable ERRNO is set to ERR_FILEACC. Array data cannot be used. Example CONST num NEW_ROBT:=12. channel\Bin. VAR num input. cur_robt. can be updated in several steps. string. for storage of the data read. the system variable ERRNO is set to ERR_RANYBIN_CHK. Open "sio1:". always wait until the whole data structure is updated before using read data from a TRAP or another program task. If timeout before the read operation is finished. CASE NEW_WOBJ: ReadAnyBin channel.ReadAnyBin Instructions Limitations This instruction can only be used for serial channels or files that have been opened for binary reading. If the end of the file is detected before all the bytes are read. The data to be read by this instruction must have a value data type of atomic. Semi-value and non-value data types cannot be used. If there is a checksum error in the data read. the system variable ERRNO is set to ERR_DEV_MAXTIME. the system variable ERRNO is set to ERR_RANYBIN_EOF. cur_wobj. VAR iodev channel. CONST num NEW_WOBJ:=20. VAR wobjdata cur_wobj. Note that the VAR or PERS variable. Error handling If an error occurs during reading. TEST input CASE NEW_ROBT: ReadAnyBin channel. ENDTEST 2-ReadAnyBin-330 System Data Types and Routines .1). These errors can then be dealt with by the error handler.

the opcode of the message is read from the serial channel. As a first step.) of serial channels or files Write data to a binary serial channel or file RAPID Summary .WriteAnyBin System Data Types and Routines 2-ReadAnyBin-331 . Syntax ReadAnyBin [IODevice’:=’] <variable (VAR) of iodev>’. According to this opcode a robtarget or a wobjdata is read from the serial channel.’ Related information Described in: Opening (etc.Communication Instructions .Instructions ReadAnyBin Close channel.’ [Data’:=’] <var or pers (INOUT) of ANYTYPE> [’\’Time’:=’ <expression (IN) of num>]’.

ReadAnyBin Instructions 2-ReadAnyBin-332 System Data Types and Routines .

Arguments Reset Signal The name of the signal to be reset to zero. The signal do15 is set to 0. Syntax Reset [ Signal ’:=’ ] < variable (VAR) of signaldo > ’. If the signal is inverted in the system parameters. Examples Reset do15. Reset weld.Instructions Reset Reset Resets a digital output signal Reset is used to reset the value of a digital output signal to zero. The signal weld is set to 0.’ System Data Types and Routines 2-Reset-333 . this instruction causes the physical channel to be set to 1. Signal Data type: signaldo Program execution The true value depends on the configuration of the signal.

Set RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles System Parameters 2-Reset-334 System Data Types and Routines .Reset Instructions Related information Described in: Setting a digital output signal Input/Output instructions Input/Output functionality in general Configuration of I/O Instructions .

Nothing moves.. StorePath. . in turn. fine. ENDPROC In the event of a welding error.. weld5. Example ArcL p100. v100. calls gun_cleaning.. and stores the original movement once again. v100.. p1. however. MoveL pclean. MoveL p1. The movement path being executed at the time is then stored and the robot moves to the position pclean where the error is rectified. p1 := CRobT(). . System Data Types and Routines 2-RestoPath-335 .. weave1. gun1. ENDIF . the robot returns to the position where the error occurred. When this has been done. meaning that the robot is first reversed along the path before welding starts and ordinary program execution can continue. until the instruction StartMove is executed or a return is made using RETRY from an error handler. RestoPath. seam1. gun1. program execution continues in the error handler of the routine. Example RestoPath. which.. v100.Instructions RestoPath RestoPath Restores the path after an interrupt RestoPath is used to restore a path that was stored at a previous stage using the instruction StorePath. z10. ERROR IF ERRNO=AW_WELD_ERR THEN gun_cleaning. Program execution The current movement path of the robot and the external axes is deleted and the path stored earlier using StorePath is restored. RETRY. PROC gun_cleaning() VAR robtarget p1. gun1. fine. The weld then automatically restarts. Restores the path that was stored earlier using StorePath.

StorePath Instructions . The movement instruction which precedes this instruction should be terminated with a stop point. Syntax RestoPath‘.StorePath 2-RestoPath-336 System Data Types and Routines . If the user wants to order movements on the new path level.’ Related information Described in: Storing paths More examples Instructions . the actual stop position must be stored directly after StorePath and before RestoPath make a movement to the stored stop position on the path.RestoPath Instructions Limitations Only the movement path data is stored with the instruction StorePath.

errnum"). If the error was created using a RAISE instruction. Program execution Program execution continues with (re-executes) the instruction that caused the error. Limitations The instruction can only exist in a routine’s error handler. Syntax RETRY ’. ERROR IF ERRNO = ERR_DIVZERO THEN reg4 := 1. Error handling If the maximum number of retries (4 retries) is exceeded.’ System Data Types and Routines 2-RETRY-337 .Instructions RETRY RETRY Restarts following an error RETRY is used to restart program execution after an error has occurred. which initialises reg4. program execution cannot be restarted with a RETRY instruction. a jump is made to the error handler. ENDIF An attempt is made to divide reg3 by reg4. If reg4 is equal to 0 (division by zero). The RETRY instruction is then used to jump from the error handler and another attempt is made to complete the division. the program execution stops with an error message and the system variable ERRNO is set to ERR_EXCRTYMAX (see "Data types . then the instruction TRYNEXT should be used. RETRY. Example reg2 := reg3/reg4. .

RETRY Instructions Related information Described in: Error handlers Continue with the next instruction Basic CharacteristicsError Recovery Instructions .TRYNEXT 2-RETRY-338 System Data Types and Routines .

program execution returns to the instruction following the procedure call. Set do1. RETURN. [ Return value ] Data type: According to the function decla- System Data Types and Routines 2-RETURN-339 . PROC errormessage() TPWrite "ERROR". a return value may not be specified. ENDPROC The errormessage procedure is called. If the instruction is present in a procedure or trap routine.Instructions RETURN RETURN Finishes execution of a routine RETURN is used to finish the execution of a routine. When the procedure arrives at the RETURN instruction. If the routine is a function. Set do1. FUNC num abs_value(num value) IF value<0 THEN RETURN -value. Arguments RETURN Return value ration The return value of a function. . ELSE RETURN value. The return value must be specified in a RETURN instruction present in a function. the function value is also returned. ENDIF ENDFUNC The function returns the absolute value of a number. Examples errormessage.

depending on the type of routine it is used in: . the program stops.Main routine: If a program stop has been ordered at the end of the cycle. .Error Recovery 2-RETURN-340 System Data Types and Routines .Error handler: In a procedure: Program execution continues with the routine that called the routine with the error handler (with the instruction following the procedure call).RETURN Instructions Program execution The result of the RETURN instruction may vary. In a function: The function value is returned. .’ Related information Described in: Functions and Procedures Trap routines Error handlers Basic Characteristics .Trap routine: Program execution continues with the instruction following the procedure call. Program execution continues from where the interrupt occurred. Syntax (EBNF) RETURN [ <expression> ]’. program execution continues with the first instruction of the main routine.Interrupts Basic Characteristics .Procedure: .Function: . Returns the value of the function.Routines Basic Characteristics . Otherwise.

The file referred to by iodev1 will have the file position set to the beginning of the file. Arguments Rewind IODevice Name (reference) of the file to be rewound. System Data Types and Routines 2-Rewind-341 .Instructions Rewind Rewind Rewind file position Rewind sets the file position to the beginning of the file. IODevice Data type: iodev Program execution The specified file is rewound to the beginning. Example Rewind iodev1.

"Hello world". ! Rewind the file pointer to the beginning of the binary file ! Read contents of the file and write the binary result on TP ! (gives 72 101 108 108 111 32 119 111 114 108 100 ) Rewind dev.) of files RAPID Summary . the system variable ERRNO is set to ERR_FILEACC. The instruction Rewind is used to rewind a binary file to the beginning so that the contents of the file can be read back with ReadBin. WriteStrBin dev. bindata := ReadBin(dev). VAR num bindata.Rewind Instructions Example ! IO device and numeric variable for use together with a binary file VAR iodev dev. bindata := ReadBin(dev). This error can then be handled in the error handler. ! Open the binary file with \Bin switch for binary read and write access Open "HOME:"\File := "bin_file".Communication 2-Rewind-342 System Data Types and Routines . ENDWHILE ! Close the binary file Close dev. Close dev. Error handling If an error occurs during the rewind. Syntax Rewind [IODevice ’:=’] <variable (VAR) of iodev>’. ! Open the binary file with \Write switch to erase old contents Open "HOME:"\File := "bin_file".dev \Bin.’ Related information Described in: Opening (etc.dev \Write. WHILE bindata <> EOF_BIN DO TPWrite " " \Num:=bindata.

Instructions Rewind System Data Types and Routines 2-Rewind-343 .

Rewind Instructions 2-Rewind-344 System Data Types and Routines .

TSK1Id etc.MOD from HOME: into the program memory. Save "PART_B".MOD". ModuleName The program module to save. If this argument is omitted. predefined variables of the data type taskid will be available. System Data Types and Routines 2-Save-345 . Save the program module PART_B with the original file path HOME: and with the original file name PART_B. The specified program module in the program memory will be saved with the original (specified in Load or StartLoad) or specified file path.g. TSK1 . e. It is also possible to save a system module at the specified file path. For all program tasks in the system. Data type: string [\FilePath] Data type: string The file path and the file name to the place where the program module is to be saved.. .Instructions Save Save Save a program module Save is used to save a program module. for the MAIN task the variable identity will be MAINId. The file name shall be excluded when the argument \File is used.. Arguments Save [\Task] ModuleName [\FilePath] [\File] Data type: taskid [\Task] The program task in which the program module should be saved. Load the program module with the file name PART_B. the specified program module in the current (executing) program task will be saved. Example Load "HOME:/PART_B.MOD. The variable identity will be "taskname"+"Id".

Avoid ongoing robot movements during the saving. the argument \FilePath must be used. To store the program module at another destination it is also possible to use the argument \FilePath. Program execution Program execution waits for the program module to finish saving before proceeding with the next instruction. The save operation can interrupt update of PERS data done step by step from other program tasks.MOD". Example Save "PART_A" \FilePath:="HOME:/DOORDIR/PART_A. Save the program module PART_A to HOME: in the file PART_A. Save "PART_A" \FilePath:="HOME:” \File:=”DOORDIR/PART_A. This will result in inconsistent whole PERS data. Therefore. Save \Task:=TSK1Id. or system configuration. any such operations will be delayed. Same as above but another syntax. external computer.MOD". This is an example where the instruction Save is executing in one program task and the saving is done in another program task. "PART_A" \FilePath:="HOME:/DOORDIR/PART_A. The argument \FilePath can only be omitted for program modules loaded with Load or StartLoad-WaitLoad and the program module will be stored at the same destination as specified in these instructions. To be able to save a program module that previously was loaded from the teach pendant. system I/O events and other program tasks cannot execute during the saving operation. it must be specified with this argument.MOD". 2-Save-346 System Data Types and Routines . A program stop during execution of the Save instruction can result in a guard stop with motors off and the error message "20025 Stop order timeout" will be displayed on the Teach Pendant.Save [\File] Instructions Data type: string When the file name is excluded in the argument \FilePath. Limitations TRAP routines. Save program module PART_A in program task TSK1 to the specified destination.MOD and in the directory DOORDIR.

’ ] [ ModuleName ’:=’ ] <expression (IN) of string> [ ’\’ FilePath ’:=’<expression (IN) of string> ] [ ’\’ File ’:=’ <expression (IN) of string>] ’. the system variable ERRNO is set to ERR_PATH. the system variable ERRNO is set to ERR_MODULE. unknown. or no space left on device. the system variable ERRNO is set to ERR_IOERROR.’ Related information Described in: Program tasks Data Types . no such directory.taskid System Data Types and Routines 2-Save-347 . If the save file cannot be opened because of permission denied. System Parameters.Instructions Save Error handling If the program module cannot be saved because there is no module name. Syntax Save [ ’\’ Task ’:=’ <variable (VAR) of taskid> ’. The errors above can be handled in the error handler. or ambiguous module name. or an external computer. If argument \FilePath is not specified for program modules loaded from the Teach Pendant.

Save Instructions 2-Save-348 System Data Types and Routines .

The TCP of the probe is moved circularly towards the position p10 at a speed of v100. Arguments SearchC [ \Stop ] | [ \PStop ] | [ \SStop ] | [ \Sup ] Signal [ \Flanks ] SearcPoint CirPoint ToPoint Speed [ \V ] | [ \T ] Tool [ \WObj ] [ \Corr ] [ \Stop ] (Stiff Stop) Data type: switch The robot movement is stopped.Instructions SearchC SearchC Searches circularly using the robot SearchC (Search Circular) is used to search for a position when moving the tool centre point (TCP) circularly. v100. sen1. When the value of the signal changes to the requested one. i. sp. probe. p10. the robot is moved a distance before it stops and is not moved back to the searched position. the outline coordinates of a work object can be obtained. to the position where the signal changed. The TCP of the probe is moved circularly towards the position p10. the robot supervises a digital input signal. the robot immediately reads the current position. the robot is moved a small distance before it stops and is not moved back to the searched position. i. v100. when the value of the search signal changes to active.e. However. probe. Examples SearchC sen1. to the position where the signal changed. p10. the position is stored in sp. cirpoint. when the value of the search signal changes to active. During the movement.e. SearchC \Stop. Using the SearchC instruction. System Data Types and Routines 2-SearchC-349 . the position is stored in sp and the robot stops immediately. sp. When the value of the signal do1 changes to active. cirpoint. while keeping the TCP on the path (soft stop). [ \PStop ] (Path Stop) Data type: switch The robot movement is stopped as quickly as possible. When the value of the signal do1 changes to active. This instruction can typically be used when the tool held by the robot is a probe for surface detection. without keeping the TCP on the path (hard stop). However. as quickly as possible.

Signal The name of the signal to supervise. i. However. CirPoint Data type: robtarget The circle point of the robot. [ \Sup ] (Supervision) Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search).SearchC [ \SStop ] (Smooth Stop) Instructions Data type: switch The robot movement is stopped as quickly as possible. If the argument \Flanks is omitted. even after the first signal change has been reported. The position is specified in the outermost coordinate system. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction). it stops in the direction of the tangent of the movement which causes it to marginally slide of the path. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be dealt with by the error handler. 2-SearchC-350 System Data Types and Routines . \SStop or \Sup is omitted. the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup). the robot is moved only a small distance before it stops and is not moved back to the searched position. i. the robot movement is stopped as quickly as possible. See the instruction MoveC for a more detailed description of circular movement. This means that if the signal has a positive value already at the beginning of a search process. \PStop. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. taking the specified tool.e. while keeping the TCP close to or on the path (smooth stop). when the value of the search signal changes to active. work object and active ProgDisp/ExtOffs coordinate system into consideration. If the argument \Stop. the robot is moved a small distance before it stops and is not moved back to the start position. program execution stops. If more than one match occurs during a search. only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. while keeping the TCP on the path (soft stop). However. SStop is faster then PStop. to the position where the signal changed. [\Flanks ] Data type: switch Data type: signaldi The positive and the negative edge of the signal is valid for a search hit.e. But when the robot is running faster than 100 mm/s.

If. the external axes and of the tool reorientation. [ \V ] (Velocity) Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction.e. Program execution See the instruction MoveC for information about circular movement. The tool centre point is the point that is moved to the specified destination position. Speed data defines the velocity of the tool centre point. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves.Instructions ToPoint SearchC Data type: robtarget The destination point of the robot and external axes. Speed Data type: speeddata The speed data that applies to movements. when this argument is present. SearchC always uses a stop point as zone data for the destination. on the other hand. The movement is always ended with a stop point. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the robot positions in the instruction are related. i. the robot is stopped at the destination point. and if it is. It is then substituted for the corresponding velocity specified in the speed data. the position is related to the world coordinate system. This argument can be omitted. System Data Types and Routines 2-SearchC-351 . [ \Corr] (Correction) Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. Tool Data type: tooldata The tool in use when the robot moves. a stationary TCP or coordinated external axes are used. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). It is then substituted for the corresponding speed data. this argument must be specified for a linear movement relative to the work object to be performed.

the robot movement stops when the first signal is detected. Example SearchC \Sup. 2-SearchC-352 System Data Types and Routines . The TCP of the probe is moved circularly towards the position p10. If the value of the signal changes twice. but a point along the real robot path. probe. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared with that programmed). when the I/O signal is ready to react. The SearchC instruction returns the position of the TCP when the value of the digital signal changes to the requested one.e. i. When a search is made using the switch \Stop. p10. the position is stored in sp. i. as illustrated in Figure 16.e. cirpoint. program execution stops. Without switch \Flanks 1 0 time 1 0 With switch \Flanks time = Instruction reaction when the signal changes Figure 16 Flank-triggered signal detection (the position is stored when the signal is changed the first time only). Limitations Zone data for the positioning instruction that precedes SearchC must be used carefully. Figure 17 illustrates an example of something that may go wrong when zone data other than fine is used. When the value of the signal do1 changes to active or passive. the programmed destination point of the previous positioning instruction. is not. sen1\Flanks. sp. The start of the search. in this case.SearchC Instructions When a flying search is used. The instruction SearchC should never be restarted after the circle point has been passed. the robot movement always continues to the programmed destination point. the \Sup argument is specified. v100. \PStop or \SStop.

The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. . . Typical stop distance using a search velocity of 50 mm/s: .without TCP on path (switch \Stop) 1-3 mm .more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. Errors can be handled in different ways depending on the selected running mode: Continuous forward / ERR_WHLSEARCH No position is returned and the movement always continues to the programmed destination point.no signal detection occurred . Continuous forward / Instruction forward / ERR_SIGSUPSEARCH No position is returned and the movement always stops as quickly as possible at the beginning of the search path.Instructions SearchC Start point with zone data z10 Search object End point Start point with zone data fine Figure 17 A match is made on the wrong side of the object because the wrong zone data was used.this generates the error ERR_WHLSEARCH.with TCP on path (switch \PStop) 12-16 mm . System Data Types and Routines 2-SearchC-353 .the signal has already a positive value at the beginning of the search process this generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted.with TCP near path (switch \SStop) 7-10 mm Error handling An error is reported during a search when: .

tooldata Data Types . Program execution stops with an error message.CorrWrite Motion and I/O Principles Positioning during Program Execution Data Types .SearchL 2-SearchC-354 System Data Types and Routines .’ [ SearchPoint ’:=’ ] < var or pers (INOUT) of robtarget > ’.wobjdata RAPID Summary . Instruction backward During backward execution. the instruction just carries out the movement without any signal supervision.’ ] | [ ’\’ PStop ’.SearchC Instructions Instruction forward / ERR_WHLSEARCH No position is returned and the movement always continues to the programmed destination point.’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’. Syntax SearchC [ ’\’ Stop’.SearchL Instructions .speeddata Data Types .’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’.’] | [ ’\’ SStop ’.’ ] | [ ’\’ Sup ’.’ ] [ Signal ’:=’ ] < variable (VAR) of signaldi > [‘\’ Flanks]’.’ Related information Described in: Linear searches Writes to a corrections entry Circular movement Definition of velocity Definition of tools Definition of work objects Using error handlers Motion in general More searching examples Instructions .Error Recovery Motion and I/O Principles Instructions .’ [ CirPoint ’:=’ ] < expression (IN) of robtarget > ’.’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.

sen1. probe. when the value of the search signal changes to active. The TCP of the probe is moved linearly towards the position p10. p10. [ \PStop ] (Path Stop) Data type: switch The robot movement is stopped as quickly as possible. i. the position is stored in sp and the robot stops immediately. SearchL \Stop. when the value of the search signal changes to active. to the position where the signal changed. However. i. v100. v100. the robot is moved a distance before it stops and is not moved back to the searched position. the robot is moved a small distance before it stops and is not moved back to the searched position. without keeping the TCP on the path (hard stop). the outline coordinates of a work object can be obtained.e.e. When the value of the signal do1 changes to active. the robot immediately reads the current position. while keeping the TCP on the path (soft stop). p10. the position is stored in sp. System Data Types and Routines 2-SearchL-355 . The TCP of the probe is moved linearly towards the position p10 at a speed of v100. to the position where the signal changed. Arguments SearchL [ \Stop ] | [ \PStop ] | [ \SStop ] | [ \Sup ] Signal [ \Flanks ] SearchPoint ToPoint Speed [ \V ] | [ \T ] Tool [ \WObj ] [ \Corr ] [ \Stop ] (Stiff Stop) Data type: switch The robot movement is stopped as quickly as possible. sp. When the value of the signal do1changes to active. During the movement. This instruction can typically be used when the tool held by the robot is a probe for surface detection. Using the SearchL instruction. probe. the robot supervises a digital input signal.Instructions SearchL SearchL Searches linearly using the robot SearchL (Search Linear) is used to search for a position when moving the tool centre point (TCP) linearly. sp. When the value of the signal changes to the requested one. Examples SearchL do1. However.

the robot movement is stopped as quickly as possible. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). the movement continues (flying search) to the position specified in the ToPoint argument (same as with argument \Sup). i. ToPoint Data type: robtarget The destination point of the robot and external axes. The position is specified in the outermost coordinate system. the robot is moved only a small distance before it stops and is not moved back to the searched position. [\Sup ] (Supervision) Data type: switch The search instruction is sensitive to signal activation during the complete movement (flying search). while keeping the TCP on the path (soft stop). But when the robot is running faster than 100 mm/s it stops in the direction of the tangent of the movement which causes it to marginally slide off the path. program execution stops.e. However. SStop is faster then PStop. taking the specified tool. This means that if the signal has the positive value already at the beginning of a search process. A user recovery error (ERR_SIGSUPSEARCH) will be generated and can be handled in the error handler. even after the first signal change has been reported. to the position where the signal changed. If the argument \Stop.e. only the positive edge of the signal is valid for a search hit and a signal supervision will be activated at the beginning of a search process. Signal The name of the signal to supervise. [\Flanks ] Data type: switch Data type: signaldi The positive and the negative edge of the signal is valid for a search hit.SearchL [ \SStop ] (Smooth Stop) Instructions Data type: switch The robot movement is stopped as quickly as possible. while keeping the TCP close to or on the path (smooth stop). 2-SearchL-356 System Data Types and Routines . work object and active ProgDisp/ExtOffs coordinate system into consideration. i. when the value of the search signal changes to active. SearchPoint Data type: robtarget The position of the TCP and external axes when the search signal has been triggered. SearchL always uses a stop point as zone data for the destination. If more than one match occurs during a search. \PStop. \SStop or \Sup is omitted. If the argument \Flanks is omitted.

e. the robot movement stops when the first signal is detected. as illustrated in Figure 18. If a search is made using the switch \Stop. Speed data defines the velocity of the tool centre point. i.Instructions Speed SearchL Data type: speeddata The speed data that applies to movements. It is then substituted for the corresponding velocity specified in the speed data. this argument must be specified for a linear movement relative to the work object to be performed. Program execution See the instruction MoveL for information about linear movement. [ \Corr] (Correction) Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. The SearchL instruction stores the position of the TCP when the value of the digital signal changes to the requested one. and if it is. if this argument is present. The movement always ends with a stop point. The tool centre point is the point that is moved to the specified destination position. System Data Types and Routines 2-SearchL-357 . the \Sup argument is specified. i. the robot stops at the destination point. [ \V ] (Velocity) Data type: num This argument is used to specify the velocity of the TCP in mm/s directly in the instruction. the position is related to the world coordinate system. It is then substituted for the corresponding speed data. Tool Data type: tooldata The tool in use when the robot moves. If a flying search is used. \PStop or \SStop. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. the robot movement always continues to the programmed destination point. a stationary TCP or coordinated external axes are used. If. the external axes and of the tool reorientation. This argument can be omitted.e. on the other hand.

the position is stored in sp. tool1. v100. tool1. sen1\Flanks. tool1. tool1. v100. At the beginning of the search process. PDispOff. in this case. the programmed destination point of the previous positioning instruction. 2-SearchL-358 System Data Types and Routines . The start of the search. v100. MoveL p120.SearchL Instructions Without switch \Flanks 1 0 time 1 0 With switch \Flanks time = Instruction reaction when the signal changes Figure 18 Flank-triggered signal detection (the position is stored when the signal is changed the first time only). tool1. Figure 19 to Figure 21 illustrate examples of things that may go wrong when zone data other than fine is used. MoveL p110. when the I/O signal is ready to react. but a point along the real robot path. p10. tool1. The TCP of the probe is moved linearly towards the position p10. i. z10. sp. Limitations Zone data for the positioning instruction that precedes SearchL must be used carefully. program execution stops after the search process is finished. sp. Using program displacement. Examples SearchL \Sup. v100. fine \Inpos := inpos50. z10. MoveL p100. z10. sen1. PDispOn *. the robot then moves relative to the searched position. MoveL sp. v100.e. probe. the program execution stops. SearchL \Stop. Otherwise the TCP of tool1 is moved linearly towards the position p10. is not. The robot is moved back to this point using an accurately defined stop point. v100. sp. If the value of the signal changes twice. a check on the signal do1will be done and if the signal already has a positive value. When the value of the signal do1changes to active or passive. When the value of the signal do1changes to active. the position is stored in sp. p10.

Instructions SearchL Start point with zone data fine Start point with zone data z10 Search object End point Figure 19 A match is made on the wrong side of the object because the wrong zone data was used. Typical stop distance using a search velocity of 50 mm/s: .this generates the error ERR_WHLSEARCH. Start point with zone data fine Start point with zone data z10 Search object End point Figure 21 No match detected because the wrong zone data was used.without TCP on path (switch \Stop) 1-3 mm .more than one signal detection occurred – this generates the error ERR_WHLSEARCH only if the \Sup argument is used. .with TCP on path (switch \PStop) 12-16 mm . .the signal already has a positive value at the beginning of the search process this generates the error ERR_SIGSUPSEARCH only if the \Flanks argument is omitted.no signal detection occurred . Start point with zone data fine Start point with zone data z10 Search object End point Figure 20 No match detected because the wrong zone data was used.with TCP near path (switch \SStop) 7-10 mm Error handling An error is reported during a search when: . System Data Types and Routines 2-SearchL-359 .

IF fk = 1 THEN MoveL p10. sp. tool1. Otherwise program execution will stop.”YES”. p20.. Example VAR num fk.The system variable ERRNO is set to ERR_SIGSUPSEARCH and the error can be handled in the error handler of the routine. v100. ELSE Stop.””.”NO”. ERROR IF ERRNO=ERR_WHLSEARCH THEN MoveL p10. If the signal is passive at the beginning of the search process. MoveL p10.. fine. If no signal detection occurs.””. Instruction backward During backward execution. the instruction just carries out the movement without any signal supervision. tool1. v100.”Try again after manual reset of signal ?”. v100. v100. The system variable ERRNO is set to ERR_WHLSEARCH and the error can be handled in the error handler of the routine. SearchL \Stop.””. RETRY. fine. a user dialog will be activated (TPReadFK . Reset the signal and push YES on the user dialog and the robot moves back to p10 and tries once more. Program execution stops with an error message. RETRY. ELSEIF ERRNO=ERR_SIGSUPSEARCH THEN TPWrite “The signal of the SearchL instruction is already high!”. sen1. ENDIF ENDIF If the signal is already active at the beginning of the search process. fine. tool1.). TPReadFK fk. tool1. Continuous forward / Instruction forward / ERR_SIGSUPSEARCH No position is returned and the movement always stops as quickly as possible at the beginning of the search path.. Instruction forward / ERR_WHLSEARCH No position is returned and the movement continues to the programmed destination point. .SearchL Instructions Errors can be handled in different ways depending on the selected running mode: Continuous forward / ERR_WHLSEARCH No position is returned and the movement always continues to the programmed destination point. the robot searches from position p10 to p20. the robot moves back to p10 and tries once more. 2-SearchL-360 System Data Types and Routines . .

’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ V ’:=’ < expression (IN) of num > ] | [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’.speeddata Data Types .’ ] [ Signal ’:=’ ] < variable (VAR) of signaldi > [‘\’ Flanks] ’.Instructions SearchL Syntax SearchL [ ’\’ Stop ’.Error Recovery Motion and I/O Principles Definition of velocity Definition of tools Definition of work objects Using error handlers Motion in general System Data Types and Routines 2-SearchL-361 .’ Related information Described in: Circular searches Writes to a corrections entry Linear movement Instructions .tooldata Data Types .wobjdata RAPID Summary .’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ ] | [ ’\’ PStop ’.’ [ SearchPoint ’:=’ ] < var or pers (INOUT) of robtarget > ’.SearchC Instructions .’] | [ ’\’ Sup ’.CorrWrite Motion and I/O Principles Positioning during Program Execution Data Types .’] | [ ’\’ SStop ’.

SearchL Instructions 2-SearchL-362 System Data Types and Routines .

The signal do15 is set to 1. If the signal is inverted in the system parameters. Examples Set do15. Syntax Set [ Signal ’:=’ ] < variable (VAR) of signaldo > ’. this instruction causes the physical channel to be set to zero.Instructions Set Set Sets a digital output signal Set is used to set the value of a digital output signal to one. Signal Data type: signaldo Program execution The true value depends on the configuration of the signal.’ System Data Types and Routines 2-Set-363 . Set weldon. The signal weldon is set to 1. Arguments Set Signal The name of the signal to be set to one.

Reset RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles System Parameters 2-Set-364 System Data Types and Routines .Set Instructions Related information Described in: Setting a digital output signal to zero Input/Output instructions Input/Output functionality in general Configuration of I/O Instructions .

The signal ao2 is set to 5. etc. Value The desired value of the signal.5.Instructions SetAO SetAO Changes the value of an analog output signal SetAO is used to change the value of an analog output signal.) MAX SIGNAL MAX PROGRAM Logical value in the program MIN PROGRAM MIN SIGNAL Figure 22 Diagram of how analog signal values are scaled. 5. Example SetAO ao2. Data type: num Signal Value Data type: signalao Program execution The programmed value is scaled (in accordance with the system parameters) before it is sent on the physical channel. mA. System Data Types and Routines 2-SetAO-365 . Arguments SetAO Signal The name of the analog output signal to be changed.5. See Figure 22. Physical value of the output signal (V.

curr_outp.SetAO Instructions Example SetAO weldcurr. The signal weldcurr is set to the same value as the current value of the variable curr_outp.’ [ Value ’:=’ ] < expression (IN) of num > ’.’ Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles System Parameters 2-SetAO-366 System Data Types and Routines . Syntax SetAO [ Signal ’:=’ ] < variable (VAR) of signalao > ’.

continues with the next instruction. After the given time-delay.32s).2 s. Program execution. Examples SetDO do15. Program execution continues directly with the next instruction. SetDO \SDelay := 0. Value The desired value of the signal. with or without a timedelay. The signal weld is set to off. SetDO weld.2. the signal is changed without the rest of the program execution being affected.Instructions SetDO SetDO Changes the value of a digital output signal SetDO is used to change the value of a digital output signal. weld. however. The signal weld is set to high with a delay of 0. If the argument is omitted. Data type: dionum Data type: signaldo System Data Types and Routines 2-SetDO-367 . Signal The name of the signal to be changed. off. The signal do15 is set to 1. The value is specified as 0 or 1. 1. high. Arguments SetDO [ \SDelay ] [ \SDelay ] Signal Value (Signal Delay) Data type: num Delays the change for the amount of time given in seconds (0. the value of the signal is changed directly.1 .

’ Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide . Syntax SetDO [ ’\’ SDelay ’:=’ < expression (IN) of num > ’.System Parameters 2-SetDO-368 System Data Types and Routines .’ [ Value ’:=’ ] < expression (IN) of dionum > ’. If the signal is inverted in the system parameters.’ ] [ Signal ’:=’ ] < variable (VAR) of signaldo > ’. the value of the physical channel is the opposite.SetDO Instructions Program execution The true value depends on the configuration of the signal.

The signal go2 is set to 10. 12. however. If the argument is omitted. After the specified time delay. the value is changed directly. Value Data type: num Data type: signalgo The desired value of the signal group (a positive integer). outputs 6 and 8 are set to zero. Arguments SetGO [ \SDelay ] [ \SDelay ] Signal Value (Signal Delay) Data type: num Delays the change for the period of time stated in seconds (0. The permitted value is dependent on the number of signals in the group: System Data Types and Routines 2-SetGO-369 . If go2 comprises 4 signals. Signal The name of the signal group to be changed. The signal go2 is set to 12. outputs 6 and 7 are set to zero. with a delay of 0. SetGO \SDelay := 0. while outputs 8 and 9 are set to one. 10.1 .4. with or without a time delay.4 s. while outputs 7 and 9 are set to one.Instructions SetGO SetGO Changes the value of a group of digital output signals SetGO is used to change the value of a group of digital output signals.g. If go2 comprises 4 signals. e. e.32s). continues with the next instruction. Program execution. Program execution continues directly with the next instruction. outputs 6-9. the value of the signals is changed without the rest of the program execution being affected.g. outputs 6-9. go2. Example SetGO go2.

1023 0 .65535 Program execution The programmed value is converted to an unsigned binary number.2047 0 .127 0 . Syntax SetDO [ ’\’ SDelay ’:=’ < expression (IN) of num > ’.’ [ Value ’:=’ ] < expression (IN) of num > ’.15 0 .4095 0 . This binary number is sent on the signal group.’ Related information Described in: Other input/output instructions Input/Output functionality in general Configuration of I/O (system parameters) RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles System Parameters 2-SetGO-370 System Data Types and Routines . the value of the signal may be undefined for a short period of time.255 No.511 0 .32767 0 .8191 0 .63 0 . of signals 1 2 3 4 5 6 7 8 Permitted value 0-1 0-3 0-7 0 .SetGO No.’ ] [ Signal ’:=’ ] < variable (VAR) of signalgo > ’.16383 0 .31 0 . Due to internal delays. of signals 9 10 11 12 13 14 15 16 Instructions Permitted value 0 . with the result that individual signals in the group are set to 0 or 1.

the robot can achieve the movement but the orientation of the tool will be slightly changed. Robots with less than six axes may not be able to reach a programmed tool orientation. Also used for linear and circular interpolation of robots with less than six axes where the tool orientation is allowed to differ. Arguments SingArea [ \Wrist ] [ \Wrist] | [ \Off] Data type: switch The tool orientation is allowed to differ somewhat in order to avoid wrist singularity. Examples SingArea \Wrist. The orientation of the tool may be changed slightly in order to pass a singular point (axes 4 and 6 in line). resulting in a reduction in velocity. By using SingArea \Wrist. The tool orientation is not allowed to differ from the programmed orientation. If none of the arguments are specified. [\Off ] Data type: switch The tool orientation is not allowed to differ. Used when no singular points are passed. For robots with six axes the default argument is \Off. Robots with less than six axes may not be able to reach an interpolated tool orientation. SingArea \Off. SingArea is also used to define linear and circular interpolation for robots with less than six axes.Instructions SingArea SingArea Defines interpolation around singular points SingArea is used to define how the robot is to move in the proximity of singular points. Used when axes 4 and 6 are parallel (axis 5 at 0 degrees). As a result the robot will stop. System Data Types and Routines 2-SingArea-371 . one or more axes may perform a sweeping movement. program execution automatically uses the robot’s default argument. If a singular point is passed. or when the orientation is not permitted to be changed.

’ Related information Described in: Singularity Interpolation Motion Principles. but the orientation of the tool deviates somewhat. Robots with less than six axes may use either the /Off argument (IRB640) or the /Wrist argument by default. In this way.at a cold start-up . The movement is only affected on execution of linear or circular interpolation. By default. This will also happen when a singular point is not passed. Syntax SingArea [ ’\’ Wrist ] | [ ’\’ Off ] ’.Singularity Motion Principles . . the TCP follows the correct path. the orientation is joint-interpolated to avoid singular points.SingArea Instructions Program execution If the arguments \Wrist is specified. This is automatically set in event routine SYS_RESET.when a new program is loaded .Positioning during Program Execution 2-SingArea-372 System Data Types and Routines .when starting program executing from the beginning. program execution automatically uses the /Off argument for robots with six axes. The specified interpolation applies to all subsequent movements until a new SingArea instruction is executed.

Instructions SoftAct SoftAct Activating the soft servo SoftAct (Soft Servo Activate) is used to activate the so called “soft” servo on any axis of the robot or external mechanical unit. with softness value 90% and ramp factor 150%. Arguments SoftAct [\MechUnit] Axis Softness [\Ramp ] [\MechUnit] (Mechanical Unit Data type: mecunit The name of the mechanical unit. stiffness). and 100% denotes max. 1. softness (max. Activation of soft servo on axis 1 for the mechanical unit orbit1. Activation of soft servo on robot axis 3. softness. SoftAct \MechUnit:=orbit1. Activation of the soft servo on robot axis 1. 0% denotes min. 90 \Ramp:=150. A factor 100% denotes the normal value. 20. it means activation of the soft servo for specified robot axis. Axis Data type: num Number of the robot or external axis to work with soft servo. with softness value 20%. If this argument is omitted. Ramp Data type: num Ramp factor in percent (>= 100%). The ramp factor is used to control the engagement of the soft servo. Example SoftAct 3. 40 \Ramp:=120. Softness Data type: num Softness value in percent (0 .100%). System Data Types and Routines 2-SoftAct-373 . with softness value 40% and ramp factor 120%. SoftAct 1. The default value for ramp factor is 100 %. with greater values the soft servo is engaged more slowly (longer ramp).

or until the soft servo is deactivated by an instruction.Positioning during program execution 2-SoftAct-374 System Data Types and Routines .’ Related information Described in: Behaviour with the soft servo engaged Motion and I/O Principles. The softness value is valid for all movements. The same axis must not be activated twice. SoftAct n . the following program sequence should be avoided. Limitations Soft servo for any robot or external axis is always deactivated when there is a power failure. (n = robot axis n. y .’] [Axis ’:=’ ] < expression (IN) of num> ’.SoftAct Instructions Program execution Softness is activated at the value specified for the current axis. until a new softness value is programmed for the current axis.’ [Softness ’:=’ ] < expression (IN) of num> [ ’\’Ramp ’:=’ < expression (IN) of num> ]’. unless there is a moving instruction in between. This limitation can be handled in the user program when restarting after a power failure. x and y softness values) Syntax SoftAct [’\’MechUnit ’:=’ < variable (VAR) of mecunit> ’. otherwise there will be a jerk in the robot movement: SoftAct n . x . Thus.

Deactivating the soft servo on all axes. with greater values the soft servo is deactivated more slowly (longer ramp). Arguments SoftDeact [\Ramp ] Ramp Data type: num Ramp factor in percent (>= 100%).SoftAct System Data Types and Routines 2-SoftDeact-375 .Instructions SoftDeact SoftDeact Deactivating the soft servo SoftDeact (Soft Servo Deactivate) is used to deactivate the so called “soft” servo on all robot and external axes.’ Related information Described in: Activating the soft servo Instructions . SoftDeact \Ramp:=150. Example SoftDeact. The default value for ramp factor is 100 %. A factor 100% denotes the normal value. Deactivating the soft servo on all axes. Syntax SoftDeact [ ’\’Ramp ’:=’ < expression (IN) of num> ]’. The ramp factor is used to control the deactivating of the soft servo. Program execution The soft servo is deactivated for all robot and external axes. with ramp factor 150%.

SoftDeact Instructions 2-SoftDeact-376 System Data Types and Routines .

System Data Types and Routines 2-SpyStart-377 . Program execution The specified file is opened for writing and the execution time data begins to be recorded in the file. Recording of execution time data is active until: .execution of instruction SpyStop .Instructions SpyStart SpyStart Start recording of execution time data SpyStart is used to start the recording of instruction and time data during execution. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use.SpyStop in one program task). specifically for multitasking systems (only necessary to have SpyStart .starting program execution from the beginning .next warm start-up Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming.log". Starts recording the execution time data in the file spy. The stored data is intended for debugging RAPID programs. The execution data will be stored in a file for later analysis. Arguments SpyStart File File Data type: string The file path and the file name to the file that will contain the execution data. Example SpyStart "HOME:/spy.log on the HOME: disk.loading a new program .

do1.means that the system is doing something else than execution of RAPID instructions. MAIN def_wz. 691310:READY :691310 691450:READY :691450 691450:READY :691450 691450:READY :691450 691460:READY :691460 691460:READY :691460 691860:READY :691860 693910:WAIT :694010 726820:WAIT :726820 740300:READY :740300 740300:READY :740300 827610: TASK column shows executed program task INSTR column shows executed instruction in specified program task IN column shows the time in ms at enter of the executed instruction CODE column shows if the instruction is READY or if the instruction WAIT for completion at OUT time OUT column shows the time in ms at leave of the executed instruction All time is given in ms (relative values) with resolution 10 ms.s.volume. This is repeated for every executed instruction in the NOSTEPIN routine.toolx\WObj:=wobjx. ----.volume. MAIN WZDOSet\Temp.x+xtrans MAIN WZDOSet\Temp.SYSTEM TRAP ----MAIN MoveL home.SYSTEM TRAP----MAIN ConfL\Off. MAIN SpyStop..wz2\Inside.toolx\WObj:=wobjx. MAIN MoveL home. .SpyStart Instructions Error handling If the file in the SpyStart instruction can’t be opened then the system variable ERRNO is set to ERR_FILEOPEN (see “Data types .z.errnum”).s. File format TASK INSTR IN CODE OUT MAIN ConfJ\Off.s.SYSTEM TRAP----. This error can then be handled in the error handler.wz1\Inside..toolx\WObj:=wobjx..SYSTEM TRAP----MAIN WZSphDef\Inside.SYSTEM TRAP ----MAIN MoveL home.[p1. ----.trans. MAIN WZSphDef\Inside. . MAIN writepos. ----.volume.z. ----.1.volume.1.[p2. ----.. If procedure call to some NOSTEPIN procedure (module) the output list shows only the name of the called procedure.do2.trans.x+xtrans. 2-SpyStart-378 System Data Types and Routines .z.

Instructions SpyStart Syntax SpyStart [File’:=’]<expression (IN) of string>’.SpyStop System Data Types and Routines 2-SpyStart-379 .’ Related information Described in: Stop recording of execution data Instructions .

SpyStart Instructions 2-SpyStart-380 System Data Types and Routines .

produce_sheets. Never use the spy function in production programs because the function increases the cycle time and consumes memory on the mass memory device in use.log". Example SpyStop. stop recording. and close the file spy.Instructions SpyStop SpyStop Stop recording of time execution data SpyStop is used to stop the recording of time data during execution.’ System Data Types and Routines 2-SpyStop-381 . which can be useful for optimising the execution cycle time.log. perform actual production. the SpyStop instruction is ignored. If the debug flag is true. start recording execution data in the file spy. is stored in a file for later analysis. Examples IF debug = TRUE SpyStart "HOME:/spy. Syntax SpyStop’.log on the HOME: disk. Program execution The execution data recording is stopped and the file specified by the previous SpyStart instruction is closed. The data. IF debug = TRUE SpyStop. Limitations Avoid using the floppy disk (option) for recording since writing to the floppy is very time consuming. Stops recording the execution time data in the file specified by the previous SpyStart instruction. If no SpyStart instruction has been executed before.

SpyStop Instructions Related information Described in: Start recording of execution data Instructions .SpyStart 2-SpyStop-382 System Data Types and Routines .

! Start loading of new program module PART_B containing routine routine_b ! in dynamic mode StartLoad \Dynamic. A program or system module can be loaded in static (default) or dynamic mode: Static mode Table 3: How different operations affect a static loaded program or system modules Set PP to main from TP Program Module System Module Not affected Not affected Open new RAPID program Unloaded Not affected Dynamic mode Table 4: How different operations affect a dynamic loaded program or system modules Set PP to main from TP Program Module System Module Unloaded Unloaded Open new RAPID program Unloaded Unloaded Both static and dynamic loaded modules can be unloaded by the instruction UnLoad. The loaded module must be connected to the program task with the instruction WaitLoad.MOD”. diskhome \File:=”PART_B. load1. When loading is in progress. before any of its symbols/routines can be used.MOD”. ! Executing in parallel in old module PART_A containing routine_a %”routine_a”%. ! Unload of old program module PART_A UnLoad diskhome \File:=”PART_A.Instructions StartLoad StartLoad Load a program module during execution StartLoad is used to start the loading of a program module into the program memory during execution. other instructions can be executed in parallel. System Data Types and Routines 2-StartLoad-383 . The loaded program module will be added to the modules already existing in the program memory. Example VAR loadsession load1.

updated by StartLoad and referenced by WaitLoad. The file name shall be excluded when the argument \File is used. [\File] Data type: string When the file name is excluded in the argument FilePath. In parallel with the loading. FilePath Data type: string The file path and the file name to the file that will be loaded into the program memory.StartLoad Instructions ! Wait until loading and linking of new program module PART_B is ready WaitLoad load1. then it must be defined with this argument. The module is loaded in dynamic mode. the program executes routine_a in module PART_A. To save linking time.MOD from diskhome into the program memory with instruction StartLoad. the instruction UnLoad and WaitLoad can be combined in the instruction WaitLoad by using the option argument \UnLoadPath. 2-StartLoad-384 System Data Types and Routines .MOD. Otherwise the loading is in static mode. Starts the loading of program module PART_B. LoadNo Data type: loadsession This is a reference to the load session that should be used in the instruction WaitLoad to connect the loaded program module to the program task. Then instruction WaitLoad waits until the loading and linking is finished. Variable load1 holds the identity of the load session. Arguments StartLoad [\Dynamic] FilePath [\File] LoadNo [\Dynamic] Data type: switch The switch enables loading of a program module in dynamic mode. ! Execution in new program module PART_B %”routine_b”%.

System Data Types and Routines 2-StartLoad-385 . is the same as Load \Dynamic. load1. The instruction WaitLoad will then wait at first for the loading to be completed.MOD from the HOME: in the directory DOORDIR into the program memory. Another way to use references to instructions that are not in the task from the beginning. if it is not already finished. WaitLoad load1.. StartLoad \Dynamic. "HOME:" \File:="/DOORDIR/DOOR1. "HOME:" \File:="/DOORDIR/DOOR1.MOD". that is easy to understand and maintain.. In this case the BindRef parameter could be set to YES (default behaviour).Instructions StartLoad Program execution Execution of StartLoad will only order the loading and then proceed directly with the next instruction. load1. The program module is loaded in dynamic mode. Same as above but with another syntax. To obtain a good program structure. Same as the two examples above but the module is loaded in static mode. Examples StartLoad \Dynamic. Loads the program module DOOR1.MOD”. load1. "HOME:" \File:="/DOORDIR/DOOR1. However. There will be a run time error on execution of an unsolved reference. which is always present in the program memory during execution. quoted between two %%. load1. without waiting for the loading to be completed. all loading and unloading of program modules should be done from the main module. and then it will be linked and initialised. is to use Late Binding. StartLoad \Dynamic. The initialisation of the loaded module sets all variables at module level to their init values. “HOME:/DOORDIR/DOOR1. StartLoad "HOME:" \File:="/DOORDIR/DOOR1. Unsolved references will be accepted if the system parameter for Tasks/BindRef is set to NO. no check for unsolved references will be done if BindRef = NO.MOD". This makes it possible to specify the routine to call with a string expression.MOD". The Late Binding way is preferable. . when the program is started or the teach pendant function Program Window/File/Check Program is used.MOD".

loadsession Instructions . Syntax StartLoad [‘\’Dynamic ‘.’ [LoadNo ’:=’] <variable (VAR) of loadsession> ’.WaitLoad Data Types .Controller/Task/ BindRef 2-StartLoad-386 System Data Types and Routines .Load Instructions .UnLoad System Parameters .’] [FilePath ’:=’] <expression (IN) of string> [’\’File ’:=’ <expression (IN) of string> ] ’.StartLoad Instructions Limitations It is not allowed to load a system module or a program module that contains a main routine.’ Related information Described in: Connect the loaded module to the task Load session Load a program module Unload a program module Accept unsolved references Instructions .

StorePath System Data Types and Routines 2-StartMove-387 . Program execution Any processes associated with the stopped movement are restarted at the same time as motion resumes.’ Related information Described in: Stopping movements More examples Instructions . Syntax StartMove’. This error can then be handled in the error handler.StopMove Instructions . the system variable ERRNO is set to ERR_PATHDIST. The robot starts to move again when the input ready_input is set. WaitDI ready_input. 1. Error handling If the robot is too far from the path (more than 10 mm or 20 degrees) to perform a start of the interrupted movement.Instructions StartMove StartMove Restarts robot motion StartMove is used to resume robot and external axes motion when this has been stopped by the instruction StopMove. Example StopMove. StartMove.

StartMove Instructions 2-StartMove-388 System Data Types and Routines .

Program execution can also be stopped using the instruction EXIT. Program execution can then be restarted from the next instruction. TPWrite “Jog the robot to the position for pallet corner 1”. Example TPWrite “The line to the host computer is broken”. If the argument NoRegain is set. This. The user can then answer. Stop. v500. System Data Types and Routines 2-Stop-389 . Arguments Stop [ \NoRegain ] Data type: switch [ \NoRegain ] Specifies for the next program start in manual mode. In automatic mode the robot and external axes always regain to the stop position. fine. since program execution cannot be restarted with EXIT. Program execution stops after a message has been written on the teach pendant. Program execution The instruction stops program execution as soon as the robot and external axes reach the programmed destination point for the movement it is performing at the time. Example MoveL p1. tool1.Instructions Stop Stop Stops program execution Stop is used to temporarily stop program execution. or if a fatal error occurs. whether or not the robot and external axes should regain to the stop position. however. Stop \NoRegain. the robot displays a question on the teach pendant. the robot and external axes will not regain to the stop position (if they have been jogged away from it). If the argument is omitted and if the robot or external axes have been jogged away from the stop position. whether or not the robot should regain to the stop position. should only be done if a task is complete.

Stop p1_read := CRobT(). For the next program start. Syntax Stop [ ’\’ NoRegain ]’.StopMove 2-Stop-390 System Data Types and Routines . tool1. z50. Limitations The movement instruction which precedes this instruction should be terminated with a stop point. so the position p1_read can be stored in the program.EXIT Instructions .’ Related information Described in: Stopping after a fatal error Terminating program execution Only stopping robot movements Instructions . in order to be able to restart in this instruction following a power failure. v500. Instructions Program execution stops with the robot at p1.EXIT Instructions . the robot does not regain to p1. The operator jogs the robot to p1_read. MoveL p2.

RestoPath. If the instruction StartMove is given. StorePath. Program execution The movements of the robot and external axes stop without the brakes being engaged..fine. Examples VAR intnum intno1. for example. Example StopMove. Move L p10.0. WaitDI di1.fine. p10:=CRobT(). CONNECT intno1 WITH go_to_home_pos.1. 1. ENDTRAP System Data Types and Routines 2-StopMove-391 . TRAP go_to_home_pos VAR robtarget p10. .tool1.v500.tool1. is set. StartMove. WaitDI ready_input.Instructions StopMove StopMove Stops robot motion StopMove is used to stop robot and external axes movements temporarily.v500.. Any processes associated with the movement in progress are stopped at the same time as the movement is stopped. StartMove. The robot movement is stopped until the input.intno1. This instruction can. ready_input. MoveL home. movement resumes. StopMove. Program execution continues without waiting for the robot and external axes to stop (standing still). ISignalDI di1. be used in a trap routine to stop the robot temporarily when an interrupt occurs.

.Interrupts Basic Characteristics. ENDTRAP Similar to the previous example.’ Related information Described in: Continuing a movement Interrupts Instructions .v500. an interrupt is activated which in turn activates the interrupt routine go_to_home_pos.tool1. the robot returns to the position at which the interrupt occurred and continues to move along the programmed path. StartMove. WaitDI di1..v500. p10:=CRobT().Interrupts 2-StopMove-392 System Data Types and Routines . Syntax StopMove’. StorePath. Move L p10. VAR intnum intno1. MoveL home. RestoPath.StartMove RAPID Summary .intno1. When di1 is set to 0. The current movement is stopped immediately and the robot moves instead to the home position.fine.fine. but the robot does not move to the home position until the current movement instruction is finished.StopMove Instructions When the input di1 is set to 1. TRAP go_to_home_pos () VAR robtarget p10. CONNECT intno1 WITH go_to_home_pos.tool1.0. ISignalDI di1. .1.

System Data Types and Routines 2-StorePath-393 . restart the movement that was stored earlier. the saved movement path can be restarted. StorePath. . following this.Instructions StorePath StorePath Stores the path when an interrupt occurs StorePath is used to store the movement path being executed when an error or interrupt occurs. MoveL p1. Program execution The current movement path of the robot and external axes is saved. when an error occurs. The current movement path is stored for later use. fine. the movement path which the robot is executing at the time is stopped at the end of the instruction (ToPoint) and stored. v100. v100. RestoPath. another movement can be started in a trap routine or an error handler. for example. Example TRAP machine_ready VAR robtarget p1. MoveL p100. p1 := CRobT(). This instruction can be used to go to a service position or to clean the gun. for example.. After this. The error handler or trap routine can then start a new movement and. tool1. ENDTRAP When an interrupt occurs that activates the trap routine machine_ready. replacing a part in the machine and the normal movement is restarted. fine. the robot remedies the interrupt by. After this. tool1. When the reason for the error or interrupt has been rectified. StartMove.. Example StorePath.

RestoPath 2-StorePath-394 System Data Types and Routines .’ Related information Described in: Restoring a path More examples Instructions .RestoPath Instructions . Only one movement path can be stored at a time. Syntax StorePath‘. the actual stop position must be stored directly after StorePath and before RestoPath make a movement to the stored stop position on the path.StorePath Instructions Limitations Only the movement path data is stored with the instruction StorePath. If the user wants to order movements on the new path level.

Instructions TEST TEST Depending on the value of an expression .. DEFAULT : TPWrite "Illegal choice".. other CASE conditions are tested.. If the value is 4. System Data Types and Routines 2-TEST-395 . and so on. ENDTEST Different instructions are executed depending on the value of reg1. TEST is used when different instructions are to be executed depending on the value of an expression or data.} [ DEFAULT: . Program execution The test data is compared with the test values in the first CASE condition. Arguments TEST Test data {CASE Test value {. Test value Data type: Same as test data The value which the test data must have for the associated instructions to be executed. If none of the conditions are satisfied. routine2 is executed. After that. Stop. program execution continues with the instruction following ENDTEST.2.3 : routine1. If the first CASE condition is not satisfied. the IF. the instructions associated with DEFAULT are executed (if this is present). If the comparison is true. the associated instructions are executed.] ENDTEST Test data Data type: All The data or expression with which the test value will be compared. Example TEST reg1 CASE 1.. CASE 4 : routine2. If there are not too many alternatives.ELSE instruction can also be used.. Otherwise... If the value is 1-3 routine1 is executed. an error message is printed and execution stops. Test value} : .

Expressions 2-TEST-396 System Data Types and Routines .’ <test value> } ’:’ <instruction list> ) | <CSE> } [ DEFAULT ’:’ <instruction list> ] ENDTEST <test value> ::= <expression> Related information Described in: Expressions Basic Characteristics .TEST Instructions Syntax (EBNF) TEST <expression> {( CASE <test value> { ’.

Axis The axis number within the mechanical unit. will give the value of the resolver angle for external robot Orbit axis 2. A test signal continuously mirrors some specified motion data stream. Data type: num System Data Types and Routines 2-TestSignDefine-397 . sampled at 100 ms rate. Test signal resolver_angle connected to channel 1. Only test signals for external robot axes can be reached.1. 2. for example. For use of the test signal for the master robot axes or the need for use of not predefined test signals. The same number must be used in the function TestSignRead for reading the actual value of the test signal. 0. Orbit. Arguments TestSignDefine Channel Channel SignalId MechUnit Axis SampleTime Data type: num The channel number 1-12 to be used for the test signal. resolver_angle. MechUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit. Refer to predefined constants described in data type testsignal. torque reference for some specified axis. Example TestSignDefine 1. SignalId Data type: testsignal The name or number of the test signal. The actual value at a certain time can be read in RAPID with the function TestSignRead.Instructions TestSignDefine TestSignDefine Define test signal TestSignDefine is used to define one test signal for the robot motion system. please contact the nearest ABB Flexible Automation centre.

1 Result from TestSignRead Mean value of the latest 8 samples generated each 0.’ [ SignalId ’:=’ ] < expression (IN) of testsignal> ’. ERRNO is set to ERR_AXIS_PAR.004 s.TestSignDefine SampleTime Sample time in seconds. If there is an error in the parameter Axis.’ [ MechUnit ’:=’ ] < variable (VAR) of mecunit> ’. the function TestSignRead returns the mean value of the latest available internal samples as shown in the table below.’ 2-TestSignDefine-398 System Data Types and Routines .001 0.004 0. The sampling of the test signal is active until: .5 ms Mean value of the latest 4 samples generated each 1 ms Mean value of the latest 2 samples generated each 2 ms Momentary value generated at specified sample time Momentary value generated at specified sample time 100 ms Program execution The definition of test signal is activated and the robot system starts the sampling of the test signal. Syntax TestSignDefine [ Channel ’:=’ ] < expression (IN) of num> ’.002 Greater or equal to 0. the system parameter ERRNO is set to ERR_UNIT_PAR. Table 5 Specification of sample time Sample Time in seconds 0 0.’ [Axis ’:=’ ] < expression (IN) of num> ’.A new TestSignDefine instruction for the actual channel is executed . Instructions Data type: num For sample time < 0.All test signals are deactivated with execution of instruction TestSignReset .’ [ SampleTime ’:=’ ] < expression (IN) of num > ’.All test signals are deactivated with a warm start of the system Error handling If there is an error in the parameter MechUnit.

TestSignRead Instructions .testsignal Functions .Instructions TestSignDefine Related information Described in: Test signal Read test signal Reset test signals Data Types .TestSignReset System Data Types and Routines 2-TestSignDefine-399 .

TestSignDefine Instructions 2-TestSignDefine-400 System Data Types and Routines .

TestSignDefine Functions . Deactivate all previously defined test signals.Instructions TestSignReset TestSignReset Reset all test signal definitions TestSignReset is used to deactivate all previously defined test signals.TestSignRead System Data Types and Routines 2-TestSignReset-401 . Program execution The definitions of all test signals are deactivated and the robot system stops the sampling of any test signals. The sampling of defined test signals is active until: .Execution of this instruction TestSignReset Syntax TestReset’.’ Related information Described in: Define test signal Read test signal Instructions .A warm start of the system . Example TestSignReset.

TestSignReset Instructions 2-TestSignReset-402 System Data Types and Routines .

it will be entered on the uppermost line of the display. Program execution The teach pendant display is completely cleared of all text. Syntax TPErase.Instructions TPErase TPErase Erases text printed on the teach pendant TPErase (Teach Pendant Erase) is used to clear the display of the teach pendant.Communication System Data Types and Routines 2-TPErase-403 . The next time text is written. Example TPErase. The teach pendant display is cleared before Execution started is written. Related information Described in: Writing on the teach pendant RAPID Summary . TPWrite "Execution started".

TPErase Instructions 2-TPErase-404 System Data Types and Routines .

the numeric value 1. stEmpty. Program execution waits until one of the function keys 4 or 5 is pressed.Instructions TPReadFK TPReadFK Reads function keys TPReadFK (Teach Pendant Read Function Key) is used to write text above the functions keys and to find out which key is depressed. stEmpty. Example TPReadFK reg1. If the function key 1 is pressed. The text More ? is written on the teach pendant display and the function keys 4 and 5 are activated by means of the text strings Yes and No respectively (see Figure 23). Text Data type: string The information text to be written on the display (a maximum of 80 characters). FK1 is the left-most key.. “Yes”. and so on. reg1 will be assigned 4 or 5 depending on which of the keys is depressed. Function keys without prompts are specified by the predefined string constant stEmpty with value empty string (“”). In other words. “More ?”. System Data Types and Routines 2-TPReadFK-405 . “No”. 1 is returned. stEmpty. More? Yes No Figure 23 The operator can input information via the function keys. FKx (Function key text) Data type: string The text to be written as a prompt for the appropriate function key (a maximum of 7 characters). depending on which key is pressed. Arguments TPReadFK Answer Text FK1 FK2 FK3 FK4 FK5 [\MaxTime] [\DIBreak] [\BreakFlag] Answer Data type: num The variable for which.5 is returned.

fine. unless the BreakFlag is used (see below). the error handler will be executed. tool1. the program continues to execute in the error handler unless the BreakFlag is used (see below). IF reg1 = 4 or OR errvar = ERR_TP_DIBREAK THEN MoveL service. The constants ERR_TP_MAXTIME and ERR_TP_ DIBREAK can be used to select the reason. The constant ERR_TP_DIBREAK can be used to test whether or not this has occurred. 2-TPReadFK-406 System Data Types and Routines .. If the display is full of text. . [\DIBreak] (Digital Input Break) Data type: signaldi The digital signal that may interrupt the operator dialog. stEmpty. Prompts are written above the appropriate function keys. Program execution The information text is always written on a new line. Keys without prompts are deactivated.TPReadFK [\MaxTime] Instructions Data type: num The maximum amount of time [s] that program execution waits. v500. “Yes”. [\BreakFlag] Data type: errnum A variable that will hold the error code if maxtime or dibreak is used. stEmpty. the program continues to execute in the error handler. If no function key is depressed within this time. TPReadFK reg1. this body of text is moved up one line first. Program execution waits until one of the activated function keys is depressed. If this optional variable is omitted. Description of concurrent TPReadFK or TPReadNum request on Teach Pendant (TP request) from same or other program tasks: • New TP request from other program task will not take focus (new put in queue) • New TP request from TRAP in the same program task will take focus (old put in queue) • Program stop take focus (old put in queue) • New TP request in program stop state takes focus (old put in queue) Example VAR errnum errvar. stEmpty.. The constant ERR_TP_MAXTIME can be used to test whether or not the maximum time has elapsed. If no function key is depressed when the signal is set to 1 (or is already 1). Strings longer than the width of the teach pendant (40 characters) are split into two lines. “No” \MaxTime:= 600 \DIBreak:= di5\BreakFlag:= errvar. “Go to service position?”.

If no answer is given within 10 minutes.’ [Text’:=’] <expression (IN) of string>’. Syntax TPReadFK [Answer’:=’] <var or pers (INOUT) of num>’. or if the input 5 is activated. Error handling If there is a timeout (parameter \MaxTime) before an input from the operator. If digital input is set (parameter \DIBreak) before an input from the operator. Predefined data CONST string stEmpty := “”. the system variable ERRNO is set to ERR_TP_DIBREAK and the execution continues in the error handler. ENDIF IF errvar = ERR_TP_MAXTIME EXIT. Using stEmpty instead of “”saves about 80 bytes for every Function Key without prompts. the execution is terminated.’ [FK1 ’:=’] <expression (IN) of string>’. These situations can then be dealt with by the error handler.’ System Data Types and Routines 2-TPReadFK-407 .’ [FK3 ’:=’] <expression (IN) of string>’.’ [FK4 ’:=’] <expression (IN) of string>’.’ [FK5 ’:=’] <expression (IN) of string> [’\’MaxTime ’:=’ <expression (IN) of num>] [’\’DIBreak ’:=’ <variable (VAR) of signaldi>] [’\’BreakFlag ’:=’ <var or pers (INOUT) of errnum>]’.Instructions Stop. The predefined constant stEmpty should be used for Function Keys without prompts. the system variable ERRNO is set to ERR_TP_MAXTIME and the execution continues in the error handler.’ [FK2 ’:=’] <expression (IN) of string>’. TPReadFK The robot is moved to the service position if the forth function key (“Yes”) is pressed.

TPReadFK Instructions Related information Described in: Writing to and reading from the teach pendant Replying via the teach pendant RAPID Summary .Communication Running Production 2-TPReadFK-408 System Data Types and Routines .

If this optional variable is omitted. The text How many units should be produced? is written on the teach pendant display. the program continues to execute in the error handler unless the BreakFlag is used (see below). That number is stored in reg1. The constant ERR_TP_DIBREAK can be used to test whether or not this has occurred. Program execution waits until a number has been input from the numeric keyboard on the teach pendant. Arguments TPReadNum Answer String [\MaxTime] [\DIBreak] [\BreakFlag] Answer Data type: num The variable for which the number input via the teach pendant is returned. Example TPReadNum reg1.Instructions TPReadNum TPReadNum Reads a number from the teach pendant TPReadNum (Teach Pendant Read Numerical) is used to read a number from the teach pendant. [\BreakFlag] Data type: errnum A variable that will hold the error code if maxtime or dibreak is used. the error handler will be executed. “How many units should be produced?“. the program continues to execute in the error handler unless the BreakFlag is used (see below). [\MaxTime] Data type: num The maximum amount of time that program execution waits.The constants ERR_TP_MAXTIME and ERR_TP_ DIBREAK can be used to select the reason. The constant ERR_TP_MAXTIME can be used to test whether or not the maximum time has elapsed. If no number is input within this time. If no number is input when the signal is set to 1 (or is already 1). System Data Types and Routines 2-TPReadNum-409 . String Data type: string The information text to be written on the teach pendant (a maximum of 80 characters). [\DIBreak] (Digital Input Break) Data type: signaldi The digital signal that may interrupt the operator dialog.

the system variable ERRNO is set to ERR_TP_MAXTIME and the execution continues in the error handler. If the display is full of text. Reference to TPReadFK about description of concurrent TPReadFK or TPReadNum request on Teach Pendant from same or other program tasks. Error handling If there is a timeout (parameter \MaxTime) before an input from the operator. If a digital input is set (parameter \DIBreak) before an input from the operator.’ [String’:=’] <expression (IN) of string> [’\’MaxTime ’:=’ <expression (IN) of num>] [’\’DIBreak ’:=’ <variable (VAR) of signaldi>] [’\’BreakFlag ’:=’ <var or pers (INOUT) of errnum>] ’. Syntax TPReadNum [Answer’:=’] <var or pers (INOUT) of num>’. “How many units should be produced?“. Program execution waits until a number is typed on the numeric keyboard (followed by Enter or OK). These situations can then be dealt with by the error handler. the system variable ERRNO is set to ERR_TP_DIBREAK and the execution continues in the error handler. ENDFOR The text How many units should be produced? is written on the teach pendant display.TPReadNum Instructions Program execution The information text is always written on a new line. this body of text is moved up one line first. The routine produce_part is then repeated the number of times that is input via the teach pendant. FOR i FROM 1 TO reg1 DO produce_part. Strings longer than the width of the teach pendant (40 characters) are split into two lines. Example TPReadNum reg1.’ 2-TPReadNum-410 System Data Types and Routines .

Communication Production Running Instructions .Instructions TPReadNum Related information Described in: Writing to and reading from the teach pendant Entering a number on the teach pendant Examples of how to use the arguments MaxTime.TPReadFK System Data Types and Routines 2-TPReadNum-411 . DIBreak and BreakFlag RAPID Summary .

TPReadNum Instructions 2-TPReadNum-412 System Data Types and Routines .

CONST tpnum TP_SCREENVIEWER := 3. Predefined data CONST tpnum TP_PROGRAM := 1. Program execution The selected Teach Pendant Window will be activated. TPShow TP_LATEST. = Latest used Teach Pendant Window before current Teach Pendant Window. Arguments TPShow Window The window to show: TP_PROGRAM TP_LATEST = Production Window if in AUTO mode. System Data Types and Routines 2-TPShow-413 .Instructions TPShow TPShow Switch window on the teach pendant TPShow (Teach Pendant Show) is used to select Teach Pendant Window from RAPID. The latest used Teach Pendant Window before the current Teach Pendant Window will be active after execution of this instruction. Program Window if in MAN mode. The Production Window will be active if the system is in AUTO mode and the Program Window will be active if the system is in MAN mode after execution of this instruction. Examples TPShow TP_PROGRAM. Window Data type: tpnum TP_SCREENVIEWER = Screen Viewer Window. CONST tpnum TP_LATEST := 2. if the Screen Viewer option is active.

TPShow Instructions Syntax TPShow [Window’:=’] <expression (IN) of tpnum> ‘.Communication Data Types .’ Related information Described in: Communicating using the teach pendant Teach Pendant Window number RAPID Summary .tpnum 2-TPShow-414 System Data Types and Routines .

[\Pos] (Position) Data type: pos The data whose position is to be written after the text string. [\Bool] (Boolean) Data type: bool The data whose logical value is to be written after the text string. Examples TPWrite "Execution started". When the display is full of text. System Data Types and Routines 2-TPWrite-415 .Instructions TPWrite TPWrite Writes on the teach pendant TPWrite (Teach Pendant Write) is used to write text on the teach pendant. Arguments TPWrite String String [\Num] | [\Bool] | [\Pos] | [\Orient] Data type: string The text string to be written (a maximum of 80 characters). Strings that are longer than the width of the teach pendant (40 characters) are divided up into two lines. for example. enter 5 instead of reg1 on the teach pendant. this text is moved up one line first. the answer to No of produced parts=5. The text Execution started is written on the teach pendant. [\Orient] (Orientation) Data type: orient The data whose orientation is to be written after the text string. TPWrite "No of produced parts="\Num:=reg1. [\Num] (Numeric) Data type: num The data whose numeric value is to be written after the text string. The value of certain data can be written as well as text. If. Program execution Text written on the teach pendant always begins on a new line.

TPWrite Instructions If one of the arguments \Num.Communication 2-TPWrite-416 System Data Types and Routines .17.3.0.000005 or greater than 0.0.0] Text string "23" "1.25882.3.879. \Bool. \Bool.905.96593.905. the number is rounded to an integer. Limitations The arguments \Num.879. The conversion from value to text string takes place as follows: Argument \Num \Num \Bool \Pos \Orient Value 23 1.96593.17.0]" The value is converted to a string with standard RAPID format.999995.14137" "TRUE" "[1817.0. its value is first converted to a text string before it is added to the first string.’ Related information Described in: Clearing and reading the teach pendant RAPID Summary .11] [0.141367 TRUE [1817. \Pos or \Orient is used. If the decimal part is less than 0. This means in principle 6 significant digits. \Pos and \Orient are mutually exclusive and thus cannot be used simultaneously in the same instruction.25882.0.11]" "[0. Syntax TPWrite [String’:=’] <expression (IN) of string> [’\’Num’:=’ <expression (IN) of num> ] | [’\’Bool’:=’ <expression (IN) of bool> ] | [’\’Pos’:=’ <expression (IN) of pos> ] | [’\’Orient’:=’ <expression (IN) of orient> ]’.

fine. or error 40082 Deceleration limit. Start point p1 End point p3 Circle point p2 The output signal gun is set to on when the TCP of the robot is here Figure 24 Example of fixed-position IO event. gun1.gunon. and afterwards these definitions are referred to in the instruction TriggC. 6) events can be defined using the instructions TriggIO. Arguments TriggC [\Conc] CirPoint ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4] [ \T5] [ \T6] Zone [ \Inpos] Tool [ \WObj ] [ \Corr ] (Concurrent) Data type: switch [ \Conc ] Subsequent instructions are executed at once.Instructions TriggC TriggC Circular robot movement with events TriggC (Trigg Circular) is used to set output signals and/or run interrupt routines at fixed positions. for example. This argument is used to shorten the cycle time when. on. TriggEquip. Examples VAR triggdata gunon. TriggC p2. In a program section that includes StorePath- System Data Types and Routines 2-TriggC-417 . gun1. 0 \Start \DOp:=gun. at the same time as the robot is moving on a circular path. the number of movement instructions in succession is limited to 5. to avoid warning 50024 Corner path failure. gunon. v500. and synchronisation is not required. When using the argument \Conc. It can also be used to tune the execution of the robot path. TriggIO gunon. fine. p3. MoveL p1. v500. z50. communicating with external equipment. or TriggInt. gun1. The digital output signal gun is set when the robot’s TCP passes the midpoint of the corner path of the point p1. One or more (max. p3. v500. TriggC p2.

TriggEquip or TriggInt. defined earlier in the program using the instructions TriggIO. Trigg_1 Data type: triggdata Variable that refers to trigger conditions and trigger activity. Speed data defines the velocity of the tool centre point. defined earlier in the program using the instructions TriggIO. TriggEquip or TriggInt. It is then substituted for the corresponding speed data. defined earlier in the program using the instructions TriggIO. [ \T2] (Trigg 2) Data type: triggdata Variable that refers to trigger conditions and trigger activity. TriggEquip or TriggInt. [ \T5 ] (Trigg 5) Data type: triggdata Variable that refers to trigger conditions and trigger activity. the subsequent instruction is executed some time before the robot has reached the programmed zone. TriggEquip or TriggInt. movement instructions with the argument \Conc are not permitted. defined earlier in the program using the instructions TriggIO. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). See the instruction MoveC for a more detailed description of circular movement. [ \T ] (Time) Data type: num This argument is used to specify the total time in seconds during which the robot moves. If this argument is omitted and the ToPoint is not a stop point. [ \T4 ] (Trigg 4) Data type: triggdata Variable that refers to trigger conditions and trigger activity. 2-TriggC-418 System Data Types and Routines . TriggEquip or TriggInt. ToPoint Data type: robtarget The destination point of the robot and external axes. defined earlier in the program using the instructions TriggIO. CirPoint Data type: robtarget The circle point of the robot. the external axes and of the tool reorientation. [ \T3 ] (Trigg 3) Data type: triggdata Variable that refers to trigger conditions and trigger activity.TriggC Instructions RestoPath. Speed Data type: speeddata The speed data that applies to movements. The circle point is defined as a named position or stored directly in the instruction (marked with an * in the instruction).

this argument must be specified for a linear movement relative to the work object to be performed. on the other hand. As the trigger conditions are fulfilled when the robot is positioned closer and closer to the end point. During stepping execution backwards. Program execution See the instruction MoveC for information about circular movement. the I/O activities are carried out but the interrupt routines are not run. The stop point data substitutes the zone specified in the Zone parameter. The tool centre point is the point that is moved to the specified destination position.Instructions [ \T6 ] (Trigg 6) TriggC Data type: triggdata Variable that refers to trigger conditions and trigger activity. Zone data describes the size of the generated corner path. During stepping execution forwards. [ \WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the robot position in the instruction is related. System Data Types and Routines 2-TriggC-419 . Tool Data type: tooldata The tool in use when the robot moves. defined earlier in the program using the instructions TriggIO. if this argument is present. Zone Data type: zonedata Zone data for the movement. the defined trigger activities are carried out. [ \Corr] (Correction) Data type: switch Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position. or at a certain point in time (limited to a short time) before the end point of the instruction. or at a certain distance after the start point of the instruction. and if it is. TriggEquip or TriggInt. no trigger activities at all are carried out. If. the position is related to the world coordinate system. The trigger conditions are fulfilled either at a certain distance before the end point of the instruction. a stationary TCP or coordinated external axes are used. [\Inpos] (In position) Data type: stoppointdata This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. This argument can be omitted.

. v500.. CONNECT intno1 WITH trap1.. IDelete intno1. Limitations If the current start point deviates from the usual. TriggC p3. v500. gun1. trigg1.. 0..1 s before the point p2 or p4 respectively. The program logic in the user program may not be based on a normal sequence of trigger activities for an “incomplete movement”. p4. fine. TriggInt trigg1.. intno1. Otherwise the robot will not take the programmed path (positioning around the circular path in another direction compared with that programmed). In such cases. . TriggC p1. fine. the sequence in which the trigger activities are carried out will be undefined. The interrupt routine trap1 is run when the work point is at a position 0. The instruction TriggC should never be started from the beginning with the robot in position after the circle point..TriggC Instructions Examples VAR intnum intno1. p2. so that the total positioning length of the instruction TriggC is shorter than usual.1 \Time. gun1. VAR triggdata trigg1. trigg1. it may happen that several or all of the trigger conditions are fulfilled immediately and at the same position. . 2-TriggC-420 System Data Types and Routines .

TriggL Instructions .speeddata Data Types .’ [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’.’ Related information Described in: Linear movement with triggers Joint movement with triggers Definition of triggers Writes to a corrections entry Circular movement Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Motion in general Instructions .stoppointdata Data Types . TriggEquip TriggInt Instructions .CorrWrite Motion Principles .TriggIO.TriggJ Instructions .tooldata Data Types .’ [Trigg_1 ’:=’ ] < variable (VAR) of triggdata > [ ’\’ T2 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T3 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T4 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T5 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T6 ’:=’ < variable (VAR) of triggdata > ] ‘.’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’.Positioning during Program Execution Data Types .’] [ CirPoint ’:=’ ] < expression (IN) of robtarget > ’.Instructions TriggC Syntax TriggC [’\’ Conc ’.wobjdata Motion Principles System Data Types and Routines 2-TriggC-421 .zonedata Data Types .’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’.’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ]‘.

TriggC Instructions 2-TriggC-422 System Data Types and Routines .

gun1. Distance Data type: num Defines the position on the path where the I/O equipment event shall occur. End point p1 10 mm Point p2 for open of the gun Figure 25 Example of fixed position-time I/O event. a group of digital.1 \DOp:=gun. The data defined is used for implementation in one or more subsequent TriggL. 10. z50. 1. TriggEquip gunon. the digital output signal gun is set to the value 1. Start point TriggL p1. z50. Arguments TriggEquip TriggData Distance [ \Start ] EquipLag [ \DOp ] | [ \GOp ] | [\AOp ] | [\ProcID ] SetValue [ \Inhib ] TriggData Data type: triggdata Variable for storing the triggdata returned from this instruction. TriggC or TriggJ instructions. v500. 0. Examples VAR triggdata gunon. System Data Types and Routines 2-TriggEquip-423 . Specified as the distance in mm (positive value) from the end point of the movement path (applicable if the argument \ Start is not set). when the TCP is 10 mm before the point p1. v500. The tool gun1 opens in point p2. gunon. To reach this.1 s before the point p2. TriggC or TriggJ instructions. These triggdata are then used in the subsequent TriggL. TriggL p1. gunon. when TCP is 0. or an analog output signal at a fixed position along the robot’s movement path with possibility to do time compensation for the lag in the external equipment. gun1.Instructions TriggEquip TriggEquip Defines a fixed position-time I/O event TriggEquip (Trigg Equipment) is used to define conditions and actions for setting a digital. The gun is full open when TCP reach point p2.

EquipLag (Equipment Lag) Data type: num Specify the lag for the external equipment in s. (The identity of the IPM process to receive the event. [ \ProcID] (Process Identity) Data type: num Not implemented for customer use. [ \Start ] Instructions Data type: switch Used when the distance for the argument Distance starts at the movement start point instead of the end point. [ \GOp ] (Group OutPut) Data type: signalgo The name of the signal. when a digital output signal shall be changed. For compensation of external equipment lag.) 2-TriggEquip-424 System Data Types and Routines . Start point Distance \Start Distance End point + - + - EquipLag Figure 26 Use of argument EquipLag. [ \DOp ] (Digital OutPut) Data type: signaldo The name of the signal.TriggEquip See the section entitled Program execution for further details. use positive argument value. Positive argument value means that the I/O signal is set by the robot system at specified time before the TCP physical reach the specified distance in relation to the movement start or end point. The selector is specified in the argument SetValue. Negative argument value means that the I/O signal is set by the robot system at specified time after that the TCP physical has passed the specified distance in relation to the movement start or end point. when a group of digital output signals shall be changed. [ \AOp ] (Analog Output) Data type: signalao The name of the signal. when a analog output signal shall be changed.

. if the specified distance from the end point (start point) is not within the length of movement of the current instruction (Trigg. Program execution When running the instruction TriggEquip. The position-time related event will be generated when the start point (end point) is passed. With use of argument EquipLag with negative time (delay). Afterwards. [ \Inhib ] (Inhibit) Data type: bool The name of a persistent variable flag for inhibit the setting of the signal at runtime. when one of the instructions TriggL. System Data Types and Routines 2-TriggEquip-425 . If this optional argument is used and the actual value of the specified flag is TRUE at the position-time for setting of the signal then the specified signal (DOp. GOp or AOp) will be set to 0 in stead of specified value. the output signal is set when the robot’s TCP is here Figure 27 Fixed position-time I/O on a corner path. End point with corner path If the Distance is 0. the following are applicable..). the I/O signal can be set after the end point.Instructions SetValue TriggEquip Data type: num Desired value of output signal (within the allowed range for the current signal). the trigger condition is stored in the specified variable for the argument TriggData. with regard to the definitions in TriggEquip: The distance specified in the argument Distance: Linear movement Circular movement Non-linear movement The straight line distance The circle arc length The approximate arc length along the path (to obtain adequate accuracy. TriggC or TriggJ is executed. the distance should not exceed one half of the arc length).

The analog output signal glue is set to the value 5. 0. 0.Accuracy specified below is valid for positive EquipLag parameter < 60 ms. z50.05 s. . the following is applicable when setting a digital output at a specified distance from the start point or end point in the instruction TriggL or TriggC: . z50. which is max. approx. MoveJ p1. TriggL p2. but not until braking is started (later than specified).Accuracy specified below is valid for negative EquipLag.3 when the TCP passes a point located 1 mm after the start point p2. tool1. the event will be generated anyhow. TriggEquip glueflow. v500.. tool1. The analog output signal glue is set once more to the value 5. glueflow. an approximate method is used in which the dynamic limitations of the robot are not taken into consideration. . However.Accuracy specified below is valid for positive EquipLag parameter < configured Event Preset Time (system parameter). results in worse accuracy than specified below. using stop points.5 s (typical values at speed 500 mm/s for IRB2400 150 ms and for IRB6400 250 ms). If the specified time is greater that the current braking time.05 \AOp:=glue. v1000. Limitations I/O events with distance (without the argument \Time) is intended for flying points (corner path). I/O events with time (with the argument \Time) is intended for stop points. results in worse accuracy than specified below. 2-TriggEquip-426 System Data Types and Routines . SingArea \Wrist must be used in order to achieve an acceptable accuracy. .Accuracy specified below is not valid for positive EquipLag parameter > configured Event Preset Time (system parameter). v500.TriggEquip Instructions Examples VAR triggdata glueflow. equivalent to the lag in the robot servo (without changing the system parameter Event Preset Time).3 when the TCP passes a point located 1 mm after the start point p1 with compensation for equipment lag 0. glueflow. z50. This time cannot exceed the current braking time of the robot. In this case. .3. I/O events with time. the whole of the movement time for the current movement can be utilised during small and fast movements. 5. Regarding the accuracy for I/O events with distance and using flying points. using flying points.. TriggL p3. I/O events with time can only be specified from the end point of the movement. tool1. I/O events with distance. 1 \Start.

TriggL. SetGO.2 ms.triggdata Instructions .’ Related information Described in: Use of triggers Definition of other triggs More examples Set of I/O Configuration of Event preset time Instructions .’ [ SetValue ’:=’ ] < expression (IN) of num> [ ’\’ Inhibit ’:=’ < persistent (PERS) of bool> ] ‘. TriggInt Data Types . TriggJ Instruction .’ [ EquipLag ’:=’ ] < expression (IN) of num> [ ’\’ DOp ’:=’ < variable (VAR) of signaldo> ] | [ ’\’ GOp ’:=’ < variable (VAR) of signalgo> ] | [ ’\’ AOp ’:=’ < variable (VAR) of signalao> ] | [ ’\’ ProcID ’:=’ < expression (IN) of num> ] ‘.5 ms.SetDO. TriggC.TriggIO. SetAO User‘s guide System Parameters Manipulator System Data Types and Routines 2-TriggEquip-427 . TriggEquip Syntax TriggEquip [ TriggData ’:=’ ] < variable (VAR) of triggdata> ‘.’ [ Distance ’:=’ ] < expression (IN) of num> [ ’\’ Start ] ‘. Typical repeat accuracy values for set of digital outputs +/.Instructions Typical absolute accuracy values for set of digital outputs +/.

TriggEquip Instructions 2-TriggEquip-428 System Data Types and Routines .

trigg1. TriggL p1. TriggC or TriggJ instructions.. gun1. CONNECT intno1 WITH trap1. trigg1. IDelete intno1. intno1.. Arguments TriggInt TriggData Distance [ \Start ] | [ \Time ] Interrupt TriggData Data type: triggdata Variable for storing the triggdata returned from this instruction. v500. z50. v500. . These triggdata are then used in the subsequent TriggL. System Data Types and Routines 2-TriggInt-429 . . The data defined is used for implementation in one or more subsequent TriggL. v500. trigg1. End point p1 or p2 5 mm The interrupt is generated when the TCP is here Figure 28 Example position related interrupt. gun1. 5. The interrupt routine trap1 is run when the TCP is at a position 5 mm before the point p1 or p2 respectively. z50. z50. TriggC or TriggJ instructions. VAR triggdata trigg1. . TriggInt trigg1.Instructions TriggInt TriggInt Defines a position related interrupt TriggInt is used to define conditions and actions for running an interrupt routine at a position on the robot’s movement path.. TriggL p2... Examples VAR intnum intno1.. Start point TriggL p1. gun1.

with regard to the definitions in TriggInt: 2-TriggInt-430 System Data Types and Routines .TriggInt Distance Instructions Data type: num Defines the position on the path where the interrupt shall be generated. Position related interrupts in time can only be used for short times (< 0. [ \Start ] Data type: switch Used when the distance for the argument Distance starts at the movement start point instead of the end point.5 s) before the robot reaches the end point of the instruction. data is stored in a specified variable for the argument TriggData and the interrupt that is specified in the variable for the argument Interrupt is activated. Specified as the distance in mm (positive value) from the end point of the movement path (applicable if the argument \ Start or \Time is not set). [ \Time ] Data type: switch Used when the value specified for the argument Distance is in fact a time in seconds (positive value) instead of a distance. See the section entitled Limitations for more details. when one of the instructions TriggL. See the section entitled Program execution for further details. Afterwards. the following are applicable. TriggC or TriggJ is executed. Interrupt Variable used to identify an interrupt. Data type: intnum Program execution When running the instruction TriggInt.

The interrupt number in the variable intno2 is flagged as used . CONNECT intno2 WITH trap2. z50.The interrupt is activated . trigg2. . System Data Types and Routines 2-TriggInt-431 . End point with corner path If the Distance is 0. the interrupt will be generated when the robot’s TCP is here Figure 29 Position related interrupt on a corner path. Examples This example describes programming of the instructions that interact to generate position related interrupts: VAR intnum intno2.Declaration of the variables intno2 and trigg2 (shall not be initiated). The position related interrupt will be generated when the start point (end point) is passed. .Allocation of interrupt numbers that are stored in the variable intno2 . intno2..The robot is moved to the point p1. the distance should not exceed one half of the arc length). VAR triggdata trigg2.When the TCP reaches the point p1.Defined trigger conditions and interrupt number are stored in the variable trigg2 TriggL p1. gun1. . an interrupt is generated and the interrupt routine trap2 is run. ..). v500. 0.The interrupt number is coupled to the interrupt routine trap2 TriggInt trigg2. if the specified distance from the end point (start point) is not within the length of movement of the current instruction (Trigg.Instructions The distance specified in the argument Distance: Linear movement Circular movement Non-linear movement The straight line distance The circle arc length TriggInt The approximate arc length along the path (to obtain adequate accuracy. .

0. Limitations Interrupt events with distance (without the argument \Time) is intended for flying points (corner path).’ 2-TriggInt-432 System Data Types and Routines .TriggInt TriggL p2.2 ms. I/O events with time can only be specified from the end point of the movement. (Ref. If the specified time is greater that the current braking time. z50. to Basic Characteristics RAPID . trigg2. results in worse accuracy than specified below. an interrupt is generated and the interrupt routine trap2 is run once more. This time cannot exceed the current braking time of the robot. Normally there is a delay of 5 to 120 ms between interrupt generation and response. gun1.The interrupt number in the variable intno2 is de-allocated.5 s (typical values at speed 500 mm/s for IRB2400 150 ms and for IRB6400 250 ms).5 ms.When the TCP reaches the point p2. . but not until braking is started (later than specified). the whole of the movement time for the current movement can be utilised during small and fast movements. results in worse accuracy than specified below. depending on the type of movement being performed at the time of the interrupt. v500. the event will be generated anyhow.’ [ Interrupt ’:=’ ] < variable (VAR) of intnum> ’. Typical repeat accuracy values for generation of interrupts +/. .’ [ Distance ’:=’ ] < expression (IN) of num> [ ’\’ Start ] | [ ’\’ Time ] ’. approx. Interrupt events with distance. Typical absolute accuracy values for generation of interrupts +/. which is max. IDelete intno2. To obtain the best accuracy when setting an output at a fixed position along the robot’s path. Interrupt events with time (with the argument \Time) is intended for stop points.The robot is moved to the point p2 Instructions .Interrupts). Syntax TriggInt [ TriggData ’:=’ ] < variable (VAR) of triggdata> ‘. However. use the instructions TriggIO or TriggEquip in preference to the instructions TriggInt with SetDO/SetGO/SetAO in an interrupt routine. using flying points. Interrupt events with time. using stop points.

Instructions

TriggInt

Related information
Described in: Use of triggers Definition of position fix I/O More examples Interrupts Instructions - TriggL, TriggC, TriggJ Instruction - TriggIO, TriggEquip Data Types - triggdata Basic Characteristics - Interrupts

System Data Types and Routines

2-TriggInt-433

TriggInt

Instructions

2-TriggInt-434

System Data Types and Routines

Instructions

TriggIO

TriggIO

Defines a fixed position I/O event

TriggIO is used to define conditions and actions for setting a digital, a group of digital, or an analog output signal at a fixed position along the robot’s movement path. To obtain a fixed position I/O event, TriggIO compensates for the lag in the control system (lag between robot and servo) but not for any lag in the external equipment. For compensation of both lags use TriggEquip. The data defined is used for implementation in one or more subsequent TriggL, TriggC or TriggJ instructions.

Examples
VAR triggdata gunon; TriggIO gunon, 10 \DOp:=gun, 1; TriggL p1, v500, gunon, z50, gun1; The digital output signal gun is set to the value 1 when the TCP is 10 mm before the point p1.

Start point

TriggL p1, v500, gunon, z50, gun1;

End point p1

10 mm
The output signal gun is set when the TCP is here Figure 30 Example of fixed-position IO event.

Arguments TriggIO TriggData Distance [ \Start ] | [ \Time ] [ \DOp ] | [ \GOp ] | [\AOp ] | [\ProcID ] SetValue [ \DODelay ]
TriggData Data type: triggdata

Variable for storing the triggdata returned from this instruction. These triggdata are then used in the subsequent TriggL, TriggC or TriggJ instructions.

System Data Types and Routines

2-TriggIO-435

TriggIO
Distance

Instructions
Data type: num

Defines the position on the path where the I/O event shall occur. Specified as the distance in mm (positive value) from the end point of the movement path (applicable if the argument \ Start or \Time is not set). See the section entitled Program execution for further details. [ \Start ] Data type: switch

Used when the distance for the argument Distance starts at the movement start point instead of the end point. [ \Time ] Data type: switch

Used when the value specified for the argument Distance is in fact a time in seconds (positive value) instead of a distance. Fixed position I/O in time can only be used for short times (< 0.5 s) before the robot reaches the end point of the instruction. See the section entitled Limitations for more details. [ \DOp ] (Digital OutPut) Data type: signaldo

The name of the signal, when a digital output signal shall be changed. [ \GOp ] (Group OutPut) Data type: signalgo

The name of the signal, when a group of digital output signals shall be changed. [ \AOp ] (Analog Output) Data type: signalao

The name of the signal, when a analog output signal shall be changed. [ \ProcID] (Process Identity) Data type: num

Not implemented for customer use. (The identity of the IPM process to receive the event. The selector is specified in the argument SetValue.) SetValue Data type: num

Desired value of output signal (within the allowed range for the current signal). [ \DODelay] (Digital Output Delay) Data type: num

Time delay in seconds (positive value) for a digital output signal or group of digital output signals. Only used to delay setting digital output signals, after the robot has reached the specified position. There will be no delay if the argument is omitted. The delay is not synchronised with the movement. 2-TriggIO-436 System Data Types and Routines

Instructions

TriggIO

Program execution
When running the instruction TriggIO, the trigger condition is stored in a specified variable for the argument TriggData. Afterwards, when one of the instructions TriggL, TriggC or TriggJ is executed, the following are applicable, with regard to the definitions in TriggIO: The distance specified in the argument Distance: Linear movement Circular movement Non-linear movement The straight line distance The circle arc length The approximate arc length along the path (to obtain adequate accuracy, the distance should not exceed one half of the arc length).
End point with corner path If the Distance is 0, the output signal is set when the robot’s work point is here

Figure 31 Fixed position I/O on a corner path.

The fixed position I/O will be generated when the start point (end point) is passed, if the specified distance from the end point (start point) is not within the length of movement of the current instruction (Trigg...).

Examples
VAR triggdata glueflow; TriggIO glueflow, 1 \Start \AOp:=glue, 5.3; MoveJ p1, v1000, z50, tool1; TriggL p2, v500, glueflow, z50, tool1; The analog output signal glue is set to the value 5.3 when the work point passes a point located 1 mm after the start point p1. ... TriggL p3, v500, glueflow, z50, tool1; The analog output signal glue is set once more to the value 5.3 when the work point passes a point located 1 mm after the start point p2.

System Data Types and Routines

2-TriggIO-437

TriggIO

Instructions

Limitations
I/O events with distance (without the argument \Time) is intended for flying points (corner path). I/O events with distance, using stop points, results in worse accuracy than specified below. I/O events with time (with the argument \Time) is intended for stop points. I/O events with time, using flying points, results in worse accuracy than specified below. I/O events with time can only be specified from the end point of the movement. This time cannot exceed the current braking time of the robot, which is max. approx. 0.5 s (typical values at speed 500 mm/s for IRB2400 150 ms and for IRB6400 250 ms). If the specified time is greater that the current braking time, the event will be generated anyhow, but not until braking is started (later than specified). However, the whole of the movement time for the current movement can be utilised during small and fast movements. Typical absolute accuracy values for set of digital outputs +/- 5 ms. Typical repeat accuracy values for set of digital outputs +/- 2 ms.

Syntax
TriggIO [ TriggData ’:=’ ] < variable (VAR) of triggdata> ‘,’ [ Distance ’:=’ ] < expression (IN) of num> [ ’\’ Start ] | [ ’\’ Time ] [ ’\’ DOp ’:=’ < variable (VAR) of signaldo> ] | [ ’\’ GOp ’:=’ < variable (VAR) of signalgo> ] | [ ’\’ AOp ’:=’ < variable (VAR) of signalao> ] | [ ’\’ ProcID ’:=’ < expression (IN) of num> ] ‘,’ [ SetValue ’:=’ ] < expression (IN) of num> [ ’\’ DODelay ’:=’ < expression (IN) of num> ] ‘;’

Related information
Described in: Use of triggers Definition of position-time I/O event Definition of position related interrupts More examples Set of I/O Instructions - TriggL, TriggC, TriggJ Instruction - TriggEquip Instruction - TriggInt Data Types - triggdata Instructions - SetDO, SetGO, SetAO

2-TriggIO-438

System Data Types and Routines

Instructions

TriggJ

TriggJ

Axis-wise robot movements with events
TriggJ (TriggJoint) is used to set output signals and/or run interrupt routines at fixed positions, at the same time as the robot is moving quickly from one point to another when that movement does not have be in a straight line. One or more (max. 6) events can be defined using the instructions TriggIO, TriggEquip, or TriggInt, and afterwards these definitions are referred to in the instruction TriggJ.

Examples
VAR triggdata gunon; TriggIO gunon, 0 \Start \DOp:=gun, on; MoveL p1, v500, z50, gun1; TriggJ p2, v500, gunon, fine, gun1; The digital output signal gun is set when the robot’s TCP passes the midpoint of the corner path of the point p1.

Start point p1

TriggJ p2, v500,gunon, fine, gun1;

End point p2

The output signal gun is set to on when the robot’s TCP is here Figure 32 Example of fixed-position IO event.

Arguments TriggJ
[ \Conc ]

[\Conc] ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4 ] [ \T5 ] [ \T6 ] Zone [ \Inpos ] Tool [ \WObj ]
(Concurrent) Data type: switch

Subsequent logical instructions are executed while the robot is moving. This argument is used to shorten the cycle time when, for example, communicating with external equipment, if synchronisation is not required. It can also be used to tune the execution of the robot path, to avoid warning 50024 Corner path failure or error 40082 Deceleration limit. Using the argument \Conc, the number of movement instructions in succession is limited to 5. In a program section that includes StorePath-RestoPath, move-

System Data Types and Routines

2-TriggJ-439

TriggJ
ment instructions with the argument \Conc are not permitted.

Instructions

If this argument is omitted, the subsequent instruction is only executed after the robot has reached the specified stop point or 100 ms before the specified zone. ToPoint Data type: robtarget

The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Speed Data type: speeddata

The speed data that applies to movements. Speed data defines the velocity of the tool centre point, the external axes and of the tool reorientation. [ \T ] (Time) Data type: num

This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Trigg_1 Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T2] (Trigg 2) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T3 ] (Trigg 3) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T4 ] (Trigg 4) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T5 ] (Trigg 5) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T6 ] (Trigg 6) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. Zone Data type: zonedata Zone data for the movement. Zone data describes the size of the generated corner path.

2-TriggJ-440

System Data Types and Routines

Instructions
[\Inpos] (In position)

TriggJ
Data type: stoppointdata

This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. The stop point data substitutes the zone specified in the Zone parameter. Tool Data type: tooldata The tool in use when the robot moves. The tool centre point is the point that is moved to the specified destination position. [ \WObj] (Work Object) Data type: wobjdata

The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted, and if it is, the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used, this argument must be specified for a linear movement relative to the work object to be performed.

Program execution
See the instruction MoveJ for information about joint movement. As the trigger conditions are fulfilled when the robot is positioned closer and closer to the end point, the defined trigger activities are carried out. The trigger conditions are fulfilled either at a certain distance before the end point of the instruction, or at a certain distance after the start point of the instruction, or at a certain point in time (limited to a short time) before the end point of the instruction. During stepping execution forwards, the I/O activities are carried out but the interrupt routines are not run. During stepping execution backwards, no trigger activities at all are carried out.

Examples
VAR intnum intno1; VAR triggdata trigg1; ... CONNECT intno1 WITH trap1; TriggInt trigg1, 0.1 \Time, intno1; ... TriggJ p1, v500, trigg1, fine, gun1; TriggJ p2, v500, trigg1, fine, gun1; ... IDelete intno1; The interrupt routine trap1 is run when the work point is at a position

System Data Types and Routines

2-TriggJ-441

TriggJ
0.1 s before the point p1 or p2 respectively.

Instructions

Limitations
If the current start point deviates from the usual, so that the total positioning length of the instruction TriggJ is shorter than usual (e.g. at the start of TriggJ with the robot position at the end point), it may happen that several or all of the trigger conditions are fulfilled immediately and at the same position. In such cases, the sequence in which the trigger activities are carried will be undefined. The program logic in the user program may not be based on a normal sequence of trigger activities for an “incomplete movement”.

Syntax
TriggJ [’\’ Conc ’,’] [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’,’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’,’ [Trigg_1 ’:=’ ] < variable (VAR) of triggdata > [ ’\’ T2 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T3 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T4 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T5 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T6 ’:=’ < variable (VAR) of triggdata > ] ‘,’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ]‘,’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] ’;’

2-TriggJ-442

System Data Types and Routines

Instructions

TriggJ

Related information
Described in: Linear movement with triggs Circular movement with triggers Definition of triggers Joint movement Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Motion in general Instructions - TriggL Instructions - TriggC Instructions - TriggIO, TriggEquip or TriggInt Motion Principles - Positioning during Program Execution Data Types - speeddata Data Types - zonedata Data Types - stoppointdata Data Types - tooldata Data Types - wobjdata Motion Principles

System Data Types and Routines

2-TriggJ-443

TriggJ

Instructions

2-TriggJ-444

System Data Types and Routines

Instructions

TriggL

TriggL

Linear robot movements with events
TriggL (Trigg Linear) is used to set output signals and/or run interrupt routines at fixed positions, at the same time as the robot is making a linear movement. One or more (max. 6) events can be defined using the instructions TriggIO, TriggEquip, or TriggInt, and afterwards these definitions are referred to in the instruction TriggL.

Examples
VAR triggdata gunon; TriggIO gunon, 0 \Start \DOp:=gun, on; MoveJ p1, v500, z50, gun1; TriggL p2, v500, gunon, fine, gun1; The digital output signal gun is set when the robot’s TCP passes the midpoint of the corner path of the point p1.

Start point p1

TriggL p2, v500, gunon, fine, gun1;

End point p2

The output signal gun is set to on when the robot’s TCP is here Figure 33 Example of fixed-position IO event.

Arguments TriggL [\Conc] ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4 ] [ \T5 ] [ \T6 ] Zone [ \Inpos ] Tool [ \WObj ] [ \Corr ]
[ \Conc ] (Concurrent) Data type: switch

Subsequent instructions are executed at once. This argument is used to shorten the cycle time when, for example, communicating with external equipment, if synchronisation is not required. It can also be used to tune the execution of the robot path, to avoid warning 50024 Corner path failure or error 40082 Deceleration limit. Using the argument \Conc, the number of movement instructions in succession is limited to 5. In a program section that includes StorePath-RestoPath, movement instructions with the argument \Conc are not permitted.

System Data Types and Routines

2-TriggL-445

TriggL

Instructions
If this argument is omitted and the ToPoint is not a stop point, the subsequent instruction is executed some time before the robot has reached the programmed zone. ToPoint Data type: robtarget

The destination point of the robot and external axes. It is defined as a named position or stored directly in the instruction (marked with an * in the instruction). Speed Data type: speeddata

The speed data that applies to movements. Speed data defines the velocity of the tool centre point, the external axes and of the tool reorientation. [ \T ] (Time) Data type: num

This argument is used to specify the total time in seconds during which the robot moves. It is then substituted for the corresponding speed data. Trigg_1 Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T2] (Trigg 2) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T3 ] (Trigg 3) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T4 ] (Trigg 4) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T5 ] (Trigg 5) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. [ \T6 ] (Trigg 6) Data type: triggdata

Variable that refers to trigger conditions and trigger activity, defined earlier in the program using the instructions TriggIO, TriggEquip or TriggInt. Zone Data type: zonedata Zone data for the movement. Zone data describes the size of the generated corner path.

2-TriggL-446

System Data Types and Routines

Instructions
[\Inpos] (In position)

TriggL
Data type: stoppointdata

This argument is used to specify the convergence criteria for the position of the robot’s TCP in the stop point. The stop point data substitutes the zone specified in the Zone parameter. Tool Data type: tooldata The tool in use when the robot moves. The tool centre point is the point that is moved to the specified destination position. [ \WObj] (Work Object) Data type: wobjdata

The work object (coordinate system) to which the robot position in the instruction is related. This argument can be omitted, and if it is, the position is related to the world coordinate system. If, on the other hand, a stationary TCP or coordinated external axes are used, this argument must be specified for a linear movement relative to the work object to be performed. [ \Corr] (Correction) Data type: switch

Correction data written to a corrections entry by the instruction CorrWrite will be added to the path and destination position, if this argument is present.

Program execution
See the instruction MoveL for information about linear movement. As the trigger conditions are fulfilled when the robot is positioned closer and closer to the end point, the defined trigger activities are carried out. The trigger conditions are fulfilled either at a certain distance before the end point of the instruction, or at a certain distance after the start point of the instruction, or at a certain point in time (limited to a short time) before the end point of the instruction. During stepping execution forwards, the I/O activities are carried out but the interrupt routines are not run. During stepping execution backwards, no trigger activities at all are carried out.

Examples
VAR intnum intno1; VAR triggdata trigg1; ... CONNECT intno1 WITH trap1; TriggInt trigg1, 0.1 \Time, intno1; ... TriggL p1, v500, trigg1, fine, gun1; TriggL p2, v500, trigg1, fine, gun1; System Data Types and Routines 2-TriggL-447

TriggL
... IDelete intno1;

Instructions

The interrupt routine trap1 is run when the work point is at a position 0.1 s before the point p1 or p2 respectively.

Limitations
If the current start point deviates from the usual, so that the total positioning length of the instruction TriggL is shorter than usual (e.g. at the start of TriggL with the robot position at the end point), it may happen that several or all of the trigger conditions are fulfilled immediately and at the same position. In such cases, the sequence in which the trigger activities are carried out will be undefined. The program logic in the user program may not be based on a normal sequence of trigger activities for an “incomplete movement”.

Syntax
TriggL [’\’ Conc ’,’] [ ToPoint ’:=’ ] < expression (IN) of robtarget > ’,’ [ Speed ’:=’ ] < expression (IN) of speeddata > [ ’\’ T ’:=’ < expression (IN) of num > ] ’,’ [Trigg_1 ’:=’ ] < variable (VAR) of triggdata > [ ’\’ T2 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T3 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T4 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T5 ’:=’ < variable (VAR) of triggdata > ] [ ’\’ T6 ’:=’ < variable (VAR) of triggdata > ] ‘,’ [Zone ’:=’ ] < expression (IN) of zonedata > [ ’\’ Inpos ’:=’ < expression (IN) of stoppointdata > ]‘,’ [ Tool ’:=’ ] < persistent (PERS) of tooldata > [ ’\’ WObj ’:=’ < persistent (PERS) of wobjdata > ] [ ’\’ Corr ]’;’

2-TriggL-448

System Data Types and Routines

Instructions

TriggL

Related information
Described in: Circular movement with triggers Joint movement with triggers Definition of triggers Writes to a corrections entry Linear movement Definition of velocity Definition of zone data Definition of stop point data Definition of tools Definition of work objects Motion in general Instructions - TriggC Instructions - TriggJ Instructions - TriggIO, TriggEquip or TriggInt Instructions - CorrWrite Motion Principles - Positioning during Program Execution Data Types - speeddata Data Types - zonedata Data Types - stoppointdata Data Types - tooldata Data Types - wobjdata Motion Principles

System Data Types and Routines

2-TriggL-449

TriggL Instructions 2-TriggL-450 System Data Types and Routines .

Program execution Program execution continues with the instruction subsequent to the instruction that caused the error. the next instruction is run. ENDIF An attempt is made to divide reg3 by reg4.’ Related information Described in: Error handlers Basic CharacteristicsError Recovery System Data Types and Routines 2-TRYNEXT-451 . . Syntax TRYNEXT’. a jump is made to the error handler. where reg2 is set to 0. Instead. Example reg2 := reg3/reg4. The TRYNEXT instruction is then used to continue with the next instruction.Instructions TRYNEXT TRYNEXT Jumps over an instruction which has caused an error TRYNEXT is used to jump over an instruction which has caused an error. ERROR IF ERRNO = ERR_DIVZERO THEN reg2:=0. If reg4 is equal to 0 (division by zero). Limitations The instruction can only exist in a routine’s error handler. TRYNEXT.

TRYNEXT Instructions 2-TRYNEXT-452 System Data Types and Routines .

Program execution The tuning values for all axes are reset to 100%.when starting program execution from the beginning. The default servo tuning values for all axes are automatically set by executing instruction TuneReset .when a new program is loaded . Syntax TuneReset ’.Instructions TuneReset TuneReset Resetting servo tuning TuneReset is used to reset the dynamic behaviour of all robot axes and external mechanical units to their normal values.’ Related information Described in: Tuning servos Instructions .at a cold start-up .TuneServo System Data Types and Routines 2-TuneReset-453 . Resetting tuning values for all axes to 100%. Example TuneReset.

TuneReset Instructions 2-TuneReset-454 System Data Types and Routines .

Other possibilities to improve the path accuracy: . Example: AccSet 20. Optimal tuning may also change with time. It can result in momentary high CPU loads causing error indication and stops. 10. Note: a value of path resolution which is too low will cause CPU load problems. It is not necessary to use TuneServo under normal circumstances.Decreasing path resolution can improve the path. but sometimes tuning can be optimised depending on the robot configuration and the load characteristics. System Data Types and Routines 2-TuneServo-455 . For external axes TuneServo can be used for load adaptation.The accuracy of straight lines can be improved by decreasing acceleration using AccSet. Avoid doing TuneServo commands at the same time as the robot is moving. TuneServo can be used to improve the path accuracy by: . optimal tuning values often differ between different robots. . Incorrect use of the TuneServo can cause oscillating movements or torques that can damage the robot. Generally. These two methods can be combined. To obtain optimal tuning it is essential that the correct load data is used.Tuning friction compensation parameters (see below). Note. You must bear this in mind and be careful when using the TuneServo. Improving path accuracy For robots running at lower speeds.Instructions TuneServo TuneServo Tuning servos TuneServo is used to tune the dynamic behavior of separate axes on the robot. Check on this before using TuneServo. .Tuning tune_kv and tune_ti (see the tune types description below).

Tune_df should always be tried first in cases of overshoots. Never use tune_dg when the robot is moving.2%) on the axes that are involved in this unwanted behavior. upper parts of working area.6: Reduce the tuning value for the current wrist axis until the movement is acceptable. Some examples of the use of TuneServo to optimise tuning follow below: IRB 6400. axes 4 . Normally it should not be used. In some cases axes 2 . 100%. 400%). Overshoots and oscillations can be reduced by decreasing the acceleration or the acceleration ramp (AccSet). Normally the optimal tuning will be found in the range 70% .130%. There is always an optimum tuning value that can vary depending on position and movement length. 200%. it can be advantageous in some cases to use an intermediate point with a corner zone to define where the tuning value will change. Typical tuning value 25%. IRB 2400. 50%. IRB 6400. IRB 6400. short movement (< 80 mm).95%. with track motion.98%.g. This optimum value can be found by changing the tuning in small steps (1 . Axis 1 can often be optimised with a tuning value of 94% . Axis 1 can often be optimised with a tuning value of 85% . When the tuning value at the start point of a long movement differs considerably from the tuning value at the end point. 2-TuneServo-456 System Data Types and Routines .TuneServo Instructions Description Tune_df Tune_df is used for reducing overshoots or oscillations along the path. in a press service application (extended and flexible load). Tune_dg Tune_dg can reduce overshoots on rare occasions. which will however increase the cycle time. A change in the movement will not be noticeable until the optimum value is approached.130%. Tuning of tune_dg can be performed with large steps in tune value (e. This is an alternative method to the use of TuneServo. The movement along the track can require a different tuning value compared with movement at right angles to the track. A low value will impair the movement considerably. Too low or too high tuning values have a negative effect and will impair movements considerably.3 can be optimised with a tuning value of 110% .

100%. Do not use these tune types. Tune_kp should not be System Data Types and Routines 2-TuneServo-457 . Basic tuning of external axes can also be simplified by using these tune types. Tune_dh should only be executed for one axis.80 is recommended for reducing path deviation. Recommended values: tune_kv 100 . All axes in the same mechanical unit automatically get the same tune_value. Tune value must always be lower than 100. A tune value in the range 50 . tune_ti 50 . Tune_dk. tune_ti robot axes For robot axes. Tune_kp. Example: IRB6400 with large flexible load which vibrates when the robot has stopped. tune_kv. All axes in the same mechanical unit automatically get the same tune_value. Tune_kp. Tune_dl Only for ABB internal use. tune_ti external axes These tune types affect position control gain (kp). Never use tune_dh when the robot is moving. large flexible load). Tune_di Tune_di can be used for reducing path deviation at high speeds. A higher tune value than 100 can reduce overshoot (but increases path deviation at high speed). speed control gain (kv) and speed control integration time (ti) for external axes. Overshoots can increase (lower tune value means larger overshoot).180%. Tune_dh increases path deviation and normally also increases cycle time. these tune types have another significance and can be used for reducing path errors at low speeds (< 500 mm/s). These are used for adapting external axes to different load inertias. Tune_di should only be executed for one axis. Incorrect use can cause oscillating movements or torques that can damage the robot.g. tune_kv.Instructions Tune_dh TuneServo Tune_dh can be used for reducing vibrations and overshoots (e. Use tune_dh with tune value 15.

These path errors appear when a robot axis changes direction of movement. Be careful if trying to exceed these recommended values. Tuning Friction ffw level (using tune_fric_lev) for each robot axis can improve the robots path accuracy considerably in the speed range 20 . Activate friction compensation for an axis by setting the system parameter Friction ffw on to TRUE (topic: Manipulator. type: Control parameters). Tune_fric_ramp overrides the value of the system parameter Friction ffw ramp. Repeat the same procedure for the next axis etc. Always tune one axis at a time. The friction model is a constant level with opposite sign of the axis speed direction. Low speed motor friction (Nm) Friction ffw level (Nm) Friction ffw ramp (rad/s) Axis motor speed (rad/s) Figure 34 Friction model Tune_fric_lev overrides the value of the system parameter Friction ffw level.200 mm/s). The final tuning values can be transferred to the system parameters. For larger robots (especially the IRB6400 family) the effect will however be minimal as other sources of tracking errors dominate these robots. Friction compensation: tune_fric_lev and tune_fric_ramp These tune types can be used to reduce robot path errors caused by friction and backlash at low speeds (10 . Never use these tune types at high speeds or when the required path accuracy is fulfilled. Friction ffw level (Nm) is the absolute friction level at (low) speeds and is greater than Friction ffw ramp (rad/s) (see figure).TuneServo Instructions used for robot axes. In most cases there is no need to tune the Friction ffw ramp. Try to improve the path where this specific axis changes its direction of movement or where it accelerates or decelerates. 2-TuneServo-458 System Data Types and Routines . Change the tuning value in small steps and find the level that minimises the robot path error at positions on the path where this specific axis changes direction of movement. Example: Friction ffw level = 1. Final tune value (tune_fric_lev) = 150%. Change the tuning values in small steps. Values of tune_kv/tune_ti which are too high or too low will cause vibrations or oscillations. Tune one axis at a time. Make changes in small steps and avoid oscillating motors. The default setting will be appropriate.100 mm/s.

This argument can be omitted when using tuning type TUNE_DF. TUNE_TI. TuneValue Data type: num Tuning value in percent (1 .5 and tune value = 100% (default value) which is equivalent. Program execution The specified tuning type and tuning value are activated for the specified axis. Axis Data type: num The number of the current axis for the mechanical unit (1 . Activating of tuning type TUNE_KP with the tuning value 110% on axis 1 in the mechanical unit MHA160R1. Example TuneServo MHA160R1. The default servo tuning values for all axes are automatically set by executing System Data Types and Routines 2-TuneServo-459 . 110 \Type:= TUNE_KP. TUNE_FRIC_LEV. 100% is the normal value. TUNE_KV. [\Type] Data type: tunetype Type of servo tuning. or until the tuning types and values for all axes are reset using the instruction TuneReset. TUNE_DG. 1.Instructions TuneServo Set Friction ffw level = 1. These types are predefined in the system with constants. This value is applicable for all movements until a new value is programmed for the current axis. TUNE_DI. Type TUNE_DK and TUNE_DL only for ABB internal use. TUNE_KP. Arguments TuneServo MecUnit Axis TuneValue [\Type] MecUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit.6). TUNE_DH. TUNE_FRIC_RAMP. Available types are TUNE_DF.500).

Manipulator 2-TuneServo-460 System Data Types and Routines .Manipulator System parameters .tunetype Instructions .’ Related information Described in: Other motion settings Types of servo tuning Reset of all servo tunings Tuning of external axes Friction compensation Summary Rapid .at a cold start-up .TuneReset System parameters . This limitation can be handled in the user program at restart after power failure.when starting program execution from the beginning.TuneServo instruction TuneReset . Syntax TuneServo [MecUnit ’:=’ ] < variable (VAR) of mecunit> ’.when a new program is loaded .’ [TuneValue ’:=’ ] < expression (IN) of num> [’\’ Type ’:=’ <expression (IN) of tunetype>]’.’ [Axis ’:=’ ] < expression (IN) of num> ’.Motion Settings Data Types . Instructions Limitations Any active servo tuning are always set to default values at power fail.

(See instructions Load). The file path and the file name must be the same as in the previously executed Load or StartLoad instruction. Program execution To be able to execute an UnLoad instruction in the program.WaitLoad. Arguments UnLoad [\Save] FilePath [\File] [\Save] Data type: switch If this argument is used. The program module must previously have been loaded into the program memory using the instruction Load or StartLoad . Example UnLoad diskhome \File:="PART_A.Instructions UnLoad UnLoad UnLoad a program module during execution UnLoad is used to unload a program module from the program memory during execution. FilePath Data type: string The file path and the file name to the file that will be unloaded from the program memory. diskhome is a predefined string constant "HOME:".MOD". that previously was loaded into the program memory with Load. a Load or StartLoad WaitLoad instruction with the same file path and name must have been executed earlier in the program. UnLoad the program module PART_A. The file name shall be excluded when the argument \File is used.MOD from the program memory. The program module will be saved at the original place specified in the Load or StartLoad instruction. System Data Types and Routines 2-UnLoad-461 . the program module is saved before the unloading starts. then it must be defined with this argument. [\File] Data type: string When the file name is excluded in the argument FilePath. The file name must be the same as in the previously executed Load or StartLoad instruction.

MOD".UnLoad Instructions The program execution waits for the program module to finish unloading before the execution proceeds with the next instruction. (See instructions Load). Unload \Save. Same as above but save the program module before unloading. After that the program module is unloaded and the rest of the program modules will be linked. TRAP routines.MOD". 2-UnLoad-462 System Data Types and Routines . Same as above but another syntax. UnLoad the program module DOOR1.MOD". This error can then be handled in the error handler.MOD from the program memory. system I/O events and other program tasks cannot execute during the unloading. Limitations It is not allowed to unload a program module that is executing. Program stop during execution of UnLoad instruction results in guard stop with motors off and error message "20025 Stop order timeout" on the Teach Pendant. the system variable ERRNO is set to ERR_UNLOAD. that previously was loaded into the program memory with Load. For more information see the instructions Load or StartLoad-Waitload. Avoid ongoing robot movements during the unloading. UnLoad "HOME:" \File:="DOORDIR/DOOR1. "HOME:" \File:="DOORDIR/DOOR1. Examples UnLoad "HOME:/DOORDIR/DOOR1. Error handling If the file in the UnLoad instruction cannot be unloaded because of ongoing execution within the module or wrong path (module not loaded with Load or StartLoad).

Load Instructions .’ Related information Described in: Load a program module Accept unresolved references Instructions .Controller System Parameters .’] [FilePath’:=’]<expression (IN) of string> [’\’File’:=’ <expression (IN) of string>]’.BindRef System Data Types and Routines 2-UnLoad-463 .Tasks System Parameters .Instructions UnLoad Syntax UnLoad [’\’Save ’.StartLoad-WaitLoad System Parameters .

UnLoad Instructions 2-UnLoad-464 System Data Types and Routines .

Program execution continues only after the di4 input has been set. Program execution continues only after the grip_status input has been reset. [\MaxTime] (Maximum Time) Data type: num Data type: dionum Signal Value [\MaxTime] [\TimeFlag] Data type: signaldi The maximum period of waiting time permitted. the error handler will be called. time runs out. if there is one. it is not considered to be an error if the max. expressed in seconds. Program Running If the value of the signal is correct. If this parameter is included in the instruction. Value The desired value of the signal. Example WaitDI di4. 1. WaitDI grip_status. Arguments WaitDI Signal The name of the signal. This argument is ignored if the MaxTime argument is not included in the instruction. If this time runs out before the condition is met. when the instruction is executed. 0. with the error code ERR_WAIT_MAXTIME.Instructions WaitDI WaitDI Waits until a digital input signal is set WaitDI (Wait Digital Input) is used to wait until a digital input is set. System Data Types and Routines 2-WaitDI-465 . the program simply continues with the following instruction. If there is no error handler. [\TimeFlag] (Timeout Flag) Data type: bool The output parameter that contains the value TRUE if the maximum permitted waiting time runs out before the condition is met. the execution will be stopped.

WaitUntil Instructions .WaitTime 2-WaitDI-466 System Data Types and Routines . the robot enters a waiting state and when the signal changes to the correct value. Syntax WaitDI [ Signal ’:=’ ] < variable (VAR) of signaldi > ’. If a Time Flag is specified. and if it exceeds the max time value. the program continues. When the robot is waiting. this will be set to true if the time is exceeded. which gives a fast response (not polled).WaitDI Instructions If the signal value is not correct.’ [ Value ’:=’ ] < expression (IN) of dionum > [’\’MaxTime ’:=’<expression (IN) of num>] [’\’TimeFlag’:=’<variable (VAR) of bool>] ’. the time is supervised.’ Related information Described in: Waiting until a condition is satisfied Waiting for a specified period of time Instructions . the program will continue if a Time Flag is specified. The change is detected with an interrupt. otherwise it will be set to false. or raise an error if it’s not.

[\TimeFlag] (Timeout Flag) Data type: bool The output parameter that contains the value TRUE if the maximum permitted waiting time runs out before the condition is met. Program execution continues only after the grip_status output has been reset. WaitDO grip_status.Instructions WaitDO WaitDO Waits until a digital output signal is set WaitDO (Wait Digital Output) is used to wait until a digital output is set. the execution will be stopped. Value The desired value of the signal. This argument is ignored if the MaxTime argument is not included in the instruction. System Data Types and Routines 2-WaitDO-467 . 0. [\MaxTime] (Maximum Time) Data type: num Data type: dionum Signal Value [\MaxTime] [\TimeFlag] Data type: signaldo The maximum period of waiting time permitted. it is not considered to be an error if the max. if there is one. when the instruction is executed. with the error code ERR_WAIT_MAXTIME. If this parameter is included in the instruction. the program simply continues with the following instruction. Program Running If the value of the signal is correct. If this time runs out before the condition is met. If there is no error handler. expressed in seconds. Program execution continues only after the do4 output has been set. Example WaitDO do4. Arguments WaitDO Signal The name of the signal. time runs out. 1. the error handler will be called.

or raise an error if its not. this will be set to true if the time is exceeded. the time is supervised. The change is detected with an interrupt. When the robot is waiting.WaitDO Instructions If the signal value is not correct. Syntax WaitDO [ Signal ’:=’ ] < variable (VAR) of signaldo > ’.’ [ Value ’:=’ ] < expression (IN) of dionum > [’\’MaxTime ’:=’<expression (IN) of num>] [’\’TimeFlag’:=’<variable (VAR) of bool>] ’. the robot enters a waiting state and when the signal changes to the correct value. If a Time Flag is specified. the program will continue if a Time Flag is specified. otherwise it will be set to false. the program continues. which gives a fast response (not polled).WaitTime 2-WaitDO-468 System Data Types and Routines .’ Related information Described in: Waiting until a condition is satisfied Waiting for a specified period of time Instructions .WaitUntil Instructions . and if it exceeds the max time value.

in order to minimise the number of links (1 instead of 2). tool1 \WObj:=wobj1. The file name should be excluded when the argument \UnloadFile is used. Arguments WaitLoad [\UnloadPath] [\UnloadFile] LoadNo [\UnloadPath] Data type: string The file path and the file name to the file that will be unloaded from the program memory. System Data Types and Routines 2-WaitLoad-469 . move the robot. tool1 \WObj:=wobj1. v1000. z50. In parallel. Example VAR loadsession load1. tool1 \WObj:=wobj1. MoveL p30. z50. z50.. MoveL p40. Load the program module PART_A. UnLoad "HOME:/PART_A. v1000. StartLoad "HOME:/PART_A.MOD". The loaded program module will be added to the modules already existing in the program memory.MOD from HOME: into the program memory. MoveL p10. z50. load1.MOD". MoveL p20.. to the program task.Instructions WaitLoad WaitLoad Connect the loaded module to the task WaitLoad is used to connect the module. . tool1 \WObj:=wobj1. v1000. %"routine_x"%. Then connect the new program module to the program task and call the routine routine_x in the module PART_A. if loaded with StartLoad. WaitLoad load1. v1000. The loaded module must be connected to the program task with the instruction WaitLoad before any of its symbols/routines can be used. This instruction can also be combined with the function to unload some other program module.

MOD from HOME: in the directory DOORDIR into the program memory and connect the new module to the task.WaitLoad [\UnloadFile] Instructions Data type: string When the file name is excluded in the argument \UnloadPath.. The initialisation of the loaded module sets all variables at module level to their init values. WaitLoad \UnloadPath:="HOME:/DOORDIR/DOOR1. no check for unsolved references will be done if BindRef = NO. In this case the BindRef parameter could be set to YES (default behaviour).MOD will be unloaded from the program memory. Examples StartLoad "HOME:/DOORDIR/DOOR2. This makes it possible to specify the routine to call with a string expression. then it must be defined with this argument. Program execution The instruction WaitLoad will first wait for the loading to be completed. The Late Binding way is preferable. However.. UnLoad "HOME:" \File:="DOORDIR/DOOR1.MOD". that is easy to understand and maintain. StartLoad "HOME:" \File:="DOORDIR/DOOR2. 2-WaitLoad-470 System Data Types and Routines . To obtain a good program structure. load1. Is the same as the instructions below but the robot can do some other work during the loading time and also do it faster (only one link). There will be a run time error on execution of an unsolved reference.MOD". if it is not already done.MOD". which is always present in the program memory during execution. LoadNo Data type: loadsession This is a reference to the load session. and then it will be linked and initialised. if the system parameter for Tasks/BindRef is set to NO. load1. ! The robot can do some other work WaitLoad \UnloadPath:="HOME:" \File:= "DOORDIR/DOOR1. that are not in the task from the beginning. Load the program module DOOR2. . load1. quoted between two %%. when the program is started or the teach pendant function Program Window/File/Check Program is used. all loading and unloading of program modules should be done from the main module.MOD". is to use Late Binding. Another way to use references to instructions. Load "HOME:" \File:="DOORDIR/DOOR2.MOD". to connect the loaded program module to the program task. load1. The program module DOOR1.MOD". Unsolved references will be accepted. fetched by the instruction StartLoad.

UnLoad System Parameters .Instructions WaitLoad Error handling If the file specified in the StartLoad instruction cannot be found. the system variable ERRNO is also set to ERR_UNLOAD. the system variable ERRNO is set to ERR_LOADED.If the program module specified in the argument \UnloadPath cannot be unloaded because the program module is not loaded with Load or StartLoadWaitLoad from the RAPID program.’ ] [ LoadNo ’:=’ ] <variable (VAR) of loadsession> ’. the system variable ERRNO is set to ERR_FILNOTFND at execution of WaitLoad.If the program module specified in the argument \UnloadPath cannot be unloaded because of ongoing execution within the module. If the module is already loaded into the program memory. the system variable ERRNO is set to ERR_UNKPROC.Controller/Task/ BindRef System Data Types and Routines 2-WaitLoad-471 . If argument LoadNo refers to an unknown load session. Syntax WaitLoad [ [ ’\’ UnloadPath ’:=’ <expression (IN) of string> ] [ ’\’ UnloadFile ’:=’ <expression (IN) of string> ] ’. The following errors can only occur when the argument \UnloadPath is used in the instruction WaitLoad: .StartLoad Data Types .Load Instructions . the system variable ERRNO is set to ERR_UNLOAD. .loadsession Instructions .’ Related information Load a program module during execution Load session Load a program module Unload a program module Accept unsolved references Instructions . These errors can then be handled in the error handler.

WaitLoad Instructions 2-WaitLoad-472 System Data Types and Routines .

Limitations If the argument \Inpos is used. the movement instruction which precedes this instruction should be terminated with a stop point. Arguments WaitTime [\InPos] [\InPos] Time Data type: switch If this argument is used. Program execution Program execution temporarily stops for the given amount of time.0. in order to be able to restart in this instruction following a power failure. This instruction can also be used to wait until the robot and external axes have come to a standstill. Argument \Inpos cannot be used together with SoftServo.Instructions WaitTime WaitTime Waits a given amount of time WaitTime is used to wait a given amount of time. Program execution waits until the robot and the external axes have come to a standstill. the robot and external axes must have come to a standstill before the waiting time starts to be counted. Example WaitTime 0. nevertheless.5 seconds.5. Time Data type: num The time. that program execution is to wait. Interrupt handling and other similar functions. are still active. Program execution waits 0. System Data Types and Routines 2-WaitTime-473 . expressed in seconds. Example WaitTime \InPos.

WaitTime Instructions Syntax WaitTime [’\’InPos’.WaitDI 2-WaitTime-474 System Data Types and Routines .’ Related information Described in: Waiting until a condition is met Waiting until an I/O is set/reset Instructions .’] [Time ’:=’] <expression (IN) of num>’.WaitUntil Instruction .

Cond The logical expression that is to be waited for. expressed in seconds. Program execution continues only after the di4 input has been set. Example WaitUntil di4 = 1. If this parameter is included in the instruction. Arguments WaitUntil [\InPos] [\InPos] Cond [\MaxTime] [\TimeFlag] Data type: switch If this argument is used. or raise an error if it’s not. the time is supervised. [\TimeFlag] (Timeout Flag) Data type: bool The output parameter that contains the value TRUE if the maximum permitted waiting time runs out before the condition is met. When the robot is waiting. it can wait until one or several inputs have been set. time runs out. System Data Types and Routines 2-WaitUntil-475 . If this time runs out before the condition is set. the robot and external axes must have stopped moving before the condition starts being evaluated. This argument is ignored if the MaxTime argument is not included in the instruction. with the error code ERR_WAIT_MAXTIME. and if it exceeds the max time value. the program will continue if a TimeFlag is specified. if there is one. the error handler will be called. the condition is checked again every 100 ms. If a TimeFlag is specified.Instructions WaitUntil WaitUntil Waits until a condition is met WaitUntil is used to wait until a logical condition is met. If there is no error handler. otherwise it will be set to false. this will be set to TRUE if the time is exceeded. [\MaxTime] Data type: num Data type: bool The maximum period of waiting time permitted. it is not considered to be an error if the max. for example. Program execution If the programmed condition is not met on execution of a WaitUntil instruction. the execution will be stopped.

WaitUntil Instructions Examples VAR bool timeout.WaitTime Basic Characteristics . an error message will be written on the display of the teach pendant. WaitUntil start_input = 1 AND grip_status = 1\MaxTime := 60 \TimeFlag := timeout. di4 = 1. ELSE start_next_cycle. ENDIF If the two input conditions are not met within 60 seconds. the movement instruction which precedes this instruction should be terminated with a stop point.Expressions 2-WaitUntil-476 System Data Types and Routines . Program execution waits until the robot has come to a standstill and the di4 input has been set. Limitation If the argument \Inpos is used.’] [Cond ’:=’] <expression (IN) of bool> [’\’MaxTime ’:=’<expression (IN) of num>] [’\’TimeFlag’:=’<variable (VAR) of bool>] ’.WaitDI Instructions .’ Related information Described in: Waiting until an input is set/reset Waiting a given amount of time Expressions Instructions . WaitUntil \Inpos. IF timeout THEN TPWrite "No start order received within expected time". in order to be able to restart in this instruction following a power failure. Syntax WaitUntil [’\’InPos’.

This instruction is also used to maximize the velocity. Arguments VelSet Override Override Max Data type: num Desired velocity as a percentage of programmed velocity.The programmed velocity override in the positioning instruction (the argument \V). . Data type: num Program execution The programmed velocity of all subsequent positioning instructions is affected until a new VelSet instruction is executed. The argument Max only affects the velocity of the TCP. The argument Override does not affect: . . All the programmed velocities are decreased to 50% of the value in the instruction. The argument Override affects: . 800. however.The welding speed in welddata. Example VelSet 50. rotating and linear external axes) in speeddata. permitted to exceed 800 mm/s.All velocity components (TCP.Instructions VelSet VelSet Changes the programmed velocity VelSet is used to increase or decrease the programmed velocity of all subsequent positioning instructions. 100% corresponds to the programmed velocity. orientation.The heating and filling speed in seamdata. . The TCP velocity is not.Timed movements. Max Maximum TCP velocity in mm/s. System Data Types and Routines 2-VelSet-477 .

speeddata RAPID Summary . The speed is 500 mm/s to point p1 and 800 mm/s to p2. MoveL p3. MoveL p2. z10. It takes 10 seconds to move from p2 to p3. Limitations The maximum speed is not taken into consideration when the time is specified in the positioning instruction. v2000. tool1.’ [ Max ’:=’ ] < expression (IN) of num > ’. z10.VelSet Instructions The default values for Override and Max are 100% and 5000 mm/s respectively.Motion 2-VelSet-478 System Data Types and Routines . tool1. tool1. Syntax VelSet [ Override ’:=’ ] < expression (IN) of num > ’. MoveL p1. z10.’ Related information Described in: Definition of velocity Positioning instructions Data Types .when a new program is loaded .at a cold start-up .when starting program executing from the beginning. v1000\T:=5. These values are automatically set . 800. v1000. Example VelSet 50.

8... If the condition is not met. starting from point 1. Program execution 7. If it is possible to determine the number of repetitions in advance. Example WHILE reg1 < reg2 DO . The instructions in the WHILE loop are executed. Arguments WHILE Condition Condition DO ... The condition is calculated. reg1 := reg1 +1. ENDWHILE Data type: bool The condition that must be met for the instructions in the WHILE loop to be executed. ENDWHILE Repeats the instructions in the WHILE loop as long as reg1 < reg2.. Syntax (EBNF) WHILE <conditional expression> DO <instruction list> ENDWHILE System Data Types and Routines 2-WHILE-479 . the FOR instruction can be used. The WHILE loop is repeated.Instructions WHILE WHILE Repeats as long as . the WHILE loop terminates and program execution continues with the instruction following ENDWHILE.. WHILE is used when a number of instructions are to be repeated as long as a given condition is met. 9.

WHILE Instructions Related information Described in: Expressions Basic Characteristics .Expressions 2-WHILE-480 System Data Types and Routines .

String The text to be written. is written to the file with the reference name logfile (assuming that the contents of reg1 is 5). for example. [\Pos] (Position) Data type: pos The data whose position is to be written after the text string. [\Num] (Numeric) Data type: num Data type: string The data whose numeric values are to be written after the text string. Write logfile. "No of produced parts="\Num:=reg1. Arguments Write IODevice String [\Num] | [\Bool] | [\Pos] | [\Orient] [\NoNewLine] IODevice Data type: iodev The name (reference) of the current file or serial channel. Examples Write logfile. The value of certain data can be written as well as text. System Data Types and Routines 2-Write-481 . "Execution started". [\NoNewLine] Data type: switch Omits the line-feed character that normally indicates the end of the text. [\Orient] (Orientation) Data type: orient The data whose orientation is to be written after the text string. The text No of produced parts=5. [\Bool] (Boolean) Data type: bool The data whose logical values are to be written after the text string. The text Execution started is written to the file with reference name logfile.Instructions Write Write Writes to a character-based file or serial channel Write is used to write to a character-based file or serial channel.

96593. Example VAR iodev printer.96593.0]" The value is converted to a string with standard RAPID format. The printer is connected to serial channel sio1:.11]" "[0. If the argument \NoNewLine is not used. is output to a printer each cycle. Write printer.3.14137" "TRUE" "[1817. including the number of the produced part and the time. its value is first converted to a text string before being added to the first string. The printed message could look like this: Produced part=473 09:47:15 Limitations The arguments \Num.905. This instruction can only be used for files or serial channels that have been opened for writing. \Pos or \Orient is used. A line.879.0.905. "Produced part="\Num:=reg1\NoNewLine. the number is rounded to an integer. \Pos and \Orient are mutually exclusive and thus cannot be used simultaneously in the same instruction.17.000005 or greater than 0.141367 TRUE [1817. The conversion from value to text string takes place as follows: Argument \Num \Num \Bool \Pos \Orient Value 23 1. " "\NoNewLine. printer\Write. ENDWHILE Close printer.Write Instructions Program execution The text string is written to a specified file or serial channel. Write printer. Write printer.11] [0.17.0.25882. a line-feed character (LF) is also written.0. This means in principle 6 significant digits. If one of the arguments \Num. \Bool.0.3.999995. CTime(). If the decimal part is less than 0.25882. Open "sio1:".879. . WHILE DInput(stopprod)=0 DO produce_part.0] Text string "23" "1. 2-Write-482 System Data Types and Routines . \Bool.

Communication System Data Types and Routines 2-Write-483 .’ [String’:=’] <expression (IN) of string> [’\’Num’:=’ <expression (IN) of num> ] | [’\’Bool’:=’ <expression (IN) of bool> ] | [’\’Pos’:=’ <expression (IN) of pos> ] | [’\’Orient’:=’ <expression (IN) of orient> ] [’\’NoNewLine]’. the system variable ERRNO is set to ERR_FILEACC.Instructions Write Error handling If an error occurs during writing.’ Related information Described in: Opening a file or serial channel RAPID Summary . Syntax Write [IODevice’:=’] <variable (VAR) of iodev>’. This error can then be handled in the error handler.

Write Instructions 2-Write-484 System Data Types and Routines .

Semi-value and non-value data types cannot be used. VAR orient quat1 := [1. System Data Types and Routines 2-WriteAnyBin-485 . Example VAR iodev channel2. string. Arguments WriteAnyBin IODevice The name (reference) of the binary serial channel or file for the writing operation.. Data type: ANYTYPE IODevice Data Data type: iodev Program execution As many bytes as required for the specified data are written to the specified binary serial channel or file. quat1. Data The VAR or PERS containing the data to be written. WriteAnyBin channel2.Instructions WriteAnyBin WriteAnyBin Writes data to a binary serial channel or file WriteAnyBin (Write Any Binary) is used to write any type of data to a binary serial channel or file. Array data cannot be used. The orient data quat1 is written to the channel referred to by channel2. Open "sio1:". or record data type. . channel2 \Bin. Limitations This instruction can only be used for serial channels or files that have been opened for binary writing. The data to be written by this instruction must have a value data type of atomic. 0]. 0. 0..

’ [Data’:=’] <var or pers (INOUT) of ANYTYPE>’.1). Open "sio1:". channel\Bin. WriteAnyBin channel.’ Related information Described in: Opening (etc. This error can then be handled in the error handler. VAR robtarget cur_robt. "\05".) of serial channels or files Read data from a binary serial channel or file RAPID Summary . ENDIF Close channel. VAR num input. Example VAR iodev channel. the system variable ERRNO is set to ERR_FILEACC. cur_robt. IF input = 6 THEN ! Send current robot position cur_robt := CRobT(\Tool:= tool1\WObj:= wobj1). ! Wait for the control character ack input := ReadBin (channel \Time:= 0.WriteAnyBin Instructions Error handling If an error occurs during writing. The current position of the robot is written to a binary serial channel.Communication Functions . ! Send the control character enq WriteStrBin channel.ReadAnyBin 2-WriteAnyBin-486 System Data Types and Routines . Syntax WriteAnyBin [IODevice’:=’] <variable (VAR) of iodev>’.

Instructions WriteBin WriteBin Writes to a binary serial channel WriteBin is used to write a number of bytes to a binary serial channel. the system variable ERRNO is set to ERR_FILEACC. System Data Types and Routines 2-WriteBin-487 . This error can then be handled in the error handler. NChar (Number of Characters) Data type: num The number of characters to be written from the Buffer. 10. text_buffer. Buffer Data type: array of num IODevice Buffer NChar Data type: iodev The list (array) containing the numbers (characters) to be written. 10 characters from the text_buffer list are written to the channel referred to by channel2. Example WriteBin channel2. Limitations This instruction can only be used for serial channels that have been opened for binary reading and writing. Error handling If an error occurs during writing. Program execution The specified number of numbers (characters) in the list is written to the serial channel. Arguments WriteBin IODevice Name (reference) of the current serial channel.

out_buffer{6} := 111. channel\Bin. input := ReadBin (channel \Time:= 0.’ [Buffer’:=’] <array {*} (IN) of num>’. out_buffer{13} := 3. out_buffer{8} := StrToByte("w"\Char).’ 2-WriteBin-488 System Data Types and Routines . out_buffer{10} := StrToByte("r"\Char). out_buffer{9} := StrToByte("o"\Char). out_buffer. out_buffer{11} := StrToByte("l"\Char). VAR num nchar. VAR num out_buffer{20}. out_buffer{4} := 108. Open "sio1:". out_buffer. out_buffer{2} := 72. out_buffer{1} := 5. IF input = 6 THEN out_buffer{1} := 2.WriteBin Instructions Example VAR iodev channel. out_buffer{7} := 32.’ [NChar’:=’] <expression (IN) of num>’. The function StrToByte is used in the same cases to convert a string into a byte (num) data. ENDIF ( enq ) ( ack ) ( stx ) ( ’H’ ) ( ’e’ ) ( ’l’ ) ( ’l’ ) ( ’o’ ) (’’) ( ’w’ ) ( ’o’ ) ( ’r’ ) ( ’l’ ) ( ’d’ ) ( etx ) The text string Hello world (with associated control characters) is written to a serial channel. WriteBin channel.1). out_buffer{12} := StrToByte("d"\Char). 13. out_buffer{3} := 101. WriteBin channel. Syntax WriteBin [IODevice’:=’] <variable (VAR) of iodev>’. out_buffer{5} := 108. 1. VAR num input.

Instructions WriteBin Related information Described in: Opening (etc.StrToByte Data Types .Communication Functions .byte System Data Types and Routines 2-WriteBin-489 .) of serial channels Convert a string to a byte data Byte data RAPID Summary .

WriteBin Instructions 2-WriteBin-490 System Data Types and Routines .

All characters and hexadecimal values written with WriteStrBin will be unchanged by the system. This error can then be handled in the error handler. Example WriteStrBin channel2. (String) Data type: string IODevice Str Data type: iodev Program execution The text string is written to the specified serial channel or file. The string is in this case ended with new line \0A. Str The text to be written. Error handling If an error occurs during writing.Instructions WriteStrBin WriteStrBin Writes a string to a binary serial channel WriteStrBin (Write String Binary) is used to write a string to a binary serial channel or binary file. the system variable ERRNO is set to ERR_FILEACC. System Data Types and Routines 2-WriteStrBin-491 . Limitations This instruction can only be used for serial channels or files that have been opened for binary reading and writing. Arguments WriteStrBin IODevice Name (reference) of the current serial channel. "Hello World\0A". The string "Hello World\0A" is written to the channel referred to by channel2.

"\05".’ [Str’:=’] <expression (IN) of string>’.Communication 2-WriteStrBin-492 System Data Types and Routines . IF input = 6 THEN ! Send a text starting with control character stx and ending with etx WriteStrBin channel. ENDIF Close channel. Open "sio1:".1). Syntax WriteStrBin [IODevice’:=’] <variable (VAR) of iodev>’.WriteStrBin Instructions Example VAR iodev channel.) of serial channels RAPID Summary . VAR num input.’ Related information Described in: Opening (etc. "\02Hello world\03". channel\Bin. ! Wait for the control character ack input := ReadBin (channel \Time:= 0. ! Send the control character enq WriteStrBin channel. The text string Hello world (with associated control characters in hexadecimal) is written to a binary serial channel.

400]. Shape Data type: shapedata Variable for storage of the defined volume (private data for the system).. corner2.400.100. 10 mm VAR shapedata volume.100]. WZBoxDef \Inside. Define a straight box with coordinates parallel to the axes of the world coordinate system and defined by the opposite corners corner1 and corner2. . CONST pos corner1:=[200. Data type: switch \Outside Define the volume outside the box (inverse volume). CONST pos corner2:=[600. System Data Types and Routines 2-WZBoxDef-493 . Example . corner2 Z Y Box corner1 World Coordinate System X Min.. volume.Instructions WZBoxDef WZBoxDef Define a box-shaped world zone WZBoxDef (World Zone Box Definition) is used to define a world zone that has the shape of a straight box with all its sides parallel to the axes of the World Coordinate System. corner1. Data type: switch One of the arguments \Inside or \Outside must be specified. Arguments WZBoxDef [\Inside] | [\Outside] Shape LowPoint HighPoint \Inside Define the volume inside the box.

WZBoxDef LowPoint Instructions Data type: pos Position (x.WZCylDef Instructions . Syntax WZBoxDef [’\’Inside] | [’\’Outside] ’.’ [LowPoint’:=’]<expression (IN) of pos>’.y.WZSphDef Instructions .g. Program execution The definition of the box is stored in the variable of type shapedata (argument Shape).z) in mm defining the corner diagonally opposite to the previous one.x) in mm defining one lower corner of the box. work object wobj0 must be active (use of component trans in robtarget e.’ [HighPoint’:=’]<expression (IN) of pos>’.trans as argument). p1.WZDOSet 2-WZBoxDef-494 System Data Types and Routines . Limitations The LowPoint and HighPoint positions must be valid for opposite corners (with different x. y and z coordinate values). If the robot is used to point out the LowPoint or HighPoint.y.’ Related information Described in: World Zones World zone shape Define sphere-shaped world zone Define cylinder-shaped world zone Activate world zone limit supervision Activate world zone digital output set Motion and I/O Principles World Zones Data Types .’ [Shape’:=’]<variable (VAR) of shapedata>’. for future use in WZLimSup or WZDOSet instructions. HighPoint Data type: pos Position (x.shapedata Instructions .WZLimSup Instructions .

volume. CONST pos C2:=[300. Data type: switch \Outside Data type: switch Define the volume outside the cylinder (inverse volume). Define a cylinder with the centre of the bottom circle in C2.. One of the arguments \Inside or \Outside must be specified. C2. CONST num H2:=200. H2. radius R2 and height H2.. System Data Types and Routines 2-WZCylDef-495 . 10 mm) Z Y C2 World Coordinate System X VAR shapedata volume. . Example R2 (min. CONST num R2:=100.200. WZCylDef \Inside.200]. Arguments WZCylDef [\Inside] | [\Outside] Shape CentrePoint Radius Height \Inside Define the volume inside the cylinder.Instructions WZCylDef WZCylDef Define a cylinder-shaped world zone WZCylDef (World Zone Cylinder Definition) is used to define a world zone that has the shape of a cylinder with the cylinder axis parallel to the z-axis of the World Coordinate System. R2. 5 mm) H2 (min.

the CentrePoint argument is the centre of the lower end of the cylinder (as in the above example).WZCylDef Shape Instructions Data type: shapedata Variable for storage of the defined volume (private data for the system).’ [Shape’:=’]<variable (VAR) of shapedata>’. work object wobj0 must be active (use of component trans in robtarget e.y. the CentrePoint argument is the centre of the upper end of the cylinder. Radius The radius of the cylinder in mm. Data type: num Height Data type: num The height of the cylinder in mm. If it is positive (+z direction).’ [Radius’:=’]<expression (IN) of num>’.trans as argument).’ 2-WZCylDef-496 System Data Types and Routines . p1. Limitations If the robot is used to point out the CentrePoint. for future use in WZLimSup or WZDOSet instructions. CentrePoint Data type: pos Position (x.’ [Height’:=’]<expression (IN) of num>’. If it is negative (-z direction).z) in mm defining the centre of one circular end of the cylinder.g. Program execution The definition of the cylinder is stored in the variable of type shapedata (argument Shape).’ [CentrePoint’:=’]<expression (IN) of pos>’. Syntax WZCylDef [’\’Inside] | [’\’Outside]’.

WZSphDef Instructions .WZBoxDef Instructions .WZDOSet System Data Types and Routines 2-WZCylDef-497 .shapedata Instructions .WZLimSup Instructions .Instructions WZCylDef Related information Described in: World Zones World zone shape Define box-shaped world zone Define sphere-shaped world zone Activate world zone limit supervision Activate world zone digital output set Motion and I/O Principles World Zones Data Types .

WZCylDef Instructions 2-WZCylDef-498 System Data Types and Routines .

z40. previously defined either to stop the movement or to set an output. which contains the identity of the world zone to be deactivated. Arguments WZDisable WorldZone WorldZone Data type: wztemporary Variable or persistent variable of type wztemporary. volume. relative to the corresponding volume.. This means that the supervision of the robot’s TCP. v500. z30. Limitations Only a temporary world zone can be deactivated. Program execution The temporary world zone is deactivated. A stationary world zone is always active. System Data Types and Routines 2-WZDisable-499 .. ENDPROC When moving to p_pick. is temporarily stopped. . tool1. v200. WZLimSup \Temp. Example VAR wztemporary wzone. It can be reactivated via the WZEnable instruction.. PROC . MoveL p_place.Instructions WZDisable WZDisable Deactivate temporary world zone supervision WZDisable (World Zone Disable) is used to deactivate the supervision of a temporary world zone. This supervision is not performed when going to p_place. tool1. wzone. MoveL p_pick.. the position of the robot’s TCP is checked so that it will not go inside the specified volume wzone. WZDisable wzone.

’ Related information Described in: World Zones World zone shape Temporary world zone data Activate world zone limit supervision Activate world zone set digital output Activate world zone Erase world zone Motion and I/O Principles World Zones Data Types .WZEnable Instructions .WZFree 2-WZDisable-500 System Data Types and Routines .WZLimSup Instructions .WZDisable Instructions Syntax WZDisable [WorldZone’:=’]<variable or persistent (INOUT) of wztemporary>’.WZDOSet Instructions .shapedata Data Types .wztemporary Instructions .

. WZDOSet \Temp. Data type: switch One of the arguments \Temp or \Stat must be specified.700]. After this instruction is executed.Instructions WZDOSet WZDOSet Activate world zone to set digital output WZDOSet (World Zone Digital Output Set) is used to define the action and to activate a world zone for supervision of the robot movements. when the robot’s TCP is inside the defined world zone or is approaching close to it. volume.. If use of switch \Stat. a digital output signal is set to the specified value. that sets the signal do_service. when the robot’s TCP is inside the defined sphere during program execution or when jogging. the data type must be wzstationary. service \Inside. p_service. System Data Types and Routines 2-WZDOSet-501 .500. Example VAR wztemporary service. 50. Arguments WZDOSet [\Temp] | [\Stat] WorldZone [\Inside] | [\Before] Shape Signal SetValue \Temp (Temporary) Data type: switch The world zone to define is a temporary world zone. 1. volume. CONST pos p_service:=[500. the data type must be wztemporary. ENDPROC Definition of temporary world zone service in the application program. PROC zone_output() VAR shapedata volume. \Stat (Stationary) The world zone to define is a stationary world zone.. WorldZone Data type: wztemporary Variable or persistent variable. If use of switch \Temp. that will be updated with the identity (numeric value) of the world zone. WZSphDef \Inside. do_service.

One of the arguments \Inside or \Outside must be specified. Signal Data type: signaldo The name of the digital output signal that will be changed. 2-WZDOSet-502 System Data Types and Routines .WZDOSet \Inside Instructions Data type: switch The digital output signal will be set when the robot’s TCP is inside the defined volume. the signal is set to the opposite value. the robot’s TCP position is supervised and the output will be set. \Before Data type: switch The digital output signal will be set before the robot’s TCP reaches the defined volume (as soon as possible before the volume). From this moment. when the robot’s TCP position is inside the volume (\Inside) or comes close to the border of the volume (\Before). TP). SetValue Data type: dionum Desired value of the signal (0 or 1) when the robot’s TCP is inside the volume or just before it enters the volume. When outside or just outside the volume. Program execution The defined world zone is activated. Shape Data type: shapedata The variable that defines the volume of the world zone. Set Access = System for the signal in System Parameters. If a stationary worldzone is used. the signal must be write protected for access from the user (RAPID.

WZCylDef \Inside. definition of a temporary world zone equip1. ENDPROC Definition of temporary world zones home and service in the application program.800]. .. WZSphDef \Inside... equip1 can be disabled or enabled from other program tasks by using the persistent variable equip1 value. do_service. p_service. System Data Types and Routines 2-WZDOSet-503 .. ! equip1 in robot work area WZEnable equip1.. 50. . volume. ! No use for equip1 any more WZFree equip1. equip1. . that sets the signals do_home and do_service. p_equip1.0].800. 50.. when the robot is inside the sphere home or service respectively during program execution or when jogging. WZSphDef \Inside. ! Definition of all temporary world zones zone_output. CONST pos p_service:=[800. volume. WZLimSup \Temp. ENDPROC PROC zone_output() VAR shapedata volume. volume.800]. At that time the robot stops before entering the equip1 volume. volume. 1. . CONST pos p_equip1:=[-800.. ! equip1 not in robot work area WZDisable equip1.0. do_home. ! equip1 out of robot work area WZDisable equip1. WZDOSet \Temp.-800. 1000. Also. 1. both during program execution and manual jogging. PROC main() . volume.. WZDOSet \Temp. volume.. CONST pos p_home:=[800. home \Inside. which is active only in the part of the robot program when equip1 is inside the working area for the robot. PERS wztemporary equip1:=[0]. service \Inside.Instructions WZDOSet Example VAR wztemporary home. .. VAR wztemporary service.. 300. p_home..

’ Related information Described in: World Zones World zone shape Temporary world zone Stationary world zone Define straight box-shaped world zone Define sphere-shaped world zone Define cylinder-shaped world zone Activate world zone limit supervision Signal access mode Motion and I/O Principles World Zones Data Types .System Parameters I/O Signals 2-WZDOSet-504 System Data Types and Routines .’ [WorldZone’:=’]<variable or persistent (INOUT) of wztemporary> (’\’Inside) | (’\’Before) ’.shapedata Data Types .’ [Shape’:=’]<variable (VAR) of shapedata>’.wzstationary Instructions . A temporary world zone can be deactivated (WZDisable).WZLimSup User’s Guide .’ [Signal’:=’]<variable (VAR) of signaldo>’.WZDOSet Instructions Limitations A world zone cannot be redefined by using the same variable in the argument WorldZone.’ [SetValue’:=’]<expression (IN) of dionum>’. Syntax WZDOSet (’\’Temp) | (’\’Stat) ’.WZBoxDef Instructions . activated again (WZEnable) or erased (WZFree) in the RAPID program. A stationary world zone cannot be deactivated. activated again or erased in the RAPID program.WZSphDef Instructions .WZCylDef Instructions .wztemporary Data Types .

A stationary world zone is always active. z30.. tool1. ENDPROC When moving to p_pick. It need only be re-activated when it has previously been deactivated by WZDisable. MoveL p_pick. . v200. but is reactivated before going to p_home Arguments WZEnable WorldZone WorldZone Data type: wztemporary Variable or persistent variable of the type wztemporary. previously defined either to stop the movement or to set an output. volume.. MoveL p_home. which contains the identity of the world zone to be activated. WZLimSup \Temp. tool1. WZDisable wzone. wzone. v500. Program execution The temporary world zone is re-activated. Example VAR wztemporary wzone. Limitations Only a temporary world zone can be deactivated and reactivated. tool1. System Data Types and Routines 2-WZEnable-505 . MoveL p_place. WZEnable wzone. Please note that a world zone is automatically activated when it is created.Instructions WZEnable WZEnable Activate temporary world zone supervision WZEnable (World Zone Enable) is used to re-activate the supervision of a temporary world zone. v200. z40. z30. the position of the robot’s TCP is checked so that it will not go inside the specified volume wzone.. PROC .. This supervision is not performed when going to p_place.

WZLimSup Instructions .WZFree 2-WZEnable-506 System Data Types and Routines .shapedata Data Types .WZDisable Instructions .WZDOSet Instructions .WZEnable Instructions Syntax WZEnable [WorldZone’:=’]<variable or persistent (INOUT) of wztemporary>’.wztemporary Instructions .’ Related information Described in: World Zones World zone shape Temporary world zone data Activate world zone limit supervision Activate world zone set digital output Deactivate world zone Erase world zone Motion and I/O Principles World Zones Data Types .

This supervision is not performed when going to p_place. which contains the identity of the world zone to be erased. the world zone definition is erased. wzone. tool1. System Data Types and Routines 2-WZFree-507 . PROC . v200. WZDisable wzone.. Limitations Only a temporary world zone can be deactivated. reactivated or erased. z30. ENDPROC When moving to p_pick.Instructions WZFree WZFree Erase temporary world zone supervision WZFree (World Zone Free) is used to erase the definition of a temporary world zone.. the position of the robot’s TCP is checked so that it will not go inside a specified volume wzone. z30.. Example VAR wztemporary wzone. v200. z40. Once erased. a temporary world zone cannot be either re-activated nor deactivated. tool1. Program execution The temporary world zone is first deactivated and then its definition is erased. . MoveL p_place. MoveL p_pick.. previously defined either to stop the movement or to set an output. volume. WZEnable wzone. When this position is reached. WZLimSup \Temp. v500. Arguments WZFree WorldZone WorldZone Data type: wztemporary Variable or persistent variable of the type wztemporary. tool1. WZFree wzone. but is reactivated before going to p_home. A stationary world zone is always active. MoveL p_home.

wztemporary Instructions .WZDisable Instructions .WZFree Instructions Syntax WZFree [WorldZone’:=’]<variable or persistent (INOUT) of wztemporary>’.WZEnable 2-WZFree-508 System Data Types and Routines .WZDOSet Instructions .shapedata Data Types .’ Related information Described in: World Zones World zone shape Temporary world zone data Activate world zone limit supervision Activate world zone set digital output Deactivate world zone Activate world zone Motion and I/O Principles World Zones Data Types .WZLimSup Instructions .

. After this instruction is executed. WZBoxDef \Outside. . WorldZone Data type: wztemporary Variable or persistent variable that will be updated with the identity (numeric value) of the world zone. Arguments WZLimSup [\Temp] | [\Stat] WorldZone Shape \Temp (Temporary) Data type: switch The world zone to define is a temporary world zone. max_workarea. Example VAR wzstationary max_workarea.. The robot stops with an error message before entering the area outside the box. WZLimSup \Stat. volume. System Data Types and Routines 2-WZLimSup-509 .. volume. If use of switch \Stat. the movement is stopped both during program execution and when jogging. \Stat (Stationary) The world zone to define is a stationary world zone. If use of switch \Temp. the data type must be wzstationary. Data type: switch One of the arguments \Temp or \Stat must be specified.. with the shape of the area outside a box (temporarily stored in volume) and the action work-area supervision.Instructions WZLimSup WZLimSup Activate world zone limit supervision WZLimSup (World Zone Limit Supervision) is used to define the action and to activate a world zone for supervision of the working area of the robot. PROC POWER_ON() VAR shapedata volume. . ENDPROC Definition and activation of stationary world zone max_workarea. corner2. corner1. the data type must be wztemporary. when the robot’s TCP reaches the defined world zone.

box1_c1. WZBoxDef \Inside. CONST pos box2_c2:=[200. Limitations A world zone cannot be redefined using the same variable in argument WorldZone. these world zones will always be active in the system.-500.-200.. CONST pos box2_c1:=[500. Program execution The defined world zone is activated. Example VAR wzstationary box1_invers. WZLimSup \Stat. box2_c2. WZBoxDef \Outside. VAR wzstationary box2.0]. 2-WZLimSup-510 System Data Types and Routines . activated again or erased in the RAPID program. both for program movements and manual jogging. volume.WZLimSup Shape Instructions Data type: shapedata The variable that defines the volume of the world zone. volume. A stationary world zone cannot be deactivated.0]. CONST pos box1_c2:=[-500. ENDPROC Limitation of work area for the robot with the following stationary world zones: . volume. volume.300].-500. activated again (WZEnable) or erased (WZFree) in the RAPID program.Outside working area when inside box2 If this routine is connected to the system event POWER ON.500]. CONST pos box1_c1:=[500. box1_invers. box2_c1. . box1_c2. WZLimSup \Stat. From this moment the robot’s TCP position is supervised.. box2. A temporary world zone can be deactivated (WZDisable).500. If it reaches the defined area the movement is stopped. PROC wzone_power_on() VAR shapedata volume.Outside working area when outside box1_invers .

WZCylDef Instructions .wzstationary Instructions .WZBoxDef Instructions .’ Related information Described in: World Zones World zone shape Temporary world zone Stationary world zone Define straight box-shaped world zone Define sphere-shaped world zone Define cylinder-shaped world zone Activate world zone digital output set Motion and I/O Principles World Zones Data Types .’ [Shape’:=’] <variable (VAR) of shapedata>’.’ [WorldZone’:=’]<variable or persistent (INOUT) of wztemporary>’.shapedata Data Types .WZSphDef Instructions .wztemporary Data Types .WZDOSet System Data Types and Routines 2-WZLimSup-511 .Instructions WZLimSup Syntax WZLimSup [’\’Temp] | [’\Stat]’.

WZLimSup Instructions 2-WZLimSup-512 System Data Types and Routines .

Arguments WZSphDef [\Inside] | [\Outside] Shape CentrePoint Radius \Inside Define the volume inside the sphere. R1. Example Z Y C1 R1 (min.300. Define a sphere named volume by its centre C1 and its radius R1. CONST pos C1:=[300.Instructions WZSphDef WZSphDef Define a sphere-shaped world zone WZSphDef (World Zone Sphere Definition) is used to define a world zone that has the shape of a sphere. C1.. Data type: switch \Outside Data type: switch Define the volume outside the sphere (inverse volume). WZSphDef \Inside. . Shape Data type: shapedata Variable for storage of the defined volume (private data for the system).200].. CONST num R1:=200. One of the arguments \Inside or \Outside must be specified. volume. 5 mm) World Coordinate System X VAR shapedata volume. System Data Types and Routines 2-WZSphDef-513 .

WZSphDef CentrePoint Instructions Data type: pos Position (x.’ Related information Described in: World Zones World zone shape Define box-shaped world zone Define cylinder-shaped world zone Activate world zone limit supervision Activate world zone digital output set Motion and I/O Principles World Zones Data Types . for future use in WZLimSup or WZDOSet instructions.’ [CentrePoint’:=’]<expression (IN) of pos>’.WZCylDef Instructions . Limitations If the robot is used to point out the CentrePoint.WZDOSet 2-WZSphDef-514 System Data Types and Routines . Radius The radius of the sphere in mm.y.z) in mm defining the centre of the sphere. Data type: num Program execution The definition of the sphere is stored in the variable of type shapedata (argument Shape).’ [Shape’:=’]<variable (VAR) of shapedata>’. Syntax WZSphDef [’\’Inside] | [’\’Outside]’. p1. work object wobj0 must be active (use of component trans in robtarget e.WZLimSup Instructions .trans as argument).WZBoxDef Instructions .’ [Radius’:=’]<expression (IN) of num>’.shapedata Instructions .g.

Functions CONTENTS Abs ACos AOutput ASin ATan ATan2 ByteToStr CalcJointT CalcRobT CDate CJointT ClkRead Cos CPos CRobT CTime CTool CWObj DefDFrame DefFrame Dim Distance DotProd DOutput EulerZYX Exp FileTime GOutput GetTime IsPers IsVar MirPos ModTime NOrient NumToStr Offs Gets the absolute value Calculates the arc cosine value Reads the value of an analog output signal Calculates the arc sine value Calculates the arc tangent value Calculates the arc tangent2 value Converts a byte to a string data Calculates joint angles from robtarget Calculates robtarget from jointtarget Reads the current date as a string Reads the current joint angles Reads a clock used for timing Calculates the cosine value Reads the current position (pos) data Reads the current position (robtarget) data Reads the current time as a string Reads the current tool data Reads the current work object data Define a displacement frame Define a frame Obtains the size of an array Distance between two points Dot product of two pos vectors Reads the value of a digital output signal Gets Euler angles from orient Calculates the exponential value Retrieve time information about a file Reads the value of a group of digital output signals Reads the current time as a numeric value Is Persistent Is Variable Mirroring of a position Get time of load for a loaded module Normalise Orientation Converts numeric value to string Displaces a robot position 3-515 System Data Types and Routines .

Functions OpMode OrientZYX ORobT PoseInv PoseMult PoseVect Pow Present ReadBin ReadMotor ReadNum ReadStr ReadStrBin RelTool Round RunMode Sin Sqrt StrFind StrLen StrMap StrMatch StrMemb StrOrder StrPart StrToByte StrToVal Tan TestAndSet TestDI Trunc TestSignRead ValToStr VectMagn Read the operating mode Builds an orient from Euler angles Removes a program displacement from a position Inverts the pose Multiplies pose data Applies a transformation to a vector Calculates the power of a value Tests if an optional parameter is used Reads a byte from a file or serial channel Reads the current motor angles Reads a number from a file or serial channel Reads a string from a file or serial channel Reads a string from a binary serial channel or file Make a displacement relative to the tool Round is a numeric value Read the running mode Calculates the sine value Calculates the square root value Searches for a character in a string Gets the string length Maps a string Search for pattern in string Checks if a character belongs to a set Checks if strings are ordered Finds a part of a string Converts a string to a byte data Converts a string to a value Calculates the tangent value Test variable and set if unset Tests if a digital input is set Truncates a numeric value Read test signal value Converts a value to a string Magnitude of a pos vector 3-516 System Data Types and Routines .

The operator is asked to input the number of parts to be produced.g. no_of_parts := Abs(no_of_parts). To ensure that the value is greater than zero.e.Functions Abs Abs Gets the absolute value Abs is used to get the absolute value. a positive numeric value.53 Returned value 3 3 2. Example reg1 := Abs(reg2). Input value 3 -3 -2. the value given by the operator is made positive. Reg1 is assigned the absolute value of reg2. Return value The absolute value. Syntax Abs ’(’ [ Input ’:=’ ] < expression (IN) of num > ’)’ A function with a return value of the data type num. (Input) Data type: num Example TPReadNum no_of_parts.53 Data type: num Arguments Abs Input The input value. i. i. e. a positive value of numeric data.e. System Data Types and Routines 3-Abs-517 . "How many parts should be produced? ".

Mathematics 3-Abs-518 System Data Types and Routines .Abs Functions Related information Described in: Mathematical instructions and functions RAPID Summary .

Return value Data type: num The arc cosine value. Example VAR num angle. VAR num value. range [-1. angle := ACos(value). 180]. . 1]. range [0. Arguments ACos Value The argument value. (Value) Data type: num Syntax Acos’(’ [Value ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. .Functions ACos ACos Calculates the arc cosine value ACos (Arc Cosine) is used to calculate the arc cosine value. Related information Described in: Mathematical instructions and functions RAPID Summary .Mathematics System Data Types and Routines 3-ACos-519 . expressed in degrees.

ACos Functions 3-ACos-520 System Data Types and Routines .

(Signal) Data type: signalao System Data Types and Routines 3-AOutput-521 ...) MAX SIGNAL MAX PROGRAM Logical value in the program MIN PROGRAM MIN SIGNAL Figure 35 Diagram of how analog signal values are scaled. Arguments AOutput Signal The name of the analog output to be read. Return value The current value of the signal. If the current value of the signal ao4 is greater than 5. See Figure 35. then . Physical value of the output signal (V. Data type: num The current value is scaled (in accordance with the system parameters) before it is read by the RAPID program. etc. mA.. Example IF AOutput(ao4) > 5 THEN .Functions AOutput AOutput Reads the value of an analog output signal AOutput is used to read the current value of an analog output signal..

Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .AOutput Functions Syntax AOutput ’(’ [ Signal ’:=’ ] < variable (VAR) of signalao > ’)’ A function with a return value of data type num.System Parameters 3-AOutput-522 System Data Types and Routines .

Functions ASin ASin Calculates the arc sine value ASin (Arc Sine) is used to calculate the arc sine value. expressed in degrees. Return value Data type: num The arc sine value. 1]. 90]. Example VAR num angle. (Value) Data type: num Syntax ASin’(’ [Value ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. range [-90. range [-1. Related information Described in: Mathematical instructions and functions RAPID Summary . . angle := ASin(value).Mathematics System Data Types and Routines 3-ASin-523 . VAR num value. . Arguments ASin Value The argument value.

ASin Functions 3-ASin-524 System Data Types and Routines .

(Value) Data type: num Syntax ATan’(’ [Value ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. range [-90. Related information Described in: Mathematical instructions and functions Arc tangent with a return value in the range [-180. . expressed in degrees. Return value Data type: num The arc tangent value. Arguments ATan Value The argument value. Example VAR num angle. 180] RAPID Summary . angle := ATan(value). VAR num value. 90].ATan2 System Data Types and Routines 3-ATan-525 . .Functions ATan ATan Calculates the arc tangent value ATan (Arc Tangent) is used to calculate the arc tangent value.Mathematics Functions .

ATan Functions 3-ATan-526 System Data Types and Routines .

Functions ATan2 ATan2 Calculates the arc tangent2 value ATan2 (Arc Tangent2) is used to calculate the arc tangent2 value. VAR num x_value. angle := ATan2(y_value. Example VAR num angle. since the function uses the sign of both arguments to determine the quadrant of the return value. x_value). 180]. X The denominator argument value. Arguments ATan2 Y The numerator argument value. expressed in degrees. range [-180.’ [X ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. The value will be equal to ATan(y/x). 180]. . . System Data Types and Routines 3-ATan2-527 . Data type: num (Y X) Data type: num Syntax ATan2’(’ [Y ’:=’] <expression (IN) of num> ’. VAR num y_value. but in the range [-180. Return value Data type: num The arc tangent value.

ATan 3-Atan2-528 System Data Types and Routines .Atan2 Functions Related information Described in: Mathematical instructions and functions Arc tangent with only one argument RAPID Summary .Mathematics Functions .

.... ’A’ -’F’ ’0’ .Functions ByteToStr ByteToStr Converts a byte to a string data ByteToStr (Byte To String) is used to convert a byte into a string data with a defined byte data format.. function. con_data_buffer{2} := ByteToStr(data1\Hex).: Hex ... con_data_buffer{5} := ByteToStr(data1\Char).."377" "00000000" "11111111" One ASCII char (*) If non-writable ASCII char.’7’ ’0’ .g... The content of the array component con_data_buffer{2} will be "7A" after the ByteToStr . function... System Data Types and Routines 3-ByteToStr-529 .: Okt .’9’.. the return format will be RAPID character code format (e.’1’ Any ASCII char (*) String length: 1-3 2 3 8 1 Range: "0" .."255" "00" . The content of the array component con_data_buffer{1} will be "122" after the ByteToStr ..: Bin . con_data_buffer{3} := ByteToStr(data1\Okt). con_data_buffer{1} := ByteToStr(data1).. Return value Data type: string The result of the conversion operation with the following format: Format: Dec ..’9’ ’0’ .... Example VAR string con_data_buffer{5}.. function. function. The content of the array component con_data_buffer{3} will be "172" after the ByteToStr .: Characters: ’0’ . function... The content of the array component con_data_buffer{4} will be "01111010"after the ByteToStr .: Char . The content of the array component con_data_buffer{5} will be "z" after the ByteToStr .... con_data_buffer{4} := ByteToStr(data1\Bin)."FF" "000" ..... VAR byte data1 := 122. “\07” for BEL control character)..

ByteToStr Functions Arguments ByteToStr BitData The bit data to be converted. If the optional switch argument is omitted.’ A function with a return value of the data type string. Limitations The range for a data type byte is 0 to 255 decimal. Syntax ByteToStr’(’ [BitData ’:=’] <expression (IN) of byte> [’\’ Hex ] | [’\’ Okt] | [’\’ Bin] | [’\’ Char] ’)’ ’. [\Char] (Character) Data type: switch The data will be converted in ASCII character format. [\Bin] (Binary) Data type: switch The data will be converted in binary format. [\Hex] (Hexadecimal) Data type: switch (BitData [\Hex] | [\Oct] | [\Bin] | [\Char]) Data type: byte The data will be converted in hexadecimal format. [\Okt] (Octal) Data type: switch The data will be converted in octal format. the data will be converted in decimal (Dec) format. 3-ByteToStr-530 System Data Types and Routines .

String Functions System Data Types and Routines 3-Pow-531 .Functions Pow Related information Described in: Convert a string to a byte data Other bit (byte) functions Other string functions Instructions .StrToByte RAPID Summary .Bit Functions RAPID Summary .

Pow Functions 3-Pow-532 System Data Types and Routines .

. The values for the external axes. in mm for linear axes. Example VAR jointtarget jointpos1. Arguments CalcJointT ( Rob_target Tool [\WObj] ) Rob_target Data type: robtarget The position of the robot and external axes in the outermost coordinate system. Tool Data type: tooldata The tool used for calculation of the robot joint angles.. CONST robtarget p1 := [. related to the specified tool and work object and at execution time active program displacement (ProgDisp) and/or external axes offset (EOffs). The tool tool1 and work object wobj1 are used for calculating the joint angles jointpos1. Return value Data type: jointtarget The angles in degrees for the axes of the robot on the arm side. System Data Types and Routines 3-CalcJointT-533 .Functions CalcJointT CalcJointT Calculates joint angles from robtarget CalcJointT (Calculate Joint Target) is used to calculate joint angles of the robot axes and external axes from a specified robtarget data. The returned jointtarget data is expressed in the calibration coordinate system.]. The jointtarget value corresponding to the robtarget value p1 is stored in jointpos1. The returned values are always related to the calibration position. The input robtarget data should be specified in the same coordinate system as specified in argument for Tool. tool1 \WObj:=wobj1). WObj and at execution time active program displacement (ProgDisp) and external axes offset (EOffs). in degrees for rotational axes. jointpos1 := CalcJointT(p1.

then the same program displacement and/or external axis offset must be active when CalcJointT is executed. active EOffs is taken into consideration. or conveyor Program execution The returned jointtarget is calculated from the input robtarget. To calculate the external axis position at the execution time. If this argument is omitted the work object wobj0 is used. the specified Tool. This argument must be specified when using stationary tool. 3-CalcJointT-534 System Data Types and Routines . If there is any active program displacement (ProgDisp) and/or external axis offset (EOffs) at the time the robtarget is stored. Instructions ConfL and ConfJ do not affect this calculation principle. robot axis 4 will be set to 0 degrees. The calculation always selects the robot configuration according to the specified configuration data in the input robtarget data. are taken into consideration. WObj (including coordinated user frame) and the ProgDisp active at execution time. When wrist singularity is used.CalcJointT [\WObj] (Work Object) Functions Data type: wobjdata The work object (coordinate system) to which the robot position is related. To calculate the robot joint angles. coordinated external axes.’ [Tool ’:=’ ] <persistent (PERS) of tooldata> [’\’WObj ’:=’ <persistent (PERS) of wobjdata>] ’)’ A function with a return value of the data type jointtarget. Syntax CalcJointT’(’ [Rob_target ’:=’] <expression (IN) of robtarget> ‘.

Coordinate Systems Instructions .robtarget Data Types .Functions CalcJointT Related information Described in: Calculate robtarget from jointtarget Definition of position Definition of joint position Definition of tools Definition of work objects Coordinate systems Program displacement coordinate system External axis offset coordinate system Functions .CalcRobT Data Types .jointtarget Data Types.tooldata Data Types .EOffsOn System Data Types and Routines 3-CalcJointT-535 .PDispOn Instructions .wobjdata Motion and I/O Principles .

CalcJointT Functions 3-CalcJointT-536 System Data Types and Routines .

work object and at execution time active program displacement (ProgDisp) and external axes offset (EOffs) into consideration. The input jointtarget data should be specified in the calibration coordinate system. Return value Data type: robtarget The robot and external axis position is returned in data type robtarget and expressed in the outermost coordinate system. taking the specified tool. q4). the external axis position is expressed in the calibration coordinate system. Example VAR robtarget p1. Arguments CalcRobT ( Joint_target Tool [\WObj] ) Joint_target Data type: jointtarget The joint position for the robot axes and external axes related to the calibration coordinate system. work object and at execution time active program displacement (ProgDisp) and external axis offset (EOffs) into consideration.Functions CalcRobT CalcRobT Calculates robtarget from jointtarget CalcRobT (Calculate Robot Target) is used to calculate a robtarget data from a given jointtarget data.. y. taking the specified tool. The tool tool1 and work object wobj1 are used for calculating of the position p1. the robot position is expressed in the object coordinate system.. tool1 \WObj:=wobj1).. If there are no active EOffs. System Data Types and Routines 3-CalcRobT-537 . The returned robtarget data is expressed in the outermost coordinate system. This function returns a robtarget value with position (x. p1 := CalcRobT(jointpos1. If there is no active ProgDisp. z).. orientation (q1 . robot axes configuration and external axes position. CONST jointtarget jointpos1 := [. The robtarget value corresponding to the jointtarget value jointpos1 is stored in p1.].

coordinated external axes. Program execution The returned robtarget is calculated from the input jointtarget. 3-CalcRobT-538 System Data Types and Routines .CalcRobT Tool The tool used for calculation of the robot position. To calculate the external axes position. the specified Tool. WObj (including coordinated user frame) and at the execution time active ProgDisp are taken into consideration.’ [Tool ’:=’ ] <persistent (PERS) of tooldata> [’\’WObj ’:=’ <persistent (PERS) of wobjdata>] ’)’ A function with a return value of the data type robtarget. This argument must be specified when using stationary tool. If this argument is omitted the work object wobj0 is used. Syntax CalcRobT’(’ [Joint_target ’:=’ ] <expression (IN) of jointtarget> ‘. To calculate the cartesian robot position. or conveyor. the EOffs active at execution time is taken into consideration. [\WObj] (Work Object) Functions Data type: tooldata Data type: wobjdata The work object (coordinate system) to which the robot position returned by the function is related.

robtarget Data Types .PDispOn Instructions .jointtarget Data Types.Coordinate Systems Instructions .CalcJointT Data Types .wobjdata Motion and I/O Principles .tooldata Data Types .Functions CalcRobT Related information Described in: Calculate jointtarget from robtarget Definition of position Definition of joint position Definition of tools Definition of work objects Coordinate systems Program displacement coordinate system External axes offset coordinate system Functions .EOffsOn System Data Types and Routines 3-CalcRobT-539 .

CalcRobT Functions 3-CalcRobT-540 System Data Types and Routines .

Related Information Described in: Time instructions Setting the system clock RAPID Summary .g. e. Return value The current date in a string. TPWrite “The current date is: “+date. ”1998-01-29”. date. The current date is written to the teach pendant display and into a text file. Syntax CDate ’(’ ’)’ A function with a return value of the type string.Functions CDate CDate Reads the current date as a string CDate (Current Date) is used to read the current system date. Example VAR string date. Write logfile.Service System Data Types and Routines 3-CDate-541 . Data type: string The standard date format is “year-month-day”. The current date is stored in the variable date. Example date := CDate(). date := CDate(). This function can be used to present the current date to the operator on the teach pendant display or to paste the current date into a text file that the program writes to.System & Time User’s Guide .

CDate Functions 3-CDate-542 System Data Types and Routines .

in degrees for rotational axes. The current values for the external axes. Syntax CJointT’(’’)’ A function with a return value of the data type jointtarget. joints := CJointT(). Related information Described in: Definition of joint Reading the current motor angle Data Types . Return value Data type: jointtarget The current angles in degrees for the axes of the robot on the arm side.jointtarget Functions .Functions CJointT CJointT Reads the current joint angles CJointT (Current Joint Target) is used to read the current angles of the robot axes and external axes. The returned values are related to the calibration position. in mm for linear axes. Example VAR jointtarget joints.ReadMotor System Data Types and Routines 3-CJointT-543 . The current angles of the axes for the robot and external axes are stored in joints.

CJointT Functions 3-CJointT-544 System Data Types and Routines .

Once a clock is read it can be read again. started again. System Data Types and Routines 3-ClkRead-545 . Example reg1:=ClkRead(clock1). stopped. Return value Data type: num The time in seconds stored in the clock. The error can be handled in the error handler.967 seconds (49 days 17 hours 2 minutes 47 seconds) it becomes overflowed and the system variable ERRNO is set to ERR_OVERFLOW. Resolution 0. or reset. The clock clock1 is read and the time in seconds is stored in the variable reg1. Argument ClkRead Clock The name of the clock to read.010 seconds.294. Error handling If the clock runs for 4. (Clock) Data type: clock Program execution A clock can be read when it is stopped or running.Functions ClkRead ClkRead Reads a clock used for timing ClkRead is used to read a clock that functions as a stop-watch used for timing. Syntax ClkRead ’(’ [ Clock ’:=’ ] < variable (VAR) of clock > ’)’ A function with a return value of the type num.

ClkRead Functions Related Information Described in: Clock instructions Clock overflow More examples RAPID Summary .ClkStart 3-ClkRead-546 System Data Types and Routines .System & Time Data Types .clock Instructions .

value := Cos(angle). (Angle) Data type: num Syntax Cos’(’ [Angle ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. Data type: num Arguments Cos Angle The angle value. VAR num value. 1] . Return value The cosine value. Example VAR num angle. . expressed in degrees.Functions Cos Cos Calculates the cosine value Cos (Cosine) is used to calculate the cosine value from an angle value. Related information Described in: Mathematical instructions and functions RAPID Summary . range = [-1.Mathematics System Data Types and Routines 3-Cos-547 . .

Cos Functions 3-Cos-548 System Data Types and Routines .

work object and active ProgDisp coordinate system into consideration. If this argument is omitted the current active work object is used. Example VAR pos pos1. it is very sensible to always specify arguments \Tool and \WObj. Arguments CPos ([\Tool] [\WObj]) [\Tool] Data type: tooldata The tool used for calculation of the current robot position. The function will always then return the wanted position. taking the specified tool. The current position of the robot TCP is stored in variable pos1. The tool tool1 and work object wobj0 are used for calculating the position. and z in the outermost coordinate system. If the complete robot position (robtarget) is to be read. If this argument is omitted the current active tool is used. System Data Types and Routines 3-CPos-549 . y. Return value Data type: pos The current position (pos) of the robot with x. y. This function returns the x. [\WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the current robot position returned by the function is related. use the function CRobT instead. although some other tool or work object has been activated manually.Functions CPos CPos Reads the current position (pos) data CPos (Current Position) is used to read the current position of the robot. and z values of the robot TCP as data of type pos. When programming. pos1 := CPos(\Tool:=tool1 \WObj:=wobj0).

pos4 := pos3-pos2. pos2 := CPos(\Tool:=grip3 \WObj:=fixture). and z position of the robot is captured at two places within the program using the CPos function.tooldata Data Types .wobjdata Motion and I/O Principles . Example VAR pos pos2.CRobT 3-CPos-550 System Data Types and Routines .CPos Functions Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system.pos Data Types. The tool grip3 and work object fixture are used for calculating the position. y and z distances travelled between these positions are then calculated and stored in the pos variable pos4. pos3 := CPos(\Tool:=grip3 \WObj:=fixture). . Related information Described in: Definition of position Definition of tools Definition of work objects Coordinate systems Reading the current robtarget Data Types . The x. VAR pos pos4. .Coordinate Systems Functions . VAR pos pos3. The x. y. Syntax CPos ’(’ [’\’Tool ’:=’ <persistent (PERS) of tooldata>] [’\’WObj ’:=’ <persistent (PERS) of wobjdata>] ’)’ A function with a return value of the data type pos.

If only the x. Example VAR robtarget p1. orientation (q1 . Arguments CRobT ([\Tool] [\WObj]) [\Tool] Data type: tooldata The tool used for calculation of the current robot position. [\WObj] (Work Object) Data type: wobjdata The work object (coordinate system) to which the current robot position returned by the function is related. If this argument is omitted the current active tool is used. q4). y. The tool tool1 and work object wobj0 are used for calculating the position.. This function returns a robtarget value with position (x. The function will always then return the wanted position. p1 := CRobT(\Tool:=tool1 \WObj:=wobj0). work object and active ProgDisp/ExtOffs coordinate system into consideration. use the function CPos instead. Return value Data type: robtarget The current position of the robot and external axes in the outermost coordinate system. taking the specified tool. and z values of the robot TCP (pos) are to be read. The current position of the robot and external axes is stored in p1. System Data Types and Routines 3-CRobT-551 .. z). y. robot axes configuration and external axes position. although some other tool or work object has been activated manually. When programming. If this argument is omitted the current active work object is used.Functions CRobT CRobT Reads the current position (robtarget) data CRobT (Current Robot Target) is used to read the current position of the robot and external axes. it is very sensible to always specify arguments \Tool and \WObj.

wobjdata Motion and I/O Principles . The tool grip3 and work object fixture are used for calculating the position.CPos 3-CRobT-552 System Data Types and Routines . p2 := ORobT( RobT(\Tool:=grip3 \WObj:=fixture) ). Syntax CRobT’(’ [’\’Tool ’:=’ <persistent (PERS) of tooldata>] [’\’WObj ’:=’ <persistent (PERS) of wobjdata>] ’)’ A function with a return value of the data type robtarget. y. Related information Described in: Definition of position Definition of tools Definition of work objects Coordinate systems ExtOffs coordinate system Reading the current pos (x. External axes are represented in the ExtOffs coordinate system.Coordinate Systems Instructions .EOffsOn Functions .robtarget Data Types.CRobT Functions Program execution The coordinates returned represent the TCP position in the ProgDisp coordinate system. z only) Data Types . Example VAR robtarget p2.tooldata Data Types . The current position in the object coordinate system (without any ProgDisp or ExtOffs) of the robot and external axes is stored in p2.

e. "18:20:46". Data type: string The standard time format is "hours:minutes:seconds". TPWrite “The current time is: “+time. Syntax CTime ’(’ ’)’ A function with a return value of the type string. System Data Types and Routines 3-CTime-553 .Functions CTime CTime Reads the current time as a string CTime is used to read the current system time. Return value The current time in a string. time := CTime(). The current time is stored in the variable time. Example time := CTime(). time. The current time is written to the teach pendant display and written into a text file. Example VAR string time. Write logfile. This function can be used to present the current time to the operator on the teach pendant display or to paste the current time into a text file that the program writes to.g.

CTime Functions Related Information Described in: Time and date instructions Setting the system clock RAPID Summary .System & Time User’s Guide .System Parameters 3-CTime-554 System Data Types and Routines .

tooldata Motion and I/O Principles . The value returned represents the TCP position and orientation in the wrist centre coordinate system. [ [0. temp_tool := CTool(). 0. 0]. 0] ]. 0. 0.Coordinate Systems System Data Types and Routines 3-CTool-555 . the tool last used in a movement instruction. The value of the current tool is stored in the variable temp_tool.e.Functions CTool CTool Reads the current tool data CTool (Current Tool) is used to read the data of the current tool. Example PERS tooldata temp_tool:= [ TRUE. 0.001. see tooldata. [1. [1. 0. 0 . [0.0] ]. [0. 0.001]. Syntax CTool’(’’)’ A function with a return value of the data type tooldata. i. Related information Described in: Definition of tools Coordinate systems Data Types. 0]. 0. Return value Data type: tooldata This function returns a tooldata value holding the value of the current tool. 0.

CTool Functions 3-CTool-556 System Data Types and Routines .

see wobjdata. The value of the current work object is stored in the variable temp_wobj.wobjdata Motion and I/O Principles . temp_wobj := CWObj(). Return value Data type: wobjdata This function returns a wobjdata value holding the value of the current work object.Coordinate Systems System Data Types and Routines 3-CWObj-557 . Related information Described in: Definition of work objects Coordinate systems Data Types.e. Example PERS wobjdata temp_wobj. the work object last used in a movement instruction. i.Functions CWObj CWObj Reads the current work object data CWObj (Current Work Object) is used to read the data of the current work object. Syntax CWObj’(’’)’ A function with a return value of the data type wobjdata. The value returned represents the work object position and orientation in the world coordinate system.

CWObj Functions 3-CWObj-558 System Data Types and Routines .

. p5. After a displacement of the object the same positions are searched for and stored as p4-p6. *. . v50. SearchL sen1. v50. CONST robtarget p2 := [. p6. p5. v50. !Search for the new positions SearchL sen1. p2. CONST robtarget p1 := [.. SearchL sen1.. p3. related to an object in an original position. Example p3 p6 p5 p4 p1 p2 Three positions. p4. Then the calculated frame is used to displace all the stored positions in the program. have been stored. Data type: pose System Data Types and Routines 3-DefDFrame-559 . p4. tool1. p1. !activation of the displacement defined by frame1 PDispSet frame1. p6).. tool1. ...Functions DefDFrame DefDFrame Define a displacement frame DefDFrame (Define Displacement Frame) is used to calculate a displacement frame from three original positions and three displaced positions. CONST robtarget p3 := [. VAR pose frame1. Return value The displacement frame. VAR robtarget p4.p3. *.. frame1 := DefDframe (p1.].]. VAR robtarget p6. . VAR robtarget p5. tool1. From these six positions the displacement frame is calculated.]. *.

OldP3 The third original position.g. NewP2 Data type: robtarget The second displaced position. NewP3 Data type: robtarget The third displaced position. it has to be placed in a plane describing the new plane of p1.DefDFrame Functions Arguments DefDFrame OldP1 The first original position. NewP1 Data type: robtarget Data type: robtarget Data type: robtarget (OldP1 OldP2 OldP3 NewP1 NewP2 NewP3) Data type: robtarget The first displaced position.’ [NewP2 ’:=’] <expression (IN) of robtarget> ’.’ [NewP1 ’:=’] <expression (IN) of robtarget> ’. It should be noted that this position can be measured and determined with less accuracy in one direction. the system variable ERRNO is set to ERR_FRAME. e. p2 and p3. This position must be measured and determined with great accuracy.’ [NewP3 ’:=’] <expression (IN) of robtarget> ’)’ A function with a return value of the data type pose.g. Error handling If it is not possible to calculate the frame because of bad accuracy in the positions. Syntax DefDFrame’(’ [OldP1 ’:=’] <expression (IN) of robtarget> ’. This position can be measured and determined with less accuracy in two directions. This error can then be handled in the error handler.’ [OldP2 ’:=’] <expression (IN) of robtarget> ’.’ [OldP3 ’:=’] <expression (IN) of robtarget> ’. this position must be placed on a line describing the new direction of p1 to p2. OldP2 The second original position. e. 3-DefDFrame-560 System Data Types and Routines .

Calibration System Data Types and Routines 3-DefDFrame-561 .PDispSet User’s Guide .Functions DefDFrame Related information Described in: Activation of displacement frame Manual definition of displacement frame Instructions .

DefDFrame Functions 3-DefDFrame-562 System Data Types and Routines .

CONST robtarget p2 := [.. Data type: pose The calculation is related to the active object coordinate system.]. are used to define the new coordinate system. .p3. p2. Example y z p3 z x p2 y frame1 p1 object frame x Three positions. VAR pose frame1..Functions DefFrame DefFrame Define a frame DefFrame (Define Frame) is used to calculate a frame. CONST robtarget p3 := [. Return value The calculated frame. p3). is defining the direction of the x-axis and the third position. The first position. related to the object coordinate system. p1... The defined frame1 may be used as a displacement frame. frame1..]. as shown in the example below: CONST robtarget p1 := [.. the second position.]. . p1. from three positions defining the frame. !activation of the displacement defined by frame1 PDispSet frame1. p3. . is defining the location of the xy-plane. System Data Types and Routines 3-DefFrame-563 . . p2. is defining the origin of frame1. frame1 := DefFrame (p1.

z z New P3 x y New P2 frame1 y object frame x New P1 Origin = 3 means that the origin is placed on the line going through NewP1 and NewP2 and so that NewP3 will be placed on the y axis. [\Origin] Data type: num Optional argument. Origin = 1. see the figure below. 3-DefFrame-564 System Data Types and Routines . means that the origin is placed in NewP1. see the figure below.DefFrame Functions Arguments DefFrame NewP1 (NewP1 NewP2 NewP3 [\Origin]) Data type: robtarget The first position. see the figure above. which will define the direction of the x-axis of the new frame. Origin = 2 means that the origin is placed in NewP2. which will define the origin of the new frame. the same as if this argument is omitted. The position of point 3 will be on the positive y side. which will define how the origin of the frame will be placed. NewP3 Data type: robtarget The third position. NewP2 Data type: robtarget The second position.e. which will define the xy-plane of the new frame. i.

p3. will place the origin in NewP1. p2.1 mm. p3 must not be too small. the system variable ERRNO is set to ERR_FRAME. p2 p3 p1 θ The triangle is not considered to be well shaped if the angle θ a is too small. System Data Types and Routines 3-DefFrame-565 . the positions cannot be too close.e. Limitations The three positions p1 .p3 must not be less than 0.Functions DefFrame z y z y New P3 x New P2 frame1 object frame x New P1 Other values. The most well shaped triangle is the one with all sides of equal length.p2 and p1 . This error can then be handled in the error handler. The distances between the positions p1 . or if Origin is omitted. must define a well shaped triangle. Error handling If the frame cannot be calculated because of the above limitations. i. The angle θ is too small if: cos Θ <1 – 10 –4 The triangle p1. defining the frame.

Mathematics Instructions . Related information Described in: Mathematical instructions and functions Activation of displacement frame RAPID Summary .’ [NewP2 ’:=’] <expression (IN) of robtarget> ’.PDispSet 3-DefFrame-566 System Data Types and Routines .DefFrame Functions Syntax DefFrame’(’ [NewP1 ’:=’] <expression (IN) of robtarget> ’.’ [NewP3 ’:=’] <expression (IN) of robtarget> [’\’Origin ’:=’ <expression (IN) of num> ]’)’ A function with a return value of the data type pose.

Arguments Dim ArrPar The name of the array. Return value Data type: num The number of array elements of the specified dimension. This procedure can take any one-dimensional array of data type num as an input.Functions Dim Dim Obtains the size of an array Dim (Dimension) is used to obtain the number of elements in an array. num factor) FOR index FROM 1 TO Dim(array. Example PROC arrmul(VAR num array{*}. 1) DO array{index} := array{index} * factor. DimNo (Dimension Number) Data type: num (ArrPar DimNo) (Array Parameter) Data type: Any type The desired array dimension: 1 = first dimension 2 = second dimension 3 = third dimension System Data Types and Routines 3-Dim-567 . ENDFOR ENDPROC All elements of a num array are multiplied by a factor.

i2. ELSE FOR i1 FROM 1 TO Dim(array1.’ [DimNo’:=’] <expression (IN) of num> ’)’ A REF parameter requires that the corresponding argument be either a constant.i2. This procedure can take any three-dimensional arrays of data type num as an input.i3} + array2{i1. Stop. A function with a return value of the data type num.2) <> Dim(array2.3) <> Dim(array2. 1) DO FOR i2 FROM 1 TO Dim(array1.1) <> Dim(array2.i3} := array1{i1. a VAR parameter or an entire PERS parameter.*. 2) DO FOR i3 FROM 1 TO Dim(array1.*}) IF Dim(array1.*.Routines Basic Characteristics . the program stops and an error message appears. a variable or an entire persistent. num array2{*.1) OR Dim(array1.Dim Functions Example PROC add_matrix(VAR num array1{*.*}. Syntax Dim ’(’ [ArrPar’:=’] <reference (REF) of any type> ’.i2.Data 3-Dim-568 System Data Types and Routines .3) THEN TPWrite "The size of the matrices are not the same". ENDPROC Two matrices are added. If the size of the matrices differs. ENDFOR ENDFOR ENDFOR ENDIF RETURN. Related information Described in: Array parameters Array declaration Basic Characteristics .i3}. The argument could also be an IN parameter.2) OR Dim(array1. 3) DO array1{i1.

dist := Distance(p1.4. CONST pos p1 := [4. Data type: num Arguments Distance (Point1 Point2) Point1 The first point described by the pos data type.4]. The distance in space between the points p1 and p2 is calculated and stored in the variable dist.. Return value The distance (always positive) between the points. p2)..4]. Example y p2 x p1 z VAR num dist. Point2 The second point described by the pos data type. Data type: pos Data type: pos System Data Types and Routines 3-Distance-569 . .Functions Distance Distance Distance between two points Distance is used to calculate the distance between two points in the space.0. CONST pos p2 := [-4.

y1.pos 3-Distance-570 System Data Types and Routines . Related information Described in: Mathematical instructions and functions Definition of pos RAPID Summary .Mathematics Data Type . z2 x x1.z1 z distance =  ( x – x ) 2 + ( y – y )2 + ( z – z ) 2 1 2 1 2   1 2 Syntax Distance’(’ [Point1 ’:=’] <expression (IN) of pos> ’. y2.Distance Functions Program execution Calculation of the distance between the two points: y x2.’ [Point2 ’:=’] <expression (IN) of pos> ’)’ A function with a return value of the data type num.

vector1 := [1. Example B θAB A A B cos θAB The dot or scalar product of two vectors A and B is a scalar. System Data Types and Routines 3-DotProd-571 .3].1. A ⋅ B = A B cos θAB The dot product: • is less than or equal to the product of their magnitudes. VAR pos vector2. . dotprod := DotProd(vector1. vector2 := [1.2. The vectors are described by the data type pos and the dot product by the data type num: VAR num dotprod. . The typical use is to calculate the projection of one vector upon the other or to calculate the angle between the two vectors. • is equal to the product of the magnitude of one vector and the projection of the other vector upon the first one. depending whether the angle between them is smaller or larger then 90 degrees. • is zero when the vectors are perpendicular to each other.1].Functions DotProd DotProd Dot product of two pos vectors DotProd (Dot Product) is used to calculate the dot (or scalar) product of two pos vectors. • can be either a positive or a negative quantity. vector2). VAR pos vector1. which equals the products of the magnitudes of A and B and the cosine of the angle between them.

Related information Described in: Mathematical instructions and functions RAPID Summary .DotProd Functions Return value The value of the dot product of the two vectors.Mathematics 3-DotProd-572 System Data Types and Routines . Vector2 The second vector described by the pos data type.’ [Vector2 ’:=’] <expression (IN) of pos> ’)’ A function with a return value of the data type num. Data type: pos (Vector1 Vector2) Data type: pos Syntax DotProd’(’ [Vector1 ’:=’] <expression (IN) of pos> ’. Data type: num Arguments DotProd Vector1 The first vector described by the pos data type.

then . (Signal) Data type: signaldo Program execution The value read depends on the configuration of the signal.. If the current value of the system signal auto_on is not active. . Example IF DOutput(auto_on) <> active THEN . the value returned by this function is the opposite of the true value of the physical channel. System Data Types and Routines 3-DOutput-573 . Return value The current value of the signal (0 or 1). then . .. Syntax DOutput ’(’ [ Signal ’:=’ ] < variable (VAR) of signaldo > ’)’ A function with a return value of the data type dionum.. .e. If the current value of the signal do2 is equal to 1. if the robot is in the manual operating mode. i. . If the signal is inverted in the system parameters.. .. Data type: dionum Arguments DOutput Signal The name of the signal to be read. Note that the signal must first be defined as a system output in the system parameters. .Functions DOutput DOutput Reads the value of a digital output signal DOutput is used to read the current value of a digital output signal. then . Example IF DOutput(do2) = 1 THEN .

DOutput Functions Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .System Parameters 3-DOutput-574 System Data Types and Routines .

Data type: orient Data type: switch Data type: switch Data type: switch System Data Types and Routines 3-EulerZYX-575 . Example VAR num anglex.rot). \Y and \Z are mutually exclusive. anglez := EulerZYX(\Z. [\Y] Gets the rotation around the Y axis. Return value Data type: num The corresponding Euler angle. object. VAR pose object. VAR num angley. 180]. VAR num anglez.rot).Functions EulerZYX EulerZYX Gets Euler angles from orient EulerZYX (Euler ZYX rotations) is used to get an Euler angle component from an orient type variable. angley := EulerZYX(\Y.rot). Arguments EulerZYX ([\X] | [\Y] | [\Z] Rotation) The arguments \X. object. a run-time error is generated. anglex := EulerZYX(\X. . . object. Rotation The rotation in its quaternion representation. range [-180. expressed in degrees. [\X] Gets the rotation around the X axis. [\Z] Gets the rotation around the Z axis. If none of these are specified.

EulerZYX Functions Syntax EulerZYX’(’ ['\'X ’. Related information Described in: Mathematical instructions and functions RAPID Summary .’] | ['\'Z ’.’] [Rotation ’:=’] <expression (IN) of orient> ’)’ A function with a return value of the data type num.’] | ['\'Y ’.Mathematics 3-EulerZYX-576 System Data Types and Routines .

Functions Exp Exp Calculates the exponential value Exp (Exponential) is used to calculate the exponential value. ex. value:= Exp( x). . Example VAR num x. Return value The exponential value ex . . VAR num value.Mathematics System Data Types and Routines 3-Exp-577 . Data type: num Arguments Exp (Exponent) Data type: num Exponent The exponent argument value. Syntax Exp’(’ [Exponent ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. Related information Described in: Mathematical instructions and functions RAPID Summary .

Exp Functions 3-Exp-578 System Data Types and Routines .

Example Load "HOME:/notmymod. access or file status change of a file.mod". ENDIF ENDWHILE This program reloads a module if there is a newer at the source.mod" \ModifyTime) > ModTime("notmymod") THEN UnLoad "HOME:notmymod. ModifyTime Last modification time. Load "HOME:notmymod. execute of modify).mod". and to compare it to the FileTime\ModifyTime at the source. 1 1970. System Data Types and Routines 3--579 . Arguments FileTime ( Path [\ModifyTime] | [\AccessTime] | [\StatCTime] ) Path Data type: string The file specified with a full or relative path. the program unloads and loads the module again. WHILE TRUE DO ! Call some routine in notmymod notmymodrout.Functions FileTime Retrieve time information about a file FileTime is used to retrieve the last time for modification. It uses the ModTime to retrieve the latest loading time for the specified module. AccessTime Data type: switch Data type: switch Time of last access (read. Return value Data type: num The time measured in secs since 00:00:00 GMT. Jan 1 1970. The time is measured in secs since 00:00:00 GMT. Then. The time is returned as a num.mod". IF FileTime("HOME:/notmymod. Jan. if the source is newer.

ENDPROC 3--580 System Data Types and Routines . LOCAL VAR num currentpos:=0. ITimer freq. ENDIF pos := pos+1. ENDWHILE ENDTRAP PROC alertInit(num freq) currentpos:=0.filename+" is changed".filename \ModifyTime) > myfiles{pos}.Functions StatCTime Data type: switch Last file status (access qualification) change time. Example This is a complete example that implements an alert service for maximum 10 files.Access . ENDRECORD LOCAL VAR falert myfiles[10]. Program execution This function returns a numeric that specifies the time since the last: .File status change of the specified file. LOCAL RECORD falert string filename. num ftime. LOCAL VAR intnum timeint.ftime THEN TPWrite "The file "+myfiles{pos}. CONNECT timeint WITH mytrap.timeint. LOCAL TRAP mytrap VAR num pos:=1. ENDPROC PROC alertFree() IDelete timeint.Modification . WHILE pos <= currentpos DO IF FileTime(myfiles{pos}.

myfiles{currentpos}. ENDIF ENDPROC Error handling If the file does not exist.ftime := FileTime (filename \ModifyTime).Functions PROC alertNew(string filename) currentpos := currentpos+1. Syntax FileTime ’(’ [ Path ’:=’ ] < expression (IN) of string> [ '\'ModifyTime] | [ '\'AccessTime] | [ '\'StatCTime] ’)’ A function with a return value of the data type num. Related information Described in: Last time a module was loaded Functions . IF currentpos <= 10 THEN myfiles{currentpos}.ModTime System Data Types and Routines 3--581 . This error can then be handled in the error handler.filename := filename. the system variable ERRNO is set to ERR_FILEACC.

Functions 3--582 System Data Types and Routines .

This binary number is then converted to an integer.32767 0 .. of signals 9 10 11 12 13 14 15 16 Return value 0 .511 0 .Functions GOutput GOutput Reads the value of a group of digital output signals GOutput is used to read the current value of a group of digital output signals. Data type: num The values of each signal in the group are read and interpreted as an unsigned binary number..255 No.8191 0 . Return value The current value of the signal (a positive integer).4095 0 .16383 0 .63 0 . (Signal) Data type: signalgo System Data Types and Routines 3-GOutput-583 .2047 0 ...1023 0 .31 0 . of signals 1 2 3 4 5 6 7 8 Return value 0-1 0-3 0-7 0 . The value returned lies within a range that is dependent on the number of signals in the group. No. If the current value of the signal go2 is equal to 5.127 0 .15 0 . then .65535 Arguments GOutput Signal The name of the signal group to be read. Example IF GOutput(go2) = 5 THEN .

Related information Described in: Input/Output instructions Input/Output functionality in general Configuration of I/O RAPID Summary Input and Output Signals Motion and I/O Principles I/O Principles User’s Guide .GOutput Functions Syntax GOutput ’(’ [ Signal ’:=’ ] < variable (VAR) of signalgo > ’)’ A function with a return value of data type num.System Parameters 3-GOutput-584 System Data Types and Routines .

Functions GetTime GetTime Reads the current time as a numeric value GetTime is used to read a specified component of the current system time as a numeric value. Example hour := GetTime(\Hour). Return value One of the four time components specified below. The current hour is stored in the variable hour. Range: 0 to 59.respond to errors differently depending on the time of day. Range: 1 to 7 (Monday to Sunday). Data type: num Argument GetTime [\WDay] Return the current weekday. [\Hour] Return the current hour.abstain from performing certain activities on the weekend .perform certain activities on a weekday . Range: 0 to 59. [\Min] Return the current minute. GetTime can be used to : . Data type: switch Data type: switch Data type: switch ( [\WDay] | [\Hour] | [\Min] | [\Sec] ) Data type: switch System Data Types and Routines 3-GetTime-585 . Range: 0 to 23. [\Sec] Return the current second.have the program perform an action at a certain time .

GetTime Functions One of the arguments must be specified. Syntax GetTime ’(’ [’\’ WDay ] | [ ’\’ Hour ] | [ ’\’ Min ] | [ ’\’ Sec ] ’)’ A function with a return value of the type num. Example weekday := GetTime(\WDay). the robot is in the maintenance mode. hour := GetTime(\Hour). ELSE maintenance.System Parameters 3-GetTime-586 System Data Types and Routines . ENDIF If it is a weekday and the time is between 7:00 and 15:59 the robot performs production.System & Time User’s Guide . otherwise program execution stops with an error message. At all other times. Related Information Described in: Time and date instructions Setting the system clock RAPID Summary . IF weekday < 6 AND hour >6 AND hour < 16 THEN production.

ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ..Functions IsPers IsPers Is Persistent IsPers is used to test if a data object is a persistent variable or not.. ELSE ! Should not happen EXIT. Return value Data type: bool TRUE if the tested actual INOUT parameter is a persistent variable. Syntax IsPers’(’ [ DatObj ’:=’ ] < var or pers (INOUT) of any type > ’)’ A function with a return value of the data type bool. ENDIF ENDPROC The procedure procedure1 will take different actions depending on whether the actual parameter parameter1 is a variable or a persistent variable. Example PROC procedure1 (INOUT num parameter1) IF IsVar(parameter1) THEN ! For this call reference to a variable .. FALSE if the tested actual INOUT parameter is not a persistent variable. Arguments IsPers DatObj (DatObj) (Data Object) Data type: any type The name of the formal INOUT parameter. System Data Types and Routines 3-IsPers-587 ..

IsVar RAPID Characteristics .IsPers Functions Related information Described in: Test if variable Types of parameters (access modes) Function .Routines 3-IsPers-588 System Data Types and Routines .

FALSE if the tested actual INOUT parameter is not a variable. Example PROC procedure1 (INOUT num parameter1) IF IsVAR(parameter1) THEN ! For this call reference to a variable . ELSE ! Should not happen EXIT. System Data Types and Routines 3-IsVar-589 .Functions IsVar IsVar Is Variable IsVar is used to test whether a data object is a variable or not. depending on whether the actual parameter parameter1 is a variable or a persistent variable... Arguments IsVar DatObj (DatObj) (Data Object) Data type: any type The name of the formal INOUT parameter. ENDIF ENDPROC The procedure procedure1 will take different actions. ELSEIF IsPers(parameter1) THEN ! For this call reference to a persistent variable ... Return value Data type: bool TRUE if the tested actual INOUT parameter is a variable. Syntax IsVar’(’ [ DatObj ’:=’ ] < var or pers (INOUT) of any type > ’)’ A function with a return value of the data type bool.

Routines 3-IsVar-590 System Data Types and Routines .IsVar Functions Related information Described in: Test if persistent Types of parameters (access modes) Function .IsPers RAPID Characteristics .

this work object must be referred to in the argument. relative to which the input position. . . This position is mirrored in the xy-plane of the frame defined by mirror. System Data Types and Routines 3-MirPos-591 . The orientation part of this position defines the current orientation of the tool coordinate system. The location of the object frame is defined relative to the user frame. mirror). Point. Note. [\WObj] (Work Object) Data type: wobjdata The work object data defining the object frame. VAR robtarget p2. relative to the world coordinate system. Arguments MirPos Point (Point MirPlane [\WObj] [\MirY]) Data type: robtarget The input robot position. and user frame. The result is new robtarget data. Example CONST robtarget p1. The mirror plane is the xy-plane of the object frame defined in MirPlane. the position is defined relative to the World coordinate system. p1 is a robtarget storing a position of the robot and an orientation of the tool. which is stored in p2. also defined in MirPlane. Return value Data type: robtarget The new position which is the mirrored position of the input position. which in turn is defined relative to the world frame. MirPlane (Mirror Plane) Data type: wobjdata The work object data defining the mirror plane. p2 := MirPos(p1. PERS wobjdata mirror. is defined. If the position is created with a work object active. If this argument is left out.Functions MirPos MirPos Mirroring of a position MirPos (Mirror Position) is used to mirror the translation and rotation parts of a position.

’ [’\’WObj ’:=’ <expression (IN) of wobjdata> ] [’\’MirY ]’)’ A function with a return value of the data type robtarget. the tool frame will be mirrored as regards the y-axis and the z-axis. Limitations No recalculation is done of the robot configuration part of the input robtarget data. the tool frame will be mirrored as regards the x-axis and the z-axis.MirPos [\MirY] (Mirror Y) Functions Data type: switch If this switch is left out.’ [MirPlane ’:=’] <expression (IN) of wobjdata> ’. which is the default rule. Related information Described in: Mathematical instructions and functions RAPID Summary .Mathematics 3-MirPos-592 System Data Types and Routines . If the switch is specified. Syntax MirPos’(’ [ Point ’:=’ ] < expression (IN) of robtarget>’.

PROC printMyTime() mytime := ModTime("mymod"). TPWrite "My time is "+NumToStr(mytime.Functions ModTime Get time of load for a loaded module ModTime (Module Time) is used to retrieve the time of loading a specified module. Jan 1 1970. Data type: string Program execution This function return a numeric that specify the time when the module was loaded. System Data Types and Routines 3--593 . The module is specified by its name and must be in the task memory.0). The time is returned as a num. Example MODULE mymod VAR num mytime. The time is measured in secs since 00:00:00 GMT. ENDPROC Return value Data type: num The time measured in secs since 00:00:00 GMT. Jan 1 1970. Arguments ModTime ( Object ) Object The name of the module.

and compares it to the FileTime\ModifyTime at the source. the program unloads and loads the module again.mod". Then. MODULE updmod PROC callrout() Load "HOME:/mymod. Syntax ModTime ’(’ [ Object ’:=’ ] < expression (IN) of string>’)’ A function with a return value of the data type num. It uses the ModTime to retrieve the latest loading time for the specified module.mod".mod" \ModifyTime) > ModTime("mymod") THEN UnLoad "HOME:/mymod. Related information Described in: Retrieve time info. IF FileTime("HOME:/mymod.Functions Example This is a complete example that implements an “update if newer” service. ENDIF ENDWHILE ENDPROC ENDMODULE This program reloads a module if there is a newer one at the source. if the source is newer.mod".FileTime 3--594 System Data Types and Routines . Load "HOME:/mymod. WHILE TRUE DO ! Call some routine in mymod mymodrout. about a file Functions .

707107. System Data Types and Routines 3-NOrient-595 . 0.1. 0. 0.1 normerr > 0. 0.707170 ) ABS ( 0. 0. the sum of the squares must equal 1: 2 2 2 2 q 1 + q 2 + q3 + q4 = 1 If the orientation is slightly unnormalised. 0. 0. 0.707170. 0.707170]. If the normalisation error is greater then 0.00001 AND err <= 0.e. 0. The normalisation of the orientation ( 0. VAR orient normorient.707107 ).00001 and less then 0.00001 ⇒ unnormalized 2 2 2 2 VAR orient unnormorient := [0.707170. it is possible to normalise it.00001 Unusable Slightly unnormalised Normalised Example We have a slightly unnormalised position ( 0. normorient := NOrient(unnormorient). 0. 0. . ABS ( q 1 + q 2 + q 3 + q 4 – 1 ) = normerr 2 2 2 2 normerr > 0.0000894 > 0. Description An orientation must be normalised. The orientation is considered to be slightly unnormalised if the normalisation error is greater then 0.707170 + 0 + 0 + 0.707170 – 1 ) = 0. . i.1 the orient is unusable. The normalisation error is the absolute value of the sum of the squares of the orientation components.707170.Functions NOrient NOrient Normalise Orientation NOrient (Normalise Orientation) is used to normalise unnormalised orientation (quaternion).707170 ) becomes ( 0.1 normerr <= 0.0000894 0.

NOrient Functions Return value The normalised orientation.Mathematics 3-NOrient-596 System Data Types and Routines . Data type: orient Arguments NOrient Orient The orientation to be normalised. (Rotation) Data type: orient Syntax NOrient’(’ [Rotation ’:=’] <expression (IN) of orient> ’)’ A function with a return value of the data type orient. Related information Described in: Mathematical instructions and functions RAPID Summary .

Dec (Decimals) Data type: num Number of decimals. [\Exp] To use exponent. The variable str is given the value "0.3). The numeric value is rounded if necessary. Example VAR string str.385". Arguments NumToStr Val (Val Dec [\Exp]) (Value) Data type: num The numeric value to be converted.Functions NumToStr NumToStr Converts numeric value to string NumToStr (Numeric To String) is used to convert a numeric value to a string. reg1 := 0. str := NumToStr(0.38521. The variable str is given the value "3. 2\Exp). The decimal point is suppressed if no decimals are included. (Exponent) Data type: switch System Data Types and Routines 3-NumToStr-597 .85E-01". with exponent if so requested.38521 str := NumToStr(reg1. The number of decimals must not be negative or greater than the available precision for numeric values. Return value Data type: string The numeric value converted to a string with the specified number of decimals.

’ [ Dec ’:=’ ] <expression (IN) of num> [ \Exp ] ’)’ A function with a return value of the data type string. Related information Described in: String functions Definition of string String values RAPID Summary .string Basic Characteristics Basic Elements 3-NumToStr-598 System Data Types and Routines .NumToStr Functions Syntax NumToStr’(’ [ Val ’:=’ ] <expression (IN) of num> ’.String Functions Data Types .

p1 := Offs (p1. 10 mm in the y-direction and 15 mm in the z-direction. The robot is moved to a point 10 mm from the position p2 (in the z-direction). tool1. ZOffset The displacement in the z-direction. XOffset The displacement in the x-direction. Examples MoveL Offs(p2.Functions Offs Offs Displaces a robot position Offs is used to add an offset to a robot position. Data type: num Data type: num Data type: num (Point XOffset YOffset ZOffset) Data type: robtarget System Data Types and Routines 3-Offs-599 . 0. 5. 10). 15). z50. Data type: robtarget Arguments Offs Point The position data to be displaced. 10. The robot position p1 is displaced 5 mm in the x-direction. Return value The displaced position data. 0. YOffset The displacement in the y-direction. v1000.

Related information Described in: Position data Data Types . ENDPROC A routine for picking parts from a pallet is made. 0]. 9E9]]. fine. 0.’ [YOffset ’:=’] <expression (IN) of num> ’. v100.’ [XOffset ’:=’] <expression (IN) of num> ’. [1. [9E9. Columns O O Rows O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O O Y-axis O O O O O O O O O O O O O X-axis O O O Figure 36 The position and orientation of the pallet is specified by defining a work object. MoveL palettpos. PERS tooldata tool. (row-1)*distance. 0. [0. 9E9. 0. palettpos := Offs (palettpos. num distance. 0. Each pallet is defined as a work object (see Figure 36). num column. Incrementing the row and column index is performed outside the routine.’ [ZOffset ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type robtarget. (column-1)*distance. 9E9. 0). 0].robtarget 3-Offs-600 System Data Types and Routines . 9E9. PERS wobjdata wobj) VAR robtarget palletpos:=[[0. 0. 0]. The part to be picked (row and column) and the distance between the parts are given as input parameters. Syntax Offs ’(’ [Point ’:=’] <expression (IN) of robtarget> ’.Offs Functions Example PROC pallet (num row. 9E9. tool\WObj:=wobj.

.Starting up Functions . CASE OP_MAN_TEST: . ENDTEST Different program sections are executed depending on the current operating mode. Related information Described in: Different operating modes Reading running mode User’s Guide ..Functions OpMode OpMode Read the operating mode OpMode (Operating Mode) is used to read the current operating mode of the system. Example TEST OpMode() CASE OP_AUTO: .. 250 mm/s Manual operating mode full speed..... Return value Data type: symnum The current operating mode as defined in the table below. 100 % 3 OP_MAN_TEST Syntax OpMode’(’ ’)’ A function with a return value of the data type symnum. CASE OP_MAN_PROG: . DEFAULT: . Return value 0 1 2 OP_UNDEF OP_AUTO OP_MAN_PROG Symbolic constant Comment Undefined operating mode Automatic operating mode Manual operating mode max.RunMode System Data Types and Routines 3-OpMode-601 ..

OpMode Functions 3-OpMode-602 System Data Types and Routines .

around the Z axis. VAR pose object.rot := OrientZYX(anglez. anglex) Return value The orientation made from the Euler angles. in degrees. around the X axis. . The rotations will be performed in the following order: -rotation around the z axis. -rotation around the new y axis -rotation around the new x axis. in degrees. angley. object. Data type: num Data type: num (ZAngle YAngle XAngle) Data type: num System Data Types and Routines 3-OrientZYX-603 . -rotation around the new y axis -rotation around the new x axis. XAngle The rotation. The rotations will be performed in the following order: -rotation around the z axis. around the Y axis. Example VAR num anglex. VAR num angley. Data type: orient Arguments OrientZYX ZAngle The rotation. YAngle The rotation. VAR num anglez.Functions OrientZYX OrientZYX Builds an orient from Euler angles OrientZYX (Orient from Euler ZYX angles) is used to build an orient type variable out of Euler angles. in degrees.

Mathematics 3-OrientZYX-604 System Data Types and Routines .’ [YAngle ’:=’] <expression (IN) of num> ’.’ [XAngle ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type orient. Related information Described in: Mathematical instructions and functions RAPID Summary .OrientZYX Functions Syntax OrientZYX’(’ [ZAngle ’:=’] <expression (IN) of num> ’.

The values stored in p11 are related to the object coordinate system without any offset on the external axes. removes external axes offset only.e. Example VAR robtarget p10. i. System Data Types and Routines 3-ORobT-605 . p11 := ORobT(p10). Data type: robtarget Arguments ORobT (OrgPoint [\InPDisp] | [\InEOffs]) OrgPoint (Original Point) Data type: robtarget The original point to be transformed. p10 := CRobT(). [\InPDisp] (In Program Displacement) Data type: switch Returns the TCP position in the ProgDisp coordinate system.e. removes program displacement for the robot only.Functions ORobT ORobT Removes a program displacement from a position ORobT (Object Robot Target) is used to transform a robot position from the program displacement coordinate system to the object coordinate system and/or to remove an offset for the external axes. The current positions of the robot and the external axes are stored in p10 and p11. VAR robtarget p11. Return value The transformed position data. i. The values stored in p10 are related to the ProgDisp/ExtOffs coordinate system. [\InEOffs] (In External Offset) Data type: switch Returns the external axes in the offset coordinate system.

Syntax ORobT ’(’ [ OrgPoint ’:=’ ] < expression (IN) of robtarget> [’\’InPDisp] | [’\’InEOffs]’)’ A function with a return value of the data type robtarget. The external axes will remain in the offset coordinate system.ORobT Functions Examples p10 := ORobT(p10 \InEOffs ).PDispOn. The TCP position will remain in the ProgDisp coordinate system. Related information Described in: Definition of program displacement for the robot Definition of offset for external axes Coordinate systems Instructions .EOffsOn. p10 := ORobT(p10 \InPDisp ). The ORobT function will remove any offset of the external axes. leaving the TCP position relative to the object coordinate system. The ORobT function will remove any program displacement that is active.Coordinate Systems 3-ORobT-606 System Data Types and Routines . EOffsSet Motion and I/O Principles . PDispSet Instructions .

. The transformation giving the coordinates of Frame0 related to Frame1 is obtained by the reverse transformation: VAR pose pose1. VAR pose pose2. . Example z1 Pose1 z0 y1 x1 Frame1 Frame0 y0 x0 Pose2 Pose1 represents the coordinates of Frame1 related to Frame0. Data type: pose Arguments PoseInv Pose The pose to invert.Functions PoseInv PoseInv Inverts the pose PoseInv (Pose Invert) calculates the reverse transformation of a pose. (Pose) Data type: pose System Data Types and Routines 3-PoseInv-607 . Return value The value of the reverse pose. pose2 := PoseInv(pose1).

Related information Described in: Mathematical instructions and functions RAPID Summary .PoseInv Functions Syntax PoseInv’(’ [Pose ’:=’] <expression (IN) of pose> ’)’ A function with a return value of the data type pose.Mathematics 3-PoseInv-608 System Data Types and Routines .

pose2). Data type: pose System Data Types and Routines 3-PoseMult-609 . Example z1 y1 z0 pose1 Frame1 x1 pose2 z2 Frame2 y2 Frame0 y0 x0 pose3 x2 pose1 represents the coordinates of Frame1 related to Frame0. is obtained by the product of the two transformations: VAR pose pose1. The transformation giving pose3. VAR pose pose2. pose3 := PoseMult(pose1. . . pose2 represents the coordinates of Frame2 related to Frame1. VAR pose pose3. A typical use is to calculate a new frame as the result of a displacement acting on an original frame. Return value The value of the product of the two poses.Functions PoseMult PoseMult Multiplies pose data PoseMult (Pose Multiply) is used to calculate the product of two frame transformations. the coordinates of Frame2 related to Frame0.

PoseMult Functions Arguments PoseMult Pose1 The first pose.Mathematics 3-PoseMult-610 System Data Types and Routines . Data type: pose (Pose1 Pose2) Data type: pose Syntax PoseMult’(’ [Pose1 ’:=’] <expression (IN) of pose> ’.’ [Pose2 ’:=’] <expression (IN) of pose> ’)’ A function with a return value of the data type pose. Related information Described in: Mathematical instructions and functions RAPID Summary . Pose2 The second pose.

VAR pos pos2. The corresponding vector related to Frame0 is obtained by the product: VAR pose pose1. . pos1 is a vector related to Frame1. Return value Data type: pos The value of the product of the pose and the original pos. VAR pos pos1. pos1). pos2:= PoseVect(pose1.Functions PoseVect PoseVect Applies a transformation to a vector PoseVect (Pose Vector) is used to calculate the product of a pose and a vector. System Data Types and Routines 3-PoseVect-611 . . Example pos2 z0 pose1 Frame0 y0 x0 z1 pos1 y1 Frame1 x1 pose1 represents the coordinates of Frame1 related to Frame0. It is typically used to calculate a vector as the result of the effect of a displacement on an original vector.

’ [Pos ’:=’] <expression (IN) of pos> ’)’ A function with a return value of the data type pos. Pos The pos to be transformed.Mathematics 3-PoseVect-612 System Data Types and Routines .PoseVect Functions Arguments PoseVect Pose The transformation to be applied. Data type: pos (Pose Pos) Data type: pose Syntax PoseVect’(’ [Pose ’:=’] <expression (IN) of pose> ’. Related information Described in: Mathematical instructions and functions RAPID Summary .

Return value Data type: num The value of the base x raised to the power of the exponent y ( xy ). . Example VAR num x. y). reg1 is assigned the value xy. VAR num y VAR num reg1.Functions Pow Pow Calculates the power of a value Pow (Power) is used to calculate the exponential value in any base. reg1:= Pow(x. Data type: num (Base Exponent) Data type: num Limitations The execution of the function xy will give an error if: . x = 0 and y < 0. System Data Types and Routines 3-Pow-613 . Exponent The exponent argument value. . Arguments Pow Base The base argument value. x < 0 and y is not an integer.

Pow Functions Syntax Pow’(’ [Base ’:=’] <expression (IN) of num> ’. Related information Described in: Mathematical instructions and functions RAPID Summary .’ [Exponent ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num.Mathematics 3-Pow-614 System Data Types and Routines .

Arguments Present OptPar (OptPar) (Optional Parameter) Data type: Any type The name of the optional parameter to be tested. An optional parameter may not be used if it was not specified when calling the routine. System Data Types and Routines 3-Present-615 . FALSE = The parameter value or a switch has not been defined. Example PROC feeder (\switch on | \switch off) IF Present (on) Set do1.Functions Present Present Tests if an optional parameter is used Present is used to test if an optional argument has been used when calling a routine. Return value Data type: bool TRUE = The parameter value or a switch has been defined when calling the routine. in order to prevent errors from occurring. is set or reset depending on the argument used when calling the routine. IF Present (off) Reset do1. ENDPROC The output do1. which controls a feeder. This function can be used to test if a parameter has been specified.

a pulse is generated on the signal glue_on. The robot then sets an analog output gluesignal. Related information Described in: Routine parameters Basic Characteristics . zone.Routines 3-Present-616 System Data Types and Routines . tool \WObj=wobj. different MoveL instructions are used depending on whether this argument is used or not. glueflow. If the argument \on is specified when calling the routine. and moves to the end position. robtarget topoint. speed. SetAO gluesignal. the optional parameter name. ELSE MoveL topoint.Present Functions Example PROC glue (\switch on. zonedata zone. ENDIF ENDPROC A glue routine is made. zone. num glueflow. PERS tooldata tool. in this case. tool. speeddata speed. A function with a return value of the data type bool. which controls the glue gun. speed. Syntax Present ’(’ [OptPar’:=’] <reference (REF) of any type> ’)’ A REF parameter requires. \PERS wobjdata wobj) IF Present (on) PulseDO glue_on. As the wobj parameter is optional. IF Present (wobj) THEN MoveL topoint.

the max. character := ReadBin(inchannel). This function works on both binary and character-based files or serial channels. This byte is converted to the corresponding positive numeric value and returned as a num data type. A byte is read from the binary serial channel inchannel. [\Time] Data type: num The max. System Data Types and Routines 3-ReadBin-617 . Open "sio1:". the execution will be stopped. If there is no error handler. time for the reading operation (timeout) in seconds.. VAR iodev inchannel. Return value Data type: num A byte (8 bits) is read from a specified file or serial channel. If this argument is not specified. The timeout function is in use also during program stop and will be noticed in the RAPID program at program start. time is set to 60 seconds.Functions ReadBin ReadBin Reads a byte from a file or serial channel ReadBin (Read Binary) is used to read a byte (8 bits) from a file or serial channel. the number -1 is returned. inchannel\Bin. Arguments ReadBin IODevice (IODevice [\Time]) Data type: iodev The name (reference) of the file or serial channel to be read. . If this time runs out before the reading operation is finished. Program execution Program execution waits until a byte (8 bits) can be read from the file or serial channel. If a file is empty (end of file). Example VAR num character.. the error handler will be called with the error code ERR_DEV_MAXTIME.

Limitations The function can only be used for files and serial channels that have been opened with read access (\Read for character based files. \Bin or \Append \Bin for binary files). the system variable ERRNO is set to ERR_FILEACC. Predefined data The constant EOF_BIN can be used to stop reading at the end of the file. bindata := ReadBin(file). 3-ReadBin-618 System Data Types and Routines . WHILE bindata <> EOF_BIN DO TPWrite ByteToStr(bindata\Char). CONST num EOF_BIN := -1. Open “HOME:/myfile.bin”. VAR iodev file. These errors can then be dealt with by the error handler. the system variable ERRNO is set to ERR_DEV_MAXTIME. file \Read \Bin.bin from the beginning to the end and displays the received binary data converted to chars on the teach pendant (one char on each line).ReadBin Functions Example VAR num bindata. ENDWHILE Read the contents of a binary file myfile. Error handling If an error occurs during reading. If time out before the read operation is finished. bindata := ReadBin(file). Syntax ReadBin’(’ [IODevice ’:=’] <variable (VAR) of iodev> [’\’Time’:=’ <expression (IN) of num>]’)’ A function with a return value of the type num.

ByteToStr System Data Types and Routines 3-ReadBin-619 .Communication Functions .) files or serial channels Convert a byte to a string data RAPID Summary .Functions ReadBin Related information Described in: Opening (etc.

ReadBin Functions 3-ReadBin-620 System Data Types and Routines .

The primary use of this function is in the calibration procedure of the robot. Return value Data type: num The current motor angle in radians of the stated axis of the robot or external axes. If this argument is omitted. System Data Types and Routines 3-ReadMotor-621 . in this release only robot is permitted for this argument). Axis The number of the axis to be read (1 . The current motor angle of the second axis of the robot is stored in motor_angle2. The value represents the full movement of each axis. only to the resolver internal zero position. Arguments ReadMotor [\MecUnit ] Axis MecUnit (Mechanical Unit) Data type: mecunit The name of the mechanical unit for which an axis is to be read. Data type: num Program execution The motor angle returned represents the current position in radians for the motor and independently of any calibration offset.6). although this may be several turns.Functions ReadMotor ReadMotor Reads the current motor angles ReadMotor is used to read the current angles of the different motors of the robot and external axes. the axis for the robot is read. (Note. The value is not related to a fix position of the robot. normally the resolver zero position closest to the calibration position (the difference between the resolver zero position and the calibration position is the calibration offset value). Example VAR num motor_angle2.e. i. motor_angle2 := ReadMotor(2).

Syntax ReadMotor’(’ [’\’MecUnit ’:=’ < variable (VAR) of mecunit>’.’] [Axis ’:=’ ] < expression (IN) of num> ’)’ A function with a return value of the data type num.CJointT 3-ReadMotor-622 System Data Types and Routines . Related information Described in: Reading the current joint angle Functions .ReadMotor Functions Example VAR num motor_angle3. The current motor angle of the third axis of the robot is stored in motor_angle3. 3). motor_angle3 := ReadMotor(\MecUnit:=robot.

If the file is empty (end of file). Open "HOME:/file. .. the control system always adds the characters carriage return (\0D) and line-feed (\0A) to the delimiters specified by the user. use \xx. any character in the specified string argument will be considered to determine the significant part of the line. Return value Data type: num The numeric value read from a specified file or serial channel. To specify non-alphanumeric characters.Functions ReadNum ReadNum Reads a number from a file or serial channel ReadNum (Read Numeric) is used to read a number from a character-based file or serial channel. Example VAR iodev infile.doc". the file is read line by line and the line-feed character (\0A) is the only delimiter considered by the parsing. [\Delim] (Delimiters) Data type: string A string containing the delimiters to use when parsing a line in the file or serial channel. System Data Types and Routines 3-ReadNum-623 . Reg1 is assigned a number read from the file file. reg1 := ReadNum(infile).doc. By default (without \Delim). Arguments ReadNum IODevice (IODevice [\Delim] [\Time]) Data type: iodev The name (reference) of the file or serial channel to be read..999E36 is returned. the number 9. When the \Delim argument is used. When using the argument \Delim. infile\Read. where xx is the hexadecimal representation of the ASCII code of the character (example: TAB is specified by \09).

. the remainder of the characters will be read on the next reading. the error handler will be called with the error code ERR_DEV_MAXTIME. 3-ReadNum-624 System Data Types and Routines .4” is converted to the numeric value 234. time for the reading operation (timeout) in seconds.4. the max.g. the function reads and discards any heading delimiters. . If the significant part exceeds 80 characters. Reads a number in a line where numbers are separated by TAB (“\09”) or SPACE (“ “) characters. The timeout function is also in use during program stop and will be noticed in the RAPID program at program start. Heading delimiters with the argument \Delim are any characters specified in the \Delim argument plus carriage return and line-feed characters. time is set to 60 seconds. If this argument is not specified. e. Example reg1 := ReadNum(infile\Delim:="\09 "). Before using the number read from the file. IF reg1 > EOF_NUM THEN TPWrite "The file is empty". “234. A heading delimiter without the argument \Delim is a line-feed character.ReadNum [\Time] Functions Data type: num The max. It then reads everything up to and including the next delimiter character (will be discarded). If there is no error handler. the execution will be stopped. If this time runs out before the read operation is finished. a check is performed to make sure that the file is not empty. The string that is read is then converted to a numeric value.. Program execution Starting at the current file position. Limitations The function can only be used for character based files that have been opened for reading. but not more than 80 characters.

Functions ReadNum Error handling If an access error occurs during reading. Predefined data The constant EOF_NUM can be used to stop reading. Related information Described in: Opening (etc. the system variable ERRNO is set to ERR_FILEACC. CONST num EOF_NUM := 9. Syntax ReadNum ’(’ [IODevice ’:=’]<variable (VAR) of iodev> [‘\’Delim’:=’<expression (IN) of string>] [’\’Time’:=’<expression (IN) of num>]’)’ A function with a return value of the type num.998E36. the system variable ERRNO is set to ERR_DEV_MAXTIME. If there is an attempt to read non-numeric data. These errors can then be dealt with by the error handler.Communication System Data Types and Routines 3-ReadNum-625 .) files or serial channels RAPID Summary . If time out before the read operation is finished. the system variable ERRNO is set to ERR_RCVDATA. at the end of the file.

ReadNum Functions 3-ReadNum-626 System Data Types and Routines .

any character in the specified string argument plus by default line-feed character will be considered to determine the significant part of the line. VAR iodev infile.doc. Example VAR string text. use \xx. Text is assigned a string read from the file file. Return value Data type: string The string read from the specified file or serial channel. System Data Types and Routines 3-ReadStr-627 .. . By default the file is read line by line and the line-feed character (\0A) is the only delimiter considered by the parsing.doc". where xx is the hexadecimal representation of the ASCII code of the character (example: TAB is specified by \09). If the file is empty (end of file).Functions ReadStr ReadStr Reads a string from a file or serial channel ReadStr (Read String) is used to read a string from a character-based file or serial channel. Open "HOME:/file. Arguments ReadStr IODevice (IODevice [\Delim] [\RemoveCR] [\DiscardHeaders] [\Time]) Data type: iodev The name (reference) of the file or serial channel to be read.. infile\Read. To specify non-alphanumeric characters. text := ReadStr(infile). the string "EOF" is returned. [\Delim] (Delimiters) Data type: string A string containing the delimiters to use when parsing a line in the file or serial channel. When the \Delim argument is used.

If the last character in the string is a carriage return character and the \RemoveCR argument is used. [\Time] Data type: num The max. the function reads and discards any heading delimiters (line-feed characters and any character specified in the \Delim argument). but not more than 80 characters. the execution will be stopped. In all cases. the carriage return character will be read from the file but not included in the return string. if the \DiscardHeaders argument is used. the remainder of the characters will be read on the next reading. the max. If this time runs out before the read operation is finished. if the first character at the current file position is a delimiter. the error handler will be called with the error code ERR_DEV_MAXTIME. time is set to 60 seconds. it then reads everything up to the next delimiter character. this character will be removed from the string. the line parsing is stopped and the return will be an empty string. If this argument is used. When using this argument. When reading a line in such files. In PC files. If the significant part exceeds 80 characters.ReadStr [\RemoveCR] Functions Data type: switch A switch used to remove the trailing carriage return character when reading PC files. 3-ReadStr-628 System Data Types and Routines . the carriage return character is by default read into the return string. If this argument is not specified. The timeout function is in use also during program stop and will be noticed in the RAPID program at program start. Program execution Starting at the current file position. a new line is specified by carriage return and line feed (CRLF). all delimiters included in the line will be read from the file but discarded. The delimiter that caused the parsing to stop is read from the file but not transferred to the return string. it is read but not transferred to the return string. By default. [\DiscardHeaders] Data type: switch This argument specifies whether the heading delimiters (specified in \Delim plus default line-feed) are skipped or not before transferring data to the return string. and the return string will contain the data starting at the first non-delimiter character in the line. If there is no error handler. time for the reading operation (timeout) in seconds.

Example Consider a file containing: <CR><LF>Hello<CR><LF> text := ReadStr(infile).. the default <LF> delimiter. A new invocation of the same statement will return “Hello\0d”. Before using the string read from the file. but only <CR> is transferred to the string. is discarded. the default <LF> delimiter. text will contain <SPACE><TAB>Hello<SPACE><SPACE>World: the first character in the file. text will be an empty string: the first character in the file is the default <LF> delimiter. the final carriage return character is removed text := ReadStr(infile\Delim:=” \09”\RemoveCR\DiscardHeaders). System Data Types and Routines 3-ReadStr-629 . A new invocation of the same statement will return “World”.. text will contain <SPACE><TAB>Hello<SPACE><SPACE>World<CR>: the first character in the file. is discarded. text := ReadStr(infile\DiscardHeaders).Functions ReadStr Example text := ReadStr(infile). text will contain “Hello”: the first characters in the file that match either the default <LF> delimiter or the character set defined by \Delim (space and tab) are discarded. Example Consider a file containing: <LF><SPACE><TAB>Hello<SPACE><SPACE>World<CR><LF> text := ReadStr(infile). a check is performed to make sure that the file is not empty. IF text = EOF THEN TPWrite "The file is empty". text := ReadStr(infile\RemoveCR\DiscardHeaders). Data is then transferred up to the first delimiter that is read from the file but not transferred into the string. . text will contain the <CR> (\0d) character: <CR> and <LF> characters are read from the file.

the system variable ERRNO is set to ERR_DEV_MAXTIME. text will contain “Hello”. text := ReadStr(infile\Delim:=”\0d”). Error handling If an error occurs during reading. text will contain an empty string: <CR> is read from the file but not transferred to the return string.ReadStr text := ReadStr(infile\RemoveCR). Limitations The function can only be used for files or serial channels that have been opened for reading in a character-based mode. text := ReadStr(infile\Delim:=”\0d”\DiscardHeaders). 3-ReadStr-630 System Data Types and Routines . Predefined data The constant EOF can be used to check if the file was empty when trying to read from the file or to stop reading at the end of the file. A new invocation of the same statement will return “Hello”. CONST string EOF := "EOF". <CR> is transferred but removed from the string. A new invocation of the same instruction will return “EOF” (end of file). If timeout before the read operation is finished. A new invocation of the same instruction will return an empty string again: <LF> is read from the file but not transferred to the return string. the system variable ERRNO is set to ERR_FILEACC. These errors can then be dealt with by the error handler. Functions text will contain an empty string: <CR> and <LF> characters are read from the file.

Communication System Data Types and Routines 3-ReadStr-631 .Functions ReadStr Syntax ReadStr ’(’ [IODevice ’:=’] <variable (VAR) of iodev> [‘\’Delim’:=’<expression (IN) of string>] [‘\’RemoveCR] [‘\’DiscardHeaders] [’\’Time’:=’ <expression (IN) of num>]’)’ A function with a return value of the type string. Related information Described in: Opening (etc.) files or serial channels RAPID Summary .

ReadStr Functions 3-ReadStr-632 System Data Types and Routines .

. time is set to 60 seconds. Text is assigned a 10 characters text string read from the serial channel referred to by channel2. the string "EOF" is returned. the max. Return value Data type: string The text string read from the specified serial channel or file. text := ReadStrBin (channel2. The timeout function is in use also during program stop and will be noticed in the RAPID program at program start. the execution will be stopped. NoOfChars Data type: num The number of characters to be read from the binary serial channel or file. If there is no error handler.Functions ReadStrBin ReadStrBin Reads a string from a binary serial channel or file ReadStrBin (Read String Binary) is used to read a string from a binary serial channel or file. Arguments ReadStrBin IODevice (IODevice NoOfChars [\Time]) Data type: iodev The name (reference) of the binary serial channel or file to be read. If this argument is not specified. . Open “sio1:”. 10).. the error handler will be called with the error code ERR_DEV_MAXTIME. VAR string text. If this time runs out before the read operation is finished. time for the reading operation (timeout) in seconds. If the file is empty (end of file). [\Time] Data type: num The max. channel2 \Bin. Example VAR iodev channel2. System Data Types and Routines 3-ReadStrBin-633 .

CONST string EOF := "EOF".ReadStrBin Functions Program execution The function reads the specified number of characters from the binary serial channel or file. These errors can then be dealt with by the error handler. the system variable ERRNO is set to ERR_DEV_MAXTIME. Predefined data The constant EOF can be used to check if the file was empty. the system variable ERRNO is set to ERR_FILEACC. Limitations The function can only be used for serial channels or files that have been opened for reading in a binary mode. If timeout before the read operation is finished.20). Error handling If an error occurs during reading. a check is performed to make sure that the file is not empty. Before using the string read from the file. when trying to read from the file or to stop reading at the end of the file. IF text = EOF THEN TPWrite "The file is empty".’ [NoOfChars ’:=’] <expression (IN) of num> [’\’Time’:=’ <expression (IN) of num>]’)’ 3-ReadStrBin-634 System Data Types and Routines . Example text := ReadStrBin(infile. Syntax ReadStrBin ’(’ [IODevice ’:=’] <variable (VAR) of iodev>’.

Functions A function with a return value of the type string.) serial channels or files Write binary string RAPID Summary .WriteStrBin System Data Types and Routines 3-ReadStrBin-635 . ReadStrBin Related information Described in: Opening (etc.Communication Instructions .

ReadStrBin Functions 3-ReadStrBin-636 System Data Types and Routines .

[\Rx] Data type: num The rotation in degrees around the x axis of the tool coordinate system. if any. to a robot position. Return value Data type: robtarget The new position with the addition of a displacement and/or a rotation.Functions RelTool RelTool Make a displacement relative to the tool RelTool (Relative Tool) is used to add a displacement and/or a rotation. tool1. Dz Data type: num The displacement in mm in the z direction of the tool coordinate system. Dy Data type: num The displacement in mm in the y direction of the tool coordinate system. v100. 0. The tool is rotated 25o around its z-axis. MoveL RelTool (p1. 0. 0 \Rz:= 25). expressed in the tool coordinate system. Arguments RelTool Point (Point Dx Dy Dz [\Rx] [\Ry] [\Rz]) Data type: robtarget The input robot position. tool1. fine. relative to the active tool. Dx Data type: num The displacement in mm in the x direction of the tool coordinate system. v100. The robot is moved to a position that is 100 mm from p1 in the direction of the tool. 0. Example MoveL RelTool (p1. System Data Types and Routines 3-RelTool-637 . 100). fine. 0. The orientation part of this position defines the current orientation of the tool coordinate system.

then around the new y-axis.’ [Dz ’:=’] <expression (IN) of num> [’\’Rx ’:=’ <expression (IN) of num> ] [’\’Ry ’:=’ <expression (IN) of num> ] [’\’Rz ’:=’ <expression (IN) of num> ]’)’ A function with a return value of the data type robtarget. Related information Described in: Mathematical instructions and functions Positioning instructions RAPID Summary . In the event that two or three rotations are specified at the same time.’ [Dy ’:=’] <expression (IN) of num> ’. and then around the new z-axis. Syntax RelTool’(’ [ Point ’:=’ ] < expression (IN) of robtarget>’. these will be performed first around the x-axis.Motion 3-RelTool-638 System Data Types and Routines .Mathematics RAPID Summary .’ [Dx ’:=’] <expression (IN) of num> ’.RelTool [\Ry] Functions Data type: num The rotation in degrees around the y axis of the tool coordinate system. [\Rz] Data type: num The rotation in degrees around the z axis of the tool coordinate system.

[\Dec] Number of decimals.38521\Dec:=1). (Decimals Data type: num System Data Types and Routines 3-Round-639 . The variable val is given the value 0. val := Round(0. Example VAR num val.38521). Return value Data type: num The numeric value rounded to the specified number of decimals. The variable val is given the value 0.385. the value is rounded to an integer. If the specified number of decimals is 0 or if the argument is omitted. The number of decimals must not be negative or greater than the available precision for numeric values.38521\Dec:=3). Arguments Round Val ( Val [\Dec]) (Value) Data type: num The numeric value to be rounded.4. val := Round(0. val := Round(0. The variable val is given the value 0.Functions Round Round Round is a numeric value Round is used to round a numeric value to a specified number of decimals or to an integer value.

Related information Described in: Mathematical instructions and functions Truncating a value RAPID Summary .Round Functions Syntax Round’(’ [ Val ’:=’ ] <expression (IN) of num> [ \Dec ’:=’ <expression (IN) of num> ] ’)’ A function with a return value of the data type num.Mathematics Functions .Trunc 3-Round-640 System Data Types and Routines .

Used in multi-tasking system to get current running mode for program task main from some other program task. Example IF RunMode() = RUN_CONT_CYCLE THEN .. ENDIF The program section is executed only for continuous or cycle running. the return value always mirrors the current running mode for the program task which executes the function RunMode. Return value 0 1 2 3 4 Symbolic constant RUN_UNDEF RUN_CONT_CYCLE RUN_INSTR_FWD RUN_INSTR_BWD RUN_SIM Data type: symnum Comment Undefined running mode Continuous or cycle running mode Instruction forward running mode Instruction backward running mode Simulated running mode Arguments RunMode ( [ \Main] ) [ \Main ] Data type: switch Return current running mode for program task main.Functions RunMode RunMode Read the running mode RunMode (Running Mode) is used to read the current running mode of the program task. System Data Types and Routines 3-RunMode-641 . Return value The current running mode as defined in the table below. If this argument is omitted.

Related information Described in: Reading operating mode Functions .RunMode Functions Syntax RunMode ’(’ [’\’Main] ’)’ A function with a return value of the data type symnum.OpMode 3-RunMode-642 System Data Types and Routines .

1] . Return value The sine value. VAR num value. expressed in degrees.Functions Sin Sin Calculates the sine value Sin (Sine) is used to calculate the sine value from an angle value. range [-1. (Angle) Data type: num Syntax Sin’(’ [Angle’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. . value := Sin(angle). Related information Described in: Mathematical instructions and functions RAPID Summary . Data type: num Arguments Sin Angle The angle value.Mathematics System Data Types and Routines 3-Sin-643 . . Example VAR num angle.

Sin Functions 3-Sin-644 System Data Types and Routines .

it has to be (Value) Data type: num ≥0. . . Related information Described in: Mathematical instructions and functions RAPID Summary .Mathematics System Data Types and Routines 3-Sqrt-645 . Example VAR num x_value.Functions Sqrt Sqrt Calculates the square root value Sqrt (Square root) is used to calculate the square root value. Return value The square root value. VAR num y_value. y_value := Sqrt( x_value). Data type: num Arguments Sqrt Value The argument value for square root ( ). Syntax Sqrt’(’ [Value’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num.

Sqrt Functions 3-Sqrt-646 System Data Types and Routines .

Arguments StrFind Str The string to search in. found := StrFind("IRB 6400". for a character that belongs to a specified set of characters. Return value Data type: num The character position of the first character. starting at a specified position. ChPos (Character Position) Data type: num (Str ChPos Set [\NotInSet]) (String) Data type: string Start character position.1. A runtime error is generated if the position is outside the string. Example VAR num found."aeiou"). The variable found is given the value 1. found := StrFind("Robotics".STR_DIGIT). If no such character is found. Data type: string System Data Types and Routines 3-StrFind-647 . Set Set of characters to test against.1. String length +1 is returned.Functions StrFind StrFind Searches for a character in a string StrFind (String Find) is used to search in a string. found := StrFind("IRB 6400".1. found := StrFind("Robotics". The variable found is given the value 2. at or past the specified position. The variable found is given the value 4.1."aeiou"\NotInSet). that belongs to the specified set.STR_WHITE). The variable found is given the value 5.

Functions Data type: switch Syntax StrFind’(’ [ Str ’:=’ ] <expression (IN) of string> ’.StrFind [\NotInSet] Search for a character not in the set of characters.’ [ Set’:=’ ] <expression (IN) of string> [’\’NotInSet ] ’)’ A function with a return value of the data type num.String Functions Data Types . Related information Described in: String functions Definition of string String values RAPID Summary .’ [ ChPos ’:=’ ] <expression (IN) of num> ’.string Basic Characteristics Basic Elements 3-StrFind-648 System Data Types and Routines .

Return value The number of characters in the string (>=0).Functions StrLen StrLen Gets the string length StrLen (String Length) is used to find the current length of a string. Data type: num Arguments StrLen Str (Str) (String) Data type: string The string in which the number of characters is to be counted. Related information Described in: String functions Definition of string String values RAPID Summary . The variable len is given the value 8. len := StrLen("Robotics"). Syntax StrLen’(’ [ Str ’:=’ ] <expression (IN) of string> ’)’ A function with a return value of the data type num.String Functions Data Types . Example VAR num len.string Basic Characteristics Basic Elements System Data Types and Routines 3-StrLen-649 .

StrLen Functions 3-StrLen-650 System Data Types and Routines .

as specified by the "from" and "to" strings.STR_LOWER. The variable str is given the value "RObOtIcs". that is found in the "from" string is replaced by the character at the corresponding position in the "to" string. Example VAR string str. STR_UPPER). Data type: string Data type: string ( Str FromMap ToMap) (String) Data type: string System Data Types and Routines 3-StrMap-651 . The variable str is given the value "ROBOTICS". FromMap Index part of mapping. ToMap Value part of mapping.Functions StrMap StrMap Maps a string StrMap (String Mapping) is used to create a copy of a string in which all characters are translated according to a specified mapping."AEIOU"). from the specified string. Characters for which no mapping is defined are copied unchanged to the resulting string. Each character."aeiou". Arguments StrMap Str The string to translate. str := StrMap("Robotics". str := StrMap("Robotics". Return value Data type: string The string created by translating the characters in the specified string.

Related information Described in: String functions Definition of string String values RAPID Summary .’ [ FromMap’:=’ ] <expression (IN) of string> ’.String Functions Data Types .StrMap Functions Syntax StrMap’(’ [ Str ’:=’ ] <expression (IN) of string> ’.string Basic Characteristics Basic Elements 3-StrMap-652 System Data Types and Routines .’ [ ToMap’:=’ ] <expression (IN) of string> ’)’ A function with a return value of the data type string.

Example VAR num found. at or past the specified position.’ [ ChPos ’:=’ ] <expression (IN) of num> ’. Return value Data type: num The character position of the first substring. for a specified pattern. Data type: string Syntax StrMatch’(’ [ Str ’:=’ ] <expression (IN) of string> ’. string length +1 is returned.Functions StrMatch StrMatch Search for pattern in string StrMatch (String Match) is used to search in a string. System Data Types and Routines 3-StrMatch-653 . found := StrMatch("Robotics". that is equal to the specified pattern string.’ [ Pattern’:=’ ] <expression (IN) of string> ’)’ A function with a return value of the data type num. starting at a specified position."bo"). If no such substring is found. The variable found is given the value 3. ChPos (Character Position) Data type: num (Str ChPos Pattern) (String) Data type: string Start character position.1. A runtime error is generated if the position is outside the string. Arguments StrMatch Str The string to search in. Pattern Pattern string to search for.

StrMatch Functions Related information Described in: String functions Definition of string String values RAPID Summary .String Functions Data Types .string Basic Characteristics Basic Elements 3-StrMatch-654 System Data Types and Routines .

Set Set of characters to test against. The variable memb is given the value TRUE. as b is not a member of the set "aeiou". A runtime error is generated if the position is outside the string. memb := StrMemb("Robotics".3. Data type: string System Data Types and Routines 3-StrMemb-655 . The variable memb is given the value FALSE. The variable memb is given the value TRUE. Return value Data type: bool TRUE if the character at the specified position in the specified string belongs to the specified set of characters.3. Example VAR bool memb. Arguments StrMemb Str The string to check in.Functions StrMemb StrMemb Checks if a character belongs to a set StrMemb (String Member) is used to check whether a specified character in a string belongs to a specified set of characters."aeiou"). memb := StrMemb("Robotics". memb := StrMemb("S-721 68 VÄSTERÅS". ChPos (Character Position) Data type: num (Str ChPos Set) (String) Data type: string The character position to check. as o is a member of the set "aeiou".STR_DIGIT).2."aeiou").

string Basic Characteristics Basic Elements 3-StrMemb-656 System Data Types and Routines . Related information Described in: String functions Definition of string String values RAPID Summary .’ [ ChPos ’:=’ ] <expression (IN) of num> ’.’ [ Set’:=’ ] <expression (IN) of string> ’)’ A function with a return value of the data type bool.String Functions Data Types .StrMemb Functions Syntax StrMemb’(’ [ Str ’:=’ ] <expression (IN) of string> ’.

according to a specified character ordering sequence. The variable le is given the value TRUE. Order Sequence of characters that define the ordering. Arguments StrOrder Str1 First string value. Example VAR bool le. Characters that are not included in the defined ordering are all assumed to follow the present ones. le := StrOrder("FIRST". Data type: string (String 2) Data type: string ( Str1 Str2 Order) (String 1) Data type: string System Data Types and Routines 3-StrOrder-657 ."SECOND". Str2 Second string value. because "FIRST" comes before "SECOND" in the character ordering sequence STR_UPPER.STR_UPPER).Functions StrOrder StrOrder Checks if strings are ordered StrOrder (String Order) is used to check whether two strings are in order. Return value Data type: bool TRUE if the first string comes before the second string (Str1 <= Str2) when characters are ordered as specified.

StrOrder Functions Syntax StrOrder’(’ [ Str1 ’:=’ ] <expression (IN) of string> ’.’ [ Order ’:=’ ] <expression (IN) of string> ’)’ A function with a return value of the data type bool.String Functions Data Types . Related information Described in: String functions Definition of string String values RAPID Summary .string Basic Characteristics Basic Elements 3-StrOrder-658 System Data Types and Routines .’ [ Str2 ’:=’ ] <expression (IN) of string> ’.

The variable part is given the value "Robot".’ [ ChPos ’:=’ ] <expression (IN) of num> ’. Syntax StrPart’(’ [ Str ’:=’ ] <expression (IN) of string> ’. which has the specified length and starts at the specified character position. as a new string. A runtime error is generated if the length is negative or greater than the length of the string. part := StrPart("Robotics".’ [ Len’:=’ ] <expression (IN) of num> ’)’ A function with a return value of the data type string.5). System Data Types and Routines 3-StrPart-659 .1. Arguments StrPart Str (Str ChPos Len) (String) Data type: string The string in which a part is to be found. Example VAR string part.Functions StrPart StrPart Finds a part of a string StrPart (String Part) is used to find a part of a string. Len (Length) Data type: num Length of string part. ChPos (Character Position) Data type: num Start character position. A runtime error is generated if the position is outside the string. or if the substring is (partially) outside the string. Return value Data type: string The substring of the specified string.

string Basic Characteristics Basic Elements 3-StrPart-660 System Data Types and Routines .String Functions Data Types .StrPart Functions Related information Described in: String functions Definition of string String values RAPID Summary .

"176". VAR byte data_buffer{5}... "AE".. The content of the array component data_buffer{5} will be 65 decimal after the StrToByte . Return value Data type: byte The result of the conversion operation in decimal representation.. "A"].. data_buffer{2} := StrToByte(con_data_buffer{2}\Hex)... function.. The content of the array component data_buffer{1} will be 10 decimal after the StrToByte . System Data Types and Routines 3-StrToByte-661 . data_buffer{3} := StrToByte(con_data_buffer{3}\Okt). function.. function. function. The content of the array component data_buffer{3} will be 126 decimal after the StrToByte . data_buffer{1} := StrToByte(con_data_buffer{1}). data_buffer{4} := StrToByte(con_data_buffer{4}\Bin).. Example VAR string con_data_buffer{5} := ["10". "00001010".Functions StrToByte StrToByte Converts a string to a byte data StrToByte (String To Byte) is used to convert a string with a defined byte data format into a byte data. The content of the array component data_buffer{2} will be 174 decimal after the StrToByte . function. data_buffer{5} := StrToByte(con_data_buffer{5}\Char). The content of the array component data_buffer{4} will be 10 decimal after the StrToByte .

.: Any ASCII char (*) String length: 3 2 3 8 1 Range: "0" .’F’ Okt .: ’0’ ."11111111" One ASCII char (*) RAPID character codes (e.’9’ Hex ...’9’. ’a’ -’f’.: ’0’ ... the following string data is valid: Format: Dec ... 3-StrToByte-662 System Data Types and Routines ...... If the optional switch argument is omitted... the string to be converted has decimal (Dec) format.. [\Bin] (Binary) Data type: switch The string to be converted has binary format.... [\Okt] (Octal) Data type: switch The string to be converted has octal format.g.StrToByte Functions Arguments StrToByte ConStr (ConStr [\Hex] | [\Okt] | [\Bin] | [\Char]) (Convert String) Data type: string The string data to be converted."255" "0" ..’1’ Char . "\07" for BEL control character) can be used as arguments in ConStr..: ’0’ ."377" "0" . Limitations Depending on the format of the string to be converted.: ’0’ .. ’A’ .’7’ Bin . [\Hex] (Hexadecimal) Data type: switch The string to be converted has hexadecimal format. [\Char] (Character) Data type: switch The string to be converted has ASCII character format."FF" "0" .

ByteToStr RAPID Summary .Functions Pow Syntax StrToByte’(’ [ConStr ’:=’] <expression (IN) of string> [’\’ Hex ] | [’\’ Okt] | [’\’ Bin] | [’\’ Char] ’)’ ’.String Functions System Data Types and Routines 3-Pow-663 . Related information Described in: Convert a byte to a string data Other bit (byte) functions Other string functions Instructions .Bit Functions RAPID Summary .’ A function with a return value of the data type byte.

Pow Functions 3-Pow-664 System Data Types and Routines .

Valid format as for RAPID literal aggregates.Functions StrToVal StrToVal Converts a string to a value StrToVal (String To Value) is used to convert a string to a value of any data type. Val (Value) Data type: ANYTYPE Name of the variable or persistent of any data type for storage of the result from the conversion. Arguments StrToVal Str ( Str Val ) (String) Data type: string A string value containing literal data with format corresponding to the data type used in argument Val. Example VAR bool ok. ok := StrToVal("3. VAR pos pos15. The variable ok is given the value TRUE and the variable p15 is given the value that are specified in the string str15. Return value Data type: bool TRUE if the requested conversion succeeded. ok := StrToVal(str15. VAR num nval.85". Example VAR string 15 := “[600. FALSE otherwise. The data is unchanged if the requested conversion failed.3]”. VAR bool ok. The variable ok is given the value TRUE and nval is given the value 3. 225.85. System Data Types and Routines 3-StrToVal-665 .pos15).nval). 500.

Related information Described in: String functions Definition of string String values RAPID Summary .string Basic Characteristics Basic Elements 3-StrToVal-666 System Data Types and Routines .String Functions Data Types .StrToVal Functions Syntax StrToVal’(’ [ Str ’:=’ ] <expression (IN) of string> ’.’ [ Val ’:=’ ] <var or pers (INOUT) of ANYTYPE> ’)’ A function with a return value of the data type bool.

Data type: num Arguments Tan Angle The angle value. (Angle) Data type: num Syntax Tan’(’ [Angle ’:=’] <expression (IN) of num> ’)’ A function with a return value of the data type num. expressed in degrees. 180] RAPID Summary . .ATan2 System Data Types and Routines 3-Tan-667 .Mathematics Functions . Example VAR num angle. Related information Described in: Mathematical instructions and functions Arc tangent with return value in the range [-180. . VAR num value. Return value The tangent value.Functions Tan Tan Calculates the tangent value Tan (Tangent) is used to calculate the tangent value from an angle value. value := Tan(angle).

Tan Functions 3-Tan-668 System Data Types and Routines .

Return value Data type: num TRUE if the semaphore has been taken by me (executor of TestAndSet function). tproutine_inuse := FALSE. .Use of some RAPID routines with function problems when executed in parallel. the use of the TestAndSet function guarantees that all three lines from each task are not separated.Operator Output & Input Example MAIN program task: PERS bool tproutine_inuse := FALSE.. BACK1 program task: PERS bool tproutine_inuse := FALSE.. WaitUntil TestAndSet(tproutine_inuse). TPWrite “Third line from MAIN”. WaitUntil TestAndSet(tproutine_inuse).. TPWrite “Second line from MAIN”.. TPWrite “First line from BACK1”. TPWrite “Third line from BACK1”. TPWrite “First line from MAIN”.Functions TestAndSet TestAndSet Test variable and set if unset TestAndSet can be used together with a normal data object of the type bool. TPWrite “Second line from BACK1”.. The function could be used both between different program tasks and different execution levels (TRAP or Event Routines) within the same program task. otherwise FALSE. To avoid mixing up the lines.. to retrieve exclusive right to specific RAPID code areas or system resources. as a binary semaphore. If program task MAIN takes the semaphore TestAndSet(tproutine_inuse) first. tproutine_inuse := FALSE. . . . one from MAIN and one from BACK1. then program task BACK1 must wait until the program task MAIN has left the semaphore.Use of the Teach Pendant . Example of resources that can need protection from access at the same time: . ??? System Data Types and Routines 3-TestAndSet-669 .

. The data object could be a VAR or a PERS. ELSE RETURN FALSE. reset the variable doit_inuse to FALSE in the START event routine.) WaitUntil TestAndSet (doit_inuse). the variable doit_inuse will not be reset. RETURN TRUE.. doit_inuse := FALSE. IF Object = FALSE THEN Object := TRUE. . .... ENDPROC If a module is installed built-in and shared. will set it and return TRUE.. the object must be a PERS or an installed VAR (intertask objects).TestAndSet Functions Arguments TestAndSet Object Object Data type: bool User defined data object to be used as semaphore. PROC doit(. Program execution This function will in one indivisible step check the user defined variable and. it is possible to use a local module variable for protection of access from different program tasks at the same time. If TestAndSet are used between different program tasks. 3-TestAndSet-670 System Data Types and Routines . Syntax TestAndSet ’(’ [ Object ’:=’ ] < variable or persistent (INOUT) of bool> ’)’ A function with a return value of the data type bool. ENDIF Example LOCAL VAR bool doit_inuse := FALSE. Note in this case: If program execution is stopped in the routine doit and the program pointer is moved to main. otherwise it will return FALSE. To avoid this.. if it is unset.

System parameters RAPID Developer’s Manual RAPID Kernel Reference Manual Intertask objects System Data Types and Routines 3-TestAndSet-671 .Functions TestAndSet Related information Described in: Built-in and shared module Intertask objects User’s Guide .

TestAndSet Functions 3-TestAndSet-672 System Data Types and Routines .

. . . . Program execution continues only after both the di1 input and the di2 input have been set. WaitUntil TestDI(di1) AND TestDI(di2). . then . FALSE = The current value of the signal is equal to 0. . System Data Types and Routines 3-TestDI-673 . If the current value of the signal di2 is equal to 1. IF TestDI (di2) THEN . (Signal) Data type: signaldi Syntax TestDI ’(’ [ Signal ’:=’ ] < variable (VAR) of signaldi > ’)’ A function with a return value of the data type bool. If the current value of the signal di2 is equal to 0. . . IF NOT TestDI (di2) THEN . Data type: bool Arguments TestDI Signal The name of the signal to be tested.Functions TestDI TestDI Examples Tests if a digital input is set TestDI is used to test whether a digital input is set. then . Return value TRUE = The current value of the signal is equal to 1.

TestDI Functions Related information Described in: Reading the value of a digital input signal Input/Output instructions Functions .DInput RAPID Summary Input and Output Signals 3-TestDI-674 System Data Types and Routines .

If the specified number of decimals is 0 or if the argument is omitted. Example VAR num val. val := Trunc(0. Arguments Trunc Val ( Val [\Dec] ) (Value) Data type: num The numeric value to be truncated. Return value Data type: num The numeric value truncated to the specified number of decimals. the value is truncated to an integer. reg1 := 0. [\Dec] Number of decimals. The variable val is given the value 0.385.38521 val := Trunc(reg1\Dec:=1). The variable val is given the value 0.Functions Trunc Trunc Truncates a numeric value Trunc (Truncate) is used to truncate a numeric value to a specified number of decimals or to an integer value. val := Trunc(0.38521). The variable val is given the value 0.3. (Decimals) Data type: num System Data Types and Routines 3-Trunc-675 . The number of decimals must not be negative or greater than the available precision for numeric values.38521\Dec:=3).

Round 3-Trunc-676 System Data Types and Routines . Related information Described in: Mathematical instructions and functions Rounding a value RAPID Summary .Mathematics Functions .Trunc Functions Syntax Trunc’(’ [ Val ’:=’ ] <expression (IN) of num> [ \Dec ’:=’ <expression (IN) of num> ] ’)’ A function with a return value of the data type num.

. 1. . speed_value is assigned the mean value of the latest 8 samples generated each 0.5s of the test signal speed on channel speed_channel. TestSignDefine speed_channel.... TestSignReset. Return value Data type: num The numeric value in SI units on the motor side for the specified channel according to the definition in instruction TestSignDefine. Arguments TestSignRead Channel (Channel) Data type: num The channel number 1-12 for the test signal to be read. System Data Types and Routines 3-TestSignRead-677 .Functions TestSignRead TestSignRead Read test signal value TestSignRead is used to read the actual test signal value. This function returns the momentary value or the mean value of the latest samples. Program execution Returns the momentary value or the mean value of the latest samples. The channel speed_channel measures the speed of axis 1 on the mechanical unit orbit. . VAR num speed_value. The same number must be used in the definition instruction TestSignDefine.. orbit. . depending on the channel specification in the instruction TestSignDefine. depending on channel specification in instruction TestSignDefine. ! During some movements with orbit’s axis 1 speed_value := TestSignRead(speed_channel). 0. speed.. Example CONST num speed_channel.

torque_ref.. IDelete timer_int. CONNECT timer_int WITH TorqueTrap. tool0.]..05. is displayed on the Operators Window on the TP. when the torque reference for manipulator IRBP_K axis 2 is for the first time greater than 6 Nm on the motor side during the slow movement to position psync. VAR intnum timer_int. TestSignReset. ELSE IDelete timer_int. TestSignDefine torque_channel. ITimer \Single. see data type testsignal.. 0. timer_int.... .05.. Stop.TestSignRead Functions For predefined test signals with valid SI units for external manipulator axes. Example CONST num torque_channel. IRBP_K. 0. TRAP TorqueTrap IF (TestSignRead(torque_channel) > 6) THEN TPWrite “Torque pos = “ + ValToStr(CJointT()). 0. CONNECT timer_int WITH TorqueTrap. EXIT.. v5. VAR num torque_value. Syntax TestSignRead’(’ [ Channel ’:=’] <expression (IN) of num>’)’ A function with a return value of the type num.001. ENDIF ENDTRAP The joint position. MoveAbsJ psync \NoEOffs. timer_int. 3-TestSignRead-678 System Data Types and Routines . . . fine. ITimer \Single. CONST jointtarget psync := [. 2.

TestSignReset System Data Types and Routines 3-TestSignRead-679 .TestSignDefine Instructions .Functions TestSignRead Related information Described in: Define test signal Reset test signals Instructions .

TestSignRead Functions 3-TestSignRead-680 System Data Types and Routines .

The variable str is given the value "1.Functions ValToStr ValToStr Converts a value to a string ValToStr (Value To String) is used to convert a value of any data type to a string. The variable str is given the value "[100. Example VAR string str. str := ValToStr(p). Syntax ValToStr’(’ [ Val ’:=’ ] <expression (IN) of ANYTYPE> ’)’ A function with a return value of the data type string. Arguments ValToStr Val ( Val ) (Value) Data type: ANYTYPE A value of any data type.300]". This means in principle 6 significant digits. str := ValToStr(1. The variable str is given the value "TRUE".999995. VAR pos p := [100. A runtime error is generated if the resulting string is too long.23457".200.000005 or greater than 0. the number is rounded to an integer. str := ValToStr(TRUE). Return value Data type: string The value is converted to a string with standard RAPID format. System Data Types and Routines 3-ValToStr-681 .300].200.234567). If the decimal part is less than 0.

string Basic Characteristics Basic Elements 3-ValToStr-682 System Data Types and Routines .String Functions Data Types .ValToStr Functions Related information Described in: String functions Definition of string String values RAPID Summary .

1. VAR pos vector. magnitude := VectMagn(vector).Functions VectMagn VectMagn Magnitude of a pos vector VectMagn (Vector Magnitude) is used to calculate the magnitude of a pos vector. Data type: num System Data Types and Routines 3-VectMagn-683 . Return value The magnitude of the vector (data type pos). . Example z A Az y Ay x Ax A vector A can be written as the sum of its components in the three orthogonal directions: A = Ax x + Ay y + Az z The magnitude of A is: A = A x + Ay + A z 2 2 2 The vector is described by the data type pos and the magnitude by the data type num: VAR num magnitude. .1]. vector := [1.

Mathematics 3-VectMagn-684 System Data Types and Routines . Related information Described in: Mathematical instructions and functions RAPID Summary .VectMagn Functions Arguments VectMagn Vector The vector described by the data type pos. (Vector) Data type: pos Syntax VectMagn’(’ [Vector ’:=’] <expression (IN) of pos> ’)’ A function with a return value of the data type num.

121 Cos 547 CPos 549 CRobT 537. 279 CJointT 533. 551 CTime 553 CTool 555 CWobj 557 D date 541 DeactUnit 173 Decr 175 decrease velocity 477 decrement 175 DefDFrame 559 DefFrame 563 digital output 573 pulse 323 reset 333 set 363. 527 arithmetic 133 array get size 567 ASin 523 assignment 133 ATan 525 ATan2 527 B bit manipulation 9 bool 7 Break 145 byte 9 C C_MOTSET 95 C_PROGDISP 95 call 147 CallByVar 149 CDate 541 circular movement 269. 543 Clear 153 ClkRead 545 ClkReset 157 ClkStart 159 ClkStop 161 clock 11 read 545 reset 157 start 159 stop 161 Close 155. 367 Dim 567 dionum 21 displace position 599 displacement tool direction 637 displacement frame 559. 275. 683 DOutput 573 E EOffsOff 177 EOffsOn 179 EOffsSet 181 erase teach pendant display 403 System Data Types and Routines 4-685 . 173 Compact IF 205 condition 207 confdata 13 ConfJ 167 ConfL 169 CONNECT 171 corner path 81.INDEX A Abs 517 absolute value 517 acceleration reduction 135 AccSet 135 ACos 519 ActUnit 137 Add 139 AliasIO 141 analog output set 365 AOutput 521 arcus cosine 519 arcus sine 523 arcus tangent 525. 563 DotProd 571. 595. 163 comment 165 common drive unit 137.

383 load activate payload 197 loaddata 37 loadsession 43 logical value 7 M maximum velocity 477 mechanical unit 45 activate 137 deactivate 173 4-686 System Data Types and Routines . 341 load 255. 121 fly-by point 81. 623. 287. 451 ErrWrite 183 EulerZYX 575 EXIT 185 ExitCycle 187 Exp 577 exponential value 529. 299. 33 IODisable 213 IOEnable 217 ISignalDI 235 ISignalDO 239 ISleep 243 IsPers 587 IsVar 589 ITimer 245 IVarValue 249 IWatch 251 J joint movement 283. 121 FOR 189 frame 563 Functions 193 G GetTime 585 GOTO 195 GOutput 521. 491 fine 81. 345. 613. 345. 633 rewind 341 spystart 221. 577. 481. 207 Incr 209 increment 209 interrupt activate 251 at a position 429 connect 171 deactivate 243 delete 199 disable 201 enable 203 from digital input 235 identity 31 timed 245 INTNO 95 intnum 31 InvertDO 211 IO unit disable 213 enable 217 iodev 5. 469.ERRNO 95 errnum 23. 99 error recovery retry 337. 485. 291 jump 195 L label 253 linear movement 295. 163. 383 open 307 read 617. 583 GripLoad 197 group of I/O 369. 303 Load 255. 661 external axes activate 137 deactivate 173 extjoint 27 F file close 155. 627. 583 I IDelete 199 IDisable 201 IEnable 203 IF 205. 231 tsigrset 401 unload 461. 569 write 329. 487. 521.

623. 551 current time 553. 601. 623. 633 RelTool 527. 661 Present 615 ProcCall 147 procedure call 147. 627. 259 mecunit 45 MirPos 591 mirroring 591 motsetdata 47 MoveAbsJ 263 MoveC 269 MoveCDO 275 MoveCSync 279 MoveJ 283 MoveJDO 287 MoveJSync 291 MoveL 295 MoveLDO 299 MoveLSync 303 movement circle 269. 627. 287. 543 current robot position 537. 613.MechUnitLoad 97. 479 Reset 333 RestoPath 335 RETRY 337 RETURN 339 Rewind 341 robot position 59. 633 function key 405 group of outputs 521. 275. 69 System Data Types and Routines 4-687 . 583 serial channel 617. 291 linear 295. 637. 633 ReadBin 617 ReadMotor 621 ReadNum 623 ReadStr 627. 641 repeat 189. 279 joint 283. 563. 303 N num 51 numeric value 51 NumToStr 597 O o_jointtarget 53 object coordinate system 113 Offs 599 offset 599 Open file 307 serial channel 307 operating mode read 601 OpMode 601 orient 55 OrientZYX 603 ORobT 605 output at a position 435 P path resolution change 311 PathResol 311 payload 37 activate 197 PDispOff 315 PDispOn 317 pos 61 pose 63 PoseInv 607 PoseMult 609 position fix I/O 435 Pow 613. 299. 585 current tool data 555 current work object 557 digital output 573 file 617. 149 program displacement activate 317 deactivate 315 remove from position 605 PulseDO 323 Q quaternion 56 R RAISE 327 read clock 545 current date 541 current joint angles 533.

627. 623. 121 StopMove 391 stopwatch 11. 491 open 307 read 617. 231. 585 tooldata 101 TPErase 403 tpnum 107 TPReadFK 405 TPReadNum 409 TPShow 413 TPWrite 415 TriggC 417 triggdata 109 TriggEquip 423 TriggInt 429 TriggIO 435 TriggJ 439 TriggL 445 Trunc 675 TRYNEXT 451 TuneReset 453 TuneServo 455 tunetype 111 U UnLoad 461. 377 SpyStop 381 Sqrt 645 square root 645 StartMove 387 Stop 389 stop point 81. 163 file 329. 69 Round 639 routine call 147 RunMode 641 running mode read 641 S SearchC 349 SearchL 355 serial channel close 155. 487. 469. 159 StorePath 393 StrFind 647 string 89 StrLen 649 StrMap 651 StrMatch 653 StrMemb 655 StrOrder 657 StrPart 659 StrToVal 665 symnum 93 system data 95 T Tan 667 TEST 395 TestDI 673 TestSignDefine 397 TestSignReset 401 text string 89 time 553. 477 4-688 System Data Types and Routines . 569 user coordinate system 113 V ValToStr 681 velocity 77 decrease 477 max.robtarget 59. 633 rewind 341 write 481 Set 363 SetAO 365 SetDO 367 SetGO 369 shapedata 73 signalai 75 signalao 75 signaldi 75 signaldo 75 signalgi 75 signalgo 75 Sin 643 SingArea 371 soft servo activating 373 deactivating 375 SoftAct 373 SoftDeact 375 speeddata 77 SpyStart 221. 485.

485. 491 WZBoxDef 493 WZCylDef 495 WZDisable 499 WZDOSet 501 WZEnable 505 WZFree 507 WZLimSup 509 WZSphDef 513 wzstationary 117 wztemporary 119 Z zonedata 81. 121 System Data Types and Routines 4-689 . 415 WriteBin 487 WriteStrBin 329.VelSet 477 W wait a specific time 473 any condition 475 digital input 465 digital output 467 until the robot is in position 473 WaitDI 465 WaitDO 467 WaitTime 473 WaitUntil 475 WHILE 479 wobjdata 113 work object 113 Write 481 write error message 183 on the teach pendant 413.

3HAC 7783-1 For BaseWare OS 4. Glossary .0 Table of Contents Introduction RAPID Summary RAPID Overview Basic Characteristics Motion and I/O Principles Programming Off-line Predefined Data and Programs Index.

© ABB Robotics AB Article number: 3HAC 7783-1 Issue: For BaseWare OS 4. Additional copies of this document may be obtained from ABB Robotics AB at its then current charge.The information in this document is subject to change without notice and should not be construed as a commitment by ABB Robotics AB. and contents thereof must not be imparted to a third party nor be used for any unauthorized purpose. Contravention will be prosecuted. This document and parts thereof must not be reproduced or copied without ABB Robotics AB´s written permission. ABB Robotics AB assumes no responsibility for any errors that may appear in this document. In no event shall ABB Robotics AB be liable for incidental or consequential damages arising from use of this document or of the software and hardware described in this document.0 ABB Robotics AB S-721 68 Västerås Sweden .

...5 Various functions ..........................................................7 Displacing a program......................................................................................................................................9 Adjust the robot tuning values....................................................................................................................................................................................... 3-13 RAPID Overview 1-1 ...................................................7 Conversion function ... 3-6 3.......................................................... 3-7 4 Motion Settings........ 2-1 3 RAPID Summary..............................1 Programming principles ........ 3-10 4......................................... 3-9 4....... 3-3 2.............................11 Data for motion settings....................................... 3-4 2..................................... 3-11 4.....6 Defining the behaviour near singular points...................................................................... 3-9 4........................................................ 3-11 4............................................................... 3-3 2...2 Wait................. 3-12 5 Motion ................................... 3-3 2..................................................................2 Defining velocity ................................................10 World Zones............................................................................5 Defining the payload .3 Comments................................................................ 2-1 1............................................................................................................................. 3-1 2 Controlling the Program Flow ...1 Programming principles .........4 Loading program modules........................................................................................................................................4 Stopping program execution.....................1 Other Manuals ........................................................................................................................................................................................2 Calling another routine ...................6 Basic data.........................4 Defining configuration management ............................... 1-1 2 Introduction ...............................................................................1 Assigning a value to data...................................................................5 Stop current cycle .......................................................3 Program control within the routine............................. 3-6 3. 3-10 4. 3-4 3 Various Instructions .......................................................................... 3-5 3.............................................................................. 3-10 4... 3-10 4...3 Defining acceleration........................................................................................................................ 3-6 3............................................................... 3-12 4......................................................................................................................... 2-1 1 Introduction .......................................................................................................2 How to Read this Manual . 3-3 2............ 3-5 3.............................................................................................................. 3-11 4.........................................................................................................................................................RAPID Overview CONTENTS Page 1 Table of Contents .....................................8 Soft servo...................................... 3-5 3....................................................................................................................... 2-1 1......................................................................................................................................................................... 3-1 1 The Structure of the Language ....................................... 3-5 3.............................. 3-9 4...

............... 3-20 6....................... 3-21 7.............................................................................................................................................. 3-15 5.....................RAPID Overview 5........................................................................................ 3-24 8...................................5 Motion control if an error/interrupt takes place ............ 3-18 6 Input and Output Signals ........................................................................................................................................... 3-15 5........................................................................................ 3-14 5....................................................................................1 Programming principles ........................... 3-19 6................... 3-23 8....................................................2 Connecting interrupts to trap routines .............................................. 3-25 9..................................................... 3-19 6....11 Position functions ........................................................ 3-18 5.................4 Cancelling interrupts ................ 3-19 6..........1 Programming principles ................ 3-16 5............................................................................................ 3-23 8..5 Enabling/disabling interrupts ........................13 Basic data for movements .....................................7 Independent axes ..................................................................................... 3-14 5.................2 Changing the value of a signal ... 3-22 7....4 Testing input on output signals.......................................................................................................... 3-13 5......................................................................................12 Motion data..............3 Reading the value of an input signal .......................................................... 3-24 9 Error Recovery................................................................................................................1 Programming principles ..............................................................................2 Communicating using the teach pendant............. 3-22 7................................................................................................................ 3-20 6............. 3-25 9.............. 3-24 8........................ 3-21 7...........................2 Positioning instructions ...................................... 3-17 5............ 3-17 5.................... 3-17 5....... 3-16 5.................................6 Data type of interrupts .............................10 Load identification and Collision detection ......................................................6 Controlling external axes..................................................... 3-20 7 Communication ..........................3 Reading from or writing to a character-based serial channel/file................. 3-24 8................................................................... 3-19 6............... 3-14 5...................................8 Path Correction..........1 Programming principles ......................... 3-26 1-2 RAPID Overview .............4 Activating outputs or interrupts at specific positions .............................2 Creating an error situation from within the program ...........................3 Searching .........................................................................................9 Conveyor tracking ...5 Disabling and enabling I/O modules ..5 Data for serial channels ...................................................................................................................... 3-21 7..6 Defining input and output signals ........................................................................................................... 3-22 8 Interrupts........................................................................................................................................................................................3 Restarting/returning from the error handler ............. 3-23 8.............................................................................................1 Programming principles .............4 Communicating using binary serial channels/files.....................................3 Ordering interrupts .................................. 3-25 9.

.....5 Spot welding data .............3 Reading current time and date .............2 Principles of SpotWare ..................................................... 41 16..............................................2 Programming principles ... 41 16......... 3-33 12...........RAPID Overview 9................................ 3-39 15............................................................................................................. 3-35 13.................3 Programming principles ......................................3 More advanced calculations ....................................1 Programming principles ............................................... 3-36 13..................................................................................................................... 3-39 16 RAPID Support Instructions ............ 3-36 14 GlueWare .................................................................................................................................................................................................2 Sending a program-controlled message from the robot to a computer......................................... 3-32 12......................... 3-26 10 System & Time ............................................................................................................................................... 3-35 13.............. 3-34 12................ 3-28 11 Mathematics..............................3 Glue instructions..........................................................................1 Glueing features.................. 3-29 11....3 Arc welding plus instructions ........... 3-34 13 Arc Welding ....................................4 Trigg functions...................................... 3-35 13....................1 Get system data...................... 3-37 14.......................................................................... 3-29 11............................................................................ 41 16...................................................................................4 Arithmetic functions .............................................................................................................................................. 3-27 10............................. 3-36 13.....................................4 Retrieve time information from file................................................. 3-38 14................ 3-29 11...........................................................................................................................................................................................4 Spot welding instructions ................................4 Arc welding data..............................................................................................1 Programming principles..................................1 Spot welding features .........................................................................................................................................3 Write configuration data ............................................................ 3-32 12...........1 Programming principles ................ 3-39 15..............5 Arc welding plus data .....................4 Glue data................................................................................................ 3-37 14..... 3-37 14..................................................................................................................................................................................... 3-37 14....... 3-29 11......................................................... 3-27 10..........................................................................................................2 Using a clock to time an event......................................... 3-43 RAPID Overview 1-3 ....................................................................5 DispenseWare data... 3-34 12............................................... 41 16.................................................................2 Read configuration data .. 3-38 15 External Computer Communication....................................................................................................................... 3-30 12 Spot Welding.................................................................................................4 Data for error handling ............................1 Programming principles .................2 Simple calculations on numeric data ..............................2 Arc welding instructions.............. 3-27 10.................................... 42 17 Service Instructions.......................................... 3-27 10.................................................

..................................... 3-47 20 Syntax Summary ...................................................3 Routine termination......... 4-15 4 Data Types .......................................................................................................................... 4-4 2 Modules ..............7 Placeholders...........3 Numeric values...................................................... 4-19 4.................................................................................................................................................................1 Routine scope ....................................................................... 4-1 1....................................................1 Basic Operations..............................................8 File header ......................................2 Functions ..........3 Syntax.................. 4-8 3 Routines .....................5 Procedure call .......................................................... 4-3 1........4-1 1 Basic Elements............................... 4-8 2................................................................................................................................ 4-2 1.....................................2 Resource access Protection ..................2 Parameters .............. 3-49 20............................................6 Comments.................1 Identifiers............................................................................................................................................................................................2 System modules.........................3 Module declarations ......................................... 4-11 3...... 4-12 3............................................................................................... 4-8 2.................... 4-1 1...................................................................................................6 Syntax................................................................................................. 3-45 18.............................................. 3-47 19..........................................................................................................................................RAPID Overview 17.........1 Basics............. 4-3 1.....9 Syntax..................................................................... 4-7 2.......................... 3-55 4 Basic Characteristics ............................................ 3-49 20............................... 4-19 4.................................................................................. 4-13 3...............................................................................4 Logical values......................1 Directing a value to the robot’s test signal ........................... 3-45 18............ 4-13 3..............................................................1 Instructions .......................... 4-14 3.....................2 Comparison and Searching...............................................................................................................................................................................................1 Program modules..................................................3 Conversion............................................................................ 4-7 2..................................................................5 String values ............................................................................... 4-2 1.........................................................................................................................................2 Spaces and new-line characters .................................. 4-3 1.................2 Equal (alias) data types.................................. 4-11 3...................................... 4-19 4.............................. 4-2 1.................................. 4-20 1-4 RAPID Overview .............................................................................................................4 Routine declarations ................................. 4-2 1......................... 3-43 18 String Functions .................................. 3-46 19 Multitasking................................................................................................................................................................................................................................................................................................................................................................................................................................ 3-47 19....4 Syntax................................. 3-45 18.............................................................................................................................................................1 Non-value data types ................................

................ 4-22 5.......................................................................4 Using data in expressions ........................................6 Using function calls in expressions .......... 4-21 5................ 4-27 7 Expressions ...............................................1 Error handlers ..............................................................................................................................................................1 Interrupt manipulation .................................................................................................. 4-30 7..........................................................1 Data scope..... 4-48 11....................... 4-30 7................................................................................................................................. 4-45 11........................3 String expressions................. 4-44 11............................................................................................................................................................................................................................................................................................................... 4-40 10 Backward execution .............................5 Using aggregates in expressions.......... 4-48 11....4 Priorities........6 Task sizes ............................................................................................................................................................... 4-37 9 Interrupts ....................................................................... 4-46 11............................ 4-24 5................. 4-24 5. 4-37 8.................................................................................... 4-29 7....................................2 Intertask communication ....... 4-42 11 Multitasking ...............................................................................5 Initiating data..........1 Backward handlers .......................................................................................................................... 4-47 11..............7 Syntax ..................... 4-23 5...................................................................................................................RAPID Overview 5 Data........................8 Syntax ....................................... 4-41 10........ 4-43 11.............2 Trap routines .........................................................................................................................................................1 Syntax ..... 4-32 7...................................................................................................................................................................................................................... 4-34 8 Error Recovery...........................3 Persistent declaration................ 5-1 RAPID Overview 1-5 .........................................................................................................1 Arithmetic expressions ........2 Variable declaration ............................................................................................4 Constant declaration .................................................................................................................................................................................................................................... 4-23 5............. 4-27 6........... 4-33 7........................................................................................................................................................................................................ 4-39 9..................................................................... 4-49 5 Motion and I/O Principles ........................................................................................2 Logical expressions .5 Trust Level ...... 4-39 9......6 Storage Class ................................... 4-21 5.... 4-32 7............ 4-41 10......................................................................................8 Programming scheme ........ 4-25 6 Instructions ..........................................................................2 Limitation of move instructions in the backward handler................................ 4-31 7................................................................ 4-29 7......................................................1 Synchronising the tasks ......................................................7 Priority between operators.............................. 4-48 11..................7 Something to think about...........................................3 Type of task.........................................

....1 The robot’s tool centre point (TCP) ..2 Tuning of Collision Detection levels.......................... 5-25 3...........1 Introduction .3 Coordinate systems used to determine the direction of the tool.................... 5-23 2....................................................... 5-10 2 Positioning during Program Execution.................................................................1 Program execution through singularities..................................3 Concurrent program execution ................................. 5-25 3....................................................................... 5-43 6.................................................................................................................................5 Related information ......................................................................................................................1 General ..4 Path synchronisation................................................... 5-33 Figure 36 Configuration check................................................................................................ 5-1 1...................................................... 5-24 3 Synchronisation with logical instructions ......................................................... 5-46 7................................................. 5-31 Figure 34 Specifying robot configuration ................ 5-23 2........3 Motion supervision dialogue box ..............2 Interpolation of the position and orientation of the tool...........................................................1 Sequential program execution at stop points........................................ 5-34 5 Robot kinematic models ......................................................................... 5-43 6.............................1 Related information ......... 5-1 1................... 5-30 4 Robot Configuration .................................................................................... 5-11 2................................ 5-11 2................ 5-37 5......................................................................................................4 Related information ....... 5-26 3............................................................RAPID Overview 1 Coordinate Systems ........................................................... 5-39 6 Motion Supervision/Collision Detection ............ 5-43 6..6 Stop and restart .......................................7 Related information ......................................................... 5-31 4 Different types of robot configurations ............................................................................................................................................................................................................................2 Sequential program execution at fly-by points................................................................. 5-25 3................................................................................................................................................................................................................. 5-41 6..................4 Digital outputs ................... 5-41 6.1 Robot kinematics ...............................2 General kinematics ..................6 Related information ........................5 Limitations......................... 5-35 5................................................................................................................ 5-20 2................................................................................................................................ 5-11 2.........................5 Soft Servo ...................... 5-44 7 Singularities ........................ 5-41 6........ 5-46 1-6 RAPID Overview .............. 5-33 4.......................................................................................................................................................... 5-45 7.............................3 Interpolation of corner paths ............................. 5-14 2.......................................................2 Jogging through singularities ............................. 5-29 3..............................................................................................................4 Independent axes ..................................2 Coordinate systems used to determine the position of the TCP....... 5-35 5.............................. 5-1 1............................................................3 Related information ................................................................ 5-6 1...........................................................

........9 Related information .................................................... 7-1 1.. 6-2 7 Predined Data and Programs ................................................................................................................................................................................................................................. 5-56 9........... 5-50 8................................................................................................................................................................................... 5-58 6 Programming Off-line.................................................................... 8-3 RAPID Overview 1-7 ...................... 6-1 1......5 Actions....... 5-53 9 I/O Principles......................................................................................................................... 5-51 8......................................................................................... 8-1 Glossary.................................................................................................................................................................... 7-1 1.............................. 5-52 8..........................................3 Syntax check........................ 5-49 8..... 5-49 8.............................................................................. .......6 Minimum size of World Zones...................................................4 9...................2 Using World Zones ..................................................4 Examples ........................ 6-1 1 Programming Off-line ..2 Editing .....................3 Deleting this data .....................................4 Supervision of the Robot TCP..............................................................................................................................................................................3 Related information ..................1 File format ....... 5-55 9.......................................................... 7-1 1 System Module User ................................................................................................................................... Glossary ......................................................................... 5-56 Cross connections ............................................... 7-2 8 Index................................................................................... 6-1 1................................................................................5 Making your own instructions...........RAPID Overview 7...... 7-1 1.. 5-52 8........................ 6-1 1........................................................ restart.................. and run on .......................................................... 5-47 8 World Zones.8 Power failure................................................................................................ 5-55 9........... 6-1 1......................7 Maximum number of World Zones ...1 Contents .................................................. 5-49 8................................................................................................................................................................. 6-2 1...............................5 9................................................................6 System signals ...2 Creating new data in this module ........................................................ 5-52 8...........................1 Using global zones.........................................2 Signals connected to interrupt ................................. 5-49 8.......................... 5-57 Related information .....................3 Definition of World Zones in the world coordinate system ................................................................................ 5-57 Limitations..............................................1 Signal characteristics ..........................................3 9...................................................................

RAPID Overview 1-8 RAPID Overview .

either on diskette or. This manual also contains a Product Specification which provides an overview of the characteristics and performance of the robot. this manual will be particularly useful in this respect. as well as maintenance procedures and troubleshooting. The Product Manual describes how to install the robot. In addition to these. This chapter briefly describes all instructions. such as how to move the robot manually. When you start to program the robot it is normally better to start with the User’s Guide until you are familiar with the system.1 Other Manuals Before using the robot for the first time. RAPID Overview 2-1 .Introduction 1 Introduction This is a reference manual containing a detailed explanation of the programming language as well as all data types. The User’s Guide provides step-by-step instructions on how to perform various tasks. see RAPID Overview Chapter 3: RAPID Summary. or sometimes already loaded. It also includes a summary of the syntax. there are a number of predefined data and programs supplied with the robot. You would not normally read this chapter unless you are an experienced programmer. or how to start a program when running production. 1. functions and data types grouped in accordance with the instruction pick-lists you use when programming. System DataTypes and Routines Chapters 1-3 describe all data types. RAPID Overview Chapter 4: Basic Characteristics explains the inner details of the language. RAPID Overview Chapter 5: Motion and I/O Principles describes the various coordinate systems of the robot. 1. This manual describes all the data and programs provided with the robot on delivery. If you program off-line.2 How to Read this Manual To answer the questions Which instruction should I use? or What does this instruction mean?. which is particularly useful when programming off-line. you will find some tips in RAPID Overview Chapter 6: Programming off-line. instructions and functions. how to program. you should read Basic Operation. instructions and functions. They are described in alphabetical order for your convenience. If you are programming off-line. its velocity and other motion characteristics during different types of execution. This will provide you with the basics of operating the robot. RAPID Overview Chapter 7: Predefined Data and Programs describes what happens when these are loaded into the robot.

such as instruction names.Certain control words that are masked in the teach pendant display are printed. e. The names on the function keys and in the entry fields are specified in bold italic typeface. Modpos..e.g. since the robot automatically makes sure that the correct syntax is used.Optional arguments are enclosed in square brackets [ ]. Examples of programs are always displayed in the same way as they are output to a diskette or printer. e. These arguments can be omitted. you generally only need to know the simplified syntax. This differs from what is displayed on the teach pendant in the following ways: .Arguments that are mutually exclusive. Typographic conventions The commands located under any of the five menu keys at the top of the teach pendant display are written in the form of Menu: Command. Words belonging to the actual programming language. For example. Glossary and System DataTypes and Routines Chapter 4 contains an index. you choose File: Print. 2-2 RAPID Overview . e. cannot exist in the instruction at the same time.g. VAR num reg1. Syntax rules Instructions and functions are described using both simplified syntax and formal syntax. MoveL. Simplified syntax Example: TPWrite Instruction String [\Num] | [\Bool] | [\Pos] | [\Orient] Compulsory argument Optional argument Mutually exclusive arguments . are written in italics.g. words indicating the start and end of a routine. RAPID Overview chapter 8 contains an Index. are separated by a vertical bar |. e. . . .Data and routine declarations are printed in the formal form. If you use the teach pendant to program. to activate the Print command in the File menu.g.Arguments that can be repeated an arbitrary number of times are enclosed in braces { }.Introduction To make things easier to locate and understand. i.

RAPID Overview 2-3 .Symbols that are written in order to obtain the correct syntax are enclosed in single quotation marks (apostrophes) ’ ’. .The data type of the argument (italics) and other characteristics are enclosed in angle brackets < >. This is based on the same rules. See the description of the parameters of a routine for more detailed information. cannot exist in the instruction at the same time. . . The basic elements of the language and certain instructions are written using a special syntax.The symbol ::= means is defined as.Introduction Formal syntax Example: TPWrite [String’:=’] <expression (IN) of string> [’\’Num’:=’ <expression (IN) of num> ] | [’\’Bool’:=’ <expression (IN) of bool> ] | [’\’Pos’:=’ <expression (IN) of pos> ] | [’\’Orient’:=’ <expression (IN) of orient> ]’.’ <identifier> ::= <ident> | <ID> <ident> ::= <letter> {<letter> | <digit> | ’_’} . but with some additions.Arguments that can be repeated an arbitrary number of times are enclosed in braces { }. . Example: GOTO <identifier>’. i.The text within the square brackets [ ] may be omitted.e.Text enclosed in angle brackets < > is defined in a separate line. .Arguments that are mutually exclusive. EBNF.’ . are separated by a vertical bar |.

Introduction 2-4 RAPID Overview .

There are three kinds of data – constants.A constant represents a static value and can only be assigned a new value manually.g. e. such as one to move the robot.as an expression. Thus. When a program is saved the initialization value reflects the current value of the persistent.g. reg1 .g. .g. tool data (which contains all information on a tool. .g.Automatic error handling . functions and trap routines. e. . e. . there is no limit (except that imposed by memory) on the number of data. 5 or 4. variables and persistents.g. for example. positions and loads. 5+reg1*2 .as a function call. Reset do5. one to set an output. e. Information can also be stored in data. These data can exist either globally in the program or locally within a routine.6 .Modular programs . Data is grouped into different data types which describe different types of information. . it is automatically executed if that particular interrupt occurs. For example. A trap routine can be associated with a specific interrupt.A variable can also be assigned a new value during program execution.g. the instruction for resetting an output contains an argument which defines which output is to be reset. such as tools. The instructions generally have a number of associated arguments which define what is to take place in a specific instruction. .as a reference to data. e. e. etc.as a string value.RAPID Summary The Structure of the Language 1 The Structure of the Language The program consists of a number of instructions which describe the work of the robot. to count the number of parts to be processed). e. when an input is set.A function returns a value of a specific type and is used as an argument of an instruction.g.as a numeric value. such as its TCP and weight) and numerical data (which can be used.A persistent can be described as a “persistent” variable.Multi tasking RAPID Overview 3-1 .Arithmetic and logical expressions . As this data can be created and assigned arbitrary names. These arguments can be specified in one of the following ways: . there are specific instructions for the various commands. Abs(reg1) .Routine parameters . e.A procedure is used as a subprogram. Other features in the language are: . "Producing part A" There are three types of routines – procedures.Trap routines provide a means of responding to interrupts.

The Structure of the Language RAPID Summary 3-2 RAPID Overview .

.By executing different instructions depending on whether or not a given condition is satisfied. instructions which interrupt this sequential execution and call another instruction are required to handle different situations that may arise during execution.By going to a label within the same routine. . 2. 2. instruction by instruction. Sometimes.By calling another routine (procedure) and. continuing execution with the instruction following the routine call.By repeating a sequence of instructions a number of times or until a given condition is satisfied. when that routine has been executed. . .e. i.1 Programming principles The program flow can be controlled according to five different principles: .RAPID Summary Controlling the Program Flow 2 Controlling the Program Flow The program is executed sequentially as a rule.2 Calling another routine Instruction ProcCall CallByVar RETURN Used to: Call (jump to) another routine Call procedures with specific names Return to the original routine 2.By stopping program execution.3 Program control within the routine Instruction Compact IF IF FOR WHILE TEST GOTO label Used to: Execute one instruction only if a condition is satisfied Execute a sequence of different instructions depending on whether or not a condition is satisfied Repeat a section of the program a number of times Repeat a sequence of different instructions as long as a given condition is satisfied Execute different instructions depending on the value of an expression Jump to a label Specify a label (line name) RAPID Overview 3-3 .

When the execution mode CONT is selected.5 Stop current cycle Instruction Exit cycle Used to: Stop the current cycle and move the program pointer to the first instruction in the main routine.Controlling the Program Flow RAPID Summary 2. 3-4 RAPID Overview . execution will continue with the next program cycle.4 Stopping program execution Instruction Stop EXIT Break Used to: Stop program execution Stop program execution when a program restart is not allowed Stop program execution temporarily for debugging purposes 2.

1 Assigning a value to data Data can be assigned an arbitrary value. to wait until an input is set. Instruction WaitTime WaitUntil WaitDI WaitDO Used to: Wait a given amount of time or to wait until the robot stops moving Wait until a condition is satisfied Wait until a digital input is set Wait until a digital output is set 3.load program modules. or updated with an arithmetic expression. 5.g.3 Comments Comments are only inserted into the program to increase its readability.g. It can. 3. Instruction comment Used to: Comment on the program RAPID Overview 3-5 . for example. Program execution is not affected by a comment. Instruction := Used to: Assign a value to data 3. reg1+5*reg3.RAPID Summary Various Instructions 3 Various Instructions Various instructions are used to . e.wait a given amount of time or wait until a condition is satisfied . e. be initialised with a constant value. or to wait until an arbitrary condition is satisfied.insert a comment into the program .2 Wait The robot can be programmed to wait a given amount of time. for example.assign values to data .

if loaded with StartLoad. to the program task Save a program module Used to: Program a load session 3.6 Basic data Data type bool num symnum string switch Used to define: Logical data (with the values true or false) Numeric values (decimal or integer) Numeric data with symbolic value Character strings Routine parameters without value 3-6 RAPID Overview .4 Loading program modules Program modules can be loaded from mass memory or erased from the program memory. Instruction Load UnLoad Start Load Wait Load Save Data type loadsession Used to: Load a program module into the program memory Unload a program module from the program memory Load a program module into the program memory during execution Connect the module. In this way large programs can be handled with only a small memory.Various Instructions RAPID Summary 3.5 Various functions Function OpMode RunMode Dim Present IsPers IsVar Used to: Read the current operating mode of the robot Read the current program execution mode of the robot Obtain the dimensions of an array Find out whether an optional parameter was present when a routine call was made Check whether a parameter is a persistent Check whether a parameter is a variable 3.

Convert a string with a defined byte data format to a byte data.RAPID Summary Various Instructions 3.7 Conversion function Function StrToByte ByteToStr Used to: Convert a byte to a string data with a defined byte data format. RAPID Overview 3-7 .

Various Instructions RAPID Summary 3-8 RAPID Overview .

Management of different robot configurations .when a new program is loaded. Default values are automatically set (by executing the routine SYS_RESET in system module BASE) . .Program displacement .1 Programming principles The basic characteristics of the robot motion are determined by data specified for each positioning instruction. 4. Instruction VelSet Used to define: The maximum velocity and velocity override RAPID Overview 3-9 .Payload .at a cold start-up. but can also be read using the system variable C_MOTSET or C_PROGDISP. . Some data.2 Defining velocity The absolute velocity is programmed as an argument in the positioning instruction.Tuning values 4. however. is specified in separate instructions which apply to all movements until that data changes.Behaviour close to singular points .Soft servo .when the program is started from the beginning. In addition to this.Maximum velocity and velocity override .RAPID Summary Motion Settings 4 Motion Settings Some of the motion characteristics of the robot are determined using logical instructions that apply to all movements: . the maximum velocity and velocity override (a percentage of the programmed velocity) can be defined.Acceleration . The general motion settings are specified using a number of instructions.

the acceleration can be reduced for part of the program.Motion Settings RAPID Summary 4. the correct configuration will be achieved. Instruction AccSet Used to define: The maximum acceleration 4. however. If joint (axis-by-axis) motion is used.6 Defining the behaviour near singular points The robot can be programmed to avoid singular points by changing the tool orientation automatically.5 Defining the payload To achieve the best robot performance.3 Defining acceleration When fragile parts. the robot will always move towards the closest configuration. Instruction SingArea Used to define: The interpolation method through singular points 3-10 RAPID Overview . If linear or circular motion are used. It is possible to change this. are handled. Instruction ConfJ ConfL Used to define: Configuration control on/off during joint motion Configuration check on/off during linear motion 4. Instruction GripLoad Used to define: The payload of the gripper 4. for example. the correct payload must be defined. but a check is performed to see if it is the same as the programmed one.4 Defining configuration management The robot’s configuration is normally checked during motion.

7 Displacing a program When part of the program must be displaced. for example. Instruction TuneServo TuneReset PathResol Data type tunetype Used to: Adjust the robot tuning values Reset tuning to normal Adjust the geometric path resolution Used to: Represent the tuning type as a symbolic constant RAPID Overview 3-11 . When using this function. You can adjust the robot tuning values to obtain the required performance. for example. can occur.9 Adjust the robot tuning values In general. overrunning. a spring tool. Instruction PDispOn PDispSet PDispOff EOffsOn EOffsSet EOffsOff Function DefDFrame DefFrame ORobT Used to: Activate program displacement Activate program displacement by specifying a value Deactivate program displacement Activate an external axis offset Activate an external axis offset by specifying a value Deactivate an external axis offset Used to: Calculate a program displacement from three positions Calculate a program displacement from six positions Remove program displacement from a position 4. a program displacement can be added. Instruction SoftAct SoftDeact Used to: Activate the soft servo for one or more axes Deactivate the soft servo 4. e.8 Soft servo One or more of the robot axes can be made “soft”. the robot will be compliant and can replace.RAPID Summary Motion Settings 4. following a search. in certain extreme cases. however. the performance of the robot is self-optimising.g.

10 World Zones Up to 10 different volumes can be defined within the working area of the robot.11 Data for motion settings Data type motsetdata progdisp Used to define: Motion settings except program displacement Program displacement 1. Instruction WZBoxDef WZSphDef WZLimSup1 WZDOSet1 WZDisable1 WZEnable1 WZFree1 Data type wztemporary wzstationary shapedata 1 Used to: Define a box-shaped global zone Define a cylindrical global zone Define a spherical global zone Activate limit supervision for a global zone Activate global zone to set digital outputs Deactivate supervision of a temporary global zone Activate supervision of a temporary global zone Erase supervision of a temporary global zone Used to: Identify a temporary global zone Identify a stationary global zone Describe the geometry of a global zone WZCylDef 1 4. The working area is then available only to one robot at a time. These can be used for: .Creating a working area common to two robots. . Only when the robot is equipped with the option “Advanced functions” 3-12 RAPID Overview .Motion Settings RAPID Summary 4.Delimiting the working area for the robot and preventing a collision with the tool.Indicating that the robot’s TCP is a definite part of the working area. .

Tool data (e.Speed data (desired speed) . The path between these two positions is then automatically calculated by the robot. arriving at the end position at the same time as the robot.1 Programming principles The basic motion characteristics.g.Program displacement .Maximum velocity and velocity override .Acceleration .Soft servo .Payload . i. “move from the current position to a new position”. the position of the TCP) .Work-object data (e.Position data (end position for robot and external axes) . RAPID Overview 3-13 . 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 9): . The remaining motion characteristics are specified by defining data which are arguments of the instruction: .e. such as the type of path.g.Zone data (position accuracy) .Management of different robot configurations . are specified by choosing the appropriate positioning instruction. The external axes are moved at a constant velocity.Tuning values Both the robot and the external axes are positioned using the same instructions.RAPID Summary Motion 5 Motion The robot movements are programmed as pose-to-pose movements.Behaviour close to singular points . 5.

4 Activating outputs or interrupts at specific positions Normally. the robot can search for the position of a work object. Moves the robot by joint movement and sets a digital output in the middle of the corner path. special motion instructions are used. Only if the robot is equipped with the option “Advanced Functions”. 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. logical instructions are executed in the transition from one positioning instruction to another.2 Positioning instructions Instruction MoveC MoveJ MoveL MoveAbsJ MoveCDO MoveJDO MoveLDO MoveCSync1 MoveJSync1 MoveLSync1 Type of movement: TCP moves along a circular path Joint movement TCP moves along a linear path Absolute joint movement Moves the robot circularly and sets a digital output in the middle of the corner path. Moves the robot circularly and executes a RAPID procedure Moves the robot by joint movement and executes a RAPID procedure Moves the robot linearly and executes a RAPID procedure 1. Instruction SearchC SearchL Type of movement: TCP along a circular path TCP along a linear path 5. If. Moves the robot linearly and sets a digital output in the middle of the corner path. these can be executed instead when the robot is at a specific position. Only if the robot is equipped with the option “Advanced functions” 3-14 RAPID Overview . Instruction TriggIO 1 Used to: Define a trigg condition to set an output at a given position Define a trigg condition to execute a trap routine at a given position TriggInt1 1. 5.Motion RAPID Summary 5. however.3 Searching During the movement. for example.

motion can be stopped temporarily and then restarted again. Only if the robot is equiped with the option “Developer’s Functions”.and postvalue of specified I/O signals (process signals) at the stop sequence of the robot movements. Only if the robot is equipped with the option “Advanced Functions”. Some instructions.5 Motion control if an error/interrupt takes place In order to rectify an error or an interrupt. 5. however. only affect the external axis movements.Only if the robot is equipped with the option “Advanced Functions”. Instruction StopMove StartMove StorePath1 RestoPath1 Used to: Stop the robot movements Restart the robot movements Store the last path generated Regenerate a path stored earlier 1. Used to define: Trigg conditions Analogue I/O trigger condition TriggC1 TriggJ1 TriggL1 StepBwdPath2 restartdata Data type triggdata aoitrigg 1 2 1. 5. 2.RAPID Summary TriggEquip1 Motion Define a trigg condition to set an output at a given position with the possibility to include time compensation for the lag in the external equipment Run the robot (TCP) circularly with an activated trigg condition Run the robot axis-by-axis with an activated trigg condition Run the robot (TCP) linearly with an activated trigg condition Move backwards on its path in a RESTART event routine Mirrors the pre. Instruction DeactUnit ActUnit MechUnit Load Used to: Deactivate an external mechanical unit Activate an external mechanical unit Defines a payload for a mechanical unit RAPID Overview 3-15 .6 Controlling external axes The robot and external axes are usually positioned using the same instructions.

8 Path Correction Instruction CorrCon2 CorrWrite 2 Used to: Connect to a correction generator Write offsets in the path coordinate system to a correction generator Disconnect from a previously connected correction generator Remove all connected correction generators Used to: CorrDiscon2 CorrClear2 Function CorrRead Data type Corrdescr2 2 Read the total corrections delivered by all connected correction generators Used to: Add geometric offsets in the path coordinate system 2.) 5. The working area of an axis can also be reset. such as IRB 5402 and IRB 5403. Only if the robot is equipped with the option “Advanced Motion”. which will reduce the cycle times. IndCMove2 IndDMove2 IndRMove2 IndReset2 IndInpos2 IndSpeed2 Instruction HollowWristReset2 2. Only if the robot is equipped with the option “Advanced Motion”.Motion RAPID Summary 5.7 Independent axes The robot axis 6 (and 4 on IRB 2400 /4400) or an external axis can be moved independently of other movements. Function IndAMove 2 Used to: Change an axis to independent mode and move the axis to an absolute position Change an axis to independent mode and start the axis moving continuously Change an axis to independent mode and move the axis a delta distance Change an axis to independent mode and move the axis to a relative position (within the axis revolution) Change an axis to dependent mode or/and reset the working area Check whether an independent axis is in position Check whether an independent axis has reached programmed speed Used to: Reset the position of the wrist joints on hollow wrist manipulators. (The Instruction HollowWristReset can only be used on Robot IRB 5402 AND IRB 5403. (The Instruction HollowWristReset can only be used on Robots IRB 5402 and IRB 5403.) 3-16 RAPID Overview .

y.9 Conveyor tracking Instruction WaitWObj3 DropWObj 3 Used to: Wait for work object on conveyor Drop work object on conveyor 3.RAPID Summary Motion 5. z of the robot) Read the current position (the complete robtarget) Read the current joint angles Read the current motor angles Read the current tooldata value Read the current wobjdata value Remove a program displacement from a position Mirror a position Calculates joint angles from robtarget The distance between two positions RAPID Overview 3-17 .10 Load identification and Collision detection Instruction MotionSup ParIdPosValid ParIdRobValid LoadId Used to: Deactivates/activates motion supervision Valid robot position for parameter identification Valid robot type for parameter identification Load identification of tool or payload 5.11 Position functions Function Offs RelTool CalcRobT CPos CRobT CJointT ReadMotor CTool CWObj ORobT MirPos CalcJointT Distance Used to: Add an offset to a robot position. expressed in relation to the work object Add an offset. Only if the robot is equipped with the option “Conveyor tracking”. expressed in the tool coordinate system Calculates robtarget from jointtarget Read the current position (only x. 5.

12 Motion data Motion data is used as an argument in the positioning instructions.Motion RAPID Summary 5. Data type robtarget jointtarget speeddata zonedata tooldata wobjdata stoppointdata Used to define: The end position The end position for a MoveAbsJ instruction The speed The accuracy of the position (stop point or fly-by point) The tool coordinate system and the load of the tool The work object coordinate system The termination of the position 5.13 Basic data for movements Data type pos orient pose confdata extjoint robjoint o_robtarget o_jointtarget loaddata mecunit Used to define: A position (x. z) An orientation A coordinate system (position + orientation) The configuration of the robot axes The position of the external axes The position of the robot axes Original robot position when Limit ModPos is used Original robot position when Limit ModPos is used for MoveAbsJ A load An external mechanical unit 3-18 RAPID Overview . y.

! Analog input IF ai1 > 5. high/low) Change the value of a group of digital output signals 6.. 6.... 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. e.2 Changing the value of a signal Instruction InvertDO PulseDO Reset Set SetAO SetDO SetGO Used to: Invert the value of a digital output signal Generate a pulse on a digital output signal Reset a digital output signal (to 0) Set a digital output signal (to 1) Change the value of an analog output signal Change the value of a digital output signal (symbolic value. ! Digital group input IF gi1 = 5 THEN .RAPID Summary Input and Output Signals 6 Input and Output 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. RAPID Overview 3-19 .2 THEN .g.g.. e.1 Programming principles The signal names are defined in the system parameters. : ! Digital input IF di1 = 1 THEN .3 Reading the value of an input signal The value of an input signal can be read directly in the program. 6.

5 Disabling and enabling I/O modules I/O modules are automatically enabled at start-up.4 Testing input on output signals Instruction WaitDI WaitDO Function TestDI Used to: Wait until a digital input is set or reset Wait until a digital output is set on reset Used to: Test whether a digital input is set 6.Input and Output Signals RAPID Summary 6.6 Defining input and output signals Data type dionum signalai signalao signaldi signaldo signalgi signalgo Instruction AliasIO 1 Used to define: The symbolic value of a digital signal The name of an analog input signal * The name of an analog output signal * The name of a digital input signal * The name of a digital output signal * The name of a group of digital input signals * The name of a group of digital output signals * Used to: Define a signal with an alias name * Only to be defined using system parameters. but they can be disabled during program execution and re-enabled later. 1. Instruction IODisable IOEnable Used to: Disable an I/O module Enable an I/O module 6. Only if the robot is equipped with the option “Developer’s Functions” 3-20 RAPID Overview .

Label the function keys and to read which key is pressed Read a numeric value from the teach pendant Choose a window on the teach pendant from RAPID RAPID Overview 3-21 . for example. 7.2 Communicating using the teach pendant Instruction TPErase TPWrite ErrWrite TPReadFK TPReadNum TPShow Used to: Clear the teach pendant operator display Write text on the teach pendant operator display Write text on the teach pendant display and simultaneously store that message in the progam’s error log. Information can also be printed directly on a printer connected to the robot.1 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.RAPID Summary Communication 7 Communication There are four possible ways to communicate via serial channels: . such as about the number of parts to be processed. .Messages can be output to the teach pendant display and the user can answer questions. for example. A file. for example. On doing this. binary transmission is necessary. Both text and the value of certain types of data can be printed. If communication is required in both directions simultaneously.Character-based information can be written to or read from text files in mass memory. can have data that is stored in character-based or binary form. production statistics can be stored and processed later in a PC. In this way. Each serial channel or file used must first be opened. for example.Binary information can be transferred between the robot and a sensor. . The teach pendant can be used at all times and does not need to be opened. with a link protocol. 7. . the channel/file receives a descriptor that is then used as a reference when reading/writing.Binary information can be transferred between the robot and another computer.

5 Data for serial channels Data type iodev Used to define: A reference to a serial channel/file.4 Communicating using binary serial channels/files Instruction Open1 WriteBin1 WriteAnyBin1 WriteStrBin1 Rewind1 Close1 ClearIOBuff1 Function ReadBin1 ReadAnyBin ReadStrBin1 1 Used to: Open a serial channel/file for binary transfer of data Write to a binary serial channel/file Write to any binary serial channel/file Write a string to a binary serial channel/file Set the file position to the beginning of the file Close the channel/file Clear input buffer of a serial channel Used to: Read from a binary serial channel Read from any binary serial channel Read a string from a binary serial channel/file 7. which can then be used for reading and writing 1.3 Reading from or writing to a character-based serial channel/file Instruction Open 1 1 Used to: Open a channel/file for reading or writing Write text to the channel/file Close the channel/file Used to: Read a numeric value Read a text string Write Close1 Function ReadNum1 ReadStr1 7. Only if the robot is equipped with the option “Advanced functions” 3-22 RAPID Overview .Communication RAPID Summary 7.

When an interrupt is ordered. the ordinary program is interrupted and a special trap routine is executed. This can take place in two ways: . 8. it is also automatically enabled. The program is interrupted. .A given amount of time elapses after an interrupt is ordered. 8. This may be one of the following events: . Any interrupts occurring during this time are disregarded. but can be temporarily disabled. Any interrupts occurring during this time are placed in a queue and then automatically generated when interrupts are enabled again. The interrupt identity (variable) is then used to order an interrupt. . It obtains its identity by creating a variable (of data type intnum) and connecting this to a trap routine. regardless of which instruction is being run at the time. when a specific input is set to one.1 Programming principles Each interrupt is assigned an interrupt identity.e.All interrupts can be disabled.A specific position is reached. to specify the reason for the interrupt. for example. .An input or output is set to one or to zero.RAPID Summary Interrupts 8 Interrupts Interrupts are used by the program to enable it to deal directly with an event. program execution resumes from where it was interrupted. When this has been fully executed.Individual interrupts can be deactivated.2 Connecting interrupts to trap routines Instruction CONNECT Used to: Connect a variable (interrupt identity) to a trap routine RAPID Overview 3-23 . When this occurs. i.

4 Cancelling interrupts Instruction IDelete Used to: Cancel (delete) an interrupt 8.6 Data type of interrupts Data type intnum Used to define: The identity of an interrupt 1.Interrupts RAPID Summary 8.3 Ordering interrupts Instruction ISignalDI SignalDO ITimer TriggInt1 Used to order: An interrupt from a digital input signal An interrupt from a digital output signal A timed interrupt A position-fixed interrupt (from the Motion pick list ) 8. Only if the robot is equipped with the option “Advanced functions” 3-24 RAPID Overview .5 Enabling/disabling interrupts Instruction ISleep IWatch IDisable IEnable Used to: Deactivate an individual interrupt Activate an individual interrupt Disable all interrupts Enable all interrupts 8.

In future releases.Add the instruction RAISE in this error handler. If there is no error handler there either. It is also possible to create an error from within the program and then jump to the error handler. then: . the internal error handler of the robot takes over directly. a call will be made to the error handler in the routine that called the routine in question.2 Creating an error situation from within the program Instruction RAISE Used to: “Create” an error and call the error handler RAPID Overview 3-25 . such as errors that occur when an incorrect value is read by a bar code reader.1 Programming principles When an error occurs. which means that program execution does not have to be interrupted. So. a call will be made to the error handler in the routine that called that routine.RAPID Summary Error Recovery 9 Error Recovery Many of the errors that occur when a program is being executed can be handled in the program. 9. errors can be handled using ordinary instructions.Add an error handler in the current routine . the error handler of the routine is called (if there is one). A return from the error handler can then take place in various ways. If the routine does not have an error handler. These errors are either of a type detected by the robot. a good rule already in this issue is as follows: if you want to call the error handler of the routine that called the current routine (propagate the error). if the current routine does not have an error handler. or of a type that is detected by the program. such as division by zero. 9. The internal error handler outputs an error message and stops program execution with the program pointer at the faulty instruction. The system data ERRNO can be used to determine the type of error that has occurred. In the error handler. and so on until the internal error handler of the robot takes over and outputs an error message and stops program execution.

4 Data for error handling Data type errnum Used to define: The reason for the error 3-26 RAPID Overview .3 Restarting/returning from the error handler Instruction EXIT RAISE RETRY TRYNEXT RETURN Used to: Stop program execution in the event of a fatal error Call the error handler of the routine that called the current routine Re-execute the instruction that caused the error Execute the instruction following the instruction that caused the error Return to the routine that called the current routine 9.Error Recovery RAPID Summary 9.

10. It is also possible to retrieve components of the current system time as a numeric value.1 Programming principles Clock instructions allow the user to use clocks that function as stopwatches. 10. This allows the robot program to perform an action at a certain time or on a certain day of the week.2 Using a clock to time an event Instruction ClkReset ClkStart ClkStop Function ClkRead Data Type clock Used to: Reset a clock used for timing Start a clock used for timing Stop a clock used for timing Used to: Read a clock used for timing Used for: Timing – stores a time measurement in seconds 10. In this way the robot program can be used to time any desired event. This string can then be displayed to the operator on the teach pendant display or used to time and date-stamp log files.RAPID Summary System & Time 10 System & Time System and time instructions allow the user to measure.3 Reading current time and date Function CDate CTime GetTime Used to: Read the Current Date as a string Read the Current Time as a string Read the Current Time as a numeric value RAPID Overview 3-27 . inspect and record time. The current time or date can be retrieved in a string.

3-28 RAPID Overview .4 Retrieve time information from file Function FileTime ModTime Used to: Retrieve the last time for modification of a file. Retrieve the time of loading a specified module.System & Time RAPID Summary 10.

g. 11.2 Simple calculations on numeric data Instruction Clear Add Incr Decr Used to: Clear the value Add or subtract a value Increment by 1 Decrement by 1 11.1 Programming principles Calculations are normally performed using the assignment instruction. There are also some instructions used for simple calculations. such as to clear a numeric variable. reg1:= reg2 + reg3 / 5.3 More advanced calculations Instruction := Used to: Perform calculations on any type of data RAPID Overview 3-29 . e. 11.RAPID Summary Mathematics 11 Mathematics Mathematical instructions and functions are used to calculate and change the value of data.

180] Calculate the cosine value Calculate the sine value Calculate the tangent value Calculate Euler angles from an orientation Calculate the orientation from Euler angles Invert a pose Multiply a pose Multiply a pose and a vector Calculate the magnitude of a pos vector. Normalise unnormalised orientation (quarternion) 3-30 RAPID Overview .90] Calculate the arc tangent value in the range [-180. Calculate the dot (or scalar) product of two pos vectors.4 Arithmetic functions Function Abs Round Trunc Sqrt Exp Pow ACos ASin ATan ATan2 Cos Sin Tan EulerZYX OrientZYX PoseInv PoseMult PoseVect Vectmagn DotProd NOrient Used to: Calculate the absolute value Round a numeric value Truncate a numeric value Calculate the square root Calculate the exponential value with the base “e” Calculate the exponential value with an arbitrary base Calculate the arc cosine value Calculate the arc sine value Calculate the arc tangent value in the range [-90.Mathematics RAPID Summary 11.

RAPID Summary Mathematics RAPID Overview 3-31 .

process start and supervision of an external weld timer.Gun pre-closing . It is intended that the user adapts some user data and routines to suit the environmental situation. It should be noted that SpotWare is a package that can be extensively customised.Time.Spot counters .Weld error recovery with automatic rewelding .User-defined service routines .User defined supervision of the surrounding equipment before weld start .Simulated welding .Monitoring of the external weld timer .Spot Welding RAPID Summary 12 Spot Welding The SpotWare package provides support for spot welding applications that are equipped with a weld timer and on/off weld gun. NADEX.Quick start after a weld .User defined open/close gun and supervision .User defined pressure setting .Return to the spot weld position .1 Spot welding features The SpotWare package contains the following features: . 12.Reverse execution with gun control .Parallel and serial weld timer interfaces 3-32 RAPID Reference Manual . ABB Timer.Fast and accurate positioning . The SpotWare application provides fast and accurate positioning combined with gun manipulation. Some serial weld timer interfaces are also supported: Bosch PSS5000.User defined supervision of the surrounding equipment after the weld .Handling of an on/off gun with two strokes .or signal-dependent motion release after a weld . See separate documentation. Communication with the welding equipment is carried out by means of digital inputs and outputs.Presetting and checking of gun pressure .User defined preclose time calculation .Dual/single gun .

One weld timer monitoring with standard parallel (some serial) interface.Supports both program and start triggered weld timers .SpotL/J current data information Spot Welding .Manual weld. program schedule or start signal triggered.Spot identity transfer to the serial weld timer BOSCH PSS 5000 . is possible . a state dependent weld power and water cooling signal control are implemented. The triggers are activated by virtual digital signals. gun open and gun close initiated by digital input . RAPID Reference Manual 3-33 .Spot identity info: the current spotdata parameter name (string format) .Optional user defined error recovery 12. On its way towards the programmed position. Note: This feature requires the MultiTasking option . A program stop will only stop the motion task execution. For example. It is also possible to define new supervision events and to connect them to digital signal triggers. this will finish the weld and open the gun. the motion task will trigger actions in the spot-welding tasks.RAPID Summary . For well defined entries. The weld timer may be of the type. By default. This offers the possibility of performing a stand-alone weld anywhere without programming a new position. spot welding and continuous supervision.User defined autonomous supervision. The process and supervision carry on their tasks until they come to a well defined process stop. although the program has stopped. These gun routines may be changed from the simple on/off default functionality to a more complex like analog gun control and they may contain additional gun supervision.2 Principles of SpotWare SpotWare is based on a separate handling of motion. Since the process and supervision tasks are acting on I/O triggers.Weld process start disregarding the in position event. calls to user routines offer adaptations to the plant environment. such as state-controlled weld current signal and water cooling start. even if activated manually from the I/O window on the teach-pendant. Supported equipment: . they will be executed either by the trig that was sent by the motion (SpotL/J) or by manual activation (teach pendant or external). The opening and closing of the gun are always executed by RAPID routines. A number of predefined parameters are also available to shape the behaviour of the SpotL/J instruction. The tasks work with their own internal encapsulated variables and with persistents which are fully transparent for all tasks.

.5 Spot welding data Data type spotdata gundata Used to define: The spot weld process control The spot weld gun 3-34 RAPID Reference Manual . gun closure/opening and the welding process Move the TCP along a non-linear path and perform a spot weld at the end position SpotJ 12.Spotdata: spot weld process data . The spot welding process is specified by: .System parameters: the I/O configuration.Any type of pressure preset. 12.Spot Welding .4 Spot welding instructions Instruction SpotL Used to: Control the motion.3 Programming principles Both the robot’s linear movement and the spot weld process control are embedded in one instruction.Gundata: spot weld gun data . Both the robot’s joint movement and the spot weld process control are embedded in one instruction. . RAPID Summary .The system modules SWUSRF and SWUSRC: RAPID routines and global data for customising purposes.Any type of single/dual gun close and gun gap control. gun closure/opening and the welding process Move the TCP along a linear path and perform a spot weld at the end position Control the motion. SpotJ.System Parameters 12. See User’s Guide . SpotL.Event controlled SpotL/J-independent spot weld equipment such as contactors etc.

which is also identified by the arc welding instruction. The weld settings for the actual weld phase are defined in weld data. Crater-filling and scraping starts can.RAPID Summary Arc Welding 13 Arc Welding The ArcWare package supports most welding functions. 13. The start and end phase are defined in seam data. Using ArcWare. The welding process is divided into the following phases: START WELD END FINISH FILL POSTACTION PREACTION IGNITION HEAT t 13. for example.2 Arc welding instructions Instruction ArcC ArcL Type of movement: TCP along a circular path TCP along a linear path RAPID Overview 3-35 . be programmed. such as a scraping start. Any weaving is defined in weave data. the whole welding process can be controlled and monitored by the robot via a number of different digital and analog inputs and outputs. are defined in the system parameters.1 Programming principles The same instructions are used both to control the robot’s movements and the actual welding process. Certain functions. The arc welding instructions indicate which weld data and seam data are used in the weld in question.

5 Arc welding plus data Data type spcdescr spcdata Used to define: Statistical process control descriptor Statistical process control data 3-36 RAPID Overview .4 Arc welding data Data type welddata seamdata weavedata arcdata Used to define: The weld phase The start and end phase of a weld The weaving characteristics Arc process data 13.Arc Welding RAPID Summary 13.3 Arc welding plus instructions Instruction ArcRefresh ArcKill SpcWrite SpcStat SpcRead SpcDump SpcDiscon SpcCon Type of movement: Refresh ArcWeld data Kill the ArcWeld process Writes to a statistical process controller Statistical process control status Reads the current process status Dumps statistical process control information Disconnects from a statistical process controller Connects to a statistical process controller 13.

GlueL and GlueC respectively.2 Programming principles Both the robot’s movement and the glue process control are embedded in one instruction. See Predefined Data and Programs .Gun pre-opening and pre-closing respectively .The system module GLUSER: RAPID routines and global data for customizing purposes.Fast and accurate positioning . . process start and stop.Glueing 14. Communication with the glueing equipment is carried out by means of digital and analog outputs.ggundata.Simulated glueing 14. See System Parameters . .3 Glue instructions Instruction GlueL GlueC Used to: Move the TCP along a linear path and perform gluing with the given data Move the TCP along a circular path and perform gluing with the given data RAPID Overview 3-37 . The GlueWare application provides fast and accurate positioning combined with gun manipulation.Handling of on/off guns as well as proportional guns .Two different guns can be handled in the same program.Gundata: glue gun data.System Module GLUSER. 14.1 Glueing features The GlueWare package contains the following features: . each gun controlled by one digital signal (on/off) and two analog signals (flows) . The glueing process is specified by: .System parameters: the I/O configuration.RAPID Summary GlueWare 14 GlueWare The GlueWare package provides support for gluing applications that are equipped with one or two gluing guns. See Data types .

5 DispenseWare data Data type beaddata equidata Used to define: Dispensing Bead Data Dispensing Equipment Data 3-38 RAPID Overview .4 Glue data Data type ggundata Used to define: The glue gun used 14.GlueWare RAPID Summary 14.

15.RAPID Summary External Computer Communication 15 External Computer Communication The robot can be controlled from a superordinate computer. for example. Only if the robot is equipped with the option “RAP Serial Link”. The computer can. In this case.1 Programming principles As a common communications protocol is used to transfer information from the robot to the computer and vice versa. Programming is only necessary when program-controlled information has to be sent from the robot to the superordinate computer.2 Sending a program-controlled message from the robot to a computer Instruction SCWrite1 Used to: Send a message to the superordinate computer 1. the robot and computer can understand each other and no programming is required. 15. a special communications protocol is used to transfer information. RAPID Overview 3-39 . change values in the program’s data without any programming having to be carried out (except for defining this data).

External Computer Communication RAPID Summary 3-40 RAPID Overview .

2 Read configuration data Instruction to to read one attribute of a named system parameter. Only when the robot is equipped with the option “Advanced functions” RAPID Overview 3-41 . Instruction WriteCfgData1 Used to: Write one attribute of a named system parameter.RAPID Summary RAPID Support Instructions 16 RAPID Support Instructions Various functions for supporting of the RAPID language: . 16. 1. Instruction GetSysData Used to: Fetch data for and name of current active Tool or Work Object.Write configuration data 16. Instruction ReadCfgData1 Used to: Read one attribute of a named system parameter.Get system data .3 Write configuration data Instruction to write one attribute of a named system parameter.Read configuration data .1 Get system data Instruction to fetch the value and (optional) the symbol name for the current system data of specified type. 16.

4 Trigg functions Instructions to set output signals and/or run interrupt routines at fixed positions at the same time as the robot is moving. Define robot movements and events at a linear movement. Define robot movements and events at a non-linear movement from one point to another. Instruction TriggC TriggJ TriggL Used to: Define robot movements and events on a circular path.RAPID Support Instructions RAPID Summary 16. 3-42 RAPID Overview .

can be directed to an analog output signal located on the backplane of the robot. such as the speed of a motor.1 Directing a value to the robot’s test signal A reference signal. 17. See the chapter on Troubleshooting Tools in the Product Manual for more information. Instructions TestSignDefine TestSignReset Function TestSignRead Used to: Define a test signal Reset all test signals definitions Used to: Read test signal value RAPID Overview 3-43 .RAPID Summary Service Instructions 17 Service Instructions A number of instructions are available to test the robot system.

Service Instructions RAPID Summary 3-44 RAPID Overview .

STR_UPPER. 18. conversion.RAPID Summary String Functions 18 String Functions String functions are used for operations with strings such as copying.2 Comparison and Searching Operator = <> Function StrMemb StrFind StrMatch StrOrder Used to: Test if equal to Test if not equal to Used to: Check if character belongs to a set Search for character in a string Search for pattern in a string Check if strings are in order RAPID Overview 3-45 . comparison. etc.1 Basic Operations Data type string Used to define: String. Predefined constants STR_DIGIT. concatenation. searching. STR_LOWER and STR_WHITE Instruction/Operator := + Function StrLen StrPart Used to: Assign a value (copy of string) String concatenation Used to: Find string length Obtain part of a string 18.

3 Conversion Function NumToStr ValToStr StrToVal StrMap StrToByte ByteToStr Used to: Convert a numeric value to a string Convert a value to a string Convert a string to a value Map a string Convert a string to a byte Convert a byte to string data 3-46 RAPID Overview .String Functions RAPID Summary 18.

but their type or size (array dimension) differ.. (See Basic Characteristics Multitasking. Start/Stop/Restart.). If two persistents have the same name. A task has its own trap handling and the event routines are triggered only on its own task system states (e.g. but persistents are not. A persistent with the same name and type is reachable in all tasks.. One parallel program can be placed in the background or foreground of another program.1 Basics To use this function the robot must be configured with one extra TASK for each background program.2 Resource access Protection Function TestAndSet Used to Retrieve exclusive right to specific RAPID code areas or system resources. Up to 10 different tasks can be run in pseudo parallel. Variables and constants are local in each task. Each task consists of a set of modules.RAPID Summary Multitasking 19 Multitasking Multitasking RAPID is a way to execute programs in (pseudo) parallel with the normal execution. in the same way as the normal program.. It can also be on the same level as another program. a runtime error will occur. 19. All the modules are local in each task.) 19. RAPID Overview 3-47 .

Multitasking RAPID Summary 3-48 RAPID Overview .

1 Instructions Data := Value AccSet Acc Ramp ActUnit MecUnit Add Name AddValue ArcRefresh ArcKill Break CallBy Var Name Number Clear Name Clock Clock Clock IODevice ClkReset ClkStart ClkStop Close ! Comment ConfJ ConfL [\On] | [\Off] [\On] | [\Off] CONNECT Interrupt WITH Trap routine CorrClear CorrCon Descr CorrDiscon Descr CorrWrite CorrWrite Descr Data RAPID Overview 3-49 .RAPID Summary Syntax Summary 20 Syntax Summary 20.

.. ENDFOR GOTO Label Load DestObject [\ ObjectName ] GripLoad GetSysData IDelete IF Interrupt ..Syntax Summary CorrClear DeactUnit MecUnit Decr Name WObj RAPID Summary DropWObj EOffsSet EAxOffs ErrWrite [ \W ] Header Reason [ \RL2] [ \RL3] [ \RL4] Exit ExitCycle FOR Loop counter FROM Start value TO End value [STEP Step value] DO ...} [ELSE . Condition IF Condition THEN ..] ENDIF Incr Name IndAMove MecUnit Axis [ \ToAbsPos ] | [ \ToAbsNum ] Speed [ \Ramp ] IndCMove MecUnit Axis Speed [ \Ramp ] IndDMove MecUnit Axis Delta Speed [ \Ramp ] IndReset MecUnit Axis [ \RefPos ] | [ \RefNum ] | [ \Short ] | [ \Fwd ] | [ \Bwd ] | [ \Old ] IndRMove MecUnit Axis [ \ToRelPos ] | [ \ToRelNum ] | [ \Short ] | [ \Fwd ] | [ \Bwd ] Speed [ \Ramp ] 3-50 RAPID Overview . {ELSEIF Condition THEN .....

RAPID Summary InvertDO IODisable IOEnable Syntax Summary Signal UnitName MaxTime UnitName MaxTime ISignalDI [ \Single ] Signal TriggValue Interrupt ISignalDO [ \Single ] Signal TriggValue Interrupt ISleep ITimer Interrupt [ \Single ] Time Interrupt VarNo Value. Interrupt Interrupt ParIdType LoadIdType Tool [\PayLoad] [\WObj] [\ConfAngle] [\SlowTest] [\Accuracy] ParIdType LoadIdType Tool [\PayLoad] [\WObj] [\ConfAngle] [\SlowTest] [\Accuracy] IVarValue IWatch LoadId MechUnitLoad MechUnit AxisNo Load MoveAbsJ MoveC [ \Conc ] ToJointPos Speed [ \V ] | [ \T ] Zone [ \Z] Tool [ \WObj ] [ \Conc ] CirPoint ToPoint Speed [ \V ] | [ \T ] Zone [ \Z] Tool [ \WObj ] CirPoint ToPoint Speed [ \T ] Zone Tool [\WObj ] Signal Value CirPoint ToPoint Speed [ \T ] Zone Tool [\WObj ] ProcName MoveCDO MoveCSync MoveJ [ \Conc ] ToPoint Speed [ \V ] | [ \T ] Zone [ \Z ] Tool [ \WObj ] MoveJDO ToPoint Speed [ \T ] Zone Tool [ \WObj ] Signal Value MoveJSync MoveL ToPoint Speed [ \T ] Zone Tool [ \WObj ] ProcName [ \Conc ] ToPoint Speed [ \V ] | [ \T ] Zone [ \Z ] Tool [ \WObj ] RAPID Overview 3-51 .

Syntax Summary MoveLDO ToPoint Speed [ \T ] Zone Tool [ \WObj ] Signal Value RAPID Summary MoveLSync ToPoint Speed [ \T ] Zone Tool [ \WObj ] ProcName MotionSup Open [ \On] | [ \Off] [\TuneValue] Object [\File] IODevice [\Read] | [\Write] | [\Append] | [\Bin] ParIdPosValid ( ParIdType Pos AxValid [\ConfAngle] ) ParIdRobValid PathResol Value (ParIdType) PDispOn [ \Rot ] [ \ExeP ] ProgPoint Tool [ \WObj ] PDispSet DispFrame Procedure PulseDO RAISE { Argument } [ \PLength ] Signal [ Error no ] ReadCfgData InstancePath Attribute CfgData Reset Signal [ Return value ] IODevice RETURN Rewind Save [\Task] ModuleName [\FilePath] [\File] SearchC [ \Stop ] | [ \PStop ] | [ \Sup ] Signal SearchPoint CirPoint ToPoint Speed [ \V ] | [ \T ] Tool [ \WObj ] SearchL [ \Stop ] | [ \PStop ] | [ \Sup ] Signal SearchPoint ToPoint Speed [ \V ] | [ \T ] Tool [ \WObj ] Set Signal Signal Value [ \SDelay ] Signal Value Signal Value SetAO SetDO SetGO 3-52 RAPID Overview .

RAPID Summary
SingArea [ \Wrist] | [ \Arm] | [ \Off]

Syntax Summary

SoftAct Axis Softness [\Ramp ] SpcCon Descr Status [\GrpSize ] [\Teach ] [\Strict ] [\Header ] [\BackupFile ] SpcDiscon Descr SpcDump SpcRead SpcStat SpotJ SpotL SpotML Stop [ \NoRegain ] ToPoint Speed Spot [\InPos] [\NoConc] [\Retract] Gun Tool [\WObj]

TEST Test data {CASE Test value {, Test value} : ...} [ DEFAULT: ...] ENDTEST TestSignDefine Channel SignalId MechUnit Axis SampleTime TestSignReset TPReadFK Answer String FK1 FK2 FK3 FK4 FK5 [\MaxTime] [\DIBreak] [\BreakFlag] TPReadNum Answer String [\MaxTime] [\DIBreak] [\BreakFlag] TPShow TPWrite Window String [\Num] | [\Bool] | [\Pos] | [\Orient]

TriggC CirPoint ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4] Zone Tool [ \WObj ] TriggEqip TriggInt TriggData Distance [ \Start ] | [ \Time ] Interrupt

RAPID Overview

3-53

Syntax Summary

RAPID Summary

TriggIO TriggData Distance [ \Start ] | [ \Time ] [ \DOp ] | [ \GOp ] | [\AOp ] SetValue [ \DODelay ] | [ \AORamp ] TriggJ ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4 ] Zone Tool [ \WObj ] TriggL ToPoint Speed [ \T ] Trigg_1 [ \T2 ] [ \T3 ] [ \T4 ] Zone Tool [ \WObj ] TriggStopProc RestartRef [\DO1] [\GO1] [\GO2] [\GO3] [\GO4] ShadowDO TuneServo MecUnit Axis TuneValue [\Type] UnLoad FilePath [\File] VelSet WaitDI Override Max Signal Value [\MaxTime] [\TimeFlag]

WaitDO Signal Value [\MaxTime] [\TimeFlag] WaitTime WaitUntil
WaitWObj

[\InPos] Time [\InPos] Cond [\MaxTime] [\TimeFlag]
WObj [ \RelDist ]

WHILE

Condition DO ... ENDWHILE

Write IODevice String [\Num] | [\Bool] | [\Pos] | [\Orient] [\NoNewLine] WriteBin IODevice Buffer NChar

WriteCfgData InstancePath Attribute CfgData WriteStrBin IODevice Str

WZBoxDef [\Inside] | [\Outside] Shape LowPoint HighPoint 1 WZCylDef [\Inside] | [\Outside] Shape CentrePoint Radius Height WZDisable WorldZone WZDOSet [\Temp] | [\Stat] WorldZone [\Inside] | [\Before] Shape Signal SetValue WZEnable WorldZone WZFree WorldZone
3-54 RAPID Overview

RAPID Summary
WZLimSup [\Temp] | [\Stat] WorldZone Shape WZSphDef

Syntax Summary

[\Inside] | [\Outside] Shape CentrePoint Radius

20.2 Functions Abs (Input) ACos (Value) (Signal)
(Parameter)

AOutput
ArgName

ASin ATan ATan2

(Value) (Value) (Y X) (ByteData [\Hex] | [\Okt] | [\Bin] | [\Char]) (Clock)

ByteToStr ClkRead CorrRead Cos CPos CRobT

(Angle) ([Tool] [\WObj]) ([Tool] [\WObj]) (OldP1 (NewP1 OldP2 NewP2 OldP3 NewP1 NewP2 NewP3)

DefDFrame DefFrame Dim

NewP3 [\Origin])

(ArrPar DimNo) (Signal)
(Vector1 Vector2)

DOutput
DotProd

EulerZYX Exp

([\X] | [\Y] | [\Z] Rotation)

(Exponent)

RAPID Overview

3-55

Syntax Summary

RAPID Summary

FileTime ( Path [\ModifyTime] | [\AccessTime] | [\StatCTime] ) GOutput GetTime (Signal) ( [\WDay] | [\Hour] | [\Min] | [\Sec] )

IndInpos MecUnit Axis IndSpeed MecUnit Axis [\InSpeed] | [\ZeroSpeed] IsPers IsVar MirPos (DatObj) (DatObj) (Point MirPlane [\WObj] [\MirY])

ModTime ( Object ) NOrient NumToStr Offs (Rotation) (Val Dec [\Exp])

(Point XOffset YOffset ZOffset) (ZAngle YAngle XAngle)

OrientZYX

ORobT (OrgPoint [\InPDisp] | [\InEOffs]) PoseInv (Pose) PoseMult (Pose1 Pose2) PoseVect Pow (Pose Pos)

(Base Exponent) (OptPar) (IODevice [\Time])

Present ReadBin

ReadMotor [\MecUnit ] Axis ReadNum ReadStr RelTool Round (IODevice [\Time]) (IODevice [\Time]) (Point Dx Dy Dz [\Rx] [\Ry] [\Rz])

( Val [\Dec])

3-56

RAPID Overview

RAPID Summary
Sin Sqrt (Angle) (Value) (Str ChPos Set [\NotInSet]) (Str) ( Str FromMap ToMap) (Str ChPos Pattern) (Str ChPos Set) ( Str1 Str2 Order) (Str ChPos Len)

Syntax Summary

StrFind StrLen StrMap StrMatch StrMemb StrOrder StrPart

StrToByte

(ConStr [\Hex] | [\Okt] | [\Bin] | [\Char])

StrToVal ( Str Val ) Tan (Angle) (Signal) Object

TestDI

TestAndSet

TestSignRead (Channel) Trunc ( Val [\Dec] ) ( Val )
(Vector)

ValToStr
VectMagn

RAPID Overview

3-57

Syntax Summary

RAPID Summary

3-58

RAPID Overview

Basic Characteristics

Basic Elements

1 Basic Elements
1.1 Identifiers
Identifiers are used to name modules, routines, data and labels; e.g. 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 16 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. See Chapters 7, 8, 9, 10 ,13, 14 and 15 in this manual. ALIAS CONNECT DO ENDFUNC ENDRECORD ERROR FROM INOUT NOSTEPIN PERS RECORD SYSMODULE TRAP VIEWONLY AND CONST ELSE ENDIF ENDTEST EXIT FUNC LOCAL NOT PROC RETRY TEST TRUE WHILE BACKWARD DEFAULT ELSEIF ENDMODULE ENDTRAP FALSE GOTO MOD NOVIEW RAISE RETURN THEN TRYNEXT WITH CASE DIV ENDFOR ENDPROC ENDWHILE FOR IF MODULE OR READONLY STEP TO VAR XOR

RAPID Overview

4-1

Basic Elements

Basic Characteristics

1.2 Spaces and new-line characters
The RAPID programming language is a free format language, meaning that spaces can be used anywhere except for in: - identifiers - reserved words - numerical values - placeholders. 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. Unnecessary spaces and new-line characters will automatically be deleted from a program loaded into the program memory. Consequently, programs loaded from diskette and then stored again might not be identical.

1.3 Numeric values
A numeric value can be expressed as - an integer, e.g. 3, -100, 3E2 - a decimal number, e.g. 3.5, -0.345, -245E-2 The value must be in the range specified by the ANSI IEEE 754-1985 standard (single precision) float format.

1.4 Logical values
A logical value can be expressed as TRUE or FALSE.

1.5 String values
A string value is a sequence of characters (ISO 8859-1) and control characters (nonISO 8859-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 max. 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"

4-2

RAPID Overview

Basic Characteristics

Basic Elements

1.6 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 an entire line and cannot occur between two modules; e.g. ! comment IF reg1 > 5 THEN ! comment reg2 := 0; ENDIF

1.7 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 <TDN> <DDN> <RDN> <PAR> <ALT> <DIM> <SMT> <VAR> <EIT> <CSE> <EXP> <ARG> <ID> Represents: data type definition data declaration routine declaration formal optional alternative parameter optional formal parameter formal (conformant) array dimension instruction data object (variable, persistent or parameter) reference else if clause of if instruction case clause of test instruction expression procedure call argument identifier

1.8 File header
A program file starts with the following file header: %%% VERSION:1 LANGUAGE:ENGLISH %%% (Program version M94 or M94A) (or some other language: GERMAN or FRENCH)

RAPID Overview

4-3

Basic Elements

Basic Characteristics

1.9 Syntax
Identifiers <identifier> ::= <ident> | <ID> <ident> ::= <letter> {<letter> | <digit> | ’_’} Numeric values <num literal> ::= <integer> [ <exponent> ] | <integer> ’.’ [ <integer> ] [ <exponent> ] | [ <integer> ] ’.’ <integer> [ <exponent> ] <integer> ::= <digit> {<digit>} <exponent> ::= (’E’ | ’e’) [’+’ | ’-’] <integer> 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 -<newline> ::= -- newline control character -<digit> ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 <letter> ::= <upper case letter> | <lower case letter>

4-4

RAPID Overview

Basic Characteristics
<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) | ß

Basic Elements

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

RAPID Overview

4-5

Basic Elements

Basic Characteristics

4-6

RAPID Overview

Basic Characteristics

Modules

2 Modules
The program is divided into program and system modules. The program can also be divided into modules (see Figure 1). Program memory Program
Program data Main routine Main module Routine1 Module1 Module2 Module3 Module4 Program data Routine4 Routine5 Routine2 Routine3

System module1 Program data System module2 Routine6 Routine7 Figure 1 The program can be divided into modules.

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

RAPID Overview

4-7

Modules

Basic Characteristics

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

2.3 Module declarations
A module declaration specifies the name and attributes of that module. These attributes can only be added off-line, not using the teach pendant. The following are examples of the attributes of a module: Attribute SYSMODULE NOSTEPIN VIEWONLY READONLY NOVIEW If specified, the module: is a system module, otherwise a program module cannot be entered during stepwise execution cannot be modified cannot be modified, but the attribute can be removed 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 teach pendant. A module or a program containing a NOVIEW program module cannot be saved. Therefore, NOVIEW should primarily be used for system modules. NOVIEW can only be defined off-line from a PC. MODULE module_name (SYSMODULE, VIEWONLY) !data type definition !data declarations !routine declarations ENDMODULE

e.g.

A module may not have the same name as another module or a global routine or data.

2.4 Syntax
Module declaration <module declaration> ::= MODULE <module name> [ <module attribute list> ] <type definition list> <data declaration list> <routine declaration list> ENDMODULE

4-8

RAPID Overview

Basic Characteristics

Modules

<module name> ::= <identifier> <module attribute list> ::= ‘(‘ <module attribute> { ‘,’ <module attribute> } ‘)’ <module attribute> ::= 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> }

RAPID Overview

4-9

Modules

Basic Characteristics

4-10

RAPID Overview

Basic Characteristics

Routines

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

3.1 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 (see the example in Figure 2): - The scope of a global routine may include any module. - 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. Module1
Local Routine a Local Routine b Routine c Routine d Routine e

Module2
Local Routine a Local Routine e Routine f Routine g Routine h

Figure 2 Example: 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 or data in the same module. A global routine may not have the same name as a module or a global routine or global data in another module.

RAPID Overview

4-11

. switch.An INOUT parameter specifies that a corresponding argument must be a variable (entire. Example: PROC routine3 (\num exclude1 | num exclude2) The special type. This is indicated by a stroke “|” between the parameters in question. ENDPROC 4-12 RAPID Overview .Routines Basic Characteristics 3. Changing this variable will not change the corresponding argument. i. element or component) which can be changed by the routine. element or component) or an entire persistent which can be changed by the routine. There are four different types of parameters (in the access mode): .A PERS parameter specifies that a corresponding argument must be an entire persistent which can be changed by the routine.2 Parameters The parameter list of a routine declaration specifies the arguments (actual parameters) that must/can be supplied when the routine is called. Example: PROC routine1 (num in_par. may (only) be assigned to optional parameters and provides a means to use switch arguments.. A value cannot be transferred to a switch parameter. Present.e. VAR num var_par. . 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. this means. it makes it possible to use arguments to return values to the calling routine. VAR or PERS parameter is updated. Two or more optional parameters may be mutually exclusive (i. in actual fact. An optional parameter is denoted by a backslash “\” before the parameter. IF Present (off ) THEN .Normally. INOUT num inout_par. declared to exclude each other). ..A VAR parameter specifies that a corresponding argument must be a variable (entire. If an INOUT. which means that only one of them may be present in a routine call. PERS num pers_par) A parameter can be optional and may be omitted from the argument list of a routine call. a parameter is used only as an input and is treated as a routine variable. i. arguments that are only specified by names (not values). that the argument itself is updated. The only way to use a switch parameter is to check for its presence using the predefined function.e.e.. . Example: PROC routine4 (\switch on | switch off) .

Routine declarations cannot be nested. The degree of an array argument must comply with the degree of the corresponding formal parameter. Dim. 3. The evaluation of a function must be terminated by a RETURN instruction. it is not possible to declare a routine within a routine. a backward handler (only procedures) and an error handler (see Figure 3). Routine declaration Data declarations RAPID Overview 4-13 . a backward handler and an error handler.e. a body. data. a body. Execution continues from the point where the interrupt occurred. The dimension of an array parameter is “conformant” (marked with “*”).4 Routine declarations A routine can contain routine declarations (including parameters).Basic Characteristics Routines Arrays may be passed as arguments. i. The actual dimension thus depends on the dimension of the corresponding argument in a routine call. Example: PROC routine5 (VAR num pallet{*.*}) 3. A routine can determine the actual dimension of a parameter using the predefined function.3 Routine termination The execution of a procedure is either explicitly terminated by a RETURN instruction or implicitly terminated when the end (ENDPROC. data. The execution of a trap routine is explicitly terminated using the RETURN instruction or implicitly terminated when the end (ENDTRAP or ERROR) of that trap routine is reached. BACKWARD or ERROR) of the procedure is reached. Module Data declarations Routine a Routine b Routine c Body (Instructions) Routine d Backward handler Routine e Error handler Figure 3 A routine can contain declarations.

ENDFUNC Trap declaration Example: Respond to feeder empty interrupt.2)). TRAP feeder_empty wait_feeder. RETURN. ENDTRAP 3. FUNC num veclen (pos vector) RETURN Sqrt(Pow(vector. 4-14 RAPID Overview .Mandatory parameters must be specified. Example: Return the length of a vector. PROC arrmul( VAR num array{*}. .5 Procedure call When a procedure is called. Late binding is defined by putting percent signs before and after the string that denotes the name of the procedure. . the arguments that correspond to the parameters of the procedure shall be used: .2)+Pow(vector.y.x.Optional arguments can be omitted. ENDFOR ENDPROC Function declaration A function can return any data type value. but not an array value. Even though early binding should be considered to be the “normal” procedure call form. See the Chapter Using function calls in expressions on page 32 for more details. They must also be specified in the correct order. 1 ) DO array{index} := array{index} * factor.z.2)+Pow(vector.Conditional arguments can be used to transfer parameters from one routine call to another. late binding sometimes provides very efficient and compact code. 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). num factor) FOR index FROM 1 TO dim( array.Routines Procedure declaration Example: Basic Characteristics Multiply all elements in a num array by a factor.

If a reference is made to a procedure call error (syntax. the system variable ERRNO is set to ERR_REFUNKPRC. CASE 3: ...’<optional parameter declaration> | ’. . z. y. not procedure) using late binding. the system variable ERRNO is set to ERR_CALLPROC. Note that the late binding is available for procedure calls only.Basic Characteristics Example: ! early binding TEST products_id CASE 1: proc1 x. % procname{product_id} % x. z..’ <parameter declaration> | <optional parameter declaration> | ’. ! same example using late binding % “proc” + NumToStr(product_id. If a reference is made to an unknown procedure using late binding...6 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> ::= ’. “proc3”]. y.’ <PAR> RAPID Overview 4-15 .. z. and not for function calls. 3. . . y. “proc2”.. y.. z. 0) % x. CASE 2: proc2 x. Routines ! same example again using another variant of late binding VAR string procname {3} :=[“proc1”.

Routines Basic Characteristics <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> ] 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> ] ENDFUNC <function name> ::= <identifier> Trap routine declaration <trap declaration> ::= TRAP <trap name> <data declaration list> <instruction list> [ ERROR <instruction list> ] ENDTRAP <trap name> ::= <identifier> 4-16 RAPID Overview .

’ <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> ::= ’.’ <conditional procedure argument> | ’.’ <required procedure argument> | <optional procedure argument> | ’.Basic Characteristics Procedure call Routines <procedure call> ::= <procedure> [ <procedure argument list> ] ’.’ <ARG> <required procedure argument> ::= [ <identifier> ’:=’ ] <expression> <optional procedure argument> ::= ’\’ <identifier> [ ’:=’ <expression> ] <conditional procedure argument> ::= ’\’ <identifier> ’?’ ( <parameter> | <VAR> ) RAPID Overview 4-17 .’ <optional procedure argument> | <conditional procedure argument> | ’.

Routines Basic Characteristics 4-18 RAPID Overview .

4. Example: VAR dionum high:=1. level:= high. assignment of the x-component of pos1. A specific component of a record data can be accessed by using the name of that component. 4.Function (return) data types The input data types (signalai. pos1. Non-value data cannot be used in value-oriented operations: .Assignment (:=) . A component may be of an atomic or record type. e. 500.g. pos.g. e.TEST instructions . depth ] pos record aggregate value. A record value can be expressed using an aggregate representation. VAR num level.Basic Characteristics Data Types 4 Data Types There are two different kinds of data types: . a value data type represents some form of “value”. num. These data can be used in value-oriented operations.A record data type is a composite type with named.IN (access mode) parameters in routine calls .2 Equal (alias) data types An alias data type is defined as being equal to another type. Simply speaking. ordered components. signalgi) are of the data type semi value. [ 300. In the description of a data type it is only specified when it is a semi value or a nonvalue data type.1 Non-value data types Each available data type is either a value data type or a non-value data type. . except initialisation and assignment.g. Data with the same data types can be substituted for one another. This is OK since dionum is an alias data type for num RAPID Overview 4-19 . e.Equal to (=) and not equal to (<>) checks .x := 300.g. signaldi.Initialisation .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. e.

’ <data type> ::= <identifier> 4-20 RAPID Overview .3 Syntax <type definition>::= [LOCAL] ( <record definition> | <alias definition> ) | <comment> | <TDN> <record definition>::= RECORD <identifier> <record component list> ’.Data Types Basic Characteristics 4.’ ENDRECORD <record component list> ::= <record component definition> | <record component definition> <record component list> <record component definition> ::= <data type> <record component name> <alias definition> ::= ALIAS <data type> <identifier> ’.

This is accomplished by letting an update of the value of a persistent automatically cause the initialisation value of the persistent declaration to be updated. Note that the local directive may only be used at module level.A constant represents a static value and cannot be assigned a new value. VAR num global_variable. local program data hides any global data or routine with the same name (including instructions and predefined routines and data). Example: LOCAL VAR num local_variable. The following scope rules apply to program data: . Data declared inside a routine is called routine data. 5.A persistent can be described as a “persistent” variable. routine data hides any other routine or data with the same name. all data used must be declared. (When a program is saved the initialisation value of any persistent declaration reflects the current value of the persistent.The scope of local program data comprises the module in which it is contained.A variable can be assigned a new value during program execution. otherwise it is global. RAPID Overview 4-21 . .) . Note that the parameters of a routine are also handled as routine data. A persistent may not have the same name as another persistent in the same program. . Data declared outside a routine is called program data. .Basic Characteristics Data 5 Data There are three kinds of data: variables.Within its scope. A data declaration introduces data by associating a name (identifier) with a data type.The scope of routine data comprises the routine in which it is contained.The scope of predefined or global program data may include any module. Except for predefined data and loop variables. not inside a routine. .Within its scope. Global program data may not have the same name as other global data or a routine in another module. . The optional local directive of a data declaration classifies data as local (within the module).1 Data scope The scope of data denotes the area in which the data is visible. Program data may not have the same name as other data or a routine in the same module. persistents and constants. The following scope rules apply to routine data: .

e1. c. 4. VAR num maxno{10} := [1. Module2: Data a. d. Note that the value of an uninitialized variable may be used. 50]. . 2 or 3) format by adding dimensional information to the declaration. set to zero. i. Module2: Data a.the program is opened. 4-22 RAPID Overview . Example: VAR pos pallet{14. 2.2 Variable declaration A variable is introduced by a variable declaration. g. 7. 8. f. Example: VAR num x. 3]. but it is undefined.e. 18}. h1.the program is executed from the beginning of the program. 6. The following data can be called from routine h: Module1: Data d. 100. 9. Variables with value types may be initialised (given an initial value).Data See the example in Figure 4. Example: VAR string author_name := “John Smith”. The initialisation value is set when: . Routine data may not have the same name as other data or a label in the same routine. A dimension is an integer value greater than 0. The expression used to initialise a program variable must be constant. 5. 5. Variables of any type can be given an array (of degree 1. VAR pos start := [100. f. Module1 Local Data a Local Data b Data c Data d Data e Basic Characteristics Module2 Local Data a Local Data f Data g Local Routine e Data e1 Routine h Data h1 Data c Figure 4 Example: The following data can be called from routine e: Module1: Data c. g. 3.

The initialisation value must be a single value (without data or operands).23. Example: CONST pos seq{3} := [[614. . 2 or 3) format by adding dimensional information to the declaration. 1183.]... [914. 1022]]. Persistents of any type can be given an array (of degree 1. But note the limitation that these two persistents always have the same current value (use the same storage in the memory).4 Constant declaration A constant is introduced by a constant declaration... reg1 := 5.55. reg1 := 5. Example: PERS pos pallet{14. not inside a routine. are single values or single aggregates. After execution. in turn. Example: CONST num pi := 3. if they are local within the module (PERS LOCAL).Basic Characteristics Data 5. 1021].141592654. A dimension is an integer value greater than 0. It is possible to declare two persistents with the same name in different modules.. 998. Note that if the value of a persistent is updated. or a single aggregate with members which. 2 or 3) format by adding dimensional information to the declaration. . The value of a constant cannot be modified.. and must always be given an initial value. RAPID Overview 4-23 .3 Persistent declaration Persistents can only be declared at module level. Example: PERS pos refpnt := [100. without any error being generated by the system (different data scope). this automatically causes the initialisation value of the persistent declaration to be updated. 998. [814. A dimension is an integer value greater than 0. 5. 778. the program looks like this: PERS num reg1 := 5. 778. Example: PERS num reg1 := 0.98]. A constant of any type can be given an array (of degree 1. 18} := [. 1020].

! Faulty syntax PERS num a__b := a + b. Example: CONST num a := 2. ! Correct syntax CONST num ab := a + b. VAR num a_b := a + b. CONST num b := 3.Data Basic Characteristics 5. In the table below. 5. The initialisation value for a persistent can only be a literal expression. 4-24 RAPID Overview . 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.5 Initiating data The initialisation value for a constant or variable can be a constant expression. new program. PERS num a__b := 5. you can see what is happening in various activities such as warm start. Table1 System event Affects Constant Variable Persistent Commanded interrupts Start up routine SYS_RESET (with motion settings) Files Path Power on (Warm start) Unchanged Unchanged Unchanged Re-ordered Open. Close or New program Init Init Init Disappears Start program (Move PP to main) Init Init Init Disappears Start program (Move PP to Routine) Init Init Init Disappears Start program (Move PP to cursor) Unchanged Unchanged Unchanged Unchanged Start program (Call Routine) Unchanged Unchanged Unchanged Unchanged Start program (After cycle) Unchanged Unchanged Unchanged Unchanged Start program (After stop) Unchanged Unchanged Unchanged Unchanged Not run Run* Run Not run Not run Not run Not run Not run Closes Recreated at power on Closes Disappears Closes Disappears Closes Disappears Unchanged Disappears Unchanged Unchanged Unchanged Unchanged Unchanged Unchanged * Generates an error when there is a semantic error in the actual task program. program start etc.6 Storage Class The storage class of a data object determines when the system allocates and deallocates memory for the data object.

This means that any value assigned to an persistent or a module variable. they have the same storage during the lifetime of a task.7 Syntax Data declaration <data declaration> ::= [LOCAL] ( <variable declaration> | <persistent declaration> | <constant declaration> ) | <comment> | <DDN> Variable declaration <variable declaration> ::= VAR <data type> <variable definition> ’. and module variables are static. 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.’ <persistent definition> ::= <identifier> [ ’{’ <dim> { ’. persistents. i. Routine variables are volatile.Basic Characteristics Data Constants. 5.’ <dim> } ’}’ ] [ ’:=’ <constant expression> ] <dim> ::= <constant expression> Persistent declaration <persistent declaration> ::= PERS <data type> <persistent definition> ’.’ <dim> } ’}’ ] ’:=’ <literal expression> RAPID Overview 4-25 . The memory is later de-allocated at the point of the return to the caller 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 . always remains unchanged until the next assignment.e.a number of instances of the same variable are created.’ <variable definition> ::= <identifier> [ ’{’ <dim> { ’. 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.

Data Constant declaration Basic Characteristics <constant declaration> ::= CONST <data type> <constant definition> ’.’ <dim> } ’}’ ] ’:=’ <constant expression> <dim> ::= <constant expression> 4-26 RAPID Overview .’ <constant definition> ::= <identifier> [ ’{’ <dim> { ’.

index := index + 1. ENDWHILE 6.Basic Characteristics Instructions 6 Instructions Instructions are executed in succession unless a program flow instruction or an interrupt or error causes the execution to continue at some other place.1 Syntax <instruction list> ::= { <instruction> } <instruction> ::= [<instruction according to separate chapter in this manual> | <SMT> RAPID Overview 4-27 . Some instructions may contain other instructions and are terminated by specific keywords: Instruction IF FOR WHILE TEST Example: Termination word ENDIF ENDFOR ENDWHILE ENDTEST WHILE index < 100 DO .”. Most instructions are terminated by a semicolon “. A label is terminated by a colon “:”.

Instructions Basic Characteristics 4-28 RAPID Overview .

The result receives the same type as the operand.g. e. e. keep sign vector addition subtraction unary minus. Preserves integer (exact) representation as long as operands and result are kept within the integer subdomain of the num type. If the operand has an alias data type.g. IF a>=3 THEN . (Non-integer operands are illegal. Integer operations. RAPID Overview 4-29 . change sign vector subtraction multiplication scalar vector multiplication vector product linking of rotations division integer division integer modulo.num -num or -pos pos . 14 MOD 4=2. a:=Abs(3*b).) 3.as a condition in an IF instruction . for example: .1 Arithmetic expressions An arithmetic expression is used to evaluate a numeric value. e...in an assignment instruction . remainder Operation Operand types num + num +num or +pos pos + pos num . Table 2 Operator + + + * * * * / DIV 2) MOD 2) addition unary plus.g. WaitTime time.pos num * num num * pos or pos * num pos * pos orient * orient num / num num DIV num num MOD num Result type num3) same1)3) pos num3) same1)3) pos num3) pos pos orient num num num 1.as an argument in an instruction . 14 DIV 4=3. a:=3*b/c. the result receives the alias "base" type (num or pos). e. Example: 2*pi*radius Table 2 shows the different types of operations possible. It can be used.as an argument in a function call e. 2.g.g. 7.Basic Characteristics Expressions 7 Expressions An expression specifies the evaluation of a value.

Example: a>5 AND b=3 Table 3 shows the different types of operations possible. Table 3 Operator < <= = >= > <> AND XOR OR NOT less than less than or equal to equal to greater than or equal to greater than not equal to and exclusive or or unary not. negation Operation Operand types num < num num <= num any 1)= any 1) num >= num num > num any 1) <> any 1) bool AND bool bool XOR bool bool OR bool NOT bool Result type bool bool bool bool bool bool bool bool bool bool 1) Only value data types. Example: “IN” + “PUT” gives the result “INPUT” 4-30 RAPID Overview .2 Logical expressions A logical expression is used to evaluate a logical value (TRUE/FALSE). Operands must have equal types. a AND b a True False b True True False False False False a OR b a True False b True True True False True False a XOR b a True False b True False True False True False NOT b b True False False True 7.3 String expressions A string expression is used to carry out operations on strings.Expressions Basic Characteristics 7.

Basic Characteristics Table 4 shows the one operation possible. A record component is referenced using the component name. persistent or constant declared as an array can be referenced to the whole array or a single element. the Y component only the whole position RAPID Overview 4-31 . VAR num column{3}..4 Using data in expressions An entire variable. 2 or 3) of the array. VAR pos pos1. VAR num value. Index value 1 selects the first element. Example: Arrays A variable. persistent or constant declared as a record can be referenced to the whole record or a single component. persistent or constant can be a part of an expression. The number of elements in the index list must fit the declared degree (1. . . 2*pi*radius only one element in the array all elements in the array Records A variable. Example: VAR num row{3}. yvalue := home.y. Expressions Table 4 Operator + Operation string concatenation Operand types string + string Result type string 7. Example: VAR pos home. The index is an integer value greater than 0 and may not violate the declared dimension. VAR num yvalue. An array element is referenced using the index number of the element. value := column{3}. . pos1 := home. row := column.

7. -100. and one switch one required argument . it may not include any argument expression. 0. [0. 0. IF [1. two or more optional arguments may be declared to exclude each other.b.5 Using aggregates in expressions An aggregate is used for record or array values..determined by p1 illegal since the data type of neither of the aggregates can be determined by the context.0.937.. in which case.785398\Rad) Dist(p2) Dist(\distance:=pos1. Example: Cosine(45) Cosine(0.”. Instead.937. The data type of each aggregate member must be equal to the type of the corresponding member of the determined type. In addition.785398).. Example: Polar(3. and one optional 4-32 RAPID Overview . pos array aggregate It must be possible to determine the data type of an aggregate the context. 2*x].. pos record aggregate posarr := [[0.b.6 Using function calls in expressions A function call initiates the evaluation of a specific function and receives the value returned by the function. Example: Sin(angle) The arguments of a function call are used to transfer data to (and possibly from) the called function. A switch type argument is somewhat special. y. only one of them may be present in the argument list. A required (compulsory) argument is separated from the preceding argument by a comma “.785398) two required arguments Polar(Dist:=3.] THEN aggregate type pos . 12]. using names An optional argument must be preceded by a backslash “\” and the formal parameter name. Example: pos := [x.z]].. Optional arguments may be omitted but the order of the (present) arguments must be the same as the order of the formal parameters. p1 :=[1.. p2) one required argument . -100.Expressions Basic Characteristics 7. The data type of an argument must be equal to the type of the corresponding parameter of the function. 100]. The formal parameter name may be included or omitted. such an argument can only be either "present" or "not present". Angle:=0. 12] = [a. Example VAR pos pl.

The called function views the parameter as a constant.. The access mode can be either in. array element or record component). .7 Priority between operators The relative priority of the operators determines the order in which they are evaluated. . The rules below imply the following operator priority: * / DIV MOD +< > <> <= >= = AND XOR OR NOT . Example: PROC Read_from_file (iodev File \num Maxtime) . time is only used if specified when calling the routine ! Read_from_file . var or pers: . array element or record component) or an entire persistent.. ! Max. . A conditional argument is considered to be “present” if the specified optional parameter (of the calling function) is present.An INOUT parameter requires the corresponding argument to be a variable (entire. Note that the specified parameter must be optional. otherwise it is simply considered to be omitted. The called function gains full (read/update) access to the argument.lowest An operator with high priority is evaluated prior to an operator with low priority. ENDPROC The parameter list of a function assigns an access mode to each parameter.highest . The called function gains full (read/write) access to the argument. RAPID Overview 4-33 . The called function gains full (read/write) access to the argument. 7.A PERS parameter requires the corresponding argument to be an entire persistent. character:=ReadBin (File \Time?Maxtime). inout. Operators of the same priority are evaluated from left to right. Parentheses provide a means to override operator priority.A VAR parameter requires the corresponding argument to be a variable (entire.An IN parameter (default) allows the argument to be any expression.Basic Characteristics Expressions Conditional arguments are used to support smooth propagation of optional arguments through chains of routine calls.

8 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> 4-34 RAPID Overview .Expressions Example Expression a+b+c a+b*c a OR b OR c a AND b OR c AND d a < b AND c < d Evaluation order Basic Characteristics Comment left to right rule * higher than + Left to right rule AND higher than OR < higher than AND (a + b) + c a + (b * c) (a OR b) OR c (a AND b) OR (c AND d) (a < b) AND (c < d) 7.

’ <expr> } <variable component> ::= <variable> ’.’ <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> RAPID Overview 4-35 .Basic Characteristics Data <variable> ::= <entire variable> | <variable element> | <variable component> <entire variable> ::= <ident> <variable element> ::= <entire variable> ’{’ <index list> ’}’ <index list> ::= <expr> { ’.’ <optional function argument> | <conditional function argument> | ’.’ <required function argument> | <optional function argument> | ’.’ <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 Expressions <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> ::= ’.

Expressions <conditional expression> ::= <expression> Parameters <parameter> ::= <entire parameter> | <parameter element> | <parameter component> Basic Characteristics 4-36 RAPID Overview .

after that execution will stop. and the scope of any routine data also comprises the error handler of the routine. The occurrence of an error causes suspension of the normal program execution and the control is passed to an error handler. If this instruction causes the same error again. starting with the instruction in which the error occurred. ERROR IF ERRNO = ERR_DIVZERO THEN TPWrite "The number cannot be equal to 0". control is transferred to its error handler. Example: FUNC num safediv( num x. This is done using the RETRY instruction. Errors are identified by their unique error number and are always recognized by the robot. the RETURN instruction must specify an appropriate return value. If the routine is a function. the error handler can: . the system error handler is called. 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. . If further execution is not possible.1 Error handlers Any routine may include an error handler. RETURN x. related to the execution of a specific piece of a program. the error handler can at least assure that the program is given a graceful abortion.Resume execution. After any necessary actions have been taken. . When an error occurs in a routine that does not contain an error handler or when the end of the error handler is reached (ENDFUNC. The concept of error handlers makes it possible to respond to and. num y) RETURN x / y. If an error occurs during the execution of the routine. up to four error recoveries will take place. An error makes further execution impossible (or at least hazardous). The system error handler just reports the error and stops the execution.Return control to the caller of the routine using the RETURN instruction. “Overflow” and “division by zero” are examples of errors. starting with the instruction following the instruction in which the error occurred. 8. The error handler is really a part of the routine. possibly. recover from errors that arise during program execution. RAPID Overview 4-37 . This is done using the TRYNEXT instruction. .Propagate the error to the caller of the routine using the RAISE instruction. ENDPROC or ENDTRAP).Resume execution.Basic Characteristics Error Recovery 8 Error Recovery An execution error is an abnormal situation.

any propagation of an error from a trap routine is made to the system error handler. It can. for example. This facility can be used to recover from complex situations. Explicitly-raised errors are treated exactly like errors raised by the system. Since a trap routine can only be called by the system (as a response to an interrupt). In addition to errors detected and raised by the robot. Note that it is not possible to recover from or respond to errors that occur within an error clause. the same error is raised again at the point of the call of the routine .Error Recovery Basic Characteristics In a chain of routine calls. The system error handler just reports the error and stops the execution. be used to escape from deeply-nested code positions. Error recovery is not available for instructions in the backward handler.the error is propagated. each routine may have its own error handler. Such errors are always propagated to the system error handler. and the error is explicitly propagated using the RAISE instruction. the system error handler is called. Error numbers 1-90 may be used in the raise instruction. a program can explicitly raise errors using the RAISE instruction. When the top of the call chain (the entry routine of the task) is reached without any error handler being found or when the end of any error handler is reached within the call chain. 4-38 RAPID Overview . If an error occurs in a routine with an error handler. Such errors are always propagated to the system error handler.

The raising of interrupts may be disabled and enabled. any generated interrupts of the specified type are thrown away without any trap execution. When running stepwise and when the program has been stopped. The definition specifies the interrupt condition and activates and enables the interrupt. deactivate activate RAPID Overview 4-39 . During the deactivation time. e.g. depending on what type of movement is being performed at the time of the interrupt. An activated interrupt may in turn be deactivated (and vice versa). Interrupts are always disabled during the execution of a trap routine.when the next instruction is entered.g. identified by interrupt numbers. . Example: ISleep sig1int. An interrupt occurs when an interrupt condition is true. namely: . any interrupt that occurs is queued and not raised until interrupts are enabled again. . its response – calling the corresponding trap routine – can only take place at specific program positions. If interrupts are disabled. WaitUntil. high.any time during the execution of a movement instruction. Interrupts that are generated under these circumstances are not dealt with. The total limitation set by the I/O CPU is 100 interrupts.any time during the execution of a waiting instruction. MoveL. ISignalDI di1. IWatch sig1int. Example: VAR intnum sig1int.1 Interrupt manipulation Defining an interrupt makes it known to the robot. e. Even though the robot immediately recognizes the occurrence of an interrupt (only delayed by the speed of the hardware). sig1int. . Note that the interrupt queue may contain more than one waiting interrupt. The occurrence of an interrupt causes suspension of the normal program execution and control is passed to a trap routine. 9. . Queued interrupts are raised in FIFO order.Basic Characteristics Interrupts 9 Interrupts Interrupts are program-defined events. The maximum number of defined interrupts at any one time is limited to 70 per program task. This normally results in a delay of 5-120 ms between interrupt recognition and response. no interrupts will be handled. Unlike errors. the occurrence of an interrupt is not directly related to (synchronous with) a specific code position.

a trap routine can be terminated using the RETURN instruction or when the end (ENDTRAP or ERROR) of the trap routine is reached. After the necessary action has been taken. . 9. If an interrupt occurs. Example: VAR intnum empty. VAR intnum full. but a new interrupt cannot be defined to an interrupt variable until the previous definition has been deleted. that does not have any connected trap routine. CONNECT full WITH ftrap. high.e. ENDTRAP TRAP ftrap close_valve. . ENDPROC TRAP etrap open_valve. During the disable time. causes immediate termination of program execution. control is immediately transferred to the associated trap routine (if any). RETURN.2 Trap routines Trap routines provide a means of dealing with interrupts. IEnable sig1int. IDelete empty. Example: IDisable sig1int. high. 4-40 RAPID Overview . RETURN. When an interrupt occurs.Interrupts Basic Characteristics An enabled interrupt may in turn be disabled (and vice versa). empty. It is not necessary to explicitly remove an interrupt definition. ISignalDI di1. ENDTRAP connect trap routines define feeder interrupts responds to “feeder empty” interrupt responds to “feeder full” interrupt Several interrupts may be connected to the same trap routine. this is treated as a fatal error. The system variable INTNO contains the interrupt number and can be used by a trap routine to identify an interrupt. ISignalDI di3. Example: IDelete sig1int. Execution continues from the place where the interrupt occurred. IDelete full. i. A trap routine can be connected to a particular interrupt using the CONNECT instruction. disable enable Deleting an interrupt removes its definition. any generated interrupts of the specified type are queued and raised first when the interrupts are enabled again. .PROC main() CONNECT empty WITH etrap. full.

z10. MoveTo. FOR.z10. MoveL p1.v500. MoveL p1.Basic Characteristics Backward execution 10 Backward execution A program can be executed backwards one instruction at a time.z10. ENDPROC When the procedure is called during forward execution.z10.tool1.1 Backward handlers Procedures may contain a backward handler that defines the backward execution of a procedure call. 10.tool1.p3.The instructions IF.tool1. the following occurs: PROC MoveTo () MoveL p1.v500. MoveC p2.It is not possible to step backwards out of a routine when reaching the beginning of the routine. ENDPROC .v500.tool1.z10.p3.tool1. .z10. Example: PROC MoveTo () MoveL p1. MoveC p2.v500.tool1.v500.v500. BACKWARD MoveL p4. WHILE and TEST cannot be executed backwards.z10.v500.v500.z10.tool1.v500.v500..z10.tool1. BACKWARD MoveL p4.z10.v500.p3. MoveL p4. 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.p3.tool1. MoveC p2. MoveL p4. MoveC p2.z10. . The following general restrictions are valid for backward execution: .tool1. RAPID Overview 4-41 .z10.tool1.v500.tool1..

for some part of the backward path.. 10.v500.p3.Backward execution Basic Characteristics When the procedure is called during backwards execution. ENDPROC Instructions in the backward or error handler of a routine may not be executed backwards.tool1. MoveL p1.tool1.2 Limitation of move instructions in the backward handler The move instruction type and sequence in the backward handler must be a mirror of the move instruction type and sequence for forward execution in the same routine: PROC MoveTo () MoveL p1.tool1. By move instructions is meant all instructions that result in some movement of the robot or external axes such as MoveL.v500. Any departures from this programming limitation in the backward handler can result in faulty backward movement..z10.z10. SearchC. BACKWARD MoveL p4.p3. . A procedure with an empty backward handler is executed as “no operation”.z10.p3.tool1. Linear movement can result in circular movement and vice versa.v500. MoveC p2.v500. ArcC. A procedure with no backward handler cannot be executed backwards. MoveL p1.v500.z10.v500..v500.z10. PaintL . PROC MoveTo () MoveL p1. MoveC p2. MoveC p2.tool1.z10.tool1. i.p3.v500.v500.z10.z10. ENDPROC Mirror plane Note that the order of CirPoint p2 and ToPoint p3 in the MoveC should be the same. 4-42 RAPID Overview .tool1.v500.z10.tool1. two instructions in a call chain may not simultaneously be executed backwards.. MoveL p4.tool1. MoveC p2.tool1.z10.z10.v500.z10.e.v500. BACKWARD MoveL p4. the following occurs: . MoveTo. TriggJ. Backward execution cannot be nested. MoveL p4.tool1.tool1.

RAPID Overview 4-43 . A persistent with the same name and type is reachable in all tasks. .When running a Wait instruction in manual mode. so why are the programs not in parallel? Multitasking RAPID is a way to execute programs in (pseudo) parallel with the normal execution.. Up to 10 different tasks can be run in pseudo parallel. but persistents are not. A task has its own trap handling and the event routines are triggered only on its own task system states (e. that is if the operator chooses to save or open a program. The response time is the same as the interrupt response time for one task. . unless an error occurs in that program. For all settings. To use this function the robot must be configured with one extra TASK for each background program.The Teach Pendent cannot access other tasks than the main task. the development of RAPID programs for other tasks can only be done if the code is loaded into the main task. . There are a few restrictions on the use of Multitasking RAPID. .Basic Characteristics Multitasking 11 Multitasking The events in a robot cell are often in parallel.).There is only one physical Teach Pendent. see User’s Guide . see User’s guide . This is true.. Variables and constants are local in each task. All the modules are local in each task..The execution of a task will halt during the time that some other tasks are accessing the file system. in the same way as the normal program. So.System parameters. Start/Stop/Restart.g. If two persistents have the same name.System parameters). when the task is not in the background of another busy program . so be careful that a TPWrite request is not mixed in the Operator Window for all tasks. or if the program in a task uses the load/erase/read/write instructions. a runtime error will occur.Move instructions can only be executed in the main task (the task bind to program instance 0. Each task consists of a set of modules. One parallel program can be placed in the background or foreground of another program. or off-line.Do not mix up parallel programs with a PLC. This will only occur in the main task. a simulation box will come up after 3 seconds. but their type or size (array dimension) differ. . It can also be on the same level as another program. The execution is started at power on and will continue for ever. of course.

PROC main() startsync:= TRUE. Do not poll more frequently in other implementations. Synchronising using polling This is the easiest way to do it. In such cases. but the performance will be the slowest. But there are other applications which need to know what the main task is doing. no synchronisation mechanism is necessary. for example. IF. . quite independently of the other tasks being executed. Example TASK 0 MODULE module1 PERS bool startsync:=FALSE.Multitasking Basic Characteristics 11. it will poll internally every 100 ms. ENDPROC ENDMODULE TASK 1 MODULE module2 PERS bool startsync:=FALSE. WHILE or GOTO. PROC main() WaitUntil startsync. Persistents are then used together with the instructions WaitUntil. ENDPROC ENDMODULE 4-44 RAPID Overview . .1 Synchronising the tasks In many applications a parallel task only supervises some cell unit. If the instruction WaitUntil is used.

1. All declarations must specify an init value to the persistent variable.Basic Characteristics Synchronising using an interrupt The instruction SetDO and ISignalDO are used. . isiint1. Example TASK 0 MODULE module1 PROC main() SetDO do1. RAPID Overview 4-45 . ENDTRAP ENDMODULE Multitasking 11. Otherwise a runtime error will occur. ENDWHILE IDelete isiint1. ENDPROC ENDMODULE TASK 1 MODULE module2 VAR intnum isiint1. The persistent variable must be of the same type and size (array dimension) in all tasks that declared it. WHILE TRUE DO WaitTime 200. ENDPROC TRAP isi_trap .2 Intertask communication All types of data can be sent between two (or more) tasks with persistent variables. PROC main() CONNECT isiint1 WITH isi_trap. A persistent variable is global in all tasks. 1. but only the first module loaded with the declaration will use it. ISignalDO do1.

it will be restarted from the beginning each time the power is turned on. controlling the robot movement).3 Type of task Each extra task (not 0) is started in the system start sequence. !read string IF stringtosend = “this is a test” THEN ENDPROC ENDMODULE Basic Characteristics 11. PERS string stringtosend:=””. 4-46 RAPID Overview .Multitasking Example TASK 0 MODULE module1 PERS bool startsync:=FALSE. but if the type is set to SEMISTATIC. startsync:= TRUE ENDPROC ENDMODULE TASK 1 MODULE module2 PERS bool startsync:=FALSE. PROC main() WaitUntil startsync. PERS string stringtosend:=””. A SEMISTATIC task will also int the restart sequence reload modules specified in the system parameters if the module file is newer that the loaded module. The teach pendent can only be used to start task 0. It is also possible to set the task to type NORMAL. PROC main() stringtosend:=”this is a test”. then it will behave in the same was as task 0 (the main task. so the only way to start other NORMAL tasks is to use CommunicationWare. If the task is of type STATIC. it will be restarted at the current position (where PP was when the system was powered off).

8 and 9 are idle. 4 and 5 are busy tasks 0. 2. 4.Basic Characteristics Multitasking 11. and 8 are busy tasks 0. tasks 6 and 7 are busy tasks 0. 4. 3. RAPID Overview 4-47 . The example below describes some situations where the system has 10 tasks (see Figure 5) Round robbin chain 1: Round robbin chain 2: Round robbin chain 3: Round robbin chain 4: tasks 0. 5 and 8 are busy tasks 1 and 2 are idle tasks 2. or has stopped the execution (idle).4 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). 1. 1. 5. Then the background will only execute when the foreground is waiting for some events. A robot program with move instructions will be in an idle state most of the time. 8 and 9 are idle chain 1 task 0 chain 2 task 1 task 2 task 3 task 4 task 5 task 6 task 7 chain 4 chain 3 task 8 task 9 Figure 5 The tasks can have different priorities. 3. But it is possible to change the priority of one task by putting the task in the background of another. 1.

SysStop . and not affect the memory area above. 11. And if the supervision task is in foreground.This is the default behaivour. See System parameters . That area is shared by all tasks. but it is restartable. NoSafety . and the system is set to state SYS_FAIL. See System parameters . This should be used when the task has some security supervisions.Only the actual task itself will stop. it will never allow another task in background to execute.Multitasking Basic Characteristics 11. When taking up the system to “motors on” it is possible to jogg the robot. The system is forced to “motors off”.6 Task sizes The system will supply a memory area with an installation depending on size.All NORMAL tasks will be stopped (normaly only the main task).AveragePers. Jogging is also possible.All NORMAL tasks will be stopped (eg the main task).5 Trust Level TrustLevel handel the system behavior when a SEMISTATIC or STATIC task is stopped for some reason or not executable. all other NORMAL tasks (eg the MAIN task) will also stop. All jogg and program start orders will be rejected. Only a new warm start reset the system. you must think about the following: . SysFail . Otherwise the teach pendent will never get any time to interact with the user. The value of a persistent variable will be stored in a separate part of the system. A new warm start will reset the system.Controller/Task 11. but a new attempt to start the program will be rejected. 4-48 RAPID Overview . SysHalt .Always use the interrupt mechanism or loops with delays in supervision tasks.7 Something to think about When you specify task priorities.

until the functionallity is satified. 3. Note: this could only be done in motors on state. Iteration phase In many cases an iteration with point 3 and 5 is enough. Test and debug the modules in the MAIN task. Finish phase 1. If all point below is used it will take care of that for you. Note: Don’t save the task. change and save the module(s). Restart the system. 5. save each module according to the system parameters. 4. 2. 6.Basic Characteristics Multitasking 11. It’s only when the program has to be tested in the MAIN task and execution of the RAPID code in two task at the same time could confuse the user. Create the modules that should be in the task from the TeachPendant (in the MAIN task) or off-line. 2. Specify all modules that should be preloaded to this new task. Change back the task type to SEMISTATIC (or STATIC). Restart the system RAPID Overview 4-49 . Change the task type to NORMAL to inhibit the task. 4. Define the new task under system parameters (controller/task) Set the type to NORMAL and the TrustLevel to NoSafety. 5. also under system parameters (controller/task-modules). Restart the system. Load the moulde(s) to the MAIN task.8 Programming scheme The first time 1. Change the task type to SEMISTATIC (or STATIC). Restart the system. all point should be used. Note: if a STATIC task is used it has to be forced to reload the new changed module and restarted from the beginning. A NORMAL task will not start when the system restart and if it’s not the MAIN task not it will be affected by the start button at the teach pendant. Set the TrustLevel to desired level eg SysFail 2. 1. test. 3.

Multitasking Basic Characteristics 4-50 RAPID Overview .

2 Coordinate systems used to determine the position of the TCP The tool (TCP’s) position can be specified in different coordinate systems to facilitate programming and readjustment of programs. here the z-axis is coincident with axis 1 of the robot (see Figure 1).1 The robot’s tool centre point (TCP) The position of the robot and its movements are always related to the tool centre point. RAPID Overview 5-1 . the robot’s positions are defined in the base coordinate system. it is the position of the TCP that is recorded. 1. Z Y X Figure 1 The base coordinate system. When a position is recorded. a stationary TCP is used.g. e. programming can be done in the base coordinate system. When no coordinate system is defined. If that tool is active. The coordinate system defined depends on what the robot has to do.Motion and I/O Principles Coordinate Systems 1 Coordinate Systems 1. the programmed path and speed are related to the work object. at a given velocity. in the muzzle of a glue gun.1 Base coordinate system In a simple application. This point is normally defined as being somewhere on the tool. 1. If the robot is holding a work object and working on a stationary tool. at the centre of a gripper or at the end of a grading tool. but only one may be active at any one time. See Stationary TCPs on page 8. Several TCPs (tools) may be defined.2. This is also the point that moves along a given path.

.The origin is situated at the intersection of axis 1 and the base mounting surface.The x-axis points forwards. Base coordinate system robot 2 X Y Z Z Y X Base coordinate system robot 1 z y World coordinate system x Figure 2 Two robots (one of which is suspended) with a common world coordinate system.The y-axis points to the left (from the perspective of the robot). if it is not specifically defined. It can also be advantageous to use this type of system when the positions are to be related to a fixed point in the workshop.2.The z-axis points upwards. programming in the base coordinate system is more difficult because the directions of the axes are not the same as the principal directions in the working space. . several robots work within the same working space at a plant. See the example in Figure 2. it is useful to define a world coordinate system. 1. . 5-2 RAPID Overview . the robot is mounted upside down (suspended). programming in the base coordinate system is easy. however. The world coordinate system will be coincident with the base coordinate system. In such cases. Sometimes. A common world coordinate system is used in this case to enable the robot programs to communicate with one another. .2 World coordinate system If the robot is floor-mounted.Coordinate Systems Motion and I/O Principles The base coordinate system is located on the base of the robot: .The xy plane is the same as the base mounting surface. If.

however. A fixture. you will not need to reprogram if a fixture must be moved or turned.Motion and I/O Principles Coordinate Systems 1. Z User coordinate system 1 Y X Z User coordinate system 2 Y X Z Y X Base coordinate system z y World coordinate system x Figure 3 Two user coordinate systems describe the position of two different fixtures.2.4 Object coordinate system The user coordinate system is used to get different coordinate systems for different fixtures or working surfaces.3 User coordinate system A robot can work with different fixtures or working surfaces having different positions and orientations. 1. A user coordinate system can be defined for each fixture. may include several work objects that are to be processed or handled by the robot. RAPID Overview 5-3 . The object coordinate system can also be used when jogging the robot. This coordinate system is also very suited to off-line programming since the positions specified can usually be taken directly from a drawing of the work object. all programmed positions will follow the fixture and no reprogramming will be required. the same as the previous one.2. The user coordinate system is defined based on the world coordinate system (see Figure 3). it often helps to define a coordinate system for each object in order to make it easier to adjust the program if the object is moved or if a new object. is to be programmed at a different location. Thus. If all positions are stored in object coordinates. A coordinate system referenced to an object is called an object coordinate system. By moving/turning the user coordinate system as much as the fixture has been moved/turned.

a coordinate system. If the work object is moved/turned. If a fixture is moved/turned. The displacement coordinate system is defined based on the object coordinate system (see Figure 5). 5-4 RAPID Overview . To avoid having to re-program all positions each time. coordinated external axes are used.Coordinate Systems Motion and I/O Principles The object coordinate system is defined based on the user coordinate system (see Figure 4). The programmed positions are always defined relative to an object coordinate system. to compensate for differences in the positions of the individual parts. the same path is to be performed at several places on the same object. then the object coordinate system moves with the user coordinate system. is defined. If the user coordinate system is movable. Neither the programmed positions nor the defined object coordinate systems need to be changed. This coordinate system can also be used in conjunction with searches.2. this can be compensated for by moving/turning the object coordinate system. z z User coordinate system z Object coordinate system 1 y y x y x Object coordinate system 2 x z y World coordinate system x Figure 4 Two object coordinate systems describe the position of two different work objects located in the same fixture. that is. this can be compensated for by moving/turning the user coordinate system.5 Displacement coordinate system Sometimes. This makes it possible to move the robot in relation to the object even when the workbench is being manipulated. known as the displacement coordinate system. 1.

6 Coordinated external axes Coordination of user coordinate system If a work object is placed on an external mechanical unit. The programmed path and speed will thus be related to the work object (see Figure 6) and there is no need to consider the fact that the object is moved by the external unit. 1. in this case. The position and orientation of the user coordinate system will. RAPID Overview 5-5 . be dependent on the axes rotations of the external unit.2. z User coordinate system y x joint 2 joint 3 joint 1 z y World coordinate system x Figure 6 A user coordinate system. that is moved whilst the robot is executing a path defined in the object coordinate system.Motion and I/O Principles Coordinate Systems y y Original position New position x Displacement coordinate system x Object coordinate system Figure 5 If program displacement is active. all positions are displaced. a movable user coordinate system can be defined. defined to follow the movements of a 3-axis external mechanical unit.

be dependent on the movements of the external unit. To be able to calculate the user and the base coordinate systems when involved units are moved. The programmed path and speed will be related to the object coordinate system (Figure 7) and there is no need to think about the fact that the robot base is moved by an external unit. 1.Coordinate Systems Coordination of base coordinate system Motion and I/O Principles A movable coordinate system can also be defined for the base of the robot. A coordinated user coordinate system and a coordinated base coordinate system can both be defined at the same time. as for the moveable user coordinate system. the robot must be aware of: . User coordinate system Object coordinate system World coordinate system Track Base coordinate system Figure 7 Coordinated interpolation with a track moving the base coordinate system of the robot.The calibration positions of the user and the base coordinate systems . The position and orientation of the base coordinate system will. The tool coordinate system is referenced to the wrist coordinated system. defined at the mounting flange on the wrist of the robot. for example. This is of interest for the installation when the robot is mounted on a track or a gantry. 5-6 RAPID Overview . These relations are defined in the system parameters.3 Coordinate systems used to determine the direction of the tool The orientation of a tool at a programmed position is given by the orientation of the tool coordinate system.The relations between the angles of the external axes and the translation/rotation of the user and the base coordinate systems.

The x-axis points in the opposite direction.1 Wrist coordinate system In a simple application. here the z-axis is coincident with axis 6 of the robot (see Figure 8). at right angles to the mounting flange.3. 1. . . The TCP (origin) is selected as the point on the tool that must be correctly positioned. the muzzle on a glue gun.3.Motion and I/O Principles Coordinate Systems 1.The origin is situated at the centre of the mounting flange (on the mounting surface). The tool coordinate system can also be used to get appropriate motion directions when jogging the robot. RAPID Overview 5-7 . the wrist coordinate system can be used to define the orientation of the tool. towards the control hole of the mounting flange. which is the origin of the tool coordinate system. all you have to do is redefine the tool coordinate system. The program does not normally have to be changed. y x Figure 8 The wrist coordinate system. e. z The wrist coordinate system cannot be changed and is always the same as the mounting flange of the robot in the following respects: .The z-axis points outwards.g. The tool coordinate axes are defined as those natural for the tool in question.2 Tool coordinate system The tool mounted on the mounting flange of the robot often requires its own coordinate system to enable definition of its TCP. If a tool is damaged or replaced.

This means that the coordinate systems will be reversed. The tool coordinate system is defined based on the wrist coordinate system (see Figure 10). y Tool coordinate system x z Figure 10 The tool coordinate system is defined relative to the wrist coordinate system.Coordinate Systems Motion and I/O Principles x x Top Top z z Figure 9 Tool coordinate system. here for a gripper. If that tool is active.3. as usually defined for an arc-welding gun (left) and a spot welding gun (right). as in Figure 11. the programmed path and speed are related to the work object held by the robot. 1. 5-8 RAPID Overview .3 Stationary TCPs If the robot is holding a work object and working on a stationary tool. a stationary TCP is used.

z y z Object coordinate system z y z User coordinate system x y Displacement coordinate system x y Wrist coordinate system x x Figure 12 Program displacement can also be used together with stationary TCPs. neither the user coordinate system nor program displacement is used. if they are used. RAPID Overview 5-9 . In the example in Figure 11. It is.Motion and I/O Principles Coordinate Systems Z Object coordinate system X Y Z Y X Tool coordinate system Z Y X Base coordinate system z y World coordinate system x Figure 11 If a stationary TCP is used. they will be related to each other as shown in Figure 12. the object coordinate system is usually based on the wrist coordinate system. however. possible to use them and.

Calibration Data Types .4 Related information Described in: Definition of the world coordinate system Definition of the user coordinate system Definition of the object coordinate system Definition of the tool coordinate system Definition of a tool centre point Definition of displacement frame Jogging in different coordinate systems User’s Guide .Calibration Data Types .Calibration RAPID Summary .System Parameters User’s Guide .Coordinate Systems Motion and I/O Principles 1.tooldata User’s Guide .Calibration Data Types .Calibration Data Types .wobjdata User’s Guide .Motion Settings User’s Guide .tooldata User’s Guide .Jogging 5-10 RAPID Overview .wobjdata User’s Guide .

joint interpolation.2 Interpolation of the position and orientation of the tool 2. in a single movement. linear interpolation or circle interpolation. .The zone data (defines how the robot and the external axes are to pass the destination point).The destination point of the movement (defined as the position of the tool centre point.1 General During program execution. positioning instructions in the robot program control all movements.Motion and I/O Principles Positioning during Program Execution 2 Positioning during Program Execution 2. the configuration of the robot and the position of the external axes).g. . the drive system supervision may trip out and stop the robot in order to prevent overheating of drives or motors. In material handling and pallet applications with intensive and frequent movements. RAPID Overview 5-11 . As an alternative to defining the velocity of the robot and the external axes. .2. this type of motion is used to move the tool quickly from one position to another. be avoided if the weaving function is used. the cycle time needs to be slightly increased by reducing programmed speed or acceleration. Joint interpolation also allows an axis to move from any location to another within its working space. If this occurs. the orientation of the tool. however.The coordinate systems (tool. All axes move from the start point to the destination point at constant axis velocity (see Figure 13).The interpolation method used to reach the destination point. . Instead the velocities of the orientation and external axes should be used to limit the speed. e. user and object) used for the movement. This should. 2. when small or no TCP-movements are made. the time for the movement can be programmed.1 Joint interpolation When path accuracy is not too important.The velocity of the robot and external axes. The main task of the positioning instructions is to provide the following information on how to perform movements: .

The velocity of the tool centre point is expressed in mm/s (in the object coordinate system).g. the velocity will not be exactly the programmed value. the TCP travels along a straight line between the start and destination points (see Figure 14). one or more of the axes will require more torque than the motors can give. During interpolation. the velocity of all axes will automatically be reduced. If the configuration is extremely non-linear (e. the velocities of the remaining axes are calculated so that all axes reach the destination point at the same time. the axis that travels fastest relative to its maximum velocity in order to carry out the movement. As interpolation takes place axis-by-axis. If the tool is reorientated. the more accelerations and decelerations are required to make the tool move in a straight line and to obtain the desired tool orientation. the robot axes must follow a non-linear path in the axis space.e.2. In this case. e Start point Figure 14 Linear interpolation without reorientation of the tool. i. Destination point To obtain a linear path in the object coordinate system.2 Linear interpolation During linear interpolation. All axes are coordinated in order to obtain a path that is independent of the velocity. Acceleration is automatically optimised to the max performance of the robot.Positioning during Program Execution Motion and I/O Principles Destination point Start point Joint interpolated path Figure 13 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). in the proximity of wrist and arm singularities). it is rotated at constant velocity. The orientation of the tool remains constant during the entire movement unless a reorientation has been programmed. The more non-linear the configuration of the robot is. is determined. RAPID Overview 5-12 . 2. Then. the velocity of the limiting axis.

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. reorientation will be smooth.2.Motion and I/O Principles Positioning during Program Execution A maximum rotational velocity (in degrees per second) can be specified when rotating the tool. Acceleration is optimised automatically. the defined velocity will be maintained. If the programmed orientation is the same relative to the circle at the start and the destination points. The first point to be programmed is the start of the circle segment. the orientation of the tool will remain constant relative to the path. The next point is a support point (circle point) used to define the curvature of the circle. one of the motors exceeds the current limit. Circle point Destination point Start point Figure 15 Circular interpolation with a short twist for part of a circle (circle segment) with a start point. The three programmed points should be dispersed at regular intervals along the arc of the circle to make this as accurate as possible. on the other hand. 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. As long as no motor exceeds the limit for the torque. If. However. circle point and destination point. the alternative twist is selected (see Figure 16). the reorientation velocity is only limited by the maximum motor speeds. RAPID Overview 5-13 . if the orientation at the support point is programmed closer to the orientation rotated 180°. and the orientation at the support is close to the same orientation relative to the circle. 2.3 Circular interpolation A circular path is defined using three programmed positions that define a circle segment. If this is set to a low value. If it is a high value. irrespective of the velocity defined for the tool centre point. and the third point denotes the end of the circle (see Figure 15).

with the TCP following a linear or circular path. the tool will not have a constant direction relative to the circle plane as for normal circular interpolation. positions can be passed at high speed without having to reduce the speed unnecessarily. All axes are coordinated in order to obtain a path that is independent of the velocity.4 SingArea\Wrist During execution in the proximity of a singular point.3 Interpolation of corner paths The destination point is defined as a stop point in order to get point-to-point movement. it is best to use modified interpolation. 2.2. linear or circular interpolation may be problematic. the tool will move at the programmed velocity along the arc of the circle. 2. In this case. the orientation in the programmed positions sometimes must be modified to avoid big wrist movements. In this way. which means that the wrist axes are interpolated axis-by-axis. however. Fly-by points are used to get continuous movements past programmed positions. In the SingArea\Wrist case the orientation in the circle support point will be the same as programmed. If the torque of any of the motors is insufficient. A fly-by point generates a corner path (parabola path) past the programmed 5-14 RAPID Overview . will differ somewhat from the programmed orientation. which can occur if a complete wrist reconfiguration is generated when the circle is executed (joints 4 and 6 moved 180 degrees each). This means that the robot and any external axes will stop and that it will not be possible to continue positioning until the velocities of all axes are zero and the axes are close to their destinations. The orientation of the tool. the velocity will automatically be reduced at those parts of the circular path where the motor performance is insufficient. However. Acceleration is optimised automatically. As long as all motor torques do not exceed the maximum permitted values.Positioning during Program Execution Motion and I/O Principles Circle point Destination point Start point Figure 16 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. If the circle path passes a singularity.

RAPID Overview 5-15 . which generally means that the programmed position is never reached. the transition from one speed to the other will be smooth and take place within the corner path without affecting the actual path. a corner path is generated in order to pass a fly-by point. 10%). The beginning and end of this corner path are defined by a zone around the programmed position (see Figure 17).3. This calculation has an error factor (normally max. 2. the size of the zones (in mm) must be recalculated in axis angles (radians). which means that the true zone will deviate somewhat from the one programmed. All axes are coordinated in order to obtain a path that is independent of the velocity. The zone for the path of the TCP Programmed position Corner path Figure 17 A fly-by point generates a corner path to pass the programmed position. Programmed fly-by point Zone Start point Corner path Destination point Figure 18 During joint interpolation.Motion and I/O Principles Positioning during Program Execution position.1 Joint interpolation in corner paths The size of the corner paths (zones) for the TCP movement is expressed in mm (see Figure 18). If different speeds have been programmed before or after the position. Acceleration is optimised automatically. Since the interpolation is performed axis-by-axis.

If different speeds have been programmed before or after the corner position. gluing or water cutting) along the corner path. The tool will be reorientated so that the orientation at the end of the zone will be the same as if a stop point had been programmed (see Figure 20a-c). the programmed positions can be placed closer together. making it possible to approximate the desired path using two or more smaller parabolic paths. The orientation zone is usually set larger than the position zone. a corner path is generated in order to pass a fly-by point.2 Linear interpolation of a position in corner paths The size of the corner paths (zones) for the TCP movement is expressed in mm (see Figure 19). If the tool is to carry out a process (such as arc-welding.3 Linear interpolation of the orientation in corner paths Zones can be defined for tool orientations. 2. If the shape of the parabolic corner path does not match the object geometry.3. 5-16 RAPID Overview . Programmed corner position Zone Start point Corner path Destination point Figure 19 During linear interpolation. the reorientation will start interpolating towards the orientation of the next position before the corner path starts.3. In this case. The reorientation will then be smoother and it will probably not be necessary to reduce the velocity to perform the reorientation. just as zones can be defined for tool positions. the transition will be smooth and take place within the corner path without affecting the actual path. the size of the zone can be adjusted to get the desired path. Figure 20a Three positions with different tool orientations are programmed as above.Positioning during Program Execution Motion and I/O Principles 2.

the interpolation of the external axes towards the destination of the next programmed position. the transition from one velocity to the other will take place smoothly within the corner path. Operation zone size Figure 20c If the middle position was a fly-by point. RAPID Overview 5-17 . program execution would look like this. The interpolation method used in the actual corner paths is chosen in such a way as to make the transition from one method to another as smooth as possible.3. will be started before the TCP corner path starts. program execution would look like this. If different reorientation velocities are programmed before and after the fly-by point. If the tool is not moved. If the corner path zones for orientation and position are not the same size. in the same manner as for orientation. In this way. This can be used for smoothing external axes movements in the same way as the orientation zone is used för the smoothing of the wrist movements.5 Corner paths when changing the interpolation method Corner paths are also generated when one interpolation method is exchanged for another.3. If the external axis zone is set to be larger than the TCP zone. 2. The orientation zone for the tool movement is normally expressed in mm. more than one interpolation method may be used in the corner path (see Figure 21).Motion and I/O Principles Positioning during Program Execution Figure 20b If all positions were stop points.4 Interpolation of external axes in corner paths Zones can also be defined for external axes. the size of the zone is expressed in angle of rotation degrees instead of TCP-mm. 2. and if the reorientation velocities limit the movement. you can determine directly where on the path the orientation zone begins and ends.

in order to obtain symmetrical corner paths. no corner zone will be generated.3. 5-18 RAPID Overview . joint interpolation of the corner path is used. The same zone radius is always used for inputs to or outputs from a programmed position. 2. and Sing Area\Wrist interpolation between p3 and p4. or vice versa. Linear interpolation has been programmed between p1 and p2.Positioning during Program Execution Motion and I/O Principles p1 Linear interpolation Joint interpolation Sing Area\Wrist p4 interpolation p2 Sing Area\Wrist interpolation Position zone p3 Orientation zone Figure 21 Interpolation when changing from one interpolation method to another. joint interpolation between p2 and p3. e.g. If the interpolation is changed from a normal TCP-movement to a reorientation without a TCP-movement or vice versa. a new TCP or a new work object. the robot reduces the size of the zone to half the distance from one overlapping programmed position to the other (see Figure 22). 2. This is also applicable when changing from coordinated operation to non-coordinated operation.3.6 Interpolation when changing coordinate system When there is a change of coordinate system in a corner path. The same will be the case if the interpolation is changed to or from an external joint movement without TCPmovement. To get a well-defined path and to achieve optimum velocity at all times.7 Corner paths with overlapping zones If programmed positions are located close to each other. it is not unusual for the programmed zones to overlap.

Motion and I/O Principles Positioning during Program Execution Generated path p4 p2 p1 Programmed position zones Corner zones as calculated by the robot p3 Figure 22 Interpolation with overlapping position zones. As soon as one of these corner path zones overlap. Both position and orientation corner path zones can overlap. thereby generating symmetrical corner paths within the zones. the robot reduces the size of the zones to make them equal to half the distance from p2 to p3. that zone is reduced (see Figure 23). The position zones do not overlap and are consequently not reduced. Programmed orientation zone Generated orientation zone p2 p1 p3 Generated path p4 Position zones Orientation zone Figure 23 Interpolation with overlapping orientation zones. The zones around p2 and p3 are larger than half the distance from p2 to p3. RAPID Overview 5-19 . The orientation zone at p2 is larger than half the distance from p2 to p3 and is thus reduced to half the distance from p2 to p3. the orientation zone at p3 is not reduced either. Thus.

This takes place even if the axis is being moved at the time. and the program must be started from the beginning. 5-20 RAPID Overview . Note that a mechanical unit may not be deactivated when one of its axes is in independent mode. such as when a previous point has been programmed as a fly-by point. For instance. An error message is then displayed. When the program is restarted the independent axis starts automatically.4 Independent axes An independent axis is an axis moving independently of other axes in the robot system.8 Planning time for fly-by points Occasionally. If stop points are a problem then use concurrent program execution. 2. Once the axis is changed back to normal mode it is possible to run it as a normal axis. Four different move instructions specify the movement of the axis. if the next movement is not planned in time.4.1 Program execution An axis is immediately change to independent mode when an Ind_Move instruction is executed.The points are very close together at high speeds. The reset instruction can also set a new reference for the measurement system . If a program execution is stopped when an independent axis is moving.3. The axis then keeps moving at a constant speed (regardless of what the robot does) until a new independent-instruction is executed. 2. or when simultaneous program execution is used. the program cannot be restarted. the IndCMove instruction starts the axis for continuous movement. that axis will stop. IndReset.Positioning during Program Execution Motion and I/O Principles 2. It is possible to change an axis to independent mode and later back to normal mode again.a type of new synchronization of the axis. . programmed fly-by points can give rise to a stop point. This may happen when: . If a new Ind_Move instruction is executed before the last one is finished. A special set of instructions handles the independent axes.A number of logical instructions with long program execution times are programmed between short movements. To change back to normal mode a reset instruction. the new instruction immediately overrides the old one. is used. If a loss of voltage occurs when an axis is in independent mode. No active coordination between independent and other axes in normal mode takes place.

MoveL MoveL 2. the axis does not move and an error message is displayed. in order to leave the independent mode. The movement of the axis will also be stepwise in line with the execution of other instruments. see Figure 25. 2. Independent axis reaches final position IndAMove WaitTime 10 10 s Independent axis speed Normal axis speed Figure 24 Stepwise execution of independent axes. If an attempt is made to execute the axis manually.Motion and I/O Principles Positioning during Program Execution 2.2 Stepwise execution During stepwise execution. After synchronization (updated revolution counter).3 Jogging Axes in independent mode cannot be jogged. Execute an IndReset instruction or move the program pointer to main. By using the IndReset instruction the logical working area can be moved. The logical working range is the range used by RAPID instructions and read in the jogging window. see Figure 24. the physical and logical working range coincide.4. an independent axis is executed only when another instruction is being executed. RAPID Overview 5-21 .4 Working range The physical working range is the total movement of the axis.4.4.

2. 2.4. In independent mode. specified in the configuration file. Low resolution together with stiff tuned controller can result in unacceptable torque. then axis 6 must not be in the independent mode. Check the controller tuning and axis performance close to the working range limit at installation. Note that correction via the production window inhibits TRUE value from the IndSpeed\InSpeed function. the IndReset instruction can also be used for axis 4 on IRB 2400 and 4400 models.6 Robot axes Only robot axis 6 can be used as an independent axis. Note that the IndSpeed\InSpeed function will not be TRUE if the axis speed is reduced.5 Speed and acceleration In manual mode with reduced speed. Also check if the position resolution and path performance are acceptable. execute the same program with axis 6 in normal mode. 5-22 RAPID Overview . Normally the IndReset instruction is used only for this axis. the lowest value of acceleration and deceleration. Modify the points or use SingArea\Wrist or MoveJ instructions. using the instruction IndReset.100%). the speed is reduced to the same level as if the axis was running as non-independent. is used both for acceleration and deceleration. If IndReset is used for robot axis 4. The AccSet instruction does not affect axes in independent mode.4. noise and controller instability. The resolution of positions is decreased when moving away from logical position 0. However. singularity problems may occur because the normal 6-axes coordinate transform function is still used. This value can be reduced by the ramp value in the instruction (1 . If axis 6 is used as an independent axis. If a problem occurs. are active for independent movement. The VelSet instruction and speed correction in percentage via the production window.Positioning during Program Execution Motion and I/O Principles Logical working range after synchronization Logical working range 0 after IndReset 0 0 Physical working range Logical working range Figure 25 The logical working range can be moved.

is defined by a parameter called softness. the position read from teach pendant for axis 6 is compensated with the positions of axis 4 and 5 via the gear coupling.Motion and I/O Principles Positioning during Program Execution The axis 6 is also internally active in the path performance calculation.5 seconds. With ramp = 1.6 Stop and restart A movement can be stopped in three different ways: 1. However. This stop method is. For a stiff stop the robot will stop in a shorter time than for the normal stop. 2. The tuning time can be set from the program with the parameter ramp. for example.5 Soft Servo In some applications there is a need for a servo. the larger the position deviation required to obtain the same force. and in the general case the transition time will be ramp x 0. 2. For a normal stop the robot will stop on the path. 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 . A result of this is that an internal movement of axis 6 can reduce the speed of the other axes in the system. 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.work object). When this is done. a tuning will be made between the different servo modes and between different softness values to achieve smooth transitions. used for search stop when it is important to stop the motion as soon as possible. the transitions will take 0. The higher the softness parameter. The relationship between the position deviation and the force. which acts like a mechanical spring. which makes a restart easy. but the deceleration path will not follow the programmed path. The softness parameter is set in the program and it is possible to change the softness values anywhere in the program. 2. If axis 4 or 5 is out of home position the working range for axis 6 is moved due to the gear coupling. Note that deactivation of soft servo should not be done when there is a force between the robot and the work object. 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.5 in seconds. The independent working range for axis 6 is defined with axis 4 and 5 in home position. RAPID Overview 5-23 . Activation and deactivation of soft servo as well as changing of softness values can be made when the robot is moving.

System parameters CPU Optimization 5-24 RAPID Overview . If the robot has stopped outside the programmed path.zonedata Instructions . all times are counted from the beginning. The path deviation will usually be bigger for a quick-stop than for a stiff stop.Positioning during Program Execution Motion and I/O Principles 3. For a quick-stop the mechanical brakes are used to achieve a deceleration distance.MoveJ Instructions .MoveC Instructions . A restart following a power failure is equivalent to a restart after a quick-stop.7 Related information Described in: Definition of speed Definition of zones (corner paths) Instruction for joint interpolation Instruction for linear interpolation Instruction for circular interpolation Instruction for modified interpolation Singularity Concurrent program execution Data Types .speeddata Data Types . even in cases when the power failure occurred while a logical instruction was running. After a stop (any of the types above) a restart can always be made on the interrupted path. the restart will begin with a return to the position on the path. for example. It should be noted that the robot will always return to the path before the interrupted program operation is restarted. When restarting. where the robot should have stopped. positioning on time or an interruption in the instruction WaitTime.MoveL Instructions .Singularity Motion and I/O PrinciplesSynchronisation with logical instructions User’s Guide . 2. which is as short as specified for safety reasons.SingArea Motion and I/O Principles.

on.e. A logical instruction is any instruction that does not generate a robot movement or an external axis movement. v1000. See Figure 27 and Figure 28.2 Sequential program execution at fly-by points If a positioning instruction has been programmed as a fly-by point. e. SetDO do1. when the programmed position has been attained (see Figure 26). fine.g. logical instructions can also be executed at specific positions or during an ongoing movement. on. z30. v1000. v1000. z30. p1 Execution of SetDO MoveL p1.Motion and I/O Principles Synchronisation with logical instructions 3 Synchronisation with logical instructions Instructions are normally executed sequentially in the program.1 Sequential program execution at stop points If a positioning instruction has been programmed as a stop point. tool1. Execution of SetDO DT p1 MoveL p1. an I/O instruction. Position zone Orientation zone Figure 27 A logical instruction following a fly-by point is executed before reaching the largest zone. tool1. the subsequent instruction is not executed until the robot and the external axes have come to a standstill. Nevertheless. MoveL p2. tool1. the subsequent logical instructions are executed some time before reaching the largest zone (for position. tool1. z30. 3. MoveL p2. i. RAPID Overview 5-25 . SetDO do1. v1000. orientation or external axes). 3. These instructions are then executed in order. Figure 26 A logical instruction after a stop point is not executed until the destination position has been reached.

tool1.The time it takes for the robot to plan the next move: approx. The time at which they are executed (DT) comprises the following time components: . on. Orientation zone Figure 28 A logical instruction following a fly-by point is executed before reaching the largest zone. MoveL p3.3 Concurrent program execution Concurrent program execution can be programmed using the argument \Conc in the positioning instruction. tool1. v1000.0 seconds depending on the velocity and the actual deceleration performance of the robot.1 seconds. .The robot delay (servo lag) in seconds: 0 . z30. v1000.1. v1000. z30. SetDO do1. 3. used when communicating via serial channels). z30. tool1.g. This argument is used to: .Execute one or more logical instructions at the same time as the robot moves in order to reduce the cycle time (e.Synchronisation with logical instructions Motion and I/O Principles Execution of SetDO Position zone DT p2 p1 MoveL p1. 0. MoveL p2. 5-26 RAPID Overview .

See Figure 29. fine. z30. . v1000.Motion and I/O Principles Synchronisation with logical instructions When a positioning instruction with the argument \Conc is executed. the logical instructions are executed at a given time (DT) before reaching the largest zone (for position. MoveL \Conc. tool1. SetDO do1.If the robot is not moving. Execution of SetDO p2 p1 MoveL p1. Figure 29 In the case of concurrent program execution after a stop point. p2.If the previous positioning instruction ends at a fly-by point. on. See Figure 30. v1000. tool1. tool1. v1000. the logical instructions are executed as soon as the current positioning instruction starts (at the same time as the movement). the following logical instructions are also executed (in sequence): . or if the previous positioning instruction ended with a stop point. a positioning instruction and subsequent logical instructions are started at the same time. MoveL p3. z30. orientation or external axes). RAPID Overview 5-27 .

Figure 30 In the case of concurrent program execution after a fly-by point. however. affect the movements ordered by previous positioning instructions.Synchronisation with logical instructions Motion and I/O Principles Execution of SetDO Largest zone DT p2 p1 MoveL p1. tool1. MoveL p3. Instructions which indirectly affect movements. z30. 5-28 RAPID Overview . on. the logical instructions start executing before the positioning instructions with the argument \Conc are started.Logical instructions are executed directly. They do not. z30. MoveL \Conc. in the order they were programmed. the following applies: . v1000. v1000. If several positioning instructions with the argument \Conc and several logical instructions in a long sequence are mixed. SetDO do1. tool1. v1000. z30. are executed in the same way as other logical instructions. p2. such as ConfL and SingArea. tool1. This takes place at the same time as the movement (see Figure 31) which means that logical instructions are executed at an earlier stage on the path than they were programmed.

During concurrent program execution. p3. the control system also handles weave events. v1000. . z30.a positioning instruction to a stop point without the argument \Conc. RAPID Overview 5-29 . MoveL \Conc. 5. SetAO ao2. different types of path synchronisation signals can be generated. a trig signal will be generated when the robot passes a predefined position on the path. on. tool1. With a time event. z30. v1000. With a so-called positions event. SetDO do1. tool1. a signal will be generated in a predefined time before the robot stops at a stop position. MoveL \Conc. all connected logical instructions are executed at the same time as the first position is executed. z30.4 Path synchronisation In order to synchronise process equipment (for applications such as gluing.the instruction WaitTime or WaitUntil with the argument \Inpos. the following instructions are programmed to end the sequence and subsequently re-synchronise positioning instructions and logical instructions: . Moreover. tool1. painting and arc welding) with the robot movements.Motion and I/O Principles Synchronisation with logical instructions Execution of SetDO and SetAO DT Largest zone p2 p1 MoveL p1. 3. v1000. p2. which generate pulses at predefined phase angles of a weave motion. Figure 31 If several positioning instructions with the argument \Conc are programmed in sequence.

2ms.Motion Data Types . In the event of a power failure and restart in a Trigg instruction. Typical repeat accuracy for a set of digital outputs on the path is +/.Synchronisation with logical instructions Motion and I/O Principles All the position synchronised signals can be achieved both before (look ahead time) and after (delay time) the time that the robot passes the predefined position. all trigg events will be generated once again on the remaining movement path for the trigg instruction. 3.zonedata 5-30 RAPID Overview . The position is defined by a programmed position and can be tuned as a path distance before the programmed position.5 Related information Described in: Positioning instructions Definition of zone size RAPID Summary .

Figure 32 Two different arm configurations used to attain the same position and orientation. a position is located approximately in the middle of a work cell. The configuration on the right side is attained by rotating the arm backward. Axis 1 is rotated 180 degrees. We call these different robot configurations. some robots can get to that position from above and below when using different axis 1 directions (see Figure 32). for example. If.Motion and I/O Principles Robot Configuration 4 Robot Configuration Different types of robot configurations It is usually possible to attain the same robot tool position and orientation in several different ways. This is possible for robot types with extended axis 3 working range (see Figure 33). RAPID Overview 6-31 . using different sets of axis angles. Some robots may also get to that position from above and below while using the same axis 1 direction.

Robot Configuration Motion and I/O Principles ABB Figure 33 IRB140 with two different arm configurations used to attain same position and orientation. In the configuration in which the front part of the upper arm points upwards (lower). axis 6 axis 4 axis 5 Figure 34 Two different wrist configurations used to attain the same position and orientation. 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). The Axis 1 angle is the same for both configurations. axis 4 has been rotated 180 degrees. 6-32 ABB RAPID Overview . 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 34).The configuration on the right side is attained by rotating the lower arm forward and the upper arm backward.

program execution will stop. the RAPID Overview 6-33 .Motion and I/O Principles Specifying robot configuration Robot Configuration When programming a robot position. During axis-by-axis or modified linear movement using a configuration check. The way of specifying robot configuration differs for different kinds of robot types (see Data Types and System Data . However. 4 and 6.confdata. however. for a complete description). for most robot types this includes defining the appropriate quarter revolutions of axes 1. If. also a robot configuration is specified. To do this. the robot may unexpectedly start to move its arms and wrists which. During linear movement. you can make the robot check the configuration and. the configuration check is active.– 1   π⁄2 angle . in turn. program execution stops as soon as any one of the axes deviates more than the specified number of degrees. 1 2 0 3 Figure 35 Quarter revolution for a positive joint angle: int  joint – -------------- . if the correct configuration is not attained. Configuration check Usually you want the robot to attain the same configuration during program execution as the one you programmed. If the configuration is not checked. the robot always moves to the closest possible configuration. may cause it to collide with peripheral equipment. The configuration check involves comparing the configuration of the programmed position with that of the robot.  π⁄2  angle -3 -2 -4 -1 Figure 36 Quarter revolution for a negative joint angle: int  joint – -------------.

• The robot tool has been changed causing the robot to take another configuration than was programmed. When the execution of a programmed position is stopped because of a configuration error. the configuration check can be deactivated. 4. • The position is subject to an active frame operation (displacement.Robot Configuration Motion and I/O Principles robot always moves to the programmed axis configuration.confdata RAPID Summary . it may often be caused by some of the following reasons: • The position is programmed off-line with a faulty configuration. base). If the configuration check is not active.1 Related information Described in: Definition of robot configuration Activating/deactivating the configuration check Data Types and System Data . user. The correct configuration in the destination position can be found by positioning the robot near it and reading the configuration on the teach pendant. If the programmed position and orientation can not be achieved. object. If the configuration parameters change because of active frame operation.Motion Settings 6-34 RAPID Overview . program execution stops before starting the movement. the robot moves to the specified position and orientation with the closest configuration.

For standard ABB master and external robots.1 Robot kinematics The position and orientation of a robot is determined from the kinematic model of its mechanical structure. 5.1 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.Motion and I/O Principles Robot kinematic models 5 Robot kinematic models 5. The kinematic parameters specifying the arm-lengths. length_of_upper_arm length_of_wrist Z6 joint 5 offset_of_joint_3 Z length_of_lower_arm offset_of_joint_2 joint 4 joint 3 joint 6 X6 joint 2 joint 1 height_of_foot X Figure 37 Kinematic structure of an IRB1400 robot A calibration procedure supports the definition of the base frame of the master robot relative to the world frame. RAPID Overview 5-35 . these models are predefined in the controller. are predefined in the configuration file for each robot type.1. The specific mechanical unit models must be defined for each installation. offsets and joint attitudes.

Z2 length_of_lower_arm Z0 offset_of_upper_arm attitude_of_joint1 joint 2 joint 1 offset_of_joint1_x turn_table X2 attitude_of_joint height_of_foot X0 Figure 39 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. 5-36 RAPID Overview .1.Robot kinematic models Motion and I/O Principles Z6 X6 Z Y X Master robot base frame World frame Figure 38 Base frame of master robot 5. A number of predefined classes of 2 and 3 dimensional mechanical structures are supported.2 External robot Coordination with an external robot also requires a kinematic model for the external robot.

John J. This is possible for external robots. Mechanics & Control. Modelling is based on the Denavit-Hartenberg convention according to Introduction to Robotics. Craigh (Addison-Wesley 1986) RAPID Overview 5-37 .Motion and I/O Principles Robot kinematic models Z0 Body C Z2 X2 Body B Body A X0 External robot base frame World frame Figure 40 Base frame of an ORBIT_160B robot Y0 Y2 X0 y1 X2 x1 x2 Figure 41 Reference points on turntable for base frame calibration of an ORBIT_160B robot in the home position using predefined model 5.2 General kinematics Mechanical structures not supported by the predefined structures may be modelled by using a general kinematic model.

Robot kinematic models Motion and I/O Principles Z2 d1 d2 Z0 Y2 X0 turn_table alfa2 a1 = 0 a2 = 0 alfa1 = 0 Figure 42 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. Z2 Z0 Y2 X0 External robot base frame World frame Figure 43 Base frame of an ORBIT_160B robot using general kinematics model 5-38 RAPID Overview .

System Parameters RAPID Overview 5-39 .3 Related information Described in: Definition of general kinematics of an external robot User’s Guide .Motion and I/O Principles Robot kinematic models Y0 X0 x1 y1 x2 Y2 X2 Figure 44 Reference points on turntable for base frame calibration of an ORBIT_160B robot in the home position (joints = 0 degrees) 5.

Robot kinematic models Motion and I/O Principles 5-40 RAPID Overview .

However. The motion supervision is only active when at least one axis (including external axes) is in motion. The tune values are set in percent of the basic tuning where 100% corresponds to the basic values. This is to avoid unnecessary trigging due to external process forces. the load identification functionality can be used to define it. and incorrect load definition.Motion and I/O Principles Motion Supervision/Collision Detection 6 Motion Supervision/Collision Detection Motion supervision is the name of a collection of functions for high sensitivity. This is useful in applications where external process forces act on the robot in certain parts of the cycle. the robot stops again and remains in the motors on state. When the collision detection is triggered. Motion supervision includes functionality for the detection of collision. the function is deactivated.2 Tuning of Collision Detection levels The collision detection uses a variable supervision level. At low speeds it is more sensitive than during high speeds. If the tool data or payload data are not known. RAPID Overview 6-41 . no tuning of the function should be required by the user during normal operating conditions. jamming. 6. A typical collision is illustrated in the figure below. Separate tuning parameters are available for jogging and program execution. There is a RAPID instruction called MotionSup which turns the function on and off and modifies the supervision level.1 Introduction The collision detection may trig if the data for the loads mounted on the robot are not correct. payloads and arm loads. This includes load data for tools. it is possible to turn the function on and off and to tune the supervision levels. Arm load data cannot be identified. After this. 6. When all axes are standing still. the motor torques are reversed and the mechanical brakes applied in order to stop the robot. Increasing the percentage gives a less sensitive system and decreasing gives the opposite effect. 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. The different tuning parameters are described in more detail in the User’s Guide under System Parameters: Manipulator. The MotionSup instruction is described in more detail in the RAPID Reference Manual. This functionality is called Collision Detection. It is important to note that if tune values are set in the system parameters and in the RAPID instruction both values are taken into consideration. For this reason. Example: If the tune value in the system parameters is set to 150% and the tune value is set to 200% in the RAPID instruction the resulting tune level will be 300%. model-based supervision of the robot’s movements.

The motor speed is reversed to remove residual forces on the tool and robot. time of collision collision detected robot stopped residual forces removed motor speed time speed reversed motor torque time torque reversed 6-42 RAPID Overview .The motor torque is reversed to stop the robot.Motion Supervision/Collision Detection Motion and I/O Principles Figure: Typical collision Phase 1 . Phase 2 .

If the robot is stopped and the function turned off.5 Limitations The motion supervision is only available for the robot axes. the status flag in the dialogue window is set to on again. or any other external manipulators. This displays a dialogue box which allows the motion supervision to be turned on and off. this will only take effect once the robot starts to move. either from the teach pendant or through the digital input AckErrDialog. if the collision detection is active and the robot is moving. MotSupOn is still high. As a result. Thus. Therefore. the collision detection can still be active during the running of the program.4 Digital outputs The digital output MotSupOn is high when the collision detection function is active and low when it is not active. This is also the case even when it is an external axis which is run as an independent joint. If the RAPID instruction MotionSup is used to turn off the collision detection. MotSupOn switches to low. 6. This will only affect the robot during jogging.Motion and I/O Principles Motion Supervision/Collision Detection 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 which is only available if the system is installed in Service mode. 6. orbit stations. It is not available for track motions. When the robot starts to move. It stays high until the error code is acknowledged.3 Motion supervision dialogue box Select motion supervision under the special menu in the jogging window. 6. Note that a change in the state of the function takes effect when a motion starts. This is a safety measure to avoid turning the function off by accident. If the motion supervision is turned off in the dialogue box and a program is executed. MotSupOn is high. RAPID Overview 6-43 . The digital output MotSupTrigg goes high when the collision detection triggers. If the program is then stopped and the robot jogged. The collision detection may trigger when the robot is used in soft servo mode. The digital outputs are described in more detail in the User’s Guide under System Parameters: IO Signals. it is advisable to turn the collision detection off when the robot is in soft servo mode. the digital output MotSupOn may temporarily be high at program start before the robot starts to move. The collision detection is deactivated when at least one axis is run in independent joint mode.

In the event of a stiff collision during program execution. it may not be possible to jog the robot without the supervision triggering. 6. As a result.Motion Supervision/Collision Detection Motion and I/O Principles The distance the robot backs up after a collision is proportional to the speed of the motion before the collision.IO Signals Motion and I/O Principles 6-44 RAPID Overview . If the robot is mounted on a track the collision detection should be set to off when the track is moving.Manipulator System Parameters . the robot may not back up sufficiently to relieve the stress of the collision. If it is not turned off the collision detection may trigger when the track moves.Motion System Parameters . it may take a few seconds before the robot starts to back up. even if there is no collision.6 Related information Described in: RAPID instruction MotionSup System parameters for tuning Motion supervision IO Signals Load Identification RAPID Summary . If repeated low speed collisions occur. In this case use the jog menu to turn off the collision detection temporarily and jog the robot away from the obstacle.

e. Wrist singularities are configurations where axis 4 and axis 6 are on the same line. These positions. Generally speaking. a robot has two types of singularities: arm singularities and wrist singularities. Axis 5 with an angle of 0 degrees Axis 6 parallel to axis 4 Figure 34 Wrist singularity occurs when axis 5 is at 0 degrees. User’s Guide 17-35 . Singularity at the intersection of the wrist centre and axis 1 Rotation centre of axis 1 Z base X base Figure 33 Arm singularity occurs where the wrist centre and axis 1 intersect. i. and 6) ends up directly above axis 1 (see Figure 33).Motion and I/O Principles Singularities 5 Singularities Some positions in the robot working space can be attained using an infinite number of robot configurations to position and orient the tool. constitute a problem when calculating the robot arm angles based on the position and orientation of the tool. Arm singularities are all configurations where the wrist centre (the intersection of axes 4. known as singular points (singularities). 5. axis 5 has an angle equal to 0 (see Figure 34).

5. The high joint velocities may be reduced by using the mode (Sing Area\Wrist) when the wrist axes are interpolated in joint angles. This may cause robot joints to make unnecessary movements. the first position on the other side of the singularity should be programmed with an orientation that makes the reconfiguration unnecessary. problems do not occur when the robot passes singular points. This singularity occurs at robot positions where the wrist centre and the rotation centres of axes 2 and 3 are all in a straight line (see figure below). the robot can pass singular points but at a decreased speed. it should be noted that the robot must not be in its singularity when only external joints are moved.Singularities Singularity points of IRB140 Motion and I/O Principles The robot has the wrist singularity and the arm singularity. problems do not occur when the robot passes singular points During linear interpolation. 17-36 User’s Guide . When executing a linear or circular path close to a singularity. 5. There is also a third kind of singularity. Note that the robot configuration changes dramatically when the robot passes close to a singularity with linear or circular interpolation. AB B Figure 35 The additional singular point for IRB140. the linear path velocity is reduced.2 Jogging through singularities During joint interpolation. An orientation error compared to the full linear interpolation is however introduced. while still maintaining the linear path of the robot tool. In order to avoid the reconfiguration.1 Program execution through singularities During joint interpolation. In order not to exceed the maximum joint velocities. the velocities in some joints (1 and 6/4 and 6) may be very high. Also.

SingArea User’s Guide 17-37 .Motion and I/O Principles Singularities 5.3 Related information Described in: Controlling how the robot is to act on execution near singular points Instructions .

3 Definition of World Zones in the world coordinate system All World Zones are to be defined in the world coordinate system. RAPID Overview 5-49 . . The sides of the Boxes are parallel to the coordinate axes and Cylinder axis is parallel to the Z axis of the world coordinate system.Indication that the robot is at a position where it is permissible to start program execution from a PLC.Motion and I/O Principles World Zones 8 World Zones 8. To limit the working area of the robot in order to avoid collision with the tool. the robot stops or an output is automatically set if the robot is inside a special user-defined area. 8.When external equipment is located inside the robot’s work area. . To make a common work area for two robots available to only one robot at a time.When two robots share a part of their respective work areas.2 Using World Zones To indicate that the tool centre point is in a specific part of the working area. The possibility of the two robots colliding can be safely eliminated by the supervision of these signals. A forbidden work area can be created to prevent the robot colliding with this equipment.1 Using global zones When using this function. Here are some examples of applications: . 8.

5-50 RAPID Overview . a stationary TCP is used.4. The TCP is always supervised irrespective of the mode of operation. the tool will not move and if it is inside a World Zone then it is always inside. 8. program execution and jogging. If that tool is active. for example.World Zones Motion and I/O Principles Base coordinate system robot X Y Z Sphere Radius TCP Cylinder Radius Box Height z y World coordinate system x A World Zone can be defined to be inside or outside the shape of the Box. 8.4 Supervision of the Robot TCP Not supervised TCP The movement of the tool centre point is supervised and not any other points on the robot. Sphere or the Cylinder.1 Stationary TCPs If the robot is holding a work object and working on a stationary tool.

A World Zone can be defined to be outside the work area. It can be used to stop the robot just inside a World Zone Stop Time for Robot Movement of TCP World Zone Status of digital output 8. It is useful to indicate that the robot has stopped in a specified area. then the only ways to get out of the Zone are by jogging or by manual pushing with the brakes released. The robot will then stop with the Tool Centre Point just outside the World Zone. Time between checks against World Zones Movement of TCP World Zone Status of digital output 8.5. by releasing the brakes and manually pushing.5 Actions 8.3 Stop the robot before the tcp reaches a World Zone.1 Set a digital output when the tcp is inside a World Zone. when heading towards the Zone Stop Time for Robot Time between checks against World Zones Movement of TCP When the robot has been moved into a World Zone defined as an outside work area.5. RAPID Overview 5-51 . This action sets a digital output when the tcp is inside a World Zone. for example.Motion and I/O Principles World Zones 8.5.2 Set a digital output before the tcp reaches a World Zone. This action sets a digital output before the tcp reaches a World Zone.

if the time that the robot is inside the zone is too short. restart. speed Speed Resol. 8. 5-52 RAPID Overview .8 Power failure. 8. and run on Stationary World Zones will be deleted at power off and must be reinserted at power on by an event routine connected to the event POWER ON.7 Maximum number of World Zones A maximum of ten World Zones can be defined at the same time. Therefore.World Zones Motion and I/O Principles 8. It is up to the user to make the zones large enough so the robot cannot move right through a zone without being checked inside the Zone. Min. the distance between the Zones must exceed the minimum size. size of zone for used path_resolution and max. 1000 mm/s 25 mm 50 mm 75 mm 2000 mm/s 50 mm 100 mm 150 mm 4000 mm/s 100 mm 200 mm 300 mm 1 2 3 If the same digital output is used for more than one World Zone. The digital outputs for the World Zones will be updated first at Motors on. Supervision of the movement of the tool centre points is done at discrete points with a time interval between them that depends on the path resolution. as shown in the table above. Time between checks against World Zones It is possible that the robot can pass right through a corner of a zone without it being noticed. Temporary World Zones will survive a power failure but will be erased when a new program is loaded or when a program is started from the main program. to avoid an incorrect status for the output. make the size of the zone larger than the dangerous area.6 Minimum size of World Zones.

9 Related information RAPID Reference Manual Motion and I/O Principles: Data Types: Coordinate Systems wztemporary wzstationary shapedata Instructions: WZBoxDef WZSphDef WZCylDef WZLimSup WZDOSet WZDisable WZEnable WZFree WZTempFree RAPID Overview 5-53 .Motion and I/O Principles World Zones 8.

World Zones Motion and I/O Principles 5-54 RAPID Overview .

gripper do2 feeder2 do16 OUT16 Figure 48 To be able to use an I/O board. Logical names must always be used during programming. .1 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. but can also have no logical connections (see Figure 48). the physical output 2 is connected to two different logical names. . Each of the boards has several digital and/or analog channels which must be connected to logical signals before they can be used. affected by emergency stops or similar events. . Physical channel IN1 IN2 Logical signal do1 feeder IN16 OUT1 OUT2 . are defined in the system parameters. RAPID Overview 5-55 . When the power supply to the robot is switched on. IN16. The physical channel determines time delays and voltage levels (see the Product Specification). . The characteristics. 9. I/O board . . all signals are set to zero. filter times and scaling between programmed and physical values. its channels must be given logical names. has no logical name and thus cannot be used. They are not. This is carried out in the system parameters and has usually already been done using standard names before the robot is delivered. In the above example. . however. on the other hand.Motion and I/O Principles I/O Principles 9 I/O Principles The robot generally has one or more I/O boards. A physical channel can be connected to several logical names.

program execution continues. PulseDO do1. SetDO do1. WaitDO do1 .5. on the other hand. SetDO do1. The function can be called on a raising or falling edge of the signal. WaitTime 0. However. If.I/O Principles Motion and I/O Principles An output can be set to one or zero from within the program. Ex: If a function is connected to a signal called do1 and you make a program like: SetDO do1. In this case you may loose the interrupt. make sure that the output is set before resetting it. If.1. a program start is automatically generated as soon as this input is enabled. a new change is ordered for the same output before the given time elapses. Ex: SetDO do1.3 System signals Logical signals can be interconnected by means of special system functions.2 Signals connected to interrupt RAPID interrupt functions can be connected to digital signal changes. or the chapter on Installation and Commissioning . an input is connected to the system function Start. if the digital signal changes very quickly. This can also be done using a delay or in the form of a pulse. Signal value 1 Time 0 0. For more information. see Chapter 9.1.0.PLC Communication in the Product Manual. SetDO \SDelay:=1.1. 9. do1. for example. the interrupt can be missed. the first change is not carried out (see Figure 49).0. These system functions are generally only enabled in automatic mode.5 1 Figure 49 The instruction SetDO is not carried out at all because a new command is given before the time delay has elapsed. In this way you will never loose any interrupt. The change is then carried out without affecting the rest of the program execution. The signal will first go to High and then Low in a few milliseconds. To be sure that you will get the interrupt. System Parameters. 9. If a pulse or a delayed change is ordered for an output. 5-56 RAPID Overview .

Pulses or delays are not transmitted over cross connections. AND and OR (Option: Advanced functions). . e. di2.An input signal can be connected to one or more input or output signals.do8=do7 .do8=di5 If do7 is set to 1. cross-connecting di1 to di2 whilst di2 is cross-connected to di1.do4=di2 If di1 changes.An output signal can be connected to one or more input or output signals.di2=di1 .di3=di2 .If there is a cross connection on an input signal.5 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.Logical conditions can be defined using NOT.If the same signal is used in several cross connections. the value of that signal is the same as the value that was last enabled (changed). If di5 is then set to 0. . . however. They must not. do8 will also be set to 1. . one cross connection can affect another. the corresponding physical connection is automatically disabled. do8 will also be changed (in spite of the fact that do7 is still 1). . di3 and do4 will be changed to the corresponding value. RAPID Overview 5-57 .Cross connections can be interlinked. .4 Cross connections Digital signals can be interconnected in such a way that they automatically affect one another: . . Any changes to that physical channel will thus not be detected.do5=di6 and do1 Do5 is set to 1 if both di6 and do1 is set to 1. . 9.g. be connected in such a way so as to form a ”vicious circle”.Motion and I/O Principles I/O Principles 9. Examples: . in other words.

6 Related information Described in: Definition of I/O boards and signals Instructions for handling I/O Manual manipulation of I/O User’s Guide .System Parameters RAPID Summary .I/O Principles Motion and I/O Principles 9.Inputs and Outputs 5-58 RAPID Overview .Input and Output Signals User’s Guide .

1. • Open the file in QuickTeach or ProgramMaker. Copy this log to a diskette using the robot’s File Manager.2 Editing When a program is created or changed in a word-processor. use the command File: Check Program. you should use a template. QuickTeach. To obtain information about the type of error. If you use a word-processor to edit programs. etc.). When the program is syntactically correct. To make sure that all references to routines and data are correct. Note that the value of a stored position is only displayed as an *on the teach pendant. you can use the computer tool. If there are any syntactical errors.1 File format The robot stores and reads RAPID programs in TXT format (ASCII) and can handle both DOS and UNIX text formats. z. whereas the text file will contain the actual position value (x. it can be checked and edited in the robot. If the program has been changed in the robot. In addition to off-line programming. In order to minimise the risk of errors in the syntax (faulty programs). This chapter explains the working procedure for doing this. These programs can be read directly to a wordprocessor without having to be converted. maintained and stored in an ordinary office computer. • Use a RAPID syntax check program for the PC. A template can take the form of a program that was created previously on the robot or using QuickTeach. the program will not be accepted and an error message will be displayed. all information will be handled in the form of text. All information can be read and changed directly using a normal text editor. 1. it can be stored on diskette again and processed or stored in a PC. these must be saved in TXT format (ASCII) before they are used in the robot. the robot stores a log called PGMCPL1. y. This means that information about data and routines will differ somewhat from what is displayed on the teach pendant.LOG on the internal RAM disk. 1. By this is meant that the text must follow the fundamental rules of the RAPID language. One of the following methods should be used to detect errors in the text: • Save the file on diskette and try to open it in the robot.Programming Off-line Programming Off-line 1 Programming Off-line RAPID programs can easily be created.3 Syntax check Programs must be syntactically correct before they are loaded into the robot. RAPID Overview 6-1 . Open the log in a word-processor and you will be able to read which lines were incorrect and receive a description of the error.

num t2) IF t1 > t2 THEN RETURN t1. DEFAULT: TPWrite “Unknown trap . ENDIF ENDFUNC ENDMODULE 1. 6-2 RAPID Overview . function as instructions: . These are created in the form of normal routines.5 Making your own instructions In order to make programming easier. when programming and test-running. ENDPROC TRAP InvertDo12 ! Trap routine for TriggInt TEST INTNO CASE process_int: InvertDO do12.The complete routine will be run during step-by-step execution. gun1.4 Examples The following shows examples of what routines look like in text format. ELSE RETURN t2. v200. you can customize your own instructions.They can be taken from the instruction pick list and programmed as normal instructions. number=”\Num:=INTNO. but. . fine.Programming Off-line Programming Off-line 1. you can place them in the USER system module. %%% VERSION: 1 LANGUAGE: ENGLISH %%% MODULE main VAR intnum process_int . Alternatively. ENDTEST ENDTRAP LOCAL FUNC num MaxNum(num t1. • Create a new system module where you can place your routines that will function as instructions. ! Demo of RAPID program PROC main() MoveL p1.

must be entered off-line. it will not be possible to get past the instruction during backward program execution (see Chapter 13 in this manual . The arguments of the instruction are defined in the form of routine parameters. • If the instruction is to behave in a certain way during backward program execution. • Change the module attribute to NOSTEPIN. however. A backward handler can be entered using the command Routine: Add Backward Handler from the Program Routines window. Note that the name of the parameters will be displayed in the window during programming and should therefore be given names that the user will understand. GripOpen and GripClose. If there is no such handler. NOSTEPIN) PROC GripOpen (VAR signaldo Gripper) Set Gripper. e. Example: To make the gripper easier to handle. ENDPROC PROC GripClose (VAR signaldo Gripper) Reset Gripper. WaitTime 0. The complete routine will then be run during step-by-step execution. WaitTime 0. MODULE My_instr (SYSMODULE.Programming Off-line Programming Off-line • Create a routine in this system module with the name that you want your new instruction to be called.2. two new instructions are made. GripOpen gripper1. • Test the routine thoroughly so that it works with different types of input data (arguments). • Place the routine in one of the Most Common pick lists.2. This attribute.Basic Characteristics). The output signal’s name is given to the instruction’s argument.g. ENDPROC ENDMODULE RAPID Overview 6-3 . this can be done in the form of a backward handler.

Programming Off-line Programming Off-line 6-4 RAPID Overview .

usually better to give your own names to the data you use. This data does not have to be created and. predefined data is supplied with the robot. e. It is. .2 Creating new data in this module This module can be used to create such data and routines that must always be present in the program memory regardless of which program is loaded. which means that it is always present in the memory of the robot regardless of which program is loaded. . 1. • Choose View: Modules from the Program window. since this makes the program easier for you to read. 1. one work object data. initial programming is made easier. RAPID Overview 7-1 . num wobjdata clock dionum dionum dionum Declaration VAR num reg1:=0 . VAR num reg5:=0 PERS wobjdata wobj1:=wobj0 VAR clock clock1 CONST dionum high:=1 CONST dionum low:=0 CONST dionum edge:=2 User is a system module. tools and service routines. • Change.Predefined Data and Programs System Module User 1 System Module User In order to facilitate programming. however.g.1 Contents User comprises five numerical data (registers). • Select the system module User and press Enter . If this data is used. create data and routines in the normal way (see Programming and Testing). consequently. Name reg1 reg2 reg3 reg4 reg5 wobj1 clock1 high low edge Data type num . . . one clock and two symbolic values for digital signals. can be used directly.

press the Types function key to select the correct data type. To change or delete individual data • Choose View: Data from the Program window. • Choose Data: In All Modules. the CallByVar instruction will not work. • Press Delete . the entire module) • Choose View: Modules from the Program window.e. • Change or delete in the normal way (see Programming and Testing). If this is not shown. • Select the desired data. To delete all data (i.System Module User Predefined Data and Programs 1.3 Deleting this data Warning: If the Module is deleted. 7-2 RAPID Overview . • Select the module User.

5-35 coordinated external axes 5-5 corner path 5-14 cross connections 5-57 D joint movement 5-11 data 4-21 used in expression 4-31 data type 4-19 declaration constant 4-23 module 4-8 persistent 4-23 routine 4-13 variable 4-22 displacement frame 5-4 RAPID Overview L linear movement 5-12 local data 4-21 routine 4-11 logical expression 4-30 logical value 4-2 displacement instructions 3-11 DIV 4-29 E equal data type 4-19 ERRNO 4-37 error handler 4-37 error number 4-37 error recovery 4-37 expression 4-29 external axes coordinated 5-5 F file header 4-3 file instructions 3-21 function 4-11 function call 4-32 G global data 4-21 routine 4-11 GlueWare 3-37 I I/O principles 5-55 I/O synchronisation 5-25 identifier 4-1 input instructions 3-19 interpolation 5-11 interrupt 3-23. 4-3 communication 3-39 communication instructions 3-21 component of a record 4-19 concurrent execution 5-26. 4-41. 4-44 base coordinate system 5-1 C calling a subroutine 3-3 circular movement 5-13 comment 3-5. 4-23 assigning a value to data 3-5 axis configuration 5-31 B backward execution 4-41 Backward Handler 6-3 backward handler 4-13. 4-39 J 8-1 .INDEX A aggregate 4-19 alias data type 4-19 AND 4-30 argument conditional 4-33 arithmetic expression 4-29 array 4-22. 5-43 conditional argument 4-33 configuration check instructions 3-10 CONST 4-23 constant 4-21 coordinate system 5-1.

4-39 typographic conventions 2-2 U User . 5-35 tool coordinate system 5-7 trap routine 4-11.system module 7-1 user coordinate system 5-3 V VAR 4-22 variable 4-21 W wait instructions 3-5 world coordinate system 5-2 wrist coordinate system 5-7 WriteCfgData Write configuration data 41 X XOR 4-30 RAPID Overview .M main routine 4-7 mathematical instructions 3-29. 5-23 spot welding 3-32 stationary TCP 5-8 stopping program execution 3-4 string 4-2 string expression 4-30 switch 4-12 syntax rules 2-2 system module 4-8 T TCP 5-1. 5-35 stationary 5-8 time instructions 3-27 tool centre point 5-1. 3-45 MOD 4-29 modified linear interpolation 5-14 module 4-7 declaration 4-8 motion instructions 3-14 motion settings instructions 3-9 mulittasking 4-43 Multitasking 3-47 N non value data type 4-19 NOT 4-30 numeric value 4-2 O object coordinate system 5-3 offline programming 6-1 operator priority 4-33 optional parameter 4-12 OR 4-30 output instructions 3-19 P parameter 4-12 path synchronization 5-29 PERS 4-23 persistent 4-21 placeholder 4-3 position instruction 3-14 position fix I/O 5-29 procedure 4-11 program 4-7 program data 4-21 program displacement 3-11 program flow instructions 3-3 program module 4-7 programming 6-1 R record 4-19 reserved words 4-1 robot configuration 5-31 routine 4-11 8-2 declaration 4-13 routine data 4-21 S scope data scope 4-21 routine scope 4-11 searching instructions 3-14 semi value data type 4-19 singularity 5-45 soft servo 3-11.

Error handler Expression Fly-by point Function Group of signals Interrupt I/O Main routine Manual mode Mechanical unit Module Motors On/Off Operator’s panel Orientation Parameter Persistent Procedure RAPID Overview 8-3 .e. The direction of an end effector. A point which the robot only passes in the vicinity of – without stopping. The position of the robot axes at a particular location. It corresponds to the argument of an instruction. everything except the name of the instruction. Normal execution can then be restarted automatically. sent with the routine call. The input data of a routine. can independently form an instruction. The applicable mode when the operating mode switch is set to . A group of external axes. The applicable mode when the operating mode selector is set to . A variable.e. A group of routines and data. The distance to that point depends on the size of the programmed zone. for example. i. One part of a record. The part of a routine or data that defines its properties. An event that temporarily interrupts program execution and executes a trap routine. The state of the robot. A routine which. The path generated when passing a fly-by point. when called. i. A number of digital signals that are grouped together and handled as one signal. Electrical inputs and outputs. the value of which is persistent. The routine that usually starts when the Start key is pressed. whether or not the power supply to the motors is switched on. i. A sequence of data and associated operands. Any dialog boxes appearing on the display of the teach pendant must always be terminated (usually by pressing OK or Cancel) before they can be exited. A separate part of a routine where an error can be taken care of. reg1+5 or reg1>5. e. A routine that returns a value. a part of the program. Data that can only be changed manually.g. The panel located on the front of the control system.e.Glossary Glossary Argument Automatic mode Component Configuration Constant Corner path Declaration Dialog/Dialog box The parts of an instruction that can be changed.

configuration data in other words. however. that moves along the programmed path at the programmed velocity. Data that can be changed from within a program. the system modules remain in the program memory. A module that is always present in the program memory. it starts to move to the next position. contain system modules. Trap routine Variable The routine that defines what is to be done when a specific interrupt occurs. for example. The instruction that will be executed first when starting program execution.Glossary Program Program data Program module The set of instructions and data which define the task of the robot. A point at which the robot stops before it continues on to the next point. such as the Program window and the Service window. Local data that can only be used in a routine. Programs do not. The spherical space that surrounds a fly-by point. When a new program is read. Data that can be accessed in a complete module or in the complete program. As soon as the robot enters this zone. but which loses its value (returns to its initial value) when a program is started from the beginning. Record Routine Routine data Start point Stop point System module System parameters Tool Centre Point (TCP) The point. A module included in the robot’s program and which is transferred when copying the program to a diskette. Window Zone 8-4 RAPID Overview . The settings which define the robot equipment and properties. generally at the tip of a tool. A subprogram. The robot is programmed and operated by means of a number of different windows. A compound data type. A window can always be exited by choosing another window.