You are on page 1of 20

Volume 1 Chapter 15 Working with Drill Cycles

15 Working with Drill Cycles


Drill cycles programmed in Mastercam can be processed in the post executable and the post
customization file using several different methods, depending on several factors:
! If the drill cycle will be output as a canned cycle that produces the NC output code as
parameterized lines, either the machine tool will generate the discrete moves to produce the drilled
hole, or the post executable will generate the discrete tool motion in the NC output.
! Prior to Mastercam V8, the NCI data for the drill cycles did not provide for a rapid position after
the tool change series of NCI lines and it did not accommodate subprograms. The NCI format for
drill cycles was redesigned with Mastercam Version 8 to correct these deficiencies. Posts not
written specifically for the new NCI format are processed in a special manner so that the behavior
and output is the same as when it was originally written.
! Other factors, such as the drill operation type (3- or 5-axis) and the procedure used in the post
customization file also influence how the NC output is generated.

Version 8 NCI drill cycle format changes


Mastercam Version 8 changed the NCI drilling format to a universal drilling format that is used by
3-, 4-, and 5-axis drilling operations. This change was made to support subprograms with drilling and
to avoid the need to generate null tool changes in the NCI for every drill position with 4 -axis drilling.

Null tool changes (NCI Gcode 1000) had been required to introduce the tool plane matrix necessary to
determine the angular movement, which required the drill cycle to be cancelled (NCI Gcode 80) for
each drill position in a new tool plane.

The new format also simplified the interpretation of 5-axis drilling because formerly there was no
vector data on the actual drill cycle (NCI Gcode 81). The post executable had to save the drill data
until the position move with 5-axis drilling.

Because of these changes, it has been necessary to provide a conversion process in the post executable
file to support the thousands of posts that were created before Mastercam V8 universal drilling format.

The new NCI drill data


This section describes the data as it comes from the NCI file and how it is processed for the post writer
prior to the calls to the output postblocks.

In the new NCI drilling format, the position data is described as a line with 3-dimensional endpoints at
the position represented by the bottom of the hole and the initial position of the tool above the drill
hole. Scalar positions along this line are then presented for the reference point, the top of stock, and the
point selected in Mastercam for the drill location.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-1


Volume 1 Chapter 15 Working with Drill Cycles

To keep the existing post customization files compatible and, in general, to provide more usable data to
the post writer, the NCI data is then converted to represent the data as in the earlier NCI format. The
data presented for 3-axis drilling and 5-axis drilling has always been different, and those differences
have been maintained.

NCI Gcode 81
The following table describes the two-line set of NCI Gcode 81 (which defines the drill cycle) data
read from the NCI file. The second line shows the parameters that are written to the line. Below the
represented NCI line set is a table with a description of each parameter that was written.
Note: The table does not list the specific variable labels for the NCI values, just a description of each
parameter value. See Volume 3, The NCI File for detailed descriptions.
81

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19

Parameter Description

1 Drill cycle type

2 Absolute X position of the drill point at the bottom (Z in Lathe)

3 Absolute Y position of the drill point at the bottom (X in Lathe)

4 Absolute Z position of the drill point at the bottom (zero in Lathe)

5 Dwell time

6 Feed rate

7 First peck amount

8 Subsequent peck amount

9 Peck clearance

10 Chip break retract

11 Distance from the selected drill position to the initial height, sign positive for above
selected drill position

12 Distance from the selected drill position to the reference height, sign positive for above
selected drill position

13 Distance from the selected drill position to the top of stock, sign positive for above
selected drill position

14 Boring bar clearance shift amount

15-2 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

Parameter Description

15 Absolute U position of the initial height point (W in Lathe)

16 Absolute V position of the initial height point (U in Lathe)

17 Absolute W position of the initial height point (zero in Lathe)

18 Control flags

19 Reverse the drill direction from the UVW point to the XYZ point.

NCI Gcode 81 variables (3-axis)


The following table describes the resulting numeric variables and the form of the values for 3-axis
drilling with NCI Gcode 81 data before any manipulation by rotary axis routines.
Variable Description
Label

drillcyc Drill cycle type (as read):


