Sinumerik R-Parameters & System Variables

If you know Fanuc Macro B, Sinumerik does everything #-variables do — it just splits the job in two: R-parameters are your free scratch variables (like #100#999), and $-prefixed system variables are named reads/writes into the control (like #3000#5000-series). The names look intimidating until you learn the two-letter decode — then they're easier to remember than Fanuc's numbers.

R-Parameters (Arithmetic Parameters)

R0R99 (expandable via machine data MD28050 $MC_MM_NUM_R_PARAM) are channel-specific REAL variables, freely available to the programmer. Unlike Fanuc's volatile #100-series, R-parameters are retentive — they survive power-off and are included in data backups. There is also a global flavor, RG[n], shared across channels.

ItemSinumerikFanuc equivalent
Scratch variablesR0R99 (or R[n])#100#199 (but R-params persist like #500s)
Global across channelsRG[n]— (Fanuc commons are already control-wide)
In synchronized actions$R[n] or $Rn
TypeDOUBLE (REAL)Same — floating point
CountSet by MD28050 $MC_MM_NUM_R_PARAMFixed by option/model

Assignment and math are plain infix — no brackets-around-everything like Fanuc:

R1 = 10.5              ; simple assignment
R2 = R1 * 2 + SIN(30)  ; expressions read naturally
R[R2] = 1              ; indirect addressing (Fanuc: #[#102]=1)
X=R1 Y=-R2 F500        ; use directly in motion blocks

Decoding the $-Prefix Naming Scheme

This table is the key to the whole system. Every system variable is $ + data class + scope letter + _NAME. Once you can decode $AA_IM[X] as "runtime data, axis-specific, position (I) in machine coords (M), for X" you can sight-read most Siemens programs.

1st letter (data class)MeaningFanuc analogy
$MMachine data (configuration, protected)Parameters
$SSetting data (operator-adjustable)Settings
$TTool data (offsets, tool type)#2001+ / #10001+ offset variables
$ARuntime (current) system data#3000#5000-series reads
$VService data (e.g. raw encoder actual values)Diagnostic screens
$PProgram-run data (evaluated during block preprocessing)Modal #4001+ variables
$RR-parameter (synchronized-action notation)#100-series
2nd letter (scope)MeaningExamples
NNCK-global (whole control)$MN_, $SN_, $AN_
CChannel-specific$MC_, $SC_, $AC_, $TC_
AAxis-specific (takes an [axis] index)$MA_, $SA_, $AA_, $VA_

So $AA_IM[X] = runtime + axis-specific + IM (position in the Machine coordinate system) for the X axis, and $AA_IW[X] is the same thing in the Workpiece coordinate system. A few exceptions carry no scope letter: $A_YEAR (global runtime data) and the $P_ family. Note: reading a $A.../$V... runtime variable in a part program forces an implicit preprocessing stop (like STOPRE) so the value is current — expect a brief pause in look-ahead.

System Variables Worth Knowing

The 828D lists manual documents thousands; these are the ones a programmer actually reads or writes. Axis-indexed variables take the axis name: $AA_IW[X].

VariableWhat it isFanuc equivalent
Position
$AA_IW[ax]Current position, workpiece coordinates (setpoint)#5041
$AA_IM[ax]Current position, machine coordinates (setpoint)#5021
$VA_IM[ax]Encoder actual value, machine coordinates
$P_EP[ax]Programmed end position of current block#5001
$AA_MW[ax] / $AA_MM[ax]Measured probe trigger position, WCS / MCS#5061– skip position
Tool
$P_TOOLNOActive tool number (T)#4120
$P_TOOLActive cutting edge (D number)#4107
$P_TOOLPLast programmed tool number (no magazine mgmt)
$TC_DP1[t,d]Tool type of tool t, edge d
$TC_DP3[t,d]Tool geometry — length 1#2001+ / #11001+
Work Offsets & Frames
$P_UIFR[n]Settable work offset frame n (G54 = $P_UIFR[1], active on G54–G599)#5221– / #7001
$P_UIFRNUMNumber of the active settable frame#4014 (modal WCS group)
$P_IFRAMEActive settable frame (the live G54…)
$P_PFRAMEProgrammable frame (TRANS/ROT)#5201– (G52-ish)
$P_ACTFRAMETotal active frame (everything chained)
Feed & Spindle
$P_FProgrammed path feed#4109
$AC_VACTWActual path velocity in the WCS
$P_S[n]Programmed speed of spindle n#4119
$AA_S[n]Current speed of spindle n
$AC_OVRPath override (writable in synchronized actions)
$AC_MSNUMNumber of the current master spindle
Modal & Status
$P_GG[n]Active G function of G group n#4001#4022
$AC_ALARM_STATAlarm response status (bit-coded: stop, NOREADY…)#3000-adjacent status
Time & Part Counters
$A_YEAR / $A_MONTH / $A_DAYSystem date#3011
$A_HOUR / $A_MINUTE / $A_SECONDSystem time#3012
$AC_TIMESeconds since block start#3001-ish
$AC_CYCLE_TIMEExecution time of the selected NC program
$AC_OPERATING_TIME / $AC_CUTTING_TIMETotal AUTO runtime / machining time
$AC_TIMER[n]User timer n (set to start value; -1 stops it)
$AC_ACTUAL_PARTSParts machined this run (auto-resets at target)#3901
$AC_REQUIRED_PARTSPart count target#3902
$AC_TOTAL_PARTSTotal parts since start time

GUD — Global User Data

GUD is Siemens' answer to "I wish #510 had a name." Instead of memorizing that #510 holds your probe diameter, you define a retentive variable called PROBE_DIA in a GUD block — a definition file loaded onto the control (828D reserves blocks for Siemens cycles, the machine builder, and the end user). The number of available GUD modules is set by machine data $MN_MM_NUM_GUD_MODULES.

; In a user GUD definition file:
DEF NCK REAL PROBE_DIA        ; global to the whole control
DEF CHAN INT FIXTURE_ID       ; per channel

; Then in any program, by name:
PROBE_DIA = 6.0
IF FIXTURE_ID == 2 GOTOF OP20

Compared to Fanuc #500#999 permanent commons: same persistence, but typed (REAL, INT, BOOL, AXIS, CHAR…), named, and scoped. For synchronized actions there is a pre-built set in the GUD2 block — SYG_RM[n] (REAL), SYG_IM[n] (INT), SYG_BM[n] (BOOL) — sized by machine data such as $MN_MM_NUM_SYNACT_GUD_REAL.

Worked Examples

Capture the current work-coordinate position into R-parameters (the Siemens version of reading #5041#5043):

R1 = $AA_IW[X]   ; current X, work coords
R2 = $AA_IW[Y]   ; current Y
R3 = $AA_IW[Z]   ; current Z
MSG("Z WORK POS: " << R3)
M0               ; hold so you can read it

Branch on the active tool — e.g. refuse to run a probing routine unless the probe (T9) is in the spindle:

IF $P_TOOLNO <> 9 GOTOF WRONG_TOOL
; ... probing moves ...
GOTOF DONE

WRONG_TOOL:
MSG("LOAD PROBE T9 - ACTIVE TOOL IS T" << $P_TOOLNO)
M0

DONE:
M17

Nudge the G54 Z origin from inside a program — the equivalent of writing to #5223. $P_UIFR[1] is the G54 frame; index by axis and component (TR = translation):

$P_UIFR[1,Z,TR] = $P_UIFR[1,Z,TR] - 0.05  ; shift G54 Z down 0.05
G54                                        ; re-select to activate the change

References

  • Siemens, SINUMERIK 828D System Variables Lists Manual (08/2018), Siemens AG.
  • Siemens, SINUMERIK Programming Guide: Job Planning, Siemens AG.

Have a question or want to contribute?

Contact us with corrections, additions, or topics you'd like covered.

Get in Touch