Home › G-codes › Siemens 840D 828D › REPEAT
REPEAT Repeat a program section
Siemens 840D 828D G-code · Mill and lathe
Runs a section of the main program again. REPEAT LABEL P=n repeats from the label to the REPEAT block. REPEAT START END P=n repeats the blocks between two labels.
Format
REPEAT LABEL P= or REPEAT START END P=
Addresses
| Address | What it does |
|---|---|
LABEL | Label that marks the start of the section |
START END | Labels that mark the start and end of the section |
P= | Number of repetitions |
How it works
Non modal.
Example program
START: G91 G0 X20 ; STEP 20 IN X
G90 CYCLE81(50,0,2,-10,) ; DRILL
REPEAT START P=4 ; REPEAT SECTION 4 MORE TIMES
G90 G0 Z100
G90 CYCLE81(50,0,2,-10,) ; DRILL
REPEAT START P=4 ; REPEAT SECTION 4 MORE TIMES
G90 G0 Z100
Example is in inch. Check offsets and clearances first.
Watch out for
- Labels end with a colon where they are set, for example START:.
- Use G91 or a frame like ATRANS inside the section so each pass lands in a new place.
Related codes
Every G-code for Siemens 840D 828D in your pocket. The app has the full example programs, search by number or shop word, a line decoder and calculators for tapping, threading and drilling.
Open REPEAT in the app All Siemens 840D 828D G-codes