Sinumerik 828D R Parameter Limits: Sync Actions & Easy Screen

David Krause17 min read
HMI ProgrammingSiemensTechnical Reference
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Sinumerik 828D R Parameter Value Limitation — Engineering Reference

R parameters on the Sinumerik 828D are floating-point arithmetic variables evaluated by the NC kernel. They are commonly used for counters, fixture offsets, recipe data, hand-loaded operator values, and runtime calculations inside part programs. Unlike GUD (Global User Data) or LUD (Local User Data), R parameters are always global in scope and persist in NV-RAM across controller restarts. Because an operator can overwrite any R parameter directly from the HMI, on a settable input field, or by an external PLC write through $A_DBB / $A_DBW / $A_DBD addressing, an unguarded R parameter is effectively unbounded: any value the operator (or the part program) writes will be accepted, including nonsense values that propagate into tool offsets, feedrate multipliers, or motion setpoints.

This reference covers two production-ready techniques to clamp R parameter values on the Sinumerik 828D without modifying the part program: (1) NC synchronous actions using the WHENEVER ... DO construct, and (2) Easy Screen input validation on a custom HMI screen. Each method has distinct licensing, performance, and operator-experience trade-offs, summarized in the comparison matrix below. A third path — direct clamping of tool wear offsets inside the tool management screen — is also documented because the original engineering requirement was a value window for a feed-related R variable, which can alternatively be enforced by clamping the downstream tool wear geometry.

Terminology note. The "R" in "R parameter" has no relation to the statistical coefficient of determination R² discussed in regression literature. On Sinumerik the leading $ prefix marks the variable as a system or NC variable, e.g., $R1. See Coefficient of determination (Wikipedia) for the unrelated statistical concept; the authoritative source for the NC variable syntax is Siemens Industry Online Support.

R Parameter Fundamentals on Sinumerik 828D

R parameters are pre-defined in the NC kernel and indexed numerically. They are real (floating point, IEEE 754 single precision internally) and can be assigned integer or fractional values. On the 828D the default R-parameter set spans R0 through R99, with the upper count settable via machine data so that controllers in the 840D sl class can expose R0 ... R299 or R0 ... R999 when extra runtime data slots are needed.

Table 1 — R Parameter Address Range by Machine Data
Machine data Default value Range Effect
MD28000 $MC_MM_NUM_R_PARAM 100 0 ... 32767 Number of R parameters available to the part program.
MD28080 $MC_MM_NUM_BASE_FRAMES 1 0 ... 16 Independent of R count but commonly mis-tuned with it.
MD18660 $MN_MM_NUM_SYNACT_GUD_REAL 0 / OEM 0 ... 32767 Drives the synchronous-action real-variable pool.

To check the active R parameter count on a running 828D, display machine data via MENU SELECT > Setup > Machine Data and filter by 28000, or read it from the PLC through the corresponding DB. On 828D PPU versions 4.5 SP2 and later the MD can be edited online without an NC reset; older PPU variants require an NCK restart to take effect.

Operator write paths:

  1. HMI settable input field in any operator screen, including the standard Parameters area.
  2. Easy Screen custom screen with an EDIT or VAR control.
  3. Part program assignment: R1 = 47.5.
  4. Synchronous action assignment: $R1 = 47.5 inside a DO block.
  5. PLC via the NC variable interface using PUT/GET or direct DB writes.

Because all five paths bypass any single-point validation, value clamping has to be enforced centrally — either by monitoring the value after each write (synchronous action) or by intercepting the write at the HMI (Easy Screen). Each approach is treated in detail below.

Why Clamp R Parameter Values

Unbounded operator parameters are a frequent root cause of:

  • Incorrect feedrate multipliers when an R parameter is later multiplied into a programmed feed (F = R5 * 100).
  • Tool table corruption when an R parameter is copied into a wear offset without range checking.
  • Clamp force / chuck pressure overshoot when the parameter feeds an analog output scaled to physical units.
  • Cycle time blow-ups when an R parameter drives a dwell or a number of passes.
  • NCK stop conditions (alarm 15180 "value out of range" or 15110 "channel %1 block %2 motion synchronous action: parameter 1 invalid") if the clamped value lands on a downstream MD boundary.

