KUKA Robot codes
KUKA RobotSystemBasic

KRC0947

KUKA Robot KRC0947 - CONSTANT TYPE INCOMPATIBLE WITH EXPR. TYPE IN SWITCH 2284

CONSTANT TYPE INCOMPATIBLE WITH EXPR. TYPE IN SWITCH 2284

This is a KRL compiler error indicating a type mismatch in a SWITCH statement at line 2284. The constant value used in a CASE clause is incompatible with the expression type being evaluated in the SWITCH statement. The compiler cannot match the constant type to the switch expression type, preventing program compilation.

Common Causes

  • CASE constant is declared as a different data type than the SWITCH expression (e.g., INT constant with REAL expression)
  • Using string literals in CASE when SWITCH expression is numeric, or vice versa
  • CASE constant is an enum value incompatible with the SWITCH expression type
  • Type casting was removed or changed between the SWITCH expression and CASE constants
  • Incorrect variable reference in CASE clause that resolves to wrong data type

Troubleshooting Steps

  1. 1Navigate to line 2284 in the KRL source file and locate the SWITCH statement
  2. 2Verify the data type of the expression being evaluated in the SWITCH parentheses
  3. 3Examine all CASE clause constants and ensure they match the SWITCH expression data type
  4. 4Add explicit type casting to CASE constants if needed to match the SWITCH expression type
  5. 5Check variable declarations used in both SWITCH expression and CASE constants for type consistency
  6. 6Recompile the program after correcting the type mismatch to verify the error is resolved

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.