KUKA KRC4 industrial robot controller proxy
AxoKrc4 (namespace AXOpen.Components.Kuka.Robotics.v_5_x_x) is the
controller proxy for robots driven by a KUKA KRC4 controller.
It extends AXOpen.Core.AxoComponent and implements
AXOpen.Components.Abstractions.Robotics.IAxoRobotics, exposing all programme
and motion commands as AxoTask instances that advance their state machine
inside the component's Run() call.
KRC5 has an equivalent proxy — see AxoKrc5. The two classes
share an identical public API (same task surface, same Config/Status/IO
layout, same error catalogue) and the same AXOpen slot layout: slot 1 reserved
(empty), slot 2 = DIO512 with 64-byte cyclic I/O. Only the vendor GSDML and
PROFINET device template differ between them.
- Programme control —
StartAtMain,StartProgram,StopProgram,StartMotorsAndProgram,StopMovementsAndProgram. - Motor control —
StartMotors,StopMotors. - Motion commands —
StartMovements(movementParams),StopMovements, and a combinedStartMotorsProgramAndMovements(movementParams). - Safety-interlocked task execution — every task checks
Inputs.Manual,Inputs.Automatic,Inputs.AlarmStopActive,Inputs.UserSafetySwitchClosed, andInputs.Errorwhile busy (error IDs 20001–20005). - Hardware wiring — consumes a PROFINET device identifier; the
Run()method auto-resolves the child slot layout (slot 1 safety-module = empty, slot 2 = 512 DI / 512 DO) viaReadSlotFromHardwareIDandReadHardwareIOAddressduring first cycle. - Cyclic I/O transfer —
Siemens.Simatic.DistributedIO.ReadData/WriteDataon slot 2 each cycle (error IDs 1201 / 1231 on transport failure). - Tool / area / position / coordinate outputs driven from
MovementParameters. - Hardware diagnostics task (
HardwareDiagnosticsTask) and two on-delay info/error timers (Config.InfoTime,Config.ErrorTime,Config.TaskTimeout).
The component is configured via the nested Config : AxoKrc4_Config
member. Adjust these before invoking Run(); they can also be set from the
commissioning UI.
| Parameter | Type | Default | Purpose |
|---|---|---|---|
Config.InfoTime |
LTIME |
LT#2S |
Delay before a task publishes a potential (waiting-for-signal) message. Controls how long the component waits silently on an expected input before surfacing progress via TaskMessenger. |
Config.ErrorTime |
LTIME |
LT#5S |
Delay before _errorTimer.output throws the currently-executing task. Acts as a per-step watchdog on KRC4 responses. |
Config.TaskTimeout |
LTIME |
LT#50S |
Hard upper bound for a task's total duration. 0s disables the timeout (used in the showcase so commissioning demos never self-abort). |
Config.HWIDs |
AxoKrc4_HWIDs |
— | Device hardware identifiers, auto-populated on first Run() from the hwID argument and the slot layout. |
Most of the initialization variables come from the I/O system. The example below is for demonstration purposes.
[!INCLUDE IntializeAndRun]
View the library source at AxoKrc4.st.
The .NET twin for AxoKrc4 is generated by ixc from the ST source and
extended by AxoKrc4.cs (partial class) under src/AXOpen.Components.Kuka.Robotics/AxoKrc4/v_5_x_x/.
The partial wires the runtime messenger dictionaries (InitializeMessenger,
InitializeTaskMessenger) and exposes ErrorDescription / ActionDescription
helpers on AxoKrc4_Component_Status so the HMI can render the active step.
View the .NET twin source at AXOpen.Components.Kuka.Robotics/AxoKrc4.
AxoKrc4 ships a dedicated Blazor view (AxoKrc4View.razor) inside
AXOpen.Components.Kuka.Robotics.blazor. When RenderableContentControl
inspects an AxoKrc4 context, it picks this view automatically based on the
Presentation attribute. Operator commands are grouped into two tabs —
Movements (Start/Stop Movements, Restore, Reset All Outputs, with movement
parameters inline) and Power & Program (motor and programme tasks) — laid
out as a uniform 2-column grid. If you prefer the generic AxoComponent
rendering, use RenderableContentControl directly.
Available Presentation values: Status-Display, Command-Control, Service-Control, Spot, Compact.
View the Blazor view at AxoKrc4View.razor.
The raw GSDML and matching PROFINET device template for KRC4 live inside the
library package so AxoKrc4 can be wired up without fetching files from the
vendor:
- GSDML —
ctrl/assets/kuka_krc4/GSDML-V2.33-KUKA-KRC4-ProfiNet_5.0-20181102.xml— vendor GSDML for Siemens hardware-catalog import. - HW template —
ctrl/assets/kuka_krc4/kuka_krc4_dio512.hwl.yml— PROFINET device template expected byRun()(slot 1 empty, slot 2 =512_DI_DO, 64-byte cyclic I/O).
The showcase copies the template into showcase/app/hwc/library_templates/kuka_krc4/
so application builds do not need a catalog round-trip.
PROFINET hardware template at showcase/app/hwc/library_templates/kuka_krc4/kuka_krc4_dio512.hwl.yml.
The template provisions a KRC4 as a PROFINET device with two slots:
| Slot | Module | Purpose |
|---|---|---|
| 1 | (safety module, left empty by the template) | Reserved — AxoKrc4.Run() verifies this slot resolves to HwID_None = 0. |
| 2 | 512_DI_DO |
64-byte in / 64-byte out PROFINET I/O cyclically transferred by the component. |
Run() takes a single hwID : UINT that identifies the KRC4 device in the
configured hardware layout. The component then:
- Calls
ReadSlotFromHardwareID(hwID)to obtain the device's geographic address. - Reads the hardware ID of slot 1 and asserts it is
0(no safety module wired — error 710 otherwise). - Reads the hardware ID of slot 2 (the 512 DI / 512 DO module) and caches
it in
Config.HWIDs.HwID_512_DI_DO. - Calls
ReadHardwareIOAddresson slot 2 and asserts it exposes exactly 64 input and 64 output bytes (error 726 otherwise). - Each cycle thereafter:
Siemens.Simatic.DistributedIO.ReadData/WriteDatatransfer the 64-byte blocks bound toInputs/Outputs.
Use the AXOpen.Showcase.HwIdentifiers#{device}_HwID constants to supply
hwID from application code (as the showcase does with kuka_rb1_HwID
for the KRC4 instance).