Error code: KAREL deployment · Category: Programming · Controllers: R-30iB, R-30iB Plus, R-J3iC, CRX-10i
You wrote a clean little KAREL routine, compiled it on your laptop, FTP’d the .PC to the robot, hit SELECT, and the controller refuses to see it. Or it sees it but cannot run it. KAREL has three failure modes on FANUC controllers and they hit in a specific order: wrong KTRANS version, missing license option, or corrupted transfer. We see all three in roughly that order on customer cells, and the fix path is the same every time. At Probot Systems we maintain KAREL utilities for fleet rollout, so this workflow gets exercised on R-30iB and CRX cabinets every week.
This post is written for technicians and integrators deploying KAREL (.PC) programs to FANUC controllers. It assumes you have a .KL source and access to KTRANS or the equivalent in ROBOGUIDE. If you are looking at PRIO-620 or PROG-040 errors that came from a KAREL program calling motion, those have their own posts.
KAREL is FANUC’s higher-level programming language. Source files are .KL, compiled binaries are .PC, and the compilation is done off the robot by KTRANS (a Windows command-line tool). The robot only ever sees the .PC file, and the controller checks three things before it will run it: the binary is intact, the KAREL option is licensed, and the binary was compiled for the running firmware version.
Although there is no single FANUC alarm called “KAREL compile error”, the controller does post PROG-040 Already locked by other task when KAREL calls overlap with motion. Per the manual: “Cause: Motion control for the specified group was already reserved by another program. Remedy: Check the other running programs to determine who has motion control.” If you ever see PROG-040 from a KAREL helper, the helper is configured with a motion group it does not actually need.
Likewise, PRIO-620 PNIO(C) station deactivated turns up when a KAREL utility tries to read fieldbus data and the slave is not present, the manual notes: “The device whose Show error when deactivated setting is ON is deactivated. Remedy: Check the station specified the station number, and activate it.” Both are downstream of a successful KAREL load, not the compile itself.
In plain terms: the three pre-flight checks (translator match, license, clean binary) are what gate the program. If any one fails, the controller silently refuses to run it or posts a generic “program not found” message on SELECT.
%INCLUDE klevkmsk and similar headers for the system data types. If your source is missing the include, KTRANS reports undefined identifiers in the listing file (.L). Match the structure FANUC ships with its KAREL Reference Manual.Step 1. Read the controller firmware version. MENU > STATUS > Version ID. Write down the major.minor (e.g., V9.40P/12).
Step 2. Check your KTRANS version. The version is in the file name (KTRANS940 for V9.40, etc.) or in the .L listing header. Major.minor must match the controller. A patch difference (V9.40 vs V9.41) is usually OK, a minor difference (V9.40 vs V9.50) is not.
Step 3. Confirm the KAREL option is loaded. MENU > STATUS > Version ID > F1 [ORDER FILE]. Look for R632 or J632 entries. If absent, KAREL is not licensed on this controller and no amount of correct KTRANS will help.
Step 4. Re-FTP the file in BINARY mode. From a command-line FTP client: type binary before put my_program.pc. From WinSCP: set transfer mode to Binary in the session preferences. Open the .PC with a hex editor on both sides if you are unsure: byte-for-byte identical means binary transfer was clean.
Step 5. Select the program. SELECT > F1 [TYPE] > KAREL Programs. If it does not show in the list, the load failed silently. If it shows but RUN fails, motion ownership is the issue (see PROG-040 above) and the manual fix is to confirm “Check the teach pendant enable switch and other running programs to determine who has motion control.”
For a version mismatch:
Recompile with the matching KTRANS. If you do not have it, install ROBOGUIDE matching the controller version and use its built-in KTRANS. ROBOGUIDE V9.10, V9.30, and V9.40 each ship with the right translator for their respective firmware. Do not paste a V8 .PC into a V9 cabinet.
For a missing KAREL option:
This is a licensing fix. Order R632 (KAREL Programming Option) from FANUC for the affected serial number. The option file is added during a controlled start. There is no software workaround.
For a corrupted binary:
Re-transfer in binary. A Reddit thread on a Fanuc commenter utility built around KAREL notes that the .PC must be transferred binary and selected from the TP under SELECT > KAREL Programs (reference). A clean binary FTP, then SELECT, should work in under 30 seconds.
For an INCLUDE error:
Open the .L listing file produced by KTRANS. The first undefined identifier tells you which system include is missing. Add the appropriate %INCLUDE directive (typical headers: klevkmsk, klevccdf, kliosop). The FANUC KAREL Reference Manual lists all of them with their purpose.
For a KAREL program that loads but fails to call from TP:
Confirm the call is CALL my_program and not CALL my_program( ). The argument syntax differs slightly between TP and KAREL. If the KAREL program declares no arguments, drop the parentheses. If it does, declare them with the right types.
Two cases worth a call:
You want to deploy a KAREL utility across a fleet of robots with different firmware revisions. That is a build-system problem (one source, many .PC binaries, automated FTP, controlled-start option deployment), and it is worth doing once correctly rather than every commissioning.
You are debugging a KAREL program that crashes the controller, hangs, or fights a motion task. KAREL has full access to system variables, and a buggy program can lock the cabinet in ways a TP-only program cannot. The fix is usually a re-architecture against the documented motion ownership rules, not more KAREL code.
contact us for a KAREL deployment, or schedule a maintenance preventive visit so the option file, KTRANS version, and KAREL inventory are documented before the next firmware upgrade.
Probot Systems is a FANUC integrator based in Lévis, Quebec serving Canada and the US. We build and deploy KAREL utilities for line-side HMI, data logging, and PLC handshake on R-30iB and CRX cells across both countries. If your KAREL deployment is stuck on “the file is there but the robot will not run it”, that is a quick contact us conversation.
Remplissez le formulaire ci-dessous et nous vous contacterons dans les plus brefs délais.
Fill out the form below, and we will be in touch shortly.