The conventional mitigation is to define a clamp window, e.g., 0 ≤ R1 ≤ 40, and enforce it before any downstream code reads the value. The threshold need not be hard-coded; it can be sourced from a GUD or from machine data, which lets the integrator later re-tune the window through commissioning rather than by editing part programs.

Method 1 — Synchronous Actions with WHENEVER/DO

Synchronous actions are evaluated by the NC interpolation cycle and execute in lock-step with the part program. The minimum evaluation granularity on the 828D is one IPO clock, typically 2 ms or 4 ms depending on MD10050 $MN_SYSCLOCK_CYCLE_TIME and MD10060 $MN_POSCTRL_SYSCLOCK_CYCLE_TIME. Within that clock the interpreter tests each WHENEVER condition and fires any DO actions whose condition transitioned from false to true on that cycle.

Canonical clamp syntax for R1 bounded to [0, 30]:

; Synchronous action IDs 90 and 91 are OEM-action IDs in the standard
; convention — choose IDs that do not collide with cycle-time slots
; reserved for Siemens compile cycles.
IDS=90 WHENEVER $R1 < 0   DO $R1 = 0
IDS=91 WHENEVER $R1 > 30  DO $R1 = 30

The leading IDS= keyword designates the action as a static synchronous action — once loaded via DEF INT IDS in the NC program or via the synchronous-action list under MENU SELECT > Commissioning > Synchronous Actions, the action remains resident across resets. The runtime effect is: any IPO clock in which the condition evaluates true causes the assignment to fire. Because the condition is evaluated every clock, the clamp reacts within one IPO period of an out-of-range write, including writes from the PLC.

Synchronous Action Structure (SVG flowchart)

$R1 write event WHENEVER $R1 < 0 WHENEVER $R1 > 30 DO $R1 = 0 (low clamp) DO $R1 = 30 (high clamp) $R1 in [0, 30]

Figure 1 — Synchronous action clamp logic. Each IPO cycle the NCK tests both conditions; if true, the corresponding assignment fires and the value is clamped before downstream code sees it.

Loading and Activating the Action

Static synchronous actions live in a sub-program loaded by the part program header (typically in _N_SETUP or a manufacturer-specific start-up SPF). Loading sequence:

  1. Define a static local variable to hold the action ID: DEF INT IDS is implicit; explicitly declare with DEF INT IDS90 if the action is parameterised.
  2. Issue the cancel of any prior resident action on the same ID: CANCEL(90), CANCEL(91).
  3. Load and arm: IDS=90 WHENEVER $R1 < 0 DO $R1=0.
  4. Repeat for the upper bound.
  5. Persist by adding the SPF to _N_CMA_DIR/_N_PROG_EVENT_SPF or by saving the synchronous-action list via SAVE in the synchronous-action editor.
; _N_CMA_DIR/_N_PROG_EVENT_SPF
PROC PROG_EVENT
  ; Cancel any previous resident instances on cold start
  CANCEL(90)
  CANCEL(91)
  ; Re-arm after each NCK reset
  IDS=90 WHENEVER $R1 < 0  DO $R1=0
  IDS=91 WHENEVER $R1 > 30 DO $R1=30
  ; Optional — mirror the value into the PLC interface for visualization
  IDS=92 WHENEVER 1       DO $A_DBD[0] = $R1
M30

IDS Numbering Conventions and OEM Reserved Range

Synchronous action IDs are 32-bit signed integers. The convention used by Siemens compile cycles and many OEMs is to reserve the low IDs for system use and assign OEM work in the upper range:

Table 2 — Synchronous Action ID Conventions on Sinumerik 828D
IDS range Conventional owner Comment
1 ... 15 Reserved (Siemens cycles) Do not reassign without compile-cycle impact analysis.
16 ... 63 OEM machinery cycles Common for clamp, lube, and clamping-bar interlocks.
64 ... 127 OEM auxiliary Safe for low-frequency tasks such as counters and handshakes.
128 ... 254 OEM advanced Used for safety-related polling at low IPO loads.
255+ Application / integrator Avoid the CANCEL(255) and the RESET semantics.

To list active IDs from the HMI, open MENU SELECT > Diagnostics > NC/PLC Variables > Synchronous Actions. The dialog shows ID, state (active/cancelled), condition, and action. From the PLC side, the action list can be read via DB10.DBB0 upwards (see the Sinumerik 828D PLC interface manual for the exact DB layout on the active PPU variant).

