Siemens SINUMERIK 840Di sl Programming Manual page 426

Hide thumbs Also See for SINUMERIK 840Di sl:
Table of Contents

Advertisement

Program section repetition
11.1 Program section repetition
Note
The label must appear before the REPEAT statement. The search is performed toward the
start of the program only.
Programming repeat area between two labels
START_LABEL: xxx
ooo
END_LABEL: yyy
ppp
REPEAT START_LABEL END_LABEL P=n
zzz
The area between the two labels is repeated P=n times. User-defined names can be
assigned to the labels. The first line of the repetition contains the start label, the last line
contains the end label. If the line containing the start or end label contains further
statements, these are executed again on each run. If P is not specified, the program section
is repeated once. After the last repetition, the program is continued at the line zzz following
the REPEAT line.
Note
The program section to be repeated can appear before or after the REPEAT statement. The
search initially commences toward the start of the program. If the start label is not found in
this direction, the search resumes from the REPEAT statement toward the end of the
program.
It is not possible to nest the REPEAT statement with the two labels within parentheses. If the
start label is found before the REPEAT statement and the end label is not reached before
the REPEAT statement, the repetition is performed on the section between the start label
and the REPEAT statement.
Programming repeat an area between a label and the end label
LABEL: xxx
ooo
ENDLABEL: yyy
REPEAT LABEL P=n
zzz
ENDLABEL is a predefined label with a fixed name. ENDLABEL marks the end of a program
section and can be used multiple times in the program. The block marked by ENDLABEL
can contain further statements.
426
Programming Manual, 11/2006, 6FC5398-1BP10-2BA0
Fundamentals

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents