You are on page 1of 29

Simulator tutorials

Simulator tutorials are built in tutorials that you can run directly in the simulator 3D window. You find them under the
help menu item Run Tutorial.
When you start a simulator tutorial you will see messages and questions at the bottom of the 3D view. You will also see
contour lines, arrows and a grid coordinate system. Be careful to read the instructions for each tutorial so you
understand what to enter.

General rules for the tutorials.


1.You need to enter G codes for each block where we ask you to move the tool. This is true even if the G code you have
entered in the previous block is the same as the current one. They always have to be repeated.
2.You do not have to worry about upper case or lower case characters and other formatting. For example, these two
blocks will both work when the tutorial ask you to go with a feed movement to X123 Y234.
G01 X123 Y234
g1x+123.00y234.0
3.You should never write F, S or other codes when not asked to do so. We fill in these codes for you so that you can
focus on G, M codes and coordinates.
4.While you are running the tutorial, the program blocks will be sent to the CNC editor so that you can study and
simulate the program afterwards.
5. If you want to end the tutorial prematurely, you can click on the stop button below the 3D view.
6. Coordinates that we ask you to enter are either in steps of five or steps of 10 (5,10,15,20,25 etc.). No other values or
decimals are used in our exercises unless clearly specified.
7. All simulator tutorials are in millimeters

Tutorial 2 getting started with the CNCSimulator Pro Turning


The purpose of this tutorial is to learn the basic concepts of how to use the CNCSimulator Pro turning from scratch. We
are going to make a very simple part, taking a few rough cuts, fine cuts and drill a hole.
This is the part we are going to make:

This tutorial is made in millimeters, so the first thing we have to do is to ensure we have millimeters set as units in the
program settings. Click Settings Settings from the main menu.

While we are at it, set all other settings like in the picture above. Click OK.
Now what we have to do is to load a machine for the project. Click on the Open Machine button
Machine dialog. You can also click File Load Machine from the main menu.

to show the Select

Uncheck the Open demo checkbox and click on the Turning Center machine button.
This is how your CNCSimulator Pro window should look like now.

OK, now we need to create a workpiece for your project. Press F2 to open the Inventory Browser where we keep all our
tools, workpieces, materials and offsets.
Click the Lathe Workpieces tab.

If you have not previously created any workpieces, this is what you will see.

Click on the Add button to add a new workpiece.


Enter 50 for diameter, 100 for length and ignore all other settings.

As you can see on the blue bar below the workpiece picture, our index for this workpiece is one. Yours might be another
index if you already had workpieces stored.
OK great, now let's start writing the CNC program!
We start with a special CNCSimulator Pro command to put the workpiece we just created in the chuck. It is called
$AddRegPart. You can either type in the command by hand followed by the index number for the workpiece or take a
shortcut by clicking the Insert at cursor button. This button will automatically put the command in the editor.

Put the cursor at the end of the first line and press enter. This is to ensure that the next command we insert will end up
on a new line.
Next step is to select a tool to use for our rough cuts.
Press F2 again to open the Inventory Browser. This time we are going to stay on the first page (Tools) and click on the
Embedded lathe tools option.

We are going to use one of the fixed embedded tools that come with the CNCSimulator Pro. Actually, we are going to
use the first one so you could just go ahead and click the Insert at cursor button again.

This is what you should have in the editor at the moment:


Normally, to select a tool you use only the code T but as this is an embedded tool, we use ET as in Embedded Tool. If
you create your own tools later, you will use only T for tool selections.
Besides selecting the tool, we need to execute the actual tool change by putting the code M06 after the tool selection.
Note when you press M (or G or any other recognized code) a list of available codes will pop-up.

Either type 6 or select M06 from the list by using the mouse or the arrow keys on the keyboard.
OK, by now we are all set to start cutting the workpiece.
Click the Reset View button to zoom in on the workpiece.

