; Multiple Loop example ; ; ; G40 G80 ; sets no offsets no cycles active G90 ; sets in absolute mode G49 ; clears any length offsets G21 ; declares metric programme G0 X0 Y0 Z0 M5 ; safety line should not move if machine set up properly G43 T1 M6 ; use tool length offset & prompt for tool change G00 X4.122 Y5.2 ; move to first hole G65 P100 L2 ; P is loop indicator this does 2 segments only G49 ; turn off offset G00 Z0 ; send Z fully up G00 X0 Y0 ; send X and Y to zero M30 ; end of main programme O100 ; Loop identified by letter O G65 P101 L5 ; P is loop indicator ie P101 calls O101 L is number of passes eg 5 G00 X4.122 ; confirm x is at start position G91 ; switches to incremental Y12. ; move to next segment G90 ; back to absolute M99 ; end of loop O101 ; Loop G65 P102 L16 ; P is loop indicator ie P100 calls O100 L is number of passes G91 ; switches to incremental G00 Y6.0 ; Moves to next row G90 ; back to absolute G65 P103 L16 ; calls loop to move x back G91 ; switches to incremental G00 Y6.0 ; Moves to next row G90 ; back to absolute M99 ; end of loop O102 ; Loop identified by letter O G65 P105 L1 ; calls drill routine G91 ; switches to incremental G00 X8.25 ; moves X 8.25 G90 ; back to absolute M99 ; end of loop O103 ; Loop identified by letter O G91 ; switches to incremental G00 X-8.25 ; moves X-8.25 G90 ; back to absolute G65 P105 L1 ; calls drill routine M99 ; end of loop O105 ; Loop that drills change fo action you require G01 Z-9. F100. ; feeds z down G91 ; switches to incremental DELETE FOR ACTUAL JOB G01 Y2.0 ; MOVES Y TO GET SCREEN DISPLAY DELETE FOR ACTUAL JOB G01 Y-2.0 ; MOVES Y TO GET SCREEN DISPLAY DELETE FOR ACTUAL JOB G90 ; back to absolute DELETE FOR ACTUAL JOB G00 Z1. ; retracts Z M99 ; end of loop