info@artec.bg +359 889 557 337
Artec Robotics
News item

A Guide to the Syntax of KRL (KUKA Robot Language)

Home / News / A Guide to the Syntax of KRL (KUKA Robot Language)

05.03.2025

KRL (KUKA Robot Language) is a programming language used to program KUKA industrial robots. It's powerful and flexible, allowing control of the robot's movements, signal processing, interaction with peripheral devices and much more. Below we provide a complete guide to KRL syntax.

1. Basic elements of KRL

  • Comments:
    Comments start with ; and are used for explanations in the code.
    Example:
KRL comment
  • Variables:
    Variables are declared with the keyword DECL.
    Example:
Variables
  • Data types:
    INT – integer
    REAL – floating-point number
    BOOL – Boolean value (TRUE/FALSE)
    CHAR – character
    STRING – string
    FRAME – coordinate system
    POS – position
    AXIS – robot axes

2. Robot movements

  • LIN (linear motion):
    Motion in a straight line between two points.
    Example:
LIN
  • PTP (point-to-point motion):
    Motion between points without a specific path.
    Example:
PTP
  • CIRC (circular motion):
    Motion along an arc through three points.
    Example:
CIRC

3. Program control

  • IF-ELSE:
    Conditional statements.
    Example:
IF-ELSE
  • FOR loop:
    Repeating a block of code.
    Example:
FOR loop
  • WHILE loop:
    Repeating while a condition is true.
    Example:
WHILE loop
  • SWITCH-CASE:
    Choosing between multiple options.
    Example:
SWITCH-CASE

4. Functions and procedures

  • Defining a function:
    Functions are defined with DEF.
    Example:
 DEF
  • Calling a function:
    Example:
Calling a function
  • Function parameters:
    Example:
Function parameters

5. Working with signals

  • Reading an input signal:
    Example:
Input signal
  • Writing an output signal:
    Example:
Output signal

6. Working with tools and coordinate systems

  • Defining a tool (TOOL):
    Example:
TOOL KRL
  • Defining a coordinate system (BASE):
    Example:
BASE KUKA

7. Error handling

  • TRYN-CATCH:
    For handling exceptions.
    Example:
TRYN-CATCH

8. Additional commands

  • WAIT:
    Pausing program execution.
    Example:
WAIT
  • LOOP:
    An infinite loop.
    Example:
LOOP: KRL

9. Sample program

Sample program

10. Additional resources

  • KUKA OfficeLite: A simulation environment for testing KRL programs.
  • KUKA System Software (KSS): Official KRL documentation.
  • KUKA College: Training and courses on programming KUKA robots.

KUKA's official website, where you can find documentation, products and contacts, is at https://www.kuka.com/

On the Artec Robotics “News” page you will find a variety of articles and guides on robotics and automation. Here you'll find useful information about the latest technologies, software solutions and programs that will help you dive deeper into the world of industrial robots and automated systems.

Follow the news from Artec Robotics!

MAKE AN INQUIRY

KRL KUKA
Contact us

Make an inquiry