With most Fanuc controls, the L word is used to specify the number of repetitions for a subprogram call. The command
M98 P1000 L4
for example, will make the machine execute program O1000 four times. Again, this is the most common use for the L word.
If the L word is omitted (M98 P100), the machine will execute the program one time. That is, the machine will assume L1 if it is not explicitly stated in the command.
Though not as commonly known, the L word can also be used with canned cycles. As with subprogramming, the machine will assume one execution of the canned cycle if the L word is left out. So the command
N050 G81 X1.0 Y1.0 R0.1 Z-1.0 F4.0
will drill one hole.
When programming incrementally, the L word can be used to specify that a series of equally spaced holes will be machined. Consider these commands:
.
.
.
N010 G54 G90 S400 M03
N015 G00 X1.0 Y1.0
N020 G43 H01 Z0.1 M08
N025 G81 R0.1 Z-1.0 F4.0
N030 G91 X1.0 L9
N035 G90 G80 M09
N040 G91 G28 Z0
.
.
.
In line N025, the first of ten equally spaced holes on one inch centers is drilled. Line N030 drills the other nine.
But this article is about using L0. When could this be helpful? Maybe you want to have a subprogram that includes a series of holes to be drilled. All of the hole locations are included in the subprogram. Here is the subprogram:
O1000
N1 X1.0 Y1.0
N2 X4.5
N3 Y4.5
N4 X1.0
N5 G80 M09
M99
Again, all of the holes to be drilled are in this subprogram. Consider this portion of the main program:
.
.
.
N010 G54 G90 S400 M03
N015 G00 X1.0 Y1.0
N020 G43 H01 Z0.1 M08
N025 G81 R0.1 Z-1.0 F4.0 L0 (Tell the machine how to drill the holes)
N030 M98 P1000
N035 G91 G28 Z0
.
.
.
Line N025 sets up the canned cycle but does not drill a hole. Not until the machine executes the subprogram will the first hole be drilled.
Another application for L0 is helpful when you need to clear obstructions between holes. You probably know that G98 and G99 can be used to clear obstructions by moving above them in Z between holes, but in some cases, it may save time to clear obstructions by moving around them in X and Y. Consider these commands:
.
.
.
N010 G54 G90 S400 M03
N015 G00 X1.0 Y1.0
N020 G43 H01 Z0.1 M08
N025 G81 R0.1 Z-1.0 F4.0 (First hole)
N030 X1.5 (Second hole)
N035 Y2.0 L0 (Move forward in Y to clear obstruction)
N040 X3.0 L0 (Move right in X to continue to clear obstruction)
N045 Y1.0 (Drill next hole)
N050 G90 G80 M09
N055 G91 G28 Z0
.
.
.
No holes will be machined in lines N035 and N040. While you can achieve the same effect by canceling and reinstating the cycle between holes, this technique requires fewer commands.
Comments