SINUMERIK 840D sl Easy Screen Custom Dialog for Operator Input During NC Runtime
This reference covers the end-to-end configuration of an SINUMERIK 840D sl custom operator dialog using the Easy Screen (SINUMERIK Operate) programming interface. The use case is operator-entered variable data, typically a product identification string, captured at an M00 program stop, stored in a Global User Data (GUD) variable, and consumed by the standard engraving cycle CYCLE60 through the <TEXT,_VAR_TEXT> substitution mechanism.
1. Functional Overview
The workflow implemented by this configuration is:
- The NC program reaches the engraving position and executes
M00(program stop). - An
MMC(...)NC command invokes a dialog loaded from/user/sinumerik/hmi/proj/or/oem/sinumerik/hmi/proj/. - The operator enters the product ID through an alphanumeric Edit field on the SINUMERIK Operate user interface.
- On softkey OK, the dialog writes the string into a globally defined
STRING[n]GUD or into a numericREALGUD. - The dialog closes, the
M00is acknowledged by NC Start, and the engraving cycle reads the variable via_VAR_TEXT.
Substitution of the dialog variable into the cycle call is performed in the NC source by replacing the literal text in the engraving block with the variable reference.
2. Prerequisites
| Component | Requirement |
|---|---|
| NCU | NCU 710.3 / 720.3 / 730.3 / 731.3 with CF card ≥ 8 GB |
| NC software | SINUMERIK 840D sl 4.7 SP3 or later (also valid on 4.8, 5.x line) |
| HMI software | SINUMERIK Operate V4.7 SP3 or later (matches NC version) |
| HMI option | "SINUMERIK Operate programming package" (6FC5800-0AP04-0YB0) — mandatory if user-defined dialogs are to be created; not included in base scope |
| Configuration access | Manufacturer password level (NCU manufacturer area) for GUD and machine display data (MD9000-) |
| Engineering tools | CrossEdit / Access MyMachine / PTE (Programming and Testing Environment) for syntax checks; or direct edit on CF card via SCP/SSH |
| Reference manuals | Programming Manual Job Planning (SINUMERIK 840D sl), Commissioning Manual Base Software (SINUMERIK Operate), Operator Components Manual |
SETUP /DGET LIC from the service menu or evaluate /card/system/license/keys.txt on the CF card. Without the option, .ini dialog files are not parsed and the MMC() call returns error 120200 "Dialog not found".
3. Easy Screen File System Layout
Custom dialogs reside in the user or manufacturer (OEM) project tree. Two trees exist; loading precedence is OEM → USER → ADDON → SIEMENS, with OEM taking priority. Files must live under the /proj/ subdirectory of the project tree.
| Directory | Purpose | Typical use |
|---|---|---|
| /oem/sinumerik/hmi/proj/ | OEM/manufacturer dialogs, write-protected by NC manufacturer password | Standard user customizations, templates delivered with machine |
| /user/sinumerik/hmi/proj/ | End-user dialogs | Application-specific screens such as the engraving product-ID dialog |
| /addon/sinumerik/hmi/proj/ | Add-on tool dialogs | Optional tool manufacturer screens |
| /siemens/sinumerik/hmi/proj/ | Siemens standard screens | Reference only, do not modify |
Each dialog consists of three logical file groups inside one dialog subfolder, for example /user/sinumerik/hmi/proj/EngraveDialog/:
- engravedlg.ini — Configuration file with screen definitions, softkey layout, and access level.
- engravedlg.com — (Optional) Internal placeholder, not required for purely textual dialogs.
- engravedlg.bmp / engravedlg.png / engravedlg.ico — Icon and background assets referenced from the .ini.
MMC() is the path of the .ini file relative to /.../proj/ without the .ini extension, e.g. "EngraveDialog/engravedlg".
4. Registering the Dialog in regie.ini
Every dialog directory must be announced in the active configuration level of regie.ini. Without registration, the file is invisible to MMC(). Locate the relevant file at /user/sinumerik/hmi/cfg/system/configuration/configuration.xml (Operate < 4.9) or via the Operating Area Switchover setup. The classic text-based mechanism is reproduced below for legacy environments.
; regie.ini — register custom dialog directories
; File path: /user/sinumerik/hmi/cfg/system/regie.ini
[MMC]
;Engraving operator dialog (user scope)
EngraveDialog/engravedlg = "Engraving Dialog", ../../proj/EngraveDialog/engravedlg.ini, "*", "", "ICON"
Restart the HMI after editing the registration:
; Service shell restart (Operate)
> sudo /etc/init.d/sinumerik-hmi restart
; or via menu: Start-up → HMI → Restart
5. Dialog Configuration (.ini) Anatomy
The Easy Screen .ini file uses section keys, declarative screen definitions, and inline scripting. A complete reference for the legacy Easy Screen syntax is provided in the Commissioning Manual Base Software chapter "Programming in the .ini File". The working template below implements the engraving dialog.
; ===========================================================
; engravedlg.ini
; Path: /user/sinumerik/hmi/proj/EngraveDialog/engravedlg.ini
; Purpose: capture operator-entered product ID at M00 program stop
; ===========================================================
[SIZE]
Width=620
Height=320
; Logical pixels; the dialog auto-scales to panel resolution.
[TEXT]
Title=Engraving — Product Identification
Subtitle=Enter the unique product ID before NC Start
BackColor=light gray
BackPicture=engravedlg.bmp
; Picture must reside in the dialog folder.
[KEYS]
SK1=OK
SK2=Cancel
SK3=Help
SK4=Default
SK5=LastID
SK6=Clear
SK7=
SK8=
[ACCESS]
; Manufacturer-only on SK5, others end-user level
SK1.protection=0
SK5.protection=4
[DEFAULTS]
; Trigger default values on first load
Edit1=""
Num1=0
FlagOK=0
; ---------------------- Screen definition ----------------------
[Screen01]
Title="Product ID"
; Static label
Var1 = limitle("Enter product ID", "ALIGN_LEFT", 12, 0)
; Alphanumeric edit field, max 32 chars
Edit1 = input("Product ID", "ALIGN_LEFT", 12, "STRING", 32, 0, $SN, /640/262/280/30)
; Numeric edit field, optional secondary counter
Num1 = input("Quantity", "ALIGN_LEFT", 12, "REAL", 10, 0, $RN, /640/305/200/30)
; Decorative line
Var2 = limith("────────────────────", 12, /10/345/620/2)
; Status line
Var3 = limit("Press OK to store, Cancel to abort", /10/360/620/30)
; --------------------- Variable declarations ------------------
[VAR]
; Local Easy Screen variables
DEF CHAR Edit1[32]
DEF REAL Num1
DEF INT FlagOK = 0
DEF CHAR LastID[32] = ""
; --------------------- Procedural blocks ----------------------
[LOAD]
; Run once when dialog opens
LastID = ""
; Read last ID from GUD (string GUD is not natively supported;
; numeric alternative uses GUD _CHAR counter that the NC
; writes via STRING assignment).
DISPLAY "Ready for input."
[CHANGE]
; Fired whenever an input element is modified
[UNLOAD]
; Run once when dialog closes
DISPLAY "Dialog closed."
[DO]
; Bound to softkey presses; SKx selection via IF
IF $SK == 1 THEN
; OK — copy to GUD
GUD _CH_PROD_ID[0] = Edit1
GUD _CH_PROD_ID_LEN[0] = strlen(Edit1)
GUD _RN_PROD_QTY[0] = Num1
DISPLAY "Stored product ID: " << Edit1
FlagOK = 1
EXIT
ENDIF
IF $SK == 2 THEN
; Cancel
DISPLAY "Operator cancelled."
FlagOK = 0
EXIT
ENDIF
IF $SK == 5 THEN
; Recall previous ID
Edit1 = LastID
DISPLAY "Reusing last product ID: " << Edit1
ENDIF
IF $SK == 6 THEN
; Clear
Edit1 = ""
Num1 = 0
DISPLAY "Cleared fields."
ENDIF
5.1 Element Primitives
| Primitive | Geometry parameter | Notes |
|---|---|---|
label() |
none | Static text label rendered in default font |
input("caption", "align", height, "type", len, decimal, $var, /x/y/w/h/) |
/x/y/w/h/ logical pixels | Editable field; type STRING/REAL/INT/CHAR; supported lengths 1..255 |
limith("—") |
/x/y/w/h/ | Horizontal line, color follows dialog foreground |
limitle(caption, align, font, /x/y/w/h/) |
/x/y/w/h/ | Left-aligned static text |
limit(caption, /x/y/w/h/) |
/x/y/w/h/ | Generic caption inside bounding box |
bargraph(var, min, max, /x/y/w/h/) |
/x/y/w/h/ | Visualization bar for numeric |
listbox() |
/x/y/w/h/ | Selection list for ENUM types |
5.2 Coordinate System
The logical origin (0,0) is the top-left corner of the dialog box. Y increases downward. The dialog is rendered inside a non-modal window on top of the active area. Resolution is logical pixels; the rendering engine rescales for HD panels (1920×1080) using the system DPI factor.
6. Global User Data (GUD) Definitions
GUD is the standard mechanism for persistent user variables accessible from both NC and HMI. They are defined in the NC through machine data NC_USER_DATA_R, NC_USER_DATA_INT, NC_USER_DATA_HEX and through free GUD definitions in _N_DEF_DIR/_N_GUD_DEF for newer controls.
; _N_GUD_DEF / _N_GUD_K1
; Stored in NC file system: /card/user/cfg/
DEF NCK INT _CH_PROD_ID_LEN
DEF NCK CHAR _CH_PROD_ID[32]
DEF NCK REAL _RN_PROD_QTY
; Bit mask for tool/operator setup
DEF NCK INT _IB_OP_FLAGS = 0
Activation requires an NCK reset (or PI_SERVICE _N_GUD_DEF on newer firmware with hot-reload). Verify with:
; On SINUMERIK Operate:
; Start-up → NC/PLC Variables → NCK → GUD
; Expected row count >= 4 (the three variables plus _IB_OP_FLAGS).
STRING[n] is supported from SW 4.7 SP3 onward. For older firmware use DEF NCK CHAR _CH_PROD_ID[32] with manual length tracking via _CH_PROD_ID_LEN. The Easy Screen STRING edit type maps to a CHAR[] backing store.
7. Machine Display Data for Softkey Visibility
Custom softkeys appear on the SINUMERIK Operate horizontal softkey bar only if the corresponding display MDs are set. Two registers are relevant:
| MD | Description | Value |
|---|---|---|
| MD9000 .. MD9009 | Activate softkey 1..10 in area menu | Bit-coded per softkey |
| MD9100 .. MD9119 | Reserve user softkey in startup screen | 1 = enabled |
| MD9200 .. MD9219 | Activate softkey per area (machine, parameter, program, services, diagnostics) | Bit-coded |
Example: to enable a custom softkey Engrave Dialog in the Machine area horizontal bar, slot 6:
; mmc.ini — display machine data
; File: /user/sinumerik/hmi/cfg/system/mmc.ini
[MACHINE_AREA_SOFTKEYS6]
SK6 = "ENGRAVE", "", "" ; title, picture, tooltip
ACCESS = 0 ; access level 0 = user
Couple the softkey to a dialog using softkey.ini:
; softkey.ini
; File: /user/sinumerik/hmi/cfg/system/softkey.ini
[SOFTKEY_AREA_MACHINE_SK6]
TEXT = "ENGRAVE"
TASK = "MMCDIALOG(EngraveDialog/engravedlg)"
ACCESSLEVEL = 0
Access level 0 corresponds to manufacturer level. End-user accessible softkeys use level 7. Set the operator password (pass 1111 by default for end-user) before testing.
8. Triggering the Dialog from an NC Program
The MMC(...) NC command opens an .ini dialog by name. Syntax (see Programming Manual Job Planning, chapter "Additional Commands"):
MMC("Name", "Mode", "Scope", "Geometry", "Result")
| Argument | Meaning |
|---|---|
| Name | Path of .ini dialog without extension, relative to /proj/ |
| Mode |
"M" modal (until EXIT/UNLOAD), "NM" non-modal (background), "EXIT" close all dialogs |
| Scope |
"S" session, "G" global (across HMI sessions), "" default session |
| Geometry |
"x,y,w,h" dialog box window, default centered |
| Result | Numeric variable receiving return code (0=OK, 1=Cancel, -1=Error) |
Insert the dialog call immediately after M00:
; engraving.spf — engraving subprogram
PROC ENGRAVE(REAL _POS_X, REAL _POS_Y, STRING[32] _ID, INT _QS)
DEF REAL _RET
; Position to engraving point
G0 X_POS_X Y_POS_Y
; Stop for operator input
M0
; Open dialog; blocks until OK/Cancel pressed
MMC("EngraveDialog/engravedlg", "M", "S", "100,100,640,320", _RET)
; Branch on return code
IF _RET == 0 THEN
; Stored in GUD; pull into local string for cycle call
; Cycle 60 expects STRING address; bind via GUD indirectly
_ID = _CH_PROD_ID
_QS = _CH_PROD_ID_LEN
CYCLE60("<TEXT,_VAR_TEXT>", _ID, _QS, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1)
ELSE
MSG("Operator cancelled engraving — program halted")
M0
ENDIF
RET
The cycle call passes the user-entered ID through the cycle's engraving string parameter using the variable substitution mechanism:
; Cycle 60 call form
CYCLE60("<TEXT,_VAR_TEXT>",
"ENGRAVING",
12, ; character count
0.0, 0.0, 0.0, ; X, Y, Z start offsets
0.0, 0.0, 0.0, ; X, Y, Z end offsets
1) ; write on top
9. _VAR_TEXT Substitution
_VAR_TEXT is a placeholder recognized by CYCLE60. The cycle's engraving routine reads the string from the calling context. Direct STRING passing is supported in SINUMERIK 840D sl SW 4.7 SP3 and later when the cycle signature includes STRING[32] _VAR_TEXT. On older firmware, a synchronized action writes the string into the cycle's expected location:
; Pre-cycle assignment for legacy SW < 4.7 SP3
DEF STRING[32] _VAR_TEXT
DEF INT _VAR_TEXT_LEN
_VAR_TEXT = _CH_PROD_ID
_VAR_TEXT_LEN = _CH_PROD_ID_LEN
; Then call cycle with explicit char-buffer (CYCLE60 expects CHAR[])
CYCLE60("<TEXT, _VAR_TEXT>", _VAR_TEXT, _VAR_TEXT_LEN, ...)
strlen() of the user-entered value, not the buffer size, to avoid trailing null characters being engraved.
10. STEP-by-STEP Commissioning Procedure
-
Validate the option. Verify the SINUMERIK Operate programming option is licensed via the license key in
/card/system/license/keys.txt. -
Create the GUD definition. Edit
_N_GUD_DEFin/card/user/cfg/and perform an NCK reset (RESETbutton on MCP, then NCK restart). -
Create the dialog folder. On the CF card, create
/user/sinumerik/hmi/proj/EngraveDialog/withengravedlg.iniand optionalengravedlg.bmp. -
Register the dialog. Add the entry in
/user/sinumerik/hmi/cfg/system/regie.inias shown in section 4. -
Configure softkey. Edit
mmc.iniandsoftkey.inito expose a user-area softkey with the dialog task. -
Adapt the engraving subprogram. Edit the engraving .spf to insert
M0andMMC()before the cycle call. -
Restart the HMI. Use the menu Start-up → HMI → Restart or the service command
/etc/init.d/sinumerik-hmi restart. - Functional check from softkey. Press the softkey. The dialog opens. Enter "TEST123" and press OK. Verify the dialog closes.
-
Verify GUD write. Open Start-up → NC/PLC Variables → GUD. Confirm
_CH_PROD_IDcontains "TEST123" and_CH_PROD_ID_LENequals 7. -
Functional check from NC. Load a part program that calls
ENGRAVE. Run with NC Start. Stop at M0. Enter an ID. Continue. Confirm the engraving is visible on the workpiece. -
Reset and recovery test. Press Cancel in the dialog. Confirm
_RETreads 1 and the program re-issues M0 instead of engraving.
11. Verification Checklist
| Check | Pass criterion |
|---|---|
| Dialog registration |
SHOW MMC in service console lists "EngraveDialog/engravedlg" |
| Softkey visibility | Softkey text "ENGRAVE" visible on horizontal bar after HMI restart |
| Field input | Alphanumeric input accepted up to 32 characters; numeric field accepts negative and decimal values |
| OK returns | Dialog closes, NC resumes, engraving text matches entered string |
| Cancel returns | Dialog closes, NC re-prompts with second M0 |
| GUD persistence | Value remains after NC reset, vanishes only on power cycle if MD re-loads defaults |
| Length truncation | Engraving contains exactly N characters, no trailing zeros |
| Unicode | Non-ASCII characters rejected or replaced with ? depending on locale; test with active locale |
12. Error Codes and Troubleshooting Matrix
| Symptom | Likely cause | Diagnostic | Resolution |
|---|---|---|---|
| Dialog does not open, MMC() returns 120200 | Operate programming option not licensed or .ini not registered | Check licenses.txt and regie.ini
|
Install option, add to regie.ini, restart HMI |
| Dialog opens but fields are blank | DEFAULTS section missing or var names mismatch | Compare element $var with VAR section |
Reconcile variable names; remove duplicate DEF |
| OK softkey does nothing | DO block missing or EXIT not reached | Enable dialog debug log: /user/sinumerik/hmi/log/dialog.log
|
Add DISPLAY trace inside each IF $SK == branch |
| GUD write fails silently | GUD type mismatch — e.g. assigning STRING to CHAR[] | Inspect dialog log | Coerce types: GUD _CH_PROD_ID = Edit1 with CHAR[] backing |
Cycle 60 ignores _VAR_TEXT
|
Cycle version does not implement string substitution | SHOW CYCLE /VERSION |
Upgrade cycle set or pass string via auxiliary variable |
| Softkey text missing | Display MD not enabled for user area | Check MD9000-9019 | Enable MD9005 for SK6 in area menu |
| Engraving cuts wrong characters | Length argument too long, padding includes NUL bytes | Inspect _CH_PROD_ID_LEN
|
Pass strlen() value, not buffer size |
| Dialog disappears after a few seconds | Modal flag missing or HMI in modal pop-up queue | Check MMC(... "M" ...) flag |
Change to "M"; remove competing pop-up dialogs |
| Operator cannot see softkey | Active access level too low | Show access level on status line | Lower ACCESSLEVEL from 0 to 7, or set operator password |
| Engraved text contains `?` for `ä`, `ö`, `ü` | Active font does not include extended Latin | Inspect font table in cycle 60 | Enable extended character set or restrict input to ASCII |
13. Operator Workflow & Safety Considerations
The M0 stop point requires deliberate operator action. Confirm that:
- The spindle is halted and the tool is in a safe position before M0. Use
M5and coolant off where applicable. - The dialog is positioned such that it cannot be obscured by panel glare or covered by the operator's body.
- The OK softkey is large enough to avoid accidental Cancel during gloved operation (≥ 90×60 logical pixels).
- The default softkey on first press is OK (SK1) so that Enter on the alphanumeric input triggers confirmation.
- If multiple operators share the cell, do not store the previous ID as default — require explicit re-entry to prevent mis-engraving.
14. Security and Audit Trail
For traceability, log the GUD write to a CSV on the CF card using a synchronized action or HMI logging directive:
; Log action — append to /card/user/log/engraving_audit.csv
DEF STRING[128] _LOG_LINE
DEF STRING[16] _TS
TS = ""
; Read NC time via $A_DAY, $A_HOUR, etc.
_LOG_LINE = _CH_PROD_ID << ";" << _RN_PROD_QTY << ";"
<< $A_DAY << "/" << $A_HOUR << ":" << $A_MINUTE << ":" << $A_SECOND
WRITE _LOG_LINE / "FILE:/card/user/log/engraving_audit.csv,APPEND"
[LOG].
15. Frequently Asked Questions
Do I need the SINUMERIK Operate programming option to use Easy Screen?
Yes. The Easy Screen (.ini dialog) engine is part of the optional programming package (6FC5800-0AP04-0YB0). Without it, the HMI ignores the .ini files and MMC() returns error 120200 "Dialog not found". Verify license presence in /card/system/license/keys.txt before commissioning.
Can the dialog accept Unicode or only ASCII characters?
Easy Screen STRING fields accept any 8-bit character set that the active locale supports. The font used by CYCLE60 engraving is typically a CNC font table that supports a limited subset — usually ASCII plus Latin-1 accents. Configure the active locale in mmc.ini via [LANGUAGE] and validate engraving output with a non-ASCII test string during commissioning.
Why does the dialog open but the softkey text not appear?
Softkey text is controlled by the display machine data MD9000..MD9019. Without setting the relevant bit for SK6, the softkey area remains empty. Set MD9005 = 1 for SK6 in the Machine area, restart the HMI, and verify with Start-up → NC/PLC Variables → Display Data.
How do I pass the entered string into CYCLE60 engraving?
CYCLE60 expects a STRING[32] or CHAR[] buffer with an explicit length. Declare a GUD CHAR[], write the dialog value into it, then call CYCLE60("<TEXT,_VAR_TEXT>", _CH_PROD_ID, _CH_PROD_ID_LEN, ...). Always pass the character count from strlen(), not the buffer size, to avoid engraving trailing NUL bytes.
Can I trigger the dialog directly from the NC program without a softkey?
Yes. Use MMC("EngraveDialog/engravedlg", "M", "S", "100,100,640,320", _RET) after M0 in the part program. The dialog opens when the NC stops, the operator enters data, presses OK, and execution resumes. The return code in _RET is 0 for OK, 1 for Cancel, -1 for error. Branch on this return code to decide whether to engrave or halt.