M/H Functions (C1)

1.1 IntroductionPAGEREF _Toc303345377 \h2

1.2 Description 3

1.2.1 Range of user-definable M/H numbers 6

1.2.2 Parameterising the synchronisation methods 6

1.3 Programming with reference to the example of M functions 7

1.3.1 Channel and axis-specific M functions 7

1.3.1.1 Example 1: Programming a channel-specific M function 7

1.3.1.2 Example 2a: Programming an axis-specific M function in extended syntax 7

1.3.1.3 Example 2b: Programming an axis-specific M function in DIN syntax 8

1.3.2 Spindle M functions 9

1.3.2.1 Example 1a: CNC spindle, internally synchronised 10

1.3.2.2 Example 1b: CNC spindle, synchronised internally and by the PLC 11

1.3.2.3 Example 2a: PLC spindle 12

1.3.2.4 Example 2b: PLC spindle with output of the M functions via the channel range 13

1.3.3 Gear selection/parameter set changeover 14

1.3.4 Examples of the synchronisation methods in connection with motions 26

1.3.5 Default M functions 27

1.3.6 M/H functions with additional information 28

1.3.7 Production time calculation 29

1.3.8 CNC programming 31

1.3.9 Method for creating an M or H function in the channel parameter list 32

1.3.10 Application examples 35

1.3.11 HMI-Display 37

1.4 Parameters 38

1.4.1 Overview 38

1.4.2 Description 45

1.4.2.1 Channel parameters 45

More:

button Introduction

button Description

button Programming with reference to the example of M functions

button Parameters


Introduction

Machine switching functions

Characteristics of M and H functions

In conformity with DIN66025, the CNC commands M and H serve to command machine switching and auxiliary functions via the PLC. Some of the M functions are defined by standardisation, while all others and the H functions are freely available to the user.

The timing of output of M and H functions to the PLC and its subsequent reaction may be synchronised in various ways with motions to be executed.

To simulate the machining time of an M or H function, a time period can be specified in order to determine the run time of a CNC program.

By default, the PLC assigns M and H functions to the CNC channel in which they are programmed. It is also possible to output these in an axis-specific range to the PLC which can lead to simplified realisation of PLC applications, particularly in the case of systems with several CNC channels and axes used jointly by these.

Synchronisation method

Freely available or assigned a default in accordance with DIN 66025

Machining time

Channel or axis-specific output

Spindle-specific

The CNC channels are each parameterised via an initialisation list (channel parameter list). Here, you must specify all M and H functions. The method of synchronisation and, optionally instead of the channel-specific assignment, an axis-specific assignment is defined. At the interface to the PLC (high level interface) [HLI], M and H functions are output in the channel and axis-specific ranges and the PLC processes them further and confirms them accordingly.


Description

Output

Synchronisation

The M and H functions are enabled for each CNC channel in the channel parameter list via their synchronisation methods. For safety reasons, M and H functions cannot be used in the CNC program if a synchronisation method is not specified (in this case, the CNC generates the message 20157).

There are the following possibilities of output to the PLC:

q No output

q Output before motion

q Output after event

q Output after motion

Output to the PLC (HLI) can take place in different ranges of the interface:

q Output in the channel range

q Output in the axis range

The following possibilities of synchronisation with a motion to be executed are available:

q No synchronisation

q Synchronisation before motion

q Synchronisation after motion

q Synchronisation at the transition to the next motion block with machining feed rate ('late' synchronisation implicit)

q Synchronisation in the case of an explicit request ('late' synchronisation explicit)

q Synchronisation during a motion block (example: push-cut edge shaping)

More:

button Range of user-definable M/H numbers

button Parameterising the synchronisation methods


Range of user-definable M/H numbers

The maximum number range from 0 to 65535 is provided for the M or H number. The actually available range is limited depending on the version and can be found in the documentation [SYSP]. This is where you will also find details of the limits to the maximum number of M and H functions in each CNC block as well as the maximum number of simultaneously active 'late' synchronisations per channel and axis.


Parameterising the synchronisation methods

Synchronisation method

The synchronisation method of each corresponding M function is defined in the table entitled P-CHAN-00041 (m_synch). The field index "MNr" corresponds to the number of the M function. The value specifies which synchronisation method the M function possesses, i.e. when output to the PLC and a check for the presence of the PLC acknowledgement take place. A motion is not executed, or is stopped at the latest towards the end of the block, if no acknowledgement has arrived from the PLC.

The corresponding table P-CHAN-00027 (h_synch) is used for H functions.

Parameters

P-CHAN-00041 | Synchronisation method of the M function with the number MNr
P-CHAN-00027 | Synchronisation method of the H function with the number HNr

In NC program the synchronisation method of each M/H function also can be changed by corresponding variables (V.G.M_FCT[MNr].SYNCH or V.G.H_FCT[HNr].SYNCH) [PROG].

Synchronisation methods

Symbol | Value | Meaning
NO_SYNCH | 0x00000000 | No output of the M/H function to PLC
MOS | 0x00000001 | Output of the M/H function to PLC without synchronisation
MVS_SVS | 0x00000002 | Output of the M/H function to PLC before the motion block, synchronisation before the motion block
MVS_SNS | 0x00000004 | Output of the M/H function to PLC before the motion block, synchronisation after the motion block
MNS_SNS | 0x00000008 | Output of the M/H function to PLC after the motion block, synchronisation after the motion block
MNE_SNS | 0x00000020 | Output of the M/H function to PLC after an event (e.g. measurement interrupt), synchronisation after the motion block (for option edge banding only)
Synchronisation across blocks CAUTION: Is only allowed for M functions!
MVS_SLM | 0x00004000 | Late synchronisation, M function output at the start of the block. Synchronisation at the transition to the motion block with machining feed rate (G01/G02/G03) ('late' synchronisation implicit, Sync. late movement)
MVS_SLP | 0x00008000 | Late synchronisation, M function output at the start of the block. Synchronisation in the case of the NC command #EXPL SYN ('late' synchronisation explicit, Sync. late program)
Synchronisation pre-output
MEP_SVS | 0x01000000 | M/H function output to PLC with a specified distance, synchronisation before the next block
MET_SVS | 0x02000000 | M/H function output to PLC with a specified time, synchronisation before the next block
MOS_TS | 0x00040000 | CAUTION: Is only allowed for M functions! Output of the M function to the PLC before the motion block without synchronisation, sample time offset as parameter for precise time-related output in PLC.

