Cnc programming – Lenze ETC Motion Control User Manual

Page 109

Advertising
background image

CNC programming

G functions

G functions individual descriptions

3

3.2

3.2.2

l

109

EDSTCXN EN 2.0

3.2.2.11

G22 Subprogram call, optionally with condition check and start of a new NC channel

Call of a subprogram as a separate program or within the current program,
optionally dependent on a condition and programmable with repetition.
The subprogram can also be started in a new NC channel.

G22 AXES K L J I E

AXES

Axes, which should be transferred to the new NC channel (K).

K

Number of the new NC channel (> 1)

L

Number of the subprogram {1 ... 9999}

J

Block number

I

Loop counter

E

Index of the Q−Bit (direct programming) or of the parameter field (indirect
programming) for the condition check.

Function G22 allows a subprogram call, which can also be executed
conditionally via the DIN address E on request and which can be executed in
a separate NC channel via the DIN address K.

If E is directly programmed, the function is time synchronized and the value
of E is interpreted as an index of a Q−Bit. The jump is only executed if the Q−Bit
is "1". In the case of indirect programming, the jump is only executed when
the contents of the specified parameter is not equal to "0". A time
synchronization only takes place if it is a time synchronized parameter.

The program processing branches to the called subprogram L, the main
program is continued after the return from the subprogram with the block
following the subprogram call.

Up to seven subprogram calls can be nested.

Functions which have a modal effect are still valid after the return from a
subprogram. In the subprogram, the state of the main program is initially
valid, yet this can be changed.

By specifying a block number under the address J, it is possible to start with
a specific block number of the subprogram. If no program number L is
specified, the subprogram is called within the current program. The program
processing then branches to the specified block number. The program is
continued like with a normal subprogram call after G99 with the block
following G22. It is important to note here that the block numbers must
always be assigned numerically in ascending order!

It is also possible to program a number of repetitions under the address I.
That means that the block following G22 is started when the program L was
called I−times.

Syntax

Meaning of the addresses

Explanation

Advertising