Siemens SINUMERIK 840DE Programming Manual page 401

Hide thumbs Also See for SINUMERIK 840DE:
Table of Contents

Advertisement

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.
The area between a label and the following ENDLABEL is repeated P=n times. Any name
can be used to define the start label. If the block with the start label or ENDLABEL contains
further statements, these are executed on each repetition.
Note
If no ENDLABEL is found between the start label and the block with the REPEAT call, the
loop ends before the REPEAT line. The construct therefore has the same effect as
described above in "repeat area from label".
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.
Parameters
LABEL:
REPEAT
REPEATB
Fundamentals
Programming Manual, 10.2004 Edition, 6FC5 298-7AB00-0BP1
Subprograms and Repetition of Program Sections
Jump destination; the name of the jump destination is
followed by a colon
Repeat (repeat several lines)
Repeat block (repeat one line only)
11.4 Program section repetition
11-9

Advertisement

Table of Contents
loading

Table of Contents