Zoom in a bit further by clicking in the 3D view and rolling the mouse wheel away from you.
Click the Start Simulation button to execute the commands we have entered so far.

Now, this is what the 3D view should look like:

As you can see, the workpiece that we made and the tool we selected are in place.
Let's move the tool in position for the first rough cut by using the G00 code.
Important! The CNCSimulator Pro does automatically put the zero point at the right plane of the jaws. The distance from
the plane to the spindle is 23 millimeter. That means that the right end of our 100 mm long workpiece is at (100-23) 77
in the Z axis. This rule goes for all lathes in the CNCSimulator Pro. Always take the 23 millimeters into account!

We want to take away 10 millimeter from the diameter per cut (5 mm material) so we should put the tool on 40 as our
initial diameter is 50. Let us also put the tool on Z 80 so we have some space (3 mm) between the tool and the
workpiece end plane.
Type G00 X40 Z80 and press Enter.
Fine, now let's take the first actual cut.
Type G01 Z50 F250 S1000 M04 M08 and press Enter.
If you move the mouse over the codes in the block above, you will see tooltip windows explaining what they do.

OK, now we back out the tool a bit before going with fast traverse back to Z80.
Type X44 Z52 and press Enter.
Note that we did not have to write G01 again as it is already activated. The code is modal.
To help us see clearly the tool moves we do, we can turn on the toolpath display. Click on the glasses button and check
the Feeds and Fast Traverses checkboxes.

Now, if you simulate you will see feed movements (G01-G03) in green and fast traverses (G00) in red.

We continue by going back to 80 in the Z axis with fast traverse.


Type G00 Z80 and press Enter.
We go down to diameter 30.
Type X30 and press Enter.
Type G01 Z60 and press Enter.
Again, we back off a little.
Type X34 Z62 and press Enter.
Now we need another tool for the fine cut. Press F2 to open the inventory browser again, then select Embedded lathe
tools and click the blue right arrow to go to the second tool.
Click the Insert at cursor button.

Without pressing Enter, write M06 to execute the tool change, then press Enter.
After a tool change, the tool is at the tool change position of the machine and we need to go back to the workpiece.

Type G00 X28 Z80 and press Enter.


Enter the following blocks to finish the fine cut:
G01 Z59
X38
Z49
X45
X50 Z45
This is how your program should look by now:

Back off again as we did earlier.


Type X54 Z47 and press Enter.
Time to select a drilling tool to make the hole.
Press F2 on the keyboard, click Embedded lathe tools and browse to tool number 17 (drill diameter 10 mm).
Click the Insert at cursor button.
Enter M06 and press Enter.

We will now take the tool back from the tool change position and place it in the center of the workpiece.
Type G00 X0 Z80 and press Enter.
We are going to use a canned drilling cycle to make the hole.
Type G81 Z60 R78 and press Enter.
Type G00 X100 Z200 and press Enter.
Type M30 to end the program and press Enter.
Excellent! We are done. Simulate the program and then click the cutting (knife) button.

Check the Show inside checkbox.

The final program:


$AddRegPart 1
ET1 M06
G00 X40 Z80
G01 Z50 F250 S1000 M04 M08
X44 Z52
G00 Z80
X30
G01 Z60
X34 Z62
ET2 M06
G00 X28 Z80
G01 Z59
X38
Z49
X45
X50 Z45
X54 Z47
ET17 M06
G00 X0 Z80
G81 Z60 R78
G00 X100 Z200

M30

Tutorial 1 getting started with the CNCSimulator Pro


The purpose of this tutorial is to learn the basic concepts of how to use the CNCSimulator Pro from scratch. We are
going to make a very simple part, milling a slot and drilling four holes on a 100 x 100 x 20 millimeter workpiece. For
simplicity we are going to ignore radius compensation and we work only in absolute coordinates.
This is the part we are going to make:

First of all, we need to set millimeters as units and load an appropriate machine for our project.

From the main menu, select Settings and click on Settings.


