RAPID Programming Language Essentials
RAPID Language Comments
! This is a comment
Header File
%%%
VERSION: 1 (version M94 of the program)
LANGUAGE: ESPAÑOL (Any language)
%%%
Modules
MODULE <nombre_módulo> [<List of attributes>]
<List Statement database>
<List Statement rutina>
ENDMODULE
Attributes
SYSMODULE
: System module.NOSTEPIN
: Cannot enter during stepping.ViewOnly
: Cannot be changed.READONLY
: Cannot be modified except for its attributes.
Routines
Procedures
PROC <name procedimiento> (Parameters)
<List Name> statements;
List> instrucciones>;
ERROR list> instrucciones>;
ENDPROC
Functions
FUNC <type> dato> value (Parameters)
<List Name> statements;
List> instrucciones>;
RETURN data;
ERROR list> instrucciones>;
ENDFUNC
Interruptions
TRAP <name trap>
<List Name> statements;
List> instrucciones>;
ERROR list> instrucciones>;
ENDTRAP
Data Persistence
- VAR: Variable data, modifiable during program execution.
- CONST: Constant data, cannot be modified.
- PERS: Persistent data, retains changes across executions.
Data Types
bool (Boolean): VAR bool <identifier> := <value>
(TRUE
/FALSE
/logical expression)
Example: VAR bool flag; flag := TRUE; flag := value1 > value2;
clock: VAR clock <identifier>;
Maximum: 4294967 sec. ClkReset
, ClkStart
, ClkStop
, ClkRead
Example: VAR clock clock; ClkReset clock;
confdata (Structure): Defines robot axes configurations. In ABB: [1,0,0,0]
. Components: cf1
, cf4
, Nf6
, cfx
.
Example: Confdata conf15 VAR := [1, -1, 0, 0]
dionum: Used with instructions and functions for digital I/O manipulation.
Example: CONST dionum closed := 1; SetDO pinza1 closed;
errnum: Describes recoverable errors during program execution.
Example: CONST err_maq1 errnum := 1; IF dinput(di1) = 0 RAISE err_maq1;
extjoint: Defines positions of external axes.
intnum: Identifies an interrupt.
iodev: Used for serial channels.
LoadData: Describes loads on the robot’s mounting flange.
mecunit: Defines mechanical units controlled by the robot.
num (Numerical values): VAR num a; a := 5;
orient: Tool and guidance axis rotations as quaternions.
pos (Structure): Represents positions (x, y, z) in millimeters.
Example: VAR pos p1; p1 := [500, 0, 940]; p1.y := p1.y + 50;
pose: Used for coordinate system transformations.
Example: VAR pose base1; base1.trans := [50, 0, 40]; base1.rot := [1, 0, 0, 0];
robtarget (Structure): Defines robot positions.
Example: CONST robtarget p1 := [[x, y, z], [q1, q2, q3, q4], [c1, c2, c3, c4], [e1, e2, e3, e4, e5, e6]];
string (Character string): VAR string text; text := Start of the system;
tooldata (Structure): Describes tool characteristics.
Example: CONST tooldata tool := [TRUE, [[x, y, z], [q1, q2, q3, q4]], [mass, [xg, yg, zg], [qg1, qg2, qg3, Qg4], ix, iy, iz]];
wobjdata (Structure): Defines work objects.
Example: PERS wobjdata obj2 := [FALSE, TRUE, "", [[300, 600, 200], [1, 0, 0, 0]], [[0, 200, 30], [1, 0, 0, 0]]];
Speeddata: Speed of movements (e.g., v100
, v200
, V1000
).
Zonedata: Accuracy of reaching positions (e.g., z10
, Z20
, Z50
, fine
).
Movement Directions
MoveL: Linear movement. Movel p1, v100, z10, tool1;
MoveC: Circular movement. MoveC p0, p1, v100, z10, tool1;
MoveJ: Joint movement. MoveJ p1, v100, z10, tool1;
Offs: Adds an offset to a position. Offs(Punto, offsetX, offsetY, offsetZ)
Instructions
Change output value: Reset <output digital> = 0
, Set <output digital> = 1
, SetDO do1, 1
Standby: WaitDI di1, 1
, WaitTime 0.5
, WhileUntil
Flow Control
Compact IF: IF <condition> Instruction;
IF: IF <condition> THEN <Instructions> ELSE <Instructions> ENDIF
FOR: FOR <counter> FROM VI TO VF [STEP increment] DO <Instructions> ENDFOR
WHILE: DO WHILE <condition> <Instructions> Endwhile
TEST: TEST <data> CASE value1, value2, .., value(n-1): rutina1; CASE value n: rutinax; DEFAULT instructions; ENDTEST
GOTO: GOTO Label
DH Parameters
(Detailed explanation of Denavit-Hartenberg parameters)
Singular Configurations
(Explanation of singular configurations in robotics)
Trajectory Types
(Explanation of point-to-point, coordinated, and continuous trajectories)
Programming Methods
(Explanation of programming by guidance and textual programming)
Implementation Criteria
(Explanation of layout, control architecture, equipment choice, safety, and economic rationale)
Resolution, Accuracy, Repeatability
(Definitions and explanations)