License Requirements for Synchronous Actions

The synchronous-action feature itself is part of the base NCK software on the 828D, but the user-side editor and the unlimited-count runtime carry an option bit. Confirm against the active license certificate in MENU SELECT > Setup > License:

Table 3 — Relevant Sinumerik 828D Option Bits for Clamping Work
Option bit Functionality enabled Effect on the clamp task
6FC5800-0AS00-0YB0 (Synchronous actions, programmable) Editor for static synchronous actions Needed to load the WHENEVER/DO code from an SPF.
6FC5800-0AS00-0YA0 (Synchronous actions, runtime > 4) Removes the four-action ceiling Required if you use more than four OEM static actions in parallel.
6FC5800-0AS00-0YH0 (Easy Screen) Custom HMI screens Needed only for Method 2 below; not required for synchronous actions.
Verify on the live controller. Option-bit names are sometimes reordered in newer license paperwork. Always cross-check the certificate against /card/license.txt on the CF card and the on-screen license list before commissioning. If the controller reports alarm 8021 "option not set" on first load, the synchronous-action editor option is missing.

Method 2 — Easy Screen Input Validation

Easy Screen is a manufacturer-side HMI development environment built into Sinumerik Operate. It allows integrators to create custom operator screens whose input fields can be wired to NC variables with embedded range checks, dropdowns, and toggle controls. On the 828D, up to five Easy Screen screens are available without an additional license — beyond that, the add-on option bit above is required.

An Easy Screen form is a plain-text configuration file stored under /oem/sinumerik/hmi/proj on the active HMI partition (CF card or operator-panel flash). The configuration language has a small vocabulary of control elements; the two relevant for R-parameter clamping are EDIT and VAR:

; /oem/sinumerik/hmi/proj/screenform.ini
; Vertical form, three input fields, OEM soft-key position 7.

HS         = 7            ; Start with horizontal soft-key 7 (OEM range)
VS         = 8            ; Eight vertical keys (Form 1 of 5 free screens)

LOAD
  ; Optional banner — pulls the operator attention
  "R PARAMETER CLAMP MONITOR"
END_LOAD

PRESS(HS7)
  ; Confirm-button logic, executed when operator presses the soft key.
  IF $R1 < 0
    $R1 = 0
  ENDIF
  IF $R1 > 30
    $R1 = 30
  ENDIF
  ; Optional — write the clamped value back to the field
  R1 = $R1
END_PRESS

; Layout
    R1      "R1 value:"     EDIT
    R1      "Upper limit:"  EDIT 30.0
    R1      "Lower limit:"  EDIT  0.0

The EDIT control in Easy Screen supports an optional min/max pair that the HMI uses to reject out-of-range keyboard entries before they reach the NCK. The exact attribute syntax varies between Operate versions — Operate 4.5 uses EDIT(n.nn, x.xx) inline; Operate 4.7+ uses a separate LIMIT block — so verify against the version of Operate installed. Check the version under MENU SELECT > Diagnostics > System Info.

Easy Screen Configuration Workflow

  1. Backup the operator panel. Before editing OEM files, copy /card/oem to a USB stick with the same folder layout.
  2. Create the form file. Save the configuration above as /oem/sinumerik/hmi/proj/screenform.ini (Operate 4.5) or the XML equivalent (Operate 4.7+, depending on configuration profile).
  3. Register the soft-key. Add the form to the OEM area so the soft-key appears. The registration block typically reads SKEY 7 (7, "R-Clamp", "screenform", 1) with the layout index matching VS.
  4. Reload the HMI. From MENU SELECT > Commissioning > HMI > Reload OEM Files, or reboot the PPU if the OEM framework does not support hot-reload.
  5. Validate. Open the custom screen, attempt to enter a value outside the window, and confirm the HMI rejects the entry. If the value is accepted, the LIMIT clause is missing or the EDIT field is wired to a GUD instead of the R parameter.
Five-screen limit. The 828D provides five free Easy Screen forms. Once the count is exhausted the integrator must purchase the Easy Screen option to extend. Plan form usage carefully — production-critical screens should occupy low soft-key positions because re-pinning later requires touching the registered keys file.