0: Simple drilling
1: Peck drilling
2: Chip break
3: Tap
4: Bore #1
5: Bore #2
6: Misc. #1
7: Misc. #2
8-19: Custom cycles
xnci Absolute X position of the drill point at the bottom
ynci Absolute Y position of the drill point at the bottom (zero in Lathe)
znci Absolute Z position of the drill point at the bottom
depth Absolute Z position of the drill point at the bottom
dwell Dwell time (as read)
frplunge Feed rate (as read)
peck1 Incremental distance, first peck amount (as read)
peck2 Incremental distance, additional peck amounts (as read)

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-3


Volume 1 Chapter 15 Working with Drill Cycles

Variable Description
Label

peckclr Incremental distance, peck clearance (as read)


retr Incremental distance, chip break retract (as read)
shftdrl Incremental distance, boring bar clearance shift amount (as read)
zdrl Absolute position of the Z location of the selected drill point
refht Absolute position of the Z location of the reference height
initht Absolute position of the Z location of the initial height
tosz Absolute position of the Z location of the top of stock
u Absolute X position of the initial height point
v Absolute Y position of the initial height point (zero in Lathe)
w Absolute Z position of the initial height point
cur_cflg Control flags
rev_drl5 Reverse the drill direction from the UVW point to the XYZ point (as read).

NCI Gcode 81 variables (5-axis)


The following table describes the resulting numeric variables and the form of the values for 5-axis
drilling with NCI Gcode 81 data before any manipulation by rotary axis routines.

Variable Description
Label

drillcyc Drill cycle type (as read):


100: Simple drilling
101: Peck drilling
102: Chip break
103: Tap
104: Bore #1
105: Bore #2
106: Misc. #1
107: Misc. #2
108-119: Custom cycles
xnci Absolute X position of the drill point at the bottom
15-4 Mastercam Version 9 MP Post Processor Reference Guide June 2002
Volume 1 Chapter 15 Working with Drill Cycles

Variable Description
Label

ynci Absolute Y position of the drill point at the bottom (zero in Lathe)
znci Absolute Z position of the drill point at the bottom
depth Incremental distance from reference height to the bottom.
dwell Dwell time (as read)
frplunge Feed rate (as read)
peck1 Incremental distance, first peck amount (as read)
peck2 Incremental distance, additional peck amounts (as read)
peckclr Incremental distance, peck clearance (as read)
retr Incremental distance, chip break retract (as read)
shftdrl Incremental distance, boring bar clearance shift amount (as read)
zdrl The selected drill point (always zero)
refht Incremental distance from the selected drill point to reference height.
initht Incremental distance from the selected drill point to initial height.
u Absolute X position of the reference height point
v Absolute Y position of the reference height point
w Absolute Z position of the reference height point
cur_cflg Control flags
rev_drl5 Reverse the drill direction from the UVW point to the XYZ point (as read).

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-5


Volume 1 Chapter 15 Working with Drill Cycles

NCI Gcode 100


This line represents the “two line set” of NCI Gcode 100 (which defines additional points with drill
cycle) data read from the NCI file.
Note: Mastercam Lathe toolpaths are not expected to produce the NCI Gcode 100.
100

1 2 3 4 5 6 7 8 9 10 11 12 13

Parameter Description

1 Drill cycle type


2 Absolute X position of the drill point at the bottom
3 Absolute Y position of the drill point at the bottom
4 Absolute Z position of the drill point at the bottom
5 Distance from the selected drill position to the initial height, sign positive for above
selected drill position
6 Distance from the selected drill position to the reference height, sign positive for above
selected drill position
7 Dwell time
8 Feed rate
9 Absolute U position of the initial height point
10 Absolute V position of the initial height point
11 Absolute W position of the initial height point
12 Control flags
13 Reverse the drill direction from the UVW point to the XYZ point.

15-6 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

NCI Gcode 100 variables (3-axis)


The following table describes the resulting numeric variables and the form of the values for 3-axis
drilling with NCI Gcode 100 data before any manipulation by rotary axis routines.

The NCI Gcode 100 variables are unique in that the numeric variables for u, v and w are relative to the
original tool plane matrix defined with the NCI Gcode 81 tool change preceding the NCI Gcode 100.
This rotation, which is defined with the rotary axis selection in Mastercam, is used by the post
executable to create a new tool plane matrix relative to the NCI Gcode 100 drill position. Backwards
compatibility is maintained by rotating the NCI data for the endpoints into the new tool plane.

