Professional Documents
Culture Documents
In this document and also in the MP Post Reference Guide itself, the following color-coding scheme
has been used to highlight changes.
Chapter 3, Formulas
Mill/Router/Lathe Wire
plin_end plin_end
pcir_end pcir_end
pmx_end pedm_end
pdrl_end pcan_end
pthd_end plow_uv_end
psof_end psof_end
ptlchg0_end ptlchg0_end
ptlchg_end ptlchg_end
M/L/W/R pcomment0
Postblock Type Standard postblock, Command postblock
NCI Gcode 1005, 1006, 1007, 1008
Category Comment
Description This postblock is called every time a comment is read in from the NCI
file. This allows the post to examine the comment gcode
(1005,1006,1007,1008) and the actual comment string, which is passed
in the pre-defined string variable scomm0. You can also examine the
value in the variable comm._cnt.
Dependencies
Notes See Volume 1, How Comments from the NCI Work for more
information!
M/L/W/R pcomment_end
Postblock Type Standard postblock, Command postblock
NCI Gcode 1005, 1006, 1007, 1008
Category Comment
Description This postblock is called after the comment output loop (calls to the
pcomment postblock). The comm_cnt variable is reset to zero on this call.
Dependencies
Notes See Volume 1, How Comments from the NCI Work for more
information!
R pblockdrl
Postblock Type Standard postblock
NCI Gcode 83
Category Drill (Block drilling)
Description See note below
Dependencies
M/L/R plin_end
Postblock Type Standard postblock
NCI Gcode 1
Category Linear feed
Description This postblock is called after all calls to plin are completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes The plin (mlin or llin) linear output postblocks may be called multiple times
to process an move depending on any motion breakup in effect. lin_end is
called after the linear motion is processed.
See the related pcir_end postblock
W plin_end
Postblock Type Standard postblock
NCI Gcode 1 (also 21, 31 if 4-axis Wire path)
Category Linear feed
Description This postblock is called after all calls to plin are completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes The plin linear output postblocks may be called multiple times to process
a move depending on any motion breakup in effect. plin_end is called
after the linear motion is processed.
See the related pcir_end postblock for Wire
M/L/R pcir_end
Postblock Type Standard postblock
NCI Gcode 2, 3
Category Arc
Description This postblock is called after all calls to pcir are completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on NCI Gcode 2 or 3 termination.
The pcir (mcir or lcir) circular output postblocks may be called multiple
times to process an arc move depending on any motion breakup in effect.
(breakarcs : 1 # break arc at quadrants)
pcir_end is called after the arc motion is processed.
See the related plin_end postblock
W pcir_end
Postblock Type Standard postblock
NCI Gcode 2, 3, 32, 33
Category Arc
Description This postblock is called after all calls to pcir are completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on NCI Gcode 2, 3, 32, 33 termination.
The pcir circular output postblocks may be called multiple times to
process an arc move depending on any motion breakup in effect.
(breakarcs : 1 # break arc at quadrants)
pcir_end is called after the arc motion is processed.
See the related plin_end postblock
M/L/R pmx_end
Postblock Type Standard postblock
NCI Gcode 11
Category 5-axis motion
Description This postblock is called after the call to pmx is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on NCI Gcode 11 termination
W pedm_end
Postblock Type Standard postblock
NCI Gcode 11
Category UV taper
Description This postblock is called after the call to pedm is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on NCI Gcode 11 termination (4-axis taper mode path).
See the related pedm postblock
M/L/R pdrl_end
Postblock Type Standard postblock
NCI Gcode 81, 100
Category Drill
Description This postblock is called after all calls to the active canned cycle
postblock are completed.
Dependencies
Assigned or
Calculated
Variables
Recommended Variables common to drill canned cycle Gcode 81
Variables Variables common to drill canned cycle Gcode 100
Code Example
W pcan_end
Postblock Type Standard postblock
NCI Gcode 81, 100
Category Wire canned cycle
Description This postblock is called after all calls to the active canned cycle
postblock are completed.
Dependencies
L pthd_end
Postblock Type Standard postblock
NCI Gcode 201
Category Threading
Description This postblock is called after the calls to the threading postblocks are
completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on Gcode 201 termination.
See related lathe threading postblocks.
See Volume 3, Lathe Threading Cycles for more information.
W plow_uv_end
Postblock Type Standard postblock
NCI Gcode 20, 21, 22, 23
Category UV direct
Description This postblock is called after the call to plin or pcir is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on NCI Gcode 20,21, 22, 23 termination (4-axis direct mode path).
See the related postblocks plin and pcir
M/L/R/W psof_end
Postblock Type Standard postblock
NCI Gcode 1001
Category Start of file
Description This postblock is called after the call to psof is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on Gcode 1001 termination or tlchng_aft completion.
See tlchng_aft in Volume 3, Numeric Variables for more information.
See ptlchg1002 postblock for related information.
M/L/R/W ptlchg0_end
Postblock Type Standard postblock
NCI Gcode 1000
Category Null tool change
Description This postblock is called after the call to ptlchg0 is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on Gcode 1000 termination or tlchng_aft completion.
See related ptlchg0 postblock for Mill/Lathe/Router.
See related ptlchg0 postblock for Wire.
M/L/R/W ptlchg_end
Postblock Type Standard postblock
NCI Gcode 1002
Category Null tool change
Description This postblock is called after the call to ptlchg is completed.
Dependencies None
Assigned or
Calculated
Variables
Recommended
Variables
Code Example Post dependent
Notes Called on Gcode 1002 termination or tlchng_aft completion.
See related ptlchg postblock for Mill/Lathe/Router.
See related ptlchg postblock for Wire.
mprint
Formula Type File function
Description Displays a message to the screen. The output message is not written to
the NC output. The return value is 0 if numeric variable was passed, or
1 if a string variable was passed to the function.
Form function argument
Argument numeric variable, value
string variable
Return Type numeric variable (scalar)
Formula Code Ex. string1 “ERROR FOUND”
real_var : 100
pblock # A postblock
real_result = mprint (string1)
real_result = mprint (real_var)
Added descriptions for the new SIM information variables: sim_no and sim_type.
Added description for the new Contour Flag style option switch: skp_lead_flgs.
Added description for the new end_ variables available in the ptoolend postblock: end_op_id, end_opcode,
end_tlplnno
Added descriptions for the new block drilling variables for Router
bdrl_ofs_x, bdrl_ofs_y, bdrl_ofs_z
bdrl_tool_grp
bdrl_tool_no
bdrl_use_lead
bdrl_wrk_ofs
ra_offset
ra_rot_head
ra_translated
ra_type
Deleted entries for these variable descriptions. (They no longer exist.): ra_strt_on, ra_on, ra_length
R bdrl_ofs_x
Variable Type NCI variable
Category Block drilling (Router)
Description Distance of drill hole minus the lead drill position - X
Values
R bdrl_ofs_y
Variable Type NCI variable
Category Block drilling (Router)
Description Distance of drill hole minus the lead drill position - Y
Values
R bdrl_ofs_z
Variable Type NCI variable
Category Block drilling (Router)
Description Distance of drill hole minus the lead drill position -Z
Values
R bdrl_tool_grp
Variable Type NCI variable
Category Block drilling
Description Block drill group number
Values
R bdrl_u
Variable Type NCI variable
Category Block drilling
Description Position of lead drill at initial height - X
Values
R bdrl_v
Variable Type NCI variable
Category Block drilling
Description Position of lead drill at initial height – Y
Values
R bdrl_w
Variable Type NCI variable
Category Block drilling
Description Position of lead drill at initial height – Z
Values
R bdrl_use_lead
Variable Type Post switch variable
Category Post switch, Preparatory
Description Output the lead drill (on block drilling) as the drill position
Values
0 No
1 Yes
Code Example none
R bdrl_wrk_ofs
Variable Type NCI variable
Category Block drilling
Description Work offset for drill position
Values
R bdrl_x
Variable Type NCI variable
Category Block drilling
Description Lead drill position at depth - X
Values
R bdrl_y
Variable Type NCI variable
Category Block drilling
Description Lead drill position at depth - Y
Values
R bdrl_z
Variable Type NCI variable
Category Block drilling
Description Lead drill position at depth - Z
Values
R bdrl_x2
Variable Type NCI variable
Category Block drilling
Description X position for pblockdrl data collection
Values
R bdrl_y2
Variable Type NCI variable
Category Block drilling
Description Y position for pblockdrl data collection
Values
R bdrl_z2
Variable Type NCI variable
Category Block drilling
Description Z position for pblockdrl data collection
Values
comm_call
Variable Type Calculated variable
Category Comment
Description Reports how many times the comment output loop has been
called (calls to the pcomment postblock), either by the command
word comment, or internally from MP.This makes the count from
a tool change different than from a motion postblock call.
Values Value
Code Example None
Notes Initializing comm._cnt = -1, will allow the comment output loop to
be called only with the command word comment.
See Volume 1, Posting Comments into the NC File for more
information.
comm_cnt
Variable Type Calculated variable
Category Comment
Description Reports how many comments have been buffered in from the
NCI data prior to output in a comment output loop.
Values Value
Code Example None
Notes comm._cnt allows the user to control the comment buffer output
by redefining the number of comments that MP has written to the
comment buffer. This tricks the MP executable into ending or
rereading the buffered comments
See Volume 1, Posting Comments into the NC File for more
information.
end_op_id
Variable Type Calculated variable
Category Tool change information, operation type
Description In postblock ptoolend, this is the Operation ID on the next tool
change.
Values Value
Code Example ptoolend #End of tool path, before reading new tool data
if end_gcode = 1000,
[
#Null toolchange
if end_op_id <> op_id, pretract_mov
]
else,
[
#Actual toolchange
pretract
]
Notes
end_opcode
Variable Type Calculated variable
Category Tool change information, operation type
Description In postblock ptoolend, this is the Operation code on the next tool
change.
Values Value
Code Example ptoolend #End of tool path, before reading new tool data
if end_gcode = 1000,
[
#Null toolchange
if end_op_id <> op_id, pretract_mov
]
else,
[
#Actual toolchange
pretract
]
Notes
end_tlplnno
Variable Type Calculated variable
Category
M R ra_head_no
Variable Type NCI variable
Category Right-angle head support
Description Head number
Values
Notes
M R ra_offset
Variable Type NCI variable
Category Right-angle head support
Description Work offset overide
Notes
M R ra_rot_head
Variable Type NCI variable
Category Right-angle head support
Description Flags when the head has rotary capabilities
Values
0 Fixed head
1 Rotary motion in head
Code Example none
M R ra_translated
Variable Type NCI variable
Category Right-angle head support
Description Flags coordinate translation.
Values
0 Coordinates are not translated to the machine view.
1 All coordinates are translated to the machine view.
Notes From parameter 16 of the 1028 NCI line
M R ra_type
Variable Type NCI variable
Category Right-angle head support
Description Defines head type
Values
0 No head (off)
1 Right angle
2 Compound angle
3 Block drill
Notes
M R L W redo_proc
Variable Type Command variable
Category Process control
Description The command variable redo_proc allows exiting the current
postline and all subsequent processing on the current NCI line.
The posting process is then restarted on the NCI line that the
redo_proc exited on. The purpose of this command variable is to
enter an internal MP procedure and then abort the process in
order to restart it with a different condition. Some examplese are
to linearize arcs after calling into pcir, to break lines after calling
into plin, to switch long drill cycles on or off, etc.
To avoid endless looping, a call to redo_proc is performed once
and then is disabled until the next NCI line is read.
Caution: This procedure can produce undesirable effects on tool
tables, etc. There is no control over what internal variables are
updated before a procedure is restarted! Generally, the sooner
the procedure is aborted, the safer it is.
New postblocks have been added to allow the user to see when
the procedure has exited in the normal read loop. These
postblocks are called just before the next NCI line set is read.
Variables can safely be reset here that are modified before the
redo_proc is called.
Added Mill/Router/Lathe postlocks:
plin_end - Gcode 0 or 1 termination
pcir_end - Gcode 2 or 3 termination
pmx_end - Gcode 11 termination
pdrl_end - Gcode 81 or 100 termination
pthd_end - Gcode 201 termination
psof_end - Gcode 1001 termination or tlchng_aft completion
ptlchg0_end - Gcode 1000 termination or tlchng_aft completion
sim_no
Variable Type Global variable
Category SIM (HASP) data
Description Holds the SIM (HASP) serial number.
Values Value
Code Example None
sim_type
Variable Type Global variable
Category SIM (HASP) data
Description Holds the SIM (HASP) user type
Values
0 industrial
1 educational
2 dealer
3 control
Code Example None
skp_lead_flgs
Variable Type Post switch variable
Category Post switch, Process modification
Description Controls the handling of the contour flags.
Values
Notes Indicates that the new style leads (2000s and 200s, 3000s and
300s) for cstart and cend are to be converted to Version 9.0 and
earlier style. This replaces the rpd_typ_v7 variable that was used in
Wire for this purpose.
See cur_cflg for contour flag information.
M / L ra_strt_on
Variable Type NCI variable
Category Future development
Notes Right-angle head support
M / L ra_on
Variable Type NCI variable
Category Future development
Notes Right-angle head support
M / L ra_length
Variable Type NCI variable
Category Future development
Notes Right-angle head support
Added descriptions for the new NCI code 1028 (Lathe and Mill).
g
1 2 3 4 5 6 7 8 9 10 11 1213 14 15 16 17
g 1027 gcode
1 Holder type ra_type 0 No head
1 Right-angle
2 Compound
3 Block drill
2 Offset register ra_offset
3 Tool path pector X ra_vecx
4 Tool path pector Y ra_vecy
5 Tool path vector Z ra_vecz
6 Tool initial vector X ra_svecx
7 Tool initial vector Y ra_svecy
8 Tool initial vector Z ra_svecz
9 Head offset X ra_hvecx
10 Head offset Y ra_hvecy
11 Head offset Z ra_hvecz
12 Tool offset X ra_tvecx
13 Tool offset Y ra_tvecy
14 Tool offset Z ra_tvecz
15 Head number ra_head_no only used for block drilling
16 ra_translated 0 coordinates no translated
1 coordinates are translated to the
machine view
17 ra_rot_head 0 Fixed-head
1 roatry motion in head
g 83 gcode
1 Lead drill at depth - X bdrl_x
2 Lead drill at depth - Y bdrl_y
3 Lead drill at depth - Z bdrl_z
4 Distance of drill hole bdrl_ofs_x
minus lead drill
position - X
5 Distance of drill hole bdrl_ofs_y
minus lead drill
position - Y
6 Distance of drill hole bdrl_ofs_z
minus lead drill
position - Z
7 Group number bdrl_tool_grp
8 Work offset for drill bdrl_wrk_ofs
position
9 Position of lead drill bdrl_u
at initial height - X
10 Position of lead drill bdrl_v
at initial height – Y
11 Position of lead drill bdrl_w
at initial height – Z
12 Bitwise tool number, bdrl_tool_no – In this parameter, the data stored in
first head bdrl_tool_no9 “bitwise” format. TEN separate post
variables are extracted from it.
bdrl_tool_no, bdrl_tool_no2,
bdrl_tool_no3, through
bdrl_tool_no9
Note: The G83 NCI data is ONLY written by the Mastercam ROUTER product.
g 1013 gcode
1 Cutter
compensation cc 0 Cutter compensation modal
use
40 Cancel cutter compensation in the
control
41 Cutter compensation in the control
= left
42 Cutter compensation in the control
= right
140 Cancel cutter compensation last
move in the contour
2 Tool (wire) tldia
diameter
3 Tool (wire) tlrad
radius
4 Overburn
overburn
amount
5 Wire status wire 0 Off
1 On
6 Power status power 0 Off
1 On
7 Work origin X wox
Note: These are partial lists. Other parameters may have been changed. See the complete document
for color-coded changes.
Added parameters Æ
Added parameters Æ
10205 lrough_ltol
10703 lgroove_peck_number
10704 lgroove_peck_incr
10706 lgroove_last_incr
10742 lgroove_retract_incr
10741 lgroove_retract_incr
10724 lgroove_peck_number
10725 lgroove_peck_incr
10726 lgroove_last_incr
10728 lgroove_retract_incr
10729 lgroove_retract_incr
10315 lgroove_peck_number
10316 lgroove_peck_incr
10318 lgroove_last_incr
10742 lgroove_retract_incr
10320 lgroove_retract_incr
(was) 13129 0 = use number of steps, 1 = use step, 2 = use percent of tool width
(now) 13129 Rough step: 0 = use number of steps, 1 = use step, 2 = use percent of tool width
Added parameter Æ
10205 lrough_ltol
(was) 10251 True = use edge percentage, False = use edge distance
(now) 10251 Use "solid hidden face" (True/False)
Added parameters Æ
Added parameters Æ
12121 Corner
12122 upalong
Added parameter Æ
Added parameter Æ
Added parameters Æ
12121 Corner
12122 Upalong
(now)
12128 How shallow is to be used in contour:
0=shallow is off, remove cuts, allow partial
1=shallow is off, remove cuts, disallow partial
2=shallow is off, add cuts, allow partial
3=shallow is off, add cuts, disallow partial
10=shallow is on, remove cuts, allow partial
11=shallow is on, remove cuts, disallow partial
12=shallow is on, add cuts, allow partial
13=shallow is on, add cuts, disallow partial
12129 Minimum stepdown to add cuts to shallow area:
Added parameters Æ
Added parameters Æ
10415 True = climb, false = conventional cut
10223 Prompt for relative start point (True/False)
12104 Plunge distance
12105 Retract distance
10200 Machining angle (bias angle)
12263 True = ignore climb(/conv.) flag
12424 Number of total passes
12054 Stepover for offset passes
12428 Tangent line length (gap setting)
Added parameters Æ
12307 True = include cuts outside from/to range, false = do not include them
12428 Tangent line length (gap setting_
Added parameters Æ
12428 Tangent line length (gap setting)
12430 True = skip internal lines in 3d collapse
Added parameters Æ
12421 True = row only (v8 code), false = grid (v9)
12427 Tool display and NCI output length
Added parameters Æ
12427 Tool display and NCI length
Added parameters Æ
12265 Do finish passes at all depths (True/False)
12429 Use zigzag muliple passes (True/False)
(was) 12231 z
(now) 12231 Axis Depth (abs)
12235 trim_sign[2]
12236 trim_sign[2]
Added parameter Æ
12409 Infinite look ahead enabled (True/False)
(was) 12246 1 or 2
(now) 12246 Number of across contours: 1 or 2
15301 View RB
15305 Default diameter
15306 Sel
15340 True = NCI section has been read in, False = go get it when needed
15499 Geometry sub-tree expanded (True/False)
15500 Last tab page in toolpath parameters page ('0' based)
Added parameter Æ
15339 Use clearance plane at start/end (True/False)
Added parameter Æ
15339 Use clearance plane at start/end (True/False)
Added parameters Æ
15345 Feed rate is actually a surface finish (True/False)
15375 Plunge feed rate is actually a surface finish (True/False)
15376 Custom tool display comes from: auto(0), file (1) or level (2)
15377 Tool reference level
Added parameters Æ
-14124 Feed rate is actually a surface finish (True/False)
-14125 Plunge rate is actually a surface finish (True/False)
15376 Custom tool display comes from: auto(0), file (1) or level (2)
15377 Tool reference level
Added parameter Æ
15379 True = by depth, False = by contour
-15246 back_v
-15247 back_v
-15248 front_v
-15249 front_v
-15250 Back used (True/False)
-15251 Front used (True/False)
12333 Option
15415 IfPreferHoleFilling
15416 IfDeleteChains
15417 IfCreateGroups
15418 IfUseMainColor
15419 IfUseMainLevel
15420 IfCycleColors
15421 IfCycleLevels
15422 ResultColor
15423 ResultLevel
15424 IfRestoreLast
15425 IfSaveScrap
15426 IfAddPartsAsGroup
15427 IfIgnoreHoles
15428 IfInnerHoles
15429 StartingCorner
15430 IfAddLabels
15431 ScanForNotes
15432 DrawUsingColors
15433 LabelHeight
15434 IfAutoOrigins
15435 ScrapName
xform stuff follows
15436 xfmMethod: 0 = Toolplane, 1 = Coordinate
15437 xfmGroupOutputBy: 0 = operation order, 1 = operation type
15438 xfmWoff: 0 = off, 1 = maintain source operation's number's, 2 = assign new
15439 xfmWoffStart
15440 xfmWoffInc
15441 xfmWoffMatchExisting (True/False)
15442 xfmWoffCreateNewOps (True/False)
15443 xfmWoffKeepExistingOp (True/False)
15444 xfmCopySourceOps (True/False)
15445 xfmDisablePosting (True/False)
15446 xfmSubPgmOn (True/False)
15447 xfmSubPgmAbs (True/False)
15448 xfmSubPgmUnique (True/False)
15453 ParentOpId
15454 SeparateOpPerSheet (True/False)
15455 WorkOffsetPerSheet (True/False)
15456 WoffStart
15457 WoffInc