Ensure that you have millimeters selected as this tutorial is made in millimeters.

Click OK to close the settings dialog.


Click File Load Machine from the main menu or click the open machine button

In the dialog that shows, please deselect Open demo. Then click on the Milling Center button.

Fine, now let's get started by defining our workpiece. Press F2 on the keyboard to open the Inventory Browser.
Click on the Mill Workpieces tab at the top of the dialog.
Click on the green plus button to add a new workpiece.

In the Workpiece Name field, enter a name for your new workpiece, let's call it Tutorial1.

Enter X, Y and Z size as 100, 100 and 20.


Take a mental note of the workpiece index number. Here we did not have any workpieces before in the registry, hence
the index number became 1. In your case, the number could be different. See the red arrow.

Ignore the rest of the settings and click OK to close the Inventory Browser.
Now we need to call up our new workpiece from the program. We do that by using the command $AddRegPart followed
by the workpiece index number (we use 1) and the table displacement values.
We are going to put our new workpiece 30 millimeter from the machine zero in both X and Y. The machine zero is placed
near the lower left corner of the machine table and it is marked by a cross symbol (could be somewhat hard to spot).

To call up our workpiece number one (or your index number if different) on X30 Y30 from the machine zero, we write
($AddRegPart 1, 30, 30)
Now you can go ahead and click on the Play button
table.
In the lower toolbar, click this button

(simulation start) to see that your workpiece shows up on the

to zoom in on the machine table.

At this moment, please note that you can click in the simulation window with the left mouse button and drag the mouse
around to rotate the view. If you click with the right mouse button and drag you will pan the view. Also please note that
you can roll the mouse wheel to zoom in and out.
OK, let's get started with the actual CNC program!
As we moved the workpiece in on the machine table and away from the machine zero our lower left corner on the
workpiece now is at X30 Y30. That is not very practical so let's move the programming zero point to X30 Y30 Z20. This
will result in a zero point in the upper (Z) lower left corner (XY) of the workpiece.
We move the programming zero point by using the G-code G92. (This can also be done from a zero point registry using
G54 to G59 but that is out of scope of this tutorial).
Type G92 X30 Y30 Z20 in the editor.
Click on the Play button again and note how the zero point moves to the corner of your workpiece.

Now, we need tools to mill the 10 mm wide slot and drill the diameter 10 mm holes.
Again, press F2 on the keyboard to open the Inventory Browser (or select Settings Inventory Browser from the main
menu).
In this tutorial, we assume you have no previous custom made tools, if you do, please add these two new tools at the
end of your list and use the tool index you get.
Select My milling tools and click on the button with the green plus icon, the Add button.
First we will add the tool to mill the slot. Select a flat tool tip, enter 10 as diameter and 50 as length. Enter the name of
the tool Tutorial1 flat mill. Ignore all other settings and click OK.

In our case, this new tool will get tool index number 1 (take a note of yours).
Now, we repeat the procedure adding the drilling tool. Click the Add button again.
This time, select a pointed tool tip and enter diameter 10, length 50 and tip angle 80 degrees. Name it Tutorial1 drill.
Click OK.

Click on the X in the upper right corner of the Tool Browser to close it.
Congratulations! Now we have a workpiece and tools and can start programming the rest of our part.
To call up our new milling tool we use T1 (or your tool index number) followed by M06 to tell the virtual machine to go
to its tool change position and execute the tool change.
T1 M06

Next, let us move the tool to the start position. We have decided to use the lower left corner of the slot as the start
where we will drill down into the material.
We use G-code G00 to move with rapid speed to the position stopping 2 mm over the workpiece.
G00 X15 Y15 Z2
Now, press Play to see that the positioning works.

We now enter the G-code G01 for feed movement down to working depth. We also need to start the spindle (M03) and
set the Feed rate (F) and spindle RPM (S).
G01 Z-5 F250 S2000 M03

