Cnc programming – Lenze ETC Motion Control User Manual

Page 88

Advertising
background image

CNC programming

Basics

3

3.1

l

88

EDSTCXN EN 2.0

Generally, a program starts with a "%" sign, followed by the program
number (1 ... 9999).

When a program is loaded via the monitor interface, this program number
is automatically created from the file name and inserted at the start of the
program (123.DIN −> %123).

Every program can be directly started or called as a subprogram by other
programs. Note that, in individual cases, the relevant parameters must be
provided.

No distinction is made between main programs and subprograms by means
of the program number.

Generally, program numbers

³ 8000 are considered separately. Normally,

cycle programs are stored in this range.

A block consists of a statement, optionally preceded by a block number, (see
below). A statement consists of the following elements:

ƒ "G" preparatory function

ƒ "M", "S", "T" auxiliary functions

ƒ "Q" fast outputs

ƒ Parameter assignments

ƒ Computer statement

ƒ Comment

All elements must only be programmed once in a block. Exceptions are "Fast
outputs" and "Parameter assignment". These may be specified more than
once in a block.

Computer statements are preceded by a colon. They must occur alone in a
block and may only be combined with comments. A block may have a
maximum length of 256 characters.

For program loops or branches, a statement can be preceded by block
numbers. These must be assigned within the program in ascending order.

The program end is indicated by an M function or a G function:

ƒ M30 = main program end

ƒ G99 = subprogram end

Program start

Block

Program loop and branch

Program end

Advertising