Variable Description
Label

xnci Absolute X position of the drill point at the bottom


ynci Absolute Y position of the drill point at the bottom (zero in Lathe)
znci Absolute Z position of the drill point at the bottom
depth Absolute Z position of the drill point at the bottom
dwell Dwell time (as read)
frplunge Feed rate (as read)
zdrl Absolute position of the Z location of the selected drill point
refht Absolute position of the Z location of the reference height
u Absolute X position of the initial height point
v Absolute Y position of the initial height point (zero in Lathe)
w Absolute Z position of the initial height point
cur_cflg Control flags
rev_drl5 Reverse the drill direction from the UVW point to the XYZ point (as read).

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-7


Volume 1 Chapter 15 Working with Drill Cycles

NCI Gcode 100 variables (5-axis)


The table below describes the resulting numeric variables and the form of the values for 5-axis drilling
with NCI Gcode 100 data before any manipulation by rotary axis routines.

Variable Description
Label

xnci Absolute X position of the drill point at the bottom


ynci Absolute Y position of the drill point at the bottom (zero in Lathe)
znci Absolute Z position of the drill point at the bottom
depth Incremental distance from reference height to the bottom.
dwell Dwell time (as read)
frplunge Feed rate (as read)
zdrl The selected drill point (always zero)
refht Incremental distance from the selected drill point to reference height.
u Absolute X position of the reference height point
v Absolute Y position of the reference height point
w Absolute Z position of the reference height point
cur_cflg Control flags
rev_drl5 Reverse the drill direction from the UVW point to the XYZ point (as read).

Additional NCI drill parameter data


Mastercam Version 8 added additional parameters to the drill cycle NCI output, the NCI Gcode 82
line, which is output in the NCI file just prior to the NCI Gcode 81 line. These parameters are provided
for custom use when the number of parameters on the standard NCI Gcode 81 line is not adequate.
The following illustration shows the dialog box used to enter the values in Mastercam.
See Volume 3, The NCI File for more information.

15-8 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

Processing with rpd_typ_v7


The numeric variable rpd_typ_v7 was added to the MP language for Mastercam Version 8. It alters
internal post executable routines and data reading functions to avoid version change problems that
occur when features are added and data changed.

Processing with rpd_typ_v7 enabled (old form)


Mastercam V8 always writes the tool change rapid position from the tool change line (NCI Gcode
1000, 1001 and 1002) after the tool change line in the NCI file. The move is written as a rapid position.
This can be in the form of the NCI Gcode 0 or 11 with feed rate set to –2, depending on the toolpath
type.

In earlier versions of Mastercam, this rapid position was never written and the post customization file
would either call back to the tool change postblock or create the rapid positioning during the drill cycle
postblock calls. With the introduction of the mandatory rapid position in the NCI file, errors during
posting and in the NC output can be generated in posts written for the earlier NCI format when the
added rapid NCI line is encountered.

To avoid these problems, the numeric variable rpd_typ_v7 is added to the post customization file and is
set to 1. rpd_typ_v7 skips the rapid position after the tool change in the NCI file and reads the next two-
line set from the NCI file. This is usually the drill cycle definition (NCI Gcode 81) that was expected
by the older post customization file. rpd_typ_v7 also skips the new long code drilling calls if set on and
rotaxtyp is set to less than 6. See Volume 2, Rotary Processing for more information.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-9


Volume 1 Chapter 15 Working with Drill Cycles

Processing with rpd_typ_v7 disabled (new form)


With the rpd_typ_v7 numeric variable set to 0 (that is, disabled), the post executable reads the added
rapid NCI line. This is desirable for two reasons:
! The tlchng_aft (tool change after) routine functions correctly in all cases. You can retrieve a valid
position move. This is required with 5-axis if you want to know the rotary positions in the tool
change postblock.
! The enhanced long drill cycles are available.

Processing long code