Tool Wear and Tool Offset Limit Configuration

The original engineering question was driven by a feed-related R variable being clamped to a window. A complementary technique is to clamp the downstream tool wear geometry instead of the R parameter itself, which makes the safety guarantee physical rather than logical. The tool management screen on the 828D exposes wear entries whose range is bounded by machine data:

Table 4 — Machine Data Governing Tool Wear Limits
Machine data Default (metric) Effect
MD20180 $MC_CUTTING_EDGE_DEFAULT 0 Edge number pre-loaded on tool change.
MD20150 $MC_GCODE_DEFAULT_VALUES OEM Default G-code group state.
MD20184 $MC_TOA_OFFSET_LIMIT[0..2] ±99999.999 Absolute wear limit per axis (X, Z, Y) on the active TOA.
MD20186 $MC_TOA_OFFSET_LIMIT_PLUS / _MINUS OEM Asymmetric wear limits — tighten these for a hard clamp.

To set a hard wear clamp on, e.g., the Z-axis wear of a turning tool, edit MD20184[2] to the maximum acceptable wear value. The HMI tool list will then refuse operator entries outside the window and alarm 17180 "channel %1 block %2 invalid value for tool offset" will trip on any program-level attempt to write outside. This is the safest mechanism because it survives NCK reset, NC program change, and PLC reassignment.

Method Comparison Matrix

Table 5 — Clamping Methods Compared
Criterion Synchronous action (Method 1) Easy Screen (Method 2) Tool MD wear clamp
Latency ≤ 1 IPO clock (2–4 ms) HMI scan (~50 ms) Hard — write rejected
Catches part-program writes Yes No (only HMI) Yes
Catches PLC writes Yes (next IPO clock) No Yes (NCK rejects)
Catches HMI operator entry Yes (after accept) Yes (before accept) Yes
License requirement Sync-action option Easy Screen > 5 forms None (standard MD)
Survives NCK reset Yes if stored in PROG_EVENT Yes (file-resident) Yes (file-resident)
Performance cost Two NCK tests / IPO clock Negligible None
Complexity to implement 5 minutes per parameter 30–60 minutes per screen 10 minutes per axis
Diagnostic visibility Excellent (sync-action list) Operator-side only Tool list + alarm log

For the original engineering case — a single R parameter bounded to 0–40 — the synchronous-action approach (Method 1) is the most economical, because it requires no HMI development, catches PLC-driven writes, and the clamp is visible in the synchronous-action diagnostics list. Easy Screen is preferable when multiple R parameters need operator-friendly grouped entry with explanation text, drop-downs, or unit selection. The tool-MD wear clamp is the fallback when the value window is so critical that no upstream mistake must propagate.

Commissioning and Verification Procedure

Run the following sequence on every machine that adopts the clamp pattern, irrespective of method:

  1. Pre-load backup. Archive the active NCK card image (Series commissioning > Create series start-up archive) so a known-good baseline can be restored if the test sequence fails.
  2. Confirm license. Verify the option bit in MENU SELECT > Setup > License. If absent, record the order number and request the certificate from the machine OEM before proceeding.
  3. Load the actions / form. Either write the synchronous-action list or install the Easy Screen form, depending on the chosen method.
  4. Test low-bound clamp. From the HMI set R1 = -5. Expected: R1 displays as 0 within one second. NCK alarm log should remain clear.
  5. Test high-bound clamp. Set R1 = 47.5. Expected: R1 displays as the configured ceiling (30 or 40 depending on window).
  6. Test part-program write. Run R1 = 99 ; M30. Expected: post-run, R1 displays the clamp ceiling.
  7. Test PLC write. From the PLC programmer issue a write of -12.5 to the appropriate DB that the PLC interface maps to $R1. Expected: NCK clamps to the low bound on the next IPO cycle.
  8. Test NCK reset persistence. Issue an NCK reset (RESET on the HMI). Expected: R1 retains the last-clamped value, and the synchronous actions reload from PROG_EVENT.
  9. Test power cycle. Power-cycle the PPU. Expected: same behaviour as reset.
  10. Document the test results. Attach screenshots of the synchronous-action list, alarm log, and R1 display to the commissioning report.

Troubleshooting Matrix