M or H output Synchronisation | Before NC block | After NC block | After event | Pre-output according to specified distance/time | None
Before motion | MVS_SVS |  |  | MEP_SVS, MEP_SVS |
After motion | MVS_SNS | MNS_SNS | MNE_SNS |  |
Implicit at next transition to G01/G02/G03 | MVS_SLM |  |  |  |
Programmed synchronisation | MVS_SLP |  |  |  |
None | MOS |  |  |  | NO_SYNCH
None | MOS_TS |  |  |  |

The reaction of the synchronisation methods MVS_SVS, MVS_SNS and MNS_SNS is identical if M or H functions are programmed without motion in the block.

Example

# ****************************************

# Definition of M functions and synchronisation methods

# ======================================================

m_synch[0] 0x00000002 MVS_SVS

m_synch[1] 0x00000001 MOS

m_synch[2] 0x00000002 MVS_SVS

m_synch[8] 0x00000008 MNS_SNS

m_synch[9] 0x00000000 NO_SYNCH

# Definition of H functions and synchronisation methods

# =====================================================

h_synch[0] 0x00000001 MOS

h_synch[1] 0x00000002 MVS_SVS

h_synch[2] 0x00000004 MVS_SNS

h_synch[3] 0x00000008 MNS_SNS

h_synch[4] 0x00000002 MVS_SVS

#


Programming with reference to the example of M functions

More:

button Channel and axis-specific M functions

button Spindle M functions

button Gear selection/parameter set changeover

button Examples of the synchronisation methods in connection with motions

button Default M functions

button M/H functions with additional information

button Production time calculation

button CNC programming

button Method for creating an M or H function in the channel parameter list

button Application examples

button HMI-Display


Channel and axis-specific M functions

More:

button Example 1: Programming a channel-specific M function

button Example 2a: Programming an axis-specific M function in extended syntax

button Example 2b: Programming an axis-specific M function in DIN syntax


Example 1: Programming a channel-specific M function

Initialisation in the channel parameter list

m_synch[25] 0x0002

Programming example


Example 2a: Programming an axis-specific M function in extended syntax

Initialisation in the channel parameter list

m_synch[25] 0x0002

Programming example


Example 2b: Programming an axis-specific M function in DIN syntax

Compatibility mode

After the introduction of axis-specific M and H functions, a compatibility mode became necessary to make it possible to use existing CNC programs for axis-specific output as well without changing the syntax.

Via the channel parameters

P-CHAN-00039 (m_default_outp_ax_name[MNr]) or

P-CHAN-00025 (h_default_outp_ax_name[HNr])

axis-specific output of an M or H function can be defined as the default. A channel-specific output then no longer takes place.

Parameters

P-CHAN-00039 | Designation of the axis to which the M function with the number MNr is output
P-CHAN-00025 | Designation of the axis to which the H function with the number HNr is output

Initialisation in the channel parameter list

m_synch[25] 0x0002

m_default_outp_ax_name[25] X

Programming example


Spindle M functions

In DIN66025, the M functions M3, 4, 5, 19 and M4045 have been reserved for Class 1 and 2 machines for the control of spindles. These M functions can be synchronised with a contouring motion to be executed. In the case of M3, 4 and 5, synchronisation always takes place internally (speed reached) and, as an option, additionally by the PLC (->PLC_INFO).

Use of the M functions M3, 4, 5 and 19 on machines without a spindle can be enabled with the channel parameter P-CHAN-00098 (spindle_ m_fct_free).

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

As detailed in the description in 2.1.3.1.2 and 2.1.3.1.3, all freely available M functions can also be output to a spindle in a specific axis.

Spindles are monitored by an interpolator of the CNC (CNC spindle) or are controlled by the PLC (PLC spindle).

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

Parameters

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 | Identification of a PLC spindle with output of M functions via the channel range of the HLI
P-CHAN-00098 | Enabling of M3, 4, 5, 19 for any use

Synchronisation methods

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

PLC_INFO

The PLC_INFO bit can be set in addition to these existing synchronisation modes. It determines whether the PLC is also to be informed. Observe the following:

In the case of PLC spindles, the PLC is generally also informed in the case of every spindle M function. There is therefore no need to additionally set the PLC_INFO bit.

It makes sense to use the PLC_INFO bit with NC spindles. In addition to the synchronisation mode, the PLC_INFO bit can be set here for output of information to the PLC.

More:

button Example 1a: CNC spindle, internally synchronised

button Example 1b: CNC spindle, synchronised internally and by the PLC

button Example 2a: PLC spindle

button Example 2b: PLC spindle with output of the M functions via the channel range


Example 1a: CNC spindle, internally synchronised

Initialisation in the axis parameter list

kenngr.achstyp 0x00000004 Spindle

Initialisation in the channel parameter list

spindel[0].m3_synch 0x00000002 MVS_SVS

spindel[0].m4_synch 0x00000004 MVS_SNS

spindel[0].m5_synch 0x00000004 MVS_SNS