To enable drill cycle long code, set the numeric variables in the post customization (.PST) file as
follows:
usecandrill : no # Use canned cycle for drill
usecanpeck : no # Use canned cycle for peck
usecanchip : no # Use canned cycle for chip break
usecantap : no # Use canned cycle for tap
usecanbore1 : no # Use canned cycle for bore1
usecanbore2 : no # Use canned cycle for bore2
usecanmisc : no # Use canned cycle for misc1
1
usecanmisc : no # Use canned cycle for misc2
2

Drill cycle long code processing has been enhanced in the post executable file when the numeric
variable rpd_typ_v7 is disabled (that is, omitted or set to 0). The enhanced drill cycle long code provides
support in the post executable for tap, bore1, bore2, misc1 and misc2 drilling and boring cycles. All
these cycles are also supported with 5-axis drilling.

When numeric variable rpd_typ_v7 has been enabled, as required for earlier post customization files, the
long cycle drill motion must be explicitly generated in the post customization file for 5-axis drilling and
the tap, bore1, bore2, misc1 and misc2 drilling and boring cycles.
Note: With rpd_typ_v7 enabled, tap, bore1, bore2, misc1 and misc2 drilling and boring cycles call the
drill (feed in, rapid out) long code output.

15-10 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

The following tables describe the enhanced drill cycle long code, the variables modified, and postblock
calls generated.

Simple drill (drillcyc = 0)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

If retrefht = 0 and initial gcode = 0


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-11


Volume 1 Chapter 15 Working with Drill Cycles

Peck drill (drillcyc = 1)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Peck loop, continue until depth reached

Feed in Feed from reference gcode = 1 pz or plin


height incremental first bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv
peck distance on first
peck. Add second peck
distance on additional
pecks.

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Rapid out Rapid to reference gcode = 0 prapid or pzrapid


height. (Not done when bug9 = 4
xnci, ynci, znci, fr, fr_pos, ipr_actv
depth reached.)

Rapid in Rapid to last depth plus gcode = 0


clearance distance. (Not bug9 = 5
xnci, ynci, znci, fr, fr_pos, ipr_actv
done when depth
reached.)

End Peck Loop

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

If retrefht = 0 and initial gcode = 0


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

15-12 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

Chip break drill (drillcyc = 2)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Peck Loop, continue until depth reached

Feed in Feed from reference gcode = 1 pz or plin


height incremental first bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv
peck distance on first
peck. Add second peck
distance on additional
pecks.

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Rapid up Rapid from current depth gcode = 0 prapid or pzrapid


by retract distance. (Not bug9 = 4
xnci, ynci, znci, fr, fr_pos, ipr_actv
done when depth
reached.)

Rapid in Rapid to last depth plus gcode = 0


clearance distance. (Not bug9 = 5
xnci, ynci, znci, fr, fr_pos, ipr_actv
done when depth
reached.)

End Peck Loop

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

If retrefht = 0 and initial


height does not equal
reference height, rapid to
initial height.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-13


Volume 1 Chapter 15 Working with Drill Cycles

Tap (drillcyc = 3)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Reverse Spindle reversal. Mill gcode = 4 pdwl_spd


Spindle changes sign of ss. bug9 = 3
ss, spdir, css_actv
Lathe changes sign of
spdir.

Feed out If retrefht = 0, current gcode = 1 pz or plin


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Feed to current position.

Restore Spindle is reset to initial gcode = 4 pdwl_spd


Spindle setting. bug9 = 7
ss, spdir, css_actv

Rapid out If retrefht = 0 and initial gcode = 0 prapid or pzrapid


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

15-14 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

Bore, feed out (drillcyc = 4)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Feed out If retrefht = 0, current gcode = 1 pz or plin


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Feed to current position.

Rapid out If retrefht = 0 and initial gcode = 0 prapid or pzrapid


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-15


Volume 1 Chapter 15 Working with Drill Cycles

Bore, stop, rapid out (drillcyc = 5)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Spindle Spindle stop. Mill ss = 0. gcode = 4 pdwl_spd


Stop Lathe spdir = 0. bug9 = 3
ss, spdir, css_actv

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

Restore Spindle is reset to initial gcode = 4 pdwl_spd


Spindle setting. bug9 = 7
ss, spdir, css_actv

Rapid out If retrefht = 0 and initial gcode = 0 prapid or pzrapid


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