Now we will move the mill to the start point of the arc, there is no need to type G01 in this block as the code is modal
meaning it will remember the G01 code from the previous block (block = line).
Y70
From now on, feel free to click the Play button at any time to check the simulation.
Now, let's program the clockwise arc movement. To do so, we use the G02 code followed by the X/Y coordinates of the
endpoint and the I/J coordinates of the relative center point (I stands for incremental distance from starting point to
center in X and J is the same in Y).

G02 X30 Y85 I15 J0

Great! Let's enter the rest of the blocks to finish the slot.
G01 X85
Y15
X15
How about that? We are back to where we started. Let's go up in Z to a safe position and then change tool for the
drilling.
G00 Z2
T2 M06

Make sure you use your tool index after T for the drilling tool we created.
Now we can come back from the tool change position and put the drill over the first hole.
G00 X30 Y30 Z2
Next, we will start a drill cycle. We only need to start it and then it will drill on each position we program until we tell it
to stop. For this we use a common drill G-code called G81. We tell the cycle to drill to a total depth of 15 mm and a start
depth of 1 mm above the workpiece. As we have changed tool, we need to start the spindle again (M03). This time, let
us also use coolant water (M08) to not overheat the tool.
G81 Z-15 R1 M03 M08
Now we can just position over each hole center and the drilling will start automatically.
Y70
X70
Y30

Now we need to end the drilling cycle using the G80 code.
G80
Finally we go up in Z and the write M30 to end the program.
Z50
M30

Congratulations! You have done your first CNC program in the famous CNCSimulator!
The complete program:
$AddRegPart 1, 30, 30
G92 X30 Y30 Z20
T1 M06
G00 X15 Y15 Z2
G01 Z-5 F250 S2000 M03
Y70
G02 X30 Y85 I15 J0
G01 X85
Y15
X15
G00 Z2
T2 M06
G00 X30 Y30 Z2
G81 Z-15 R1 M03 M08
Y70
X70
Y30
G80
Z50

G codes
Codes and commands

