Overview: M06, T, and the SINUMERIK 808D Tool Change Chain
On the SINUMERIK 808D Advanced controller, the M06 auxiliary function is not implemented as a PLC instruction. It is an NC auxiliary function whose execution is decoded by the NCK and forwarded to the PLC as a discrete interface signal. The PLC then drives the mechanical sequence of a disk tool magazine: arm extend, dual-arm swing, spindle unclamp, magazine rotate, and so on. The default SINUMERIK 808D Advanced PLC program already contains a magazine handling block (subroutine 60 family, e.g. SUB_60_Disk_MGZ) that reacts to these interface signals. A typical service question is therefore not "how do I write M06 in ladder?" but "which DB bit corresponds to M06, and how do I configure the NC so that M06 is generated at all?".
The relevant interface area for the first NCK channel on the 808D Advanced is DB2500. The actual M-code bit for M06 is DB2500.DBX1000.6, while the T-decoded bit for the active tool number appears at DB2500.DBX8.0. Tool type and offset DINT data for the spindle tool is written to DB2500.DBD2000. The disk-magazine-specific rotate command from the tool change sub-program appears in DB4900.DBB24. These signals, plus a small set of machine data (MD22550, MD22560, MD10715, MD10716), determine whether the system uses T-only tool change, T+M6 tool change, or a magazine without M6.
Tool Change Machine Data on 808D Advanced
Four machine data are critical for activating M06 in the part program and for routing the T and M codes through the NCK:
| MD | Name (808D) | Typical Value | Effect |
|---|---|---|---|
| MD22550 | TOOL_CHANGE_MODE | 0 or 1 | 0 = tool change by T command only (no M6 required). 1 = tool change by T + M6 (M6 required as a separate block). |
| MD22560 | TOOL_CHANGE_M_CODE | 206 | Defines the M-code that triggers the tool change when MD22550 = 1. Default 206 corresponds to M6. |
| MD10715 | M_NO_FCT_CYCLE[n] (M6 entry) | 6 | Index 0 of the M-code-to-cycle assignment array. Value 6 routes M6 to the user cycle %_N_TOOL_SPF. |
| MD10716 | M_NO_FCT_CYCLE_NAME[n] | "T" | Name string of the cycle called by the M-code. "T" is the conventional name for the tool change cycle. |
With the default commissioning profile of a disk-magazine 808D Advanced, the values are usually 22550 = 1, 22560 = 206, 10715[0] = 6, 10716[0] = "T". If the user only programs T14 without a separate M6 block, the NC will not generate the tool change call when MD22550 = 1; the tool will be "prepared" but the spindle will not be loaded.
Part-program syntax (T-only vs. T + M6)
; --- Tool change without M6 (MD22550 = 0) ---
N10 T1 ; Tool 1 call, magazine positioning + spindle swap performed immediately
...
N70 T588 ; Tool 588 call
; --- Tool change with M6 (MD22550 = 1) ---
N10 T14 ; Tool 14 prepared (pre-warned)
N15 M6 ; Tool change cycle initiated, T14 is loaded into spindle
The 808D Commissioning Manual explicitly states: an M-code and a T-code that calls a user cycle must not be placed in the same NC block. Writing N10 T14 M6 on one line is rejected by the interpreter.
Interface Signals: DB2500 and the M06/T Decoding
DB2500 is the VDI interface (Versorgungs-Daten-Interface) of the first NCK channel of the 808D Advanced. The standard signals relevant to a disk-magazine tool change are listed below; the bit addresses follow the SINUMERIK 808D ADVANCED Commissioning Manual and the Siemens Industry Online Support lists documentation.
| Address | Type | Symbol (typical) | Meaning |
|---|---|---|---|
| DB2500.DBX8.0 | BOOL | T function 1, change | NCK signals that a new T number has been decoded. The PLC uses this to start the magazine search and pre-position sequence. |
| DB2500.DBX1000.6 | BOOL | M function 6, change | NCK signals that M6 has been decoded. The PLC uses this to trigger the actual spindle swap via %_N_TOOL_SPF and SUB_60. |
| DB2500.DBD2000 | DINT | Tool type / offset D for spindle | Tool type and offset number of the tool currently in the spindle, mirrored to the PLC for visualisation and safety interlocks. |
| DB2500.DBB1000..1007 | BYTE | M function group 1..8, change | M0..M31 decoded bits. DBX1000.0 = M0, DBX1000.6 = M6, etc. |
| DB2500.DBX3000.0..2 | BOOL | Read-in inhibit / aux. function ack | PLC feedback to NCK. Used by the PLC to gate the next NC block until the magazine has finished. |
| DB4900.DBB24 | BYTE | Magazine rotate cmd from tool change SPF | Numeric command from the tool change sub-program to the PLC, typically the target pocket number or rotate request. |
For a deeper look at the M-code decoding, the Siemens support thread "808D: want to set a bit by using an M code" explains that for a typical M-code (e.g. M11) the decoded bit lives in DB2500.DBX1001.3, and that the bit is the actual interface a user ladder uses to react to the M function.
Why M06 Does Not Appear in the Default Ladder
The default 808D Advanced PLC application is delivered as a pre-compiled SDB for a generic disk-magazine machine. It does not include any "M6" coil or contact for the simple reason that the M6 event is consumed inside the user cycle %_N_TOOL_SPF and its sub-program SUB_60_Disk_MGZ_M. These are stored as part programs (SPF) in the NC file system, not as PLC blocks. When the NCK sees M6:
- It sets
DB2500.DBX1000.6 = 1for one IPO cycle (M function change). - It then calls the cycle named in MD10716[0], which by convention is
%_N_TOOL_SPF. -
%_N_TOOL_SPFcontains the high-level tool change sequence (Z to tool change position, prepare new tool, request old tool return, perform the swap) and callsSUB_60_Disk_MGZ_Mto physically rotate the disk and the dual-arm. - The PLC acknowledges the auxiliary function and clears the M6 bit.
Therefore, the "M06 in ladder" problem is really a configuration problem: make the NC generate the M6 decode and let the default user cycle handle the mechanics. Adding user-defined M-code handling in the PLC is only required for non-standard M functions or for overriding the default tool change sub-program.
Reading the SUB_60_Disk_MGZ User Cycle
Open the cycle in the 808D HMI under Program Manager → User Cycles. The structure is the same as a regular sub-program: a sequence of G-code lines, optionally with parametric variables. A minimal version of the disk-magazine tool change looks like this (representative of the default cycle; real content may differ by firmware build):
; %_N_TOOL_SPF (simplified, for study only)
PROC TOOL
DEF INT _T_NO, _SP_T, _OLD_POCKET, _NEW_POCKET
; 1. Save spindle tool and requested new tool
_SP_T = $TC_MPP6[9998,1] ; current spindle tool
_OLD_POCKET = $A_TOOLMN[1] ; current pocket of spindle tool
_NEW_POCKET = $TC_MPP6[ magNo, _T_NO] ; target pocket for new tool
; 2. Position Z to tool change plane
G0 G53 G90 Z=MD20150[Z] ; or user-defined position
; 3. Move old tool back to its pocket (subroutine 60)
CALL SUB_60_Disk_MGZ_M(_OLD_POCKET, "RETURN")
; 4. Rotate disk so new tool is at change position
CALL SUB_60_Disk_MGZ_M(_NEW_POCKET, "ROTATE")
; 5. Dual-arm swing / spindle clamp-unclamp
CALL SUB_60_Disk_MGZ_M(_NEW_POCKET, "SWAP")
; 6. Update spindle tool and reset T/M change bits in DB2500 via PLC
RET
Inside the sub-programs, the DB4900.DBB24 byte is used as a "handshake" register between the NC sub-program and the PLC. The cycle writes the target pocket number and the operation ("RETURN", "ROTATE", "SWAP") into this area; the PLC reads it, runs the I/O sequence, and writes a status word back. The PLC block in the default project that handles this is usually FB7 / DB7 or similar, named MAG_CTRL or MAGAZINE. Inspecting this block with the STEP 7 tool inside the 808D Toolbox is the fastest way to see which outputs drive the magazine motor contactor, the arm-in / arm-out solenoids, and the spindle-unclamp solenoid.
Step-by-Step: Enabling M06 on a Disk-Magazine 808D Advanced
- Connect to the controller and back up the NC and PLC images (series start-up / archive).
- Open Commissioning → Machine Data and verify the four M-data listed above. Set MD22550 = 1, MD22560 = 206, MD10715[0] = 6, MD10716[0] = "T" if not already.
- Open Program Manager → User Cycles and confirm that
%_N_TOOL_SPFandSUB_60_Disk_MGZ_Mexist. If they are missing, copy them from a backup or the default project. - Compile a short test program in MDA:
T1M6(in two separate blocks). The T bitDB2500.DBX8.0should pulse, then the M6 bitDB2500.DBX1000.6should pulse. The disk should rotate and the tool should be loaded. - Monitor
DB2500.DBD2000in the PLC online view; it should reflect the tool type/offset of the loaded tool. - If the bit pulses but the disk does not move, the problem is mechanical / I/O. Trace the magazine motor output in the
MAG_CTRLblock; check the spindle-unclamp pressure switch and the arm-in / arm-out prox switches.
Adding a Custom M-Code in Ladder (Reference Pattern)
If a custom M-code (for example M11) is required to drive a discrete output, the standard ladder pattern on 808D Advanced is:
// Network 1: latch user M11
A DB2500.DBX1001.3 ; M11 change bit (M function group 1, bit 3)
S M 200.0 ; local latch
// Network 2: drive the physical output
A M 200.0
= Q 0.0 ; user M11 output, e.g. chip conveyor forward
// Network 3: clear latch on NCK ack (next block read-in)
A DB2500.DBX3000.1 ; aux. function ack, group 1
R M 200.0
The same pattern works for M06 if the user does not want the default %_N_TOOL_SPF cycle. In that case, MD10715[0] should be reassigned to a different M-code and the user's own cycle should be defined in MD10716[0], so that the standard disk-magazine tool change remains intact. The PLC then uses DB2500.DBX1000.6 as a regular M6 change bit.
Disk Magazine: Mechanical-to-Interface Mapping
| Mechanical step | NC sub-program operation | DB4900 value | Typical PLC output |
|---|---|---|---|
| Disk rotate to target pocket | ROTATE | Target pocket number (DINT low byte) | Magazine CW / CCW contactor |
| Arm in (extend) | ARM_IN | Bit 0 of DBB25 | Arm-in solenoid |
| Arm out (retract) | ARM_OUT | Bit 1 of DBB25 | Arm-out solenoid |
| Spindle unclamp | UNCLAMP | Bit 2 of DBB25 | Drawbar release solenoid |
| Spindle clamp | CLAMP | Bit 3 of DBB25 | Drawbar clamp solenoid |
| Tool return to pocket | RETURN | Source pocket number | (combined with ROTATE) |
These mappings are illustrative; the exact assignment must be cross-checked against the active PLC project (open the project with the PLC Programming Tool from the 808D Toolbox) and the SINUMERIK 808D ADVANCED Commissioning Manual in the section "Tool management".
Verification Procedure
After configuring M06 and the disk magazine cycle, perform the following checks in order:
-
Static check (no spindle rotation): In MDA, run
T1 M6. The T-change bit and the M6-change bit must pulse in DB2500. The disk must rotate to pocket 1 and the arm must perform one cycle. - Tool counter check: Open the tool list on the HMI. The "active tool in spindle" row must show T1, and the "pocket 1" row must show "empty" after the cycle.
-
Status mirror check: In the PLC online view,
DB2500.DBD2000must equal the DINT-encoded tool type/offset of T1. -
Spindle rotation check: Restart the spindle with M3 S500 and run a short G1 move. Listen for the drawbar; the spindle must not drop the tool during rotation. If the drawbar pressure drops, increase the clamp dwell time in
SUB_60_Disk_MGZ_M. - Edge cases: Run a tool change at maximum magazine position (e.g. T588 on a 588-pocket disk) and at minimum (T1) to confirm the search direction logic. Run a tool change from spindle to the same tool number to confirm that the PLC correctly suppresses a no-op swap.
Troubleshooting Matrix
| Symptom | Likely cause | Where to look | Remedy |
|---|---|---|---|
| DBX1000.6 never goes high | MD22550 = 0 (T-only mode) or M6 written in the same block as T | Machine Data, part program | Set MD22550 = 1 and split T / M6 into separate blocks. |
| DBX1000.6 pulses but disk does not move | User cycle %_N_TOOL_SPF missing or not assigned |
MD10716[0], Program Manager / User Cycles | Reassign cycle name or copy the default SPF from backup. |
| Disk rotates to wrong pocket | Mismatch between magazine numbering and tool list | Magazine configuration, tool list | Re-assign pocket numbers in the magazine configuration screen. |
| Spindle does not unclamp | Drawbar pressure low / prox switch not picked up | I/O, pneumatic | Check 24 V output, drawbar pressure, and clamp-prox input. |
| M6 is decoded but PLC never resumes the NC | DBX3000.x auxiliary-function ack not written | PLC MAG_CTRL block | Confirm the ack bit is set in the same block that detects DBX1000.6. |
| Alarm 4100 "Tool not found" after M6 | T number not in magazine list or empty pocket selected | Tool list, magazine configuration | Load the tool to a free pocket or correct the tool number. |
Frequently Asked Questions
What is the exact PLC address of M06 on a SINUMERIK 808D Advanced?
It is DB2500.DBX1000.6 (M function group 1, bit 6). The bit is set for one IPO cycle when the NCK decodes an M6 in the active part program, and the PLC must acknowledge it via the auxiliary-function-acknowledge bit (typically DB2500.DBX3000.1) so the read-in of the next block can continue.
Why does M06 not appear in the default ladder of my 808D Advanced?
Because the default project does not contain user-defined M6 handling. M6 is consumed by the NC user cycle %_N_TOOL_SPF, which itself calls SUB_60_Disk_MGZ_M for a disk magazine. The ladder only "sees" M6 if the user has explicitly written code on DB2500.DBX1000.6, for example to drive a custom output as described in the Siemens support thread on M-code bits in 808D.
How do I enable T + M6 tool change instead of T-only?
Set MD22550 = 1, MD22560 = 206, MD10715[0] = 6, MD10716[0] = "T". Then always program T and M6 in separate NC blocks, e.g. N10 T14 and N15 M6. The 808D Commissioning Manual explicitly forbids T and M6 in the same block.
What is the role of DB2500.DBD2000 and DB2500.DBX8.0?
DB2500.DBD2000 is a DINT mirror of the active spindle tool's type and offset, used by the PLC for status display and interlocks. DB2500.DBX8.0 is the T-function-1 change bit: it pulses when a new T number is decoded so the PLC can start magazine pre-positioning before M6 is executed.
What is the difference between %_N_TOOL_SPF, SUB_60, and DISK_MGZ?
On 808D Advanced, %_N_TOOL_SPF is the M6 user cycle (high-level tool change sequence), SUB_60_Disk_MGZ_M is the disk-magazine-specific motion sub-program that rotates the disk and swings the dual arm, and DISK_MGZ.SPF is an older / alternative name for the same logic. They are part programs (SPF) on the NC side, not PLC FBs.
Which address carries the magazine rotate command from the tool change SPF?
It is DB4900.DBB24. The NC tool change sub-program writes the target pocket number and the requested operation (ROTATE, ARM_IN, ARM_OUT, UNCLAMP, CLAMP) into this byte; the PLC reads it in the MAG_CTRL block to drive the magazine outputs and feeds a status word back to the NC.
Can I write M06 as a coil in STEP 7 ladder for 808D?
No. M06 is an NC auxiliary function, not a PLC bit. The PLC can only react to the decoded M6 bit DB2500.DBX1000.6 in DB2500. To make the NC issue M6, the part program must contain an M6 in a block by itself, and the machine data MD22550 / MD22560 / MD10715 / MD10716 must be set so that the NCK routes M6 to the tool change cycle.