Home › G-codes › Siemens 840D 828D › L
L Subprogram call by name or L number
Siemens 840D 828D G-code · Mill and lathe
Runs a subprogram, then returns to the next block. The subprogram is called by its name or by L with a number. P sets how many times it runs.
Format
NAME [P] or L123 [P]
Addresses
| Address | What it does |
|---|---|
NAME or L123 | Subprogram name. Leading zeros count, so L007 and L7 are different. |
P | Number of passes, 1 if not written |
How it works
Non modal. Write the call in a block of its own.
Example program
G0 X10 Y10 Z2 ; START OF PATTERN
L10 P3 ; RUN L10 THREE TIMES
POCKET_A ; CALL SUBPROGRAM BY NAME
M30
L10 P3 ; RUN L10 THREE TIMES
POCKET_A ; CALL SUBPROGRAM BY NAME
M30
Example is in inch. Check offsets and clearances first.
Watch out for
- End the subprogram with M17 or RET.
- Modal settings changed in the subprogram stay active after the return.
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 L in the app All Siemens 840D 828D G-codes