These are the default standard codes that are used in our normal virtual machines. Please note that customized
machines may have other codes and formats.
The following tables will give a brief explanation to the various G, M and other codes recognized by the CNCSimulator
interpreter. In the Format column, you will see the format expected by the program. If a code is written within brackets
like this [X#] it means that the code is non obligatory and can be omitted if not needed. The # sign means that the
CNCSimulator expects a number and the $ sign means that it is expecting a text string within quotation marks.
Let's show an example:
G12[X#][Y#]Z#R#Q#S#SA#AS#RA#H#
This means that the code G12 accepts X and Y coordinates but they are not obligatory and can be omitted. On the other
hand, you must specify the Z,R,Q,S,SA,AS,RA and H codes to avoid an alarm at runtime.

G-code

Explanation

Format

Example

Machine
type

(codes valid from V1.0.6.5)

G00

Go rapidly (with
G00 [X#][Y#][Z#]
maximum traverse rate)
to the X/Y/Z position.
This code is used for
position and not for
actual machining.

G00 Z100

All
machines

G01

Travel in a straight line


using the programmed
feed rate (F). This code
is used for machining.

G01 X2.5
Y4.1 F200

All
machines

G02
XY-machines

Circular/Helical
G02[X#][Y#][Z#]
G02 X10
Interpolation clockwise. [I#][J#][K#][R#][F#] Y10 I10 J0
It causes a clockwise
F200
circular movement at
programmed feed rate
(F). The motion can be
2-dimensional (flat) or
3-dimensional (helical).
The default plane of the
circular movement is
the XY-plane (G17) but
other planes can be
used as well (see G17G19). The center of the
arc or circle is
programmed using the
I, J and K letters (R can
also be used).

All
machines

Exactly like G02 but the G03[X#][Y#][Z#]


G03 X10
circular motion is going [I#][J#][K#][R#][F#] Y10 I10 J0
counterclockwise.
F200

All
machines

Lathe

G03
XY-machines

G01
[X#][Y#][Z#][F#]

Lathe

G04

Dwell in milliseconds.
G04 P#
This will keep the axes
unmoving for the period
of time specified by the
P number.

G04 P2000 All


(Two
machines
seconds
delay)

G09

Will force the machine G09


to do a full stop before
continuing with the next
move. This is a nonmodal variant of G61
and hence does not
have to be cancelled.

G12

Circular drilling canned G12[X#][Y#]Z#


cycle. Use to drill holes R#Q#S#SA#
around the contour of a AS#RA#H#
circle. R is starting plane
and Z is total drill depth
for each hole. Q is
incremental depth
(peck). SA is circle start
angle (angle of first hole
too) and AS is angle
between holes. RA is
circle radius and H
specifies the number of
holes to drill.

G12 X0 Y0 Milling
Z-20 R2 Q5 machines
SA0 AS36
only
RA30 H10

G17

Selects the XY plane for G17


circular movements
(see G02 and G03).

G17

Milling
machines
only

G18

Selects the XZ plane for G18


circular movements
(see G02 and G03)

G18

Milling
machines
only

All
machines

G19

Selects the YZ plane for G19


circular movements
(see G02 and G03).

G19

Milling
machines
only

G20

Enforce use of
inches units.

G20

G20

All
machines

G21

Enforce use of
millimeter units.

G21

G21

All
machines

G28

Return home command. G28[X#][Y#][Z#]


This command will first
go to the programmed
position X/Y/Z and then
to the Xmin Ymax Zmax
of the machine axes. It
can be a convenient
way to end a program
putting the machine
table in a position to
change workpiece.

G28 Z10

Milling
and
turning
machines
only

G40

Cancel cutter
compensation
previously activated by
G41 or G42.

G40
More info

All
machines
except
the 3D
Printer

G41

Activates left side cutter G41[D#][P#]


compensation (or nose
radius compensation in
a lathe).

G41
More info

All
machines
except
the 3D
Printer

G42

Activates right side


G42[D#][P#]
cutter compensation (or
nose radius
compensation in a
lathe).

G42
More info

All
machines
except
the 3D
Printer

G43

Activates tool length


compensation.
(Optional, if not used,
automatic tool length
compensation will be
used).

G43 H2 Z2
More info

Milling
machines
only

G40

G43[H#][P#][Z#]

G49

Cancel tool length


compensation
(activated by G43).

G49

G49

Milling
machines
only

G53

Move in absolute noncompensated


coordinates.

G53 [X#][Y#][Z#]

G53 X0 Y0
Z100

All
machines

G54-G59

Fixture (work) offsets. A G54


typical use of these Gcodes is to establish a
local coordinate system
for each workpiece
when using multiple
ones. You need to setup
the offsets in the Zero
Points Data table in the
Inventory Browser (F2).
G54 corresponds to
offset registry index 0,
G55 to index number 1
etc

G00 G54 X0 All


Y0 Z3
machines

G54.1

Fixture (work) offsets. A G54.1 P# (0-99)


typical use of these Gcodes is to establish a
local coordinate system
for each workpiece
when using multiple
ones. You need to setup
the offsets in the Zero
Points Data table in the
Inventory Browser (F2).
G54.1 uses letter P to
specify the offset
registry index.

G54.1 P10
(Use work
offset 10)

All
machines

G61

Exact stop mode.

G61

G61

All
machines

G64

Normal stop mode


(cancels G61)

G64

G64

All
machines

G70

Finishing Cycle.

G70 [P#][Q#]

G70 P100
Q250

Turning
machines
only

After roughing, finishing


can be performed with
this cycle. P is first block
of finishing contour and
Q is the last block.
For more information
see: G71 Rough Turning
Cycle and G70 Finishing
Cycle.

G71

Rough Turning Cycle

G71

G71

Two block format


Roughing cycle.

Turning
machines
only

For more information


see: G71 Rough Turning
Cycle and G70 Finishing
Cycle.
G73

Peck drilling canned


G73 [X#][Y#][Z#]
cycle. The cycle is
[R#][Q#][P#]
intended for deep
drilling or chip breaking
milling operations. The
cycle retracts the tool to
break chips. Code letter
Q is used for peck size.
R is starting plane and Z
is total depth.
Parameter P is used for
dwell at each peck.
Please note that at the
end of the cycle, the
return position in Z is
controlled by G98 and
G99.

G73 Z-20
Milling
R1 Q1 P100 and
turning
machines
only

G74-G75

Generic
G74
drilling/boring/tapping [X#][Y#][Z#][R#]
canned cycle. These are
used in a generic way to
create compatibility
with many common
CNC controllers on the
market. They will bring
the tool to the
programmed Z depth. If
R is programmed it will
be used as the start
plane, if not the current
Z position will be used
as the start plane. All
other parameters will
be ignored.

G74 Z-20
R1

G76

Generic
drilling/boring/tapping
canned cycle. See G74G75 above.

Milling
machines
only

G76

Threading Cycle

Turning
machines
only

Milling
and
turning
machines
only

For more information


see: G76 Lathe
Threading Cycle
G80

Cancels any canned


cycle. Please note that
G00 G03 also cancels
canned cycles.

G80

G81

Basic drilling canned


G81
cycle. R is starting plane [X#][Y#][Z#][R#]
and Z is total depth.
Please note that at the
end of the cycle, the
return position in Z is
controlled by G98 and
G99.

G81 Z-6 R2 Milling


and
turning
machines
only

G82-G89

Generic
drilling/boring/tapping
canned cycle. Same as
G74-G76 above.

G82
[X#][Y#][Z#][R#]

G82 Z-20
R1

Milling
and
turning
machines
only

G90

Absolute programming
mode. Distances given
will move the tool
relative to an absolute
zero.

G90

G90 G00
X10 Y10

All
machines

G91

Incremental
programming mode.
Distances given will
move the tool relative
to the current position
of the tool.

G91

G91 G00 Z5 All


machines

G92

Use to reposition the


G92[X#][Y#][Z#]
origin point (zero point).

G92 X20
Y20 Z10

All
machines

G94

Set feed in millimeter or G94


inch per minute.

G94

Milling
machines

G95

Set feed per revolution


mode.

G95

Milling
machines

G96

Constant surface speed G96[S#]


control.

G96 S300

Turning
machines

G97

Cancel constant surface G97


speed control.

G97

Turning
machines

G95

G80

Milling
and
turning
machines
only

G98

Initial level return at the G98


end of a canned cycle.

G81 G98 Z- Milling


7 R2
and
turning
machines
only

G99

R level return at the end G99


of a canned cycle.

G81 G99 Z- Milling


7 R2
and
turning
machines
only

G71 Rough Turning Cycle and G70 Finishing Cycle


Codes and commands

Let's start with G71. This cycle is programmed by using two blocks.
Example:
N10 G71 U2 R1
N20 G71 P8 Q9 U0.4 W0
The parameters of the first block are:
U: The depth of cut during the cycle.
R: The retraction height for each completed cut.
The parameters of the second block are:
P: Start block number for the contour.
Q: End block number for the contour.
U: Finishing allowance in the X-axis.
W: Finishing allowance in the Z-axis.
If you load the turning center machine and then open the demo files, there is an example called:
Sample3_G70_G71_unit.CNC that you can try to see the cycle in action.

The G70 block at the end of the example is the Finishing Cycle. It simply repeats the blocks used in the G71 cycle but
instead of doing rough cuts it does a contour cut removing the material left from the finishing allowances.
Threads can be done externally or internally with this two-block threading canned cycle. Here is a brief explanation of
the cycle and its parameters.

The parameters of the first block are:


P: This parameter is composed of three values that control the thread behavior.
In the example above we have P010060. Let's take the numbers apart.
01: Number of spring cuts. This means, when done with the thread cuts, that the machine can be programmed to take a
number of extra cuts at the same depth to smooth the final thread.
00: Run out angle. The angle used to leave the thread.
60: Infeed angle. The angle used when entering the thread.
Q : Depth of each normal cut. This value is given in hundreds so the Q500 above means 0.5.
R: Depth of last or finish cut.
The parameters of the second block are:
X: End value in the X-axis.
Z: End value in the Z-axis.
P: Thread depth (radial value).
Q: Depth of first cut.

F: Thread pitch.
Note! The CNCSimulator Pro simplifies the threading process by ignoring some of the parameters, as for the simulation,
it is not important to take every parameter literary. The important parameters for the simulator are the following:
The Q parameter in the first block tells the simulator how much to take for each cut.
The X and Z values of the second block tells the simulator where to end the thread.
The F parameter of the second block tells the simulator the pitch of the thread.
There is an example among the demo programs called Sample4_G76_Threading_unit.cnc that you can run to see the
cycle in action
Other codes interpreted by the simulator

Format

Example

Code

Explanation

Absolute or
X#
incremental X
axis value used in
canned cycles
and codes like
G00-G03.

X2.43

Absolute or
Y#
incremental Y
axis value used in
canned cycles
and codes like
G00-G03.

Y1.16

Absolute or
Z#
incremental Z
axis value used in
canned cycles
and codes like
G00-G03.

Z-3.2

Represents the
I#
center in X in G02
and G03 circle/
arc commands.

G02 X34
Z106.867 I4.8 K0

Represents the
J#
center in Y in G02
and G03 circle/
arc commands.

G02 Y0 J-20

Represents the
K#
center in Z in G02
and G03 circle/
arc commands.

G02 X34
Z106.867 I4.8 K0

Selects a tool
from the user
defined tool

T1 M06

T#

registry in the
Inventory
Browser (F2).
M06 is used to
execute the
actual tool
change.
ET

Selects a tool
from the fixed
embedded tool
registry. M06 is
used to execute
the actual tool
change.

ET#

ET9 M06

DT

Selects a
DT#
predefined
milling tool. The
tool must first
have been
defined using the
$DefineMillTool
command. M06
is used to
execute the
actual tool
change.

DT3 M06

Defines spindle
rotation in
revolutions per
minute (RPM).

S2000

Defines feed rate F#


in millimeter or
inches per
minute.

F240

Used in M98 to
P#
define a sub
program number.
Also used as
dwell time in
canned cycles.

M98 P1001 L1

Used in M98 to
define the
number of
repetitions.

M98 P1001 L1

Sub program
O#
number. Should
be the first line of
every sub
program.

S#

L#

G73 Z-20 R2 Q5
P100 F350

(Drilling sub
program 1)
O1000

Reference or
starting plane in
canned cycles. R

R#

G81 Z-20 R2

is also used in
G02/G03 to
give the radius
when I/J/K are
not used.
Q

Peck size in
canned cycles.

Q#

G73 Z-20 R2 Q5
P0 F350

SA, AS, RA

Start Angle,
Angle Step and
Radius used in
G12 Circular
drilling cycle.

SA# AS# RA#

G12 X0 Y0 Z-20
R2 Q5 SA0 AS36
RA30 H10

Used for number


of holes in the
G12 Circular
drilling cycle.

G12 X0 Y0 Z-20
R2 Q5 SA0 AS36
RA30 H10

( and )

Used for
(text)
comments. G and
M codes inside
parenthesis will
not be executed.
$-commands will
be executed even
when inside the
parenthesis.

(Drilling sub
program 1)

Used for
comment out
one or several
lines. G, M and $commands will
not be executed.

G01 Z-20 F440


/G03 I23.2 J0
/G03 X15 I19
G00 Z7

Block number.

N#

N500

You might also like