1. The meaning of the letters in the NC program
O: program number, set the program number
N: block number, set the program sequence number
G: Preparation function
X/Y/Z: size characters, axis movement instructions
A/B/C/U/V/W: additional axis movement command
R: arc radius
I/J/K: arc center coordinates (vector)
F: Feed, set the feed rate
S: spindle speed, set the spindle speed
T: tool function, set the tool number
M: Auxiliary function, on/off control function
H/D: tool offset number, set the tool offset number
P/X: Delay, set delay time
P: Program number command, set subprogram number (such as subroutine call: M98P1000)
L: Repeat, set the number of subroutines or fixed cycle repetitions (eg M98 P1000 L2, omitting L for L1)
P/W/R/Q: parameters, parameters used in the fixed cycle (eg: tapping G98/(G99)G84 X_ Y_ R_ Z_ P_ F_)
2. Common G code interpretation
G00: Positioning or fast moving
G01: Linear interpolation
G02: circular interpolation / helical interpolation CW
G03: Circular interpolation / spiral interpolation CCW
G04: dwell time or delay time
Such as: G04 X1000 (or G04 X1.0)
G04 P1000 means stay for 1 second
G09: Stop accurately or stop the inspection accurately (check if it is within the target range)
G10: Programmable data input
G17: Select XPYP plane XP: X axis or its parallel axis
G18: Select ZPXP plane YP: Y axis or its parallel axis
G19: Select YPZP plane ZP: Z axis or its parallel axis
G20: inch input
G21: mm input
G28: Return to reference point detection
Format: G91/(G90) G28 X__ Y__ Z__
Return to the reference point via the intermediate point X__ Y__ Z__ (absolute value / incremental value command)
G29: Return from the reference point
G91/(G90) G29 X__ Y__ Z__
An instruction to return to the target point X__ Y__ Z__ from the starting point through the reference point (absolute value/incremental value command)
G30 returns to the 2nd, 3rd, 4th reference point
G91/(G90) G30 P2 X__ Y__ Z__; return to the 2nd reference point
G91/(G90) G30 P3 X__ Y__ Z__; return to the 3rd reference point
G91/(G90) G30 P4 X__ Y__ Z__; return to the 4th reference point
X__ Y__ Z__: After the intermediate point position (absolute value / incremental value command)
G40: Tool radius compensation canceled
G41: Left tool radius compensation (tool is on the left along the feed direction)
G42: Right tool radius compensation (tool is on the right along the feed direction)
G43: Tool length compensation + direction
G44: Tool length compensation - direction
G49: Cancel tool length compensation
G50: Unscaled
G51: Scaling, format:
ON G51 X_ Y_ Z_ P_;
OFF G50
X_ Y_ Z_: Set the zoom center position
P: scaling, the range is 1-999999, can not be a decimal, if P800 represents a scaling of 0.8
G52: Setting the local coordinate system
G53: Select machine coordinate system
G54-G59: Select workpiece coordinate system 1-6
G60: Single direction positioning, eliminating the transmission gap (instead of G00), passing the target position and then returning to the target position
G61: Quasi-stop check mode, decelerate when the cutting feed approaches the target position and check the position tolerance range
G62: Automatic corner override
G63: Tapping method
G64: Normal cutting mode, the cutting feed does not decelerate when approaching the target position, and the cutting section does not decelerate between the segments.
G65: Macro program call
G66: Macro program modal call
G67: Macro program modal call canceled
G68: coordinate rotation, format:
G17: G68 X_ Y_ R_
G18: G68 X_ Z_ R_
G19: G68 Y_ Z_ R_
G69 coordinate rotation canceled
G73: Multi-stage drilling cycle
G74: Attacking the left-hand thread cycle
G76: fine boring cycle (directional eccentric retraction)
G80: Cancel the canned cycle
G81: Single stage drilling cycle
G82: Single-stage drilling cycle (to achieve bottom hole stop or delay)
G83: Multi-stage drilling cycle
G84: Attack right-hand thread
G85: boring cycle
G86: boring cycle
G87: ruminant cycle
G88: boring cycle
G89: boring cycle
G90: Absolute instruction
G91: Relative instructions
G92: Setting the workpiece coordinate system
G98: Return to the starting point when the fixed cycle is back
G99: Retraction point when the fixed cycle is retracted (R point is set in the canned cycle)
3. Common M code explanation
M00: The program stops unconditionally
M01: Program condition stops
M02: End of program
M03: Spindle forward rotation
M04: Spindle reversal
M05: Spindle stop
M08: open outside cold
M09: Turn off all cooling
M26: open inside cold
M30: The program ends and returns to the beginning of the program
M84: Check tray 1
M95: Check tray 2
M98: Calling a subroutine
M99 : Return to the main program
M135: Rigid tapping
M417: Machine tray 1 inspection
M418: Machine tray 2 inspection
M419: Machine tray check is over
M433: Tool Broken Tool Detection
M462: tray number transmission
4. Common arithmetic
Addition: #i=#j+#k
Subtraction: #i=#j-#k
Multiplication: #i=#j*#k
Division: #i=#j/#k
Sine: #i=SIN[#j]
Arcsine: #i=ASIN[#j]
Cosine: #i=COS[#j]
Inverse cosine: #i=ACOS[#j]
Tangent: #i=TAN[#j]
Anyway cut: #i=ATAN[#j]
Square root: #i=SQRT[#j]
Absolute value: #i=ABS[#j]
Rounding: #i=ROUND[#j]
Round up: #i=FIX[#j]
Take down: #i=FUP[#j]
Natural logarithm: #i=LN[#j]
Exponential function: #i=EXP[#j]
Or: #i=#jOR#k
XOR: #i=#jXOR#k
With: #i=#AND#k
Convert from BCD to BIN: #i=BIN[#j]
Convert from BIN to BCD: #i=BCD[#j]
5. Logical operators
EQ: equal
NE: Not equal
GT: greater than
GE: less than or equal to
LT: less than
6. Program transfer and loop
Unconditional transfer: GOTO
Conditional transfer: IF [conditional expression]
IF [conditional expression] GOTO n, if the condition is satisfied, jump to block n
IF [conditional expression] THEN, such as: IF [#I=#J] THEN #K=0
Http://www.cncku.com
G: Preparation function
R: arc radius
F: Feed, set the feed rate
2. Common G code interpretation
G01: Linear interpolation
G20: inch input
G21: mm input
G29: Return from the reference point
G50: Unscaled
OFF G50
G62: Automatic corner override
G63: Tapping method
G65: Macro program call
G69 coordinate rotation canceled
G73: Multi-stage drilling cycle
G80: Cancel the canned cycle
G81: Single stage drilling cycle
G83: Multi-stage drilling cycle
G84: Attack right-hand thread
G85: boring cycle
G86: boring cycle
G87: ruminant cycle
G88: boring cycle
G89: boring cycle
G90: Absolute instruction
G91: Relative instructions
3. Common M code explanation
M01: Program condition stops
M02: End of program
M03: Spindle forward rotation
M04: Spindle reversal
M05: Spindle stop
M08: open outside cold
M09: Turn off all cooling
M26: open inside cold
M84: Check tray 1
M95: Check tray 2
M98: Calling a subroutine
M99 : Return to the main program
M135: Rigid tapping
M462: tray number transmission
4. Common arithmetic
5. Logical operators
EQ: equal
NE: Not equal
GT: greater than
GE: less than or equal to
LT: less than
6. Program transfer and loop
Unconditional transfer: GOTO
IF [conditional expression] THEN, such as: IF [#I=#J] THEN #K=
More details: www.allescncmachine.com
Whatsapp: + 86-15966602397(24 hours online)