Coding for CNC machines. G- and M-codes. Command parameters are set in Latin letters

In pursuit of powerful post processors - CAM applications, machine operators do not notice an inexpensive, affordable and easy to use and learn software product. On all forums, a lot of questions to smart gurus - how to figure out the settings of universal programs, scouring the Internet in search of hacked copies of expensive programs, for some reason we don’t think that it’s easier to buy an inexpensive software product and honestly and legally, and what’s important - and very effectively, apply it on your equipment.

Home hobby and homemade or retrofit CNC machines or construction machines are now becoming more widespread. With the control program, everything is usually clear - this is MACH, there are practically no alternatives. And with the choice of a post-processor, a home master usually has problems.

Consider using a CNC machine to create a simple bas-relief.

An inexpensive solution to the G-code question for this purpose is simple and handy program bmp2 cnc.

Bmp2Cnc creates a G-code control program (UE of G-codes) from a grayscale image. You can also upload a color photo to the program: it is possible to convert a color image to a grayscale one, but here we will use a ready-made black and white drawing as an example:

Let's walk through the program step by step.

So, loading the image into the program. Change the image size to the one that corresponds to the size of the future bas-relief. Enter the value 100 mm in the "Width" box and, if there is a bird in the checkbox below, the image height changes with the same scale:

Next, choose zero. The easiest way is to take the lower left corner of the picture as the origin of the UE coordinates. Why? The convenience lies in the fact that the dimensions of the bas-relief will be displayed more clearly in the Mach3 control program in the future, it will be easier to manipulate the control program further - to scale the part, loop, i.e. perform several identical processing by one control program on one workpiece, and so on:

The most interesting moment is coming. Now we will see the detail in volume. In the "Depth" section, we set the depths for the white and black colors of the image. For our 100 by 100 bas-relief, set the depth for the darkest shade of black first to 10 mm, click the "Apply" button. After a second, we see the resulting relief in the graphical visualization window:

Need more volume? Set the depth 15 mm. Now the detail looks quite voluminous:

In the next bmp2cnc dialog, select the postprocessor suitable for our system - Mach2-3 in millimeters and go to tool selection:

Choosing the right cutter with a sharp nose, which will cleanly enough process our part:

Choosing a tool diameter- milling cutters and itu of parallel passes, do not get carried away and set too high parameters - otherwise the processing will stretch for hours or even a day! Here it is better to compromise, let the part turn out to be slightly rough, in the end, you will have to go through the sandpaper anyway (since the original picture was of low quality), but the machine will process much faster:

Any number of depth passes can be set depending on the hardness of the material, the quality of the tool, etc.

Here in the sixth dialog of the program there is a very useful function, which, by the way, is implemented "with a scratch" in other venerable programs. By pressing one button, you can cut off the planes that are unnecessary for processing, which will significantly shorten the processing time. We cut off the lower plane - and our the model is finalized:

Clicking the "Calculate" button- and we see the resulting processing paths. In a separate window - a ready-made control program:

Next, you can run processing simulation. The animated cutter tool on the program screen will move along the trajectories created in Bmp2Cnc, providing us with an excellent visualization of the machine:

That's all. The G-code NC file can be sent to the machine, and the results of the work can be saved as a Bmp2Cnc project for subsequent references and changes, or as a Stl or Dxf model.

Ready UE G-codes loaded into Mach3:

In a manufacturing environment where different CNC machines are used, a lot of different software is used, but in most cases, all control software uses the same control code. Software for amateur machines, is also based on a similar code. In everyday life it is called "G-code". This material provides general information on the G-code (G-code)

G-code is a conventional naming language for programming CNC devices (Computer Numerical Control). Created by the Electronic Industries Alliance in the early 1960s. The final revision was approved in February 1980 as the RS274D standard. The ISO Committee approved G-code as ISO 6983-1:1982, the State Committee for Standards of the USSR - as GOST 20999-83. In Soviet technical literature, G-code is referred to as the ISO-7 bit code.

Manufacturers of control systems use G-code as a base subset of the programming language, extending it as they see fit.

A program written using G-code has a rigid structure. All control commands are combined into frames - groups consisting of one or more commands. The block is terminated by a line feed character (FS/LF) and has a number, except for the first block of the program. The first frame contains only one "%" character. The program ends with an M02 or M30 command.

Summary code table

The main, in the standard are called preparatory, language commands begin with the letter G:

  • Moving the working bodies of the equipment at a given speed (linear and circular)
  • Performing typical sequences (such as drilling holes and threads)
  • Controlling tool parameters, coordinate systems, and work planes

