What Is a Frame on Siemens SINUMERIK?
On SINUMERIK controls a frame is a data record that defines the transition from one coordinate system to another. It carries an offset (translation), a rotation, a scale factor and a mirroring component. The control knows where the workpiece sits and which way it faces entirely through frames.
In the shop this means you do not have to clamp the part in exactly the same place and at exactly the same angle every time. If the part ends up 40 mm to the right and tilted by 7°, you do not rewrite the program — you move the coordinate system onto the part. The program stays the same; the coordinate system moves.
As the source document puts it: using frames, coordinate systems can be translated, rotated, mirrored and scaled, so that the coordinate plane is aligned to the workpiece surface. The result is a clear reduction in programming time and cost.
The coordinate system chain: from MCS to WCS
To understand what a frame does you need to know which coordinate systems the control stacks on top of each other. The frame chain in the Job Planning manual runs as follows:
The X, Y and Z values you write in the part program belong to the topmost system, the WCS. Every step in between is a frame, and they all stack. This is exactly why G54 and TRANS do not cancel each other — they add up.
Types of frame
The source document groups the possible frames as follows:
| Type | How it is activated | What it is for |
|---|---|---|
| Basic frame (basic offset) | G500 and the basic frame variables | Offsets shared by all parts: fixture, pallet or clamping datum |
| Settable frames | G54, G55, G56, G57, G505 … G599 | The classic work offset, measured and entered at the panel |
| Programmable frames | TRANS, ROT, SCALE, MIRROR and their additive versions | Temporary translation, rotation, scaling and mirroring inside the program |
| System frames | Managed by the control (TOROT/TOFRAME, measuring, external zero offset, cycles) | Measuring cycles, alignment to tool orientation, preset, transformations inside cycles |
The active total frame: $P_ACTFRAME
The workpiece coordinate system currently valid in the channel is described by $P_ACTFRAME, which results from chaining all frames acting in the channel in a fixed sequence:
Two of these variables show up constantly in daily work:
- $P_IFRAME — the active settable frame. After G54 is programmed, $P_IFRAME contains the translation, rotation, scaling and mirroring defined by G54. It corresponds to
$P_UIFR[$P_IFRNUM]. - $P_PFRAME — the active programmable frame. It is the frame that results from programming TRANS/ATRANS, ROT/AROT, SCALE/ASCALE, MIRROR/AMIRROR, or from assigning CTRANS, CROT, CMIRROR or CSCALE. It defines the reference between the settable zero system (SZS) and the workpiece coordinate system (WCS).
Whenever one of these frames changes, the control recalculates the current total frame $P_ACTFRAME automatically.
Programmable frame commands
The source document sorts programmable frames into five groups. The table below shows which command is absolute and which is additive:
| Group | Absolute | Additive | Assignment to a frame variable |
|---|---|---|---|
| Offset — coarse (translation) | TRANS, G58 | ATRANS | CTRANS |
| Offset — fine | G59 | — | CFINE |
| Rotation | ROT, ROTS | AROT, AROTS | CROT, CROTS |
| Scaling | SCALE | ASCALE | CSCALE |
| Mirroring | MIRROR | AMIRROR | CMIRROR |
TRANS and ATRANS — translation
TRANS writes an absolute translation into the programmable frame: previously programmed programmable frame components are replaced. ATRANS adds to the current state.
The subprogram (here L10) never changes; only the coordinate system moves. The same approach is used for pallet work, multi-station fixtures and repeating hole patterns.
G58 and G59 — axial coarse and fine offset
The source document classifies G58 as the coarse component of the axial zero offset and G59 as the fine component. The total offset is the sum of the coarse and the fine offset. The fine offset first has to be enabled by machine data:
In practice the fine offset is where small measurement-driven corrections are entered, so the main offset stays untouched.
ROT and AROT — rotation
ROT rotates the coordinate system about the geometry axes and works absolutely; AROT adds to the existing rotation. The Job Planning manual states the value ranges explicitly:
| Rotation | Value range |
|---|---|
| Rotation around 1st geometry axis | −180° … +180° |
| Rotation around 2nd geometry axis | −90° … +90° |
| Rotation around 3rd geometry axis | −180° … +180° |
The middle axis being limited to ±90° is not arbitrary: SINUMERIK describes rotation about three axes in RPY notation (Roll–Pitch–Yaw), where the middle angle is mathematically restricted to ±90°. The same logic applies to the “solid angle” mode of CYCLE800, where the sequence is fixed — first Z, then Y.
ROTS, AROTS and CROTS — rotation with solid angles
ROTS and AROTS are defined as “programmable frame rotations with solid angles“. With plain ROT you give a separate angle per axis; with ROTS you define the position of the plane in space instead. When a drawing dimensions an inclined face relative to two axes, ROTS works directly from that information. CROTS performs the same operation as an assignment to a frame variable.
SCALE and ASCALE — scaling
SCALE applies a scale change on the specified axes; ASCALE works additively. In mould and die work this is used for shrinkage allowance, model enlargement and trial parts.
MIRROR and AMIRROR — mirroring
MIRROR reverses direction on the specified axis, so a single program can machine both the left-hand and the right-hand version of a symmetrical part. The Job Planning manual defines CMIRROR as “mirror on a coordinate axis”, and MI is the mirroring component of a frame.
Clearing and suppressing frames
| Command | Effect |
|---|---|
TRANS / ROT / SCALE / MIRROR (with no values) | Clears the corresponding programmable frame component |
G500 | Deactivates all settable frames; the basic frames remain active |
G53 | Suppresses the zero offset non-modally |
G153 | Suppression including basic frames |
SUPA | The widest suppression: suppression of the current zero offset including programmed offsets, system frames, handwheel (DRF) offsets, external zero offset and overlaid movement |
Using SUPA or G53 for moves to the tool change position, a reference point or a fixed service position keeps those moves free of any active frame.
Frame variables: what sits behind G54
The G54 values you enter at the panel are stored in frame variables. The Job Planning manual gives the mapping directly:
| Active settable frame | Data storage frame | Corresponding command |
|---|---|---|
$P_IFRAME = | $P_UIFR[0] | G500 |
$P_UIFR[1] | G54 | |
$P_UIFR[2] | G55 | |
$P_UIFR[3] | G56 | |
$P_UIFR[4] | G57 | |
$P_UIFR[5] | G505 | |
$P_UIFR[99] | G599 |
In other words, programming G54 makes $P_UIFR[1] the active frame. This table is the starting point for anyone who wants to read or write work offsets from inside a program.
$P_UIFR[n] and $P_CHBFR[n] are data storage frames. A value written to them from the program is not immediately active in the channel. It becomes active only when G500, G54 … G599 is executed. By contrast, a value written to $P_IFRAME is included in the calculation immediately. This is the usual explanation for “I wrote the value but the machine still runs on the old one”.Basic frames: $P_CHBFRAME, $P_BFRAME, $P_UBFR
$P_CHBFRAME[n]— the active channel-specific basic frames; they define the reference between the basic coordinate system (BCS) and the basic origin system (BOS/BZS).$P_BFRAME— the current first basic frame in the channel. The manual states the identities$P_BFRAME = $P_CHBFRAME[0]and$P_UBFR = $P_CHBFR[0]; both older variables are retained for compatibility reasons.$P_ACTBFRAME— the chained complete basic frame; this variable is read-only.
The number of basic frames per channel is configured with MD28081 $MC_MM_NUM_BASE_FRAMES. The standard configuration is designed for at least one basic frame per channel, a maximum of eight basic frames is supported, and in addition there can be eight NCU global basic frames in the channel.
Which frame survives a reset?
The manual ties this to machine data:
“Does G54 stay active after Reset or not?” is answered by those bits — and that is why the behaviour differs from machine to machine.
Assigning values to frames: CTRANS, CROT, CSCALE, CMIRROR
To assign values to a frame directly in the program, the C functions are used. The manual gives the syntax as:
| Function | Meaning |
|---|---|
CTRANS | Translation of the specified axes |
CROT | Rotation around the specified axes |
CSCALE | Scale change on the specified axes |
CMIRROR | Direction reversal on the specified axis |
CFINE | Assignment of a fine offset to a FRAME variable |
The chaining operator ” : “
The chaining operator combines several operations on one frame; they are processed successively from left to right:
That single line translates the coordinate system by X10 Y20 Z5, then rotates it 45° about Z, then mirrors it in Y. Order matters — the operations are applied in the sequence written.
Frames can also be chained with each other:
The manual also names the classic application: describing several workpieces arranged on a pallet that are to be machined in the same process. The frame components hold intermediate values for the pallet task and are chained to generate the various workpiece zeros.
Defining your own frame variable: DEF FRAME
In addition to the predefined frame variables, you can define your own:
The last pattern is particularly useful: buffer the current frame before entering a subprogram and restore it on exit, so the subprogram cannot corrupt the coordinate system of the main program.
Reading and changing frame components: TR, FI, RT, SC, MI
You can access an individual value inside a frame instead of the whole frame:
| Component | Meaning |
|---|---|
TR | Translation (coarse offset) |
FI | Translation fine (fine offset) |
RT | Rotation |
SC | Scale modification |
MI | Mirroring |
$P_UIFRNUM holds the number of the currently set frame, which allows “work on whichever offset is active” style programming. On multi-part jobs this lets a single subprogram serve every offset.
External zero offset: $AA_ETRANS
The external zero offset is a linear offset between the basic coordinate system (BCS) and the basic origin system (BOS/BZS), and it can be driven by the PLC. Depending on machine data it acts in one of two ways:
| MD28082 $MC_MM_SYSTEM_FRAME_MASK, Bit1 | Behaviour |
|---|---|
| 0 | $AA_ETRANS[axis] is written directly by PLC, HMI or NC program and acts directly as the offset value. |
| 1 | The active system frame $P_EXTFRAME and the data storage frame $P_EXTFR are activated. All traversal movements in the channel are stopped, a preprocessing stop with subsequent reorganization (STOPRE) is performed, the offset is written to both frames, the active total frame $P_ACTFRAME is recalculated, the offset is retracted in the programmed axes, and the interrupted motion or NC program continues. |
The interface signal DB31, ... DBX3.0 going from 0 to 1 activates the offset. This is the mechanism used for parts moving on a conveyor, drifting fixtures and automation cells.
PRESETON and PRESETONS — setting a new actual value
Both procedures set a new actual value in the machine coordinate system (MCS) for one or more axes. This corresponds to a zero offset of the MCS of the axis and does not cause the axis to be traversed. Both initiate a preprocessing stop with synchronization, and the actual position is assigned to the axis only at standstill.
The difference between them is a safety matter:
| PRESETON | PRESETONS | |
|---|---|---|
| Referencing status | Lost — the machine axis is reset to “not referenced / synchronized” | Unchanged |
| Preprocessing stop | Yes | Yes |
| Alone in the block | Yes | Yes |
| Restriction | The manual recommends using it only for axes that do not require a reference point | Possible only for certain encoder types and referencing modes |
G74). Losing the reference affects the validity of software limits and protection zones — do not use this command in a production program without the machine manufacturer’s approval.PRESETONS is possible only if the active measuring system satisfies:
MD30240 $MA_ENC_TYPE[measuring system]= 0 (simulated encoder) or 1 (raw signal encoder)MD34200 $MA_ENC_REFP_MODE[measuring system]= 0 (no reference point approach possible) or 1 (referencing for incremental, rotary or linear measuring systems: zero pulse on the encoder track)
MEAFRAME — frame calculation from three measuring points in space
MEAFRAME supports measuring cycles: it calculates a frame from three ideal points and the corresponding measured points.
The problem it solves is familiar from mould work and large-part machining. When a workpiece is positioned for machining, its position relative to the Cartesian machine coordinate system is generally both offset and rotated. Exact machining or measuring would otherwise require either a costly physical adjustment of the part or a change to the motions defined in the part program. MEAFRAME is the third way: three points whose ideal positions are known are probed, and the control calculates the difference as a frame.
| Parameter | Meaning |
|---|---|
| <ideal points> | 2-dim. REAL array containing the three coordinates of the ideal points |
| <measuring points> | 2-dim. REAL array containing the three coordinates of the measured points |
| <quality> | VAR REAL variable that returns information on the quality of the FRAME calculation |
What the quality value tells you
| Value | Meaning |
|---|---|
| −1 | The ideal points are almost on a straight line: the frame could not be calculated, the returned FRAME variable contains a neutral frame |
| −2 | The measuring points are almost on a straight line: the frame could not be calculated, a neutral frame is returned |
| −4 | The calculation of the rotation matrix failed for a different reason |
| ≥ 0.0 | Sum of distortions (distances between the points) required to transform the measured triangle into a triangle congruent to the ideal triangle |
The manual explains it as follows: in order to map the measured coordinates onto the ideal coordinates using a rotation and a translation, the triangle formed by the measured points must be congruent to the ideal triangle. This is achieved by a compensation algorithm that minimizes the sum of squared deviations. Because the effective distortion can be used to judge the quality of the measurement, MEAFRAME returns it as an additional variable.
Using the MEAFRAME result
MEAFRAME returns an offset frame. If this offset frame is chained to the settable frame that was active when the function was called (for example $P_UIFR[1] with G54), a settable frame is provided for further conversions and machining. If the offset frame has to apply at a different position in the frame chain, or if other frames are active before the settable frame, the ADDFRAME function can be used to chain it into one of the channel basic frames or a system frame.
A controlled application example
The manual’s example program does not activate the calculated frame blindly — it applies limit checks first. This approach is worth copying exactly:
The logic is simple: if the measurement is poor, the distortion too large, or the calculated rotation greater than expected, the program raises an alarm and stops instead of machining from a bad frame. Every probing routine that sets a work offset automatically should carry checks like these.
NCU global frames and the rotation restriction
Only one set of NCU global frames is used for all channels on each NCU. They can be read and written from all channels and are activated in the respective channel.
Related machine data
| Machine data | Meaning |
|---|---|
MD28081 $MC_MM_NUM_BASE_FRAMES | Number of basic frames in the channel (min. 1, max. 8) |
MD18601 $MN_MM_NUM_GLOBAL_USER_FRAMES | Reconfiguration of settable frames as global frames |
MD18600 $MN_MM_FRAME_FINE_TRANS | Enable of the fine offset (= 1) |
MD20110 RESET_MODE_MASK | Which frame remains effective after reset |
MD28082 $MC_MM_SYSTEM_FRAME_MASK | Behaviour of the system frames (Bit1: external zero offset) |
Selecting basic frames: $P_CHBFRMASK and $P_NCBFRMASK
These two system variables select which basic frames are included in the calculation of the “complete” basic frame. The value is interpreted as a bit mask. The variables can only be programmed in the program and read via the OPI.
After a reset and in the basic setting, both variables take the value of $MC_CHBFRAME_RESET_MASK.
Frame commands on SINUMERIK 828D
The 828D availability table in the Job Planning manual shows that the frame-related commands are standard on PPU240.3/241.3, PPU260.3/261.3 and PPU280.3/281.3, in both the turning and the milling versions:
| Command group | Status on 828D |
|---|---|
TRANS, ATRANS, CTRANS | Standard (all PPU versions, turning + milling) |
ROT, AROT, ROTS, AROTS, CROT, CROTS | Standard |
SCALE, ASCALE, CSCALE | Standard |
MIRROR, AMIRROR, CMIRROR | Standard |
CFINE, TR, SC, MI | Standard |
MEAFRAME, ADDFRAME, INVFRAME | Standard |
SUPA | Standard |
TOROT, TOROTX, TOROTY, TOROTZ, TOFRAME, TOFRAMEX/Y/Z, TOROTOF | Standard |
TCOFR, TCOFRX, TCOFRY, TCOFRZ, TCOABS | Milling versions only; not available on turning versions |
TRAORI | Not available on 828D |
TRANSMIT, TRACYL | Option |
The practical conclusion: the whole of frame programming is available on 828D. It is not a 840D sl privilege. The boundary starts at multi-axis orientation transformation (TRAORI).
Frames and swivelling the plane (CYCLE800)
Swivelling a plane with CYCLE800 sets up a frame. The source document is unambiguous: when the coordinate system is swivelled, the previously set zero offset is automatically swivelled with it. You do not have to re-establish G54.
The same document summarises the value of frames in mould making: the coordinate system is first translated and then rotated onto an inclined surface, after which you no longer have to take the inclination into account while programming. All machining cycles can be programmed as usual, perpendicular to the workpiece surface — using a drilling cycle, for example.
The CYCLE800 graphical dialogue used to align machine axes with workpiece axes must be installed on the control. The source document notes that in its own edition this dialogue was available on 840D only; today’s 828D also provides the swivel cycle, and the availability table above supports this.
The most common frame mistakes on the shop floor
- Not clearing the frame at the end of the program. The next program starts with the leftover translation or rotation. Make it a habit to end programs with
TRANS,ROTorG500. - Writing a data storage frame and forgetting to activate it. Writing
$P_UIFR[n]is not enough; the value is not active untilG54…G599orG500is executed. - Running a mirrored program without simulation. MIRROR reverses the machining direction; cutter compensation side and circular direction change with it.
- Using different scale factors per axis. Circles distort and radii no longer hold size.
- Not protecting the tool change move from frames. Without
SUPAorG53, the move to the tool change position shifts with the active frame. - Programming a rotation in a global frame. You will get alarm 18310; global frames do not accept rotations.
- Using PRESETON in a production program. It destroys the axis reference and forces re-referencing.
- Activating a MEAFRAME result without limit checks. A bad probe measurement turns straight into a bad work offset.
- Not knowing the reset behaviour. Which frame survives a reset depends on the
MD20110 RESET_MODE_MASKbits, and it differs from machine to machine.
Frequently asked questions
What is the difference between TRANS and G54?
G54 is a settable frame: entered at the panel, retained independently of the program, stored in $P_UIFR[1]. TRANS is a programmable frame written inside the program, and it sits on top of G54. They do not cancel each other; they add.
How many frames can be active at once?
In principle every step of the chain is active at the same time: basic frames, the settable frame, system frames and the programmable frame. The result is combined in $P_ACTFRAME.
What is the SINUMERIK equivalent of Fanuc G68 (coordinate rotation)?
ROT / AROT. Where Fanuc cancels the rotation with G69, SINUMERIK clears it by writing ROT with no values.
What is the SINUMERIK equivalent of Fanuc G52 (local coordinate system)?
TRANS / ATRANS.
If I change a frame inside a subprogram, do I corrupt the main program?
Yes. The remedy is to buffer the current frame in a FRAME variable before entering the subprogram and restore it on exit: DEF FRAME SETTING_4 → SETTING_4 = $P_PFRAME → … → $P_PFRAME = SETTING_4.
How do I machine four parts on a pallet with one program?
By building a frame for each part and chaining them. That is exactly the method described in the manual: the frame components hold intermediate values for the pallet task and are chained to generate the various workpiece zeros. In practice you either chain $P_UIFR[n] offsets or shift your own DEF FRAME variable inside a loop.
Why can I not enter the rotation angle I want?
Because rotation around the second geometry axis is limited to −90° … +90°. That is a mathematical consequence of RPY notation, not a fault.
Is a work offset taken with a measuring cycle also a frame?
Yes. Measuring cycles write their result into system frames, and those are part of the $P_ACTFRAME chain. A frame calculated from three points with MEAFRAME enters the same chain.
Sources
- Siemens AG — SINUMERIK Advanced CNC Operation & Programming (Turkish edition), 05/2010: Section 3.2 What are frames? (coordinate systems, frame types, use of frames, machining on an inclined plane, table of programming components), Section 3.3 Swivelling — CYCLE800 (automatic swivelling of the preset zero offset)
- Siemens AG — SINUMERIK 840D sl / 828D Job Planning, Programming Manual, 01/2015, document no. 6FC5398-2BP40-5BA2: Chapter 6 Coordinate transformations (frames) — 6.1 coordinate transformation via frame variables, 6.1.1 $P_CHBFRAME / $P_IFRAME / $P_PFRAME / $P_ACTFRAME, 6.2 value assignments to frames (CTRANS, CROT, CSCALE, CMIRROR, chaining, TR/FI/RT/SC/MI, DEF FRAME), 6.3 coarse and fine offsets (CTRANS, CFINE), 6.4 external zero offset ($AA_ETRANS), 6.5 PRESETON, 6.6 PRESETONS, 6.7 MEAFRAME, 6.8 NCU global frames; Chapter 20.1 Operations and 20.2 Operations: Availability for SINUMERIK 828D