spindel[0].m19_synch 0x00000004 MVS_SNS

Programming example

Main spindle

The feed motion X100 is started after the spindle has confirmed execution of the M3 command. The M function is not output to the PLC.

Programming example

The same example in axis-specific syntax for a further spindle:

N10 S2[M3 REV1000] G01 F100 X100


Example 1b: CNC spindle, synchronised internally and by the PLC

To achieve output of the M functions to the PLC, the PLC_INFO bit is set in the synchronisation mode.

The spindle always executes the corresponding command immediately (asynchronously). Corresponding to the synchronisation method, the contouring motion however is additionally synchronised with the acknowledgement by the PLC.

Initialisation in the axis parameter list

kenngr.achstyp 0x00000004 Spindle

Initialisation in the channel parameter list

spindel[0].m3_synch 0x00020002 MVS_SVS, PLC_INFO

spindel[0].m4_synch 0x00020004 MVS_SNS, PLC_INFO

spindel[0].m5_synch 0x00000004 MVS_SNS

spindel[0].m19_synch 0x00000004 MVS_SNS

Programming example

The feed motion X100 is started after both the spindle and the PLC have confirmed execution of the M3 command.


Example 2a: PLC spindle

For PLC spindles, the M functions are always output to the PLC. The PLC_INFO bit need not be set here.

For details of configuration of a PLC spindle, see [FCT-S1].

Initialisation in the axis parameter list

kenngr.achstyp 0x00000004 Spindle

achs_mode 0x00040000 External controled
spindle

antr_typ 0x00000004 Simulation

Initialisation in the channel parameter list

spindel[0].m3_synch 0x00000002 MVS_SVS

spindel[0].m4_synch 0x00000004 MVS_SNS

spindel[0].m5_synch 0x00000004 MVS_SNS

spindel[0].m19_synch 0x00000004 MVS_SNS

Programming example


Example 2b: PLC spindle with output of the M functions via the channel range

A PLC spindle can also be supplied with M functions via the channel-specific range of the HLI. To this end, 1 must be assigned to the channel parameter P-CHAN-00069 (plc_control). The PLC_INFO need not be set for output of the M functions. The spindle is not configured as a CNC axis.

Initialisation in the channel parameter list

spindel[0].plc_control1

spindel[0].m4_synch 0x00000004 MVS_SNS

spindel[0].m5_synch 0x00000004 MVS_SNS

spindel[0].m19_synch 0x00000004 MVS_SNS

Programming example


Gear selection/parameter set changeover

The M functions for selection of the gear of the main spindle M4045 are activated by the parameter P-CHAN-00052 (main_spindle_gear_change) in the channel parameter list. The M functions M4045 can be used freely if gear changing is deactivated.

M function | Meaning
M4045 | Gear selection for the main spindle

When gear changing P-CHAN-00052 (main_spindle_gear_change) is activated, the M functions M4045 must be assigned the synchronisation method MVS_SVS via the parameter P-CHAN-00041 (m_synch[..])!

Output always takes place in the spindle-specific range, and the PLC_INFO bit is not used here.

Possible:

q Output to other axes by axis-specific programming (e.g. X[M40]). The gear change function is then not active.

Not possible:

q Output to a spindle by axis-specific programming

q A default output to axes or spindles (Channel parameters).

The M functions M40-M45 are defined by definition of the prescribed synchronisation method.

Initialisation in the channel parameter list

m_synch[40] 0x00000002 MVS_SVS

m_synch[41] 0x00000002 MVS_SVS

m_synch[42] 0x00000002 MVS_SVS

m_synch[43] 0x00000002 MVS_SVS

m_synch[44] 0x00000002 MVS_SVS

m_synch[45] 0x00000002 MVS_SVS

Activation of gear changing:

main_spindle_gear_change 1

Programming example


Examples of the synchronisation methods in connection with motions

To simplify matters, the DIN syntax with channel-specific output is used in the following examples. Parameterisation takes place with the familiar P-CHAN-00041 (m_synch[..]) parameter.

MVS_SVS

Motion is not enabled until the M function is acknowledged by the PLC. Initialisation in the channel parameter list

m_synch[..] 0x2

Programming example

N20 G00 X25

N30 X50

N40 X75 M25 (M25 of the MVS_SVS type)

N50 G01 X100 F2000

N60 X125 Z100

M30

When the block N40 is executed, M25 is output and the program waits for the PLC's acknowledgement before the motion is begun in N40.

MVS_SNS | The subsequent CNC block is not executed until after acknowledgement of the M function by the PLC.
 | Initialisation in the channel parameter list m_synch[..] 0x4

Programming example

N20 G00 G90 X25

N30 X50

N40 X75 M25 (M25 of the MVS_SNS type)

N50 G01 X100 F2000

N60 X125 Z100

M30

On execution of the N40 block, M25 is output and the motion is continued. If the acknowledgement of M25 does not arrive in good time, the program stops at the end of N40.

MNS_SNS | Stopping at the end of the block until the M function is acknowledged by the PLC.
 | Initialisation in the channel parameter list m_synch[..] 0x8

Programming example

N20 G00 X25

N30 X50

N40 X75 M25 (M25 of the MNS_SNS type)

N50 G01 X100 F2000

N60 X125 Z100

M30

After the motion in N40, the program stops in any case, waiting for the acknowledgement by the PLC after output of M25.

MNE_SNS | Output of the M function is triggered by an event. Motion is not enabled beyond the end of the block until after acknowledgement of the M function by the PLC.
 | Initialisation in the channel parameter list m_synch[..] 0x20

Programming example

N05 X0 Y0

N10 G108 (Start measuring edge banding)

N20 G01 X90 Y90 F20

