S7-1200/S7-1500 KUKA Robot PROFINET Communication

David Krause10 min read
SiemensTIA PortalTutorial / How-to
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Overview

Connecting a KUKA robot to a Siemens S7-1200 or S7-1500 over PROFINET requires the KUKA mxAutomation technology package. mxAutomation is a standardized PROFINET interface that exposes the motion kernel of the KR C4 / KR C5 robot controller to an external PLC, allowing the PLC to issue motion commands (PTP, LIN, CIRC) and read status information using cyclic I/O and acyclic services. Two artefacts are mandatory on the PLC side: a GSDML device description file for the robot controller, and a function-block (FB) library that wraps the cyclic frame and translates it into high-level motion calls. Both are not part of the free TIA Portal installation; they are delivered by KUKA as part of the licensed mxAutomation option.

This article walks through obtaining the GSDML, installing it in TIA Portal V15 or later, importing the FB library, configuring the PROFINET device, and commissioning a working handshake. The same procedure applies to both S7-1200 (firmware V4.2 or later, PROFINET IO Controller) and S7-1500. Code samples and parameter values are valid for TIA Portal V15, V15.1, V16, V17, and V18 with mxAutomation library version 4.x or 5.x unless noted.

Licensing note: mxAutomation is a commercial KUKA technology package. The GSDML and the TIA Portal FB library are released only after the option is purchased and the WorkVisual project is enabled. Plan the licensing, controller software version, and PLC hardware revision in advance to avoid mid-project rework.

Architecture and Communication Model

The PLC acts as PROFINET IO Controller. The KUKA robot controller (KR C4 compact, KR C4, KR C5) acts as PROFINET IO Device. Communication is divided into two channels:

  • Cyclic I/O — a fixed slot structure (typically 32 bytes input / 32 bytes output) carries the live command, status, override, and error flags every PROFINET update cycle (1–4 ms).
  • Acyclic services — used for parameter read/write, job submission (program selection, variable set), and diagnostics via the mxAutomation library's read/write FBs.

From the application programmer's point of view, you do not touch the raw frame. You call high-level FBs such as FB_MxCommandPTP, FB_MxCommandLIN, FB_MxCommandCIRC, FB_MxAcknowledge, and FB_MxReadWrite. The library handles encoding/decoding and handshake bits.

Prerequisites

Hardware

Component Requirement
PLC S7-1200 CPU 1214C/DC/DC or higher, or any S7-1500 CPU. PROFINET interface required.
Robot controller KUKA KR C4 / KR C4 compact / KR C5 with PROFINET option
mxAutomation option Installed and enabled on the robot controller (WorkVisual project)
Network PROFINET-compliant Cat 5e cable, switch optional, both devices on same subnet
Engineering PC TIA Portal V15 (or later) installed; KUKA.WorkVisual access for robot side

Software and Licensing

  • TIA Portal V15 or later (V15 introduced native KUKA integration; V16+ refined it).
  • KUKA mxAutomation library file (e.g. KUKA_mxAutomation_V5_x.zal15) corresponding to your TIA Portal version.
  • KUKA GSDML file (e.g. GSDML-V2.3-KUKA-KR_C4-xxxxxxxx.xml) matching the robot controller firmware and mxAutomation version.
  • Valid mxAutomation license on the robot controller (the option is enabled in WorkVisual and registered with KUKA).
If you cannot find the GSDML in your delivery, KUKA's engineering portal and your local KUKA representative are the only official source. The GSDML is not redistributed by Siemens.

