KUKA Robot codes
KUKA RobotSystemBasic

KRC0802

KUKA Robot KRC0802 - NAME NOT DECLARED AS SIMPLE VARIABLE 2138

NAME NOT DECLARED AS SIMPLE VARIABLE 2138

A variable or identifier referenced in the KRL program has not been declared as a simple variable type. This compilation error occurs when the KRL compiler encounters a symbol that is used but lacks proper variable declaration with an appropriate data type.

Common Causes

  • Variable used in code without prior declaration statement
  • Typo in variable name that doesn't match any declared variable
  • Variable declared in wrong scope or program module
  • Attempting to use a reserved keyword or built-in function name as a variable
  • Missing data type specification in variable declaration (e.g., REAL, INT, BOOL, AXIS)

Troubleshooting Steps

  1. 1Review the KRL source code line indicated by the error message and identify the undeclared variable name
  2. 2Check the variable declaration section at the beginning of the program or in included header files
  3. 3Verify variable name spelling and capitalization matches between declaration and usage
  4. 4Add explicit variable declaration with appropriate type (DECL statement) if missing
  5. 5Ensure variable scope is correct - if using external variables, verify they are properly imported or accessible
  6. 6Recompile the program after corrections and verify the alarm no longer appears

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.