G代码和M代码表汇总
G代码是最为广泛使用的数控编程语言,主要在计算机辅助制造中用于控制自动机床。使用G代码可以实现快速定位、逆圆插补、顺圆插补、中间点圆弧插补、半径编程、跳转加工。
M是辅助功能:用于指定主轴旋转方向,启动停止,冷却液的开关,工件,或者刀具的夹紧和松开,刀具的更换等功能,是由地址M和后两位数字组成,部分功能与系统配置有关。
M是辅助功能:用于指定主轴旋转方向,启动停止,冷却液的开关,工件,或者刀具的夹紧和松开,刀具的更换等功能,是由地址M和后两位数字组成,部分功能与系统配置有关。
List of G codes
G code G代码 |
Group 组号 |
Meaning 含义 |
---|---|---|
G00 | 01* | Rapid motion (快速运动) |
G01 | 01 | Linear interpolation motion (直线插补运动) |
G02 | 01 | CW interpolation motion (顺圆插补运动) |
G03 | 01 | CCW interpolation motion (逆圆插补运动) |
G04 | 00 | Dwell (暂停) |
G09 | 00 | Exact stop (准确停止) |
G10 | 00 | Programmable data input (可编程数据输入) |
G11 | 00 | Programmable data input cancel (可编程数据输入取消) |
G15 | 17* | Polar coordinate cancel (极坐标编程取消) |
G16 | 17 | Polar coordinate (极坐标编程) |
G17 | 02* | XY plane selection (XY平面选择) |
G18 | 02 | ZX plane selection (ZX平面选择) |
G19 | 02 | YZ plane selection (YZ平面选择) |
G20 | 06* | Select inches (选择英制) |
G21 | 06 | Select metric (选择公制) |
G28 | 00 | Return to reference point (返回参考点) |
G29 | 00 | Return from reference point (从参考点返回) |
G30 | 00 | Return to 2nd ,3rd,4th reference point (返回第2、3、4参考点) |
G31 | 00 | Feed until skip (跳转) |
G33 | 01 | Threading (螺纹切削) |
G40 | 07* | Cutter compensation cancel (取消刀具补偿) |
G41 | 07 | Cutter compensation left (刀具左补偿) |
G42 | 07 | Cutter compensation right (刀具右补偿) |
G43 | 08 | Tool length compensation + (刀具长度补偿+) |
G44 | 08 | Tool length compensation - (刀具长度补偿-) |
G49 | 08* | G43/G44 cancel (取消G43/G44) |
G50 | 11* | G51 cancel (取消G51) |
G51 | 11 | Scaling (比例缩放) |
G52 | 00 | Set local coordinate system (设定局部坐标系) |
G53 | 00 | Non-modal machine coordinate selection (非模态机床坐标系选择) |
G54 | 14* | Select work coordinate system 1 (设定工件坐标系1) |
G55 | 14 | Select work coordinate system 2 (设定工件坐标系2) |
G56 | 14 | Select work coordinate system 3 (设定工件坐标系3) |
G57 | 14 | Select work coordinate system 4 (设定工件坐标系4) |
G58 | 14 | Select work coordinate system 5 (设定工件坐标系5) |
G59 | 14 | Select work coordinate system 6 (设定工件坐标系6) |
G60 | 00 | Unidirectional positioning (单一方向定位) |
G61 | 15 | Exact stop modal (模态准确停止) |
G64 | 15* | G61 cancel (取消G61) |
G65 | 00 | Macro call (调用宏程序) |
G68 | 16 | Rotation (旋转) |
G69 | 16* | G68 cancel (取消G68) |
G73 | 09 | Highspeed peck drilling cycle (高速深孔钻循环) |
G74 | 09 | Left-handed tapping cycle (左旋攻丝循环) |
G76 | 09 | Fine boring canned cycle (精镗循环) |
G80 | 09* | Canned cycle cancel (取消固定循环) |
G81 | 09 | Drilling cycle (钻孔循环) |
G82 | 09 | Spot drilling cycle (钻孔循环,孔底暂停) |
G83 | 09 | Normal peck drilling cycle (普通深孔钻循环) |
G84 | 09 | Tapping cycle (攻丝循环) |
G85 | 09 | Boring cycle (镗孔循环) |
G86 | 09 | Boring cycle with spindle stop (镗/铰孔循环,孔底主轴停止) |
G87 | 09 | Back boring cycle (背镗循环) |
G88 | 09 | Boring cycle (镗孔循环,孔底暂停后,主轴停) |
G89 | 09 | Boring and dwell cycle (镗孔循环,孔底暂停,主轴不停) |
G90 | 03* | Absolute (绝对编程方式) |
G91 | 03 | Incremental (增量编程方式) |
G92 | 00 | Set work coordinates (设定工件坐标系) |
G94 | 05* | Feed per minute (每分进给) |
G95 | 05 | Feed per revolution (每转进给) |
G96 | 13 | Constant surface speed (恒线速度切削) |
G97 | 13* | Constant surface speed cancel (恒线速度切削取消) |
G98 | 10* | Initial point return (返回初始点平面) |
G99 | 10 | R plane return (返回R点平面)5 |
List of G codes(车床专用)
G code G代码 |
Group 组号 |
Meaning 含义 |
---|---|---|
G12.1 | 21* | Polar coordinate interpolation cancel (极坐标取消) |
G13.1 | 21 | Polar coordinate interpolation (极坐标) |
G70 | 00 | Finishing cycle (精车循环) |
G71 | 00 | Stock removal in turning (外圆粗车循环) |
G72 | 00 | Stock removal in facing (端面粗车循环) |
G73 | 00 | Pattern repeating cycle (封闭切削循环) |
G74 | 00 | End face peck drilling cycle (端面啄式钻孔循环) |
G75 | 00 | Longitudinal cut off cycle (切槽复合循环) |
G76 | 00 | Multiple-thread cutting cycle (复合螺纹切削循环) |
G83 | 10 | Cycle for face drilling (端面钻孔循环) |
G84 | 10 | Cycle for face tapping (端面攻丝循环) |
G85 | 10 | Cycle for face boring (端面镗孔循环) |
G87 | 10 | Cycle for side drilling (侧面钻孔循环) |
G88 | 10 | Cycle for side tapping (侧面攻丝循环) |
G89 | 10 | Cycle for side boring (侧面镗孔循环) |
G98 | 05* | Feed per minute (每分进给) |
G99 | 05 | Feed per revolution (每转进给) |
List of M codes
M code M代码 |
Meaning 含义 |
---|---|
M00 | Stop program (程序停止) |
M01 | Optional program stop (程序选择停止) |
M02 | Program end (程序结束) |
M03 | Spindle forward (主轴正转) |
M04 | Spindle reverse (主轴反转) |
M05 | Spindle stop (主轴停转) |
M06 | Tool change (自动换刀) |
M07 | Coolant ON (Mist) (冷却液开启(雾状)) |
M08 | Coolant ON (Flood) (冷却液开启(水状)) |
M09 | Coolant OFF (冷却液关闭) |
M19 | Orient spindle (主轴定向) |
M30 | Program end and rewind (程序结束并反绕) |
M31 | Chip conveyor forward (排屑器正转) |
M32 | Chip conveyor reverse (排屑器反转) |
M33 | Chip conveyor stop (排屑器停转) |
M34 | Increment coolant spigot position (冷却液喷嘴位置上升) |
M35 | Decrement coolant spigot position (冷却液喷嘴位置下降) |
M36 | Pallet rotate (托盘回转) |
M39 | Rotate tool turret (刀具转塔架回转) |
M41 | Low gear shift (切换低挡齿轮) |
M42 | High gear shift (切换高挡齿轮) |
M50 | Execute pallet change (执行托盘交换) |
M82 | Tool unclamp (刀具松开) |
M86 | Tool clamp (刀具夹紧) |
M88 | Through the spindle coolant ON (主轴中心孔冷却开启) |
M89 | Through the spindle coolant OFF (主轴中心孔冷却关闭) |
M95 | Sleep mode (睡眠模式) |
M96 | Jump if no input (无输入则跳转) |
M97 | Local subprogram call (局部子程序调用) |
M98 | Subprogram call (子程序调用) |
M99 | Subprogram return or loop (子程序返回或循环执行) |