KUKA Robot codes
KUKA RobotSystemBasic

KRC0801

KUKA Robot KRC0801 - LOCAL SUBROUTINE NOT ALLOWED IN PROCESS COMMANDS 2137

LOCAL SUBROUTINE NOT ALLOWED IN PROCESS COMMANDS 2137

This alarm indicates that a local subroutine (function or procedure with local scope) has been incorrectly used within a process command context in KRL code. Process commands require globally accessible subroutines, not locally scoped ones, which violates the KRL program structure rules.

Common Causes

  • Attempting to call a local function from within a PROCESS or background task command
  • Declaring a subroutine with local visibility inside a scope that is referenced by process commands
  • Incorrect use of nested function definitions within process-oriented program sections
  • Mixing local and global scope declarations in multi-threaded or background execution contexts
  • Legacy code migration where local subroutines were not properly converted to global scope for concurrent execution

Troubleshooting Steps

  1. 1Review the KRL source code and identify which subroutine is being called from the process command that triggered alarm 2137
  2. 2Check the subroutine declaration and verify that it is defined with GLOBAL visibility or at the program root level, not within a local scope
  3. 3Convert the local subroutine to a GLOBAL subroutine by moving its declaration outside of any enclosing local scope or function
  4. 4Ensure all subroutines called from PROCESS, BACKGROUND, or concurrent execution contexts are accessible at the global program level
  5. 5Recompile the KRL program after making scope corrections and verify syntax in the KUKA IDE
  6. 6Test the program execution to confirm the alarm no longer occurs and process commands execute properly

Seeing Multiple Alarms?

Seeing another alarm with this one? Enter the code.

Get machine-aware diagnosis

AxisMD logs alarms against your actual machines, tracks patterns, and gives AI context your manual doesn't have.

Start free

Was this guide helpful?

Always verify with your machine manual or a certified technician before performing service procedures.