Workpiece Alignment (CYCLE998 & Frames)
You clamp a plate, probe it, and it’s sitting a degree and a half off true. On a Siemens SINUMERIK you don’t loosen the vise and re-tap it — you measure the error and write it into a frame, and every program then runs on the part as it actually sits. The measuring cycle that does the measuring-and-correcting is CYCLE998 “3D – align plane”; the thing it writes into is a frame (a settable work offset or the base frame). This is the SINUMERIK counterpart to Fanuc’s G54.4 Workpiece Setting Error Compensation and Heidenhain’s 3D basic rotation. This page is derived from Siemens’ SINUMERIK 840D sl Measuring Cycles manual (A5E44904897B AB, 06/2019), §3.3.19, and the NC Programming manual (A5E47432823B AA, 06/2019), §3.8.
What CYCLE998 Does
CYCLE998 “3D – align plane” determines and corrects the angular position of a three-dimensional inclined plane on a workpiece by measuring three points. The angles are relative to rotation about the axes of the active plane (G17–G19). When you tell it to correct, it writes the measured angular error into the rotary components (rotation) of the specified work offset — the translatory components are left unchanged, to be set by a later edge/corner measurement. There is a hard limit: CYCLE998 can measure a maximum angle of −45° to +45°. Afterward, on a machine with orientation transformation set up (swiveling / TRAORI), the probe can be aligned perpendicular to the measured plane.
⚠ Two things must be true around it. First, the probe has to be calibrated (CYCLE976) — an uncalibrated probe hands every alignment its own error. Second, because CYCLE998 corrects rotation only, a part it has aligned still has the wrong zero until you follow with an edge/corner datum measurement (CYCLE977 / CYCLE978) to set the translational offset. The workflow is two steps: align the plane, then set the datum.
Key CYCLE998 Parameters
The cycle’s prototype is PROC CYCLE998(INT S_MVAR, INT S_KNUM, INT S_RA, INT S_PRNUM, REAL S_SETV, …). The three that decide what is measured and where the correction lands:
| Parameter | Digit / value | Meaning |
|---|---|---|
S_MVAR(measuring variant) | UNITS 5 | Measure edge (one angle). |
UNITS 6 | Measure plane (two angles) — the 3D align-plane variant. | |
HUNDREDS 1 | Correction target: measure and correct the WO (0 = only measure, no correction). | |
S_KNUM(which frame) | UNITS/TENS 1…99 | Number of the work offset (or 1–16 for a basic offset) to correct. |
THOUSANDS 0 | Correct the settable WO (G54…G599). | |
THOUSANDS 1 / 2 / 9 | Correct the channel-specific basic WO / the basic reference / the active WO. | |
TEN-THOUSANDS 0 / 1 | Fine / coarse correction in the frame. | |
S_RA(correction target) | 0 | Correction as a coordinate rotation about the axis resulting from S_MA. |
>0 | Correction into a rotary axis (the channel-axis number of the rotary axis, preferably the rotary table); the angular offset goes into the translatory part of that axis’s WO. |
A representative call from the manual (a third measurement in a probing routine): CYCLE998(100105,10004,0,1,1,1,,1,5,201,1,10,,,,,1,,1,). The probe is called as a tool with a tool-length compensation (3D multi-probe type 710 or mono-probe type 712), pre-positioned over the first measuring point.
The Frame System — Where the Correction Lives
A frame on SINUMERIK is a coordinate transformation — translation, rotation, scale, mirror. CYCLE998 writes into one; you can also write them by hand. The ones that matter for workpiece setup:
| Frame | What it is |
|---|---|
$P_UIFR[n] | Settable frames — the data-storage work offsets. $P_UIFR[1] = G54, [2] = G55, … up to [99] = G599; $P_UIFR[0] = G500 (all off). Writing one doesn’t activate it until the matching G-command runs. |
$P_IFRAME | The currently active settable frame — equals $P_UIFR[$P_IFRNUM]. |
$P_BFRAME | The current base frame (channel-specific, $P_CHBFRAME[0]) — a foundation offset under the settable frames. |
$P_PFRAME | The programmable frame — what TRANS/ROT/… in the part program set. |
$P_ACTFRAME | The total frame — the chained result of base + settable + programmable (plus system frames). It describes the currently valid workpiece coordinate system, and is recalculated whenever any contributing frame changes. |
Writing Frames — ROT/AROT/CROT and TRANS/ATRANS/CTRANS
Rotations and translations are assigned with a matching pair of commands: the program-level ROT/TRANS (absolute) and AROT/ATRANS (additive), and the C-forms CROT/CTRANS used when assigning directly to a frame variable. To bake a measured rotation into a settable frame:
| Statement | Effect |
|---|---|
$P_UIFR[n]=CROT(X,a,Y,b,Z,c) | Write rotations a/b/c about X/Y/Z into settable frame n (= G-offset). |
$P_UIFR[n]=CTRANS(X,10,Y,20,Z,5) | Write a translation into settable frame n. |
$P_PFRAME=CTRANS(X,10,Y,20,Z,5):CROT(Z,45) | Chain translation then rotation into the programmable frame (the : chains frames). |
ROT(X,a,Y,b,Z,c) / AROT(…) | Program-level absolute / additive rotation of the programmable frame. |
A frame is rotate-order sensitive: CROT applies its axis rotations in a defined sequence, and the RT rotation ranges are −180°/+180° about the 1st and 3rd geometry axes but only −90°/+90° about the 2nd — the same ±45°-class constraint you see in CYCLE998.
Reading and Modifying Individual Components
You can touch a single value inside a frame — one offset or one angle — by naming the axis and the component in brackets. The components are TR (translation), FI (translation fine), RT (rotation), SC (scale), MI (mirror):
| Expression | Meaning |
|---|---|
$P_UIFR[n,Z,TR] | The Z translation of settable frame n. |
$P_UIFR[n,X,RT] | The rotation about X of settable frame n. |
R10=$P_UIFR[$P_UIFRNUM,X,RT] | Read the X-rotation of the currently active settable offset into R10. |
$P_PFRAME[X,TR]=25 | Modify the X translation of the current programmable frame — applies immediately. |
This is how a probing macro nudges just the rotation the measurement found while leaving the datum translation alone — exactly the “correct the rotary components, leave the translatory components” behavior CYCLE998 implements.
Don’t Confuse CYCLE998 with CYCLE996
These sit next to each other in the measuring-cycles manual and both involve angles, but they do opposite jobs. CYCLE998 corrects a workpiece — it measures how the part is mis-set and writes a frame. CYCLE996 is machine kinematic calibration — it measures a reference sphere in several rotary-axis positions to calculate the geometric vectors that define the 5-axis transformation itself (the TRAORI and TCARR swivel data set). CYCLE996 must run without an active kinematic transformation and is for machine start-up, service after a collision, or checking the kinematics — not for setting up a part. Use CYCLE998 to true a workpiece; use CYCLE996 to true the machine.
Machine Data & Setting Data That Affect This
The measuring cycles are configured largely through setting data (the general and workpiece measuring masks) plus the frame/channel machine data that decide which frames exist and how they chain. Exact numbers where the manual gives them; where it describes a mask by name, that’s noted — the probe and measuring behavior must be commissioned by the machine-tool builder.
| Item | What it controls |
|---|---|
SD 54760 $SNS_MEA_FUNCTION_MASK_PIECE | General workpiece-measuring function mask — governs which CYCLE998 options (e.g. empirical-value memory, display fields) are available. |
Probe-parameter field (selected by S_PRNUM) | Which stored probe calibration data set (ball diameter, trigger offsets) the cycle uses; the probe must be a calibrated tool of type 710 or 712. |
Settable-frame count / $P_UIFR dimension | How many settable frames (G54…G599) exist — a channel machine-data configuration set by the MTB. |
Base-frame configuration ($P_CHBFRAME count, chaining/mask MD) | Whether and how the channel-specific base frames and the base reference participate in $P_ACTFRAME — determines what S_KNUM’s “basic” targets write into. |
Setting-data and frame-configuration numbers beyond SD 54760 are commissioning data set by the machine-tool builder — see the SINUMERIK Measuring Cycles manual §4 and the NC Programming manual §3.8 (Coordinate transformations / frames).
See also — the same idea on other controls: Fanuc measures a mis-set part and rotates-then-shifts the coordinate system with G54.4 Workpiece Setting Error Compensation; Heidenhain uses 3D basic rotation (a probed preset with spatial rotation). For the neighbouring Siemens features: Swivel Plane (CYCLE800) for deliberately tilted planes and 5-axis transformation (TRAORI) for tool-tip tracking. For how workpiece alignment relates to tilted-plane and TCP machining across brands, see the cross-control primer on TWP and TCPM.
Sources: SINUMERIK 840D sl / 840D / 840Di sl Measuring Cycles Programming Manual, A5E44904897B AB (06/2019) — §3.3.19 3D – align plane (CYCLE998), §3.3.23 3D – kinematics (CYCLE996), §4.1.6 CYCLE998 measuring cycle parameters; and SINUMERIK 840D sl / 840D / 840Di sl NC Programming Programming Manual, A5E47432823B AA (06/2019) — §3.8 Coordinate transformations (frames), §3.8.2.1 value assignments (CTRANS/CROT), §3.8.2.2 reading and changing frame components (TR, FI, RT, SC, MI).
Have a question or want to contribute?
Contact us with corrections, additions, or topics you'd like covered.
Get in Touch