Home › M-codes › Siemens 840D 828D › M17
M17 End of subprogram
Siemens 840D 828D M-code · Mill and lathe
Ends a subprogram and returns to the calling program. RET does the same.
Format
M17
How it works
Non modal.
Example program
; SUBPROGRAM L10
G91 G1 X10 F300 ; STEP
G90
M17 ; RETURN TO MAIN PROGRAM
G91 G1 X10 F300 ; STEP
G90
M17 ; RETURN TO MAIN PROGRAM
Example is in inch. Check offsets and clearances first.
Watch out for
- M2 or M30 in a subprogram also returns, but M17 or RET makes the intent clear.
Machine builders set many M codes, and they change by model and options. Check the M code list for your machine.
Related codes
M17 on other controls
The same number can mean something different on another control.
| Control | Meaning |
|---|---|
| Haas NGC | Pallet unclamp and open APC door |
| Doosan (Fanuc) | Machine lock act |
| Mazak (EIA) | Spindle orientation 120° (for AJC) |
| Okuma OSP | CEJ MATIC : Request of Data transfer |
| Centroid CNC12 Acorn | Prepare for tool change, macro |
| Hurco WinMax (NC) | Automatic buffering off |
| Fadal | End of subroutine, Format 1 |
Every M-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 M17 in the app All Siemens 840D 828D M-codes