Preparatory (basic) teams

Table of basic commands

The codeDescriptionExample
G00 Rapid tool movement (idle) G0 X0 Y0 Z100;
G01 Linear interpolation G01 X0 Y0 Z100 F200;
G02 Clockwise circular interpolation G02 X15 Y15 R5 F200;
G03 Circular interpolation counterclockwise G03 X15 Y15 R5 F200;
G04 Delay by P milliseconds G04 P500;
G10 Set new coordinates for origin G10 X10 Y10 Z10;
G11 Cancel G10 G11;
G15 Cancel G16 G15 G90;
G16 Switching to polar coordinates G16 G91 X100 Y90;
G20 Inch Mode G90 G20;
G21 Operating mode in metric system G90 G21;
G22 Activate the set limit of movements (The machine will not go beyond their limit). G22 G01 X15 Y25;
G23 Cancel G22 G23 G90 G54;
G28 Return to reference point G28 G91 Z0 Y0;
G30 Z-axis lift to tool change point G30 G91 Z0;
G40 Cancel Tool Size Compensation G1 G40 X0 Y0 F200;
G41 Compensate tool radius left G41 X15 Y15 D1 F100;
G42 Compensate Tool Radius Right G42 X15 Y15 D1 F100;
G43 Compensate tool height positively G43 X15 Y15 Z100 H1 S1000 M3;
G44 Compensate tool height negatively G44 X15 Y15 Z4 H1 S1000 M3;
G53 Switch to machine coordinate system G53 G0 X0 Y0 Z0;
G54-G59 Switch to operator-defined coordinate system G54 G0 X0 Y0 Z100;
G68 Rotate coordinates to the desired angle G68 X0 Y0 R45;
G69 Cancel G68 G69;
G80 Cancel drilling cycles (G81-G84) G80Z100;
G81 Drilling cycle G81 X0 Y0 Z-10 R3 F100;
G82 Dwell cycle G82 X0 Y0 Z-10 R3 P100 F100;
G83 Retract drilling cycle G83 X0 Y0 Z-10 R3 Q8 F100;
G84 Threading cycle
G90 Absolute coordinate system G90 G21;
G91 Relative coordinate system G91 G1 X4 Y5 F100;
G94 F (feed) - in mm/min format. G94 G80 Z100;
G95 F (feed) - in the format mm / rev. G95 G84 X0 Y0 Z-10 R3 F1.411;
G98 Cancel G99 G98 G15 G90;
G99 After each cycle, do not retreat to the “approach point” G99 G91 X10 K4;

Technology code table

Technological commands of the language begin with the letter M. They include actions such as:

  • Change Tool
  • Enable/disable spindle
  • Enable/disable cooling
  • Call/End Subroutine

Auxiliary (technological) commands

The codeDescriptionExample
M00 Suspend the operation of the machine until pressing the "start" button on the control panel, the so-called "technological stop" G0 X0 Y0 Z100 M0;
M01 Pause the machine until the "start" button is pressed if the stop confirmation mode is enabled G0 X0 Y0 Z100 M1;
M02 End of program M02;
M03 Start spindle rotation clockwise M3 S2000;
M04 Start spindle rotation counterclockwise M4 S2000;
M05 Stop spindle rotation M5;
M06 Change Tool M6 T15;
M07 Enable additional cooling M3 S2000 M7;
M08 Turn on main cooling M3 S2000 M8;
M09 Turn off cooling G0 X0 Y0 Z100 M5 M9;
M30 End of information M30;
M98 Subroutine call M98P101;
M99 End of subprogram, return to main program M99;

CNC machining programming is carried out in a language commonly referred to as the ISO 7-bit language or the G and M code language. The language of G and M codes is based on the provisions of the International Organization for Standardization (ISO) and the Electronic Industries Association (EIA).

CNC manufacturers adhere to these standards for describing basic functions, but take liberties and derogations when it comes to the special features of their systems.

Japanese FANUC CNC systems (FANUC CORPORATION) were among the first to be adapted to work with G and M codes and using this standard most fully. At present, FANUC racks are the most common both abroad and in Russia.

CNC systems from other well-known manufacturers, such as SINUMERIK (SIEMENS AG) and HEIDENHAIN, also have G and M code capabilities, but some specific codes may differ. The difference in programming specific functions can be found in the documentation for the specific CNC system.

There are three methods for programming machining for CNC machines:

  • Manual programming.

