5.9 Flow Control Command(IF~GOTO) .....................................................................................240
5.10 Flow Control Command (WHILE~DO) ......................................................................................242
5.11 Function ......................................................................................................................................245
09
G83 Peck Drilling Cycle 09
G84 Right-Handed Screw Thread Tapping Cycle 09
G85 Reaming Cycle 09
G86 Boring Cycle 09
G87 Back Boring Cycle 09
G88 Boring Cycle (Manual Operation on the Bottom Point) 09
G89 Reaming Cycle 09
G90 Absolute Command 03
G91 Incrementalal Command 03
G92 Coordinate Setting 00
G94 Feed Per Minute 05
G95 Feed Per Revolution 05
G98 Canned Cycle Starting Point Return 10
G99 Canned Cycle R Point Return 10
G100 Global variables Setting
The following are all
macros
G101 Linear Mode of Multi-hole Manufacturing Cycle
LNC Technology Co., Ltd.
2
LNC-MILL
G-Code Function Table
G Code Function Group
G102 Circular Mode of Multi-hole Manufacturing Cycle
G103 Arc Mode of Multi-hole Manufacturing Cycle
G104 Grid Mode of Multi-hole Manufacturing Cycle
G105 Promiscuous Mode of Multi-hole Manufacturing Cycle
G111 Two-way Plane Proce ssing in X-axis
G112 Two-way Plane Processing in Y-axis
G113 One-way Plane Processing in X-axis
G114 One-way Plane Processing in Y-axis
G121 Circular Shape Side Cutting
G122 Rectangle Shape Side Cutting
G123 Track Shape Side Cutting
G131 Circular Shape Pocket Cutting
G132 Rectangle Shape Pocket Cutting
G133 Track Shape Pocket Cutting
LNC Technology Co., Ltd. 3
2 General M-Code Function Table
M Code Function Remark
M00 Program stop CNC
M01 Optional stop CNC
M02 End of program CNC
M03 Spindle CW
M04 Spindle CCW
M05 Spindle stop
M06 Auto tool change
M08 Coolant ON
LNC-MILL
G00 Rapid Positioning
M09 Coolant OFF
M19 Spindle Orientation
M20 Spindle Orientation Tuning
M28 Rigid tapping Cancellation
M29 Rigid tapping
M30 Program rewind CNC
M98 Calling of subprogram CNC
M99 End of subprogram CNC
LNC Technology Co., Ltd. 5
LNC-MILL
G00 Rapid Positioning
3 Command Syntax
G00 Rapid Positioning
Command Format
Argument Instruction
Action Instruction
G00 <axis><target site>;
zAxis
Specify the name of axis being shifted, and it can be any combination of X, Y,
Z, A, B, C or U, V, W. The only condition is that it must be consistent with the
setting of current axis (the 4th axis is set by using the parameter #0122). The
movement command for four-axis shift can be specified for each G00 single
block.
zTarget Site
Coordinate of the target point, which can be an absolute value or
incrementalal value in accordance with the status of G90 or G91.
The function of the G00 Command can be used to enforce the tool rapid
positioning to the specified coordinate.
When G00 is used, the movement speed can not be determined by the format of
F__, but it is determined by the setting values of parameters #1000~1003,
1122~1123. The knob for fast feedrate adjustment now can adjust the speed
percentage (F0, 25%, 50%, 100%).
For the G00 movement command, the movement between servo axes is
independent, and the movement speed for each axis can be set by each
parameter so that the operator should carefully concern this situation for the
avoidance of the collision of both the tool and the workpiece. In most case, the
tool axis (so-called Z-axis) should be drawn to the clearance height before
executing the G00 Command. Moreover, the activation of G00 Command can be
determined by the setting of the parameter #0041 as shown below. For more
information about the determination of the G00 simultaneous movement feedrate,
refer to the following table.
6LNC Technology Co., Ltd.
Program Sample
G90 G00 X20. Y10.;
LNC-MILL
G00 Rapid Positioning
Y
Current Position
Path for Continuous Movement
Path for Discontinuous
(0,0)
Determination of the G00 simultaneous movement feedrate
In MEM, MDI modes, the
Non-Dry-Run
Mechanism
Dry Run Mechanism
Parameter #0083 = 0
Movement
Coordinate(20,10)
G00 Command or action is
the same as that of the G00
Command
The movement speed of
each axis should not
exceed the G00 speed set
for each axis (Note 1)
The movement speed of
each axis should not
exceed the JOG speed set
for each axis (Note 2)
X
G00, G53 Commands for the
PMC axis function
The movement speed of
each axis should not exceed
the G00 speed set for each
axis
C23 is OFF : The movement
speed of each axis should
not exceed the JOG speed
set for each axis;
C23 is ON : The movement
speed of each axis should
not exceed the G00 speed
set for each axis
Dry Run Mechanism
Parameter #0083 = 1
The movement speed of
each axis should not
exceed the G00 speed set
for each axis
The movement speed of
each axis should not exceed
the G00 speed set for each
axis
Note 1: In this case, the override is based on the fast feedrate percentage.
Note 2: In this case, the override is based on the cutting feedrate percentage.
LNC Technology Co., Ltd. 7
LNC-MILL
G01 Linear Interpolation
G01 Linear Interpolation
Command Format
Argument Instruction
Action Instruction
G01 <axis><target site> F___;
zAxis
Specify the name of axis for cutting and it can be any combination of X, Y, Z, A,
B, C or U, V, W. The only condition is that it must be consistent with the setting
of current axis (the 4th axis is set by using the parameter #0122).
zTarget Site
Coordinate of the target point, which can be an absolute value or
incrementalal value in accordance with the status of G90 or G91.
zF__
Feedrate (unit: mm/min or inch/min). The default value is acquired from the
parameter #0149 if not specified.
The function of the G01 Command can be used to enforce the Tool linear cutting
moving to the position specified by the next Command from the current position
with the F feedrate set.
When G01 is cutting, the actual feedrate can be adjusted by using the continuous
feedrate adjustment knob at will (0%~150%). The highest cutting feedrate can be
set by using the parameter #1004, and the actual cutting speed is the setting
value of the parameter #1004 when the F value given by the maching program
exceeds the setting value set by he parameter.
8LNC Technology Co., Ltd.
Illustration
G90 G01 X200. Y100. F200.;(Absolute Value)
LNC-MILL
G01 Linear Interpolation
G91 G01 X200. Y100. F200.;(Incrementalal Value)
Y=100
Starting
Point
Y
Finishing Point
X=200
Starting Point X+200
Y
Y= Starting
Point
Finishing Point
Y+100
X
Starting
Point
X= Starting Point X+200
X
LNC Technology Co., Ltd. 9
LNC-MILL
G02, G03 Circular/Helical Interpolation CW/CCW
G02, G03 Circular/Helical Interpolation CW/CCW
Command Format
Argument Instruction
⎡
G17
⎢
⎣
⎡
G18
⎢
⎣
⎡
G19
⎢
⎣
G02
G03
G02
G03
G02
G03
R__
I__J__
R__
I__K__
R__
J__K__
⎤
F__;
⎥
⎦
⎤
F__;
⎥
⎦
⎤
F__;
⎥
⎦
⎤
⎥
⎦
⎤
⎥
⎦
⎤
⎥
⎦
⎡
X__Y__
⎢
⎣
⎡
X__Z__
⎢
⎣
⎡
Y__Z__
⎢
⎣
zX__, Y__, Z__
Coordinate of the target point, which can be an absolute value or
incrementalal value based on the status of G90 or G91.
zI__
The starting point away from the center point at the X axis which is an
incrementalal value when viewing from the start point to the center point.
zJ__
The starting point away from the center point at the Y axis which is an
incrementalal value when viewing from the start point to the center point.
zK__
The starting point away from the center point at the Z axis which is an
incrementalal value when viewing from the start point to the center point.
G02 and G03 are Commands for Circular/Helical Interpolation. Because the
workpiece is 3D, the Circular/Helical Interpolation direction on the different plane
is shown in the following diagram. The start-up default plane can be set by using
the parameter #0145。The processing command can use R to replace I, J, K
directly, wherein R is the radius of Circular/Helical. If R, I and J are written in the
program, the system will take the one specified by R as a base.
For G02 and G03 Commands, the system will check and determine whether the
distance from the starting point of Circular/Helical to the center point is the same
Illustration
Y
as the distance from the end point of Circular/Helical to the center point (each one
of them must be equal to the radius of the Circular/Helical). If the error between
them exceeds 5 μm, the system alarm will be enabled【When INT 3132 uses
G02/G03, the end coordinate is not on the Circular/Helical】
G02
G03
Circular/Helical in
G17
X-Y Plane
X
X
G02 G02
Z
G03 G03
Z Y
Circular/Helical in
Z-X Plane
G18
Circular/Helical in
Y-Z Plane
G19
LNC Technology Co., Ltd. 11
LNC-MILL
G04 Dwell
G04 Dwell
Command Format
Argument Instruction
Action Instruction
Program Sample
G04 X100.;------------------------------------------------------------------------------------ Stop time is 100 sec.
G04 X___;
G04 P___;
zX__
Setup the time-out in sec. Setting range: 0.001~99999.999.
zP__
Setup the time-out in ms, and the decimal timess are not allowed to be
entered as data. Setting range: 1~99999999.
Action of Dwell – The time-out can be set after G04, and the next section will be
continued and executed after the time-out is up.
G04 P100; -------------------------------------------------------------------------------------Stop time is 0.1 sec.
G04; -------------------------------------------------------------------------------Similar to the actual stop (G09)
12LNC Technology Co., Ltd.
G09 Correct Positioning
Command Format
LNC-MILL
G09 Correct Positioning
Argument Instruction
Program Sample
G01__
⎡
⎢
G09
G02__
⎢
⎢
G03__
⎣
⎤
⎥
;
⎥
⎥
⎦
G09 is a command that can accommodate to put off the tool. In the case of G09,
each time the system executes each positioning command, the confirmation of
positioning is needed to be taken, and the next block will be executed after
confirming that the conditions of the positioning meet the settings. If the cutting
positioning occurs between blocks when operating, the discontinuous situation
will exist because of the precision demand of the positioning point, so the speed
will be sacrificed. This method will lead to the higher precision, and the
positioning precision can be set by using the parameters #0006~0009. The
function of G09 can only be functioned in single block pertaining to G09, and then
go back to the original status.
Tool Path under the incorrect positioning situation
LNC Technology Co., Ltd. 13
LNC-MILL
G10 Data Input Setting
G10 Data Input Setting
Command Format 1
Command Format 2
Argument Instruction
G10 P 1~30
G10 P 154~159
Function 1 : Set up the tool compensation value.
R__ Z__;
<axis><target site>;
zP__
Tool compensation value. Setting range: 1~30.
zR__
Tool radius compensation value.
zZ___
Tool length compensation value.
Function 2 : Setup the machine coordinate of the origin in the G54~G59
coordinate system.
zP__
Coordinate system. Setting range:154~159 which are corresponding to
G54~G59.
zAxis
Specify the name of axis being set. It can be any combination of X, Y, Z, A, B,
C or U, V, W. The only condition is that it must be consistent with the setting of
current axis (the 4
th
axis is set by using the parameter #0122).
zTarget Site
Machine coordinate of the target point.
14LNC Technology Co., Ltd.
Action Instruction
Program Sample
G10P1R6.Z10;Set the radius offset value of the first Tool to 6, and the offset value of the length to
10, respectively.
G10P154X50;Set the mechane coordinate of the origin of X axis in G54 coordinate system to 50.
LNC-MILL
G10 Data Input Setting
For the compensation of tool and G54~G59 coordinate system, MDI input will be
taken in most case, but the G10 command can be set in maching program, and it
must be set before using these tool compensation value or G54~G59 coordinate
system so that the setting values can be activated in the maching program later.
LNC Technology Co., Ltd. 15
LNC-MILL
G15 Polar Coordinate Command Cancel
G15 Polar Coordinate Command Cancel
G16 Polar Coordinate Command
Command Format
Argument Instruction
G17 G16 X___ Y___;
G18 G16 Z___ X___;
G19 G16 Y___ Z___;
zX__ Y__
In G17 plane, X__ specifies the radius of the polar coordinate, while Y__
specifies the angle of the polar coordinate.
zZ__ X__
In G18 plane, Z__ specifies the radius of the polar coordinate, while X__
specifies the angle of the polar coordinate.
zY__ Z__
In G19 plane, Y__ specifies the radius of the polar coordinate, while Z__
specifies the angle of the polar coordinate.
Action Instruction
The angle can be executed by using the incrementalal or absolute command.
As shown below, the target point of cutting path can be specified by using G16 in
polar coordinate system.
16LNC Technology Co., Ltd.
Illustration
LNC-MILL
G16 Polar Coordinate Command
G17 G90(Absolute)
Command position
X
Current position
G17 G91(Incremental)
Command position
Y
X
Current position
Y
X: radius Y: angle
X: radius Y: angle
LNC Technology Co., Ltd. 17
LNC-MILL
G17, G18, G19 Cutting Plane Setting
G17, G18, G19 Cutting Plane Setting
Command Format
Argument Instruction
G17; (XY Plane)
G18; (ZX Plane)
G19; (YZ Plane)
When using the Circular/Helical Command or the tool radius compensation
command, the cutting plane must be set at first in order to ensure the correctness
of the system computing.
The start-up default processing plane can be set by using parameter #0145.
18LNC Technology Co., Ltd.
G20, G21 Conversion Between Metric System and British System
G20, G21 Conversion Between Metric System and British System
Command Format
LNC-MILL
Argument Instruction
G20;
G21;
zG20
British system unit setting (inch unit), and the minimum value is 0.0001 inch
zG21
Metric system unit setting (mm unit), and the minimum value is 0.001 mm
This command should be independently used, and should not coexist with other
commands in the same single block. Meanwhile, this command must be set in the
header of the program, i.e. before setting the coordinate system.
The following items must be considered when converting unit:
(1)The coordinate of workpiece should be reverted to basic system.
(2)The tool offset should be cancelled.
(3)The related parameters used in the system must be modified at the same
time, and compliant to the unit set.
LNC Technology Co., Ltd. 19
LNC-MILL
G22, G23 Tool Stored Stroke Check
G22, G23 Tool Stored Stroke Check
Command Format
Argument Instruction
Action Instruction
G22 X___ Y___ Z___ I___ J___ K___;
G23;
zX___ Y___ Z___and I___ J__ _ K___
Designate the range of stroke as the machine coordinate. Please refer to the
reference diagram.
G23 is used to cancel the tool-stored stroke check.
G22 should be executed after manually zero point return; The tool should not
enter the prohibited stroke zone specified by G22 after the setting; otherwise the
system alarm will be triggered :
【MOT 9009 X-axis exceeds the positive stroke limit of G22】
【MOT 9010 X-axis exceeds the negative stroke limit of G22】
【MOT 9011 Y-axis exceeds the positive stroke limit of G22】
【MOT 9012 Y-axis exceeds the negative stroke limit of G22】
【MOT 9013 Z-axis exceeds the positive stroke limit of G22】
【MOT 9014 Z-axis exceeds the negative stroke limit of G22】
In the manual mode, the alarm can be disabled if user moves the servo axis in
the reverse direction; In the auto mode, the system alarm can be triggered in
addition to the alarm mentioned above【MOT 4058 exceeds the software
stroke limit】, and the function of NC is disabled, so user needs to press the
RESET key to cease the alarm status.
The prohibited zone specified by G22 can be set by system parameter #0071 to
determine whether it’s an internal prohibited zone or an external prohibited zone
that.
20LNC Technology Co., Ltd.
(X,Y,Z)
Illustration
LNC-MILL
G22, G23 Tool Stored Stroke Check
(I,J,K)
(X,Y,Z)
Prohibited zone
of internal stroke
(I,J,K)
Prohibited zone of
external stroke
Parameter #0071=1 Parameter #0071=0
LNC Technology Co., Ltd. 21
LNC-MILL
G27 Return to Origin Check
G27 Return to Origin Check
Command Format
Argument Instruction
zAxis
Specify the name of axis being reverted to the origin. It can be any
combination of X, Y, Z, A, B, C or U, V, W. The only condition is that it must be
consistent with the setting of current axis (the fourth axis is set by using the
parameter #0122). On the six-axes model M600, parameters #0288 & #0289
are used to control the 5
zTarget Site
Coordinate of the target point, which can be an absolute value or
G27 <axis><target site>;
th
& 6th axes.
Action Instruction
incrementalal value in accordance with the status of G90 or G91.
When the program completes an operation cycle and reaches the finishing point
or goes back to starting point, G27 can be used to execute the check of “Return
to origin” in order to ensure the correctness of current actual location. After the
execution of the specified stroke is completed, G27 command will check the
current position and determine whether it reaches the mechanical origin (First
reference point); if it stops at the origin after execution, the indicator light for origin
point will alight, and next single block will be run; if it does not stop at the origin,
the system alarm will be triggered【MOT 4046 “Return to origin” failed】.
When the argument X___ is specified, the Return and check could be prosecuted
at the X-axis; if not specified, the Return and check should not be prosecuted at
the X-axis, and the truth can be similarly applied to other axes.
We suggest that all Tool Compensations should be canceled before executing
G27 for the avoidance of misjudgment.
Specify the name of axis being reverted to the first reference point. It can be
any combination of X, Y, Z, A, B, C or U, V, W. The only condition is that it
must be consistent with the setting of current axis (the 4
th
axis is set by using
the parameter #0122). On the six-axes model M600, parameters #0288 &
#0289 are used to control the 5
th
& 6th axes.
zCenter point Position
Coordinate of the center point, which can be an absolute value or
incrementalal value in accordance with the status of G90 or G91.
The system will preserve the coordinate of the center point specified by G28 for
the further use of G29.
In maching program, the tool can be reverted to the first reference point (machine
origin) after G28 Command is used to control the tool to pass through the center
point set previously. Before executing G28, the “manual return to origin”
procedure must be prosecuted first, otherwise the system alarm will be triggered
【“return to origin” is not yet prosecuted after the MOT 4018 is enabled】。
When the argument X___ is not specified, return to the first reference point will
not be prosecuted at the X-axis; and on other axes as well. If no argument of any
axis is specified, return to the first reference point will be prosecuted at all axes.
Note that the preciously specified tool length compensation value will be
cancelled automatically after the execution of G28.
24LNC Technology Co., Ltd.
Illustration
LNC-MILL
G28 Return to the First Reference Point
G90 G28 X100. Y80.; G91 G28 X0. Y0.;(No center point)
Y
Starting point
Machine origin
(50,50)
Center point
(100,80)
X
Y
Machine origin
Starting point
(50,50)
X
LNC Technology Co., Ltd. 25
LNC-MILL
G29 Return from the First Reference Point
G29 Return from the First Reference Point
Command Format
Argument Instruction
Action Instruction
G29 <axis><target site>;
zAxis
Specify the name of axis being reverted to the first reference point. It can be
any combination of X, Y, Z, A, B, C or U, V, W. The only condition is that it
must be consistent with the setting of current axis (the 4
th
axis is set by using
the parameter #0122). On the six-axes model M600, parameters #0288 &
#0289 are used to control the 5
th
& 6th axes.
zTarget Site
Coordinate of the target point, which can be an absolute value or
incrementalal value in accordance with the status of G90 or G91.
The G29 Command is only used after G28. The tool will stop at the first reference
point after G28 is executed; and now G29 can be used to control that the tool to
G30 Auto Return to the 2nd, 3rd and 4th Reference Points
G30 Auto Return to the 2nd, 3rd and 4th Reference Points
Command Format
⎤
⎡
⎥
⎢
⎥
⎢
⎥
⎢
⎦
⎣
Argument Instruction
zP__
Specify the reference point. Setting range: 2~4, corresponding to the 2nd~4
reference points.
zAxis
Specify the name of axis being reverted to the reference points. It can be any
combination of X, Y, Z, A, B, C or U, V, W. The only condition is that it must be
consistent with the setting of current axis (the 4
;Locationpoint Center Axis 432 P G30>><<
th
axis is set by using the
th
Action Instruction
parameter #0122). On the six-axes model M600, parameters #0288 & #0289
are used to control the 5
th
& 6th axes.
zCenter point Location
Coordinate of the center point can be an absolute value or incrementalal value
in accordance with the status of G90 or G91.
This command is used to return to 2
revert to 2
nd
, 3rd, 4th reference points through the center point from the current
position.
The offset of 2
nd
reference point and the machine origin can be set by using
parameters #1022~1025; the offset of 3
can be set by using parameters #1026~1029; and the offset of 4th reference point
and the machine origin can be set by using parameters #1030~1033.
Before executing G30, the “manually return to origin” procedure must be
executed at first, otherwise the system alarm will be triggered【MOT 4018:
Returning to origin is not yet executed after boot】.
When the argument X___ is not specified, return to origin will not be executed on
nd
, 3rd, 4th reference points, and the tool will
rd
reference point and the machine origin
X-axis; so will be it on other axes as well. If no argument of any axis is specified,
the “Return to reference point” procedure will be executed at all axes.
Note that the previously specified Tool Compensation value will be cancelled
automatically after G30 is executed.
28LNC Technology Co., Ltd.
Illustration
LNC-MILL
G30 Auto Return to the 2nd, 3rd and 4th Reference Points
Specify the name of axis being set. It can be any combination of X, Y, Z, A, B,
C or U, V, W. The only condition is that it must be consistent with the setting of
current axis (the 4
model M600, parameters #0288 & #0289 are used to control the 5
th
axis is set by using the parameter #0122). On the six-axes
th
& 6th axes.
zTarget Site
Coordinate of the target point, which can be an absolute value or
incrementalal value in accordance with the status of G90 or G91.
zF__
Feedrate, which is only effective in this single block. If is not set, the setting
value of parameter #1042 is used for the feedrate of this single block.
Action Instruction
The function of this command is the same as G01, and if the Skip signal is
triggered during execution, this single block will be terminated immediately, and
the next single block will be run.
The absolute coordinate will be set in variables $260~$263 of the macro program
when G31 Skip signal is triggered (X-axis, Y-axis, Z-axis and the 4th axis in order),
while the machine coordinate will be set in system variables $270~$273 of the
macro program (X-axis, Y-axis, Z-axis and 4
th
axis in order). Before G31 Skip
signal is triggered, system variables $260~$263 (absolute coordinate),
$270~$273 (machine coordinate) of macro program are the coordinate of target
point of G31 command.
30LNC Technology Co., Ltd.
y
Illustration
LNC-MILL
G31 Skip Signal Abort Block
+Y
Skip single
triggering
Starting Point
issued by G31
Target point
issued by G31
Program Path
Actual Path
+X
+Y
Skip single
triggering
Starting Point
issued b
Target point
issued by G31
G31
Program Path
Actual Path
+X
LNC Technology Co., Ltd. 31
LNC-MILL
G31 Skip Signal Abort Block
Relevant parameter
1. Parameter #0073 : Operation Type, whether to decelerate or stop after
receiving G31 Skip signal
2. Parameter #0176 : Operation Type, G31 Skip signal is for Local Input
contact.
3. Parameter #0177 : Operation Type, G31 Skip signal can be normally close
(NC) or normally open (NO).
4. Parameter #1042 : Servo Type, the default feedrate of G31 block. unit:
um/min.
32LNC Technology Co., Ltd.
G41, G42 Tool Radius Compensation
Command Format
LNC-MILL
G41, G42 Tool Radius Compensation
Argument Instruction
G17
⎤
⎡
⎢
⎢
⎢
⎣
G40;
G18
G19
G41
⎤
⎡
⎥
⎥
⎥
⎦
⎢
⎣
G42
D__;
⎥
⎦
zG40
Tool radius compensation can cel.
zG41
Tool radius compensation left.
zG42
Tool radius compensation right.
zD__
Tool Compensation times. Setting range: 1~30
Action Instruction
The single block for the start and the cancellation of tool Compensation must be a
linear command (G00 or G01), circular/helical command (G02 or G03) is not
allowed.
The type of Tool Compensation could be Type A and Type B, which could be set
by parameter #0131.
LNC Technology Co., Ltd. 33
LNC-MILL
G41, G42 Tool Radius Compensation
Illustration
G41 : The tool has an offset of an amount of the
radius to the left when facing to the direction of
tool movement.
G42 : The tool has an offset of an amount of the
radius to the right when facing to the direction of
the tool movement.
34LNC Technology Co., Ltd.
Program Path
LNC-MILL
G41, G42 Tool Radius Compensation
Work piece
TYPE A
Actual
toWHILE
[….] DO 1;
ol path
Program Path
Actual tool path
Program Path
Work piece
Work piece
Actual tool path
TYPE B
Work piece
Program Path
Actual tool path
LNC Technology Co., Ltd. 35
LNC-MILL
G43, G44, G49 Tool Length Compensation
G43, G44, G49 Tool Length Compensation
Command Format
Argument Instruction
G43H
G44H ;
G49;
zG43
A command for Tool Compensation in positive direction. If the compensation
value is positive, the tool axis will be moved in the positive direction.
zG44
A command for Tool Compensation in negative direction. If the compensation
;
Program Sample
value is positive, the tool axis will be moved in the negative direction.
zG49
Tool length compensation cancel.
zH__
Tool length compensation. Setting range: 1~99, and the compensation value
for H0 is always set to 0.
H1 : 20.0mm, H2 : 30.0mm
Program Command Absolute CoordinateMachine Coordinate
…
G00Z0.;
G43H1;
Z50.;
0. 0.
-20. 0.
50. 70.
G43H2;
Z50.;
G49;
…
36LNC Technology Co., Ltd.
40. 70.
50. 80.
80. 80.
LNC-MILL
G43, G44, G49 Tool Length Compensation
H1 : 20.0mm, H2 : 30.0mm
Program Command Absolute CoordinateMachine Coordinate
…
G00Z0.; 0. 0.
G44H1; 20. 0.
Z50.; 50. 30.
G44H2; 60. 30.
Z50.; 50. 20.
G49; 20. 20.
…
LNC Technology Co., Ltd. 37
LNC-MILL
G43, G44, G49 Tool Length Compensation
Note:
1.G53, G28 and G30 in Tool Compensation Process
When processing Tool Compensation, G53, G28 and G30 Commands make NC to cancel
Tool Compensation value automatically, and convert to the statu s o f G49.
H1 : 20.0mm
Program Command Absolute CoordinateMachine Coordinate
…
G00Z0.; 0. 0.
G43H1; -20. 0.
G00Z50.; 50. 70.
G91G28Z0.; 0. 0.
G00Z50.; 50. 50.
…
2. M30, M02 in Tool Compensation Process
When processing Tool Compensation, M30 and M02 End of Program Commands make NC
to cancel Tool Compensation value automatically, an d convert to the status of G49.
3. RESET in the Tool Compensation Process
When processing Tool Compensation, RESET signal will make NC to cancel the Tool
Compensation value automatically, and convert to the status of G49.
38LNC Technology Co., Ltd.
G50, G51 Scaling Command
Command Format
Argument Instruction
z G51
z G50
z X__ Y__ Z__
P__
⎡
Z__Y__ X__ G51
⎢
I__J__K__
⎣
G50;
Scaling Enable.
Scaling Cancel.
Coordinates of the scaling center point.
LNC-MILL
G50, G51 Scaling Command
⎤
;
⎥
⎦
Action Instruction
zP__
Multiple, no decimal timess, and the unit is the multiple of 0.001. Setting range:
1~99999 (corresponding to the multiple of 0.001~99.999, and the multiple is 1
when set to 1000). Same condition as on each axis.
zI__ J__ K__
Multiple of scaling for each axis, which can be set by using parameters
#1092~1094.
The scaling processing uses P___or I___ J___ K___ which can be determined by
parameter #0143. The activation of scaling function for each axis can be set by
parameters #0136~0138.
LNC Technology Co., Ltd. 39
LNC-MILL
G50, G51 Scaling Command
Illustration
G90 G51 X40. Y30. P2000.
Y
Path after twofold magnification
Original Program Path
(40,30)
X
40LNC Technology Co., Ltd.
G52 Interval Coordinate System Setting
Command Format
LNC-MILL
G52 Interval Coordinate System Setting
Argument Instruction
Action Instruction
Illustration
G52 <axis><origin of interval coordinate system
zAxis
Specify the origin of interval coordinate system for the working coordinate
system (G54~G59) of an axis. It can be any combination of X, Y, Z, A, B, C or
U, V, W. The only condition is that it must be consistent with the setting of
current axis (the 4
M600, parameters #0288 & #0289 are used to control the 5
An interval coordinate system can be set in all manufacturing coordinate systems
(G54~G59) by using G52 Command. Sometimes this makes program coding
more convenient. After G52 is set, movement commands are aiming towards the
interval coordinate system set by G52 under absolute mode (G90).
th
axis is set by parameter #0122). On the six-axes model
There are two methods to cancel the interval coordinate system set by G52. The first method is to
run “manually return to origin” procedure (and parameter #0133 is set to 1); the second method is to
run G52 command aincremental, but the argument being used must be the negative value of the
argument used by G52 command at the last time.
G53 Rapid Positioning of Machine Coordinate System
G53 Rapid Positioning of Machine Coordinate System
Command Format
LNC-MILL
Argument Instruction
Action Instruction
G53 <axis><target site>;
zAxis
Specify the name of axis being moved. It can be any combination of X, Y, Z, A,
B, C or U, V, W. The only condition is that it must be consistent with the setting
of current axis (the 4
six-axes model M600, parameters #0288 & #0289 are used to control the 5
th
6
axes.
th
axis is set by using the parameter #0122). On the
th
&
zTarget Site
Machine coordinate of the target point.
G53 Command can be used to control and move the tool to the specified machine
coordinate. Regarding G53 Command, the tool’s move methoid is rapid feeding,
and the speed can be set by parameters #1000~1003, 1122~1123. Generally
G53 Command belongs to “non simultaneous movement”. If simultaneous
movement is needed, it can be set by parameter #0041. Moreover, G53
Command is effective in single block only, and it can only be used under absolute
mode (G90), it will become ineffecitve under incremental mode (G91).
Note that the previously specified Tool Compensation value will be cancelled
automatically after the execution of G53.
LNC Technology Co., Ltd. 43
LNC-MILL
G54~G59 Manufacturing Coordinate System Selection
G54~G59 Manufacturing Coordinate System Selection
Command Format
Action Instruction
G54;
⎤
⎡
⎥
⎢
G55;
⎥
⎢
⎥
⎢
G56;
⎥
⎢
G57;
⎥
⎢
⎥
⎢
G58;
⎥
⎢
G59;
⎥
⎢
⎦
⎣
Six G codes (G54 to G59) applied in the workpiece coordinate system represent
six different coordinate system which can be used in accordance with
manufacturing needs.
The origin offset of each coordinate system can be set through〈OFFSET〉Æ〈coordinate system setting〉; For more information, refer to the operation manual;
Moreover, it can also be set by G10 Command, for more information about this
refer to G10 Command instruction.
The relationship among each coordinate system is shown as follows: : (The
G54
G54 Offset
00 Offset
Zero point
default coordinate system is G54 after the system is boot.)
G55
G55 Offset
G56
G56 Offset
G57 Offset
00 Work coordinate
G58 Offset
G59 Offset
G59
G57
G58
44LNC Technology Co., Ltd.
Program Sample
G90 G54 G00 X100. Y100.;
G55 X100. Y100.;(AÆB)
LNC-MILL
G54~G59 Manufacturing Coordinate System Selection
Y
A(100,100)
100
G54
00 Coordinate system
100
X
100
Y
B(100,100)
X
G55
100
LNC Technology Co., Ltd. 45
LNC-MILL
G61, G64 Exact Positioning Mode, General Cutting Mode
G61, G64 Exact Positioning Mode, General Cutting Mode
Command Format
G61;
Argument Instruction
Action Instruction
G64;
zG61
Exact positioning mode
zG61
General cutting mode.
The function of G61 is the same as that of G09, but the effectiveness of G09 is
limited to one block, and the effectiveness of G61 is valid still after a declaration,
until G64 (general cutting) is declared. G64 is the default mode of the system,
and the G64 mode stays effective unless G61 is declared.
For cutting commands (G01/G02/G03), the positioning precision of each axis can
be set by using parameters #0006~0009, 0252~0253; For rapid positioning (G00),
the positioning precision of each axis is set by using parameters #0800~0830,
0268~0269. Furthermore, the activation for the correct positioning function of
each axis can be enabled or disabled by using parameter #0043.
Tool path under G61 mode
Tool path under G64 mode
46LNC Technology Co., Ltd.
G65 Simple Call
Command Format
LNC-MILL
G65 Simple Call
Argument Instruction
In addition to arguments P and L, more NC addresses (English alphabets excluding G, L, N, O, P)
can be used to induct arguments, no limit of sequential order, and these arguments are
corresponding to the local variables used in the macro program. The comparison charts are shown
as follows:
G65 P__ L__ <arguments…>;
zP__
The macro program number being called (Macro program name without four
digits after ”O”). The system alarm will be enabled if there’s no input. [INT 3111:
no called program name (no input of P address)].
zL__
Times of iteration. The default setting value is 1 if no specific input.
NC
Address
A #1 I #9 T #20
B #2 J #10 U #21
C #3 K #11 V #22
D #4 M #13 W #23
E #5 Q #17 X #24
F #6 R #18 Y #25
H #8 S #19 Z #26
Local
Variable
NC
Address
Local
Variable
NC
Address
Local
Variable
LNC Technology Co., Ltd. 47
LNC-MILL
G65 Simple Call
O0001;
.
.
G65 P0008 L1 A2.0 B 3.0;
.
.
M30;
#1==3.0
O0008;
#3=#1+#2;
G00 X#3;(similar to G00 X5.0;)
M99;
48LNC Technology Co., Ltd.
LNC-MILL
G65 Simple Call
In G65 blocks, G65 must be written before all arguments. The nest type call can be done towards
G65, and up to four levels are available for the combination of G65 and G66 (The main program is
not included, and the main program is level 0), and each level has its own local variables as shown
below :
Main
Program
(Level 0)
O0001;
..
#1=2.0
..
#1=1;
G65 P0002 A2.0;
..
..
M30;
Local
Variables
(Level 0)
1 2 3 4 5
#1
Macro
Program
(Level 1)
O0002;
..
#1=3.0
..
..
G65 P0003 A3.0;
..
..
M99;
Local
Variables
(Level 1)
#1
Macro
Program
(Level 2)
O0003;
..
#1=4.0
..
..
G65 P0004 A4.0;
..
..
M99;
Local
Variables
(Level 2)
#1
Macro
Program
(Level 3)
O0004;
..
#1=5.0
..
..
G65 P0005 A5.0;
..
..
M99;
Local
Variables
(Level 3)
#1
Macro
Program
(Level 4)
O0005;
..
..
..
..
..
..
M99;
Local
Variables
(Level 4)
#1
#33
..
..
..
..
#33
..
..
..
..
#33
..
..
..
..
#33
..
..
..
..
#33
..
..
..
..
LNC Technology Co., Ltd. 49
LNC-MILL
G66 Macro Program Mode Call
G66 Macro Program Mode Call
Command Format
Argument Instruction
G66 P__ L__ <arguments…>;
zP__
The macro program times to be called (Macro program name excluding the 4
digits after “O”). The system alarm will be triggered if no input available. [INT
3111: no called program name (no input of P address)].
zL__
Times of iteration. The default setting value is 1 if no input.
In addition to arguments P and L mentioned above, more NC addresses
(English alphabets excluding G, L, N, O, P) can be used to induct arguments
without any previously defined order, and these arguments are corresponding
to the local variables used in the macro program. Refer to the comparison
charts listed in G65.
Action Instruction
The difference between G66 and G65 is that the latter only calls macro program for once, but the
macro programs called by G66 will be called aincremental after each movement block is completed
until the calling mode is cancelled by G67.
O0001;
.
.
G66 P0008 L1 A 2.0
B3.0;
G91 G00 Y10.;
Y10.;
Y10.;
G67;
Y10.;
After Move,Execution O0008
After Move,Execution O0008
After Move,Execution O0008
Execution O0008
Go O0001
O0008;
#3=#1+#2;
G91 G00 Z#3;
Z-#3;
M99;
50LNC Technology Co., Ltd.
LNC-MILL
G66 Macro Program Mode Call
In G66 blocks, G66 must be written before all arguments. Like G65, the nest type call could be done
by G66, and up to 4 levels are available for the combination of G66 and G65, (The main program is
not included, and the main program is level 0), but the G66 arguments (corresponding to local
variables of macro program) can only be set for once in G66 block, and then the mode calling will
not be reset aincremental.
LNC Technology Co., Ltd. 51
LNC-MILL
G67 Macro Program Mode Call Cancel
G67 Macro Program Mode Call Cancel
Command Format
Action Instruction
G67;
G67 is used to cancel the function of G66 macro program mode call.
52LNC Technology Co., Ltd.
G68, G69 Coordinate System Rotation
Command Format
LNC-MILL
G68, G69 Coordinate System Rotation
Argument Instruction
G69;
Y__ X__ G17
⎡
⎢
G68
⎢
⎢
⎣
⎤
⎥
R__;
X__ Z__G18
⎥
⎥
Z__Y__ G19
⎦
zX__Y__
Specify the rotation center coordinate in the G17 plane.
zZ__X__
Specify the rotation center coordinate in the G18 plane.
zY__Z__
Specify the rotation center coordinate in the G19 plane.
If the rotation center is not specified, the current position of G68 will be the
rotation center.
zR__
Rotation angle, positive value denotes a counter-clockwise rotation. The input
unit of this argument is determined by parameter #0130. If the setting value of
parameter #0130 is 1, the input unit of this argument is degree; If the setting
value of parameter #0130 is 0, the input unit of this argument is 0.001 degree.
If argument R__ is not specified, the default value can be derived from
parameter #1091; parameter #0142 can be used to determined whether the
rotation angle is an absolute value or an incremental value.
Coordinate of R point (i.e. retraction point) (mm).
zQ__
Cutting feedrate per time (mm), always a positive value.
zK__
Iteration times
zF __
Feedrate (G94 mm/min) (G95 mm/rev).
The Z-axis manufacturing retraction volume is set by parameter #0150. The
input value is a minimum unit, and the decimal timess are not allowed.
Action Instruction (Taking G17 plane for example)
1. Fast position to the hole position (X, Y, yet maintain the original tool height);
2. Fast position to the coordinate of R point (R);
3. Peck drill with specified cutting feedrate and spindle speed, the feed is (Q)
4. Fast return, and the retraction amount is determined by parameter #0150.
5. Peck drill with specified cutting feedrate and spindle speed, the feed is
“peck drilling feed + peck drilling retraction amount)
6. Fast return, and the retraction amount is determined by parameter #0150.
7. Repeat steps 5~6 until the hole bottom is cut
8. In G98 mode, fast return to the starting point; In G99 mode, fast return to the
R point;
9. If K is to be specified ( > 1), repeat steps 2~6 until reaching specified drilling
times, otherwise procedure ends;
56LNC Technology Co., Ltd.
LNC-MILL
G73 Rapid Peck Drilling Cycle
10. In G91 mode, argument R specifies the distance between R point and the
starting point; argument Z specifies the distance between the hole bottom
and R point; if K is specified ( > 1), repeat steps 2~8, between each iteration
make a location offset according to previously specified X, Y, and continue
to drill.
11. The difference between G73 and G83 is that G73’s retraction amount is
determined by parameter #0150, and the later one should return to R point
everytime.
Coordinate of R point (i.e. retraction point) (mm).
zP__
Dwell time in the hole bottom (1/1000), minimum unit, decimal timess are not
allowed.
zK__
Times of iteration.
zF__
Cutting feedrate (G94 mm/min) (G95 mm/rev).
If add M29 command before G74, it will become left-handed thread rigid tapping.
Action Instruction (taking G17 plane for example)
1. Fast position to the hole position (X, Y, yet maintain the original tool height);
2. Fast position to the coordinate of R point (R);
3. Tapping begins, and spindle rotates counter-clockwisely;
4. Cut to the hole bottom position (Z) with specified cutting feedrate and
spindle speed
5. Stop the spin dle; if P is specified,dwell at the hole bottom for specified time;
6. Spindle rotates clockwisely, cut to R point with specified cutting feedrate and
spindle speed
7. Tapping ends, spindle stops; if P is specified, dwell at R point for specified
time.
8. In G98 mode, fast return to the starting point; In G99 mode, fast return to R
point;
9. If K is specified ( > 1), repeat steps 2~8 until reach specified tapping
iteration times; otherwise procedure ends;
LNC Technology Co., Ltd. 65
LNC-MILL
G74 Left-Handed Screw Thread Tapping Cycle
10. In G91 mode, argument R is to specified the distance between R point and
the starting point; argument Z specifies the distance between hole bottom
position and R point; if K is specified ( > 1), repeat steps 2~8, between each
iteration make a location offset according to previously specified X, Y, and
continue tapping.
11. In G94 mode, the cutting feedrate F = rotating speed (S) × pitch of screw
thread (PITCH); In G95 mode, the cutting feedrate F = pitch of screw thread
(PITCH).
Coordinate of R point (i.e. retraction point) (mm).
zQ__
Offset of hole bottom (mm), and the migration direction is set by system
parameter #0121.
zK__
Times of iterations.
zF__
Feedrate (G94 mm/min) (G95 mm/rev).
Action Instruction (taking G17 plane for example)
1. Fast position to the hole position (X, Y, yet maintain the original height of
tool);
2. Fast position to the coordinate of R point (R);
3. Cut to the hole bottom position (Z) with specified cutting feedrate and
rotation speed of spindle;
4. If P is specified, dwell at the hole bottom position for specified time;
5. Spindle stops, execute M19 to do spindle positioning;
6. Tool migrates, the migration distance is set by argument Q, and the
migration direction is set by parameter #0121;
74LNC Technology Co., Ltd.
LNC-MILL
G76 Fine Boring Cycle
7. In G98 mode, fast return to the starting point; In G99 mode, fast return to the
coordinate of R point;
8. Tool migrates, return to the original hole coordinate (reverse actions of step
6);
9. Disable spindle positioning mode, and the spindle rotates;
10. If K is specified ( > 1) , repeat steps 2~9 until obtaining specified times of
boring cycle; otherwise procedure ends;
11. In G91 mode, argument R is to specified the distance between R point and
the starting point; argument Z specifies the distance between hole bottom
position and R point; if K is specified ( > 1), after each boring procedure
(steps 2~9), the hole position will have a incremental offset according to
specified X, Y, and then continues boring process.
Coordinate of R point (i.e. retraction point) (mm).
zK__
Times of iteration.
zF__
Feedrate (G94 mm/min) (G95 mm/rev).
Action Instruction (taking G17 plane for example)
1. Fast position to hole position (X, Y, yet maintain the original height of tool);
2. Fast position to the coordinate of R point (R);
3. Cut to the hole bottom position (Z) with specified cutting feedrate and
spindle speed;
4. In G98 mode, fast return to the starting point; In G99 mode, fast return to R
point;
5. If K is specified ( > 1) , repeat steps 2~4 until reach specified drilling iteration
times; otherwise procedure ends;
6. In G91 mode, argument R specifies the distance between R point and the
starting point; argument Z specifies the distance between hole bottom
position and R point; if K is specified ( > 1), after each drilling process (steps
2~5), the hole position will migrate according to specified X, Y and then
continue next drilling process.
84LNC Technology Co., Ltd.
Illustration
LNC-MILL
G81 Drilling Cycle
7. The difference between G81 and G82 is that the latter can specify the dwell
time at hole bottom.
Coordinate of R point (i.e. retraction point) (mm).
zP__
Pause time of the hole bottom (1/1000 sec), minimum unit, decimal timess are
not allowed.
zK__
Times of iteration.
zF__
Cutting feedrate (G94 mm/min) (G95 mm/rev)
Action Instruction (taking G17 plane for example)
1. Fast position to hole position (X, Y, yet maintain the original tool height);
2. Fast position to the coordinate of R point (R);
3. Cut to the hole bottom position (Z) with specified cutting feedrate and
rotation speed of spindle;
4. If P is specified,dwell at the hole bottom for specified time;
92LNC Technology Co., Ltd.
LNC-MILL
G82 Drilling Cycle
5. In 98 mode, fast return to the starting point; In G99 mode, fast return to R
point;
6. If K is specified ( > 1), repeat steps 2~5 until reach specified drilling iteration
times; otherwise procedure ends;
7. In G91 mode, argument R specifies the distance between R point and the
starting point; argument Z specifies the distance between hole bottom
position and the R point; If K is specified ( > 1), after each drilling process
(steps 2~5) the hole will migrate according to specified X, Y and then
continues next drilling process.
8. The difference between G81 and G82 is that the latter can specify the dwell