Learn PLCs free
Programming Tutorials17 min read3,382 words

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.

PPI
PLC Programming IO Editorial Team
Sourced guidance with documented review and correction standards

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.

ABB robot programming ecosystem showing RAPID language, RobotStudio offline software, IRC5 and OmniCore controllers, and FlexPendant teach pendant workflow The ABB robot programming stack from RobotStudio PC software through IRC5 or OmniCore controller to RAPID program execution and FlexPendant teach pendant for on-site position fine-tuning. RobotStudio (PC — Windows) Virtual controller (real firmware) RAPID code editor 3D simulation + collision check AutoPath from CAD surfaces Cycle time measurement Sync to robot via Ethernet IRC5 / OmniCore Controller Runs RAPID program modules Inverse kinematics + path planning 6-axis servo loop (1 ms update) I/O config, fieldbus (PROFINET/EIP) EGM — externally guided motion option Virtual controller = identical firmware FlexPendant Jog + teach positions On-site fine-tuning Wizard Easy Programming ABB Robot Arm IRB 120 to IRB 8700 6 servo axes, absolute encoders ±0.02 mm repeatability
ABB robot programming stack: develop and simulate in RobotStudio offline, transfer via Ethernet to the IRC5/OmniCore controller running real firmware, then fine-tune taught positions on the FlexPendant pendant.

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.

RAPID language module structure showing MainModule with PROC main, PickPart, PlacePart routines, robtarget constants, and key motion instructions MoveJ MoveL WaitDI SetDO The hierarchical structure of an ABB RAPID program showing a module containing data declarations, a main PROC entry point that calls sub-procedures, and the motion and I/O instructions used within each routine. MODULE MainModule Data declarations: PERS tooldata, PERS wobjdata, CONST robtarget, VAR num, VAR bool PROC main() MoveAbsJ pHome (safe start) WHILE TRUE DO PickPart; PlacePart; nCycleCount++; ENDWHILE PROC PickPart() WaitDI DI_PartSensor \MaxTime SetDO DO_Gripper, 0 (open) MoveJ pApproach, v500, z10 MoveL pPickPos, v100, fine SetDO DO_Gripper, 1 (close) MoveL pApproach, v200, z10 PROC PlacePart() MoveJ pPlacePos, v400, fine SetDO DO_Gripper, 0 (release) WaitTime 0.2 PulseDO DO_MachineCycle, 0.5 s MoveJ pHome, v500, z50
RAPID program structure: a MainModule holds data declarations; main() calls modular sub-procedures PickPart and PlacePart, each using MoveJ/MoveL motion instructions with speed and zone data arguments.

2. Wizard Easy Programming (block-based)

Four ABB robot programming methods compared — RAPID code, Wizard Easy Programming, FlexPendant teach, and RobotStudio offline with skill level and best-use guidance Side-by-side comparison of the four ways to program an ABB robot showing required skill level, typical use case, and whether each method requires the physical robot to be present. RAPID Code Skill: intermediate–advanced Hardware: RobotStudio or pendant Use: complex welding, assembly Robot needed: optional (VC) Full control and flexibility Wizard Easy Programming Skill: operator / no-code Hardware: OmniCore FlexPendant Use: simple pick-and-place Robot needed: yes (OmniCore) No RAPID knowledge required FlexPendant Teach Skill: technician — field Hardware: real robot required Use: teach positions on fixture Robot needed: yes — on-site Most accurate positions RobotStudio Offline Skill: engineer — advanced Hardware: PC only (virtual ctrl) Use: new cells, major changes Robot needed: no (simulation) Safest for new programs
Four ABB robot programming methods: choose RAPID for complex applications, Wizard for operator-managed simple tasks, FlexPendant teach for on-site position accuracy, and RobotStudio offline for safe new program development.

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:

  • fine as the zonedata argument means the robot stops exactly at the target (zero fly-by). Use fine wherever exact positioning matters — picks, places, and process start points.
  • z10 means 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.
  • v100 for the descent to pick position slows the approach, reducing the risk of part or gripper damage.
  • \WObj:=wLoadStation ties the move to the load station coordinate frame. If the fixture moves, you update wLoadStation once — all targets update automatically.
  • WaitDI with \MaxTime and \TimeFlag is 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

RAPID motion instruction speed and zone data parameters showing MoveJ MoveL speed values v100 to v2000 and zone data fine z1 z10 z50 for path corner rounding Reference chart for RAPID speeddata and zonedata arguments showing common speed values in millimeters per second and zone rounding distances from fine zero fly-by to z50 50mm fly-by with guidance on when to use each setting. RAPID Speed & Zone Data Quick Reference speeddata — TCP Velocity v50 50 mm/s — delicate insertions, press fits v100 100 mm/s — pick / place descent, MoveL final approach v500 500 mm/s — general transit MoveJ, return to home v2000 2000 mm/s — rapid repositioning, open-space moves speeddata also sets orientation speed (°/s) and external axis speed — see built-in table v5 to v7000 zonedata — Path Corner Rounding fine 0 mm — robot stops exactly; use at picks, places, welds z1 1 mm rounding — near-exact, smooth arc at target z10 10 mm fly-by — via-points, approach, retract moves z50 50 mm fly-by — home, large sweep transitions Never use fine at high speed between many targets — each stop/restart cycle hammers gearboxes
RAPID speed and zone data parameters: use v100 with fine at precision pick/place points; use v500 with z10 at intermediate via-points; reserve fine stops only where exact positioning is mechanically required.

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.

#abbrobot programming#RAPIDlanguage#RobotStudio#robotprogramming#FlexPendant#industrialrobots
Share this article:

Related Articles