Sinumerik 808D M-Code Not Activating PLC Bit: Troubleshooting Guide
The Sinumerik 808D ships with an integrated PLC that decodes every M-function called by the NCK before any user-defined side effect (coolant on, chuck open, bar-feeder advance, custom aux) becomes visible to the machine. When an operator types M11 into the MDI line and nothing happens on the PLC side, the failure is almost always one of four things: the user M-code is not pre-decoded by the 808D firmware and the PLC decode network is missing; the M-code strobe signal is not being read; the program is loaded on the controller but the wrong project is active on the PLC; or the M-function acknowledgement (M-ACK) is not being returned so the NCK never presents the M-code again. This guide walks through the full signal chain on the 808D, isolates each failure mode, and provides a working decode network that you can paste into your PLC project.
1. Problem Summary
The reported symptom is straightforward:
- Controller: Sinumerik 808D (turning or milling).
- Programming tool: PLC Programming Tool (ladder / FBD editor shipped with the commissioning package).
- User action: enters
M11in MDI mode and presses Cycle Start / NC Start. - Expected result: PLC bit (intended to drive an auxiliary function, e.g.,
M100.0) goes TRUE while the M-function is active. - Actual result: nothing happens on the PLC side. Trying other M-codes produces the same silent result.
The first suspicion usually falls on the NC program, but on the 808D, M-codes are decoded exclusively in the PLC. The NCK only transports the M-code number and a strobe; the PLC decides what to do with it. The fix is therefore in the PLC project, not in any G-code.
2. Sinumerik 808D M-Code Signal Architecture
The 808D NCK and PLC communicate through a fixed set of interface signals. M-functions flow from the NCK to the PLC along this path:
- The NCK decodes a part-program block containing an M-word.
- The NCK writes the M-function number to the M-function number interface word (typically
M_FCT_NUM) and sets the strobeM_FCT. - The PLC reads the strobe and number, executes the user-defined action (set a memory bit, energize an output, run a subroutine), and acknowledges the M-function by toggling
M_ACKor by reading the relevant pre-decoded signal. - The NCK clears the strobe after acknowledgement and continues with the next block.
The 808D pre-decodes a small set of standard M-codes that are required by DIN 66025 / ISO 6983 turning and milling conventions. Any M-code that is not pre-decoded must be handled by the PLC. The complete signal map is documented in the Sinumerik 808D Programming and Operating Procedures for Turning manual and the matching 808D milling documentation.
| M-code | Function | 808D handling |
|---|---|---|
| M00 | Programmed stop | Pre-decoded; halts the part program. |
| M01 | Optional stop | Pre-decoded; halts only when optional stop is enabled. |
| M02 | End of program | Pre-decoded; resets the program. |
| M03 | Spindle CW | Pre-decoded; drives spindle interface signals. |
| M04 | Spindle CCW | Pre-decoded; drives spindle interface signals. |
| M05 | Spindle stop | Pre-decoded; clears spindle run signals. |
| M06 | Tool change | Pre-decoded; triggers tool changer sequence. |
| M07 / M08 | Coolant on (mist / flood) | Pre-decoded; coolant outputs handled by PLC. |
| M09 | Coolant off | Pre-decoded; coolant outputs cleared. |
| M17 / M30 | End of subroutine / program | Pre-decoded; resets program flow. |
| All other M-codes (M10, M11, M12, ... M99) | User-defined | Must be decoded by the PLC. The NCK will present them, but no action occurs unless the PLC explicitly decodes them. |
The critical implication: M11 is not automatically handled by the 808D. The NCK delivers it to the PLC interface, but if no PLC network reads it, the part program appears to do nothing. This is the most common root cause on 808D installations where operators or programmers expect "M-code support" out of the box.
3. Root Cause Analysis: Why M11 Doesn't Trigger the PLC
When a user-defined M-code such as M11 produces no reaction, work through the following checklist. Each item corresponds to a specific failure mode that has been seen on production 808D machines.
3.1 The PLC decode network for M11 does not exist
This is the single most common cause. A user adds M11 to the part program, writes a PLC network expecting the bit to come on, but never adds the network that compares the M-function number to 11 and sets the corresponding bit. Without that comparison, the NCK strobe pulses and the PLC ignores it.
3.2 The PLC project on the controller does not match the source project
The PLC project may exist on the programming PC but was never downloaded, or a different project was downloaded last. The 808D displays the project CRC / version string at boot — verify that the version shown on the HMI matches what you are editing. Many "the M-code doesn't work" tickets trace back to the PLC being in a stale or empty state.
3.3 The PLC is in stop / error
If the PLC has gone to STOP (SF LED on, BF LED on for bus errors), all M-code decoding halts. The HMI may show an alarm. Resolve the PLC fault first.
3.4 The M-function strobe is being read on the wrong edge
A common PLC error is using a level-sensitive contact on M_FCT rather than an edge-triggered comparison. On 808D the strobe is a pulse that returns low once acknowledged. Reading it as a steady-state signal can lead to missed M-codes, especially when the part program executes two M-codes in consecutive blocks.
3.5 The M-code is acknowledged before the user action completes
If the PLC acknowledges the M-code and the NCK advances before the user logic has latched the desired bit, the next decode cycle can miss the M-code. This is rare for simple bits but common when the action is delayed (e.g., waiting for a hydraulic cylinder to reach end-of-stroke).
3.6 M-code range or prefix conflict
The 808D distinguishes between single-digit M-codes (M0–M9), two-digit M-codes (M10–M99), and extended M-codes (M100+). Some user programs prefix M-codes with leading zeros (e.g., M011); the NCK interprets this as M11, but a ladder compare with the literal 11 still works. Confirm by reading the M-code number interface word.
4. Step-by-Step: Decoding a User M-Code on the 808D PLC
Use the following procedure to add M11 decoding to your PLC project. The procedure assumes you have the PLC Programming Tool for 808D installed and a working connection to the controller.
4.1 Prerequisites
- PLC Programming Tool for Sinumerik 808D installed on the engineering PC.
- Online connection to the 808D via Ethernet (X130 on the PPU) or RS232 service port.
- The current PLC project archive (.ptp or matching format) backed up to the engineering PC.
- Read/write access; the 808D must be in commissioning or service mode to download.
4.2 Procedure
- Open the PLC project in the Programming Tool and confirm it compiles cleanly. Any pre-existing errors block the download.
- Locate the section of the PLC program where M-code decoding lives. On a fresh 808D project this is typically in OB1 / main scan, but more often inside the spindle / auxiliary subprograms. Insert a new network titled
M11_USER_DECODE. - Add a normally-open contact tied to the M-function strobe signal from the NCK→PLC interface (the symbol is typically named
M_FCTor appears in the SINUMERIK symbol table as a flag representing the active M-function strobe). - Add a comparison instruction that reads the M-function number (the integer word, often
M_FCT_NUMor the equivalent flag) and compares it to the constant 11. - On the comparison's TRUE output, set the desired internal memory bit (commonly
M100.0or a marker bit you have reserved for this auxiliary function). - If you need the bit to stay TRUE until explicitly cleared, latch it with a SET coil and add a separate reset network. If you need it to mirror the strobe, use a direct assignment.
- Repeat the pattern for any other user M-codes (M12, M13, etc.) — one comparison per network, or one comparison block driving multiple SET coils if you prefer a single decode block.
- Compile, download, and put the controller in a safe state (no part program running, doors closed, drives inhibited).
4.3 Ladder example
The following snippet shows a minimal decode network. Replace the symbol names with the ones defined in your project's symbol table. On the 808D the exact signal name varies by firmware version, but the structure is consistent.
Network 1: M11 decode (rising edge)
| M_FCT | | M_FCT_NUM = 11 | | ( S ) M100.0 |
| (NO) | | == | | |
| |-----| |-----| |
Network 2: Clear M11 bit on strobe falling edge
| NOT M_FCT | | M_FCT_NUM = 0 | | ( R ) M100.0 |
| (NC) | | == | | |
| |-----| |-----| |
For FBD users, the equivalent is a comparator block driving an SR flip-flop, with the strobe enabling the comparator.
5. M-Code Acknowledgement and Timing
On the 808D, the M-function strobe (M_FCT) must be acknowledged before the NCK continues. If your decode network never sends the acknowledgement, the part program will appear to stall at the M-line and the operator will see a "waiting for PLC" state. The acknowledgement mechanism depends on the M-code:
| Class | M-codes | Acknowledgement | Notes |
|---|---|---|---|
| Pre-decoded, fast | M00, M01, M02, M17, M30 | Handled internally by the 808D firmware; no PLC ack needed. | These halt or end the program. |
| Pre-decoded, output-driven | M03, M04, M05, M07, M08, M09 | PLC reads the pre-decoded bit; NCK waits for the auxiliary function to settle. | The PLC drives the actual output (spindle, coolant valves). |
| User M-codes (single-digit M0–M9 set) | M10, M11, M12 ... | PLC acknowledges via the M-code ack interface signal after performing the action. | Use the 808D's fast or normal ack per your timing requirements. |
| Extended M-codes | M100+ | PLC acknowledges using the extended M-function handshake. | Reserved for machine builders; usually disabled by default. |
For most user M-codes on the 808D, a single acknowledgement pulse from the PLC suffices. If your action is fast (set a bit), wire the acknowledgement to the same network that sets the bit. If your action is slow (advance a turret and wait for an "in position" input), generate the acknowledgement only after the in-position input arrives.
6. Verification: Confirming M-Code Decoding Works
After downloading the modified PLC project, verify the decode network with the following sequence. Do this in MDI mode first, then with a short test part program.
- Go online with the PLC and open the status / watch table view for the symbols
M_FCT,M_FCT_NUM, and your target bit (e.g.,M100.0). - Switch the controller to MDI mode. Ensure single block is OFF and the spindle / feed override is at zero for safety.
- Type
M11on the MDI line and press NC Start / Cycle Start. - Observe the watch table:
M_FCTshould pulse TRUE for the duration of the decode,M_FCT_NUMshould show 11, andM100.0should transition TRUE (or pulse, depending on your latching logic). - Reset the controller and run a short program:
M11 ; G04 F2 ; M30 ;. Confirm that the bit transitions at the M11 line and clears cleanly before M30.
7. Common Errors and Fault Codes
The 808D reports several alarm categories that overlap with M-code behavior. The ones most relevant to user-defined M-codes are summarized below.
| Alarm | Text (abbreviated) | Meaning | Likely cause |
|---|---|---|---|
| 700062 | Tool on spindle <> tool programmed. MGZ must be referenced. | The tool in the spindle does not match the programmed tool, and the magazine has not been referenced. | Tool changer sequence interrupted; run the magazine reference cycle before continuing. Unrelated to user M-code decoding but commonly confused when M06 appears to fail. |
| 808D-PLC stop | PLC fault / SF LED on | The integrated PLC has stopped due to a programming error or I/O fault. | Read the PLC diagnostic buffer from the Programming Tool; resolve the fault and restart the PLC. |
| No alarm, M-code silently ignored | — | User M-code not decoded. | Add or fix the decode network per Section 4. |
| NC stop at M-line | Waiting for aux. function | PLC did not acknowledge the M-code. | Add the acknowledgement pulse per Section 5. |
| Wrong auxiliary function triggered | — | M-code number comparison reads the wrong word, or the project has a duplicate decode network. | Cross-check M_FCT_NUM in the watch table and search the project for duplicate decoders. |
8. Extended M-Codes (M100+)
If you need to use M-codes above M99 — for example to coordinate with a bar feeder or parts catcher that ships its own M-code convention — the 808D supports extended M-functions. These use a separate handshake, typically signalled by a "high" M-function strobe. Extended M-functions are disabled by default on most 808D builds; enable them through the relevant machine data in the commissioning area of SINUMERIK Operate, then add the corresponding decode network in the PLC. Confirm the exact machine data number against your commissioning manual before changing it on a production machine.
9. Alternative Decoding Patterns
Beyond the single-network comparator, two patterns are worth knowing.
9.1 Indexed decode block
For machines with dozens of user M-codes, a single decode block that reads M_FCT_NUM and drives a shift register or a demultiplexer saves ladder real estate and makes the project easier to maintain. The pattern is: strobe rising edge → latch M_FCT_NUM into a holding word → demux the holding word to N bits.
9.2 Edge-triggered SET with explicit reset
For safety-relevant auxiliaries (e.g., clamp, gate interlock), use a rising-edge SET on the decode comparator and reset only when an external "action complete" input arrives. This prevents the bit from being cleared by an unintended second M-function strobe or by a power-cycle glitch.
10. Field-Commissioning Checklist
Before signing off a machine that uses user M-codes, run through the following list:
- Each user M-code in the part program has a matching decode network in the live PLC project (verify via project CRC and online compare).
- Each user M-code is acknowledged within the time the NCK allows, or the part program has a G04 / dwell if the action is slow.
- The M-code decode networks are documented in the machine's PLC functional description.
- Standard M-codes (M00, M01, M02, M03, M04, M05, M06, M07/M08, M09, M30) still trigger their default behavior — your additions must not have overwritten any of the pre-decoded networks.
- The PLC project is archived both on the engineering PC and on a backup medium.
- If extended M-codes are used, the corresponding machine data is documented in the machine data sheet.
11. Quick Diagnostic Procedure
When a user reports "my M-code doesn't work," use this flow to localize the fault in under five minutes:
- Confirm the PLC is running (no SF / BF LED, RUN LED on).
- Confirm the PLC project version on the HMI matches the project on your engineering PC.
- Open the watch table and confirm
M_FCTpulses when the M-code is executed in MDI. - Confirm
M_FCT_NUMshows the expected integer. - Confirm the decode comparator output transitions.
- Confirm the target bit transitions and is not being reset elsewhere.
- If all six steps pass and the physical output does not energize, the fault is downstream of the PLC (wiring, contactor, valve, E-stop).
Why does my M11 do nothing on the Sinumerik 808D even though the part program is correct?
M11 is a user-defined M-code on the 808D. The NCK delivers it to the PLC through the M-function interface, but the 808D does not pre-decode it — your PLC project must contain a network that compares the M-function number to 11 and sets the corresponding bit. Add the decode network, download the project, and verify with the watch table.
Which M-codes are pre-decoded by the Sinumerik 808D?
The standard turning/milling set: M00, M01, M02, M03, M04, M05, M06, M07/M08, M09, M17, M30. Everything else (M10–M99) requires a PLC decode network. Extended M-codes (M100+) require enabling the extended M-function machine data.
Where do I find the M-function strobe and number signals in the PLC?
The exact symbol names depend on the PLC project's symbol table, but the strobe is typically named M_FCT and the M-function number is M_FCT_NUM. Open the watch table in the PLC Programming Tool, force a user M-code in MDI, and read the symbols to confirm.
The NC stops at my user M-line and the part program hangs — what is missing?
The PLC is not acknowledging the M-function. After the decode network performs the action, it must pulse the M-code acknowledgement signal so the NCK clears the strobe and advances. Add the acknowledgement to the same network that sets the action bit.
Alarm 700062 "Tool on spindle <> tool programmed. MGZ must be referenced" — is this related to user M-codes?
No. This alarm indicates that the tool in the spindle does not match the programmed tool and the magazine has not been referenced. Run the magazine reference cycle from the HMI to clear it. It is unrelated to user M-code decoding but is commonly seen during commissioning and tool-change validation.