Siemens 840D M0 Spindle Restart: Resolving Auto-Resume Failures on Production Parts Programs
On a SINUMERIK 840D-powered lathe or turning center, the programmer's intent for M0 is often a brief in-cycle pause: close or open the steady rest (Lünette), traverse the tailstock quill (Pinole verfahren), retract the tailstock (Reitstock absenken), or perform operator-table actions that keep part flow moving. Under the wrong configuration, M0 instead dumps the spindle and the part program resumes with S = 0, no M3/M4 active, and the spindle coasts to standstill. Operators then have to manually issue a spindle start and the part falls out of cycle. This article explains the root cause (machine manufacturer PLC and modal auxiliary function handling), presents the diagnostic decision tree, and walks through field-proven configuration paths that restore automatic spindle resume on the SINUMERIK 840D, 840D sl, 840D plus, and ONE Numeric Control generations.
1. Problem Statement and Symptom Profile
Symptom on a running production job:
- Part program contains
M0at the end of a turning pass for tailstock repositioning. - Operator presses
NC-Start/CYCLE-STARTafter the manual action. - Spindle does not resume. Part program counter increments, axes feed, but spindle remains at
S = 0with noROTaxis motion. - Channel state in diagnostics shows no active M3/M4 and the
SpindleStatereportsSTOPPED.
Reference behavior the user expects: S and M3/M4 remain modal and active across the M0 halt. This is the documented modal behavior on stock Siemens default cycles where the manufacturer has not overridden the SPC (Stop at Pending Command) handling, but it is not the only valid interpretation and customer-specific SINUMERIK 840D deployments frequently diverge.
SPC (Spindle Stop at Programmed Stop) override intact. Touching the auxiliary function interface without reviewing the machine builder's safety logic is a rejection-prone action by machine OEMs and represents an electrical safety issue under DIN EN ISO 13849-1 PL d or higher depending on machine class.
2. Root Cause Analysis
The default Siemens SINUMERIK 840D auxiliary function decoding pipeline for M0 does not directly clear modal spindle commands. Three independent configuration layers contribute to whether the spindle resumes, and at least one of them is usually the culprit:
-
NC machine data default settings in the startup
_N_INITIAL_INIand per-channel INI files (the modal spindle state is governed by reset / startup behavior MDs and default auxiliary function values). -
NCK auxiliary function decoding & SPC option: the optional behavior Stop Pending Command (SPC) triggers an automatic
M0equivalent atM00blocks and may be combined with spindle stop in the OEM program. -
Manufacturer PLC logic in the M0/M1 branch of the auxiliary function pre-decoding (
FC19/FCTUF-style decoding area in the machine'sMPF/SPFcustomer area): the OEM PLC can deliberately issueM5or clear the spindle enable when the auxiliary function decoder seesM0. This is the most common cause on retrofit or aftermarket-controlled machines.
Cross-checking across identical 840D-equipped machines is the strongest evidence: if one operator's machine auto-resumes and another does not on the same control firmware train, the divergence lives in (1) and (3), not in the NCK kernel.
3. SINUMERIK 840D Auxiliary Function and Spindle Interface Reference
Before configuring, build a correct mental model of the spindle control path. The control surface between part program and physical spindle for M-coded halts is:
| Layer | Signal / Token | Source/Direction | Function |
|---|---|---|---|
| NC program → NCK |
M0, S, M3/M4
|
NC program decoder | Modal auxiliary function commands dispatched to internal spindle state machine. |
| NCK ↔ PLC | DB21..DB interface (channel 1), extended auxiliary function handshake | PLC ↔ NCK | Fast & extended M-function latched/loaded signals, change bits, decoders. |
| PLC ↔ Drive | Drive telegram (PROFIdrive) control words STW1, STW2; setpoints via PROFIdrive NSOLL
|
SIMOTION / SINAMICS | Final spindle enable and speed reference to the SINAMICS drive. |
| PLC ↔ HMI | Channel status, active G functions, active M functions, axis/spindle states | HMI alarm/display | Provides operator visibility in the channel state line. |
The M0 trigger passes through (row 1) into the auxiliary function I/O (row 2). The PLC can either ignore M0 or stamp out a spindle stop. To make the spindle survive M0, the PLC must NOT clear the spindle enable and must leave the most-recent S/M3/M4 modal state untouched in PLC-side tracking variables.
3.1 Standard Auxiliary Function Pre-Decoding in the Manufacturer Cycle Area
The SINUMERIK 840D documentation defines standard auxiliary function pre-decoding via the symbolic names FC19, FCTUF, FC21, and similar blocks in the customer MMCCONF library. Block listings for the 840D sl are documented in the SINUMERIK 840D sl Basic Programming Manual. The PLC programmer reads the active and changed auxiliary function words at the handshake to react.
4. Step-by-Step Diagnostic Procedure
4.1 Prerequisites
- Operator access level / commissioning access (password-protected on most 840D configurations).
- Part program loaded to a known block with the
M0. - PLC project backup: download and archive the existing
*.dpnor*_S7PROJ(depending on HMI version) for rollback. - NCK data archive via Start-up > Data Backup > Series start-up for full machine configuration snapshot.
- Reference to the OEM-specific machine manual for the spindle channel assignment and the M0/M1 PLC chart.
4.2 Step 1 — Verify Modal Spindle State Without M0
- Write a small test program:
G0 X100 Z100 M3 S1500 G1 Z0 F0.2 M0 G1 Z-50 G0 Z100 M5 M30 - Run in AUTO. After
NC-STARTresumes, observe whether the spindle is running. - If the spindle does NOT restart on this trivial test, the modal decode is being cleared by PLC logic on every
M0; proceed to step 2.
4.3 Step 2 — Confirm SPC / Default Auxiliary Behavior in NC Settings
Open Start-up > Machine Data > NC Data or use SinuTrain/Programming Tool offline. Inspect the MDs related to reset modal behavior and default auxiliary functions. Each MD must be evaluated in context of the OEM's machine-specific INI; below is the category of MD to verify:
| MD Category | Symbolic Function | What It Controls |
|---|---|---|
| NCK default G / auxiliary functions (reset values) | Modal defaults applied on Reset / Power-On | Whether modal M3/M4 persists across reset; sets spindle modal state at startup. Should be reviewed for SPC overlap. |
| Auxiliary function output timing (fast / extended) | Number of M-functions per block, acknowledgment scheme | How PLC must handshake received M0; confirm M0 is not being decoded to a non-existent M5 in extended decoding. |
| Channel-specific settings (reset / SPC) | Per-channel behavior of the command sequence at reset | Specifies whether the spindle is held under Reset / SPC. |
| Interface definition (PLC quick / extended) | DB21..DB layout, bit assignments | Whether the OEM PLC reads the correct bit for M0-active state. |
4.4 Step 3 — Trace the M0 in the PLC Program
- Open the machine's PLC project in SIMATIC Manager (for classic STEP 7) or TIA Portal (for newer 840D sl with STEP 7 Safety integration).
- Cross-reference the auxiliary function decoder block (commonly named
AUX_M,FV,M_DECODE, or per-OEM naming likeSPINDLE_M) forM0andM1cases. - Search for any branch where the code sets the spindle stop enable or clears the spindle ON flag.
- Search for
"M0",DEC_M0,M_FUNCTION := 0, etc. - Log the spindle control words before and after
M0on a watch table — captureSTW1bit state (particularly bits 0–3 corresponding to ON/OFF, no jog, ramp-function generator enable, ramp-function generator disabled) for several cycles.
This is the most diagnostic step. If the PLC clears the spindle enable on M0, the configuration must change in the PLC, not in NCK.
4.5 Step 4 — Determine the Cause Path
| Observed PLC Trace | Likely Cause | Remediation Surface |
|---|---|---|
| Spindle enable cleared on M0 with DELAYED RESET-type flow. | OEM PLC explicitly handles M0 (case 3 above). | Modify / wrap the M0 branch in the manufacturer PLC. |
| Enable NOT cleared, but no M3 / M4 reasserted on resume. | NCK default auxiliary function on Reset / SPC is empty. | Adjust the per-channel NC INI / NCK MDs for modal startup. |
| Spindle enable flags transiently cleared on NCK side. | SPC (Stop Pending Command) option configured aggressively. | Review SPC switch & per-channel MD for SPC mode. |
| No PLC finger-print on M0 at all. | M0 decoded as 'hidden' via coupled subprogram / cycle interception. | Inspect cycles and any _N_CST_DIR / _N_USER_DIR overlays. |
5. Configuration Procedure A — Manufacturer PLC Modification
Approach A is the preferred field path. It is non-invasive to NCK configuration and aligns with the documented SINUMERIK open-loop architecture where auxiliary function interpretation is the PLC's responsibility.
5.1 Identify the M0/M1 Handler Block
From the cross-reference in Step 4, identify the FC/FB call where M0 is decoded. Example structure (illustrative — OEM-specific):
// OEM auxiliary function decoder (illustrative)
CASE #M_Ext_OfMfunct OF
0 : // M0 - programmed stop
IF #Reset_Run THEN
#Spindle_Stop := TRUE; // <-- this is the auto-M5 path
END_IF;
...
END_CASE;
5.2 Modify or Wrap the Branch
Two field-proven implementation patterns:
Pattern 1 — Spindle Hold: do nothing on M0; let the previous modal S / M3 / M4 persist.
CASE #M_Ext_OfMfunct OF
0 : // M0 - programmed stop
// No spindle clear. Modal S/M3/M4 retained.
...
END_CASE;
Pattern 2 — Conditional Spindle Hold (semi-automatic): for parts programs flagged Tailstock Cycle via a dedicated G code (e.g., user G G199) or by reading a marker DB, suppress the spindle clear.
CASE #M_Ext_OfMfunct OF
0 : // M0
IF #Auto_Spindle_Hold THEN // OEM flag from cycle
// suppress spindle stop
ELSE
#Spindle_Stop := TRUE;
END_IF;
...
END_CASE;
5.3 Compile, Download, and Test
- Compile the modified PLC project. Capture warnings — Siemens PLC projects often report address collisions that must be reconciled.
- Download to the target PLC while in Commissioning access level.
RESETthe PLC after download with care (could disrupt an active spindle; place machine inREADYstate). - Re-run the test program from §4.2 and verify spindle auto-resume.
6. Configuration Procedure B — NCK INI / Cycle Modification
If the OEM PLC pattern is unavailable (encapsulated under IP, locked compiler archives), attempt Approach B at the NCK level.
6.1 Modal Startup Defaults
Edit the per-channel INI file in _N_INITIAL_INI or _N_CHAx_INI to confirm the modal startup commands include spindle M3 / M4 if the part program is structured around M0 halts.
Many OEMs wrap the modal spindle default inside an OEM startup cycle; manual editing of NCK MDs without OEM consultation is discouraged because of functional safety implications.
6.2 Cycle Override in _N_CST_DIR
- Locate any cycle reading
M0in the customer area:
grep -rn "M0\|M00\|DEC_M0" /card/customer/cycles/
- If a cycle intercepts
M0and forces a spindle stop, comment out or replace the offending branch. Avoid touching compiled cycles (*.spfthat are binary-compiled by the OEM). - Re-archive cycles via Commissioning > Cycle Backup.
7. Field-Proven Pattern: Cycle-Based Spindle Resume
When the OEM PLC is opaque, an installer can add a transparent spindle resume behavior at the operator-programming layer by adding a cycle that detects M0 via a small DB and re-asserts spindle ON. However, this is fragile and is not the recommended path — it is included here only for completeness and as a documented fail-safe:
- Add a new cycle
_N_CST_DIR/_N_SpindleHold.SPF:
PROC SPINDLE_HOLD SAVE
; Read extended M function echo
IF $AC_M_FCT[0] == 0 AND $AC_BLOCKTYPE == "M0"
; No output — pass through, leaving modal S/M3/M4 untouched
ELSE
M0 ; default programmed halt
ENDIF
M17
- Bind the cycle to a hot-key or override on the operating panel.
This pattern is sometimes used by retrofitters who cannot touch the OEM PLC source but can configure the cycle directory. It does not change OEM PLC behavior at all, so it is less invasive but requires operator discipline.
8. Verification Procedure
- Run the §4.2 test program and confirm
M3active after NC-Start followingM0. - Run a production part program with multiple
M0blocks; confirm spindle re-starts at eachNC-START. - Confirm that the Feed Hold behavior still halts axes and changes spindle to follow the configured mode (typically a speed-controlled
STW1open-loop stop). - Verify e-stop still cuts spindle within SINAMICS-configured deceleration ramp.
- Verify that
M0still halts all axes (modal behavior ofM0must not be inadvertently suppressed). - Confirm that any external M0-triggered outputs from the OEM PLC (e.g., clamping valve reset) still fire correctly.
| Verification Check | Expected Outcome | Source of Truth |
|---|---|---|
| Modal spindle command after M0 resume | M3/M4 active, S value retained | Channel state / Diagnosis > M Functions |
| Spindle actual speed | Setpoint within tolerance | Axis/Spindle display on HMI |
| Axis motion after NC-START | Rapid/feed honors modal G | Trace logs |
| E-stop response | Hard cutoff, no delay | SINAMICS safety acceptance tests |
| Operator safety guards (steady rest closed confirmation) | Unchanged | OEM PLC test report |
9. Safety and Compliance Considerations
- The spindle-related safety architecture on a Siemens 840D is typically built around PROFIenergy or SINAMICS safety functions such as Safe Stop 1 (SS1) and Safe Torque Off (STO) per IEC 61800-5-2. Changes to PLC M0 handling must not disturb the safety state machine.
- Per EN ISO 13849-1, the safety integrity of the spindle stop-related functions on heavy machines is typically PL d (CAT 3) or higher. Branch modifications that interfere with the safety-decoded M-functions should be reviewed under the machine's change-control protocol.
- If the machine is undergoing retrofit, perform a CE re-evaluation and update the safety verification report. Always engage the OEM via the official Siemens Service & Support channel for any change affecting the spindle's safe-state behavior.
- For ESPE (electro-sensitive protective equipment) and operator guard interlock integration, confirm that the steady rest clamping feedback path is independent of the
M0-spindle path.
10. Cross-Platform Notes — 840D, 840D sl, 840D plus, and ONE Numeric Control
| Generation | NCK Software Range | M0 Behavior Default | Remediation Specifics |
|---|---|---|---|
| SINUMERIK 840D (classic) | SW 1.x – SW 5.x | Modal spindle may be cleared depending on OEM | PLC modification via STEP 7; cross-reference DB21..DB17 / DB21..DB7 |
| SINUMERIK 840D sl | SW 2.x – SW 4.x | Similar; HMI sl Pro | STEP 7 (Hw Config) and TIA Portal supported |
| SINUMERIK 840D plus | SW 4.5+ | Adaptive defaults | PLC via TIA Portal; PLC interface renamed in DB21..DB |
| SINUMERIK ONE | SW 6.x | Path-based approach; virtual / NCK replicated | Configure PLC via NX-CAD/SPL — consult Siemens Industry Online Support for ONE-specific procedures |
The interface signals, MDs, and PLC blocks are similar across generations but not interchangeable. Reference the appropriate SINUMERIK 840D sl Programming Manual for your software version.
11. Troubleshooting Matrix
| Symptom | Likely Cause | First Action | Confirmation |
|---|---|---|---|
| Spindle stays off after M0 with no warning. | PLC clears spindle enable on M0. | Open PLC FC/FB for M0; check for STOP commands. | Watch table before/after. |
| Spindle stays off after M0; HMI shows "Reset Spindle" alarm. | NCK detects spindle state inconsistency. | Clear the alarm; cross-check spindle mechanics. | Alarm log. |
| Spindle re-starts but at wrong RPM. | Modal S cleared but M3 retained. | Restore default S by channel INI / cycle. | Channel state display. |
| Spindle re-starts but in wrong direction. | Modal M3/M4 swapped. | Verify part program block ordering. | Operator mark-out. |
| E-stop behavior changed after PLC change. | Modified branch inadvertently affects safety. | Roll back PLC; redo under OEM supervision. | OEM test report. |
| Same program restarts spindle on one machine but not another. | Different OEM PLC configurations. | Compare machine data + PLC dump. | Diff tool. |
12. Commissioning Checklist
- Archive existing PLC + NCK + drive configuration before any change.
- Review the latest Siemens Product Notifications for related advisories.
- Capture the logical spindle assignment (
NAper channel, gear stages, axis naming likeSP1) for documentation. - Implement change in a test rig or during planned downtime.
- Run the §4.2 benchmark program and capture the channel state line.
- Run a representative production part program end-to-end.
- Update the OEM service log with the change rationale and the operator quick-reference card.
Why does my Siemens 840D stop the spindle at M0 while another 840D machine in the same plant doesn't?
The behavior is controlled by the machine manufacturer's PLC decoding of the auxiliary function. Siemens ships a default kernel that is then customized by every OEM; some OEMs clear the spindle enable on M0 to enforce safe-state behavior, others leave the modal M3/M4/S untouched. Compare the PLC FC/FB for M0 between the two machines to confirm the difference.
Can I configure the spindle to auto-resume after M0 with a machine data change only, without touching the PLC?
Sometimes yes — specifically when the cause is the modal NCK default of the spindle function after Reset / SPC, in which case the per-channel INI / machine data modifies the default modal setpoint. However, when the cause is OEM PLC logic that explicitly issues M5 on M0, only a PLC change or a customer cycle wrapper resolves it. NCK-only changes never modify OEM PLC behavior.
Will changing M0 behavior break the steady rest / tailstock closing interlocks?
Properly implemented M0 PLC branches are independent of the steady rest / Lünette safety interlocks. Verify after any change that the safety interlock feedback (e.g., steady-rest closed signal) is unaffected, and that the machine passes the OEM-defined acceptance test for that auxiliary function.
Is it safe to modify M0 behavior on a CE-marked machine without OEM consent?
No. The CE / functional safety assessment assumes the as-shipped PLC behavior. Alterations affecting spindle state at programmed stop can place the machine outside its safety case. Engage the OEM via the official Siemens service channel before modifying the M0 decode, or operate under a documented retrofit project with risk assessment per EN ISO 12100 and EN ISO 13849.
What is the difference between M0 and M1 in this context?
M0 is unconditional programmed stop; M1 is optional stop controlled by the operator toggle on the HMI. Both pass through the same PLC decoder. Some OEMs apply identical spindle-stop logic to both, others differentiate them. Field verification on the actual machine is the only reliable guide.
Does this affect the SINUMERIK 840D sl and 840D plus the same way?
Yes, the architectural structure is preserved across the 840D / 840D sl / 840D plus generations. The MD numbers and DB21 bit positions may differ; refer to the relevant programming manual on the Siemens Industry Online Support portal for the exact version-specific mapping.
Where can I find the relevant Siemens documentation for my software version?
The SINUMERIK 840D sl Basic Programming Manual, the Parameter Manual (machine data list), and the Function Manual "Spindles" (S1) are the three reference documents to consult. They are freely accessible via the Siemens Industry Online Support portal by searching the part number or your control software version.