KRC Basic functions
This page describes the plain KRC editor - the generic viewer used for regular KUKA .src/.dat files that are not built around one customer's fixed VW/VKRC program structure. It is a living document and will be extended as new functions are added to the KRC viewer.





▲ Overview

Unlike the VKRC editor, the KRC viewer does not assume any particular customer's technology package or program layout. Instead it recognizes structure directly in the KRL text itself: Because of this, a point is called local when its declaration lives in the current program's own .dat file, and global (or HOME) when it comes from a shared position pool used by several programs at once (configured separately in the editor's settings). This distinction matters for several of the features below.




▲ Folds - collapsing, expanding and their boundaries

Every ;FOLD / ;ENDFOLD pair, no matter how deeply it is nested inside other folds, can be collapsed or expanded by clicking the black or white triangle next to it, or by placing the cursor in it and pressing Ctrl+Q.

The closing ;ENDFOLD line of a fold is shown or hidden together with the rest of that fold's content - it behaves exactly like any other line inside the fold, not like a separate, always-hidden marker. This mirrors the way KRL itself always requires an explicit closing keyword for every block (IF/ENDIF, WHILE/ENDWHILE, SWITCH/ENDSWITCH, ...): the editor shows you the matching ;ENDFOLD whenever the fold is open, so the closing boundary is never left implicit or guessed.




▲ Point editor

The KRC editor has a built-in point editor for the three basic motion types - PTP, LIN and CIRC. It edits the point itself (coordinates, in both the cartesian and the joint representation, with a 3D preview) and the inline form of the motion - type, velocity, approximation, point name, tool, base - so a complete motion can be changed from one window without touching the raw fold text.

It opens with a double click on the motion fold, with Edit point coordinates from the editor's context menu, or with a double click on the point in the point table.

Insert motion point (the robot toolbar) works the other way round: it puts a new PTP motion on the line of the cursor - with the coordinates at zero, tool 0 and base 0, and with the next free point number proposed - and opens the same window on it, so the new motion is finished in one place. Closing that window without Apply undoes the insertion. See Inserting a new motion.


Point editor - full description » (coordinates and axes, the motion parameter bar, renaming a point, changing the motion type, joint versus cartesian points, what Apply writes and where, and the safety options for global positions)




▲ Point table

The table below the editor lists the positions of the open program - cartesian points and joint points in two separate tables, each with the tool, base and motion parameters that belong to them. The context menu has a submenu Path (TCP) with the path tools (path length, motion time, CIRC information, C_DIS and TRIGGER WHEN PATH checks, inserting a point on the path at a given distance).


In the picture above, XP1 to XP4 are used by the motions visible in the program text, XP5 is declared in the same .dat file but no motion refers to it, and the lower table holds the two joint positions XHOME1/XHOME2, which come from $config - a global file shared by every program of this robot.

▲ Columns, icons and colours


The strip above each table shows the selected position in the other representation: axis values for a Cartesian point, Cartesian coordinates for a joint one. For a joint position it also shows the S (status) and T (turn) of that pose, computed from the axis values - an E6AXIS declaration has no such fields, and they are needed every time the position is to be written as E6POS.
▲ Showing unused declarations

Settings » KRC » Others » Show points declared in .dat but not used in the program (enabled by default) controls whether the grey italic entries described above are listed at all.

With the option on, the table answers the question "is this position still there?" - after a rename, after deleting a motion, or when a .dat file was written by another tool. With it off, the table lists only positions that some motion actually uses, exactly as before this option existed.

A double click on the name of a used point moves the cursor of the editor to its motion. For an unused one there is no line to jump to, so the editor says which .dat file the declaration lives in instead of doing nothing.

The option also covers unused global/HOME positions, and a shared position file usually holds many more of those than the open program has local points. If the table becomes too crowded in a cell with a large shared position pool, this is the switch to turn off.

▲ Editing values in the table

The table lets you edit:

Local and global/HOME points are saved to disk very differently - this is important to understand before editing either of them:
  • a change to a local point (declared in the current program's own .dat file) is only kept in memory and shown in the table right away - it is written to the .dat file when you save the program (the same Save action you use for the rest of the file);
  • a change to a global or HOME point is written to its own shared .dat file immediately, as soon as you confirm it - there is no "unsaved changes" state for these points, and saving (or not saving) the program you currently have open has no effect on them at all.

Because editing a global/HOME point changes a file shared with other programs right away, the first time you do this in a running session the editor shows a confirmation dialog explaining exactly this, with a "Don't show this message again" checkbox (it resets the next time the program is started, so the warning is never permanently silenced). If you answer "No" to that dialog, or the write to disk fails for any reason (for example the target file is locked by another running copy of the editor), the table cell snaps back to the value that is actually stored on disk, so it never keeps showing a value that silently failed to save.

▲ Right-click menu of the point table

What the menu offers depends on the cell that was clicked and on how many rows are selected. Both tables - cartesian and joint - have the same menu, except for the distance.


The picture shows the menu for two selected points, opened on the Y column.

Entry Shown when What it does
Jump to point definition right-click on the point name or on the Module column opens the .dat file the declaration lives in and goes straight to it - for local, global and unused points alike. In the Module column the menu also has Open file (see Module column).
Set equal <column> value for selected points right-click on a coordinate column (X..C / A1..A6, E1..E6) asks for a value and either sets it in that column of every selected point (Set new value) or adds it to their current values (Add to the old value) - for example to shift a group of points by 10 mm in Z. Global points touched by the change are written once per shared .dat file, not once per point.
Set equal Tool value / Base value for selected points right-click on the Tool or Base column sets the same tool or base number for all selected points, with one common question whether their coordinates should be recalculated for the new frame (see Editing values in the table).
Cartesian distance exactly two points selected in the cartesian table shows the TCP distance of the two points and the differences |X|, |Y|, |Z|, |A|, |B|, |C|. If the points use a different tool or base, the window warns that the result is only a difference of raw coordinates, not a real physical distance.
Copy <name> coordinates
Assign coordinates to <name>
exactly one point selected; Assign only when the clipboard holds a copied position copies the position of one point together with its tool and base, and assigns it to another one - see Copy and assign coordinates below.
Copy selected coordinates as plain text at least one row selected copies the selected rows, with a header row, as tab-separated text - ready to be pasted into a spreadsheet or a report.
Select all the table is not empty selects all points of the table, e.g. before one of the "Set equal" entries.


▲ Copy and assign coordinates

Copy coordinates and Assign coordinates to ... (right-click menu of the table, and of the program text) move a complete position from one point to another. What travels is the position itself together with its tool and base - not the motion parameters. Both tables offer them, the cartesian one and the joint one: a position stored as axis values is an ordinary point, and the clipboard carries the storage form with it, so the receiving side always knows which of the two it got.

Typical uses: The editor checks three things before it writes anything: A point that is declared but not used by the program (grey italics in the table) can be a source and a target of both commands as well. Such a point has no motion fold, so it also has no explicit tool and base: the editor looks for its frame declaration by name (XP5 → FP5) and, when there is none, copies the position alone.

When tool and base are unknown on either side, they cannot be compared, so the editor cannot offer to recalculate the position either. It says so and asks whether to assign the numbers exactly as they were copied - which is right when both points use the same tool and base, and wrong when they do not. For a joint point the question does not arise, because axis values do not depend on tool or base.

▲ Module column - opening the declaration

The right-click menu of the Module column offers:



▲ Copy, cut and paste of points and folds

Selections can be copied, cut and pasted (Ctrl+C / Ctrl+X / Ctrl+V) the same way as anywhere else in the editor, with two rules specific to KRC's fold-based structure:



▲ Protect Folds

KRC menu » Protect Folds is a checkbox, enabled by default. While it is on, the editor blocks typing, Delete, Backspace, Enter and cut/paste inside the content of any fold, including nested subfolds - only plain program logic that sits outside every fold can still be edited directly as text.

Consequence: to change something that lives inside a fold - for example a motion point's coordinates, or a technology command's parameters - use the dedicated tools described on this page (the point editor, the point table, or double-clicking a recognized command fold to reopen its parameter dialog) instead of editing the raw text. This is intentional: fold content usually carries data (point/frame/motion references, or a technology command's parameters) that is not fully visible in the plain text, so free-form text edits could silently desynchronize what is shown from what is actually meant.

Protect Folds can be switched off from the same menu (or from the editor's Settings, KRC page) if you specifically need to edit raw fold text by hand - for example to fix a fold that is not recognized by the editor at all. Doing so is at your own risk: with protection off, an edit that leaves a fold's structure inconsistent may also clear the file's Undo/Redo history (see Known limitations below).




▲ Inserting commands from a KRL Command Catalog (.kop / .kfd)

KRC menu » KRL Commands is a submenu built from a KRL Command Catalog: a folder containing .kfd files and/or .kop packages, each describing one or more command categories and the commands ("InlineForms") that can be inserted from them. This is the same file format that KUKA's own smartHMI, WorkVisual and OrangeEdit use for their own inline command templates - it is not a format invented by this editor.

The catalog folder is configured once, in Settings » KRC » General » KRL Command Catalog.

The catalog is only scanned once, when the program starts. A command defined in a .kfd/.kop file will not appear in the KRL Commands menu until:
  • the file has actually been placed inside the configured catalog folder, and
  • the editor has been (re)started afterwards - simply adding, editing or replacing a file in that folder, or changing the folder path in Settings, does not update an already open KRL Commands menu.
In other words: a customer's or a technology package's commands (for example a specific spot-welding or gluing package) must first be imported this way before they can be inserted from the menu at all.

Selecting a command from the menu opens a parameter dialog (if the command has any configurable parameters), where you choose the values before the command is inserted at the cursor. When it is inserted into a program recognized as a motion point, the generated text is automatically wrapped as its own foldable ;FOLD ... ;ENDFOLD block, and double-clicking that fold again later reopens the same parameter dialog, prefilled with the values it currently has, so they can be changed.

A plain PTP/LIN/CIRC motion always opens the built-in point editor on double-click, even when the loaded catalog happens to contain a matching command template - the built-in editor offers more for these three motions (coordinates, both representations, 3D preview) than a generic parameter form does.





▲ Syntax checking - what "Check syntax" actually verifies

KRC menu » Check syntax (F6) parses the program against the KRL language grammar built into the editor.

This check is limited to the language elements that have actually been programmed into the editor. It recognizes the structure of the KRL language itself - motion commands, control flow, variable declarations and so on - but it does not know the specific shape (parameter count, valid ranges, allowed choices) of any customer- or vendor-defined technology command.

A command generated from a .kop/.kfd catalog (see above) becomes ordinary KRL text once it is written into the program, so "Check syntax" cannot verify that its parameters still match what that specific command's definition allows - that check only happens once, at the moment the command is inserted (or re-edited) through its own parameter dialog. A command typed or pasted by hand, or one that belongs to a package the editor was never given (not imported as described above), will not be flagged by "Check syntax" even if it violates that package's own rules, because the checker simply does not know that command exists.




▲ Known limitations