ABB Robot Programming: RAPID Language Tutorial for Beginners
A practical guide to ABB robot programming — the RAPID language, RobotStudio, FlexPendant, Wizard easy programming, and an annotated RAPID code example.
ABB Robot Programming: Getting Started with RAPID
ABB is one of the world's largest industrial robot manufacturers, with hundreds of thousands of robots installed in automotive, electronics, food and beverage, and general manufacturing plants. Every ABB robot — from the compact IRB 120 to the heavy-payload IRB 8700 — runs the same programming environment: the RAPID language executed by the IRC5 or OmniCore controller, programmed through RobotStudio software or the FlexPendant teach pendant.
This tutorial walks you through the core concepts of ABB robot programming: the RAPID language structure, the four ways to create a robot program, how to use RobotStudio for offline development, and a fully annotated RAPID code example you can use as a starting template. It is aimed at engineers new to ABB robotics who already have some background in industrial automation — if you are also working with PLCs alongside your robots, see the industrial automation programming guide for broader context.
The RAPID Language: Overview
RAPID (Robot Application Programming Interactive Domain) is ABB's proprietary high-level programming language for robot motion and application logic. It has been the standard ABB programming language since the S4 controller era and remains the foundation of the modern IRC5 and OmniCore platforms.
Language structure: modules, routines, and data
A RAPID program is organized into modules. Each module contains data declarations and routines. Routines fall into three types:
- PROC — standard procedures, the equivalent of a subroutine or function with no return value
- FUNC — functions that return a value (e.g., a calculated distance or a boolean check)
- TRAP — interrupt routines triggered by a hardware signal or a software event
The entry point of a robot program is a PROC named main inside the system module. All motion and application logic calls out from main.
Key data types
| Data type | Purpose | Example |
|---|---|---|
robtarget |
Cartesian position + orientation + configuration | p10 := [[600, 0, 500], [1,0,0,0], [0,0,0,0], [9E9,9E9,9E9,9E9,9E9,9E9]] |
jointtarget |
Axis angles for all six joints | home := [[0,-30,30,0,30,0],[9E9,9E9,9E9,9E9,9E9,9E9]] |
speeddata |
TCP speed + orientation speed + linear/rotational limits | v200 (built-in: 200 mm/s) |
zonedata |
Path corner rounding (fly-by distance) | z10 (10 mm corner rounding) |
bool, num, string |
Standard logical, numeric, and string types | VAR bool part_present := FALSE |
signaldi, signaldo |
References to digital I/O signals | DI_PartSensor, DO_Gripper |
Motion instructions
The two primary motion instructions are:
- MoveJ — joint interpolation. The controller moves all axes simultaneously to reach the target. Fast for large moves through open space; path is less predictable in Cartesian terms.
- MoveL — linear interpolation. The TCP travels in a straight Cartesian line to the target. Required when the robot must follow a precise path (welding, dispensing, assembly insertions).
Both instructions share the same argument pattern:
MoveJ/MoveL Target, Speed, Zone, Tool [\WObj];
Additional instructions include MoveC (circular arc), MoveAbsJ (absolute joint target, used for home position), and MoveExtJ (external axis motion).
I/O instructions
SetDO DO_Gripper, 1; ! Set digital output high
WaitDI DI_PartSensor, 1; ! Wait until digital input goes high
PulseDO \PLength:=0.5, DO_Conveyor; ! 0.5-second pulse
WaitDI is a blocking call — program execution pauses until the specified input reaches the specified value, or until an optional timeout expires.
Four Ways to Program an ABB Robot
ABB supports four distinct programming methods, each suited to different skill levels and use cases. Choosing the right one early saves significant rework.
1. RAPID code (full programming)
Writing RAPID code directly — either in RobotStudio's code editor or in the FlexPendant program editor — gives you complete control over motion paths, logic, I/O, error handling, and communication. This is the method used for complex applications: machine tending with variable part detection, robotic welding with seam tracking, palletizing with dynamic stack calculations, and assembly processes with force feedback.
Required skill level: intermediate to advanced. Familiarity with structured programming concepts helps; experience with Structured Text or similar IEC 61131-3 languages translates well.
2. Wizard Easy Programming (block-based)
Wizard Easy Programming is ABB's graphical, block-based programming interface available on the FlexPendant for OmniCore controllers. It targets operators and maintenance technicians rather than robot programmers — no RAPID syntax knowledge required.
The operator selects action blocks from a library (Move to Position, Pick, Place, Wait for Signal, If/Then, Loop) and arranges them in sequence. The OmniCore controller translates the block sequence into RAPID code behind the scenes. The underlying RAPID program is visible and editable by engineers who want to extend what Wizard created.
Best for: simple pick-and-place applications, machine tending with fixed positions, operations where the end user will modify programs without programming training.
3. FlexPendant teach programming
The FlexPendant is ABB's handheld teach pendant — a ruggedized touchscreen device connected to the IRC5 or OmniCore controller. In teach mode, the operator jogs the robot to each target position, records it as a robtarget, and assembles those targets into a move sequence using a graphical instruction list.
This method is the traditional way to program robots in production environments: an engineer writes the program skeleton in RAPID, then a technician on the floor uses the FlexPendant to teach the exact positions using the physical robot. Taught positions are more accurate than positions defined from a CAD model alone, because they account for real-world fixture tolerances.
4. Offline programming in RobotStudio
Offline programming means creating and testing the entire robot program on a PC — without connecting to the real robot until the program is ready. ABB's RobotStudio software includes a virtual controller that runs an exact copy of the IRC5 or OmniCore firmware, so programs validated in simulation behave the same way on the real robot.
This is the professional standard for new robot deployments: cycle time can be measured, reach envelopes verified against the CAD model of the cell, and I/O logic tested before the physical cell is installed.
Online vs Offline Programming
| Online (on the real robot) | Offline (RobotStudio) | |
|---|---|---|
| Hardware required | Robot + controller | PC only |
| Safety risk | Robot may move during edits | None |
| Position accuracy | Exact (taught on real fixture) | Good (CAD-based, may need fine-tuning) |
| Cycle time verification | Real measurement | Accurate simulation |
| Recommended for | Fine-tuning positions, quick edits | New programs, major changes, training |
For production facilities, the typical workflow is: develop and simulate offline in RobotStudio, transfer to the real robot, then fine-tune taught positions on the FlexPendant.
RobotStudio Walkthrough
RobotStudio is a free download from ABB's website (basic features; advanced simulation requires a license). The workflow for creating a new offline program follows these steps.
1. Create a new station. A "station" is the virtual cell — it contains the robot model, tooling, fixtures, and workpiece geometry imported from CAD (STEP, IGES, or SAT files).
2. Add a robot system. RobotStudio includes a library of every current ABB robot model. Select the robot and controller type (IRC5 or OmniCore). The software creates a virtual controller running the real firmware — this is what makes ABB simulation accurate.
3. Define tools and work objects. A tooldata object defines the TCP (Tool Center Point) — the reference point at the end of the robot's tool. A wobjdata (work object) defines the coordinate frame of the workpiece. Keeping these separate from robot base coordinates makes programs portable when fixtures move.
4. Create targets and paths. Use the AutoPath feature on imported CAD surfaces to generate toolpaths automatically, or manually place robtargets by clicking positions in the 3D view.
5. Simulate. Run the virtual controller. Check for reach errors (robot cannot reach a target), axis limit violations, and collisions. Measure cycle time in the simulation output.
6. Sync to real robot. When the program passes simulation, transfer it to the real controller via a direct Ethernet connection or USB. RobotStudio's "Sync to VC/Robot" function handles the transfer. Fine-tune taught positions on the FlexPendant.
RobotStudio is significantly more capable than competing offline programming tools that use kinematic approximations — because the virtual controller runs real firmware, the simulation is highly faithful. This is the same principle that makes offline programming central to industrial automation programming best practices across platforms.
Worked RAPID Code Example
The following program template covers a complete machine-tending cycle: wait for a part sensor signal, pick the part from a load station, move to a machine, place the part, and signal the machine to start. The comments explain each element.
MODULE MainModule
! ---- Tool and work object definitions ----
PERS tooldata tGripper := [TRUE, [[0, 0, 150], [1,0,0,0]], [2, [0,0,80], [1,0,0,0], 0, 0, 0]];
PERS wobjdata wLoadStation := [FALSE, TRUE, "", [[500,200,0],[1,0,0,0]],[[0,0,0],[1,0,0,0]]];
! ---- Taught robtargets (positions recorded on real robot or RobotStudio) ----
CONST robtarget pHome := [[600,0,800],[0.707,0,0.707,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget pApproach := [[500,200,300],[0.707,0,0.707,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget pPickPos := [[500,200,50], [0.707,0,0.707,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
CONST robtarget pPlacePos := [[800,0,100], [0.707,0,0.707,0],[0,0,0,0],[9E9,9E9,9E9,9E9,9E9,9E9]];
! ---- Cycle counter variable ----
VAR num nCycleCount := 0;
! ---- Main entry point ----
PROC main()
MoveAbsJ pHome, v500, z50, tGripper; ! Move to safe home position (joint move)
WHILE TRUE DO ! Continuous production loop
PickPart;
PlacePart;
nCycleCount := nCycleCount + 1;
ENDWHILE
ENDPROC
! ---- Pick routine ----
PROC PickPart()
! Wait for part-present sensor before approaching
WaitDI DI_PartSensor, 1 \MaxTime:=30 \TimeFlag:=bTimeout;
IF bTimeout THEN
TPWrite "Timeout waiting for part — check conveyor";
EXIT;
ENDIF
SetDO DO_Gripper, 0; ! Open gripper
MoveJ pApproach, v500, z10, tGripper \WObj:=wLoadStation; ! Fly-by approach
MoveL pPickPos, v100, fine, tGripper \WObj:=wLoadStation; ! Slow linear descent to pick
SetDO DO_Gripper, 1; ! Close gripper
WaitTime 0.3; ! Allow gripper to close fully
MoveL pApproach, v200, z10, tGripper \WObj:=wLoadStation; ! Retract with part
ENDPROC
! ---- Place routine ----
PROC PlacePart()
MoveJ pPlacePos, v400, fine, tGripper; ! Joint move to place position
SetDO DO_Gripper, 0; ! Open gripper — release part
WaitTime 0.2;
SetDO DO_MachineCycle, 1; ! Signal machine to start cycle
PulseDO \PLength:=0.5, DO_MachineCycle; ! 0.5 s pulse (machine latches internally)
MoveJ pHome, v500, z50, tGripper; ! Return home
ENDPROC
! ---- Timeout flag variable (referenced in PickPart) ----
VAR bool bTimeout := FALSE;
ENDMODULE
Key points to note in this example:
fineas the zonedata argument means the robot stops exactly at the target (zero fly-by). Usefinewherever exact positioning matters — picks, places, and process start points.z10means the robot starts blending toward the next target when it is 10 mm from the current target. This keeps motion smooth through intermediate via-points.v100for the descent to pick position slows the approach, reducing the risk of part or gripper damage.\WObj:=wLoadStationties the move to the load station coordinate frame. If the fixture moves, you updatewLoadStationonce — all targets update automatically.WaitDIwith\MaxTimeand\TimeFlagis the correct pattern for production code — never block indefinitely without a timeout.
Choosing Your Programming Method: Decision Matrix
| Scenario | Recommended method |
|---|---|
| New robot cell — complex application (welding, assembly) | RobotStudio offline + RAPID |
| New robot cell — simple pick and place | RobotStudio offline + Wizard |
| Existing cell — modify positions only | FlexPendant teach |
| Existing cell — add logic or new routines | RAPID in RobotStudio, sync to robot |
| Operator-managed program changes, no IT skills | Wizard Easy Programming on OmniCore |
| Training / learning RAPID | RobotStudio virtual controller (free) |
A Note on EGM (Externally Guided Motion)
EGM — Externally Guided Motion — is an advanced feature of the IRC5 and OmniCore controllers that allows an external system (a PC, a PLC, or a vision system) to stream real-time position or force corrections to the robot controller over UDP. Rather than following a pre-programmed path, the robot continuously adjusts its trajectory based on external data.
Practical EGM applications include: force-controlled assembly (insert a part until a measured force threshold is reached), adaptive welding with seam tracking from a laser sensor, and collaborative tasks where a human operator guides the robot by physically pushing its arm while EGM keeps it compliant.
EGM requires the EGM Sensor Interface option on the controller and a RAPID program that switches between normal motion mode and EGM-guided mode. It is not a beginner topic — it is worth knowing it exists so you can plan controller options accordingly before purchasing hardware.
ABB Robot Programming Best Practices
Define tool and work object data correctly. Errors in tooldata TCP offset or wobjdata orientation cause every taught position to be wrong. Verify TCP using the four-point or five-point calibration procedure before teaching any positions.
Use named constants for targets. CONST robtarget pPickPos is far more maintainable than an inline position literal. Names appear in the FlexPendant display, making operator troubleshooting much easier.
Structure programs as modular PROCs. A single 500-line main procedure is hard to debug. Break the application into PickPart, PlacePart, HomeRobot, ErrorHandler procedures — the same principle as PLC programming structured text modules.
Always include timeout guards on WaitDI. Production lines stop — a sensor fails, a conveyor jams. Without \MaxTime, the robot blocks indefinitely with no operator feedback.
Use RobotStudio for all major changes. Modifying RAPID code directly on the FlexPendant without a simulation test is the fastest way to create a collision. Simulate first, transfer second.
Understand how RAPID interacts with the PLC. Most robot cells use PROFINET or EtherNet/IP to handshake with a PLC — the robot signals it has completed a pick, the PLC releases a conveyor, the robot signals it is ready. This interface is defined by I/O signals and coordinated with the PLC program. For PROFINET integration specifics, see the PROFINET tutorial.
For broader context on how robot programming fits into a complete manufacturing automation system, see the manufacturing automation guide. If you are also evaluating FANUC robots, the FANUC robot programming tutorial covers FANUC's TP and Karel languages for direct comparison. A broader comparison of all major robot brands and languages is covered in the industrial robot programming complete guide.
Frequently Asked Questions
What language do ABB robots use?
ABB robots use RAPID (Robot Application Programming Interactive Domain), a proprietary high-level language developed by ABB. RAPID runs inside the IRC5 or OmniCore robot controller and handles motion control, I/O, application logic, and error handling. It is not based on IEC 61131-3 languages like PLC programming languages are, though it shares similar structured programming concepts.
What is RAPID?
RAPID is the programming language specific to ABB industrial robots. A RAPID program is organized into modules containing data declarations and routines (PROC, FUNC, TRAP). Motion instructions like MoveJ and MoveL reference robtarget positions, speeddata speed profiles, and zonedata corner rounding settings. RAPID programs are created in RobotStudio offline, on the FlexPendant, or via Wizard Easy Programming for block-based authoring.
How do you program an ABB robot?
There are four methods: (1) write RAPID code directly in RobotStudio or on the FlexPendant; (2) use Wizard Easy Programming for graphical block-based programming on OmniCore controllers; (3) teach positions manually using the FlexPendant jog controls; (4) use RobotStudio offline programming with the virtual controller for full simulation before deploying to the real robot. Most professional applications combine offline RAPID development in RobotStudio with FlexPendant position fine-tuning on site.
What is Wizard Easy Programming?
Wizard Easy Programming is ABB's no-code, graphical programming interface available on the OmniCore controller's FlexPendant. Operators select action blocks (Move, Pick, Place, Wait, Loop, If/Then) and sequence them without writing any RAPID syntax. The OmniCore controller converts the block sequence into a RAPID program. It is designed for simple, repetitive applications where end users need to modify programs without robot programming expertise.
What software do you need to program an ABB robot?
RobotStudio is the primary software for ABB robot programming. It is a free download from ABB's website for basic use (offline programming and simulation require a paid license). RobotStudio includes a virtual controller that runs real IRC5/OmniCore firmware, a 3D simulation environment, a RAPID code editor, and tools for I/O configuration and path generation. For production programming, RobotStudio runs on a Windows PC; the robot itself is programmed via the FlexPendant teach pendant for on-site position teaching and minor edits.