All CNC machine operators, technologists-programmers must have a good understanding of manual programming techniques. It's like primary school, where education provides the basis for further education.

  • Programming on the CNC console.

When programs are created and entered directly on the CNC using the keyboard and display. For example, the machine operator can verify the NC or select the required canned cycle using special icons and insert it into the code of the control program.

  • Programming with CAD/CAM system.

Programming with the help of CAD/CAM system allows you to "raise" the process of writing machining programs to a higher level. Working with the CAD/CAM system, the technologist-programmer saves himself from time-consuming mathematical calculations and receives tools that significantly increase the speed of writing control programs.

A set of commands in a programming language that corresponds to the algorithm of the machine for processing a particular workpiece is called control program (CP).

A part program consists of a sequence of blocks and usually begins with a program start character (%) and ends with M02 or M30.

Each program block represents one machining step and (depending on the CNC) may begin with a block number (N1...N10, etc.) and end with the end of block (;) character.

The NC block consists of statements in the form of words (G91, M30, X10. etc.). A word consists of a character (address) and a digit representing an arithmetic value.

Addresses X, Y, Z, U, V, W, P, Q, R, A, B, C, D, E are dimensional movements, used to designate the coordinate axes along which movements are carried out.

Words that describe movement may have a (+) or (-) sign. If there is no sign, the displacement is considered positive.

Addresses I, J, K mean interpolation parameters.

G - preparatory function.

M - auxiliary function.

S - function of the main movement.

F is the feed function.

T, D, H - tool functions.

Symbols may take on different meanings depending on the specific CNC.

G codes for CNC

G00- fast positioning.

The G00 function is used to execute a rapid cutter move to the machining position or to the safe position. Rapid traverse is never used to perform machining because the speed of movement of the machine tool is very high. Code G00 is canceled by codes: G01, G02, G03.

G01- linear interpolation.

The G01 function is used to execute linear motion at a given speed (F) . When programming, the coordinates of the end point are specified in absolute values ​​(G90) or increments (G91) with the corresponding traversing addresses (eg X, Y, Z). Code G01 is canceled by codes: G00, G02, G03.

G02- circular interpolation clockwise.

The G02 function is to move the tool along an arc (circle) in the clockwise direction at a specified speed (F). When programming, the coordinates of the end point are specified in absolute values ​​(G90) or increments (G91) with the corresponding traversing addresses (eg X, Y, Z).

Code G02 is canceled by codes: G00, G01, G03.

G03- circular interpolation counterclockwise.

The G03 function is to move the tool along an arc (circle) in the counterclockwise direction at a specified speed (F). When programming, the coordinates of the end point are specified in absolute values ​​(G90) or increments (G91) with the corresponding traversing addresses (eg X, Y, Z).

The interpolation parameters I, J, K, which define the coordinates of the center of the circular arc in the selected plane, are programmed in increments from the starting point to the center of the circle, in directions parallel to the X, Y, Z axes, respectively.

Code G03 is canceled by codes: G00, G01, G02.

G04- pause.

Function G04 - a command to perform a dwell with a given time. This code is programmed together with an X or P address which indicates the length of the dwell time. Typically, this time is between 0.001 and 99999.999 seconds. For example G04 X2.5 - pause 2.5 seconds, G04 P1000 - pause 1 second.

G17- selection of the XY plane.

The G17 code is for selecting the XY plane as the work plane. The XY plane becomes defining when using circular interpolation, coordinate system rotation, and drilling canned cycles.

G18- XZ plane selection.

The G18 code is for selecting the XZ plane as the work plane. The XZ plane becomes the defining plane when using circular interpolation, coordinate system rotation and drilling canned cycles.

G19- YZ plane selection.

The G19 code is for selecting the YZ plane as the work plane. The YZ plane becomes defining when using circular interpolation, coordinate system rotation, and drilling canned cycles.

G40- Cancel tool radius compensation.

Function G40 overrides automatic tool radius compensation G41 and G42.

G41- left tool radius compensation.

Function G41 is used to enable automatic tool radius compensation to the left of the machined surface (when viewed from the tool in the direction of its movement relative to the workpiece). Programmed together with tool function (D).

G42- right tool radius compensation.

Function G42 is used to enable automatic tool radius compensation to the right of the machined surface (when viewed from the tool in the direction of its movement relative to the workpiece). Programmed together with tool function (D).

G43- correction for the position of the tool.

Function G43 is used for tool length compensation. Programmed together with tool function (H).

