SINUMERIK 840D PLC Backup Architecture Overview
The SINUMERIK 840D powerline and 840D sl controllers maintain three independent data domains that must be archived and restored together to return a machine to its commissioned state: the NC data domain (machine data, setting data, NC programs, tool data, compensation data), the PLC data domain (PLC program blocks, DB/FB/OB sources loaded into the integrated S7-300 or S7-400-compatible PLC), and the HMI data domain (screens, softkey layouts, NC VAR selector assignments, and user cycles). A common failure mode on machines with 5–15 years of service life is the assumption that the PLC backup archive alone is sufficient to recreate the original machine configuration. It is not. The PLC backup generated by the SIMATIC STEP 7 / S7-300 archive tool or by the SINUMERIK HMI's "Series commissioning – Backup" function captures only the contents of the PLC's load memory at the moment the archive was created. It does not capture NC machine data, NC setting data, NC VAR selector binding tables, PLC symbol tables, or the HMI project files. When a service engineer replaces the PLC battery, clears the PLC memory via MRES, or uploads a fresh PLC program, the NC domain remains intact on the NCU (Numeric Control Unit) CF card, but the interface between the PLC user program and the NCK must be re-established through NC VAR selector entries and MD bits that are stored outside the PLC archive.
This article documents the root-cause pattern observed when an operator restores a 2012-vintage PLC backup onto a machine whose NC state has since been modified (for example, linear scale bypassed via MD in 2020, PLC bit changed from 0 to 1 by a service engineer to enable a workaround). It provides a verified procedure for re-establishing the missing NC VAR selector bindings, re-setting the MD bits, and confirming axis behavior in JOG mode before resuming AUTO operation.
PLC Backup vs. NC Backup: Domain Boundaries
| Data Item | Stored in PLC Backup | Stored in NC Backup | Stored in HMI Backup |
|---|---|---|---|
| PLC program blocks (OB, FB, FC, DB) | Yes | No | No |
| PLC symbol table (Symbol Editor) | No (source-side only) | No | No |
| NC machine data (MD) | No | Yes | No |
| NC setting data (SD) | No | Yes | No |
| NC VAR selector binding table | No | Partial (NC side) | Yes (HMI side) |
| Compensation data (EEC, QEC, sag, friction) | No | Yes | No |
| Tool/magazine data | No | Yes | No |
| HMI softkey project / ProTool/WinCC flexible | No | No | Yes |
| Drive parameters (SINAMICS) | No | Partial | No |
| PLC user alarms / DB contents at runtime | Snapshot only | No | No |
NC VAR Selector Tool: Function and Failure Mode
The NC VAR selector is a Windows-side configuration utility (shipped with the SINUMERIK Toolbox or the HMI Pro installation) that maps PLC operand addresses (Inputs I, Outputs Q, Flags M, Data words DBW) to NC variables so the HMI can display them in screens, alarm lines, and user-variable views. Each entry in the NC VAR selector produces two artefacts: a row in the HMI's variable table that the runtime polls, and an entry on the NC side (typically stored under /user/sinumerik/hmi/data/ or registered through the NCVAR configuration file) that allows the PLC to read/write the corresponding NC variable via the PI service interface.
When the PLC backup is restored but the NC VAR selector table is not re-imported, the following symptoms appear:
- HMI screens display
+++in fields that previously showed spindle speed, axis position, or load percentage. - PLC writes to spindle analog setpoint fail silently because the corresponding NC variable (e.g.,
spindleSpeedAnalog) is not bound. - Alarm
17000 "Channel %1 block %2 no memory available"or12550 "Channel %1 block %2 name not defined"appear when NC programs reference symbols that the HMI no longer exposes. - PLC-to-NCK interface bits (DB19 / DB21 / DB31) return default values, causing the PLC user program to behave as if interlocks are open even when they are closed.
Machine Data Persistence and PLC Bit Coupling
Many machine commissioning engineers use NC machine data bits as software switches to enable, disable, or remap functions. Common examples observed on retrofit 840D powerline machines include:
| MD Number | Function | Typical Bit Pattern |
|---|---|---|
| MD30200 $MA_NUM_ENCS | Number of encoders on axis | Bit pattern defines encoder 1 / encoder 2 active |
| MD30240 $MA_ENC_TYPE | Encoder type (incremental / absolute) | Bit 0 = 1: linear scale; Bit 0 = 0: rotary |
| MD30300 $MA_IS_ROT_AX | Rotary axis flag | Bit 0 = 1: rotary; Bit 0 = 0: linear |
| MD31000 $MA_ENC_IS_LINEAR | Linear scale direct measurement | Bit 0 = 1: linear scale active |
| MD36200 $MA_POS_LIMIT_MINUS / MD36210 $MA_POS_LIMIT_PLUS | Software limit switches | Numeric values per axis |
| MD20150 $MC_GCODE_RESET_VALUES | G-code reset values | Bit-coded G groups |
Spindle Control PLC Interface: Q41.5 / Q41.6 and Analog Setpoint
On a standard SINUMERIK 840D PLC user program, the spindle start/stop and direction commands are issued through fixed outputs of the integrated PLC. The most common mapping in the standard machine program (delivered with the SINUMERIK toolbox example project) is:
| PLC Address | Symbol (typical) | Function | Companion Signal |
|---|---|---|---|
| Q41.5 | Spindle_ON | Spindle start (M3 direction via Q41.6) | Analog setpoint on PLC output (e.g., PQW 320) |
| Q41.6 | Spindle_CCW | Spindle direction M4 (CCW); OFF = M3 (CW) | Active only when Q41.5 = 1 |
| Q41.4 | Spindle_Parking | Spindle parking / oscillation enable | Independent of Q41.5 |
| I32.x | Spindle_Aux_* | Feedback from NCK to PLC | DB31.DBX83.x group |
For spindle rotation to occur, three conditions must be satisfied simultaneously:
- PLC command: Q41.5 = 1 (start). Direction select: Q41.6 = 0 for M3 (CW), Q41.6 = 1 for M4 (CCW).
- Analog setpoint: PQW 320 (or the configured analog output word) must be non-zero. The scaling is typically 16384 = 100% of MD32000 $MA_MAX_AX_VELO for the spindle analog interface. Writing 0 to PQW stops the spindle regardless of Q41.5.
- NCK enable: DB31.DBX1.0 (drive enable) and DB31.DBX1.1 (pulse enable) must be set by the PLC based on safety chain closure. Without these, the spindle will not accelerate even if Q41.5 = 1 and PQW is set.
To diagnose a "spindle does not run in JOG" symptom, force-inspect these three conditions on the HMI's PLC status screen or via STEP 7 online monitor. If Q41.5 toggles correctly but PQW remains 0, the issue is upstream of the PLC output — typically the NC VAR selector binding for spindleSpeedAnalog is missing.
Linear Scale Bypass via MD: The 2012 vs. 2020 State Mismatch
The case described in field reports shows a Y axis that originally operated with a linear scale (Heidenhain LS or similar) in 2012, but the scale was bypassed in 2020 through machine data changes when the scale hardware failed and was not replaced. The MD that governs this configuration is:
- MD31000 $MA_ENC_IS_LINEAR[AX2] = 0 (rotary motor encoder used as only feedback; linear scale is not evaluated).
- MD30220 $MA_ENC_MODULE_NR[AX2, ENC1] unchanged (motor encoder remains on logical encoder slot 1).
- MD30240 $MA_ENC_TYPE[AX2, ENC2] = 0 (encoder slot 2 disabled) — only relevant if the linear scale originally occupied slot 2.
If the PLC program contains branches that read DB31.DBX1.5 (position measuring system 2 selected) or expects the dual-encoder feedback structure, restoring a pre-2012 PLC backup can re-enable logic that probes the linear scale and never reaches the operational state. The service engineer's "set bit from 0 to 1" workaround typically corresponds to one of the following:
- DB31.DBX1.5 forced to 0 to lock the PLC to encoder 1 (motor feedback only).
- A user-specific DB bit that disables the linear scale plausibility check.
- An MD bit (e.g., MD32710 $MA_CEC_ENABLE = 0) that disables sag compensation, which depends on the linear scale on Y.
SinuCom NC Trace or HMI menu Commissioning > MD > Export) before any PLC backup restoration saves hours of re-commissioning.Axis Referencing and JOG Mode Behavior
A common confusion on machines with mixed referenced / non-referenced axes is whether JOG motion is permitted when referencing has not completed. The SINUMERIK 840D permits limited JOG operation in the following scenarios:
| Condition | JOG Allowed? | Constraint |
|---|---|---|
| All axes referenced | Yes | Full velocity (MD32020 JOG_VELO) |
| Some axes referenced, spindle not referenced | Yes (axes only) | Spindle rotation requires referencing on at least one axis for safety |
| No axes referenced, no mechanical jam | Limited | JOG velocity reduced by MD32000 / MD32020 ratio; NC MD20150 $MC_JOG_MODE_MASK defines behavior |
| Mechanical jam in X axis and A axis (as in case) | No | NCK raises alarm 20005 "Channel %1 axis %2 blocked" — JOG inhibited until mechanical issue is resolved |
Alarm 20005 "Channel %1 axis %2 blocked" is the dominant symptom when a JOG command is accepted by the HMI but no motion follows. The cause is mechanical (guide seizure, ballscrew jam, coupling slip) or electrical (drive enable missing, motor cable phase open). In the case described, both X axis and A axis raised this alarm due to mechanical jamming — the Y axis and Z axis retained JOG capability, which is consistent with the observation that "4 axes were moving in JOG."
Step-by-Step Backup Restoration Procedure
-
Identify the three archives present on the HMI. Navigate to Commissioning > Backup/Restore > Series commissioning. Record the timestamp and label of each archive. Typical labels:
PL_2010.arc,NC_2012.arc,PLC_2012.zip. Confirm which archive contains the latest NC state versus which contains the latest PLC state. -
Export current NC MD as a baseline. Use Commissioning > MD > Export to CF. This produces a
*.txtMD-diff file you can diff against the known-good 2020 state. Save the file with a dated filename. - Verify the PLC backup archive contains the symbol table. Open the archive with STEP 7 / SIMATIC Manager. If the symbol table is missing, the operator must re-export it from the source project. The PLC archive without symbol table is functionally usable but unauditable — every address is a raw byte offset.
-
Confirm the NC VAR selector file is available. On the engineering station that originally configured the machine, open the NC VAR selector tool (Start > Programs > SINUMERIK > Tools > NC VAR selector). Export the variable table as a
*.varfile. Copy this file to a USB stick. -
Power down the NCU. Insert the CF card into a card reader. Verify the NC archive is intact (file size matches expected, no
.tmpresidue). Re-insert CF card and power on. - Restore the NC archive via HMI. Commissioning > Backup/Restore > Series commissioning > Read archive > Restore NC + HMI. Wait for the NCU to reboot twice. Confirm NCK comes up in operator mode without alarm 8020 "NCK battery warning" or 8080 "CF card inconsistent."
- Restore the PLC archive. From STEP 7 / TIA Portal connected to the integrated PLC (default IP 192.168.214.1 for 840D sl, or via MPI for powerline), select PLC > Download to Target Device. Monitor the PLC online; confirm OB1, OB40, OB82, OB100, OB101, OB121, OB122 are all loaded without SF (System Fault).
-
Import NC VAR selector table. From the engineering station, run NC VAR selector and re-import the
*.varfile. Push to NCU. This step re-creates the PLC ↔ NCK binding table that was lost when PLC backup was restored. - Re-apply known MD deviations. Compare the MD-diff file from step 2 with the documented MD state from the 2020 commissioning. Re-enter the deviations by hand or by importing a known-good MD snapshot. Pay particular attention to MD31000, MD30220, MD30240, MD30300, MD32710, MD36200, MD36210 for each axis whose scale configuration changed.
- Re-apply PLC service-engineer workaround bits. Document each bit the original service engineer set (e.g., DB100.DBX0.0 = 1). Cross-check against the original commissioning sheet. If the original sheet is unavailable, derive the bits by observing machine behavior: which axis no longer references, which output now toggles.
- Test in JOG mode. From the HMI, set Mode > JOG. Reference each axis individually. Confirm axes reach reference point without alarm 20005. Confirm spindle JOG (Spindle + / Spindle - keys) rotates the spindle at JOG velocity MD32020 and stops cleanly on key release.
- Run a dry-cycle test program. Load a short known-good part program. Run in Dry Run (DRY) mode with rapid override 25%. Confirm no alarms 12500, 12550, 17000, 20005, 25000.
- Capture the post-restore MD + PLC snapshot. Re-export MD (step 2). Save the PLC project. Save the NC VAR selector file. Label with the current date. This new snapshot becomes the "known-good" reference for the next restoration.
Verification Checklist After Restoration
| Check | Pass Criterion |
|---|---|
| PLC SF / BF LEDs | Both OFF |
| HMI online connection to NCK | Green indicator; no alarm 8040 "HMI connection failure" |
| Axis reference status (each axis) | DB31.DBX60.4 = 1 (referenced) |
| Spindle JOG CW and CCW | Q41.5 = 1 toggles; Q41.6 selects direction; analog setpoint PQW > 0 during rotation |
| Tool change cycle (magazine axis) | No alarm 14000 "Tool not found" or 22000 "Magazine blocked" |
| NC VAR selector fields in HMI | Display live values, no +++
|
| Compensation data active | MD32710 = 1 expected value; QEC/EEC tables populated |
| Drive parameters loaded | No alarm 25201 "Drive fault" |
Troubleshooting Matrix
| Symptom | Likely Root Cause | Verification | Remedy |
|---|---|---|---|
| Spindle does not run, Q41.5 toggles | PQW 320 = 0 (NC VAR selector not loaded) | Monitor PQW 320 online; force test value | Re-import NC VAR selector table |
| Y axis will not reference after PLC restore | MD31000 / MD30220 reverted to old state expecting linear scale | Read MD31000[AX2] in HMI | Set MD31000[AX2] = 0, MD30220[AX2,ENC2] = 0 (disable linear scale slot) |
| Y axis runs after PLC restore but in wrong direction | MD32100 $MA_AX_MOTION_DIR sign changed | JOG Y+ and observe direction | Toggle MD32100 bit 0 |
| Alarm 20005 on X and A axis | Mechanical jam, not configuration | Hand-crank axis with motor de-energized | Resolve mechanical issue first; do not re-archive until drive enable is verified |
HMI shows +++ in load display |
NC VAR selector binding missing for that variable | Cross-check variable name in NC VAR selector tool | Re-add variable to selector table and push |
| Alarm 12550 after PLC restore | NC program references symbol no longer exposed | Cross-check symbol table against current program | Re-export symbol table from source PLC project and rebuild HMI screens |
| Alarm 8080 after NC restore | CF card inconsistent with restored NC archive | Check /user/sinumerik/nck directories |
Perform Power-on with default MD then re-archive NC |
| Service-engineer workaround bit reverts on every PLC download | Bit is in PLC program memory (volatile) not in PLC project archive | Search STEP 7 project for the bit address | Move the bit logic into a permanent FB and re-archive PLC project |
Backup Lifecycle Best Practices
-
Timestamp every archive. Use the form
YYYY-MM-DD_site_machine_scope.arcwhere scope is one ofNC,PLC,HMI,FULL. Filename dating is the single most useful habit for a service engineer arriving on site five years later. - Maintain a one-page machine commissioning sheet. List every MD that deviates from Siemens delivery state, every PLC bit that was forced for a workaround, and every NC VAR selector entry that was added by integration. This sheet rides with the machine file and is updated whenever a service visit changes state.
- Archive after every meaningful change. Trigger points: MD deviation applied, PLC program modified, NC VAR selector binding added, mechanical repair that bypasses hardware (linear scale replacement deferred), safety upgrade, drive firmware update.
- Retain at least three generations. Keep current, previous, and pre-previous archives. When a change causes a regression, the previous-good archive is a five-minute recovery path.
- Verify archive integrity quarterly. Power up an offline NCU or use SinuCom NC Trace to read the archive header. A corrupted archive is silent until it is the only one remaining.
- Store archives off-machine. Use the Siemens service USB stick plus a mirrored copy on the customer's engineering server. A machine-room fire takes the archives with it.
- Document the password / access for each archive. Series-commissioning archives can be password-protected; the password must be stored in the same place as the commissioning sheet.
- Train at least two operators on the restore procedure. The single biggest risk on a 2010-vintage 840D is that the only person who knows the restore sequence has retired.
Reference Documentation
The procedures described above align with the following official Siemens documents. Operators performing the restoration should keep these locally accessible:
- SINUMERIK 840D sl Commissioning Manual — describes the series-commissioning archive structure and MD import/export workflow.
- SINUMERIK 840D sl PLC Programming Manual — documents the standard PLC user program template including Q41.5 / Q41.6 spindle interface.
- SINUMERIK 840D sl Basic Functions — covers axis referencing, software limit switches, and encoder configuration MDs referenced above.
- SINUMERIK NC VAR Selector Tool Documentation — describes variable binding and HMI/NCK variable access.
- SIMATIC S7-300 PLC Programming — required for operators working with the integrated PLC archive and symbol table.
Field-Commissioning Decision Path for Multi-Archive Sites
When three or more PLC backup archives exist on an HMI (as in the original case), the service engineer must decide which archive best represents the present hardware state. The decision path:
- Identify the date the linear scale was bypassed. This is the latest date any MD related to encoder configuration changed.
- Identify the date the service engineer set the PLC bit from 0 to 1. This is typically the same date as (1) but may differ if the PLC bit was a separate workaround.
- Select the PLC archive whose timestamp is the most recent after dates (1) and (2). If none exists, the operator must re-apply the MD deviations and PLC bits manually after restoring any earlier archive.
- If the most recent PLC archive is older than the mechanical jam (e.g., 2012 archive, 2024 jam), restore the PLC archive first, then re-apply all MD deviations from the machine commissioning sheet, then mechanically clear the jam, then re-archive.
FAQ
Does the SINUMERIK 840D PLC backup contain the NC VAR selector table?
No. The PLC backup contains only the PLC program blocks (OB, FB, FC, DB) and a snapshot of retentive DB contents. The NC VAR selector table is stored on the HMI/engineering station side and must be exported separately and re-imported after any PLC restore. Symptom of a missing NC VAR selector is HMI fields displaying +++ and PLC analog setpoints (e.g., PQW 320 for the spindle) remaining at zero even when Q41.5 is set.
Why does the spindle not run after restoring an old PLC backup?
Three conditions must be satisfied simultaneously: PLC output Q41.5 must be set (spindle start), Q41.6 selects direction (M3 = 0, M4 = 1), and the analog setpoint word PQW 320 must be non-zero. The PQW value is written via the NC VAR selector binding; if the selector table is not re-imported, PQW remains 0 and the spindle will not accelerate even when Q41.5 toggles correctly. Verify by online-monitoring PQW 320 in STEP 7 while issuing a spindle start from JOG.
What machine data disables a linear scale on a specific axis?
Set MD31000 $MA_ENC_IS_LINEAR[Ax] = 0, MD30220 $MA_ENC_MODULE_NR[Ax, ENC2] = 0, and confirm MD30240 $MA_ENC_TYPE[Ax, ENC2] = 0. If the PLC program reads DB31.DBX1.5 (position measuring system 2 selected), ensure that bit is forced to 0 or that the PLC branch is disabled. After changing these MDs, the axis must be re-referenced.
How do I know which archive contains the most current PLC state?
Each archive's timestamp is embedded in the filename or in the HMI series-commissioning list. Cross-reference the timestamp against the machine commissioning sheet — the latest meaningful change (MD deviation, PLC workaround bit, mechanical bypass) defines the "most current" archive. If no archive post-dates the most recent change, the operator must re-apply the deviations manually after restoration.
What alarm appears when an axis is mechanically jammed?
Alarm 20005 "Channel %1 axis %2 blocked." The NCK detects that the position command is not being followed within the MD36020 $MA_POSITIONING_TIME window. The remedy is mechanical (clear the jam, replace the ballscrew, tighten the coupling) — configuration changes will not clear this alarm. JOG is inhibited on the affected axis until the underlying mechanical issue is resolved.
Why does my Y axis run in JOG after PLC restore but fail in AUTO?
JOG does not require full NC program synchronization; AUTO does. If the Y axis is missing a required NC VAR selector binding (e.g., axis position readback to the HMI) or if MD20150 $MC_GCODE_RESET_VALUES does not match the part program header, AUTO will fail with alarm 12550 "name not defined" or 16800 "Channel %1 block %2 traverse command without traverse enable." Re-import the NC VAR selector table and verify MD20150 against the part program requirements.