# Spindle M functions

In DIN 66025, the M functions M3, M4, M5, M19 and M40-M45 are reserved for spindle control on Class 1 and 2 machines. These M functions can be synchronised with an executing path motion. With M3, M4 and M5, synchronisation is always internal (speed reached) and, as an additional option, it is executed by the PLC (->PLC_INFO).

The use of M functions M3, M4, M5 and M19 on machines without spindles can be enabled with the channel parameter P-CHAN-00098 (spindle_m_fct_free).

The M functions M40-M45 are also freely available when gear changing is deactivated (P-CHAN-00052 (main_spdl_gear_change)).

In addition, as described in Section Example 2b: Programming an axis-specific M function in DIN syntax and Example 1a: CNC spindle, internally synchronised, all freely available M functions can be output to a spindle for a specific axis.

Spindles are controlled by a CNC interpolator (CNC spindle) or by the PLC (PLC spindle).

For details of the use of spindles and the various spindle types, see [FCT-S1].

## Parameter

P-CHAN-00045 | Synchronisation method of the spindle function M3
P-CHAN-00047 | Synchronisation method of the spindle function M4
P-CHAN-00049 | Synchronisation method of the spindle function M5
P-CHAN-00043 | Synchronisation method of the spindle function M19
P-CHAN-00069 | Identifier of a PLC spindle with output of M functions via the channel range of the HLI
P-CHAN-00098 | Enabling M3, M4, M5, M19 for any use

## Synchronisation methods

The spindle M functions can be assigned the known synchronisation methods NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM and MVS_SLP.

## PLC_INFO

It only makes sense to use the PLC_INFO bit with NC spindles (position-controlled spindles). In addition to the synchronisation type, the PLC_INFO bit can be set for every spindle M function. This determines whether a spindle M function is output to the PLC or not and whether it must be acknowledged by the PLC.

If the PLC_INFO bit is not set, no output to PLC is sent to the PLC and internal synchronisation only takes place based on window monitoring for the position or speed.

For PLC spindles (speed-controlled spindles) please note the following:

In general, with every spindle M function, an output of the M function is also sent to the PLC automatically. It is therefore not necessary to additionally set the PLC_INFO bit.

## Additional information

- Examples of spindle M functions
- Gear speed selection/parameter set changeover