G54 - G59- given offset.

Bias working system workpiece coordinates relative to the machine coordinate system.

G70- input of inch data.

Function G70 activates the inch mode.

G71- input of metric data.

Function G71 activates the metric data mode.

G80- Cancellation of the constant cycle.

A function that cancels any canned cycle.

G81- standard drilling cycle.

Cycle G81 is for centering and drilling holes. The movement in the machining process takes place at the cutting feed. The movement to the starting position after processing is at rapid feed.

G82- drilling with exposure.

Cycle G82 is designed for drilling and countersinking holes. The movement in the machining process occurs at the cutting feed with a pause at the end. The movement to the starting position after processing is at rapid feed.

G83- intermittent drilling cycle.

Cycle G83 is designed for deep hole drilling. The movement in the process of processing occurs at the working feed with the periodic output of the tool to the retraction plane. The movement to the starting position after processing is at rapid feed.

G84- thread cutting cycle.

Cycle G84 is for tapping threads. The movement in the machining process occurs at the working feed, the spindle rotates in the specified direction. The movement to the starting position after processing is on the working feed with reverse rotation of the spindle.

G85- standard boring cycle.

The G85 cycle is designed for reaming and boring holes. The movement in the machining process takes place at the cutting feed. The movement to the starting position after processing is at the working feed.

G86- boring cycle with spindle stop.

Cycle G86 is for boring holes. The movement in the machining process takes place at the cutting feed. At the end of processing, the spindle stops. The movement to the starting position after processing is at rapid feed.

G87- boring cycle with manual retraction.

Cycle G87 is for boring holes. The movement in the machining process takes place at the cutting feed. At the end of processing, the spindle stops. The movement to the starting position after processing is done manually.

G90- absolute positioning mode.

In the G90 absolute positioning mode, the actuators are moved relative to the zero point of the working coordinate system G54-G59 (it is programmed where the tool should move). The G90 code is canceled with the G91 relative positioning code.

G91- relative positioning mode.

In the relative (incremental) positioning mode G91, the zero position is each time taken to be the position of the executive body that it occupied before moving to the next reference point (it is programmed how much the tool should move). The G91 code is canceled with the G90 absolute positioning code.

G94- feed rate in inches/millimeters per minute.

With function G94, the specified feedrate is set in inches or millimeters per 1 minute. Programmed together with feed function (F). The G94 code is canceled by the G95 code.

G95- feed rate in inches/millimeters per revolution.

With function G95, the specified feedrate is set in inches or millimeters per spindle revolution. Those. the feedrate F is synchronized with the spindle speed S. The G95 code is canceled by the G94 code.

M codes for CNC

M00- programmable stop.

When the control executes the M00 command, it stops. All axial movement stops while the spindle (for most machines) continues to rotate. Work according to the program resumes from the next frame after pressing the "Start" button.

M01- stop with confirmation.

Code M01 has the same effect as M00, but is only executed after confirmation from the machine control panel. If the confirmation key is pressed, then when reading a block from M01, a stop occurs. If the key is not pressed, then the block M01 is skipped and the execution of the UE is not interrupted.

M02- end of the program.

The M02 code indicates the end of the program and causes the spindle to stop, the feed to stop and the cooling to turn off.

M03- Spindle rotation clockwise.

With the M03 code, the direct rotation of the spindle with the programmed speed (S) is switched on. Code M03 is valid until canceled with M04 or M05.

M04- Spindle rotation counterclockwise.

The M04 code enables the reverse rotation of the spindle with the programmed speed (S). Code M04 is valid until canceled with M03 or M05.

M05- spindle stop.

Code M05 stops spindle rotation, but does not stop axial movement.

M06- tool change.

With the M06 code, the tool fixed in the spindle is changed to the tool that is in the ready position in the tool magazine.

M07- turning on cooling No. 2.

The code M07 enables coolant to be sprayed into the machining area, if the machine has this capability.

M08- turning on cooling No. 1.

Code M08 turns on the supply of coolant to the processing zone in the form of a jet.

M09- shutdown of cooling.

The M09 code turns off the coolant supply and cancels the M07 and M08 commands.

M10- clamp.

Code M10 refers to work with the clamping device of the moving parts of the machine.

M11- unclench.

Code M11 refers to work with the clamping device of the moving parts of the machine.

MZ0- end of information.

The M30 code informs the control about the end of the program, stops the spindle, feeds and turns off the cooling.

Additional Functions and Symbols for CNC Programming