Step 1 — Obtain the GSDML File and FB Library

  1. Identify the exact robot controller model and the mxAutomation version installed on it (visible in WorkVisual under Project > Options or in the robot's HMI under Help > Information).
  2. Contact your KUKA sales representative or the local KUKA subsidiary to request the matching GSDML file and the TIA Portal library. The deliverables are versioned together; do not mix a V4 library with a V5 GSDML.
  3. Verify the SHA-256 of the delivered files against the KUKA release notes. The GSDML is a plain XML file; you can open it in a text editor and confirm the vendor ID 0x015D and the device family name (e.g. KUKA-KR_C4-mxAutomation).
  4. Save both files in a known folder, e.g. D:\KUKA_Integration\GSD\ and D:\KUKA_Integration\Library\.

Reference documentation:

Step 2 — Install the GSDML in TIA Portal

  1. Open the TIA Portal project for the S7-1200 / S7-1500 station.
  2. Choose Options > Manage general station description files (GSD).
  3. Set the source path to the folder where the GSDML was saved.
  4. Select the file and click Install. TIA Portal validates the schema and copies it into the local GSD catalog.
  5. Close the dialog. The KUKA device now appears in the hardware catalog under PROFINET IO > Other field devices > KUKA > KR C4 mxAutomation (or the equivalent KR C5 family on newer controllers).
If the device does not appear after installation, restart TIA Portal. The GSD index is loaded only once per session. TIA Portal V15 SP1 and later also expose a KUKA entry under the Robot systems catalog if the matching HSP (Hardware Support Package) is installed; the GSDML method is still the universal fallback.

Step 3 — Import the mxAutomation Function-Block Library

  1. Switch to the Libraries pane in the project tree.
  2. Right-click and choose Open global library > Open library. Browse to the .zal15 (or older .zap14) file you received from KUKA.
  3. Drag the master copies of the FBs and the PLC tag DB into your project. Typical blocks include:
    • FB_MxCommand — dispatcher for the various command types
    • FB_MxCommandPTP / FB_MxCommandLIN / FB_MxCommandCIRC — motion primitives
    • FB_MxAcknowledge — clears pending errors
    • FB_MxReadWrite — acyclic parameter and variable access
    • DB_MxInstance — instance data block per robot
  4. Compile the program blocks to ensure all referenced types resolve.

The library version is stamped in the FB header comment. Mismatches between library and GSDML versions are the single most common cause of cyclic data rejection; both must come from the same mxAutomation release.

Step 4 — Configure the PROFINET Device in the Project

  1. In the Devices & networks editor, drag the KUKA device from the catalog to the PROFINET subnet of the S7 CPU.
  2. Assign a unique PROFINET device name to the robot, e.g. kuka1. The name is case-sensitive and must match the name configured in WorkVisual on the robot side.
  3. Assign a fixed IP address in the same subnet as the PLC, e.g. 192.168.0.50 / 255.255.255.0.
  4. Open the device view of the KUKA station and inspect the slot configuration. The default module provides the cyclic I/O area; do not delete it. The slot number (typically slot 0) determines the I-address and Q-address mapping in the PLC process image.
  5. Note the assigned I and Q addresses. For a 32-byte I/O mapping, expect inputs at e.g. IB 100 – IB 131 and outputs at QB 100 – QB 131.
Parameter Recommended value Note
Send clock 1.000 ms Lowest cycle TIA Portal will offer; matches mxAutomation default
Update time 4× send clock Default PROFINET ratio; do not go below 1 ms with copper cabling
Watchdog 3× update time Default; increase only on noisy links
Reduction ratio 1 mxAutomation does not use IRT
The S7-1200 supports the PROFINET IO Controller role with a single PROFINET interface. The S7-1500 also supports it, including on the second PROFINET port of the CPU. Do not place the KUKA on a CP that is configured as IO Controller in shared device mode; some CPs do not support the required RT class.

Step 5 — Program the Application

The library encapsulates the frame, so the application code is a sequence of FB calls. A minimal motion sequence looks like the following structured text snippet:

// Instance DB
#iDB_MxRobot("kuka1");

// 1. Establish a logical connection (assign the IO addresses)
#iDB_MxRobot.MxIOAddressIn  := 16#64;   // IB 100
#iDB_MxRobot.MxIOAddressOut := 16#64;   // QB 100
#iDB_MxRobot.MxRobotName    := 'kuka1';

// 2. Issue a PTP motion to position {X=0, Y=0, Z=500, A=0, B=0, C=0}
#iDB_MxRobot.Cmd.Cartesian.X := 0.0;
#iDB_MxRobot.Cmd.Cartesian.Y := 0.0;
#iDB_MxRobot.Cmd.Cartesian.Z := 500.0;
#iDB_MxRobot.Cmd.Cartesian.A := 0.0;
#iDB_MxRobot.Cmd.Cartesian.B := 0.0;
#iDB_MxRobot.Cmd.Cartesian.C := 0.0;
#iDB_MxRobot.Cmd.Turn.T1     := 0;
#iDB_MxRobot.Cmd.Turn.T2     := 0;
#iDB_MxRobot.Cmd.Turn.T3     := 0;
#iDB_MxRobot.Cmd.Tool        := 1;
#iDB_MxRobot.Cmd.Base        := 0;
#iDB_MxRobot.Cmd.Velocity    := 50.0;   // % override

FB_MxCommandPTP(
    IO   := #iDB_MxRobot,
    Busy => #busyPTP,
    Done => #donePTP,
    Error => #errPTP,
    ErrorId => #errIdPTP
);

// 3. Acknowledge on error
IF #errPTP THEN
    FB_MxAcknowledge(IO := #iDB_MxRobot);
END_IF;

Coordinates are in mm (linear) and degrees (rotary). Velocity is a percentage of the programmed override. Refer to the library manual for the exact field set of the Cmd UDT; some versions expose a separate Joint struct for axis-targeted moves.

Step 6 — Configure the KUKA Controller Side

  1. In WorkVisual, open the project for the robot and confirm that the mxAutomation option is licensed and active.
  2. Add the PROFINET device and assign the same PROFINET device name (kuka1) and IP address (192.168.0.50) used in the PLC project.
  3. Map the PROFINET signals in the I/O mapping editor. The default mapping is sufficient for most projects.
  4. Transfer the project to the robot controller, cold-start if required, and verify that the controller reports the PROFINET device name as active.
  5. Submit an RSI (Robot Sensor Interface) reset if the mxAutomation option was retrofitted; otherwise proceed to commissioning.

Step 7 — Commissioning and Verification

  1. Download the PLC project to the CPU and switch to RUN.
  2. Open the Online & diagnostics view of the KUKA device. The PROFINET state must transition from Not connected to Connected, no data exchange and finally to Data exchange.
  3. In the watch table, monitor the cyclic input words. Bit MxState.Connected and MxState.Operational must go to 1 within 2 s of the link being established.
  4. From the PLC, call FB_MxCommandPTP with a safe home position. Verify that the robot executes the move and that Done returns TRUE on completion.
  5. Trigger an error condition (e.g. disable the safety circuit) and confirm that Error rises on the FB and that FB_MxAcknowledge clears it once the safety is restored.

Troubleshooting Matrix

Symptom Probable cause Action
KUKA device not visible in TIA Portal catalog GSDML not installed or wrong version Re-install GSDML, restart TIA Portal, verify vendor ID 0x015D
PROFINET state stuck on “Not connected” PROFINET device name mismatch between PLC and WorkVisual Assign identical name on both sides, then power-cycle the robot controller
“Data exchange” reached but MxState.Connected stays 0 mxAutomation option not licensed on the robot Verify the option flag in WorkVisual; check KUKA smartPAD Information page
FB returns ErrorId 16#8001 Library version and GSDML version mismatch Match both to the same mxAutomation release
FB returns ErrorId 16#8002 Robot in E-Stop or safety latch open Restore safety, call FB_MxAcknowledge
Motion starts but stops after 100 ms Override = 0 or motion enable missing Set Cmd.Velocity > 0, check operator enable input on the robot
Acyclic FB_MxReadWrite times out (default 3 s) PROFINET name or IP changed after compile Recompile, download HWCN, and reassign device name in online view
Watchdog trips on the robot Send clock too aggressive for copper cable Increase send clock to 2 ms, update time 8 ms
CPU goes to STOP after first motion call Wrong I/O address bound to FB instance Cross-check MxIOAddressIn/Out with hardware configuration
Safety: Never issue motion commands while personnel are inside the robot cell. mxAutomation does not replace the safety controller; the PROFINET channel is a non-safe command interface. All personnel safeguards, zones, and stop categories must be implemented with a certified safety PLC (e.g. SIMATIC F-CPU) or the KUKA safety controller, wired independently of the mxAutomation I/O.

Version Notes and Compatibility

  • mxAutomation V4.x — compatible with KUKA System Software 8.3 to 8.5, TIA Portal V13 SP1 to V15.1.
  • mxAutomation V5.x — compatible with KUKA System Software 8.6 to 8.7, TIA Portal V15 to V18. Adds 64-byte I/O option and improved acyclic services.
  • KR C5 — requires mxAutomation V5.1 or later; TIA Portal V17 recommended for full catalog support.
  • The Siemens entry 109482123 is updated whenever a compatibility matrix changes; consult it before mixing versions.

Frequently Asked Questions

Where do I get the GSDML file for a KUKA robot?

The GSDML is delivered by KUKA together with the licensed mxAutomation option. It is not redistributed by Siemens. Request the version matching your robot controller and mxAutomation release from your local KUKA representative, and verify the vendor ID 0x015D inside the XML.

Is the mxAutomation function-block library free?

No. The FB library is part of the commercial mxAutomation technology package. After purchasing, KUKA provides a TIA Portal global library file (e.g. .zal15) that is version-locked to the matching GSDML.

Why is the KUKA device not in the TIA Portal hardware catalog after installing the GSDML?

Either the GSDML failed validation or TIA Portal is using a cached index. Close and reopen the project, restart TIA Portal, and re-import the GSDML from Options > Manage general station description files (GSD).

Which TIA Portal version is required for S7-1200 mxAutomation?

TIA Portal V15 or later. S7-1200 CPUs must be firmware V4.2 or higher to act as PROFINET IO Controller with the KUKA GSDML. For KR C5 controllers, TIA Portal V17 is recommended.

How do I clear a persistent ErrorId from the FB?

Call FB_MxAcknowledge with the same instance DB after removing the underlying cause (safety latch, E-Stop, override = 0, etc.). The Done bit of the acknowledgement FB confirms the robot has re-entered the operational state.

Back to blog