OmniTurn   CNC Lathes Made in Oregon
 Fast... Precise... Affordable... Home Contact

Looping (LS, LF)
See also G10, Work Shift

LSn:
 Loop Start; number of times to loop

LF:
 Loop Finish


Looping is used to perform repetitive moves without having to write long programs. The start of a loop is defined by LSnn where "nn" is number of times to execute the loop. At the end of the loop put a LF on a line by itself. NOTE: Comments cannot be used inside the loop.

Here is a loop program for a decorative piece using g10 and g02:

g90g72g94f300
t1 (0.031 radius groove tool)
x0z.1
m03s1000
g95f.003
z0
ls9 (LOOP START)
t1 (0.031 radius groove tool)
x.4375z0
g02x.4375z-.125r.0625
g10x0z-.125 (WORK SHIFT)
lf (LOOP FINISH)
t1 (0.031 radius groove tool)
x.4375z0
g02x.5625z-.0625r.0625
z-.25
m30
Image of G10 and Looping Example
Note that the tool path/tool radius is such that smooth contours result.



Example of shifting a program for bar work

With the G10 work shift you can take a program and loop it with the shift so that you get multiple parts done on a single feedout. Here is a loop program where three parts will be made with one barfeed sequence:

G90G94F300G72
M03S2500
T1 (table stop)
x0z.05
z-1.75
m13
f10z0
m12
LS3 (LOOP START)
T2(lh turn tool)
X0Z.2
x1.05z.05
G95F.003
g75i.05u.02f.003
x0z0
x.5z-.25
z-.5
x1.025
RF
g00z.1
x0z.05
g01
z0
x.5z-.25
z-.5
x1.025
g00z.2
T3 (0.125 partoff)
x-1.05z.2
z-.875
g01
x.05
x-1.05
g00z.1
g10x0z-.875 (WORK SHIFT)
LF (LOOP FINISH)
M30

Image of G10 and Looping Example with G75

Tooling Plate Illustrations for Program Above
Image of G10 and Looping Example with G75


Back to G-Codes
Back to Top