X, Y, Z- axial movement commands.

A, B, C- commands for circular movement around the X, Y, Z axes, respectively.

I, J, K- parameters of circular interpolation parallel to the axes X, Y, Z, respectively.

With circular interpolation G02 or G03, R defines the radius that connects the start and end points of the arc. In canned cycles, R determines the position of the retraction plane. When working with the rotation command, R determines the angle of rotation of the coordinate system.

D- tool radius compensation value.

H- tool length compensation value.

F- feed function.

S- function of the main movement.

T- value specifying the number of the tool to be moved to the change position by rotating the tool magazine.

N- numbering of UE frames.

/ - frame skip.

(...) - comments in the UE.

Numerical control systems (NC) are programmed using G-code.

G-code is the general name of a programming language regulated by ISO 6983-1:1982, GOST 20999-83.
In the technical literature of the Soviet Union, the G-code is referred to as the ISO 7-bit code (ISO 7-bit).

Despite the general regulation, the G-code has many implementations and additions, introduced mainly by developers of hardware devices of numerical control systems, which nevertheless does not prevent it from remaining the main standard in the industry.

In general, a program written using G-code consists of frames, each frame contains a set of control instructions.

Control commands can follow in the frame in any order, but usually, for the convenience of reading the control program of the numerical control system, preparatory commands come first, then commands to control the movement of the cutting tool, followed by commands for selecting material processing modes and complete the frame - technological commands.

The text of the control program begins and ends with the symbol "%".
This may be followed by the name of the program after the symbol "O".
Comments in the text of the control program are placed either in parentheses or preceded by the symbol ";".

Each control command can have one or more parameters, which are denoted by Latin letters.

G-code allows you to use the following basic parameters for control commands:

X - coordinate of the trajectory point along the X axis (for example, ),

Y - coordinate of the trajectory point along the Y axis (for example, ),

Z - coordinate of the path point along the Z axis (for example, G01 X25.4 Y2.3 Z0.2),

P - parameter (for example, P120),

(e.g. G01 X10.5 F75),

S - spindle speed (for example, S1500 M3),

R - standard cycle parameter or arc radius,

H - correction parameter of the selected tool,

I,J,K - arc parameters for circular interpolation (for example, ).

Basic commands

G15 command - cancel polar coordinate system.

Command G16 - assignment of the polar coordinate system (X radius, Y angle).

Commands G54-G59 - switching to the coordinate system specified by the operator.

G80 command - Cancel cycles of drilling, boring, tapping, etc.

G81 command - drilling cycle.

G82 command - drilling cycle with a delay.

G83 command - intermittent drilling cycle (with full drill retraction).

The G84 command is a thread cutting cycle.

Command G97 S (Speed) - Set the spindle speed using an S-word.

Basic auxiliary (technological) commands

M03 command - start spindle rotation clockwise.

M04 command - start of spindle rotation counterclockwise.

M05 command - stop spindle rotation.

M06 command - tool change.

Command M07 - activation of additional cooling.

Command M08 - turn on the main cooling.

M09 command - cooling off.

M13 command - turn off cooling and clockwise spindle rotation.

M14 command - turn off cooling and counterclockwise spindle rotation.

Command M17 - end of subroutine.

M25 command - manual tool change.

Examples of various control programs for machine tools with numerical control are presented

When writing and debugging control programs for CNC machines, you can use the application that automatically creates control programs for CNC machines after entering all the necessary parameters and geometric dimensions.

In a manufacturing environment where different CNC machines are used, a lot of different software is used, but in most cases, all control software uses the same control code. Software for amateur machines is also based on a similar code. In everyday life it is called " G-the code". This material provides general information on the G-code (G-code).

G-code is a conventional naming language for programming CNC devices (Computer Numerical Control). Created by the Electronic Industries Alliance in the early 1960s. The final revision was approved in February 1980 as the RS274D standard. The ISO Committee approved the G-code as ISO 6983-1:1982, the USSR State Committee for Standards - as GOST 20999-83. In Soviet technical literature, G-code is referred to as the ISO-7 bit code.

Manufacturers of control systems use G-code as a base subset of the programming language, extending it as they see fit.

A program written using G-code has a rigid structure. All control commands are combined into frames - groups consisting of one or more commands. The block is terminated by a line feed character (FS/LF) and has a number, except for the first block of the program. The first frame contains only one character "%". The program ends with an M02 or M30 command.

