KUKA Robot codes
KUKA RobotSystemBasic

KRC0859

KUKA Robot KRC0859 - “WHEN” EXPECTED 2195

“WHEN” EXPECTED 2195

This syntax error indicates that the KRL compiler expected a WHEN keyword at the specified location in the program source code, but found error code 2195 instead. The parser encountered an unexpected token or structure where a WHEN statement should have been present in a conditional or event-handling context.

Common Causes

  • Missing WHEN keyword in an IF-WHEN or SWITCH-WHEN statement structure
  • Incorrect syntax in conditional logic or event handler declaration
  • Misplaced or malformed WHEN clause within a program block
  • Missing or extra parentheses/brackets disrupting the expected syntax flow
  • Copy-paste error or incomplete code refactoring leaving syntax inconsistencies

Troubleshooting Steps

  1. 1Open the KRL source file and navigate to the line number indicated in the alarm message
  2. 2Review the code structure around the error location for missing WHEN keywords
  3. 3Verify that all conditional statements (IF-WHEN, SWITCH-WHEN) follow correct KRL syntax
  4. 4Check for balanced parentheses and brackets in the affected code block
  5. 5Compare the problematic code against KUKA KRL syntax documentation or working examples
  6. 6Correct the syntax error, save the file, and recompile the program to clear the alarm

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.