Lenze ETC Motion Control User Manual
Page 176

CNC programming
Block extensions
M functions
3.4
3.4.3
l
176
EDSTCXN EN 2.0
M49: Speed overlap disabled (override off)
M1014: Like M14, however as an asynchronous M function
M1015: Like M15, however as an asynchronous M function
M1048: Like M48, however as an asynchronous M function
M1049: Like M49, however as an asynchronous M function
Using a M function, it is also possible to initiate a subprogram call. For this,
all the M functions to be expanded must be entered in the machine
constants, under the identifier MK_MFKT_UPR_TABELLE,.
If the control encounters a corresponding M function in the course of
program processing, it will create a subprogram call with the program
number "9000 + M function number" after(!) all the other information from
this block has been processed.
M function numbers from 1 to 255 can be used for this type of subprogram
call.
The M function itself is transmitted normally to the PLC. If the same M
function is programmed in the subprogram that was called, it does not result
in the subprogram call being called again.
(
Stop!
If another subprogram is called in the subprogram 9000(+M
function number), which contains the triggering M function, a
call recursion occurs and then the error message "Program stack
overflow"
This subprogram mechanism is not only active in the automatic program
processing. The same M function is also expanded as an individual block in
a subprogram call.
N10 G0 X300 M14
N20 G2....
After the control has traversed the X−axis to the value 300, and the
information has been transmitted via the M14 to the PLC, the subprogram
%9014 is executed. Processing with block N20 is only continued after
subprogram %9014 has been completed.
The program sequence of the example is functionally identical with
N10 G0 X300 M14
G22 L9014
N20 G2....
Example