N30 G01 X150 Y150 M33 F8 ( M33 of the MNE_SNS type)

N40 G107 (End measuring edge banding)

N50 G00 X200 Y200

M30

A measurement event in N30 leads to output of M33. The remaining distance defined by the measurement method is then covered. The program then waits for acknowledgement of M33 by the PLC.

MVS_SLM | Block modal, implicit synchronisation at the transition to the next feed motion block (G01, G02, G03). Motion is not enabled beyond the end of this motion block until after acknowledgement of the M function by the PLC.
 | Initialisation in the channel parameter list m_synch[..] 0x4000

Programming example

N05 M24 (M24,synchronisation type MVS_SLM)

N10 M25 G00 X25 (M25,synchronisation type MVS_SLM)

N20 X50

N30 X75

N40 X100

N50 G01 X125 F2000 <--Triggering of M24, M25 before

execution of the motion block

N60 Z100

M30

If the MVS_SLM M function is programmed in the feed motion block, in conformity with MVS_SVS synchronisation takes place before this motion is begun.

Example N10 G01 F100 M24

MVS_SLP | Programmed synchronisation (#EXPL_SYN)
 | Initialisation in the channel parameter list m_synch[..] 0x8000

Programming example

N05 M26 G00 X25 (M26, synchronisation type MVS_SLP)

N10 M27 (M27, synchronisation type MVS_SLP)

N20 X50

N30 X75

N40 X100

N50 G01 X125 F2000

N60 #EXPL SYN Triggering of M26, M27 before

execution of the next block

N70 G00 X0

N80 X0 Y0

M30

Behaviour of 'late' synchronisation (MVS_SLM, MVS_SLP) at
program end

The M function remains active even beyond the end of the CNC program if there is no feed motion block after programming of an MVS_SLM M-function or if there is no longer any #EXPL SYN in the current CNC program after programming of an M function with the synchronisation method MVS_SLP. Synchronisation then takes place in a subsequent CNC program when the trigger condition is reached.

Programming example

%PRG1

N05 M26 G00 X25 (M26, synchronisation type MVS_SLM)

N10 M27 (M27, synchronisation type MVS_SLP)

M30 (M26, M27 still active at the)

(program end)

%PRG2

N10 G01 F100 X10 <--Triggering of M26 before

execution of the motion

N20 #EXPL SYN Triggering of M27 before execution

of the next block

M30

If, when a CNC program is started, there are still pending M functions with a 'late' synchronisation method from the previous CNC program, synchronisation can fundamentally be forced here.

To this end, 1 must be assigned to the channel parameter P-CHAN-00033 (late_sync_ready).

Initialisation in the channel parameter list

late_sync_ready 1

Programming example

%PRG1

N05 M26 G00 X25 (M26, synchronisation type MVS_SLM)

N10 M27 (M27, synchronisation type MVS_SLP)

M30 (M26, M27 still active at the)

(program end)

%PRG2 <--Triggering and waiting for

acknowledgement of M26, M27

before starting of the program

N10 G01 F100 X10

M30

MET_SVS, MEP_SVS | Pre-output of the M function in accordance with a specified distance or time and motion enabling only after acknowledgement of the M function by the PLC.
 | Initialisation in the channel parameter list m_synch[..] 0x01000000 (synchronisation MEP_SVS) m_synch[..] 0x02000000 (synchronisation MET_SVS)

Programming example

N10 G01 X10 G90 F5000

N20 X20

N30 X30

N40 X40

N50 M96 (M96 MEP_SVS m_pre_outp = 250000,)

(or MET_SVS m_pre_outp = 300000us)

N55 X80

N60 X0

M30

Defining the lead
distance or time

The channel parameters P-CHAN-00070 (m_pre_outp[i]) and P-CHAN-00107 (h_pre_outp[i]) are used in combination with the synchronisation types MET_SVS and MEP_SVS. The parameters define the value for output before execution of the M/H functions in the path interpolator. The lead time is specified in the case of the MET_SVS type and the lead distance in the case of the MEP_SVS type.

Example for an initialisation in the channel parameter list for 2 M functions:

q The user-specific M function M96 is to be output to the PLC 10 millimetres before the synchronisation position in the block sequence is reached

q The user-specific M function M97 is to be output to the PLC 40 millimetres before the synchronisation time in the block sequence is reached

# Definition of M functions and synchronisation methods

# ======================================================

:

m_synch[96] 0x01000000 MEP_SVS

m_synch[97] 0x02000000 MET_SVS

#

# Pre-output time/distance setting with MET_SVS, MEP_SVS

# =======================================================

m_pre_outp[96] 100000 in 0.1 um

m_pre_outp[97] 40000 in us

In NC program the definition of path or time lead of each M/H function also can be changed by corresponding variables.
(e.g. V.G.M_FCT[MNr].PRE_OUTP_PATH, see [PROG]).

MOS_TS

Output of the M function before NC block, no synchronization. With this type the CNC provides a sample time offset in reference to block transition point.

Because of motion profile sampling with cycle time tzykl the output time of M-function in interpolator is in sample time raster but has at least an maximum time offset of one sample step in reference to the block transition point. The exact output timing can be calculated and done in the PLC by using the sample time offset of M code. (see also [HLI] , pMHTechno^.D_Time).

Initialisation in the channel parameter list

m_synch[..] 0x00040000 (MOS_TS)

Programming example

N10 G01 X25 G90 F5000

N20 X50

N30 M25 (M25 MOS_TS)

N40 X100

N50 X200

M30

The output instant of the M code is in sample time raster but not exactly on block limits between the two motion blocks N20 und N40. For controlling the high accuracy output in the PLC, during calculation of the output instant the time offset tcr (fractional part of sample time step, characterizes the exact position of sample time step in reference to block transition point) is considered.

The function for exact output instant is realized in PLC typically with use of specific high resolution timer hardware.

Programming example:

Exact path synchronous triggering of I/Os

During cutting process a laser (beam width 100µm) shall be switched on/off on exact position. The tolerance is within 10 µs respectively within a ½ beam width (=50 µm). The time related resolution of the CNC interpolation cycle (typical 1 ms) is not sufficient. The problem can be solved by using a specific high resolution timer hardware.

In the system sequence CNC to drive the delay is defined greater than the delay in the system sequence to the laser system.

In the current case based on the laser system a typical delay of 800 µs is assumed. For the positioning sequence CNC  drive the typical delay is 5 sample cycles ((5 * 1 ms = 5 ms). The positioning system inside the drive operates without position lag (active feedforward control). However if necessary, the position lag can be estimated. The delay of the positioning sequence for the triggering of the laser is considered in PLC with time TDPLC .

So the provided CNC based M code of the path interpolator is delayed for n cyles inside the PLC. The exact control signal for the laser in the following cycle is calculated within the PLC, based on the interpolation data and the delay and it is created on a hardware terminal with a high basic clock-pulse rate (e.g. 1µs).


Default M functions

Channel M functions

In conformity with DIN66025, the following M functions are assigned fixed defaults as CNC commands. Unless specified accordingly in the channel parameter list, they are neither output nor synchronised.

M function | Meaning
M00 | Programmed halt
M01 | Optional halt
M02, M30 | Main program end
M17, M29 | Subroutine end
M10 | Optional function: activation of 'axis clamping' (channel-specific output) [SYSP - Chapter 3.18]. Only MNS_SNS permitted
M11 | Optional function: deactivation of 'axis clamping' (channel-specific output) [SYSP - Chapter 3.18]. Only MVS_SVS permitted.

The parameter P-CHAN-00041 (m_synch[..]) must be assigned for channel or axis-specific output!

Spindle M functions

As defined in DIN66025, the following M functions are assigned fixed defaults for the control of spindles. Unlike for other M functions, a synchronisation method is specified for each spindle under the special parameters in the channel parameter list [CHAN] (excepting M40  45).

M function | Meaning
M03 | Endless clockwise spindle rotation
M04 | Endless counterclockwise spindle rotation
M05 | Stop spindle
M19 | Position spindle
M40  45 | Gear selection for the main spindle

Example

Spindle output

spindel[0].m3_synch 0x00020002 PLC_INFO, MVS_SVS

spindel[0].m4_synch 0x00020004 PLC_INFO, MVS_SNS

Channel output

m_synch[3] 0x00000002 Channel output


M/H functions with additional information

Programming

Restrictions

In NC program for M/H functions an optional additional value can be programmed directly as a negative or positive integer or with general mathematical expressions. This value is made available to the PLC on the technology interface in combination with the M/H function.

Example: M50=123 or H44=-256

The internal M functions M00, M01, M02, M17, M29 and M30 and all user specific M/H functions can be programmed with an additional value both in channel specific and in axis specific programming syntax

For the spindle M functions M03, M04, M05, M19 and M40-M45 no additional value can be programmed!

Programming example

%m_h_add_fct

(M functions with additional value)

N10 M52=-345

N20 M12=123 (with channel parameter m_default_outp_ax_name[12] Z)

N30 M10=321 (with channel parameter m_default_outp_ax_name[10] S)

N35 P1 = 567 P2 = 345

N40 X[M54=P1]

N50 S[REV 1000 M03 M63=-789]

N60 M12=123 M10=321 M52=-345 X[M54=567] S[REV 1000 M03 M63=-789]

N70 M63=-789 M52=-P2 M54=567

N80 X[M52=-345 M54=567] Y[M63=-789] S[M05 M63=789 M54=-567] M54 M63

(H functions with additional value)

N110 H5=-345

N120 H6=123 (with channel parameter h_default_outp_ax_name[6] Z)

N130 H9=321 (with channel parameter h_default_outp_ax_name[9] S)

N135 P3 = 567 P4 = -345

N140 X[H7=P3]

N150 S[REV 1500 M04 H8=-789]

N160 H6=123 H9=321 H5=-345 X[H7=567] S[REV 1500 M04 H8=-789]

N170 H8=-789 H5=P4 H7=567

N180 X[H8=-789 H4 H5=-345] Y[H7=567] S[M05 H5=345 H7=567] H3 H8

(Mixed M/H functions with additional value)

N200 X[M52=-345 H4 H8=-789 M54=567 H5=345] H3=333 M54=444 H7=567 M63

(M/H functions with additional value in axis speczific function(INDP))

N05 X[INDP G90 G01 FEED=2000 POS=555 M54=151 H8=-181]

N999 M30=111


Production time calculation

When planning production processes, it is important to know what production times are needed for the various jobs. This also applies to the time that a machine needs to produce a part.

To simulate the production time, the run times the user has determined empirically in µs for M/H functions are specified in the table P-CHAN-00040 or P-CHAN-00026 (*_prozess_zeit[i]) in the channel parameter list. The field index "i" specifies the number of the M/H function [CHAN].

Parameters

P-CHAN-00040 | Execution time for the M function with the number i
P-CHAN-00026 | Execution time for the H function with the number i

Example

0.5 or 1.3 s are needed for execution of the M07 and M08 functions:

m_prozess_zeit[7] 500000

m_prozess_zeit[8] 1300000

For the default spindle M functions (and also for the S function), the execution time is specified under the spindle parameters [CHAN].

Parameters

P-CHAN-00042 | Execution time for the spindle M function M19
P-CHAN-00044 | Execution time for the spindle M function M3
P-CHAN-00046 | Execution time for the spindle M function M4
P-CHAN-00048 | Execution time for the spindle M function M5
P-CHAN-00080 | Execution time for the spindle S function

Example

0.5 or 1.5 s are needed for execution of the M03 and M19 functions:

spindel[0].m3_prozess_zeit 500000

spindel[0].m19_prozess_zeit 1500000


CNC programming

Channel-specific

Programming is done in the usual fashion in conformity with DIN66025. The M/H function is output at the channel-specific part of the HLI.

For all M/H functions to be used, the synchronisation entry must be under the parameters P-CHAN-00041 (m_synch[mnr]) and P-CHAN-00027 (h_synch[mnr]) in the channel parameter list. This does not apply to the default M functions.

Programming example

N20 X75

N30 X50

N40 X25 M8

N50 X0 H1

Axis-specific
(programming)

An extended CNC syntax is used for output of an M or H function to an axis.

If the output is always to take place to a specific axis, the extended syntax can be optionally dispensed with and the M/H function for this axis can be assigned by default.

The chosen axis must be in the channel. This is done by correspondingly assigning the output axis configuration in the channel parameter list or by programming axis exchange commands during execution in the CNC program [PROG].

Axis-specific
(parameterisation)

Configuration for standard output at the axis-specific part of the HLI when programming DIN66025 syntax.

m_default_outp_ax_name[7] Z

Programming example

N20 X75

N30 X50

N40 X25 M7Output of M7 to the Z axis

N50 X[M7] Output of M7 to the X axis

Explicit
(extended syntax)

Programming in axis-specific syntax [PROG] for output at the axis-specific part of the HLI. In the case of explicit programming, an assignment from the channel parameter list is ignored.

Programming example

N20 X75

N30 X50

N40 X25 X[M7]Output of M7 to the X axis

N50 X0

Mixed programming

Output of M or H functions to several axes and the channel ranges in the same NC block.

Programming example

N10 X[M7] S[M7] M7Simultaneous output of M7 to the X axis,

the main spindle and the channel range

N20 X[H1] S[H1] H1Corresponding example for the H function


Method for creating an M or H function in the channel parameter list


Application examples

Example 1

It should be optionally possible to output the M function to the channel or the X axis. Synchronisation is not necessary.

Channel parameter list

m_synch[83] 0x1

Programming example

N10 M83 X[M83]

N20 M83

N30 X[M83]

Example 2

In future, the H function H3 is always to be output to the spindle axis S without there being a need for a change to CNC programs. Synchronisation is necessary before starting a motion. To simulate the production time, an execution time of 1 s is assumed.

Channel parameter list

h_synch[3] 0x2 MVS_SVS

h_default_outp_ax_name[3] S

h_prozess_zeit[3] 1000000

Programming example

N10 X10 H3

Example 3

The default M function M1 is to be synchronised before starting of a motion. To simulate the production time, an execution time of 0.8 s must be assumed.

Channel parameter list

m_synch[1] 0x2 MVS_SVS

m_prozess_zeit[1] 800000

Programming example

N10 M1 X100


HMI-Display

The active M/H-Functions are available via ADS and can be displayed on the graphical user interface.

There exists a channel specific and an axis specific view.

Active M-Function, channel specific
Description | Displays the active channel specific M/H-functions on the PLC-interface (HLI).
Type | Structure: UNS32 number UNS32 activ-M/H[12]
Value range | [ 0; MAX_UNS32 ]
HMI elements | mc_active_m_functions_r, mc_active_h_functions_r
Zugriff | Read
IndexOffsetADS | 0x3d, 0x91 (IndexGroupADS = 0x000201<ii> with <ii> = Kanal, [ 1 ; max])

Active M/H-Function, axis specific
Description | Displays the active axis specific M/H-functions on the PLC-interface (HLI).
Type | Struktur: UNS32 Anzahl UNS32 active-M/H[12]
Value range | [ 0; MAX_UNS32 ]
HMI elements | ac_<I>_active_m_functions_r, ac_<I>_active_h_functions_r
Zugriff | Read
IndexOffsetADS | 0x13, 0x17 (IndexGroupADS = 0x000202<ii> mit <ii> = Achsindex, [1;max])

Example | After start of MDI H41, H42, H51 following three H-Functions are waiting for PLC-acknowledge.

Example | After MDI X[H50] the axis specific H-Function is waiting for PLC-acknowledge.


Parameters

More:

button Overview

button Description


Overview

Constant | Description
M_FKT_ANZ | Maximum number of M functions [SYSP - Chapter 8.1]
H_FKT_ANZ | Maximum number of H functions [SYSP - Chapter 8.2]
ACHS_NAME_LAENGE | Maximum length of the axis designation [SYSP - Chapter 6.46]

ID | Parameter | Description
P-CHAN-00025 | h_default_output_ax_name[i] | Axis-specific output of H functions
P-CHAN-00026 | h_prozess_zeit[i] | Process time of H functions
P-CHAN-00027 | h_synch[i] | Synchronisation methods for H functions
P-CHAN-00033 | late_sync_ready | Handling of open 'late' synchronisation processes at the end of the CNC program
P-CHAN-00039 | m_default_output_ax_name[i] | Axis-specific output of M functions
P-CHAN-00040 | m_prozess_zeit[i] | Process time of M functions
P-CHAN-00041 | m_synch[i] | Synchronisation methods for M functions
P-CHAN-00042 | m19_prozess_zeit | Process time of M19 functions
P-CHAN-00043 | m19_synch | Synchronisation method M19
P-CHAN-00044 | m3_prozess_zeit | Process time of M03 functions
P-CHAN-00045 | m3_synch | Synchronisation method M3
P-CHAN-00046 | m4_prozess_zeit | Process time of M04 functions
P-CHAN-00047 | m4_synch | Synchronisation method M4
P-CHAN-00048 | m5_prozess_zeit | Process time of M05 functions
P-CHAN-00049 | m5_synch | Synchronisation method M5
P-CHAN-00052 | main_spindle_gear_change | Spindle gear change/parameter set changeover
P-CHAN-00069 | plc_control | Identification of a PLC spindle with output of M functions via the channel range of the HLI
P-CHAN-00070 | m_pre_outp[i] | Distance/time-dependent pre-output of M functions
P-CHAN-00080 | s_prozess_zeit | Process time of the S function
P-CHAN-00098 | spindle_m_fct_free | Free use of the spindle M functions M3, 4, 5, 19
P-CHAN-00107 | h_pre_outp[i] | Distance/time-dependent pre-output of H functions


Description

More:

button Channel parameters


Channel parameters

P-CHAN-00039 | Definition of an axis-specific M function
Parameter | m_default_outp_ax_name[i]
Description | If the user wishes to force axis-specific handling for specific M functions, it is possible to configure them by means of the channel parameter P-CHAN-00039 so that they have an axis-specific effect. The field index "i" defines the number of the M function. Each M function can be assigned an axis name which it is to apply to. Besides spindle axes, contour axes are also permitted.
Data type | STRING
Data range | 1 ≤ string length ≤ ACHS_NAME_LAENGE
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | As in the case of channel-specific M functions, the synchronisation method of the axis-specific M function is defined with P-CHAN-00041 .

P-CHAN-00025 | Definition of an axis-specific H function
Parameter | h_default_outp_ax_name[i]
Beschreibung | If the user wishes to force axis-specific handling for specific H functions, it is possible to configure them by means of the channel parameter P-CHAN-00025 so that they have an axis-specific effect. The field index "i" defines the number of the H function. Each H function can be assigned an axis name which it is to apply to. Besides spindle axes, contour axes are also permitted.
Data type | STRING
Data range | 1 ≤ string length ≤ ACHS_NAME_LAENGE
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | As in the case of channel-specific H functions, the synchronisation method of the axis-specific H function is defined with P-CHAN-00027 .

P-CHAN-00052 | Enabling gear change for main spindle
Parameter | main_spindle_gear_change
Description | Gear changing for the main spindle is enabled or disabled with P-CHAN-00052.
Data type | BOOLEAN
Data range | 0: Spindle gear change for the main spindle deactivated 1: Spindle gear change for the main spindle activated
Dimension | Translatory: - | Rotatory: -
Default | 0
Remarks | The M functions for selection of the gear of the main spindle M4045 are activated by the parameter P-CHAN-00052 in the channel parameter list. The M functions M4045 can be used freely if gear changing is deactivated.

P-CHAN-00069 | PLC spindle via channel interface
Parameter | spindel[i].plc_control
Description | A spindle is not controlled by a spindle interpolator in the NC channel, but directly by the PLC. Note that all synchronisation is no longer output and handled in relation to the specific (spindle) axis, but via the channel-specific HLI range. The axis-specific syntax for programming the spindle commands is still allowed, but is limited to specification of the speed and the M functions M3/M4/M5/M19.
Data type | BOOLEAN
Data range | 0: A spindle is controlled by a spindle interpolator in the NC channel. 1: A spindle is controlled directly by the PLC.
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | -

P-CHAN-00098

Change in the meaning of M functions

Parameter

spindle_m_fct_free

Description

As detailed in DIN66025, certain M functions have different meanings depending on the machining process and the machine design.

In the case of metal-cutting machines (e.g. milling/turning/drilling), M3/M4/M5/M19 are permanently assigned to the spindle functions (direction of rotation, stopping, positioning).

In the case of machining processes such as plasma/laser beam cutting or wire erosion, the mentioned M functions are used to control other technological functions.

To enable free assignment, P-CHAN-00098 can therefore be used to change the meanings of the M functions M3/M4/M5/M19.

Data type

BOOLEAN

Data range

0: M3/M4/M5/M19 are permanently assigned to the spindle M functions (default if spindles are configured).

1: M3/M4/M5/M19 are freely available for other technological functions. They must be defined in the channel parameters under P-CHAN-00041. The M functions are no longer spindle functions!

Dimension

Translatory: -

Rotatory: -

Default

0

Remarks

-

Synchronisation
definitions

P-CHAN-00041

Synchronisation methods for M functions

Parameter

m_synch[i]

Description

The synchronisation method of the corresponding M function is defined in the array "m_synch[i]". The field index "i" defines the number of the M function. The maximum number of M functions is limited by the constant M_FKT_ANZ.

The value of P-CHAN-00041 specifies which synchronisation method the M function possesses, i.e. when a check is run for the presence of the PLC acknowledgement. A motion is not executed, or is stopped at the latest towards the end of the block, if no acknowledgement has arrived from the PLC.

Data type

UNS16

Data range

NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM, MVS_SLP, MEP_SVS, MET_SVS

Dimension

Translatory: -

Rotatory: -

Default

NO_SYNCH

Remarks

-

P-CHAN-00027

Synchronisation methods for H functions

Parameter

h_synch[i]

Description

The synchronisation method of the corresponding H function is defined in the array "h_synch[i]". The field index "i" defines the number of the H function. The maximum number of H functions is limited by the constant H_FKT_ANZ.

The value of P-CHAN-00027 specifies which synchronisation method the H function possesses, i.e. when a check is run for the presence of the PLC acknowledgement. A motion is not executed, or is stopped at the latest towards the end of the block, if no acknowledgement has arrived from the PLC.

Data type

UNS16

Data range

NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MEP_SVS, MET_SVS

Dimension

Translatory: -

Rotatory: -

Default

NO_SYNCH

Remarks

The standard synchronisation methods MVS_SLM and MVS_SLP are not available for H functions.

P-CHAN-00045 | Synchronisation method for M03
Parameter | spindel[i].m3_synch
Description | The synchronisation method of the M03 function is defined with this parameter.
Data type | UNS16
Data range | NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM, MVS_SLP, PLC_INFO
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | -

P-CHAN-00047 | Synchronisation method for M04
Parameter | spindel[i].m4_synch
Description | The synchronisation method of the M04 function is defined with this parameter.
Data type | UNS16
Data range | NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM, MVS_SLP, PLC_INFO
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | -

P-CHAN-00049 | Synchronisation method for M05
Parameter | spindel[i].m5_synch
Description | The synchronisation method of the M05 function is defined with this parameter.
Data type | UNS16
Data range | NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM, MVS_SLP, PLC_INFO
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | -

P-CHAN-00043 | Synchronisation method for M19
Parameter | spindel[i].m19_synch
Description | The synchronisation method of the M19 function is defined with this parameter.
Data type | UNS16
Data range | NO_SYNCH, MOS, MVS_SVS, MVS_SNS, MNS_SNS, MNE_SNS, MVS_SLM, MVS_SLP, PLC_INFO
Dimension | Translatory: - | Rotatory: -
Default | -
Remarks | -

P-CHAN-00070 | Distance/time-dependent premature output of M functions
Parameter | m_pre_outp[i]
Description | P-CHAN-00070 is used in combination with the synchronisation types MET_SVS and MEP_SVS. The field index "i" defines the number of the associated M function. The value of P-CHAN-00070 defines the value for output before execution of the M function in the path interpolator. The lead time is specified in the case of the MET_SVS type and the lead distance in the case of the MEP_SVS type.
Data type | UNS32
Data range | 0 ≤ P-CHAN-00070 ≤ MAX(UNS32)
Dimension | 0.1µm (in the case of MEP_SVS) or μ s (in the case of MET_SVS)
Default | -
Remarks | -

P-CHAN-00107 | Distance/time-dependent premature output of H functions
Parameter | h_pre_outp[i]
Description | P-CHAN-00107 is used in combination with the synchronisation types MET_SVS and MEP_SVS. The field index "i" defines the number of the associated H function. The value of P-CHAN-00107 defines the value for output before execution of the H function in the path interpolator. The lead time is specified in the case of the MET_SVS type and the lead distance in the case of the MEP_SVS type.
Data type | UNS32
Data range | 0 ≤ P-CHAN-00107 ≤ MAX(UNS32)
Dimension | 0.1µm (in the case of MEP_SVS) or μ s (in the case of MET_SVS)
Default | -
Remarks | -

P-CHAN-00033

Reaction to 'late synchronisation' at the program end

Parameter

late_sync_ready

Description

This parameter is used in combination with the synchronisation methods MVS_SLM and MVS_SLP (Late Sync). It defines the reaction to Late Sync M functions still open at the end of the program. This may happen if no G01 block followed in the NC program up to the end of the program (in the case of MVS_SLM) or if explicit synchronisation was not programmed (in the case of MVS_SLP).

Data type

BOOLEAN

Data range

0: Open Late Sync M functions at the end of the program are still active the next time the program is started. This means that one or several Late Sync M functions of the first NC program are only triggered by a Late Sync event (G01 block or #EXPL SYN) of the second NC program.

1: At the program end, the program waits until all open Late-Sync M functions have been acknowledged by the PLC.

Dimension

Translatory: -

Rotatory: -

Default

-

Remarks

-

Production time
calculation

P-CHAN-00040 | Process time of M function
Parameter | m_prozess_zeit[i]
Description | The process time for production time calculation of the associated M function is defined in the array "m_prozess_zeit[i]". The field index "i" defines the number of the M function. The maximum number of M functions is limited by the constant M_FKT_ANZ.
Data type | UNS32
Data range | 0 < P-CHAN-00040 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00026 | Process time of H function
Parameter | h_prozess_zeit[i]
Description | The process time for production time calculation of the associated H function is defined in the array "h_prozess_zeit[i]". The field index "i" defines the number of the H function. The maximum number of H functions is limited by the constant H_FKT_ANZ.
Data type | UNS32
Data range | 0 < P-CHAN-00026 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00080 | Process time of the S function
Parameter | spindel[i].s_prozess_zeit
Description | Process time of the S function for production time calculation
Data type | UNS32
Data range | 0 < P-CHAN-00080 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00044 | Process time of the spindle function M03
Parameter | spindel[i].m3_prozess_zeit
Description | Process time of the M03 function for production time calculation
Data type | UNS32
Data range | 0 < P-CHAN-00044 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00046 | Process time of the spindle function M04
Parameter | spindel[i].m4_prozess_zeit
Description | Process time of the M04 function for production time calculation
Data type | UNS32
Data range | 0 < P-CHAN-00046 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00048 | Process time of the spindle function M05
Parameter | spindel[i].m5_prozess_zeit
Description | Process time of the M05 function for production time calculation
Data type | UNS32
Data range | 0 < P-CHAN-00048 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter must only be used in connection with the optional "production time calculation" function.

P-CHAN-00042 | Process time of the spindle function M19
Parameter | spindel[i].m19_prozess_zeit
Description | Process time of the M19 function for production time calculation
Data type | UNS32
Data range | 0 < P-CHAN-00042 < MAX(UNS32)
Dimension | µs
Default | -
Remarks | This parameter may only be used in connection with the optional "production time calculation" function.