Table 6 — Common Failure Modes and Recovery
Symptom Likely cause Recovery
Alarm 8021 "option not set" on action load Synchronous-action option bit missing Activate option or move logic to Easy Screen.
Action loads but does not fire Action was cancelled by another PROG_EVENT run Make the action file idempotent; cancel before re-arming.
Easy Screen form not visible after reload OEM file not in /oem/sinumerik/hmi/proj or wrong version folder Compare against /card/sinumerik/hmi/proj tree; correct path.
HMI accepts out-of-range value LIMIT block missing in the form Add LIMIT clause for the EDIT control.
Alarm 15110 "motion synchronous action: parameter 1 invalid" Action references a variable the NCK does not know (typo in $RX) Verify variable spelling against the variables list.
Action fires but value reverts A second synchronous action also writes $R1 on the same cycle Audit all static actions for $R1 writes; sequence by ID.
PLC write is not clamped PLC writes through GUD instead of R param; synchronous action only watches R Mirror the clamp to the GUD or convert PLC code to use $R1.
Easy Screen soft key grayed out Five-screen quota exhausted Consolidate forms or buy the option.
Tool wear clamp rejected valid value MD20184 set too tight for the process Re-evaluate the physical wear budget, retune MD.

Field-Engineering Notes

  • Static synchronous actions persist across part-program changes but are cancelled by an NCK reset unless they are re-armed in PROG_EVENT. A common field bug is to add a clamp, observe it working, then lose it after a maintenance reboot.
  • The clamp value written back to $R1 by the synchronous action will itself satisfy the WHENEVER condition on the next cycle, but the assignment is idempotent so no chatter occurs. NCK runs each action only on condition-edge transitions within a single cycle.
  • Avoid using WHENEVER 1 DO $R1 = $R1 as a "watchdog" — it is a no-op semantically but it costs an IPO test and can mask logic bugs in a stack trace.
  • If you must clamp several R parameters, prefer a clamping subroutine called from PROG_EVENT rather than 2N static actions. Each additional synchronous action consumes one slot in the IPO-side action table; on small PPU variants the cap can be as low as 32 simultaneous actions before performance degrades.
  • Easy Screen min/max validation is cosmetic for the operator entry path. The NCK still accepts any value the PLC or a part program writes — that is why Method 1 and the tool-MD clamp are layered defenses, not alternatives.

Frequently Asked Questions

Can I clamp an R parameter without touching the part program on a Sinumerik 828D?

Yes. Use a static synchronous action such as IDS=90 WHENEVER $R1<0 DO $R1=0 loaded from _N_PROG_EVENT_SPF. The clamp fires within one IPO clock of any out-of-range write, including PLC writes through the NC variable interface, and no part-program edit is needed.

What license is required for the WHENEVER/DO synchronous-action syntax?

The static synchronous-action editor on the 828D is gated by an option bit commonly referenced as "Synchronous actions, programmable" (order code 6FC5800-0AS00-0YB0). A second option bit lifts the four-action runtime ceiling if more OEM static actions run concurrently. Confirm against MENU SELECT > Setup > License on the live controller.

How many free Easy Screen forms does the 828D allow?

Five forms are available without an additional license on the 828D. The sixth form requires the Easy Screen option (6FC5800-0AS00-0YH0). Plan form usage to keep production-critical screens at low soft-key positions.

Why does the operator-entered value sometimes pass the Easy Screen limit?

Easy Screen EDIT validation rejects keyboard input only when the LIMIT clause (Operate 4.7+) or inline min/max pair (Operate 4.5) is configured. The NCK still accepts any value the PLC or the part program writes, so always combine Easy Screen with a synchronous-action clamp if the safety case demands physical enforcement.

What machine data clamps tool wear values?

MD20184 $MC_TOA_OFFSET_LIMIT defines the absolute wear limit per axis; MD20186 provides asymmetric positive/negative limits. Setting these MDs makes the tool-management screen reject out-of-window entries and alarm 17180 on any program-level violation, which is the strongest enforcement level available.

Does the clamp survive an NCK reset or power cycle?

Yes, provided the synchronous action is declared in a PROG_EVENT file or in the persistent synchronous-action list (SAVE in the editor). Easy Screen forms are file-resident on the CF card and reload automatically. Both methods survive an NCK reset and a PPU power cycle.

Back to blog