The main (in the standard called preparatory) commands of the language begin with the letter G:

  • movement of the working bodies of the equipment at a given speed (linear and circular;
  • execution of typical sequences (such as the processing of holes and threads);
  • control of tool parameters, coordinate systems, and work planes.

Summary code table:

Table of basic commands:

The code Description Example
G00 Rapid tool movement (idle) G0 X0 Y0 Z100;
G01 Linear interpolation G01 X0 Y0 Z100 F200;
G02 Circular interpolation of the hour hand G02 X15 Y15 R5 F200;
G03 Circular interpolation counterclockwise G03 X15 Y15 R5 F200;
G04 Delay by P milliseconds G04 P500;
G10 Set new coordinates for origin G10 X10 Y10 Z10;
G11 Cancel G10G11;
G15 Cancel G16G15 G90;
G16 Switching to polar coordinates G16 G91 X100 Y90;
G20 Inch Mode G90 G20;
G21 Operating mode in metric system G90 G21;
G22 Activate the set limit of movements (The machine will not go beyond their limit). G22 G01 X15 Y25;
G23 Cancel G22G23 G90 G54;
G28 Return to reference point G28 G91 Z0 Y0;
G30 Z-axis lift to tool change point G30 G91 Z0;
G40 Cancel Tool Size Compensation G1 G40 X0 Y0 F200;
G41 Compensate tool radius left G41 X15 Y15 D1 F100;
G42 Compensate Tool Radius Right G42 X15 Y15 D1 F100;
G43 Compensate tool height positively G43 X15 Y15 Z100 H1 S1000 M3;
G44 Compensate tool height negatively G44 X15 Y15 Z4 H1 S1000 M3;
G53 Switch to machine coordinate system G53 G0 X0 Y0 Z0;
G54-G59 Switch to operator-defined coordinate system G54 G0 X0 Y0 Z100;
G68 Rotate coordinates to the desired angle G68 X0 Y0 R45;
G69 Cancel G68G69;
G80 Cancellation of drilling cycles (G81-G84)G80 Z100;
G81 Drilling cycle G81 X0 Y0 Z-10 R3 F100;
G82 Dwell cycle G82 X0 Y0 Z-10 R3 P100 F100;
G83 Waste drilling cycle G83 X0 Y0 Z-10 R3 Q8 F100;
G84 Threading cycle
G90 Absolute coordinate system G90 G21;
G91 Relative coordinate system G91 G1 X4 Y5 F100;
G94 F (feed) - in mm/min format. G94 G80 Z100;
G95 F (feed) - in the format mm / rev. G95 G84 X0 Y0 Z-10 R3 F1.411;
G98 Cancel G99G98 G15 G90;
G99 After each cycle, do not retreat to the “approach point” G99 G91 X10 K4;

Technology code table:

Technological commands of the language begin with the letter M. They include actions such as:

  • Change Tool
  • Enable/disable spindle
  • Enable/disable cooling
  • Call/End Subroutine

Auxiliary (technological) commands:

The code Description Example
M00 Suspend the operation of the machine until pressing the "start" button on the control panel, the so-called "technological stop" G0 X0 Y0 Z100 M0;
M01 Pause the machine until the "start" button is pressed if the stop confirmation mode is enabled G0 X0 Y0 Z100 M1;
M02 End of program M02;
M03 Start spindle rotation clockwise M3 S2000;
M04 Start spindle rotation counterclockwise M4 S2000;
M05 Stop spindle rotation M5;
M06 Change Tool M6 T15;
M07 Enable additional cooling M3 S2000 M7;
M08 Turn on main cooling M3 S2000 M8;
M09 Turn off cooling G0 X0 Y0 Z100 M5 M9;
M30 End of information M30;
M98 Subroutine call M98P101;
M99 End of subprogram, return to main program M99;

Command parameters are specified in Latin letters:

Constant Code Description Example
X Trajectory point X coordinate G0 X0 Y0 Z100
Y Trajectory point Y coordinate G0 X0 Y0 Z100
Z Trajectory point Z coordinate G0 X0 Y0 Z100
F Cutting feed speed G1 G91 X10 F100
S Spindle speed S3000 M3
R Radius or canned cycle parameter G1 G91 X12.5 R12.5 or G81 R1 0 R2 -10 F50
D Selected Tool Offset Parameter M06 T1 D1
P Delay amount or number of subroutine calls M04 P101 or G82 R3 Z-10 P1000 F50
I,J,K Arc parameters for circular interpolation G03 X10 Y10 I0 J0 F10
L Subroutine call with given label L12 P3