15-16 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

Bore, fine (drillcyc = 6)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Spindle Spindle stop. Mill ss = 0. gcode = 4 pdwl_spd


Stop Lathe spdir = 0. bug9 = 3
ss, spdir, css_actv

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

Restore Spindle is reset to initial gcode = 4 pdwl_spd


Spindle setting. bug9 = 7
ss, spdir, css_actv

Rapid out If retrefht = 0 and initial gcode = 0 prapid or pzrapid


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-17


Volume 1 Chapter 15 Working with Drill Cycles

Bore, standard (drillcyc = 7)

Action Description Variables Calls

Rapid If initial height does not gcode = 0 prapid or pzrapid


equal reference height, bug9 = 1
xnci, ynci, znci, fr, fr_pos, ipr_actv
rapid to reference height.

Feed in Feed to depth. gcode = 1 pz or plin


bug9 = 2
xnci, ynci, znci, fr, fr_pos, ipr_actv

Dwell Dwell, if not 0. gcode = 4 pdwl_spd


bug9 = 3
dwell

Rapid out If retrefht = 0, current gcode = 0 prapid or pzrapid


position is initial height. bug9 = 6
xnci, ynci, znci, fr, fr_pos, ipr_actv
If retrefht = 1, current
position is reference
height.
Rapid to current position.

If retrefht = 0 and initial gcode = 0


height does not equal bug9 = 8
xnci, ynci, znci, fr, fr_pos, ipr_actv
reference height, rapid to
initial height.

Cancel drill cycles


NCI Gcode 80 indicates the end of a drill cycle and drilled positions in the NCI file. The variable
rtnrefht controls the Z-axis location where a drill cycle returns as follows:
! When rtnrefht = 0, return to the location of the initial height (initht).
! When rtnrefht = 1, return to the location of the reference height (refht ).

This is important with canned drill cycle calls because the last Z location perceived by the post
executable is at the final drill depth. With the long code output enabled (that is, when one of the
usecan… variables is set to 0), the final position is controlled by the position output with linear motion
generated in the post executable. The canned drill cycle output returns the Z location internally just
before the call to the postblock pcanceldc by setting the numeric variable z. There is no Z location
adjustment if this is a 5-axis drill routine (drill5 = 1). In the postblock pcanceldc the numeric variable z
should be updated.

15-18 Mastercam Version 9 MP Post Processor Reference Guide June 2002


Volume 1 Chapter 15 Working with Drill Cycles

pcanceldc # Cancel canned drill cycle


!z
n, "G80", e

Any other position can be stated as the last Z drill position by explicitly defining z or prv_z in the
postblock pcanceldc. For example:
pcanceldc # Cancel canned drill cycle
z = 10.
!z
n, "G80", e

Custom drill cycles


Custom drill cycles 8 through 19 were added in Mastercam Version 8. These are not supported as long
code and are for customized cycles only. The NCI Gcode 81 line is processed as any other canned drill
cycle. The exception is that only a single predefined postblock pdrlcst is called for all NCI Gcode 81
(drill definition) in the Mill and Lathe post executable. In Wire, the single predefined postblock pcancst
is called.
Additional drill hole NCI Gcode100 line within the custom drill cycles range call postblock pdrlcst_2 in
Mill and Lathe and call the postblock pdrlcst_2 in Wire. The post customization file must have code to
handle any conditional branching required for the particular drill cycle selection drillcyc. For example:
pdrlcst # Custom drill cycles 8 - 19 (user option)
if drillcyc = 8, pdrlcst8
if drillcyc = 9, pdrlcst9

pdrlcst_2 # Custom drill cycles 8 - 19, additional points (user option)


if drillcyc = 8, pdrlcst8
if drillcyc = 9, pdrlcst9

pdrlcst8 # Custom drill cycle 8


n, “DEF”, x, y, z, e

pdrlcst9 # Custom drill cycle 9


n, “REP”, x, y, z, e

June 2002 Mastercam Version 9 MP Post Processor Reference Guide 15-19


Volume 1 Chapter 15 Working with Drill Cycles

15-20 Mastercam Version 9 MP Post Processor Reference Guide June 2002

You might also like