MP Online Reference 2018
MP Online Reference 2018
MP Online Reference 2018
Contents:
NCI lines
Variables and strings
Predefined postblocks
Functions and declarations
This section lists the pre-defined variables that are set by each of the NCI lines.
The standalone NCI Reference volume that is included in the MP_documentation.pdf also
includes this information and typically includes somewhat more information about each line
than is shown here. In particular, it includes much more information about each of the 20000s
lines. The main purpose of the listing in this volume is to support easy linking with the entry
for each pre-defined variable.
Use the bookmarks on the left to browse the individual lines.
Predefined variables, postblocks, and functions: page 2
NCI 0
MLWR
Linear move at rapid rate
Mill/Router
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 cur_cflg$
Lathe
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 cur_cflg$
Wire
1 cc$
2 xnci$
3 ynci$
Predefined variables, postblocks, and functions: page 3
4 znci$
5 fr$
6 wt$
7 wc$
8 cur_cflg$
9 wc_rad$
Predefined variables, postblocks, and functions: page 4
NCI 1
MLWR
Linear move at feed rate
Mill/Router
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 cur_cflg$
Lathe
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 cur_cflg$
Wire
1 cc$
2 xnci$
3 ynci$
Predefined variables, postblocks, and functions: page 5
4 znci$
5 fr$
6 wt$
7 wc$
8 cur_cflg$
9 wc_rad$
Predefined variables, postblocks, and functions: page 6
NCI 2
MLWR
Arc move clockwise
Mill/Router
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 cur_cflg$
10 full_arc_flg$
Lathe
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
Predefined variables, postblocks, and functions: page 7
7 znci$
8 fr$
9 cur_cflg$
10 full_arc_flg$
Wire
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 wt$
10 wc$
11 cur_cflg$
12 wc_rad$
13 warc_ctyp$
14 warc_rad$
15 full_arc_flg$
Predefined variables, postblocks, and functions: page 8
NCI 3
MLWR
Arc move counterclockwise
Mill/Router
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 cur_cflg$
10 full_arc_flg$
Lathe
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
Predefined variables, postblocks, and functions: page 9
7 znci$
8 fr$
9 cur_cflg$
10 full_arc_flg$
Wire
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 wt$
10 wc$
11 cur_cflg$
12 wc_rad$
13 warc_ctyp$
14 warc_rad$
15 full_arc_flg$
Predefined variables, postblocks, and functions: page 10
NCI 4
MLWR
Dwell / spindle change
Mill/Router
1 dwell$
2 ss$
Lathe
1 dwell$
2 ss$
3 spdir$
Wire
1 dwell$
NCI 11
MWR
5-axis move / 4-axis taper move
Mill/Router
1 xnci$
2 ynci$
3 znci$
4 u$
5 v$
6 w$
7 fr$
8 cutpos$, cuttyp$
9 cur_cflg$
10 p_svec$
11 q_svec$
12 r_svec$
13 xsrf$
14 ysrf$
15 zsrf$
Wire
1 cc$
Predefined variables, postblocks, and functions: page 12
2 xnci$
3 ynci$
4 znci$
5 u$
6 v$
7 w$
8 fr$
9 cur_cflg$
Predefined variables, postblocks, and functions: page 13
NCI 20
W
Direct 4-axis lower guide: linear move at rapid
Wire
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 wt$
7 wc$
8 cur_cflg$
9 wc_rad$
Predefined variables, postblocks, and functions: page 14
NCI 21
W
Direct 4-axis lower guide: linear move at feed rate
Wire
1 cc$
2 xnci$
3 ynci$
4 znci$
5 fr$
6 wt$
7 wc$
8 cur_cflg$
9 wc_rad$
Predefined variables, postblocks, and functions: page 15
NCI 22
W
Direct 4-axis lower guide: arc move clockwise
Wire
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 wt$
10 wc$
11 cur_cflg$
12 wc_rad$
13 warc_ctyp$
14 warc_rad$
15 full_arc_flg$
Predefined variables, postblocks, and functions: page 16
NCI 23
W
Direct 4-axis lower guide: arc move counterclockwise
Wire
1 plane$
2 cc$
3 xnci$
4 ynci$
5 xc$
6 yc$
7 znci$
8 fr$
9 wt$
10 wc$
11 cur_cflg$
12 wc_rad$
13 warc_ctyp$
14 warc_rad$
15 full_arc_flg$
Predefined variables, postblocks, and functions: page 17
NCI 30
W
Direct 4-axis upper guide: linear move at rapid
Wire
1 cc$
2 wx$
3 wy$
4 wz$
5 wfr$
6 wtpr$
7 wcor$
8 cur_cflg$
9 wcor_rad$
Predefined variables, postblocks, and functions: page 18
NCI 31
W
Direct 4-axis upper guide: linear move at feed rate
Wire
1 cc$
2 wx$
3 wy$
4 wz$
5 wfr$
6 wtpr$
7 wcor$
8 cur_cflg$
9 wcor_rad$
Predefined variables, postblocks, and functions: page 19
NCI 32
W
Direct 4-axis upper guide: arc move clockwise
Wire
1 (not used)
2 wcc$
3 wx$
4 wy$
5 wxc$
6 wyc$
7 wz$
8 wfr$
9 wtpr$
10 wcor$
11 cur_cflg$
12 wcor_rad$
13 warc_cortyp$
14 warc_radius$
15 wfull_arc_flg$
Predefined variables, postblocks, and functions: page 20
NCI 33
W
Direct 4-axis upper guide: arc move counterclockwise
Wire
1 (not used)
2 wcc$
3 wx$
4 wy$
5 wxc$
6 wyc$
7 wz$
8 wfr$
9 wtpr$
10 wcor$
11 cur_cflg$
12 wcor_rad$
13 warc_cortyp$
14 warc_radius$
15 wfull_arc_flg$
Predefined variables, postblocks, and functions: page 21
NCI 80
MLWR
Cancel drill / canned cycle
Mill/Router
This Gcode has no parameters. A blank line is output following the number.
Lathe
This Gcode has no parameters. A blank line is output following the number.
Wire
This Gcode has no parameters. A blank line is output following the number.
Predefined variables, postblocks, and functions: page 22
NCI 81
MLWR
Start drill / canned cycle
Mill/Router
1 drillcyc$
2 drl_depth_x$
3 drl_depth_y$
4 drl_depth_z$
5 dwell$
6 frplunge$
7 peck1$
8 peck2$
9 peckclr$
10 retr$
11 drl_sel_ini$
12 drl_sel_ref$
13 drl_sel_tos$
14 shftdrl$
15 drl_init_x$
16 drl_init_y$
17 drl_init_z$
Predefined variables, postblocks, and functions: page 23
18 cur_cflg$
19 rev_drl5$
20 drl_dia$
Lathe
1 drillcyc$
2 drl_depth_x$
3 drl_depth_y$
4 drl_depth_z$
5 dwell$
6 frplunge$
7 peck1$
8 peck2$
9 peckclr$
10 retr$
11 drl_sel_ini$
12 drl_sel_ref$
13 drl_sel_tos$
14 shftdrl$
15 drl_init_x$
Predefined variables, postblocks, and functions: page 24
16 drl_init_y$
17 drl_init_z$
18 cur_cflg$
19 rev_drl5$
20 drl_dia$
Wire
1 cancyc$
2 xnci$
3 ynci$
4 znci$
5 canned1$
7 canned4$
8 canned5$
9 canned6$
10 canned7$
11 canned2$
12 canned3$
18 cur_cflg$
19 rev_drl5$
Predefined variables, postblocks, and functions: page 26
NCI 82
MLWR
Additional drill / canned cycle parameters
Mill/Router
1 drl_prm1$
2 drl_prm2$
3 drl_prm3$
4 drl_prm4$
5 drl_prm5$
6 drl_prm6$
7 drl_prm7$
8 drl_prm8$
9 drl_prm9$
10 drl_prm10$
Lathe
1 drl_prm1$
2 drl_prm2$
3 drl_prm3$
4 drl_prm4$
5 drl_prm5$
6 drl_prm6$
Predefined variables, postblocks, and functions: page 27
7 drl_prm7$
8 drl_prm8$
9 drl_prm9$
10 drl_prm10$
Wire
1 drl_prm1$
2 drl_prm2$
3 drl_prm3$
4 drl_prm4$
5 drl_prm5$
6 drl_prm6$
7 drl_prm7$
8 drl_prm8$
9 drl_prm9$
10 drl_prm10$
Predefined variables, postblocks, and functions: page 28
NCI 83
R
Block drill / canned cycle parameters
Router
1 bdrl_ofs_x$
2 bdrl_ofs_y$
3 bdrl_ofs_z$
4 bdrl_tool_grp$
5 bdrl_tool_no$
6 bdrl_u$
7 bdrl_v$
8 bdrl_w$
9 bdrl_wrk_ofs$
10 bdrl_x$
11 bdrl_y$
12 bdrl_z$
Predefined variables, postblocks, and functions: page 29
NCI 100
MLWR
Canned cycle repeat position
Mill/Router
2 drl_depth_x$
3 drl_depth_y$
4 drl_depth_z$
5 drl_sel_ini$
6 drl_sel_ref$
7 dwell$
8 frplunge$
9 drl_init_x$
10 drl_init_y$
11 drl_init_z$
12 cur_cflg$
13 rev_drl5$
14 drl_sel_tos$
15 drl_m1$
16 drl_m2$
17 drl_m3$
Predefined variables, postblocks, and functions: page 30
18 drl_m4$
19 drl_m5$
20 drl_m6$
21 drl_m7$
22 drl_m8$
23 drl_m9$
24 drl_dia$
Lathe
2 drl_depth_x$
3 drl_depth_y$
4 drl_depth_z$
5 drl_sel_ini$
6 drl_sel_ref$
7 dwell$
8 frplunge$
9 drl_init_x$
10 drl_init_y$
11 drl_init_z$
Predefined variables, postblocks, and functions: page 31
12 cur_cflg$
13 rev_drl5$
14 drl_sel_tos$
15 drl_m1$
16 drl_m2$
17 drl_m3$
18 drl_m4$
19 drl_m5$
20 drl_m6$
21 drl_m7$
22 drl_m8$
23 drl_m9$
24 drl_dia$
Wire
2 xnci$
3 ynci$
4 znci$
NCI 200
L
Threading parameters: part 1
Lathe
1 nspring$
2 thdfinish$
3 thdpulloff$
4 nstarts$
5 thdxclr$
6 thdangle$
7 thdequcut$
8 thdncuts$
Predefined variables, postblocks, and functions: page 33
NCI 201
L
Threading parameters: part 2
Lathe
1 thdx1$
2 thdx2$
3 thdz1$
4 thdz2$
5 thdlead$
6 thdfirst$
7 thdlast$
8 thdzclr$
9 thda1$
10 thda2$
11 thdtype$
12 thdx3$
Predefined variables, postblocks, and functions: page 34
NCI 900
L
Stock transfer – misc ops function
Lathe
1 stck_spindle$
2 stck_init_z$
3 stck_final_z$
4 stck_chuk_st_z$
5 stck_chuk_st_x$
6 stck_chuk_end_z$
7 stck_chuk_end_x$
8 stck_chuk_st_dz$
9 stck_chuk_st_dx$
10 stck_chuk_end_dz$
11 stck_chuk_end_dx$
Predefined variables, postblocks, and functions: page 35
NCI 901
L
Stock flip – misc ops function
Lathe
1 stck_spindle$
2 stck_init_z$
3 stck_final_z$
4 stck_chuk_st_z$
5 stck_chuk_st_x$
6 stck_chuk_end_z$
7 stck_chuk_end_x$
Predefined variables, postblocks, and functions: page 36
NCI 902
L
Stock advance – misc ops function
Lathe
1 stck_spindle$
2 stck_op$
3 stck_clear$
4 stck_grip$
5 stck_tool_x$
6 stck_init_z$
7 stck_final_z$
8 stck_appr_fr$
9 stck_adv_fr$
10 stck_chuk_st_z$
11 stck_chuk_st_x$
12 stck_chuk_end_z$
13 stck_chuk_end_x$
Predefined variables, postblocks, and functions: page 37
NCI 903
L
Chuck – misc ops function
Lathe
1 clmp_spindle$
2 clmp_op$
3 stck_chuk_st_z$
4 stck_chuk_st_x$
5 stck_chuk_end_z$
6 stck_chuk_end_x$
Predefined variables, postblocks, and functions: page 38
NCI 904
L
Tailstock – misc ops function
Lathe
1 tlstck_on$
2 stck_init_z$
3 stck_final_z$
Predefined variables, postblocks, and functions: page 39
NCI 905
L
Steadyrest – misc ops function
Lathe
1 stck_init_z$
2 stck_final_z$
Predefined variables, postblocks, and functions: page 40
NCI 911
L
Define misc ops custom parameters: reals
Lathe
1 miscops_mr1$
2 miscops_mr2$
3 miscops_mr3$
4 miscops_mr4$
5 miscops_mr5$
6 miscops_mr6$
7 miscops_mr7$
8 miscops_mr8$
9 miscops_mr9$
10 miscops_mr10$
Predefined variables, postblocks, and functions: page 41
NCI 912
L
Define misc ops custom parameters: integers
Lathe
1 miscops_mi1$
2 miscops_mi2$
3 miscops_mi3$
4 miscops_mi4$
5 miscops_mi5$
6 miscops_mi6$
7 miscops_mi7$
8 miscops_mi8$
9 miscops_mi9$
10 miscops_mi10$
Predefined variables, postblocks, and functions: page 42
NCI 950
MLR
Axis combination
Mill/Router
1 synclath$
2 syncbfor$
3 syncmode$
4 syncaxis$
5 syncstream$
6 syncmodebfor$
Lathe
1 synclath$
2 syncbfor$
3 syncmode$
4 syncaxis$
5 syncstream$
6 syncmodebfor$
NCI 999
MLWR
Start of operation. Note that this is not output for operations that are created
by nesting or transform.
Mill/Router
1 synctool_op$
2 syncstream$
3 syncop_id$
Lathe
1 synctool_op$
2 syncstream$
3 syncop_id$
Wire
1 synctool_op$
2 syncstream$
3 syncop_id$
Predefined variables, postblocks, and functions: page 46
NCI 1000
MLWR
Null tool change
Mill/Router
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 tlngno$
7 plane$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 rotaxis$
Predefined variables, postblocks, and functions: page 47
18 rotdia$
Lathe
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 maxss$
7 orient$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 spdir$
Predefined variables, postblocks, and functions: page 48
Wire
1 progno$
2 seqno$
3 seqinc$
4 pass$
5 ccode$
6 offset$
8 inittaper$
9 fr$
10 water$
11 threadx$
12 thready$
13 threadz$
14 startx$
15 starty$
16 startz$
17 xyheight$
18 uvheight$
Predefined variables, postblocks, and functions: page 49
19 up_st_vecx$
20 up_st_vecy$
21 up_st_vecz$
22 up_st_mode$
Predefined variables, postblocks, and functions: page 50
NCI 1001
MLWR
Start-of-file tool change
Mill/Router
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 tlngno$
7 plane$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 rotaxis$
Predefined variables, postblocks, and functions: page 51
18 rotdia$
Lathe
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 maxss$
7 orient$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 spdir$
Predefined variables, postblocks, and functions: page 52
Wire
1 progno$
2 seqno$
3 seqinc$
4 pass$
5 ccode$
6 offset$
8 inittaper$
9 fr$
10 water$
11 threadx$
12 thready$
13 threadz$
14 startx$
15 starty$
16 startz$
17 xyheight$
18 uvheight$
Predefined variables, postblocks, and functions: page 53
19 up_st_vecx$
20 up_st_vecy$
21 up_st_vecz$
22 up_st_mode$
Predefined variables, postblocks, and functions: page 54
NCI 1002
MLWR
Tool change
Mill/Router
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 tlngno$
7 plane$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 rotaxis$
Predefined variables, postblocks, and functions: page 55
18 rotdia$
Lathe
1 progno$
2 seqno$
3 seqinc$
4 t$
5 tloffno$
6 maxss$
7 orient$
8 ss$
9 fr$
10 coolant$
11 xr$
12 yr$
13 zr$
14 xh$
15 yh$
16 zh$
17 spdir$
Predefined variables, postblocks, and functions: page 56
Wire
1 progno$
2 seqno$
3 seqinc$
4 pass$
5 ccode$
6 offset$
8 inittaper$
9 fr$
10 water$
11 threadx$
12 thready$
13 threadz$
14 startx$
15 starty$
16 startz$
17 xyheight$
18 uvheight$
Predefined variables, postblocks, and functions: page 57
19 up_st_vecx$
20 up_st_vecy$
21 up_st_vecz$
22 up_st_mode$
Predefined variables, postblocks, and functions: page 58
NCI 1003
MLWR
End of file
Mill/Router
1 xh$
2 yh$
3 zh$
Lathe
1 xh$
3 zh$
Wire
1 threadx$
2 thready$
3 threadz$
Predefined variables, postblocks, and functions: page 59
NCI 1004
MLWR
Cancel cutter compensation
Mill/Router
This Gcode has no parameters. A blank line is output following the number.
Lathe
This Gcode has no parameters. A blank line is output following the number.
Wire
This Gcode has no parameters. A blank line is output following the number.
Predefined variables, postblocks, and functions: page 60
NCI 1005
MLWR
Manual entry: insert text as comment
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 61
NCI 1006
MLWR
Manual entry: insert text as code
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 62
NCI 1007
MLWR
Manual entry: comment with move
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 63
NCI 1008
MLWR
Operation comment. This is entered in the Comment box in the Tool
parameters dialog for each operation.
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 64
NCI 1009
W
Wire cut length (obsolete). This is no longer output.
Wire
1 cutlength$ (obsolete)
NCI 1010
W
Wire condition change
Wire
1 overburn$
2 ccode$
3 offset$
4 tldia$
5 reg1$
6 reg2$
7 reg3$
8 reg4$
9 reg5$
10 reg6$
11 reg7$
12 reg8$
13 reg9$
14 reg10$
15 ccode_epac_flg$
Predefined variables, postblocks, and functions: page 66
NCI 1011
MLWR
Miscellaneous reals
Mill/Router
1 mr1$
2 mr2$
3 mr3$
4 mr4$
5 mr5$
6 mr6$
7 mr7$
8 mr8$
9 mr9$
10 mr10$
Lathe
1 mr1$
2 mr2$
3 mr3$
4 mr4$
5 mr5$
6 mr6$
Predefined variables, postblocks, and functions: page 67
7 mr7$
8 mr8$
9 mr9$
10 mr10$
Wire
1 mr1$
2 mr2$
3 mr3$
4 mr4$
5 mr5$
6 mr6$
7 mr7$
8 mr8$
9 mr9$
10 mr10$
Predefined variables, postblocks, and functions: page 68
NCI 1012
MLWR
Miscellaneous integers
Mill/Router
1 mi1$
2 mi2$
3 mi3$
4 mi4$
5 mi5$
6 mi6$
7 mi7$
8 mi8$
9 mi9$
10 mi10$
Lathe
1 mi1$
2 mi2$
3 mi3$
4 mi4$
5 mi5$
6 mi6$
Predefined variables, postblocks, and functions: page 69
7 mi7$
8 mi8$
9 mi9$
10 mi10$
Wire
1 mi1$
2 mi2$
3 mi3$
4 mi4$
5 mi5$
6 mi6$
7 mi7$
8 mi8$
9 mi9$
10 mi10$
Predefined variables, postblocks, and functions: page 70
NCI 1013
MLWR
Miscellaneous parameters
Mill/Router
1 cc$
2 tldia$
3 tcr$
4 cctotip$
5 tlplnno$
6 tox$
7 toy$
8 toz$
9 opcode$
10 Text of comment
Lathe
1 cc$
2 tcr$
3 tldia$
6 tox$
Predefined variables, postblocks, and functions: page 71
7 toy$
8 toz$
9 opcode$
10 Text of comment
Wire
1 cc$
2 tldia$
3 tlrad$
4 overburn$
5 wire$
6 power$
7 wox$
8 woy$
9 opcode$
10 Text of comment
Predefined variables, postblocks, and functions: page 72
NCI 1014
MLWR
Tool plane view matrix
Mill/Router
1 m1$
2 m2$
3 m3$
4 m4$
5 m5$
6 m6$
7 m7$
8 m8$
9 m9$
Lathe
1 m1$
2 m2$
3 m3$
4 m4$
5 m5$
6 m6$
7 m7$
Predefined variables, postblocks, and functions: page 73
8 m8$
9 m9$
Wire
1 m1$
2 m2$
3 m3$
4 m4$
5 m5$
6 m6$
7 m7$
8 m8$
9 m9$
Predefined variables, postblocks, and functions: page 74
NCI 1015
W
Wire subroutine parameters
Wire
1 subtyp$
2 subno$
3 td_ct_flg$
4 tabcut$
5 wtrim$
6 skimpass$
7 cutx$
8 cuty$
9 trimplane1$
10 trimplane2$
11 reg1$
12 reg2$
13 reg3$
14 reg4$
15 reg5$
16 reg6$
17 reg7$
Predefined variables, postblocks, and functions: page 75
18 reg8$
19 reg9$
20 reg10$
Predefined variables, postblocks, and functions: page 76
NCI 1016
MLWR
Additional miscellaneous parameters
Mill/Router
1 op_id$
2 tool_typ$
3 tool_op$
4 cplnno$
5 corgx$
6 corgy$
7 corgz$
8 cc_computer$
9 workofs$
10 met_tool$
11 n_flutes$
12 spindle_no$
13 n_tap_thds$
14 lstation$
15 lturret$
16 ltool_id$
17 xform_op_id$
Predefined variables, postblocks, and functions: page 77
18 tap_pitch$
19 nesting_op_id$
Lathe
1 op_id$
2 tool_typ$
3 tool_op$
4 cplnno$
5 corgx$
6 corgy$
7 corgz$
8 cc_computer$
9 workofs$
10 met_tool$
11 n_flutes$
12 spindle_no$
13 n_tap_thds$
14 lstation$
15 lturret$
16 ltool_id$
Predefined variables, postblocks, and functions: page 78
17 xform_op_id$
18 tap_pitch$
19 nesting_op_id$
Wire
1 op_id$
2 nocore_fin$
3 tool_op$
4 cplnno$
5 corgx$
6 corgy$
7 corgz$
8 cc_computer$
9 workofs$
10 met_tool$
11 pdo_type$
13 rpd_hght$
14 landheight$
15 contour_typ$
16 contour_pos$
Predefined variables, postblocks, and functions: page 79
17 wox$
18 woy$
19 woz$
20 xform_op_id$
21 nesting_op_id$
Predefined variables, postblocks, and functions: page 80
NCI 1017
MLR
Construction plane view matrix
Mill/Router
1 cm1$
2 cm2$
3 cm3$
4 cm4$
5 cm5$
6 cm6$
7 cm7$
8 cm8$
9 cm9$
Lathe
1 cm1$
2 cm2$
3 cm3$
4 cm4$
5 cm5$
6 cm6$
7 cm7$
Predefined variables, postblocks, and functions: page 81
8 cm8$
9 cm9$
Predefined variables, postblocks, and functions: page 82
NCI 1018
MLR
Subprogram start definition
Mill/Router
1 sub_op_id$ / sub_ref_id$
2 sub_grp_id$
3 sub_trns_id$
4 sub_sec_no$
5 sub_totl_no$
6 sub_chn_no$
7 sub_inc$
8 sub_trnstyp$
9 sub_trnmthd$
10 sub_m1$
11 sub_m2$
12 sub_m3$
13 sub_m4$
14 sub_m5$
15 sub_m6$
16 sub_m7$
17 sub_m8$
Predefined variables, postblocks, and functions: page 83
18 sub_m9$
19 sub_trnsx$
20 sub_trnsy$
21 sub_trnsz$
22 sub_nxt_t$
23 sub_nxt_h$
24 sub_nxt_tid$
25 sub_mny_t$
26 sub_nst_flg$
Lathe
1 sub_op_id$ / sub_ref_id$
2 sub_grp_id$
3 sub_trns_id$
4 sub_sec_no$
5 sub_totl_no$
6 sub_chn_no$
7 sub_inc$
8 sub_trnstyp$
9 sub_trnmthd$
Predefined variables, postblocks, and functions: page 84
10 sub_m1$
11 sub_m2$
12 sub_m3$
13 sub_m4$
14 sub_m5$
15 sub_m6$
16 sub_m7$
17 sub_m8$
18 sub_m9$
19 sub_trnsx$
20 sub_trnsy$
21 sub_trnsz$
22 sub_nxt_t$
23 sub_nxt_h$
24 sub_nxt_tid$
25 sub_mny_t$
26 sub_nst_flg$
NCI 1019
MLR
Subprogram end definition
Mill/Router
1 esub_op_id$ / esub_ref_id$
2 esub_grp_id$
3 esub_trns_id$
4 esub_sec_no$
5 esub_totl_no$
6 esub_chn_no$
Lathe
1 esub_op_id$ / esub_ref_id$
2 esub_grp_id$
3 esub_trns_id$
4 esub_sec_no$
5 esub_totl_no$
6 esub_chn_no$
Predefined variables, postblocks, and functions: page 86
NCI 1020
MLWR
Stock parameters
Mill/Router
1 stck_ht$
2 stck_wdth$
3 stck_thck$
4 stck_x$
5 stck_y$
6 stck_z$
7 stck_crnr$
8 rotary_vecx$
9 rotary_vecy$
10 rotary_vecz$
12 force_tlchg$
13 maxss$
14 stck_matl$ (string)
Lathe
1 stck_ht$
2 stck_wdth$
Predefined variables, postblocks, and functions: page 87
3 stck_thck$
4 stck_x$
5 stck_y$
6 stck_z$
7 stck_crnr$
8 rotary_vecx$
9 rotary_vecy$
10 rotary_vecz$
12 force_tlchg$
13 maxss$
14 stck_matl$ (string)
Wire
1 stck_ht$
2 stck_wdth$
3 stck_thck$
4 stck_x$
5 stck_y$
6 stck_z$
7 stck_crnr$
Predefined variables, postblocks, and functions: page 88
11 tank$
14 stck_matl$ (string)
Predefined variables, postblocks, and functions: page 89
NCI 1025
MLWR
Canned text or coolant commands. Each parameter encodes the values of
two variables: the cant_pos and cant_val values.
Mill/Router
1 cant_pos1$ + cant_val1$
2 cant_pos2$ + cant_val2$
3 cant_pos3$ + cant_val3$
4 cant_pos4$ + cant_val4$
5 cant_pos5$ + cant_val5$
6 cant_pos6$ + cant_val6$
7 cant_pos7$ + cant_val7$
8 cant_pos8$ + cant_val8$
9 cant_pos9$ + cant_val9$
10 cant_pos10$ + cant_val10$
11 cant_pos11$ + cant_val11$
12 cant_pos12$ + cant_val12$
13 cant_pos13$ + cant_val13$
14 cant_pos14$ + cant_val14$
15 cant_pos15$ + cant_val15$
16 cant_pos16$ + cant_val16$
Predefined variables, postblocks, and functions: page 90
17 cant_pos17$ + cant_val17$
18 cant_pos18$ + cant_val18$
19 cant_pos19$ + cant_val19$
20 cant_pos20$ + cant_val20$
Lathe
1 cant_pos1$ + cant_val1$
2 cant_pos2$ + cant_val2$
3 cant_pos3$ + cant_val3$
4 cant_pos4$ + cant_val4$
5 cant_pos5$ + cant_val5$
6 cant_pos6$ + cant_val6$
7 cant_pos7$ + cant_val7$
8 cant_pos8$ + cant_val8$
9 cant_pos9$ + cant_val9$
10 cant_pos10$ + cant_val10$
11 cant_pos11$ + cant_val11$
12 cant_pos12$ + cant_val12$
13 cant_pos13$ + cant_val13$
14 cant_pos14$ + cant_val14$
Predefined variables, postblocks, and functions: page 91
15 cant_pos15$ + cant_val15$
16 cant_pos16$ + cant_val16$
17 cant_pos17$ + cant_val17$
18 cant_pos18$ + cant_val18$
19 cant_pos19$ + cant_val19$
20 cant_pos20$ + cant_val20$
Wire
1 cant_pos1$ + cant_val1$
2 cant_pos2$ + cant_val2$
3 cant_pos3$ + cant_val3$
4 cant_pos4$ + cant_val4$
5 cant_pos5$ + cant_val5$
6 cant_pos6$ + cant_val6$
7 cant_pos7$ + cant_val7$
8 cant_pos8$ + cant_val8$
9 cant_pos9$ + cant_val9$
10 cant_pos10$ + cant_val10$
11 cant_pos11$ + cant_val11$
12 cant_pos12$ + cant_val12$
13 cant_pos13$ + cant_val13$
Predefined variables, postblocks, and functions: page 92
14 cant_pos14$ + cant_val14$
15 cant_pos15$ + cant_val15$
16 cant_pos16$ + cant_val16$
17 cant_pos17$ + cant_val17$
18 cant_pos18$ + cant_val18$
19 cant_pos19$ + cant_val19$
20 cant_pos20$ + cant_val20$
Predefined variables, postblocks, and functions: page 93
NCI 1026
MLWR
Manual entry: comment as code, with move
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 94
NCI 1027
MLWR
Working coordinate system
Mill/Router
1 t_wcs_m1$
2 t_wcs_m2$
3 t_wcs_m3$
4 t_wcs_m4$
5 t_wcs_m5$
6 t_wcs_m6$
7 t_wcs_m7$
8 t_wcs_m8$
9 t_wcs_m9$
10 t_orgin_x$
11 t_orgin_y$
12 t_orgin_z$
Lathe
1 t_wcs_m1$
2 t_wcs_m2$
3 t_wcs_m3$
4 t_wcs_m4$
Predefined variables, postblocks, and functions: page 95
5 t_wcs_m5$
6 t_wcs_m6$
7 t_wcs_m7$
8 t_wcs_m8$
9 t_wcs_m9$
10 t_orgin_x$
11 t_orgin_y$
12 t_orgin_z$
Wire
1 t_wcs_m1$
2 t_wcs_m2$
3 t_wcs_m3$
4 t_wcs_m4$
5 t_wcs_m5$
6 t_wcs_m6$
7 t_wcs_m7$
8 t_wcs_m8$
9 t_wcs_m9$
10 t_orgin_x$
11 t_orgin_y$
Predefined variables, postblocks, and functions: page 96
12 t_orgin_z$
Predefined variables, postblocks, and functions: page 97
NCI 1028
MR
Head definition data
Mill/Router
1 ra_type$
2 ra_offset$
3 ra_vecx$
4 ra_vecy$
5 ra_vecz$
6 ra_svecx$
7 ra_svecy$
8 ra_svecz$
9 ra_block$
10 ra_station$
11 ra_head_grp$
12 ra_tc_type$
Predefined variables, postblocks, and functions: page 98
NCI 1029
MR
Head shift parameters
Mill/Router
1 ra_hvecx$
2 ra_hvecy$
3 ra_hvecz$
4 ra_bvecx$
5 ra_bvecy$
6 ra_bvecz$
7 ra_tvecx$
8 ra_tvecy$
9 ra_tvecz$
10 ra_translated$
11 ra_rot_head$
Predefined variables, postblocks, and functions: page 99
NCI 1031
MLWR
Custom reals for transform operations
Mill/Router
1 trans_mr1$
2 trans_mr2$
3 trans_mr3$
4 trans_mr4$
5 trans_mr5$
6 trans_mr6$
7 trans_mr7$
8 trans_mr8$
9 trans_mr9$
10 trans_mr10$
Lathe
1 trans_mr1$
2 trans_mr2$
3 trans_mr3$
4 trans_mr4$
5 trans_mr5$
6 trans_mr6$
Predefined variables, postblocks, and functions: page 100
7 trans_mr7$
8 trans_mr8$
9 trans_mr9$
10 trans_mr10$
Wire
1 trans_mr1$
2 trans_mr2$
3 trans_mr3$
4 trans_mr4$
5 trans_mr5$
6 trans_mr6$
7 trans_mr7$
8 trans_mr8$
9 trans_mr9$
10 trans_mr10$
Predefined variables, postblocks, and functions: page 101
NCI 1032
MLWR
Custom ints for transform operations
Mill/Router
1 trans_mi1$
2 trans_mi2$
3 trans_mi3$
4 trans_mi4$
5 trans_mi5$
6 trans_mi6$
7 trans_mi7$
8 trans_mi8$
9 trans_mi9$
10 trans_mi10$
Lathe
1 trans_mi1$
2 trans_mi2$
3 trans_mi3$
4 trans_mi4$
5 trans_mi5$
6 trans_mi6$
Predefined variables, postblocks, and functions: page 102
7 trans_mi7$
8 trans_mi8$
9 trans_mi9$
10 trans_mi10$
Wire
1 trans_mi1$
2 trans_mi2$
3 trans_mi3$
4 trans_mi4$
5 trans_mi5$
6 trans_mi6$
7 trans_mi7$
8 trans_mi8$
9 trans_mi9$
10 trans_mi10$
Predefined variables, postblocks, and functions: page 103
NCI 1042
MR
Begin probe operation/probe comments section
Mill/Router
This Gcode has no parameters. A blank line is output following the number.
Predefined variables, postblocks, and functions: page 104
NCI 1043
MR
End probe operation/probe comments section
Mill/Router
This Gcode has no parameters. A blank line is output following the number.
Predefined variables, postblocks, and functions: page 105
NCI 1050
MLWR
Define NCI version header
Mill/Router
1 vers_no$
2 m_vers_no$
3 mc_day$
4 mc_mon$
5 mc_year$
6 mc_hour$
7 mc_min$
8 mc_sec$
9 smcname$ (string)
Lathe
1 vers_no$
2 m_vers_no$
3 mc_day$
4 mc_mon$
5 mc_year$
6 mc_hour$
7 mc_min$
Predefined variables, postblocks, and functions: page 106
8 mc_sec$
9 smcname$ (string)
Wire
1 vers_no$
2 m_vers_no$
3 mc_day$
4 mc_mon$
5 mc_year$
6 mc_hour$
7 mc_min$
8 mc_sec$
9 smcname$ (string)
Predefined variables, postblocks, and functions: page 107
NCI 1051
MLWR
Machine name
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 108
NCI 1052
MLWR
Machine Group comment
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 109
NCI 1053
MLWR
Machine Group name
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 110
NCI 1054
MLWR
File descriptor
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 111
NCI 1056
MLWR
Probe data
Mill/Router
1 Text of comment
Lathe
1 Text of comment
Wire
1 Text of comment
Predefined variables, postblocks, and functions: page 112
Mill/Router/generic
Lathe
Wire
NCI lines for individual custom interfaces are not included here. They are listed in
the NCI Reference included with the MP_documentation.pdf.
Predefined variables
This section lists all of the predefined numeric variables in MP. These are the variables whose
names must be followed by a $. A separate topic, List of strings, lists all of the predefined strings.
n If the variable's value is set from the NCI file, each NCI line that might set the variable
is listed.
n If the variable is set from the control definition, the control definition page is listed.
Use the bookmarks on the left to browse the individual entries.
Predefined variables, postblocks, and functions: page 117
List of strings
The following list contains all of the predefined strings in MP. These are not product-specific
and are always available for any type of post.
Buffers
sbufname1$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 1.
sbufname2$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 2.
sbufname3$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 3.
sbufname4$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 4.
sbufname5$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 5.
sbufname6$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 6.
sbufname7$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 7.
sbufname8$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 8.
sbufname9$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 9.
sbufname10$
Assign the complete file name (drive+path+filename+extension) when opening an
existing file as a buffer 10.
Comment strings
scomm$
scomm$ is assigned from NCI comment strings, and output is usually buffered (depends
on placement of the comment$ command variable).
scomm0$
String variable used for direct comment output in pscomm0$. Comment output is not
buffered.
scommwith$
Predefined variables, postblocks, and functions: page 118
Used to capture the comments with output and prevent them from being overwritten by
other string comments in the NCI file. The 1007 comments are also concatenated before
output. (These were overwritten in very old versions of MP.)
Pre-defined string variable to hold a file extension string. Not assigned a default value,
must be set by the post writer before use.
snameaux$
File name for the alternate file output stream auxprg$. The string is assigned the NCI file
name by default, but can be overridden.
snameext$
File name for the alternate file output stream extprg$. The string is assigned the NCI file
name by default, but can be overridden.
snamelcc$
File name for the alternate file output stream lccprg$. The string is assigned the NCI file
name by default, but can be overridden.
snamenc$
File name for the NC file output stream.
snamenci$
File name for the NCI file.
snamepst$
File name for the post customization file.
snamespg$
File name for the automatic subprogram buffer.
snamesub$
File name for the alternate file output stream subprg$. The string is assigned the NCI file
name by default, but can be overridden.
spath$
Pre-defined string variable to hold a file extension string. Not assigned a default value,
must be set by the post writer before use.
spathaux$
File path (drive and directories) for the alternate file output stream auxprg$. The string is
assigned the main Mastercam directory by default, but can be overridden.
spathext$
File path (drive and directories) for the alternate file output stream extprg$. The string is
assigned the main Mastercam directory by default, but can be overridden.
spathlcc$
File path (drive and directories) for the alternate file output stream lccprg$. The string is
assigned the main Mastercam directory by default, but can be overridden.
spathnc$
File path for the NC file output stream.
spathnci$
File path for the NCI file.
spathpst$
File path for the post customization file.
spathspg$
File path for the automatic subprogram buffer.
Predefined variables, postblocks, and functions: page 120
spathsub$
File path (drive and directories) for the alternate file output stream subprg$. The string is
assigned the main Mastercam directory by default, but can be overridden.
sprogname$
This string variable outputs the NC file name as typed or upper case, depending on the
value set for the numeric variable progname$.
strtoolext$
Holds the extension of the tool file for the current operation being processed.
strtoolpath$
Holds the path, name, and extension of the tool file for the current operation being
processed.
Other strings
scopyfile$
scopyfile$, as the target of a user prompt function, receives the name of any file that the
user wants to merge with NC output. Usually used with mergeext$.
sdlm_strsel$
The string variable allows the post writer to define the string select delimiter. Example:
the sdlm_strsel$ could be set to '^', then used to search the string: '^M01^M29^M57^^'
sparameter$
Holds the parameter string for each parameter number processed during the parameter
read loop (X9 and earlier posts). Parameter numbers are 10000-49999.
spost_arg_0$
This string is a return argument from an external dll. Used to hold return values from the
post_args[ ] array.
spost_arg_1$
This string is a return argument from an external dll. Used to hold return values from the
post_args[ ] array.
spost_arg_2$
This string is a return argument from an external dll. Used to hold return values from the
post_args[ ] array.
srt_desc$
This is reserved for internal use. (It is used by our internal testing routines.)
srt_name$
This is reserved for internal use. (It is used by our internal testing routines.)
stck_matl$
Holds the name of the material selected in the Tool Settings tab of the Machine Group
Properties. This is output on the 1020 line.
strtool$
Holds the tool description string entered in the Define Tool parameters tab.
suser_label$
The name of the component (parameter 5 from 20600 line) or axis combination
(parameter 4 from 20601 line). This is automatically populated when puidlist$ is called.
Predefined variables, postblocks, and functions: page 121
sx_nci_default$
The string variable for wire processing to allow/disallow support for specific wire control
models. Used with the numeric variable controldefault$.
sx_support_mc$
This string variable is initialized by the post writer to enable Probing or POCO support.
String value must match value in post header line.
s_c_pre$
String representing C character.
s_d_pre$
String representing D character.
s_e_pre$
String representing E character.
s_f_pre$
String representing F character.
s_g_pre$
String representing G character.
s_h_pre$
String representing H character.
s_i_pre$
String representing I character.
s_j_pre$
String representing J character.
s_k_pre$
String representing K character.
s_l_pre$
String representing L character.
s_m_pre$
String representing M character.
s_n_pre$
String representing N character.
s_o_pre$
String representing O character.
s_p_pre$
String representing P character.
s_q_pre$
String representing Q character.
s_r_pre$
String representing R character.
s_s_pre$
String representing S character.
s_space$
String representing space character.
s_t_pre$
String representing T character.
s_u_pre$
String representing U character.
s_v_pre$
Predefined variables, postblocks, and functions: page 123
a$
M L R MT
Axis of rotation about the X-axis, in degrees.
When rotaxtyp$ is –3, –2, –1, 0, or 1, only the c$ variable is returned.
rotaxtyp$ set to 3 calculates a$ and c$ variables. Any other setting requires the post writer to
calculate the angles in the post.
Note that b$ is not currently supported and should not be used!
absinc$
M L R W MT
Controls whether NC output is absolute or incremental; typically, this is
the G90/G91 mode.
The initial value for this variable is set in the control definition by this option:
However, many posts also include a misc integer that sets absinc$ for an individual
operation, overriding the CD value. This lets the programmer set incremental/absolute mode
for each part or operation without having to edit the control definition each time.
When you are creating subprograms, the absinc$ value will also be overridden by the sub_inc$
parameter that is output on the 1018 line:
Predefined variables, postblocks, and functions: page 126
However, MP will automatically take care of managing the overall mode vs. subprogram
mode.
However, in Mastercam 2017, you can choose to activate the linked incremental values
feature. When you do this, Mastercam will automatically track the incremental value for the
selected variables and output the proper value based on the absinc$ setting. You do not need
to manually create separate sets of variables for the different values and manage them yourself
with postblocks like pxout.
where n is the number of the fs/fs2 statement and i is the linked incremental flag. Set this to 1
to activate linked incremental values for the specified variable. A value of 0—which is assumed
if the value is missing—disables the feature.
Note that the “suffix” argument does not need to be present if you include the linked
incremental flag. If the fourth argument on an fmt line is 1 or 0 instead of a string, MP will
correctly interpret it as the linked incremental flag. The following line would be a typical
example to activate linked incremental values for the x$ variable (assuming x$ is assigned to
format statement 2):
fmt "X" 2 x$ 1
Using the fmt mechanism to activate linked incremental values implies that this feature is
typically enabled for only specific variables and not globally throughout your post.
Predefined variables, postblocks, and functions: page 127
NOTE
Each linked incremental variable automatically inherits the format statement and
assignment of its parent variable. Do not attempt to manually assign a different format
statement to the linked incremental variable.
Mastercam will update the linked incremental variable when the parent variable is used in a
normal output statement, forced output, or dependent output. Mastercam will calculate the
different between the current and previous formatted values and place this in the linked
incremental value.
Note that because the linked incremental variable is created by the fmt statement, it is
normally not available until the fmt statement is processed in the post. If for some reason you
need to access it earlier, you can simply manually create a variable with the proper name (in
other words, the name of the parent variable with the underscore) and initialize it to whatever
value you wish. When Mastercam encounters the fmt statement, it will then link its value to
the parent variable.
In theory, once they have been created by the fmt statement, you can access the linked
incremental variables (or their prv_ values) just like any other variable. For example, you can
use them in switches or conditional statements. However, there is typically no reason to
output them directly; let Mastercam manage the output as described in the next section.
Note also that modality of the linked incremental variable is controlled by its parent. Format
attributes like delta output, non-modal or forced output do not have any direct impact on the
linked incremental variable.
NOTE
Do not confuse the linked incremental feature with the “i” (incremental) option in the
fs/fs2 definition. The linked incremental feature is a better solution for incremental
output since it preserves the absolute value as well as access to the prv_ value. Do not
use the “i” option in the fs/fs2 definition together with the linked incremental switch in
the fmt statement.
value will automatically be output when the parent variable is encountered in an output
statement and absinc$ is set to 1.
This is an enhancement from earlier versions of Mastercam, where absinc$ was typically used
primarily as the string selector for G90/G91 output; it did not affect the actual coordinate
values themselves. The new behavior is triggered for selected variables by including the linked
incremental flag in the fmt statement.
Note that you can continue to use absinc$ as the G90/G91 string selector also; that logic will
still work fine if you enable linked incremental values.
Possible values
0 Absolute (default)
1 Incremental
# -------------------------------------------------------------
# Misc. integer/real postblocks
Predefined variables, postblocks, and functions: page 129
# -------------------------------------------------------------
pmiscint$ #Set the misc. integer values
absinc$ = mi2$
add_wrk_sht = mi6$
enable_lim = mi7$
ptlch_ret_app
chain_ret_app = (mi8$ = four | mi8$ < zero)
nut_bias = mi9$
sec_bias = mi10$
Predefined variables, postblocks, and functions: page 130
add_thdzclr$
L MT
Enable alternate thdz1$ and thdzclr$ thread calculations. It adds the value thdzclr$
to thdz1$ and zeroes thdzclr$. This happens before the postblock pthread0$ is
called, so post calculations using thdz1$ work correctly. This mainly affects tapered threading
calculations.
Possible values
0 Off
1 On
angle_found$
M L R W MT
[future use]
arccheck$
M L R W MT
Enables routines that filter invalid arcs from the NCI file. It provides a
way to convert very small arcs into linear moves. There are several
different tests that you can choose to individually activate or suppress, as desired. The
arccheck$ value is expressed as a 5-digit integer in which each digit controls one of the tests as
described below. For example, arccheck$ value of 211 means perform tests 1, 10 and 200 from
the options listed below.
n Use larccheck$ in mill-turn posts when you want to configure separate arc check routines
for mill and lathe toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control
definition to set them.
n For standard lathe posts, the Arc page in the control definition sets both arccheck$ and
larccheck$. The two variables will automatically be set to the same value when linklvar$
is turned on.
n The arc motion is broken into line segments using a chordal deviation tolerance set by
the variable chord_tol$ and met_chord_tol$. The exception is with the arccheck$ option
200.
n Rounding tolerances are calculated from the mtol$ and met_mtol$ settings.
Possible values
1’s Set this digit to 1 to check the length of the arc to the minarc$ and ltol$ variables.
Note that if this option is not selected, the arc is still validated against ltol$. The
following control definition setting activates this check:
10’s 10: Check for motion on the axis parallel to the vector from center point to end
and/or start point when the vector is parallel to a quadrant. The move is converted
to a linear move if no motion is detected.
More info
The following picture shows that the rounded end point (the magenta point)
produces no motion in the horizontal axis.
Predefined variables, postblocks, and functions: page 133
The following control definition setting activates this check and sets the second
arccheck$ digit to 1:
100’s 100 – Check the end point of the arc by using the rounded positions for the arc
(center point, start point and sweep) to calculate an end point at machine
precision. The calculated end point is rounded and compared to the rounded end
point from the NCI data. The value of the variable arc_tol$ is checked on each axis
separately in the arc plane. If the value is exceeded, the arc test fails and the arc is
linearized. Check the end point of the arc by using the rounded positions for the
arc (center point, start point and sweep) to calculate an end point at machine
precision.
More info
200 – Perform the test as in (100) but use the generated end point and output the
arc. Follow the generated arc output with a linear move to the rounded end point
position from the NCI file.
Predefined variables, postblocks, and functions: page 134
300 – Perform the test as in (100) but the calculated end point is not rounded. The
calculated end point is compared to the rounded end point from the NCI. The
value of the variable arc_tol$ is compared to the distance between the two end
points in the arc plane. If the value is exceeded, the arc test fails and the arc is
linearized.
To use this arc check, select the End point checks option and select the desired
test; it will set a value of 100/200/300 as shown:
The following illustration shows what the arccheck$ 100/200 options do.
n The grid shows the smallest step the machine is capable of on each axis.
When output is generated for the NC file, NCI positions are rounded to the
precision of this machine grid.
n The light blue arc and points represent the NCI data. These positions are at
a higher precision than the machine grid and therefore are not located on
the green points. (1)
n The red arc and points represent the rounded NCI positions for the start of
the arc. These positions are used to swing an arc based on the rounded
positions and this is the arc the machine generates. (2)
n The dark blue point is the rounded position from the NCI data for the end
point of the arc. (3) A line (the thinner light blue line) is made from the
rounded arc center through the rounded NCI end point. (4)
n The actual machine arc (red arc) (2) is then trimmed to this line and the
resulting endpoint rounded to the closest machine grid point (the magenta
point). (5)
Predefined variables, postblocks, and functions: page 135
1000’s 1000 – Check the angles (θ1 and θ2) to the atol$ value on the arc formed by the
vectors from the rounded start point to rounded center point; rounded start point
to rounded end point; and rounded end point to rounded center point.
More info
The following picture shows the relationship between θ1 and θ2 and the arc:
Use ltol$ to specify the length tolerance. Use atol$ to specify the angle tolerance.
The following control definition setting activates this check and sets the fourth
arccheck$ digit to 1:
Predefined variables, postblocks, and functions: page 137
More info
The following control definition setting sets this digit to 1:
arcoutput$
M L R W MT
Obsolete; use arctype$ instead.
The set of arcoutput$ variables—arcoutput$,arcoutputxz$, arcoutputyz$,
larcoutput$, larcoutputxz$, larcoutputyz$—was used in Mastercam X to help control how
older posts were updated. Modern posts should use the arctype$ variables instead—arctype$,
arctypexz$, arctypeyz$, larctypexz$, larctypeyz$—as set in the control definition.
arcoutputxz$
M L R MT
Obsolete; use arctypexz$ instead.
The set of arcoutput$ variables—arcoutput$,arcoutputxz$, arcoutputyz$,
larcoutput$, larcoutputxz$, larcoutputyz$—was used in Mastercam X to help control how
older posts were updated. Modern posts should use the arctype$ variables instead—arctype$,
arctypexz$, arctypeyz$, larctypexz$, larctypeyz$—as set in the control definition.
arcoutputyz$
M L R MT
Obsolete; use arctypeyz$ instead.
The set of arcoutput$ variables—arcoutput$,arcoutputxz$, arcoutputyz$,
larcoutput$, larcoutputxz$, larcoutputyz$—was used in Mastercam X to help control how
older posts were updated. Modern posts should use the arctype$ variables instead—arctype$,
arctypexz$, arctypeyz$, larctypexz$, larctypeyz$—as set in the control definition.
arcrad$
Radius of the current arc; the distance from the arc center to the arc M L R W MT
starting point. Use this variable together with arcrad_end$ to see if the
radius of an arc computes the same at its endpoint as its start point, taking into consideration
the arccheck$ settings
arcrad_end$
Radius of the current arc; the distance from the arc center to the arc M L R W MT
endpoint. Use this variable together with arcrad$ to see if the radius of an
arc computes the same at its endpoint as its start point, taking into consideration the arccheck$
settings.
arctype$
M L R W MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$—
are used to set the arc center type for arcs in the designated plane. They
are set for each plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
arctypexz$
M L R MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$— are
used to set the arc center type for arcs in the designated plane. They are set
for each plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
arctypeyz$
M L R MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$— are
used to set the arc center type for arcs in the designated plane. They are set
for each plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
arc_pitch$
M L R W MT
The linear axis pitch distance of the helix motion currently being
processed. This is the distance the (perpendicular) linear axis would
move in a 360-degree sweep of the circular motion of the helix.
See helix_arc$ and helix_tol$ for related information.
arc_tol$
M L R W MT
Arc tolerance (inch). Used with arccheck$/larccheck$ to validate an arc.
Rounding tolerances are calculated from the value stored in the variable
mtol$. This rounding tolerance should be set to match the format of the axes output variables.
This contains the tolerance for inch output; see met_arc_tol$ for the metric equivalent.
atol$
M L R W MT
Minimum angle tolerance. Used with arccheck$/larccheck$ to validate an
arc. See also max_atol$.
Wire controls use this value with g60_mode$ to determine tangency.
auxprg$
M L R W MT
Use this variable to open an alternate output file (.AUX). NC output will
be directed to the AUX file when it has been opened with auxprg$ and
the subout$ variable is set to 2.
Opening output files
MP supports four different alternate files or NC output streams. Each different output file is
associated with a different command variable. Alternate output files must be recognized as a
valid stream before they can be opened and accessed with the subout$ variable. The file is
actually opened on the first attempt to output to the file.
subout$
Command variable File to be opened
value
Set subout$ to the proper value to send output to the desired file once it has been opened.
See related variables mergeaux$, newaux$ and clearaux$.
You can set auxprg$ to the appropriate value either by initializing it:
auxprg$ : 1 # Allow access to aux file (open and clear it)
Possible values
1 Open the file. If the file already exists, delete all existing contents.
Predefined variables, postblocks, and functions: page 155
2 Open the file. If the file already exists, append to existing contents.
if not(omitseq$),
[
n$ = seqno$
#set file paths, names and extensions for buffer, aux and NC
sauxfile = spathnc$ + snamenc$ + sextaux$
sbufname2$ = spathnc$ + snamenc$ + sextnc$
sncfile = spathnc$ + snamenc$ + sextnc$
axis$
M L R MT
Current axis of tool plane rotation with rotaxtyp$ set to 1 or less.
Rotation is relative to the world coordinate system (top view).
Possible values
0 None
axisx$
M L R W MT
Rotation vector used with the rotate functions rotp and rotv. By default,
this vector is 0,0,0, so you must set this vector to the desired rotation
axis. See also axisy$, axisz$.
axisy$
M L R W MT
Rotation vector used with the rotate functions rotp and rotv. By default,
this vector is 0,0,0, so you must set this vector to the desired rotation
axis. See also axisx$, axisz$.
axisz$
M L R W MT
Rotation vector used with the rotate functions rotp and rotv. By default,
this vector is 0,0,0, so you must set this vector to the desired rotation
axis. See also axisy$, axisx$.
azero$
M L R MT
[reserved for future use]
b$
This variable should not be used. Unlike a$ and a$, this value is not set by MP.
bdrl_ofs_x$
R
Distance of drill hole to the lead drill position in the X axis. It comes from the
following setting in Mastercam:
bdrl_ofs_y$
R
Distance of drill hole to the lead drill position in the Y axis. It comes from the
following setting in Mastercam:
bdrl_ofs_z$
R
Distance of drill hole to the lead drill position in the Z axis. It comes from the
following setting in Mastercam:
bdrl_tool_grp$
R
Tool group number. It comes from the following setting in Mastercam:
bdrl_tool_no$
R
Bitwise code that indicates which tools or drills are used or have been dropped for
this hole. Each tool position is assigned a value as noted below; the value of bdrl_
tool_no$ is the sum of the values for each position that is used.
For example, if the value in the NCI line is 32, that means the drill in position 6 is used. If tools
1, 2, and 4 are used, the value of bdrl_tool_no$ would be 11: 1+2+8=11.
Possible values
1 1
2 2
3 4
4 8
5 16
6 32
7 64
8 128
9 256
10 512
11 1024
12 2048
13 4096
14 8192
15 16384
16 32768
Predefined variables, postblocks, and functions: page 167
bdrl_tool_no2$
R
Bitwise tool code of tools used at this position
bdrl_tool_no3$
R
Bitwise tool code of tools used at this position
bdrl_tool_no4$
R
Bitwise tool code of tools used at this position
bdrl_tool_no5$
R
Bitwise tool code of tools used at this position
bdrl_tool_no6$
R
Bitwise tool code of tools used at this position
bdrl_tool_no7$
R
Bitwise tool code of tools used at this position
bdrl_tool_no8$
R
Bitwise tool code of tools used at this position
bdrl_tool_no9$
R
Bitwise tool code of tools used at this position
bdrl_u$
R
Position of lead drill at initial (clearance) height - X axis.
bdrl_use_lead$
R
Output the lead drill position as the drill position? If 0, then the drill position of the
first drill down is output.
Possible values
0 No
1 Yes
bdrl_v$
R
Position of lead drill at initial (clearance) height - Y axis.
bdrl_w$
R
Position of lead drill at initial (clearance) height - Z axis.
bdrl_wrk_ofs$
R
Work Offset for block drill position.
bdrl_x$
R
Axis position of the lead drill at depth (X axis). See related variables bdrl_x2$, bdrl_y2$,
bdrl_z2$; these give the position of the actual drilled hole, which will be different if a
drill other than the lead drill is drilling.
bdrl_x2$
R
X drilled position (at depth). This value is read from the NCI 81 and 100 data records
when block drilling is active. It is the actual drilled location (which may not be the
lead tool position) at depth.
See related variables bdrl_x$, bdrl_y$, bdrl_z$.
bdrl_y$
R
Axis position of the lead drill at depth (Y axis). See related variables bdrl_x2$, bdrl_y2$,
bdrl_z2$; these give the position of the actual drilled hole, which will be different if a
drill other than the lead drill is drilling.
bdrl_y2$
R
Y drilled position (at depth). This value is read from the NCI 81 and 100 data records
when block drilling is active. It is the actual drilled location (which may not be the
lead tool position) at depth.
See related variables bdrl_x$, bdrl_y$, bdrl_z$.
bdrl_z$
R
Axis position of the lead drill at depth (Z axis). See related variables bdrl_x2$, bdrl_y2$,
bdrl_z2$; these give the position of the actual drilled hole, which will be different if a
drill other than the lead drill is drilling.
bdrl_z2$
R
Z drilled position (at depth). This value is read from the NCI 81 and 100 data records
when block drilling is active. It is the actual drilled location (which may not be the
lead tool position) at depth.
See related variables bdrl_x$, bdrl_y$, bdrl_z$.
bldnxtool$
M L R W MT
Enables the routine that makes the "next tool" variables available for
supporting staged tools in your post.
Select the Enable staged tool routines option on the Tool page in the control definition.
Wire requires this switch to be enabled before it can build the wire radius and taper lists.
NOTE
Because Wire control definitions do not have this setting, Wire posts require that
bldnxtool$ be explicitly initialized to 1 in the post.
Possible values
0 No
1 Yes
bool____result$
M L R W MT
OBSOLETE: The result returned with the conditional branching
statements (if) and (while).
breakarcs$
M L R W MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The
different variables let you specify this individually for each plane. For each plane, select the
desired arc break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 190
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
breakarcsxz$
M L R MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The
different variables let you specify this individually for each plane. For each plane, select the
desired arc break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 192
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
breakarcsyz$
M L R MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The
different variables let you specify this individually for each plane. For each plane, select the
desired arc break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 194
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
brklineslen$
M L R W MT
Length of the broken line segments that are created with brklinestype$.
See brklinestype$ for more information.
brklinestype$
M L R W MT
Specify the method the post executable uses to break linear moves into
segments. Linear motion may be broken using chord height or segment
length.
n When chord height is used, the segment lengths are automatically determined.
n If segment length (values 8–11), the segment length is specified by the brklineslen$
variable.
When the original line is broken using segment length, there may be some left over. For
example, a line 2.5 units long may be broken using a segment length of 0.3. In this case, there
will be eight segments 0.3 long and 0.1 left over. If this left over line is less than 10% of the
given segment length, the left over segment will be evenly divided among the other line
segments. The result is that the line segments will all have the same length but will be a little
longer than the length asked for.
If the extra line is more that 10% of the given segment length, the number of segments will be
increased by one and the original line will be divided evenly. The resulting line segments will
all have the same length but will be a little shorter than the length asked for.
Possible values
0 No break
preset_mod
if y_axis = zero & millcc = zero & c_axistype <> three,
[
#Set brklinestype
if abs(cuttype) = two, brklinestype$ = six
if cuttype = three, brklinestype$ = four
]
]
Predefined variables, postblocks, and functions: page 199
brk_cantext$
M L R W MT
Provide the current value of cantext$ during break up of move. Note that
use of cantext$ is considered obsolete. Use cant_val1$ instead.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value
only on the first segment of a broken move.
Predefined variables, postblocks, and functions: page 200
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cc$
M L R W MT
Provide the current value of cc$ during break-up of move. See cc$ for
more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 202
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_ccomp$
M L R W MT
Provide the current value of ccomp$ during break up of move. See
ccomp$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 204
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cc_pos$
M L R W MT
Provide the current value of cc_pos$ during break up of move. See cc_
pos$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 206
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cend$
M L R W MT
Provide the current value of cend$ during break up of move. See cend$
for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 208
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cgstop$
M L R W MT
Provide the current value oof cgstop$ during break up of move. See
cgstop$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 210
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_commvar$
M L R W MT
Provide the current value of commvar$ during break up of move. See
commvar$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 212
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_coolant$
M L R W MT
Provide the current value of coolant$ during break up of move.
This variable is part of a set of variables—all beginning with brk_ —that
are designed to help you manage moves that are broken in the NCI. The following section
describes how these work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value
only on the first segment of a broken move.
Predefined variables, postblocks, and functions: page 214
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cstop$
M L R W MT
Provide the current value of cstop$ during break up of move. See cstop$
for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 216
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_cutpos2$
M L R W MT
Provide the current value of cutpos2$ flag during break up of move. See
cutpos2$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 218
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_epac_flg$
W
Provide the current value of epac_flg$ flag during break up of move. See epac_flg$ for
more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 220
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_nextccomp$
M L R W MT
Provide the current value of nextccomp$ during break up of move. See
nextccomp$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 222
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_nextcflg$
M L R W MT
Provide the current value of nextcflg$ during break up of move. See
nextcflg$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 224
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_nextop$
M L R W MT
Provide the current value of nextop$ during break up of move. See
nextop$ for more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 226
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_power$
W
Provide the current value of power$ during break up of move.
This variable is part of a set of variables—all beginning with brk_ —that are designed
to help you manage moves that are broken in the NCI. The following section describes how
these work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value
only on the first segment of a broken move.
Predefined variables, postblocks, and functions: page 228
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_rpd_typ$
L MT
Provide the current value of rpd_typ$ during break up of move. See rpd_typ$ for
more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 230
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_tank$
W
Provide the current value of tank$ during break up of move.
This variable is part of a set of variables—all beginning with brk_ —that are designed
to help you manage moves that are broken in the NCI. The following section describes how
these work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value
only on the first segment of a broken move.
Predefined variables, postblocks, and functions: page 232
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_thrd_cut$
W
Provide the current value of thrd_cut$ during break up of move. See thrd_cut$ for
more information and possible values.
During an MP routine that breaks motion, the current value is zeroed until the original
endpoint is output.
This variable is part of a set of variables—all beginning with brk_ —that are designed to help
you manage moves that are broken in the NCI. The following section describes how these
work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Predefined variables, postblocks, and functions: page 234
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value only
on the first segment of a broken move.
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
brk_water$
W
Provide the current value of water$ during break up of move.
This variable is part of a set of variables—all beginning with brk_ —that are designed
to help you manage moves that are broken in the NCI. The following section describes how
these work generally.
Variable Value
cantext$ 0
commvar$ 0
cc$ 0
ccomp$ 0
epac_flg$ 0
nextcflg$ 0
cend$ 0
cstop$ 0
cgstop$ 0
rpd_typ$ 0
Because there may be a case where you want the original value only on the first segment of a
broken move, the following variables have been defined. They will have the original value
only on the first segment of a broken move.
Predefined variables, postblocks, and functions: page 236
Variable Value
brk_cantext$ 0
brk_commvar$ 0
brk_cc$ 0
brk_ccomp$ 0
brk_cc_pos$ 0
brk_epac_flg$ 0
brk_nextop$ –1
brk_nextcflg$ 0
brk_nextcflg$ 0
brk_cend$ 0
brk_cstop$ 0
brk_cgstop$ 0
brk_rpd_typ$ 0
buf_no_index$
M L R W MT
buf_no_index$, when set to true (1), stops the automatic indexing of the
buffer record number variable argument in the rbuf and wbuf functions.
bug1$
M L R W MT
Prior to Mastercam X3, this was used as a post switch that controlled the
display editor/view of the NC file. With the introduction of the
Mastercam Posts debugger, this is obsolete and can be removed from your post. It is set to 0 by
default and you do not need to explicitly initialize it. See the Post Debugger User Guide
installed with Mastercam for more information.
bug1$ = 1 is still valid when you use ATP, so you can see the NC output in a list box. For
normal posting, though, the traditional bug1$ functionality is replaced by the Edit options that
you select in the Post Processing dialog box.
.
Possible values
2 Display the NC file in the editor program specified in the current Mastercam
configuration.
bug2$
Prior to Mastercam X3, this was used as a post switch that appended M L R W MT
debugging information to output lines in your NC file. With the
introduction of the Mastercam Posts debugger, this is obsolete and can be removed from your
post. See the Post Debugger User Guide installed with Mastercam for more information.
bug3$
M L R W MT
Prior to Mastercam X3, this was used as a post switch that appended
debugging information to output lines in your NC file. With the
introduction of the Mastercam Posts debugger, this is obsolete and can be removed from your
post. See the Post Debugger User Guide installed with Mastercam for more information.
bug4$
M L R W MT
Before Mastercam X3, this was used to output the NCI line number at
the end of each line of NC code. With the introduction of the
Mastercam Posts debugger, this is no longer necessary; all three Run modes in the debugger
include the NCI line number in the NC window.
However, bug4$ can still be useful when you want to output raw, unformatted variable values
with the ~ (tilde) operator.
n When bug4$ = –1, the ~ operator is active. The ~ operator will force raw,
unformatted output with the ~ operator.
n When bug4$ = 0 or any positive number, the ~ operator will force output, but the
output will be formatted according to the applicable format statement.
n Mastercam 2017 added a new supported value, –2. Use this setting to force output of
the extended value of a variable.
Use your editor to set bug4$ and manually add the ~ in front of the desired variables.
Note, however, that the debugger can often give you the same information more easily. Just
add the desired variable to a watch list; the watch list window always shows all values
unformatted. This way, you do not need to constantly keep making changes to your post.
See the Post Debugger User Guide installed with Mastercam for more information.
Possible values
bug9$
M L R W MT
OBSOLETE: Indicates the current drill position with long drill code
output.
bzero$
M L R MT
[reserved for future use]
c$
M L R MT
Axis of rotation about the Z-axis, in degrees.
When rotaxtyp$ is –3, –2, –1, 0, or 1, only the c$ variable is returned.
rotaxtyp$ set to 3 calculates c$ and a$ variables. Any other setting requires the post writer to
calculate the angles in the post.
Note that b$ is not currently supported and should not be used!
canceldc$
M L R W MT
Command variable which allows the post to call the postblock pcanceldc$
to cancel an active canned drill cycle.
The variable canceldc$ functions as both a command word and a post switch variable.
n As a command word, it allows the post to call the postblock pcanceldc$ to cancel an
active canned drillcycle .
n As a post switch, when you initialize it to 1, MP will use the state of the canned cycle
to re-initialize the canned cycle if cancelled. When a canned drill cycle is called and the
NCI Gcode is 100 (repeat cycle), the state is checked and the Gcode 100 is converted to
Gcode 81 and the canned drill cycle definition postblock is called.
Normally, NCI Gcode 80 indicates the end of a drill cycle and drilled positions in the NCI file.
The NCI Gcode 80 automatically calls the pcanceldc$ postblock if a canned drilling cycle is
active. However, you can use canceldc$ to directly call the pcanceldc$ postblock to cancel the
active cycle.
See also drl_cycle_actv$ for related information.
Note: We do not recommend using this variable for multiaxis canned drilling.
Possible values
0 Not active
1 Active
[
#Don't compare drl_plane if the cycle was off
if drl_cycle_actv$ < one, !drl_plane$
#Cancel the drill cycle
if drl_plane$ = m_one | prv_drl_plane$ <> drl_plane$, canceldc$
#Use the canned drillcycle?
if drl_plane$ = m_one, zero = vlin(drl_cycle$, usecandrill$)
else,
[
drl_usecan = vlout(drl_cycle$, prv_usecandrill$)
drl_usecan = vlin(drl_cycle$, usecandrill$)
]
]
!drl_plane$
Predefined variables, postblocks, and functions: page 247
cancyc$
W
Type of wire canned cycle.
Possible values
canned1$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned2$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned3$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned4$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned5$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned6$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned7$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.
canned8$
W
Obsolete; not used. This has been removed in Mastercam 2017.
canned9$
W
Obsolete; not used. This has been removed in Mastercam 2017.
cantext$
M L R W MT
OBSOLETE: Use cant_val1$ instead. The value from the first entry on the
NCI Gcode 1025 line is copied to this variable for backwards
compatibility. Use the new canned text variables and routines in all modern posts.
cant_no$
M L R W MT
The number of canned text entries on the NCI Gcode 1025 line—in
other words, the number of non-zero parameters. Use it to determine
whether there is any canned text being output from a 1025 line.
With a test such as if cant_no$ > 0, you can determine whether it is necessary to break
down the parameters on the 1025 line, or skip the line and move on.
cant_pos1$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos10$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos11$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos12$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos13$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos14$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos15$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos16$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos17$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos18$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos19$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos2$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos20$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos3$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos4$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos5$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos6$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos7$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos8$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_pos9$
M L R W MT
The numeric code indicating the output position of a canned text or
coolant command, as passed on the NCI Gcode 1025 line. The 1025 line
has 20 parameters, corresponding to cant_pos1$ through cant_pos20$.
Each variable in the set—cant_pos1$ through cant_pos20$—defines the output position of
a corresponding canned text value, cant_val1$–cant_val20$). Values can be either before,
with, or after the output NC line.
The cant_pos and cant_val values on output together on the 1025 line. Each parameter on
the 1025 line can have up to 4 digits, and encapsulates the values of two different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
cant_pos values of 0–2 indicate a canned text command; values of 3–5 indicate a coolant
command. This is designed so that your post can easily test the cant_pos value to determine
if a specific 1025 parameter should be processed as a coolant command or as a canned text
command.
Consider this example of a 1025 line:
1025
2010 4 1006 4057 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.
Possible values
3 Before (coolant)
4 With (coolant)
5 After (coolant)
cant_tlchng$
M L R W MT
Canned text control when tlchng_aft$ is on.
Use of tlchng_aft$ is recommended in all modern posts.
Possible values
0 Allow canned text values in the tool change NCI block to be overwritten by any
canned text values on the following NCI position.
1 Save the canned text values in the tool change NCI block and overwrite any
canned text values on the following NCI position.
cant_val1$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 301
cant_val10$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 303
cant_val11$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 305
cant_val12$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 307
cant_val13$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 309
cant_val14$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 311
cant_val15$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 313
cant_val16$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 315
cant_val17$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 317
cant_val18$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 319
cant_val19$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 321
cant_val2$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 323
cant_val20$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 325
cant_val3$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 327
cant_val4$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 329
cant_val5$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 331
cant_val6$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 333
cant_val7$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 335
cant_val8$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 337
cant_val9$
M L R W MT
The actual canned text value as passed on the NCI Gcode 1025 line. The
1025 line has 20 parameters, corresponding to cant_val1$ through
cant_val20$ .
Each parameter on the 1025 line can have up to 4 digits, and encapsulates the values of two
different variables:
n If the parameter value from the 1025 line has 4 digits, the first digit is the value of the
cant_pos variable for that position.
n The other three digits are the value of the cant_val variable for that position. The
cant_val variables support values up to 200.
n If the 1025 value has less than 4 digits, the cant_pos variable for that position is 0, and
all the digits represent the cant_val value.
Consider this example of a 1025 line:
1025
2010 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.
The first parameter "5052" indicates coolant event 2 will be turned on and output after the
motion command.
Predefined variables, postblocks, and functions: page 339
cc$
M L R W MT
Cutter compensation value read directly from NCI file. Use of this
numeric variable is not recommended. It has been superseded by the
numeric variable cc_pos$.
Possible values
0 Off
ccend$
M L R W MT
[reserved for future use]
ccode$
W
Current wire condition. This variable was formerly called dofs$ in old Wire post
processors. The value is copied to the dofs$ variable for backward compatibility.
ccode_epac_flg$
W
Indicates if condition code or power setting changes on approach move.
One of the capabilities of the .TECH libraries in Wire is the ability to change the
condition code or power settings on an approach move. This feature is only available when
the Pass data has power settings defined for the approach pass:
When the condition code changes on the approach, this is indicated by the ccode_epac_flg$
value. This value is always 0 unless the condition code of the approach is different, in which
case it is 1.
Possible values
ccomp$
M L R W MT
Cutter compensation in control status of NCI data. Use of this variable
for output is not recommended. It has been superseded by cc_pos$.
Possible values
0 No change
1 Cancel
2 Left
3 Right
ccstart$
M L R W MT
[reserved for future use]
cctotip$
M L R MT
Indicate whether cutter compensation is offset from the tool center or tool
tip.
For Mill and Router, the proper setting of cctotip$ will generally depend on how the system
generates tool offsets from the part surface. Some offset methods are designed for tool center
milling (often when using a ball endmill), while some are designed for tool tip milling (often
used for a bullnose endmill).
Possible values
cc_1013$
M L R W MT
Enables calculating cc_pos$ (modal cutter compensation) when the NCI
1013 line is read in the tool change NCI block. It is recommended to use
cc_pos$ as the numeric variable selector for cutter compensation string select function.
Possible values
0 Do not calculate cc_pos$ with the cutter compensation value on the 1013 line.
(default)
1 Calculate cc_pos$ with the cutter compensation value on the 1013 line.
cc_computer$
M L R W MT
Flag to indicate cutter compensation in computer is set. See related cc_
pos$ for compensation in control.
Possible values
cc_pos$
M L R W MT
Modal cutter compensation variable. It is recommended to use cc_pos$
as the numeric variable selector for cutter compensation string select
function. When motion is broken into multiple moves in the post executable, cc_pos$ remains
equal to the previous value until the final move. See brk_cc_pos$, cc$ for more information.
Possible values
1 Left (G41).
2 Right (G42).
cc_type$
W
Cutter comp type in Mastercam Wire. This is read from the 20200 line when listrad$ =
2.
Possible values
0 Computer.
1 Control.
2 Both.
3 Reverse both.
4 Off.
cend$
M L R W MT
End-of-contour flag. It indicates the last point / tool location is on the
selected contour or surface.
This value is output as part of the cur_cflg$ parameter. The cur_cflg$ value contains seven digits,
where each digit stores the value of a separate pre-defined variable; the 100s digit contains the
cend$ value.
Note that this contour flag is combined to indicate the end of the contour and to indicate the
location where cutter compensation is or would be cancelled on a lead out (even when no
compensation was selected). With drilling toolpaths, cend$ = 3 on the final point to be drilled.
See cstart$, cur_cflg$, and skp_lead_flgs$ for related information.
Possible values
0 (000) No flag
cgstop$
M L R W MT
Optional program (glue) stop.
This value is output as part of the cur_cflg$ parameter. The cur_cflg$ value
contains seven digits, where each digit stores the value of a separate pre-defined variable; the
10s digit contains the cgstop$ value.
See cstop$ and cur_cflg$ for related information.
Possible values
0 No
1 Yes
chord_tol$
M L R W MT
Chordal deviation tolerance for breaking arcs and lines. This contains
the tolerance for inch output; see met_chord_tol$ for the metric
equivalent.
clearaux$
M L R W MT
Empties the file used for the auxiliary/alternate output stream (auxprg$).
This command also sets the numeric variable nchaux$ to 0. If the file is
not opened, the contents are not cleared. See the related variable mergeaux$.
Clearing output files
You can clear alternate files of their current contents by using the appropriate command
variable for the desired file. Simply place the command variable on a line by itself inside a
postblock.
Command
File to be emptied
variable
clearext$
M L R W MT
Empties the file used for the sub/alternate output stream (extprg$).
This command also sets the numeric variable nchext$ to 0. If the file is
not opened, the contents are not cleared. See the related variable mergeext$.
Clearing output files
You can clear alternate files of their current contents by using the appropriate command
variable for the desired file. Simply place the command variable on a line by itself inside a
postblock.
Command
File to be emptied
variable
clearlcc$
M L R W MT
Empties the file used for the sub/alternate output stream (lccprg$).
This command also sets the numeric variable nchlcc$ to 0. If the file is
not opened, the contents are not cleared. See the related variable mergelcc$.
Clearing output files
You can clear alternate files of their current contents by using the appropriate command
variable for the desired file. Simply place the command variable on a line by itself inside a
postblock.
Command
File to be emptied
variable
clearsub$
M L R W MT
Empties the file used for the sub/alternate output stream (subprg$).
This command also sets the numeric variable nchsub$ to 0. If the file is
not opened, the contents are not cleared. See the related variable mergesub$.
Clearing output files
You can clear alternate files of their current contents by using the appropriate command
variable for the desired file. Simply place the command variable on a line by itself inside a
postblock.
Command
File to be emptied
variable
clmp_op$
L MT
Indicates the operation mode for lathe chuck misc ops. (Option 3 was added in
Mastercam X5.)
Possible values
0 Clamp
1 Un-clamp
2 Re-position
3 Eject stock
clmp_spindle$
L MT
Active spindle for clamp/unclamp
Possible values
0 Left spindle
1 Right spindle
cm1$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm2$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm3$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm4$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm5$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm6$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm7$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm8$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
cm9$
M L R W MT
Construction plane matrix. See also m1$ through m9$. Note: this matrix
is rarely used.
The following table lists the coordinates of each vectors if the construction plane matrix aligns
with one of the 8 standard views:
Possible values
comment$
M L R W MT
Outputs the comments taken from the NCI and buffered at the tool
change. This allows the post writer to position the location where
comments are written in the tool change postblocks and end-of-file postblock.
By default, comments are output immediately before the toolchange. If you wish to output the
comments after the toolchange, use the comment$ command to output them at the desired
location.
The comment$ command affects comments output with the following NCI lines:
n 1005
n 1006
n 1008
n 1051
n 1052
n 1053
If MP sees the comment$ command in your post, when the above NCI lines are encountered,
MP will save the comments to a special buffer instead of outputting them. When the
comment$ command is encountered, the comments will be output, one string at a time. For
each saved comment, MP copies the comment string to scomm$ and calls the pcomment$
postblock. This gives you an opportunity to format the comments before they are output to
your NC file.
The comment$ command is typically used in the following postblocks:
n psof$, lsof$, msof$
n ptlchg$, ltlchg$, mtlchg$
n ptlchg0$, ltlchg0$, mtlchg0$
n peof$, leof$, meof$
You should never call the pcomment$ postblock directly from any of these postblocks. Always
use the comment$ command instead.
Notes:
n comment$ is only used as a command word, it has no value.
n To control which comments are output, use the comm_filter$ to suppress unwanted
comments.
comment_probe$
M L R W MT
Use the comment_probe$ command to trigger the output of buffered
probing comments. The pcomment_probe$ postblock will be called once
for each buffered comment.
This will typically trigger a call to either pcomment_probe$ postblock. However, you can also
configure your post so that the comment_probe$ command will call pcomment$ instead.
The exact behavior of this command—and whether it has any effect at all, or is ignored—is
determined by the x_probe_opt$ value. In our recommended configuration—with x_probe_opt$ =
1022—the comment_probe$ command is ignored.
commlng$
Number of characters in a comment from the NCI file. commlng$ is only M L R W MT
available if the comment is not buffered (see comment$) and the NCI line
is 1005, 1006 or 1008.
commvar$
M L R W MT
Converted comment from the NCI file to a number.
If the comment string (in other words, the string currently stored in
scomm$) consists entirely of numerals (0–9, +, –, or “.” ), MP will automatically convert it to a
number and store the value in commvar$. The scomm$ string will then be cleared.
To turn off this behavior, simply initialize commvar$ to –1.
comm_call$
M L R W MT
Reports how many times the comment output loop has been called (in
other words, 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.
Initializing comm_cnt$ : –1 will allow the comment output loop to be called only with the
command word comment$.
comm_cnt$
M L R W MT
Reports how many comments have been buffered in from the NCI data
prior to output in a comment output loop.
Use comm_cnt$ to control the comment buffer output by redefining the number of comments
that MP has written to the comment buffer. This tricks MP into ending or re-reading the
buffered comments.
comm_cnt$ is not affected by probing comments; use comm_cnt_probe$ instead.
comm_cnt_probe$
Reports how many comments have been buffered from the NCI 1056 M L R W MT
lines prior to being output. Similar to comm_cnt$ except that it only
applies to probing comments.
comm_end_nci$
M L R W MT
NCI line number of the last comment to be output.
comm_filter$
M L R W MT
Binary flag that filters the comments that MP reads from the MCX file;
each bit prevents the processing of a different comment type.
Since Mastercam X, all comments are written to the NCI file. Use this variable to filter the
comments that MP reads from the file and prevent the processing of selected comment types.
The value of this variable is a “license-plate” integer with 10 digits. Each digit, when set to 1,
prevents processing of a specific comment type. A value of 0 for a digit allows processing of the
comment.
Four of the digits are set from the following control definition options:
Most of the standard .SET–based setup sheets supplied with Mastercam override the value of
comm_filter$ to zero. This overrides any restrictions in the Machine Group Properties and
allows all comments to be processed for the setup sheet, even if the programmer doesn’t want
Predefined variables, postblocks, and functions: page 381
the comments in the NC file itself. Note that the value must be overridden inside a postblock,
as shown in the example below.
Possible values
1000’s NCI 1008 comment—operation comment. Set this digit with the Output
operation comment to NC option.
#YOU MAY CALL FROM HERE) BECAUSE THE NC OUTPUT FILE IS NOT YET OPENED!
sub_level$ = 0 #Force subs off
subout$ = 0 #Force output stream to NC file
comm_filter$ = 0 #Allow output of all comments
#sextnc$ = ".doc" #Uncomment and change extension here to override
#Force longhand drilling cycles for proper time estimate
lusecandrill$ = no$ #Use canned cycle for drill
lusecanpeck$ = no$ #Use canned cycle for Peck
lusecanchip$ = no$ #Use canned cycle for Chip Break
lusecantap$ = no$ #Use canned cycle for Tap
lusecanbore1$ = no$ #Use canned cycle for Bore1
lusecanbore2$ = no$ #Use canned cycle for Bore2
lusecanmisc1$ = no$ #Use canned cycle for Misc1
lusecanmisc2$ = no$ #Use canned cycle for Misc2
spaces$ = 0
use_alt_eob$ = no$
Predefined variables, postblocks, and functions: page 383
comm_st_nci$
M L R W MT
NCI line number of the first comment to be output.
contour_pos$
Captures the Chain height setting from the Taper page. The possible values depend W
on the type of contour (see contour_typ$).
n If the contour type is 0–2, contour_ pos$ will be equal to 0 or 2.
n If the contour type is 3 or 4, then contour_ pos$ will be either 1 or 2.
Possible values
0 XY height
1 Land height
2 UV height
contour_typ$
Captures the taper or slug type from the Taper page. The values 0–4 correspond to W
the pictures in the dialog box, from left to right (value 0 means the Taper option isn’t
selected):
Possible values
0 No taper
1 Taper in
2 Taper out
3 Land up
4 Land down
controldefault$
W
Indicates Agie control model.
Mastercam X4 introduced the new Agievision custom interface for Wire. To support
the new interface, MP added some new validation routines designed to ensure that the post
selected for the wire machine definition has been configured to work with the Agievision
interface. This is centered on the value of controldefault$, which is set in the control
definition. The value from the control definition is then compared to a string that is set in the
post file.
The Wire control definition includes a new Control Model page. The Machine model field sets
the value of controldefault$.
n Selecting Generic sets controldefault$ = 0
n The 11 different Agie models set controldefault$ equal to a value from 1–11.
MP uses this string to construct a range of valid values (in this case, 1 through 11) that are used
to validate controldefault$. So if the Generic machine model is selected in the control
definition, controldefault$ will equal 0 and an error message will be generated, because 0 is
not included in the range of valid values.
In this way, the single Agievision post can be used with any of the 11 Agie models.
n Limit the range of valid models by adjusting the value of sx_nci_default$.
n Customize the post for specific models by testing for the value of controldefault$.
The text of the Machine model string is also available directly as a string parameter, 22001.
Predefined variables, postblocks, and functions: page 387
Possible values
1–11 Numeric code that indicates the specific Agie control model.
controltype$
M L R W MT
Indicates product key for post.
Possible values
0 Mill
1 Router
2 Lathe
3 Wire
4 Mill/Turn
convert_rpd$
M L R W MT
Use this to have G0 moves output as G1 moves at the maximum feed
rate. This is set in Control Definition > Feed page.
coolant$
M L R MT
Version 9-style coolant status. Note that in addition to being output directly
with the tool change NCI lines 1000/1001/1002, coolant$ is also embedded
as one of the cur_cflg$ digits, and so is available for all of the motion NCI lines as well.
Possible values
0 Off
1 Flood
2 Mist
3 Thru-the-tool (spindle)
corgx$
M L R W MT
Construction plane origin X value.
corgy$
M L R W MT
Construction plane origin Y value.
corgz$
M L R W MT
Construction plane origin Z value.
cplnno$
M L R W MT
Construction plane number. Planes 1–7 are standard planes as noted
below. Higher numbers generally refer to a custom user-defined view.
Right-click on a view in the View Manager and select Info to find out what number is assigned
to a custom view:
Possible values
1 Top
2 Front
3 Back
4 Bottom
5 Right
6 Left
7 Isometric
css_actv$
M L R MT
Constant surface speed flag. See also ipr_actv$, ss$, spdir$.
Possible values
1 On
cstart$
M L R W MT
Start-of-contour flag. It indicates the beginning of the selected contour
or surface.
n With 5-axis toolpaths (NCI Gcode 11), it indicates the first point where the tool is on
the selected surface.
n With contour toolpaths, it is set at the endpoint of the first actual move (the second
point in the toolpath).
n With drilling toolpaths, cstart$ = 3 on the first point to be drilled.
This value is output as part of the cur_cflg$ parameter. The cur_cflg$ value contains seven digits,
where each digit stores the value of a separate pre-defined variable; the 1000s digit contains
the cstart$ value.
Note that this contour flag is combined to indicate the start of the contour and to indicate the
location where cutter compensation would be engaged on a lead in (even when no
compensation was selected).
See cend$, cur_cflg$, and skp_lead_flgs$ for related information.
Possible values
0 (0000) No flag
cstop$
M L R W MT
Program stop flag.
This value is output as part of the cur_cflg$ parameter. The cur_cflg$ value
contains seven digits, where each digit stores the value of a separate pre-defined variable; the
1s digit (the right-most digit) contains the cstop$ value.
See the related variable cgstop$.
Possible values
0 No
1 Yes
cur_cflg$
M L R W MT
Contour flag. This variable is not normally accessed directly but the flags
carried in it are extracted to the individual numeric variables.
The control flags (also called “contour flags”) parameter is a single 7-digit parameter (8 digits
for Wire) passed from the NCI that carries several pieces of information in a single numeric
value. The control flags parameter appears in every motion NCI Gcode (Gcodes 0, 1, 2, 11, 81)
to control such values as contour start, stop, and end, coolant, and 5-axis angles (for Mill) or
rapid behavior (for Lathe).
Each digit or place value in the control flags parameter value represents an individual flag. For
example, place value 1 (first digit) is the contour stop flag, 10 (second digit) is the contour
optional stop flag, 100 (third digit) is the contour end flag, and so forth. When added together,
the result is a single number that represents multiple flags. Zero is implied when the place
fields are empty, but only leading zeros may be omitted. Separate pre-defined variables are
defined for each digit.
For example (in Mill), if:
cur_cflg$ = 3201001
then the control flags set the following (reading left to right):
n 5-axis: 180-degree angle
n Coolant flood
n Rapid type flag = 0, no value set
n Contour start on
n Contour end = 0, not set
n Contour optional stop = 0
n Contour stop on
The flag as read from the NCI is available as the predefined variable cur_cflg$. However, this
value is rarely, if ever, accessed or used directly. Instead, you will typically access the separate
variables that are set by each digit as noted in the following tables.
Some of the flags are 0/1 values only, while others can have additional values. Click the
variable name to see details about each specific flag.
See also the NCI Reference PDF file for each Mastercam version.
See skp_lead_flgs$ for additional important information.
Possible values
The following variables are assigned to each digit. The values 1, 10, etc. in the table
indicate the digit for each variable, not the actual values for any individual variable.
Mill/Router
1000000 Indicates how to process rotation angles for primary and secondary axes :
rev5$
Wire
cutmode$
M L R W MT
Corner rounding mode.This is set in the control definition with the
following setting:
Separate mill (cutmode$) and lathe (lcutmode$) versions let you set this individually in mill-
turn posts.
Possible values
0 Control cutting mode. The exact effect of this setting is machine-dependent, but it
typically prevents the exact stop.
1 Control exact stop mode. The machine tool checks to make sure that the endpoint
is reached. The tool decelerates to a stop at the endpoint. When this is not
engaged, a machine can over- or under-shoot the exact position.
2 Control corner rounding mode. The exact effect of this is machine-dependent, but
typically the control will insert arcs at sharp corners in the toolpath. It produces
the same effect as setting the Roll cutter around corners option to Sharp, which you
can use when you are calculating cutter compensation in computer.
cutpos$
M L R W MT
5-axis toolpath position flag.This is output as the left digit of parameter 8
on the NCI 11 line. Parameter 8 is a 2-digit number, where the left digit
is cutpos$ and the right digit is cuttyp$.
Note: If the numeric variable rpd_typ_v7$ is set, a cutpos$ of 5 is converted to 4.
Possible values
2 In cut.
4 Lead-in motion.
5 Lead-out motion.
6 Safety zone.
cutpos2$
M L R W MT
Universal toolpath position flag. Its purpose is to provide feedback as to
where a particular move is in a toolpath. The flag relies on the NCI data
providing accurate data. See also cstart$, cend$ variables.
Possible values
2 In cut.
cuttyp$
M L R MT
5-axis cut motion type.This is output as the right-most digit of parameter 8
on the NCI 11 line. Parameter 8 is a 2-digit number, where the left digit is
cutpos$ and the right digit is cuttyp$.
Possible values
1 Zig-zag
2 One way
3 Circular
4 Swarf
cutx$
W
Wire cut position available at the tool change block, NCI Gcode 1015 data.
See related variables startx$, starty$, startz$ and threadx$, thready$, threadz$.
cuty$
W
Wire cut position available at the tool change block, NCI Gcode 1015 data.
See related variables startx$, starty$, startz$ and threadx$, thready$, threadz$.
cutz$
W
Reserved for future use.
czero$
M L R MT
[reserved for future use]
c_mmlt$
M L R MT
Calls the routine and postblocks for transform subprograms with multiple
tools. This allows the post writer to control the location where the
subprogram is called and the output stream is switched in the tool change postblocks.
The c_mmlt$ command calls the psub_call_mm$ postblock when a 1018 line is encountered in
the NCI and the transform operation has two or more tool changes in it. This postblock is used
to output the subprogram call to the main level output file. It is desirable to output the tool
inside the main program (level 1), allowing the tool to be called repeatedly.
Note: The variable sub_mny_t$ —as read from the NCI 1018 line—tells MP if more than one
tool is contained in a transform operation.
c_msng$
M L R MT
Calls the routine and postblocks for transform subprograms with a single
tool. This allows the post writer to control the location where the
subprogram is called and the output stream is switched in the tool change postblocks.
The c_msng$ command calls the psub_call_m$ postblock when a 1018 line is encountered in the
NCI and the transform operation has only one tool change in it. This postblock is used to
output the subprogram call to the main level output file. It is desirable to output the tool
before the main call at the NC level so that the current tool is not called again.
Note: The variable sub_mny_t$ —as read from the NCI 1018 line—tells MP if more than one
tool is contained in a transform operation.
c_rcc_setup$
L MT
Calls the routine and postblocks for lathe canned cycle to capture values from
the roughing tool. This allows the post writer to control the location where the
information is captured in the tool change postblocks.
When the first 60000 flag is found in the roughing toolpath, rcc_flg$ is set to 1. This enables a
call to the prcc_setup$ postblock by c_rcc_setup$ in both tool and motion postblocks .
Note: The c_rcc_setup$ command should be located in both tool and motion postblocks for
posts intending to support lathe canned cycles, as shown in the examples below.
date$
M L R W MT
The current date from your system. You can use this value in either of
two ways:
n If no format is assigned to this variable, it will output the current system date as a string,
in the format DD-MM-YY.
n If you do assign a format to it, the value will be 0–6, indicating the day of the week,
Sunday–Saturday.
See related variables time$, day$, month$, year$, mon$.
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 415
day$
M L R W MT
Returns the day of the week for the current date.
The variables day$, mon$, month$ and year$ return the day, month and
year of the current date. They behave differently depending on whether you have assigned a
format.
n If no format has been applied, they return the date information as a text string,
according to the table below.
n If a format has been applied, they are treated like a numeric variable and the number
will be formatted as specified when it is output.
For example, assuming the following format statements:
fs 6 0.1
fmt 6 day$
fmt 6 month$
fmt 6 year2
year2 = year$ + 2000 # Change 09 to 2009
The following table shows what the formatted and unformatted output would be:
month$ 09 9.0
year$ 08 8.0
day$ 26 26.0
*progno$, e$
"(", "PROGRAM NAME: ", sprogname$, ")", e$
"(", "DATE: ", month$, "-", day$, "-", year$, ")", e$ # Ex. 02-12-05
"(", "TIME: ", time$, ")", e$
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 417
db_lvl_src$
M L R W MT
[reserved for future use]
db_lvl_trg$
M L R W MT
[reserved for future use]
db_repaint$
M L R W MT
[reserved for future use]
db_restore$
M L R W MT
[reserved for future use]
db_save$
M L R W MT
[reserved for future use]
dec_seq_left$
M L R W MT
When you are using decimal sequence numbers, this determines how
many digits appear to the left of the decimal point. Set in the control
definition: NC Output page.
dec_seq_right$
M L R W MT
When you are using decimal sequence numbers, this determines how
many digits appear to the right of the decimal point. Set in the control
definition: NC Output page.
deg2rad$
M L R W MT
The value required to convert constant degrees to radians (0.017453293).
depth$
M L R MT
n 3-axis drill: Absolute Z position of the drill point at the bottom.
n 5-axis drill: Incremental distance from reference height to the bottom.
dirchg$
M L R W MT
Indicates if any of the axes (X, Y or Z) have changed direction. This is
calculated for NCI 0, 1, 11, 81, 100.
Possible values
0 No change
1 Change
dll_vers$
M L R W MT
Mastercam post processor (MP.DLL) version number. Use this to check
that the post processor is compatible with MP.
This value is typically the same as the Mastercam version (vers_no$) and post version (post_
version$). These are primarily used internally to verify that your post and the MP.DLL are the
proper version or if either needs to be updated. However, you should not assume that they will
continue to be the same in future releases.
dlm_strsel$
M L R W MT
When set negative, adjusts the location of the setseloffs return by the
absolute value in this variable.
dmax$
M L R W MT
Maximum X or Y axis move with current circular motion. If the change
in X is greater than Y, the value of this variable is the change in X.
Otherwise, its value is change in Y.
dofs$
W
Current wire condition. This is considered obsolete for modern posts; use ccode$
instead.
do_full_arc$
M L R W MT
Allow full circle (360-degree sweep) arc motion output in the specified
plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
Possible values
do_full_arcxz$
M L R MT
Allow full circle (360-degree sweep) arc motion output in the specified
plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
Possible values
do_full_arcyz$
M L R MT
Allow full circle (360-degree sweep) arc motion output in the specified
plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
Possible values
do_xy_arcs$
M L R W MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Possible values
1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.
do_xz_arcs$
M L R MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Possible values
1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.
do_yz_arcs$
M L R MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Possible values
1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.
drill5$
M L R MT
Flag to indicate 5-axis drilling is active. Note that this variable is not set at
the tool change.
Possible values
Greater than 1 If rotaxtyp$ is less than 6, this variable acts as a counter and is
incremented for each additional continuous drill position.
drillcur$
M L R W MT
Indicates a drill cycle (long or canned) is active. Note that this variable
is not available at the tool change. It is set after the drill cycle NCI
Gcode 81 or 100 and is shut off with the next NCI line read.
Possible values
1 Drilling is active
drillcyc$
M L R MT
Type of canned drill cycle.
For 5-axis drilling, MP adds 100 to each value shown above when the
pdrill0$ postblock is called. On exit from the pdrill0$ postblock, MP subtracts 100 from each
value. See the related drl_cycle$ variable.
Possible values
0 Simple
1 Peck
2 Chip break
3 Tap
4 Bore #1
5 Bore #2
6 Misc #1
7 Misc #2
drl_cycle$
M L R MT
The drill cycle code. This is set from the drillcyc$ value as read from the
Gcode 81 NCI line. This is not manipulated for 5-axis drill cycle reverse
compatibility; compare to the related drillcyc$ variable, which has 100 added to it when 5-axis
drilling.
Possible values
0 Simple
1 Peck
2 Chip break
3 Tap
4 Bore #1
5 Bore #2
6 Misc #1
7 Misc #2
drl_cycle_actv$
M L R MT
The active state of a canned cycle.
n When pdrill0$ is called on the cycle definition start, the value of drl_cycle_actv$ is 0.
n Once the canned cycle is active, drl_cycle_actv$ is set to 1. In this state, a call to the
pcanceldc$ postblock—either from an NCI Gcode 80 or from the command variable
canceldc$—will be successful. A call to pcanceldc$ sets drl_cycle_actv$ to 0.
If a NCI gcode 100 is read, drl_cycle_actv$ is set to –1. This forces an artificial call to the
drillcycle definition postblock and reestablishes the drill cycle.
See canceldc$ for related information.
Possible values
0 Not active
1 Active
drl_depth_x$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).
drl_depth_y$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).
drl_depth_z$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).
drl_dia$
M L R W MT
For Router block drill operations, this is the diameter of the drill that has
been selected for the current hole.
This is also output for Mill and Lathe drill operations, but is always 0 in those cases.
drl_init_x$
M L R MT
The drill position for the (initial) height point in space (rotated or mapped
based on post processor settings).
drl_init_y$
M L R MT
The drill position for the (initial) height point in space (rotated or mapped
based on post processor settings).
drl_init_z$
M L R MT
The drill position for the (initial) height point in space (rotated or mapped
based on post processor settings).
drl_m1$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m2$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m3$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m4$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m5$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m6$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m7$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m8$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_m9$
M L R MT
Drilling position tool plane matrix. Each set of three variables describes one
of the X-Y-Z axis vectors:
n drl_m1$–drl_m3$ = X-axis vector
n drl_m4$–drl_m6$ = Y-axis vector
n drl_m7$–drl_m9$ = Z-axis vector
First, the original toolplane matrix, m1$ through m9$ (from 1014 NCI data), is copied to this
drl_m1$–drl_m9$ matrix when the Gcode 81 NCI (drilling start) data is read.
Then, the drl_m1$–drl_m9$ matrix is copied to the toolplane matrix m1$ through m9$ at the
NCI Gcode 100 (drilling subsequent point).
The following table lists the values that will be output if the plane equals one of the 8 standard
views. If the plane is instead aligned with a user-defined view, the values will be different.
Possible values
drl_plane$
M L R MT
The plane relative to the drill direction motion.
Possible values
]
!drl_plane$
Predefined variables, postblocks, and functions: page 473
drl_prm1$
M L R W MT
The custom drill parameters:
drl_prm10$
M L R W MT
The custom drill parameters:
drl_prm2$
M L R W MT
The custom drill parameters:
drl_prm3$
M L R W MT
The custom drill parameters:
drl_prm4$
M L R W MT
The custom drill parameters:
drl_prm5$
M L R W MT
The custom drill parameters:
drl_prm6$
M L R W MT
The custom drill parameters:
drl_prm7$
M L R W MT
The custom drill parameters:
drl_prm8$
M L R W MT
The custom drill parameters:
drl_prm9$
M L R W MT
The custom drill parameters:
drl_ref_x$
M L R MT
The drill position for the (reference) point in space (rotated or mapped
based on post processor settings).
These were added in Version 9.1 to support mapped drilling. Since the drill direction is no
longer confined to the Z-axis, each parameter must become a point in space.
drl_ref_y$
M L R MT
The drill position for the (reference) point in space (rotated or mapped
based on post processor settings).
These were added in Version 9.1 to support mapped drilling. Since the drill direction is no
longer confined to the Z-axis, each parameter must become a point in space.
drl_ref_z$
M L R MT
The drill position for the (reference) point in space (rotated or mapped
based on post processor settings).
These were added in Version 9.1 to support mapped drilling. Since the drill direction is no
longer confined to the Z-axis, each parameter must become a point in space.
drl_sel_ini$
M L R MT
Distance from the selected drill position to the initial height; the sign is
positive if this location is above the selected drill position.
See the related drl_init_x$, drl_init_y$, drl_init_z$ and initht$ variables.
drl_sel_ref$
M L R MT
Distance from the selected drill position to the reference height; the sign is
positive if this location is above the selected drill position.
See the related drl_ref_x$, drl_ref_y$, drl_ref_z$ and refht$ variables.
drl_sel_tos$
M L R MT
Distance from the selected drill position to the top of stock.
The sign is positive for above selected drill position.
See the related drl_tos_x$, drl_tos_y$, drl_tos_z$ variables.
drl_skewed$
M L R MT
Flag to indicate the drill direction does not match any drl_plane$ direction.
Possible values
0 False
1 True
drl_tos_x$
M L R MT
The top of stock point in space (rotated or mapped based on post processor
settings); changing the machine base matrix values (matb1$ –matb9$) in the
post will affect these values.
drl_tos_y$
M L R MT
The top of stock point in space (rotated or mapped based on post processor
settings); changing the machine base matrix values (matb1$ –matb9$) in the
post will affect these values.
drl_tos_z$
M L R MT
The top of stock point in space (rotated or mapped based on post processor
settings); changing the machine base matrix values (matb1$ –matb9$) in the
post will affect these values.
drl_vtoolx$
M L R MT
The drill direction calculated from the initial height point to the depth
point (rotated or mapped based on post processor settings); changing the
machine base matrix values (matb1$ –matb9$) in the post will affect these values.
drl_vtooly$
M L R MT
The drill direction calculated from the initial height point to the depth
point (rotated or mapped based on post processor settings); changing the
machine base matrix values (matb1$ –matb9$) in the post will affect these values.
drl_vtoolz$
M L R MT
The drill direction calculated from the initial height point to the depth
point (rotated or mapped based on post processor settings); changing the
machine base matrix values (matb1$ –matb9$) in the post will affect these values.
drl_zdrl_x$
M L R MT
The drill position for the selected (geometry) point in space (rotated or
mapped based on post processor settings); changing the machine base
matrix values (matb1$ –matb9$) in the post will affect these values.
drl_zdrl_y$
M L R MT
The drill position for the selected (geometry) point in space (rotated or
mapped based on post processor settings); changing the machine base
matrix values (matb1$ –matb9$) in the post will affect these values.
drl_zdrl_z$
M L R MT
The drill position for the selected (geometry) point in space (rotated or
mapped based on post processor settings); changing the machine base
matrix values (matb1$ –matb9$) in the post will affect these values.
dum$
M L R W MT
Reserved for internal processing only. Never use this variable!
dwell$
M L R W MT
Machine dwell time. Typically this is read from the NCI as a drill cycle
parameter.
The standalone dwell (NCI 4 line) can be generated with the Change at point function:
e$
M L R W MT
Output a carriage return/line feed to the output (NC) file.
You must explicitly include an e$ when you wish to end a line of NC
output. Output postlines that do not end with e$ are allowed; but in such cases, the next NC
output will be appended to the current line of output.
In Mastercam version 9 and earlier, the post processor automatically output a carriage
return/line feed to the NC file from predefined postblocks, so in many cases e was not
required. This was changed in Mastercam X and made a requirement.
ea$
M L R W MT
End angle (in degrees) of an arc move.
end_gcode$
In the ptoolend$ postblock, this indicates the NCI Gcode for the next tool M L R W MT
change. This tells you whether the next tool change will be a null tool
change or not.
See postblock ptoolend$ for more information.
Possible values
end_opcode$
M L R W MT
In the ptoolend$ postblock, this indicates the operation code for the next
tool change.
See postblock ptoolend$ and opcode$ for more information.
if end_gcode$ = 1000,
[
#Null toolchange
toolchng = m_one
#Filter retract if toolplane is the same toolplane path
if tlplnno$ = end_tlplnno$ & (end_opcode$ <= 16 | end_opcode$ = 19),
tlch_ret_app = m_one
pretract_mov
pg69
]
else,
[
#Actual toolchange
toolchng = two
pretract
]
!speed, !spdir2, !tlch_ret_app, !g_lim_trip
Predefined variables, postblocks, and functions: page 506
end_op_id$
M L R W MT
In the ptoolend$ postblock, this indicates operation ID for the next tool
change.
See postblock ptoolend$ and op_id$ for more information.
end_rot_type$
M L R MT
In the ptoolend$ postblock, this is the rotary axis type setting for the next
tool change.
See postblock ptoolend$ and rotary_type$ for more information.
Possible values
1 Axis substitution
2 3 axis
if end_gcode$ = 1000,
[
#Null toolchange
toolchng = m_one
#Filter retract if toolplane is the same toolplane path
if tlplnno$ = end_tlplnno$ & (end_opcode$ <= 16 | end_opcode$ = 19),
tlch_ret_app = m_one
pretract_mov
pg69
]
else,
Predefined variables, postblocks, and functions: page 508
[
#Actual toolchange
toolchng = two
pretract
]
!speed, !spdir2, !tlch_ret_app, !g_lim_trip
Predefined variables, postblocks, and functions: page 509
end_str_ix$
M L R W MT
Holds the ending match index in a string variable for the string functions
strstr and scan. The value of end_str_ix$ is different between the two
functions:
n With the strstr function, if the main string is “aluminum 0.625 bar” and the substring is
aluminum”, then end_str_ix$ equals 10.
n With the scan function, if the main string is “aluminum 0.625 bar” and the substring is
“aluminum”, then end_str_ix$ equals 16.
Beginning with Mastercam 2017, this functionality has been extended to the following
parameter read functions:
n rpar
n rparsngl
n rparsprm
See st_str_ix$ to find the start index.
end_tlplnno$
M L R W MT
In the ptoolend$ postblock, this is the tool plane (Tplane) number for the
next tool change.
See postblock ptoolend$ and tlplnno$ for more information.
if end_gcode$ = 1000,
[
#Null toolchange
toolchng = m_one
#Filter retract if toolplane is the same toolplane path
if tlplnno$ = end_tlplnno$ & (end_opcode$ <= 16 | end_opcode$ = 19),
tlch_ret_app = m_one
pretract_mov
pg69
]
else,
[
#Actual toolchange
toolchng = two
pretract
]
!speed, !spdir2, !tlch_ret_app, !g_lim_trip
Predefined variables, postblocks, and functions: page 511
end_workofs$
M L R W MT
In the ptoolend$ postblock, this is the work offset number for the next
tool change.
See postblock ptoolend$ and workofs$ for more information.
if end_gcode$ = 1000,
[
#Null toolchange
toolchng = m_one
#Filter retract if toolplane is the same toolplane path
if tlplnno$ = end_tlplnno$ & (end_opcode$ <= 16 | end_opcode$ = 19),
tlch_ret_app = m_one
pretract_mov
pg69
]
else,
[
#Actual toolchange
toolchng = two
pretract
]
!speed, !spdir2, !tlch_ret_app, !g_lim_trip
Predefined variables, postblocks, and functions: page 512
eo$
M L R W MT
End octant of the current arc.
The octant numbers on a quadrant line are assigned for arcs having
endpoints that fall within the mtol$ tolerance of the matching quadrant.
Possible values
eob$
M L R W MT
Optional end-of-block character. The post executable can output two
end-of-block characters by setting both the eob$ and prv_eob$
characters.
n The eob$ and prv_eob$ characters do not replace the carriage return/line feed written
to the end of the NC output by default. Select the Remove CR/LF... option (omitcrlf$) to
suppress these characters at the end of your block.
n To output the null character, enter a value of 0.
n If eob$ is set to null, the second alternate EOB character will not be output. It is
possible to output only a single null.
Possible values
epac_flg$
W
Indicates that a new power setting or condition code (epac) is used on the approach
point.
When the approach power settings are defined in Wire, the Approach distance field on the
Leads page is enabled:
This is indicated in the NCI by a control flag—the ninth digit of the cur_cflg$ value, so that
points added to the NCI to accommodate this approach move are flagged 100000000. The
value of this digit is stored in epac_flg$.
A corresponding new brk_ variable, brk_epac_flg$, has also been created to support any break-
of-motion routines that might need it.
Possible values
1 Indicates that the approach point uses different power settings or condition code.
error_msg$
M L R W MT
Controls the display of error messages during post processing. This is set
with the following control definition option on the Files page:
Note: When error messages are displayed on the screen, they appear in the following dialog
box:
Typically, any messages that are generated will flash by too quickly to be read. The All error
messages to file option should be selected in almost all circumstances.
See err_file$ for related information.
Possible values
1 Send all error messages encountered to screen (log file is generated but not saved)
err_file$
M L R W MT
This is set by the Keep error file option in the control definition.
It determines in which conditions the .ERR log file is saved after post processing.
n The .ERR file will be saved to the same folder as the .NC file.
n It will have the same name as the NC .file, but with a .ERR extension.
No matter which option is selected, if the file is written, it will be a complete log of the MP
processing session, including errors, warnings, and routine status messages.
See error_msg$ for related information.
Possible values
0 On fatal errors—Keep the error file only if fatal post errors were generated
(default).
1 On fatal and non-fatal errors—Keep the error file if any errors, either fatal or non-
fatal, were generated.
2 On post errors and messages—Keep the error file if any post errors were generated
or there were any mprint messages.
3 On errors, messages and prompts—Keep the error file if any post errors, mprint
messages, or user prompts (fq post questions during processing) were generated.
4 Always keep log file—Always keep the (.ERR) error log file
esub_chn_no$
For non-transform subprograms, this is the chain number. This is not used M L R MT
for transform subprograms. See also sub_chn_no$.
esub_grp_id$
This is the operation ID # (op_id$) of the source operation. See also sub_grp_ M L R MT
id$ for much more information.
esub_op_id$
This is a unique ID number for the subprogram. M L R MT
See sub_op_id$ for much more information.
esub_ref_id$
M L R MT
Subprogram reference ID. If the current subprogram is a transform
operation, this value is read from the first parameter of the 1019 line.
Otherwise, it is 0.
See sub_ref_id$ for much more information.
Possible values
0 Non-transform
>0 Transform
esub_sec_no$
M L R MT
Indicates the subprogram iteration.
For non-transform subprograms
The flag indicates the current iteration of the subprogram pattern.
n The numbering is from base 1.
n The subprogram code is output when the value is 1 (which indicates the first iteration).
n The values are negative if the patterns are copies nested in a transform toolpath to
prevent output of the copies.
For transform subprograms
The flag indicates the current iteration of the transformed toolpath.
n The numbering is from base 0.
n The subprogram code is output when the value is 0.
See sub_sec_no$ for much more information.
esub_totl_no$
M L R MT
Total number of subprogram instances.
See sub_totl_no$ for much more information.
esub_trns_id$
Indicates whether or not the current subprogram is a transform subprogram. M L R MT
See also sub_trns_id$.
Possible values
0 Non-transform.
>0 Transform
ex$
Aborts the current postline at the location of the command and returns M L R W MT
to the NCI file to read the next set of NCI lines.
Use of this variable is not recommended. Instead, use conditional branching statements for
post logic. It is very difficult to debug when this command is used.
exitpost$
M L R W MT
Aborts the entire posting process and exits the post executable.
extend$
M L R W MT
Set this variable to enable access to extended variable values.
MP post writers are familiar with the idea that every variable actually has
a set of two values: its current value and its previous (prv_) value. Mastercam 2017 extends
this set to include two additional values for each variable: an extended value, and its prv_
extended value. You can think of each variable as having four “slots:”
n standard value
n previous standard value
n extended value
n previous extended value
The extended values have no predefined relationship to the standard value. That is up to you,
as the post writer, to determine. Use them in circumstances when creating many additional
variables would be inefficient or result in cumbersome code. For example, you might want to
perform a calculation in different ways and compare the results, or maintain different values
for use in different streams.
Use the extend$ variable to enable access to these values and to control how MP uses
standard and extended values in its calculations. You can choose to use extended values for
either the source (input) values for these calculations, or the target (result) values. For
example, consider the following calculation:
my_var = sin(angle_var)
The target variable is my_var, and the source variable is angle_var. The extend$ mode tells
MP whether you want to use extended values for the left side of the equation, the right side, or
both. The following values are supported:
1 Standard Extended
2 Extended Standard
3 Extended Extended
Typically, you would want to change the extend$ value locally, to manipulate specific
calculations or formulas, rather than affecting your post as a whole or large sections of it. For
example, the following block would be a typical use:
extend$ = 2
x$ = vequ(x$)
extend$ = 0
In this example, once the desired result is obtained, the post writer immediately returns
extend$ to its default mode. Future references to x$ will return whatever value it had before
this block of code—whatever happens while extend$ = 2 has no effect on its standard value.
The result of the vequ(x$) function cannot be accessed unless extend$ is set again to
Predefined variables, postblocks, and functions: page 529
explicitly access its extended value. For example, you can set extend$ = 1 to use the
extended value as the source value in a new calculation.
It is important to understand that extended values can only be used for calculations, formulas,
and as arguments for functions. Extended values are never used for output (except as described
below using bug4$) or lookup tables. Variable initializations (including global assignments)
also do not use the extend$ mechanism; however, processing global assignments in a postline
does.
Note that the use of extended values in your post should be considered an advanced topic.
These should typically only be used by experienced post writers who are comfortable with
advanced post techniques.
Initial values and previous values
When you set the extend$ mode to enable access to extended values, it is important to
understand that the extended value of a variable does not default to the standard value. Each
variable is in essentially the same state as a newly created, uninitialized variable. So if the
standard value of x$ = 3.5 and you switch to extended mode, x$ will not have a value until
you assign it a value. In particular, its extended value will not be 3.5–its standard value—unless
you assign it.
Also, because extended values are not output, the prv_ values typically do not get set. For
example, if the extended value of x$ = 3.5 and you assign it a new value—perhaps as the result
of a calculation—its previous extended value does not change. So the prv_ extended values
are basically just another slot that you can use or set as you see fit.
While you cannot explicitly copy extended values to standard values and vice versa, you can
accomplish the same thing when extend$ = 1 or extend$ = 2.
n When extend$ = 1, Mastercam uses the extended value as the source and the standard
value as the target. So the statement x$ = x$ will effectively copy the extended value
of x$ to the standard value.
n When extend$ = 2, Mastercam uses the standard value as the source and the extended
value as the target. So the statement x$ = x$ will effectively copy the standard value
of x$ to the extended value.
Exceptions to extend$ and special cases
There are several instances where the use of extended values doesn’t make any sense and is
therefore not supported. These include:
n The value of extend$ itself only has standard values.
n The extend$ mode is ignored when newglobal$ is evaluated.
n The extend$ mode is ignored for prmcode$ when the fprm function is used. In addition,
when fprm is populating the variables in the parameter table, it will only use the
standard values.
n The extend$ mode is ignored when linklvar$, linktolvar$, and linkplnvar$ are evaluated or
processed by MP. However, the extend$ mode is not ignored when you assign a value
to them.
Many functions have helper variables whose values are either read or set when the function is
used. The following table summarizes how the extend$ state is applied to those variables
when specific functions are used.
Predefined variables, postblocks, and functions: page 530
extend$ applies
Helper variable Functions used
when…
met_xtol$ fmtrnd , xll, xla, xaa, no2str, drs_str, modfs , reading value
mprint
Possible values
0 Do not enable extended values; use standard values for both target and source.
1 Use standard values for target, and extended values for source.
2 Use extended values for target, and standard values for source.
Predefined variables, postblocks, and functions: page 531
extprg$
M L R W MT
Use this variable to open the .EXT alternate output file. NC output will
be directed to the EXT file when it has been opened with extprg$ and
the subout$ variable is set to 3.
Opening output files
MP supports four different alternate files or NC output streams. Each different output file is
associated with a different command variable. Alternate output files must be recognized as a
valid stream before they can be opened and accessed with the subout$ variable. The file is
actually opened on the first attempt to output to the file.
subout$
Command variable File to be opened
value
Set subout$ to the proper value to send output to the desired file once it has been opened.
See related variables mergeext$, newext$ and clearext$.
You can set extprg$ to the appropriate value either by initializing it:
extprg$ : 1 # Allow access to ext file (open and clear it)
Possible values
1 Open the file. If the file already exists, delete all existing contents.
2 Open the file. If the file already exists, append to existing contents.
Predefined variables, postblocks, and functions: page 533
fastmode$
M L R W MT
In versions of Mastercam X2 and earlier, fastmode$ was used to toggle
debugging output; setting it to 0 would enable enhanced NC output that
included debugging information. This was set with a control definition option. This became
obsolete in Mastercam X3, when a separate posts debugger was introduced. (See also bug1$,
bug2$, bug3$, bug4$.)
Beginning with Mastercam X3 MU1, fastmode$ is set to yes$ (1) by default, so you do not
need to explicitly initialize it or include it in your post.
However, it is not completely useless. If you manually set it to no$, it enables scaling via
scalex$, scaley$, scalez$.
Possible values
1 Use fastmode$
feedtype3$
M L R MT
Determines the type of feed rate that is used for 3-axis motion.
Use feedtype3$, feedtype4$, and feedtype5$ to determine the type of
feedrate that is used for 3-axis, 4-axis, and 5-axis motion. Separate variables let you set this
individually for each type of motion.
For Mill and Router posts, these variables are set in the control definition as shown below:
Possible values
feedtype4$
M L R MT
Determines the type of feed rate that is used for 4-axis motion.
Use feedtype3$, feedtype4$, and feedtype5$ to determine the type of
feedrate that is used for 3-axis, 4-axis, and 5-axis motion. Separate variables let you set this
individually for each type of motion.
For Mill and Router posts, these variables are set in the control definition as shown below:
Possible values
feedtype5$
M L R MT
Determines the type of feed rate that is used for 5-axis motion.
Use feedtype3$, feedtype4$, and feedtype5$ to determine the type of
feedrate that is used for 3-axis, 4-axis, and 5-axis motion. Separate variables let you set this
individually for each type of motion.
For Mill and Router posts, these variables are set in the control definition as shown below:
Possible values
fil_sharp_neg$
W
Inserts arcs at intersecting corners; the move is in the CW direction. The inserted arc
inherits the intersecting corner type.
Note that g60_mode$ must be disabled. The 2D conversion routine must be enabled. Conical,
sharp, constant and fixed modes insert an arc with a radius equal to the wire diameter divided
by two on the XY plane. Other and fishtail modes insert the arc radius based on the parameter
set with the corner type selection. Re-assign tldia$ to produce a different radius for conical,
sharp, constant and fixed corner types. Initial sweep$ and atol$ are used to determine
intersection angle tolerance.
See g60_mode$ for additional details on determining tangency.
See also make_fishtail$, fil_sharp_pos$, fil_sharp_uv$.
CAUTION: The fillet routines do not check for overlapping motion. MP does not acquire the
correct values for nextx$ or nexty$ within the vicinity of the inserted arcs.
Possible values
0 Off
1 On
fil_sharp_pos$
W
Inserts arcs at intersecting corners and the move is in the CCW direction. The
inserted arc inherits the intersecting corner type.
Note that g60_mode$ must be disabled. The 2D conversion routine must be enabled. Conical,
sharp, constant and fixed modes insert an arc with a radius equal to the wire diameter divided
by two on the XY plane. Other and fishtail modes insert the arc radius based on the parameter
set with the corner type selection. Re-assign tldia$ to produce a different radius for conical,
sharp, constant and fixed corner types. Initial sweep$ and atol$ are used to determine
intersection angle tolerance.
See g60_mode$ for additional details on determining tangency.
See also make_fishtail$, fil_sharp_neg$, fil_sharp_uv$.
CAUTION: The fillet routines do not check for overlapping motion. MP does not acquire the
correct values for nextx$ or nexty$ within the vicinity of the inserted arcs.
Possible values
0 Off
1 On
fil_sharp_uv$
W
Inserts an arc radius equal to the wire diameter divided by two with the sharp corner
type specified on arc elements in a 2D wirepath. The intersecting corners generated
on the UV plane are filleted.
Re-assign tldia$ to override the default radius calculation.
See also tldia$, fil_sharp_neg$, fil_sharp_pos$.
Possible values
0 Off
1 On
first_tool$
M L R W MT
First tool number used in the program.
This is commonly used with a pre-staged tool change at the end of the
NC program, to change to the first tool to be used. The bldnxtool$ variable must be set to 1 to
access the first_tool$ variable.
fleader$
M L R W MT
Tape leader function. This function is intended to provide the tape
leader and tape trailer when punching paper tape. It repeatedly outputs
an ASCII character of your choosing a specified number of times.
n The variable ldrcode$ is the ASCII value of the character to output.
n The variable ncldr$ is the number of times that it will be output.
Normally, fleader$ is placed in the beginning of the postblock pheader$ and at the end of the
postblock peof$.
force_tlchg$
M L R W MT
Status of the Force tool change option from the Tool parameters page.
This equals 1 when the option is selected:
For posts that are designed to support probing, force_tlchg$ should be explicitly overridden to
0 in your post, so that forced tool data does not interfere with Renishaw’s processing.
Possible values
0 Off
1 On
fr$
M L R W MT
Feed rate of current tool movement.
To access the feedrate, this variable has been superseded by fr_pos$.
which should be used instead. When fr$ is used, it is typically to test for the –1 or –2 values.
Possible values
–2 Rapid
frplunge$
M L R MT
Feed rate for the current drilling cycle.
It is recommended that you use fr_pos$ instead of frplunge$ when using the
canned drill cycle output.
Possible values
–2 Rapid
fr_a_pvtrad$
M L R W MT
[reserved for future use]
fr_b_pvtrad$
M L R W MT
[reserved for future use]
fr_cut_dpth$
M L R W MT
[reserved for future use]
fr_cut_opt$
M L R W MT
[reserved for future use]
fr_c_pvtrad$
M L R W MT
[reserved for future use]
fr_max_ideg$
M L R W MT
The maximum feed rate for this machine as set in the machine definition
(inches per degree).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 552
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 553
fr_max_iinv$
M L R W MT
The maximum inverse feed rate for this machine as set in the machine
definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 554
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 555
fr_max_ipm$
M L R W MT
The maximum feed rate for this machine as set in the machine definition
(inches per minute).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 556
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 557
fr_max_ipr$
M L R W MT
The maximum feed rate for this machine as set in the machine definition
(inches per revolution).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 558
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 559
fr_max_mdeg$
M L R W MT
The maximum feed rate for this machine in metric units (per degree) as
set in the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 560
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 561
fr_max_minv$
M L R W MT
The maximum inverse feed rate for this machine in metric units as set in
the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 562
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 563
fr_max_mpm$
M L R W MT
The maximum feed rate for this machine in metric units (per minute) as
set in the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 564
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 565
fr_max_mpr$
M L R W MT
The maximum feed rate for this machine in metric units as set in the
machine definition (per revolution).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 566
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 567
fr_min_ideg$
M L R W MT
The maximum feed rate for this machine measured in inches per degree,
as set in the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 568
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 569
fr_min_iinv$
M L R W MT
The minimum inverse feed rate for this machine as set in the machine
definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 570
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 571
fr_min_ipm$
M L R W MT
The minimum feed rate for this machine as set in the machine definition
(inches per minute).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 572
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 573
fr_min_ipr$
M L R W MT
The minimum feed rate for this machine as set in the machine definition
(inches per revolution).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 574
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 575
fr_min_mdeg$
M L R W MT
The minimum feed rate for this machine in metric units (per degree) as
set in the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 576
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 577
fr_min_minv$
M L R W MT
The minimum inverse feed rate for this machine in metric units as set in
the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 578
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 579
fr_min_mpm$
M L R W MT
The minimum feed rate for this machine in metric units (per minute) as
set in the machine definition.
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 580
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 581
fr_min_mpr$
M L R W MT
The minimum feed rate for this machine in metric units as set in the
machine definition (per revolution).
MP will read the values for the machine's minimum and maximum feed rates directly from the
machine definition and store them in the following variables:
Predefined variables, postblocks, and functions: page 582
Note that the option to use inches/mm per minute or degrees/minute is set in the control
definition. When this option is selected, MP will calculate the proper degrees/minute value.
p_any postblock
if met_tool$ = one,
[
fr_max_iinv$ = fr_max_minv$ #Set limit for feed inverse time
fr_min_ideg$ = fr_min_mdeg$ #Set limit for feed degree
fr_max_ipm$ = fr_max_mpm$ #Set limit for feed in mm/min
]
Predefined variables, postblocks, and functions: page 583
fr_pos$
M L R W MT
Positive feed rate. This variable keeps the modal positive value of fr$ and
frplunge$.
Use of fr_pos$ is recommended in all modern posts instead of fr$ or frplunge$.
fr_zero_def$
M L R W MT
[reserved for future use]
full_arc_flg$
M L R W MT
Flags if current arc is a full circle (360-degree sweep) in a single NC
block.
Possible values
g20code$
W
Gcode from the first line in the four-line set NCI file read with 4-axis direct
wirepaths. This is also set with 2D contours.
MP reads and processes 4-axis direct wirepaths differently from all other wirepaths. Because a
4-axis direct move writes a four-line set to the NCI file, MP must read four lines at a time
before making postblock calls. The four-line set is interpreted as follows:
n The Gcode from the first line in the four-line set is read and stored in g20code$.
n The parameters on the second line are read and stored into the appropriate NCI
variables.
n The Gcode from the third line is read and stored in g30code$.
n The parameters on the fourth line are read and stored into the appropriate NCI
variables.
Because the calls into the post caused by the NCI gcode are made to prapid$, plin$ and pcir$
postblocks just like normal 2D linear and circular motion, you must differentiate between the
2-axis and 4-axis calls. Use uvflag$ to check if the wirepath is 2-axis or 4-axis.
For 4-axis direct wirepaths, you can call the appropriate postblock to make any calculations
and output calls for both the lower guide move and the upper guide move. Using the value of
g30code$ and g30code$, you can call the appropriate motion output postblocks.
Possible values
0 Rapid
1 Linear
2 Arc CW
3 Arc CCW
g30code$
W
Gcode from third line in the four-line set NCI file read with 4-axis direct wirepaths.
MP reads and processes 4-axis direct wirepaths differently from all other wirepaths.
Because a 4-axis direct move writes a four-line set to the NCI file, MP must read four lines at a
time before making postblock calls. The four-line set is interpreted as follows:
n The Gcode from the first line in the four-line set is read and stored in g20code$.
n The parameters on the second line are read and stored into the appropriate NCI
variables.
n The Gcode from the third line is read and stored in g30code$.
n The parameters on the fourth line are read and stored into the appropriate NCI
variables.
Because the calls into the post caused by the NCI gcode are made to prapid$, plin$ and pcir$
postblocks just like normal 2D linear and circular motion, you must differentiate between the
2-axis and 4-axis calls. Use uvflag$ to check if the wirepath is 2-axis or 4-axis.
For 4-axis direct wirepaths, you can call the appropriate postblock to make any calculations
and output calls for both the lower guide move and the upper guide move. Using the value of
g20code$ and g30code$, you can call the appropriate motion output postblocks.
Possible values
0 Rapid
1 Linear
2 Arc CW
3 Arc CCW
g30code_2$
W
The variables g30code_2$, g30code_3$, and g30code_4$ are used for wire 2-axis to 4-
axis conversion. Since the conversion routine can produce as many as four UV
positions for each XY element, these variables store the Gcodes for the upper contour.
See also use_2d_uv$.
Possible values
0 Rapid
1 Linear
2 Arc CW
3 Arc CCW
g30code_3$
W
The variables g30code_2$, g30code_3$, and g30code_4$ are used for wire 2-axis to 4-
axis conversion. Since the conversion routine can produce as many as four UV
positions for each XY element, these variables store the Gcodes for the upper contour.
See also use_2d_uv$.
Possible values
0 Rapid
1 Linear
2 Arc CW
3 Arc CCW
g30code_4$
W
The variables g30code_2$, g30code_3$, and g30code_4$ are used for wire 2-axis to 4-
axis conversion. Since the conversion routine can produce as many as four UV
positions for each XY element, these variables store the Gcodes for the upper contour.
See also use_2d_uv$.
Possible values
0 Rapid
1 Linear
2 Arc CW
3 Arc CCW
g60_mode$
W
This variable enables MP’s routine for replacing implied corner radius arcs in
Mastercam Wire. This replaces line-arc-line tangent conditions with the intersection
of the lines, and sets the numeric variable arcrad$ for output as the implied corner radius. The
arc move is skipped. This supports the “G60” wire strategy used on many Fanuc-based
controls.
This strategy applies an implied corner radius to intersecting linear moves. Mastercam does
not provide this type of data in the NCI structure, so it must be created within MP.
To produce the output, the NCI data is examined to detect line-arc-line conditions where all
the intersections are tangent. When such a condition is found, the following occurs:
n The linear elements are intersected.
n The intersection point replaces the original element endpoints.
n The arc motion is removed.
n The radius of the arc is presented to the post.
This is illustrated in the following pictures. The original wirepath data is converted from this
configuration:
To this configuration:
Predefined variables, postblocks, and functions: page 594
NOTE
Old posts required that you not set g60_mode$ active when using use_2d_uv$; this
requirement has not applied since Mastercam X.
Predefined variables, postblocks, and functions: page 595
Possible values
0 Off
2 Indicates that a line-arc-line tangent condition has been found and the arc was
removed, indicating that this is the altered location.
gcode$
M L R W MT
Initially, this stores the gcode from the first line in the two-line set NCI
file read. Its initial value comes from the gnci$ variable. Most of the time,
these two variables have the same value. However, their values will differ in the following
circumstances:
n In cases where arcs are linearized, the gnci$ will be 2 or 3 while gcode$ will be 1.
n For multiaxis toolpaths, gnci$ will equal 11, while gcode$ will equal 1, 2, or 3.
Because of this, gcode$ is typically used as the string selector for the motion Gcodes.
getnextop$
M L R W MT
Access specific variables for the next NCI line.
Enables access to specific variables that tell you information about the
next NCI line. This lets your post know what line is about to be read, in addition to the NCI
line that is currently being processed.
The list of variables that is available depends on what NCI code is in the next NCI line. The
NCI gcode itself from the next line is stored in nextop$. The following tables list which
variables are available for each NCI gcode
NCI Gcode
Variables captured
value
1000 nextop$
1001 nextop$
1002 nextop$
1013 nextop$
Table 4: Wire
NCI Gcode
Variables captured
value
NCI Gcode
Variables captured
value
1000 nextop$
1001 nextop$
1002 nextop$
1013 nextop$
At the toolchange NCI gcodes (1000, 1001 and 1002), if the operation is a drill operation, MP
scans forward to capture the nextdc$ variable so it is available at the toolchange.
The getnextop$ procedure only reads these valid positioning data lines and gcode lines. From
the current NCI line being read, the getnextop$ procedure searches forward for the first
occurrence of one of the listed gcode values.
Router posts
At the toolchange NCI gcodes (1000, 1001 and 1002), if the operation is a block drill
operation, MP scans forward to capture the block drill parameters from the NCI 83 line. These
are read into the same variables used in the normal NCI processing. The variables are listed
here:
n bdrl_x$, bdrl_y$, bdrl_z$
n bdrl_tool_grp$
n bdrl_ofs_x$, bdrl_ofs_y$, bdrl_ofs_z$
n bdrl_wrk_ofs$
n bdrl_u$, bdrl_v$, bdrl_w$
n bdrl_tool_no$
Special cases
Special cases occur if the data for the next Gcode holds no useful data.
Predefined variables, postblocks, and functions: page 599
n On a tool change that is a drill operation (3-axis or 5-axis), the routine looks ahead for
the nextop$ value of 81 and returns the first drill cycle value it finds in nextdc$ (in Mill,
Router and Lathe only, not in Wire).
n When the nextop$ value is one of the values listed next, the look ahead routine skips
these and reads the next line(s) until valid data is found. The values that cause the
routine to skip are:
4 1006 1019
80 1007 1025
82 1008 1040 (Lathe)
1004 1010 (Wire) 1041 (Lathe)
1005 1018
Possible values
0 Do not enable the getnextop$ routine. The “next” variables will not be available
(default).
1 Enable the getnextop$ routine. The “next” variables will be available as listed in
the tables above.
get_1004$
M L R W MT
Read the NCI Gcode 1004 line with the getnextop$ routine.
The variable getnextop$ must be set to 1 for this feature to be active.
Possible values
0 Skip the NCI Gcode 1004 when getting the nextop$ variable. (default)
1 Read the NCI Gcode 1004 when getting the nextop$ variable.
gnci$
M L R W MT
Capture the Gcode from the NCI file. This determines the predefined
entry postblock calls. For example, given the following pair of NCI lines,
the value of gnci$ will be 1.
1
0 -3.18 -2.29 -1.5 -1. 0
hascylindercycle$
M L R MT
Use this setting to tell the post if your control supports cylindrical
interpolation. It stores the value of the following control definition setting:
Note that your post must be explicitly written to support this cycle.
Possible values
hashighspeed$
M L R MT
Use this setting to tell the post if your control supports high-speed
machining. It stores the value of the following control definition setting:
Note that your post must be explicitly written to support this cycle.
Possible values
haspolarcycle$
M L R MT
Use this setting to tell the post if your control supports polar interpolation.
It stores the value of the following control definition setting:
Note that your post must be explicitly written to support this cycle.
Possible values
helix_arc$
Controls output of arcs when doing helix motion. For Mill and Router M L R MT
posts, this is set with the following control definition option:
Possible values
0 Do not output arcs on helix motion. Mastercam will linearize the helixes.
2 Allow arc output on helix motion in XY plane only. Mastercam will output arcs in
the XY plane and linearize the Z component of the helix.
helix_tol$
M L R MT
The minimum axis motion perpendicular to an arc plane required to
prevent automatic linearization of the helix. If the minimum is not met and
the move distance is not zero, the arc is broken with the arc linearize routine.
The only reason to have this in a Lathe post would be for milling toolpaths in a mill/turn post.
See helix_arc$ for related information. A separate variable, met_helix_tol$, has been provided for
metric use.
i$
M L R W MT
Incremental distance from an arc endpoint to the center along the X
axis.
The i$, j$, and k$ variables are calculated from the xc$, yc$, zc$ NCI data. See the post
switches arctype$, arctypexz$, arctypeyz$, larctypexz$ for output options.
immediate$
W
Enable conversion of the two points generated in 2D wirepath for an immediate
taper change to a single point. This variable is used to return the status of the
immediate taper change. See g60_mode$ for more information. See also plot_2d_uv$.
Possible values
1 Enable the routine (initialization), not an immediate taper change during NCI file
processing.
5 g60_mode$ is currently 2: Immediate taper is on the start and end of replaced arc.
plot_2d_uv$ = -set_plot
if mi10$ = two, linarc$ = one
]
else,
[
immediate$ = one
plot_2d_uv$ = set_plot #screen drawn backplot, control setting
]
sav_linarc = linarc$
Predefined variables, postblocks, and functions: page 611
inhibit_probe$
M L R W MT
Use this command together with the uninhibit_probe$ command to
control NC output when processing probing operations.
When a probing operation is being processed, the inhibit_probe$ command outputs any
currently buffered probing data and then suspends NC output until an uninhibit_probe$
command is encountered. The probe_active$ value also updates when inhibit_probe$ is active.
“Probing operation” in this context means an operation with tool_op$/synctool_op$ value of
150, wrapped between a set of 1042/1043 lines. If a non-probing operation is being processed,
this command has no effect.
This command is typically placed:
n at the beginning of your psof$ postblock
n in ptlchg$ and ptlchg0$
Note: Use of this command is conditioned by the value of x_probe_opt$. The description in this
section is based on x_probe_opt$ = 1022.
Since this functions only as a command keyword, it has no value.
initht$
M L R MT
For 3-axis drilling, this is the absolute position of the Z location of the initial
height.
For 5-axis drilling, this is the incremental distance from the selected drill point to initial
height.
This is calculated from drl_sel_ini$.
inittaper$
W
Taper angle in degrees at the initial point in the wirepath. This value is available at
the tool change postblock calls.
The initial taper inittaper$ has the same meaning as wt$ in the wirepath.
Possible values
0 No taper
inversefeed$
M L R MT
Indicates whether the inverse feedate is specified in minutes or seconds. For
Mill and Router posts, the value of inversefeed$ is set with the following
control definition option:
Possible values
0 Feedrate in minutes
1 Feedrate in seconds
ipr_actv$
M L R W MT
Indicates the units for lathe feed rates—per revolution or per minute. For
mill toolpaths, this is always set to 0.
It is recommended that you use ipr_actv$ as the numeric variable selector for the string
selector function.
Possible values
j$
M L R W MT
Incremental distance from an arc endpoint to the center along the Y
axis.
The i$, j$, and k$ variables are calculated from the xc$, yc$, zc$ NCI data. See the post
switches arctype$, arctypexz$, arctypeyz$, larctypexz$ for output options.
k$
M L R W MT
Incremental distance from an arc endpoint to the center along the Z
axis.
The i$, j$, and k$ variables are calculated from the xc$, yc$, zc$ NCI data. See the post
switches arctype$, arctypexz$, arctypeyz$, larctypexz$ for output options.
landheight$
W
Land height value from wirepath contour parameters page.
larccheck$
L MT
Enables routines that filter invalid arcs from the NCI file; lathe version of
arccheck$. See arccheck$ for detailed info and lists of values.
larcoutput$
L MT
Obsolete; use larctype$ instead. This was used in Mastercam X to help control
how older posts were updated.
larcoutputxz$
L MT
Obsolete; use larctypexz$ instead. This was used in Mastercam X to help control
how older posts were updated.
larcoutputyz$
L MT
Obsolete; use larctypeyz$ instead. This was used in Mastercam X to help control
how older posts were updated.
larctype$
L MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$— are used
to set the arc center type for arcs in the designated plane. They are set for each
plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
larctypexz$
L MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$— are used
to set the arc center type for arcs in the designated plane. They are set for each
plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
larctypeyz$
L MT
The arctype$ variables—arctype$, arctypexz$, arctypeyz$, larctypexz$— are used
to set the arc center type for arcs in the designated plane. They are set for each
plane with the Arc center type option in the control definition:
n Use larctypexz$ in mill-turn posts so you can use separate values for mill and lathe
toolpaths. Use the separate Mill Arc and Lathe Arc pages in the control definition to set
them.
n The larctype$ and larctypeyz$ variables are not used.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Caution: When changing from absolute center to incremental arctype$, make sure to modify
the format statement for i$, j$, k$ from absolute to delta.
Possible values
1 Absolute center
5 Unsigned radius
6 Signed radius
last_g60_wt$
W
Holds the taper for the immediate taper changes at the start of a replaced arc move
when the g60_mode$ is active.
When g60_mode$ is active and an arc is being replaced (that is, when g60_mode$ is 2), the
immediate$ flag is set as follows:
n immediate$ is 3 if the immediate taper is on the start of the replaced arc.
n immediate$ is 4 if the immediate taper is on the end of the replaced arc.
n immediate$ is 5 if the immediate taper is on the start and end of the replaced arc.
When immediate$ is set from 3 to 5, four wire taper positions are returned to correspond with
the four possible wire tapers at the replaced arc. In order of the wirepath:
n prv_last_g60_wt$ and last_g60_wt$ hold the tapers at the start of the arc.
n wt$ and wt_immd$ hold the tapers at the end of the arc.
When immediate$ is 3 or 5, prv_last_g60_wt$ is set for the first point of the immediate taper
change at the start of replaced arc.
When iimmediate$ is 3, 4 or 5, last_g60_wt$ is set for the immediate taper change (second
point) at the start of replaced arc.
In all cases, wt$ is the replaced arc’s end wire taper value.
When immediate$ is 4 or 5, wt_immd$ is set for the immediate change at the end of replaced arc
(second point).
last_tool$
M L R W MT
Holds the number of the last tool used in the NCI file.
lbreakarcs$
L MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The different
variables let you specify this individually for each plane. For each plane, select the desired arc
break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 634
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
lbreakarcsxz$
L MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The different
variables let you specify this individually for each plane. For each plane, select the desired arc
break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 636
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
lbreakarcsyz$
L MT
Use the breakarcs$ variables—breakarcs$, breakarcsyz$, breakarcsxz$,
lbreakarcsxz$—to tell MP to break all arcs at the circle quadrants. The different
variables let you specify this individually for each plane. For each plane, select the desired arc
break strategy on the Arc page in the control definition:
Mastercam uses the machine step tolerance (as defined in the CD tolerance page, mtol$ and
met_mtol$) as a bilateral tolerance defining the quadrant limits.
With the addition of breakarcsxz$ and breakarcsyz$, the legacy breakarcs$ variable applies to
the XY plane only.
n Use lbreakarcsxz$ in mill-turn posts to set separate values for mill and lathe toolpaths.
Use the separate Mill and Lathe Arc pages in the control definition to set them.
n The lbreakarcs$ and lbreakarcsyz$ variables are not used.
For standard lathe posts, the Arc page in the control definition sets both sets of variables. They
will automatically be set to the same values when linklvar$ is active.
See do_full_arc$ for related information.
Predefined variables, postblocks, and functions: page 638
Possible values
0 Don’t break arcs; arcs remain as they are read from the NCI file.
lccprg$
M L R W MT
Use this variable to open the .LCC alternate output file. NC output will
be directed to the LCC file when it has been opened with lccprg$ and
the subout$ variable is set to 4.
Opening output files
MP supports four different alternate files or NC output streams. Each different output file is
associated with a different command variable. Alternate output files must be recognized as a
valid stream before they can be opened and accessed with the subout$ variable. The file is
actually opened on the first attempt to output to the file.
subout$
Command variable File to be opened
value
Set subout$ to the proper value to send output to the desired file once it has been opened.
See related variables mergelcc$, newlcc$ and clearlcc$.
You can set lccprg$ to the appropriate value either by initializing it:
lccprg$ : 1 # Allow access to lcc file (open and clear it)
Possible values
1 Open the file. If the file already exists, delete all existing contents.
Predefined variables, postblocks, and functions: page 640
2 Open the file. If the file already exists, append to existing contents.
lconvert_rpd$
L MT
Use this to have G0 moves output as G1 moves at the maximum feed rate. This is
set in Control Definition . Feed page.
lcutmode$
L MT
Corner rounding mode.This is set in the control definition with the following
setting:
Separate mill (cutmode$) and lathe versions let you set this individually in mill-turn posts.
Possible values
0 Control cutting mode. The exact effect of this setting is machine-dependent, but it
typically prevents the exact stop.
1 Control exact stop mode. The machine tool checks to make sure that the endpoint
is reached. The tool decelerates to a stop at the endpoint. When this is not
engaged, a machine can over- or under-shoot the exact position.
2 Control corner rounding mode. The exact effect of this is machine-dependent, but
typically the control will insert arcs at sharp corners in the toolpath. It produces
the same effect as setting the Roll cutter around corners option to Sharp, which you
can use when you are calculating cutter compensation in computer.
ldina1$
M R MT
[reserved for future use]
ldina2$
M R MT
[reserved for future use]
ldinl1$
M R MT
[reserved for future use]
ldinl2$
M R MT
[reserved for future use]
ldouta1$
M R MT
[reserved for future use]
ldouta2$
M R MT
[reserved for future use]
ldoutl1$
M R MT
[reserved for future use]
ldoutl2$
M R MT
[reserved for future use]
ldo_full_arc$
L MT
Allow full circle (360-degree sweep) arc motion output in the specified plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
ldo_full_arcxz$
L MT
Allow full circle (360-degree sweep) arc motion output in the specified plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
Possible values
ldo_full_arcyz$
L MT
Allow full circle (360-degree sweep) arc motion output in the specified plane.
n Use the lathe-specific version (ldo_full_arcxz$) for mill-turn posts to set separate values
for mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_full_arc$ and ldo_full_arcyz$ variables are not used in current MP
posts—only ldo_full_arcxz$.
n With the addition of do_full_arcxz$ and do_full_arcyz$, the original do_full_arc$
variable applies to the XY plane only.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_full_arcxz$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
The do_full_arc$ : 1 setting overrides the breakarcs$ setting whenever a full arc is encountered
during processing.
ldo_xy_arcs$
L MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
ldo_xz_arcs$
L MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
Possible values
1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.
ldo_yz_arcs$
L MT
Flag to indicate whether the control supports arcs in the specified plane.
n Use the lathe-specific version (ldo_xy_arc$) for mill-turn posts to set separate values for
mill and lathe toolpaths. Use the separate Mill and Lathe Arc pages in the control
definition to set them.
n Note that the ldo_xy_arc$ and ldo_yz_arc$ variables are not used in current MP posts—
only ldo_xy_arc$.
n The Mill Arc page has options for setting all three planes; the Lathe Arc page sets the
ldo_xz_arc$ variable only.
n For standard lathe posts, the Arc page in the control definition sets both sets of
variables. They will automatically be set to the same values when linklvar$ is active.
ldrcode$
M L R W MT
Sets the ASCII value of the character to be used for the tape
trailer/leader code. This is output with the fleader$ function.
The post function fleader$ will output a series of a selected character to the NC output. This
character is stored in ldrcode$, which stores the ASCII value of the desired character. Use
ncldr$ to indicate the number of times it is to be output. This function is intended to provide
the tape leader and tape trailer when punching paper tape.
Normally, fleader$ is placed in the beginning of the postblock pheader$ and at the end of the
postblock peof$.
lfeedtype3$
L MT
Determine the type of feed rate that is used for 3-axis motion (lathe).
lfeedtype4$
L MT
Determine the type of feed rate that is used for 4-axis motion (lathe).
lfeedtype5$
L MT
Determine the type of feed rate that is used for 5-axis motion (lathe).
lhelix_arc$
L MT
Controls output of arcs when doing helix motion (Lathe)
lima1$
M L R MT
[reserved for future use]
lima2$
M L R MT
[reserved for future use]
limb1$
M L R MT
[reserved for future use]
limb2$
M L R MT
[reserved for future use]
limc1$
M L R MT
[reserved for future use]
limc2$
M L R MT
[reserved for future use]
linarc$
M L R W MT
Breaks arc moves into line segments.
Set linarc$ to 1 to break arc motion into line segments using the chordal
deviation tolerance, chord_tol$.
The arc segment in the following diagram indicates the chained geometry used to drive the
toolpath, while the linear segments shown demonstrate the actual cutter path after the
linearization.
Note: Be sure to search the post for all occurrences of linarc$ to be certain it is not being reset
in other postblocks when a global break up of motion is desired.
See also llinarc$.
Possible values
linklvar$
M L R W MT
Used when updating pre-X posts. Mastercam X introduced Lathe-specific
versions of the standard canned cycle switches that are used to enable
specific canned drilling cycles. Use the linklvar$ variable to link the new Lathe variables to the
original Mill variables. When this variable is set to 1, the Lathe cycle variables are
automatically set to the same values as the Mill versions.
The lathe canned cycle variables that are set by this switch include:
n lusecanbore1$, lusecanbore2$
n lusecanchip$
n lusecandrill$
n lusecanmisc1$, lusecanmisc2$
n lusecanpeck$
n lusecantap$
See also usecan_lathe$, linkplnvar$, and linktolvar$.
For example, if the assignment usecanchip$ = 1 is found in the post, and linklvar$ is active
(linklvar$ : 1), then lusecanchip$ is also assigned the value 1.
This is typically only done when updating an old (pre-X) post. All of the Lathe canned cycle
variables can be switched on/off in the control definition and that is typically the best
practice.
Possible values
1 Assign values to Lathe canned cycle variables from the Mill equivalents.
linkplnvar$
M L R W MT
Used when updating pre-X posts. Mastercam X introduced two sets of
variables for supporting arcs. These provide support for plane-specific
values, and for dedicated variables for Lathe use. Use the linkplnvar$ variable to link the new
variables to the original variables.
n Plane-specific arc output variables: arcoutput$, arcoutputxz$, arcoutputyz$, larcoutputxz$
n Lathe arc type variables: arctype$, arctypexz$, arctypeyz$, larctypexz$
When linkplnvar$ is initialized to 1, the new arc plane variables (those with an xz or yz suffix)
will be set to the same values as the original variables. See also linklvar$ and linktolvar$.
For example, if arcoutput$ = 1, and linkplnlvar$ is active (linkplnvar$ : 1), then
arcoutputxz$ and arcoutputyz$ are also assigned the value 1.
This is typically only done when updating an old (pre-X) post. Most of the variables can be
switched on/off in the control definition and that is typically the best practice.
Possible values
linktolvar$
M L R W MT
Automatically sets values for metric tolerance variables based on the
inch versions.
Mastercam X introduced a new set of tolerance variables specifically for metric values. This
way, you can set and maintain individual values for tolerances for both inch and metric output
and not have to worry about converting one to the other. The linktolvar$ variable links the
new variables to the original variables so that the metric variables are set automatically from
the inch versions.
This variable is typically only useful as a way to support backward compatibility for old (pre-
X) posts. Otherwise, these variables should be set in the Tolerance page in the Control
Definition Manager.
n met_mtol$
n met_chord_tol$
n met_vert_tol$
n met_ltol$
n met_helix_tol$
n met_minarc$
n met_minrad$
n met_maxrad$
n met_xtol$
Possible values
linversefeed$
L MT
Indicates whether the lathe inverse feed rate is specified in in minutes (0) or
seconds (1).
listrad$
W
Enables the call to the postblock pradlist$ to generate the wire radius list. The list
must be built internally in MP by setting bldnxtool$ to 1 (yes). See also listtpr$.
In this example, the H offset register is read for the taper to be used in the toolpath.
NOTE
For Mill and Router posts, bldnxtool$ is set in the control definition, in the Tool page in
the Control Definition Manager. Since there is no Tool page for Wire, it still needs to be
Predefined variables, postblocks, and functions: page 674
After the lists are written, the post writer must place them in the head of the NC file. A couple
steps are required to call the output to write the lists. In the post, you must enable the call to
the list read loop for each list by initializing the appropriate variable to 1:
listrad$ : 1 #Enable radius list output, see pradlist$
listtpr$ : 1 #Enable taper list output, see ptprlist$
Finally, you must implement the postblocks that actually output the taper and/or radius lists.
For the wire taper list, this is the ptprlist$ postblock. The following code is a sample:
ptprlist$ # List of taper angles, only tofs (index) and wt are read
# List is checked in linear/circular (0,1,2,3)
# and "tofs" set
*tofs$, " = ", *wt$, e$
For the wire radius list, this is the pradlist$ postblock. The following code is a sample:
pradlist$ #List of wire radii, only offset and tlrad are read
The above postblocks, when enabled, are called immediately after pheader$; ptprlist$ is called
first, then pradlist$. There is no way to alter the calling order.
NOTE
The taper list is generated starting at base zero but is written starting at base 1.
The radius list captures the calculated numeric variable for wire radius tlrad$ from the NCI
Gcode 1010 and 1013 lines. These are then written to the list using the value from the numeric
variable offset$ as the index position.
Predefined variables, postblocks, and functions: page 675
When the list is generated in the post, the predefined postblock pradlist$ is called each list time
a list entry is written (in ascending order) with a non-zero offset entry. The list is read starting
at 0. The numeric variable tlrad$ is assigned the saved wire radius value, and the numeric
variable offset$ is assigned the index position (the original offset value that wrote the radius).
The numeric variable offset$ should be used in your tool change postblocks and condition
change postblock pconchg$ to refer to the listed values in the NC file. For example, this is a
typical implementation of pconchg$:
pconchg$ # Control setting change
if gcode$ = 1010, pbld, n$, ccode$, offset$, e$
else, ccode$, offset$, e$
NOTE
The taper and radius tables are limited to 1000 entries each.
Possible values
1 Traditional processing; capture offset$ and tlrad$ from the toolchange and NCI 1010
lines. pradlist$ is called.
2 Process the 20200 lines, and ignore tool change and 1010 lines. pradlist$ is called.
(This value was added for Mastercam X2 MR2.)
listtpr$
W
Enables the call to the postblock ptprlist$ to generate the wire taper list.The list must
be built internally in MP by setting bldnxtool$ to 1 (yes). See also listrad$.
Please see the article "Using the taper and radius list in Wire" in the listrad$ entry for much
more information about using this variable.
Possible values
0 No
1 Yes
ptprlist$ #List of taper angles, only tofs (index) and wt are read
llinarc$
L MT
This functions the same as linarc$. Use it in addition to linarc$ when you are
working with mill-turn posts and need to maintain separate settings for mill and
lathe toolpaths.
Possible values
lnobrk$
L MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY or
XY and Z motion (lathe). Only affects moves in the XY plane.
lnobrkxz$
L MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY or
XY and Z motion (lathe). Only affects moves in the XZ plane.
lnobrkyz$
L MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY or
XY and Z motion (lathe). Only affects moves in the YZ plane.
lofs$
W
Current offset register number as entered in Mastercam. This is now obsolete; use
offset$ instead.
lower_x$
M L R W MT
0
lower_y$
M L R W MT
[future use]
lower_z$
M L R W MT
[future use]
lrotfeed4$
L MT
Indicates the units used for 4-axis rotary feed rates (lathe).
lrotfeed5$
L MT
Indicates the units used for 5-axis rotary feed rates (lathe).
lstation$
M L R MT
Lathe station for mill/turn applications. Head number in Mill and Router.
See related variable uselstation$.
ltol$
M L R W MT
Minimum distance between arc endpoints (length tolerance). This value
is the minimum distance in terms of a straight line (chord) between the
endpoints. minarc$ relates to the minimum distance measured along the arc itself. MP always
validates arcs against ltol$, whether or not the arccheck$/larccheck$ options are turned on.
If the length of the arc move is less than the value of ltol$, the arc fails and the move to the arc
endpoint is converted into a single linear move. If the length is greater than the value of ltol$,
then the linearize arc routine is called. The arc motion is then broken into line segments using
a chordal deviation tolerance set by the variable chord_tol$. The exception is with the
arccheck$/larccheck$ 200 option.
Wire controls use this value with g60_mode$ to determine tangency.
This contains the tolerance for inch output; see met_ltol$ for the metric equivalent.
ltool_id$
M L R MT
Unique tool ID number for Lathe tools.
lturret$
M L R MT
The lathe turret that is currently being used.
Possible values
0 Bottom turret
1 Upper turret
lusecanbore1$
L MT
Enable the first lathe canned drill cycle for boring.
Set lusecanbore1$ and lusecanbore2$ with the following control definition
options:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecanbore2$
L MT
Enable the second lathe canned drill cycle for boring.
Set lusecanbore1$ and lusecanbore2$ with the following control definition
options:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecanchip$
L MT
Enable the lathe chip break canned cycle for drilling. Set this variable with the
following control definition option:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecandrill$
L MT
Enable the canned cycle for lathe drilling. Set this variable with the following
control definition option:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecanmisc1$
L MT
Enable the first miscellaneous lathe canned drill cycle.
Set lusecanmisc$ and lusecanmisc2$ with the following control definition
options:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecanmisc2$
L MT
Enable the second miscellaneous lathe canned drill cycle.
Set lusecanmisc$ and lusecanmisc2$ with the following control definition
options:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecanpeck$
L MT
Enable the canned cycle for lathe peck drilling. Set this variable with the
following control definition option:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
lusecantap$
L MT
Enable the canned cycle for lathe tap drilling. Set this variable with the
following control definition option:
n Then, Mastercam will add a separarate Lathe Drill page to the control definition to
enable the individual cycles.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
m1$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m2$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m3$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m4$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m5$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m6$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m7$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m8$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
m9$
M L R W MT
Tool plane matrix. Each group of 3 variables represents the X-Y-Z
coordinates of a unitized vector (in other words, a vector of length 1).
Each vector represents one of the axes of the tool plane coordinate system.
n m1$–m3$ represent the X axis.
n m2$–m6$ represent the Y axis.
n m7$–m9$ represent the Z axis.
The following table lists the values that will be output if the tool plane equals one of the 8
standard views. If the tool plane is instead aligned with a user-defined view, the values will be
different.
Possible values
main_prg_no$
M L R W MT
Transform subprogram number.
The value in sub_op_id$ is written to main_prg_no$ if sub_ref_id$ is greater
than 0.
See sub_op_id$, sub_ref_id$ for more information.
main_prg_no_offs$
M L R W MT
[future use]
make_fishtail$
eo$W
Produces an arc move when the fishtail corner type is selected on intersecting
corners. The inserted arc is always generated on the obtuse angle portion of the
intersection.
Note that g60_mode$ must be disabled. The 2D conversion routine must be enabled. Conical,
sharp, constant and fixed modes insert an arc with a radius equal to the wire diameter divided
by two on the XY plane. Other and fishtail modes insert the arc radius based on the parameter
set with the corner type selection. Re-assign tldia$ to produce a different radius for conical,
sharp, constant and fixed corner types. Initial sweep$ and atol$ are used to determine
intersection angle tolerance.
See g60_mode$ for additional details on determining tangency.
See also fil_sharp_pos$, fil_sharp_neg$, fil_sharp_uv$.
NOTE Caution: The fillet routines do not check for overlapping motion. MP does not
acquire the correct values for nextx$ or nexty$ within the vicinity of the inserted arcs.
Possible values
0 Off
1 On
maptomachview$
M L R W MT
Contains the setting of the following control definition option:
When you are using an aggregate head in Mill or Router, you can use this setting to determine
the base coordinate system for the aggregate head position data.
The variable is provided to the post writer but does no processing in MP. This is used by the
aggregate head C-hook (Aggregat.dll) and as documented.
Possible values
0 Off
1 On
matb1$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 731
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb2$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 734
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb3$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 737
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb4$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 740
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb5$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 743
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb6$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 746
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb7$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 749
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb8$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 752
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matb9$
M L R W MT
Matrix that describes the machine base coordinate system. Each group of
3 variables represents the X-Y-Z coordinates of a unitized vector (in
other words, a vector of length 1). Each vector represents one of the axes of the machine base
coordinate system.
n matb1$ –matb3$ represent the X axis.
n matb2$ –matb6$ represent the Y axis.
n matb7$ –matb9$ represent the Z axis.
The machine base matrix lets you map the NCI input to to a different coordinate system in
your NC output. Change the matrix values so that they describe the view that is the target
output. This is helpful for machines with left-hand coordinate systems, or horizontal machines
where the user prefers a setup relative to the machine tool.
The following table lists the coordinates of each vector if the machine matrix aligns with one
of the 8 standard views:
For example, this defines a standard base coordinate system that is parallel with Top view:
# Machine base matrix (Base matrix to map positions into)
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 1
matb6$ : 0
matb7$ : 0
matb8$ : 0
matb9$ : 1
Predefined variables, postblocks, and functions: page 755
This next example shows a horizontal machine setup where the user prefers a setup relative to
the front view in Mastercam. The user can now program the tool paths with the part relative
to the machine zero (as shown below). The post configuration settings are relative to this
matrix.
matb1$ : 1
matb2$ : 0
matb3$ : 0
matb4$ : 0
matb5$ : 0
matb6$ : 1
matb7$ : 0
matb8$ : -1
matb9$ : 0
n In posts written before Mastercam 2017, this matrix was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically read this
matrix from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually set the
matrix variables.
From the picture above, (matb1$, matb2$, matb3$) would equal (1, 0, 0). If the –X
orientation was selected, the vector would be (–1, 0, 0).
matm2$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm2$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm3$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm4$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm5$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm6$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm7$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm8$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
matm9$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.
maxnccomment$
M L R W MT
Use this setting to tell Mastercam if your control has a maximum length
for comments. This is set in the control definition NC Output page.
Comments longer than this value are truncated.
It is important to realize that the value you enter here only applies to comments in your NCI
file, and not to comments that are output to your NC file. For example, any control in/out
characters that are added by your post are not considered, so you should take this into account
when setting this value.
Because of this, it is still possible for your post to create comment strings that are longer than
this value and output them to your NC file. This will typically generate an error at your
control.
n Beginning with Mastercam 2018, the maximum value that is supported is 750.
n For Mastercam 2017 and earlier versions, the maximum value is 256.
maxrad$
M L R W MT
Maximum radius value to output for arc moves.
Controllers typically limit the size of a value that can be read. It is
possible to have an arc with a radius larger than the controller can handle. Use maxrad$ to set
a maximum radius value for arc moves that can be output in the NC file. If MP finds an arc
move with a radius larger than maxrad$, it converts the arc into line segments.
Conversely, the minrad$ variable sets the minimum radius value for arc moves in the output. If
the post processor finds an arc move with a radius smaller than minrad$, it converts the arc into
line segments.
Note: The linearization works the same as linarc$, that is, by using the chordal deviation set by
the variable chord_tol$. However, linarc$ and maxrad$ are independent variables and can be
used in combination or separately.
This variable is used for inch output; see met_maxrad$ for the metric value.
maxss$
M L R MT
Maximum spindle speed set in Mastercam. This behaves differently in
Mill/Router and Lathe.
For Lathe toolpaths, this value comes from the Toolpath parameters dialog box. It is output on
both the 1000/1001/1002 and 1020 lines.
For Mill/Router toolpaths, this value comes from the Tool Spindle—Parameters dialog box in
the Machine Definition Manager. It is only output on the 1020 line.
Predefined variables, postblocks, and functions: page 769
max_atol$
M L R W MT
Arc sweep limit. The angle of two adjoining moves that is greater than
atol$ or less than max_atol$ are considered intersecting.
Used in Wire with g60_mode$ to determine what is an intersection with G60 moves and fishtail
generator. See g60_mode$ for more information.
mc_day$
M L R W MT
Mastercam time/date stamp of the MCX file (day of the month). If the
file has not been saved, this value will be 0.
mc_hour$
M L R W MT
Mastercam time/date stamp of the MCX file (hour). If the file has not
been saved, this value will be 0.
mc_min$
M L R W MT
Mastercam time/date stamp of the MCX file (minute). If the file has not
been saved, this value will be 0.
mc_mon$
M L R W MT
Mastercam time/date stamp of the MCX file (month). If the file has not
been saved, this value will be 0.
mc_sec$
M L R W MT
Mastercam time/date stamp of the MCX file (second). If the file has not
been saved, this value will be 0.
mc_year$
M L R W MT
Mastercam time/date stamp of the MCX file (year). If the file has not
been saved, this value will be 0. Note that mc_year$ returns a 4-digit
year, while year$ returns a 2-digit value.
mergeaux$
M L R W MT
Use this command to merge the contents of the auxiliary file (subout$ =
2) into another output stream, including main NC output file. The
destination output stream is identified by the current subout$ value. Similar variables exist for
the other alternate output streams (mergeext$, mergesub$, mergelcc$) and work the same way.
To merge the alternate file, enter the command variable for the appropriate alternate file into
the post as a postline at the point where you want to merge the file. Make sure that you set
subout$ to the desired target file before issuing the merge command. The alternate file can be
merged at any time and will be appended to the target file. By merging before all posting is
completed, the contents of the merged file are inserted into the target file.
You cannot merge a file into itself, so subout$ cannot be set to write to the same stream as the
one being merged. For example, if subout$ were set to 1, attempting to mergesub$ would
generate an error because a file cannot be merged into itself. The following is not valid:
pblock # A postblock
subout$ = 2 # Direct the output to the sub alternate file
mergeaux$ # Append the aux file to the NC file
mergeext$
M L R W MT
Use this command to merge the contents of the auxiliary file (subout$ =
3) into another output stream, including main NC output file. The
destination output stream is identified by the current subout$ value. Similar variables exist for
the other alternate output streams (mergeaux$, mergesub$, mergelcc$) and work the same way.
To merge the alternate file, enter the command variable for the appropriate alternate file into
the post as a postline at the point where you want to merge the file. Make sure that you set
subout$ to the desired target file before issuing the merge command. The alternate file can be
merged at any time and will be appended to the target file. By merging before all posting is
completed, the contents of the merged file are inserted into the target file.
You cannot merge a file into itself, so subout$ cannot be set to write to the same stream as the
one being merged. For example, if subout$ were set to 1, attempting to mergesub$ would
generate an error because a file cannot be merged into itself. The following is not valid:
pblock # A postblock
subout$ = 1 # Direct the output to the sub alternate file
mergesub$ # Append the sub file to the NC file
mergelcc$
M L R W MT
Use this command to merge the contents of the lcc auxiliary file (subout$
= 4) into another output stream, including main NC output file. The
destination output stream is identified by the current subout$ value. Similar variables exist for
the other alternate output streams (mergeaux$, mergesub$, mergeext$) and work the same way.
To merge the alternate file, enter the command variable for the appropriate alternate file into
the post as a postline at the point where you want to merge the file. Make sure that you set
subout$ to the desired target file before issuing the merge command. The alternate file can be
merged at any time and will be appended to the target file. By merging before all posting is
completed, the contents of the merged file are inserted into the target file.
You cannot merge a file into itself, so subout$ cannot be set to write to the same stream as the
one being merged. For example, if subout$ were set to 1, attempting to mergesub$ would
generate an error because a file cannot be merged into itself. The following is not valid:
pblock # A postblock
subout$ = 1 # Direct the output to the sub alternate file
mergesub$ # Append the sub file to the NC file
mergenumber$
M L R MT
OBSOLETE: Used to support the Runclath C-Hook to provide the ordered
sequence number of the current operation.
mergesub$
M L R W MT
Use this command to merge the contents of an auxiliary file (subout$ =
1) into another output stream, including main NC output file. The
destination output stream is identified by the current subout$ value. Similar variables exist for
the other alternate output streams (mergeaux$, mergeext$, mergelcc$) and work the same way.
To merge the alternate file, enter the command variable for the appropriate alternate file into
the post as a postline at the point where you want to merge the file. Make sure that you set
subout$ to the desired target file before issuing the merge command. The alternate file can be
merged at any time and will be appended to the target file. By merging before all posting is
completed, the contents of the merged file are inserted into the target file.
You cannot merge a file into itself, so subout$ cannot be set to write to the same stream as the
one being merged. For example, if subout$ were set to 1, attempting to mergesub$ would
generate an error because a file cannot be merged into itself. The following is not valid:
pblock # A postblock
subout$ = 1 # Direct the output to the sub alternate file
mergesub$ # Append the sub file to the NC file
merge_end$
M L R MT
OBSOLETE: Used to support the Runclath C-Hook to flag the last
operation in the final NC file merged.
met_arc_tol$
M L R W MT
Arc tolerance (metric). Used with arccheck$/larccheck$ to validate an arc.
Rounding tolerances are calculated from the value stored in the variable
mtol$. This rounding tolerance should be set to match the format of the axes output variables.
This contains the tolerance for metric output; see arc_tol$ for the inch equivalent.
met_chord_tol$
M L R W MT
Chordal deviation tolerance for arc break up and line break up.
This contains the tolerance for metric output; see chord_tol$ for the inch
equivalent.
met_helix_tol$
M L R MT
The minimum axis motion perpendicular to an arc plane required to
prevent automatic linearization of the helix. If the minimum is not met and
the move distance is not zero, the arc is broken with the arc linearize routine.
The only reason to have this in a Lathe post would be for milling toolpaths in a mill/turn post.
See helix_arc$ for related information. A separate variable, helix_tol$, has been provided for inch
use.
met_ltol$
M L R W MT
Minimum distance between arc endpoints (length tolerance). This value
is the minimum distance in terms of a straight line (chord) between the
endpoints. minarc$ relates to the minimum distance measured along the arc itself. MP always
validates arcs against ltol$, whether or not the arccheck$/larccheck$ options are turned on.
If the length of the arc move is less than the value of ltol$, the arc fails and the move to the arc
endpoint is converted into a single linear move. If the length is greater than the value of ltol$,
then the linearize arc routine is called. The arc motion is then broken into line segments using
a chordal deviation tolerance set by the variable chord_tol$. The exception is with the
arccheck$/larccheck$ 200 option.
Wire controls use this value with g60_mode$ to determine tangency.
This contains the tolerance for metric output; see ltol$ for the inch equivalent.
met_maxrad$
M L R W MT
Maximum radius value to output for arc moves.
Controllers typically limit the size of a value that can be read. It is
possible to have an arc with a radius larger than the controller can handle. Use maxrad$ to set
a maximum radius value for arc moves that can be output in the NC file. If MP finds an arc
move with a radius larger than maxrad$, it converts the arc into line segments.
Conversely, the minrad$ variable sets the minimum radius value for arc moves in the output. If
the post processor finds an arc move with a radius smaller than minrad$, it converts the arc into
line segments.
Note: The linearization works the same as linarc$, that is, by using the chordal deviation set by
the variable chord_tol$. However, linarc$ and maxrad$ are independent variables and can be
used in combination or separately.
This variable is used for metric output; see maxrad$ for the inch value.
met_minarc$
M L R W MT
Minimum arc length tolerance (metric). This defines the minimum
distance between arc endpoints. This is measured along the path of the
arc, in contrast with met_ltol$, which is measured along the chord between the endpoints. This
tolerance is used when arccheck$/larccheck$ are set to 1 or 3.
This contains the tolerance for metric output; see minarc$ for the inch equivalent.
met_minrad$
M L R W MT
Minimum radius value to output for arc moves. This is used with the
Length of radius test in arccheck$/larccheck$ (10000s digit). See also met_
maxrad$.
This variable is used for metric output; see minrad$ for the inch value.
met_mtol$
M L R W MT
Motion tolerance. This determines the NC precision, or minimum step
value. This should match the linear precision of your machine tool. This
is also used to set the formatting of NCI data internally. mtol$ is used for inch output and met_
mtol$ for metric output.
MP uses this value in several ways when processing NCI data.
n First, it is used as the actual comparison value for generic motion—for example, with
the motst$ tests.
n Second, it determines the number of decimal places that MP will hold to when
processing NCI data. Numbers with more decimal places will be rounded or truncated.
n Third, it determines the rounding method that will be applied to NCI data. The
arccheck$/larccheck$ variables also use these mtol$ settings for rounding.
Note that if you wish, you can choose to truncate the NCI data to the desired number of
decimal places, instead of rounding. Use trunc_mtol$ to set this.
The processing logic is based on both the number of decimal places in the mtol$ value and the
value of the first non-zero digit (the following discussion applies equally to met_mtol$):
First non-zero digit is 4 or 5
The decimal precision is the number of places out to the 4 or 5. For example, if mtol$ = .0005,
then the NCI data will be rounded to 4 decimal places. Numbers will be rounded with a
partial fraction of 5.
First non-zero digit is 2
The decimal precision is the number of places out to the 2. For example, if mtol$ = .00002,
then the NCI data will be rounded to 5 decimal places. Numbers will be rounded with a
partial fraction of 2.
First non-zero digit is 1
The decimal precision is the number of places out to the 1. For example, if mtol$ = .00015,
then the NCI data will be rounded to 4 decimal places. The digit after the 1 determines the
partial fraction; in this case, 5.
For all other values
No partial fraction will be used. The decimal precision will be equal to the number of zeros.
For example, if mtol$ = .00008, then no partial fraction will be used, and the NCI data will be
rounded to 4 decimal places.
met_tool$
M L R W MT
Inch/metric flag. This is read from the NCI file. The value is based on
the current setting in the System Configuration dialog box.
n This variable determines whether the inch or metric settings are selected when fs2$
format statements are used.
n This is also typically used as the string selector for G20/G21.
Possible values
met_vert_tol$
M L R W MT
Tolerance applied to the tool vector in 5-axis toolpaths to determine if
the vector is to be considered vertical; in other words, if it is facing into
the plane. It is used when rotaxtyp$ = 3.
This variable is used for metric output; see vert_tol$ for the inch value.
met_xtol$
M L R W MT
Intersection tolerance. This is a general math function tolerance used
internally by MP. Some of the places where it is used include:
n Line and arc intersection routines; for example, xla, xaa, and xll.
n fsg1, fsg2, fsg3 functions.
This variable is used for metric output; see xtol$ for the inch value. See Tolerances for intersections
to learn more.
mi1$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi10$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi2$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi3$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi4$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi5$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi6$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi7$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi8$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mi9$
M L R W MT
Miscellaneous integers entered in the Miscellaneous values dialog box.
Miscellaneous integers let the post writer create custom variables whose
values can be entered individually for each operation. Each post needs to be written to process
each value. The specific individual meanings for each variable are based on how the post
processes them. Always open the post in an editor and read the comments on how the post is
using the miscellaneous integers.
See also mr1$ through mr10$ and miscops_mi1$ through miscops_mi10$ for related information.
mill5$
M L R MT
Flag to indicate 5-axis operation.
The value of this variable is available at the tool change when the tlchng_aft$
routines are enabled.
Possible values
minarc$
M L R W MT
Minimum arc length tolerance (metric). This defines the minimum
distance between arc endpoints. This is measured along the path of the
arc, in contrast with ltol$, which is measured along the chord between the endpoints. This
tolerance is used when arccheck$/larccheck$ are set to 1 or 3.
This contains the tolerance for inch output; see met_minarc$ for the metric equivalent.
minrad$
M L R W MT
Minimum radius value to output for arc moves. This is used with the
Length of radius test in arccheck$/larccheck$ (10000s digit). See also
maxrad$.
This variable is used for inch output; see met_minrad$ for the metric value.
miscops_mi1$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi10$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi2$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi3$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi4$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi5$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi6$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi7$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi8$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mi9$
L MT
Miscellaneous integers from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
See also miscops_mr1$ through miscops_mr10$ and mi1$ through mi10$ for related information.
miscops_mr1$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr10$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr2$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr3$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr4$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr5$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr6$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr7$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr8$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
miscops_mr9$
L MT
Miscellaneous real values from a lathe miscellaneous operation, as entered in the
Custom parameters dialog box.
Miscellaneous values let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using these
values.
See also miscops_mi1$ through miscops_mi10$ and mr1$ through mr10$ for related information.
mon$
M L R W MT
Returns the month of the current date.
The variables day$, mon$, month$ and year$ return the day, month and
year of the current date. They behave differently depending on whether you have assigned a
format.
n If no format has been applied, they return the date information as a text string,
according to the table below.
n If a format has been applied, they are treated like a numeric variable and the number
will be formatted as specified when it is output.
For example, assuming the following format statements:
fs 6 0.1
fmt 6 day$
fmt 6 month$
fmt 6 year2
year2 = year$ + 2000 # Change 09 to 2009
The following table shows what the formatted and unformatted output would be:
month$ 09 9.0
year$ 08 8.0
day$ 26 26.0
*progno$, e$
"(", "PROGRAM NAME: ", sprogname$, ")", e$
"(", "DATE: ", mon$, "-", day$, "-", year$, ")", e$ # Ex. Feb-12-05
"(", "TIME: ", time$, ")", e$
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 831
month$
M L R W MT
Returns the month of the current date.
The variables day$, mon$, month$ and year$ return the day, month and
year of the current date. They behave differently depending on whether you have assigned a
format.
n If no format has been applied, they return the date information as a text string,
according to the table below.
n If a format has been applied, they are treated like a numeric variable and the number
will be formatted as specified when it is output.
For example, assuming the following format statements:
fs 6 0.1
fmt 6 day$
fmt 6 month$
fmt 6 year2
year2 = year$ + 2000 # Change 09 to 2009
The following table shows what the formatted and unformatted output would be:
month$ 09 9.0
year$ 08 8.0
day$ 26 26.0
*progno$, e$
"(", "PROGRAM NAME: ", sprogname$, ")", e$
"(", "DATE: ", month$, "-", day$, "-", year$, ")", e$ # Ex. 02-12-05
"(", "TIME: ", time$, ")", e$
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 833
motion_lin$
M L R W MT
[reserved for future use]
motion_rot$
M L R W MT
[reserved for future use]
motst$
M L R W MT
Indicates the axes in which the current linear move is occurring. Use
mtol$ to specify the tolerance which indicates that motion is occurring.
Possible values
0 No motion
1 Motion in X only
2 Motion in Y only
4 Motion in Z only
move_ang$
M L R W MT
Angle between the current move and the next move in the XY plane, as
seen from the top view. The next move after contour is determined by
the nextop$ value.
n For Mastercam X4 and later posts, the plane is indicated by the move_ang_pln$ variable.
n For X3 and earlier, the plane is always XY.
The getnextop$ variable must be set to activate the move_ang$ variable. The mov_ang$
variable is not used with 4-axis direct Wire posts.
The value ranges from –180 degrees to 180 degrees.
Possible values
–9999 No next or previous move. move_ang$ is always set to –9999 on first and last
moves because there is no previous or next move.
8888 Motion into or out of the plane (where the plane is specified by the move_ang_
pln$ variable). The move_ang3$ variable may be able to provide the needed angular
information.
move_ang3$
M L R W MT
Angle between the current move and the next move as viewed from the
plane formed by the two moves.
This angle is always a positive value from 0–180 degrees. (Note that in some earlier versions of
the MP documentation, the value range was incorrectly listed as 0–360 degrees.)
The getnextop$ variable must be set to activate the move_ang3$ variable. See move_ang$ for
related information.
Possible values
move_ang_pln$
M L R W MT
Indicates the plane in which the move_ang$ value applies. By default this
is set to 0 for compatibility with older posts. Initialize it to a negative
value to have MP dynamically update the value. MP updates it based on the toolpath type:
n Lathe toolpaths switch it to –3.
n Non-lathe toolpaths switch to –1.
n Nothing currently automatically switches to –2, but this can still be used to initialize
automatic processing.
Set it to a positive number to manually lock the value to a specific plane.
Possible values
mr1$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr10$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr2$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr3$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr4$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr5$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr6$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr7$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr8$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mr9$
M L R W MT
Miscellaneous real values entered in the Miscellaneous values dialog box.
Miscellaneous reals let the post writer create custom floating-point
(decimal) variables whose values can be entered individually for each operation. Each post
needs to be written to process each value. The specific individual meanings for each variable
are based on how the post processes them. Always open the post in an editor and read the
comments on how the post is using the miscellaneous reals.
See also mi1$ through mi10$ and miscops_mr1$ through miscops_mr10$ for related information.
mrg_subfile$
M L R W MT
Merges contents of all the subprogram output streams.
With nested subprograms, it is possible to have an unknown number of
nested subprogram levels. This command automatically takes each nested level file and
appends it to the NC file. The initial sub_level$ of 3 or 4 determines if the top level is written
before (3) or after (4) the nested levels. When this command is used, subout$ is automatically
set to 0 (merge to main NC output).
mtol$
M L R W MT
Motion tolerance. This determines the NC precision, or minimum step
value. This should match the linear precision of your machine tool. This
is also used to set the formatting of NCI data internally. mtol$ is used for inch output and
met_mtol$ for metric output.
MP uses this value in several ways when processing NCI data.
n First, it is used as the actual comparison value for generic motion—for example, with
the motst$ tests.
n Second, it determines the number of decimal places that MP will hold to when
processing NCI data. Numbers with more decimal places will be rounded or truncated.
n Third, it determines the rounding method that will be applied to NCI data. The
arccheck$/larccheck$ variables also use these mtol$ settings for rounding.
Note that if you wish, you can choose to truncate the NCI data to the desired number of
decimal places, instead of rounding. Use trunc_mtol$ to set this.
The processing logic is based on both the number of decimal places in the mtol$ value and the
value of the first non-zero digit (the following discussion applies equally to met_mtol$):
First non-zero digit is 4 or 5
The decimal precision is the number of places out to the 4 or 5. For example, if mtol$ = .0005,
then the NCI data will be rounded to 4 decimal places. Numbers will be rounded with a
partial fraction of 5.
First non-zero digit is 2
The decimal precision is the number of places out to the 2. For example, if mtol$ = .00002,
then the NCI data will be rounded to 5 decimal places. Numbers will be rounded with a
partial fraction of 2.
First non-zero digit is 1
The decimal precision is the number of places out to the 1. For example, if mtol$ = .00015,
then the NCI data will be rounded to 4 decimal places. The digit after the 1 determines the
partial fraction; in this case, 5.
For all other values
No partial fraction will be used. The decimal precision will be equal to the number of zeros.
For example, if mtol$ = .00008, then no partial fraction will be used, and the NCI data will be
rounded to 4 decimal places.
m_vers_no$
M L R W MT
Mastercam minor version number.
See also post_version$.
Possible values
30 Version 6
32 Version 7
33 Version 8
34 Version 9
35 Mastercam X
36 Mastercam X2
37 Mastercam X3
38 Mastercam X3 SP1
39 Mastercam X4
40 Mastercam X4 MU1
42 Mastercam X5
43 Mastercam X5 MU1
46 Mastercam X6
53 Mastercam X7
54 Mastercam X7 MU1
55 Mastercam X7 MU2
59 Mastercam X8
Predefined variables, postblocks, and functions: page 854
61 Mastercam X8 MU1
62 Mastercam X8 MU2
65 Mastercam X9
69 Mastercam 2017
74 Mastercam 2018
n$
M L R W MT
Output variable for the sequence number. The initial value is inherited
from seqno$, and is incremented by seqinc$ during processing.
The sequence number is incremented internally by the post processor when a postline
contains n$ and is output, or if n$ is forced (*n$). The value of n$ is reset to seqno$ when it
exceeds seqmax$. Set omitseq$ to suppres sequence numbers.
Most of the sequence number settings are controlled from the NC Output page in the Control
Definition Manager.
nchar$
M L R W MT
Current number of characters written to the NC file. The term "NC file"
refers to the output stream for subout$ = 0.
nchaux$
M L R W MT
Current number of characters written to the .AUX file. The .AUX file
refers to the output stream for subout$ = 2.
nchext$
M L R W MT
Current number of characters written to the .EXT file. The .EXT file
refers to the output stream for subout$ = 3.
nchlcc$
M L R W MT
Current number of characters written to the .LCC file. The .LCC file
refers to the output stream for subout$ = 4.
nchsub$
M L R W MT
Current number of characters written to the .SUB file. The .SUB file
refers to the output stream for subout$ = 1.
nci_buffer_size$
M L R W MT
[future use]
nci_line$
M L R W MT
NCI line number currently being processed. This is typically only used
for testing or debugging purposes.
nci_rewind$
M L R W MT
Restarts the reading of the NCI file from the location of the command
word in the post customization file. The NCI file is reset to the start of
the file. Please be aware of the following:
n You must ensure that your post has the proper logic to prevent an endless loop!
n This command does not reinitialize the post variables. They retain the values that they
held when the nci_rewind$ command is called.
ncldr$
M L R W MT
Sets the number of leader characters output by the fleader$ function.
The post function fleader$ will output a series of a selected character to
the NC output. The character to be output is indicated by the variable ldrcode$, which stores
the ASCII value of the desired character. Use ncldr$ to indicate the number of times it is to be
output. This function is intended to provide the tape leader and tape trailer when punching
paper tape.
Normally, fleader$ is placed in the beginning of the postblock pheader$ and at the end of the
postblock peof$.
nc_lout$
M L R W MT
Indicates if NC output was generated. See no_updprv$ for more
information.
Possible values
nc_prv_modal$
M L R W MT
[future use]
nesting_op_id$
M L R W MT
Operation ID of the immediate parent nesting operation. If the current
operation is the result of a nesting operation, this is the op_id$ of the
parent nesting operation.
This parameter was added in Mastercam X9. It is parameter 19 for Mill/Lathe/Router, and
parameter 21 for Wire.
Parameter 1 on the 1016 line is the op_id$ of either the nested operation (in other words, the
original toolpath) or the actual operation, if there is no nesting.
See also xform_op_id$.
newaux$
M L R W MT
Closes and reopens the open alternate file output stream auxprg$ with a
new path, file name, or extension.
The value of auxprg$ determines if the file to be opened is new or to keep the contents of the
file.
newext$
M L R W MT
Closes and reopens the open alternate file output stream extprg$ with a
new path, file name or extension.
The value of extprg$ determines if the file to be opened is new or to keep the contents of the
file.
newglobal$
M L R W MT
Controls when global variables are computed. It is recommended that
you set newglobal$ to 1 if you plan to use global variables.
Possible values
0 Compute global variables only when they are output on a postline, used in a string
select function, or when forced to update with the ! variable modifier (default).
1 Compute global variables whenever they appear on a postline. This includes output
statements, string select function calls, formula statements, and conditional
branching statements.
finishing =
(
Predefined variables, postblocks, and functions: page 871
p_mypostblock #
if finishing, cycle832_tech = one # Post selected tech based on
operation type. See global "finishing ="
if roughing, cycle832_tech = three # Post selected tech based on
operation type. See global "roughing ="
Predefined variables, postblocks, and functions: page 872
newlcc$
M L R W MT
Closes and reopens the open alternate file output stream lccprg$ with a
new path, file name or extension. This is typically used to support lathe
canned cycle output, but technically can be used for any purpose.
The value of lccprg$ determines whether a new file will be opened or keep the contents of the
existing file.
newsub$
M L R W MT
Close and reopen the open alternate file output stream subprg$ with a
new path, file name or extension.
The setting of subprg$ determines if the file to be opened is new or to keep the contents of the
file.
nextccomp$
M L R W MT
Provides the next NCI Gcode cutter compensation. This is read from the
1013 line from the next operation. The values are the same as ccomp$.
The post switch variable getnextop$ must be set to 1 to access the value.
Possible values
0 Off
nextcflg$
M L R W MT
Provides the next NCI Gcode contour flag. See cur_cflg$ for possible
values.
The post switch variable getnextop$ must be set to 1 to access the value.
nextdc$
M L R W MT
Provides the next drill cycle selector from the next NCI 81 line. This
variable is only set at a drill cycle tool change.
The post switch variable getnextop$ must be set to 1 to access the value.
Note: If the post uses tlchng_aft$, read the value of nextdc$ in the ptlchg1002$ postblock.
nextfullarcflg$
Provides the do_full_arc$ value from the next NCI line. This variable is M L R W MT
available when the current NCI code is 2 or 3 (and for Wire, 22 or 23).
The post switch variable getnextop$ must be set to 1 to access the value.
nextop$
M L R W MT
Provides the next NCI Gcode. The name of this variable is misleading; it
is the next NCI Gcode value, not the next operation. See gcode$ for
values.
The post switch variable getnextop$ must be set to 1 to access the value.
nextplane$
M L R W MT
Provides the plane used by the next NCI Gcode. The values are the same
as plane$.
The post switch variable getnextop$ must be set to 1 to access the value.
Possible values
–1 Invalid plane
0 XY plane, G17
1 YZ plane, G19
2 XZ plane, G18
nextu$
M L R W MT
Provides the next NCI Gcode 11 (U coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
nextv$
M L R W MT
Provides the next NCI Gcode 11 (V coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
nextw$
M L R W MT
Provides the next NCI Gcode 11 (W coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
nextwc$
W
Provides the next NCI Gcode wire corner. The getnextop$ switch must be set to 1 to
access the value. See also wc$.
Possible values
0 Conical
1 Sharp
2 Constant
3 Other
nextwt$
W
Provides the next NCI Gcode wire taper.
Possible values
nextwt_immd$
W
Provides the next NCI Gcode immediate wire taper.
The value of nextwt_immd$ is initially set to nextwt$ by default. If g60_mode$ is
active, then nextwt$ is set to the first taper at the arc start and nextwt_immd$ is set to the
taper of the next actual move.
The getnextop$ switch must be set to 1 to access the value.
Possible values
nextx$
Provides the next NCI Gcode X coordinates. See xnci$ for value. M L R W MT
The post switch variable getnextop$ must be set to 1 to access the value.
nextxc$
M L R W MT
Provides the next NCI Gcode (X arc-center coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
nexty$
M L R W MT
Provides the next NCI Gcode Y coordinates. See ynci$ for value.
The post switch variable getnextop$ must be set to 1 to access the value.
nextyc$
M L R W MT
Provides the next NCI Gcode (Y arc-center coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
nextz$
M L R W MT
Provides the next NCI Gcode Z coordinates. See znci$ for value.
The post switch variable getnextop$ must be set to 1 to access the value.
nextzc$
M L R W MT
Provides the next NCI Gcode (Z arc-center coordinate).
The post switch variable getnextop$ must be set to 1 to access the value.
next_t$
M L R W MT
[future use]
next_tool$
mi8$M L R W MT
Next tool number used in the program at the current tool change.
This variable is used to select tools for tool changes that require pre-
staging the next tool to run. At each tool change NCI Gcode 1001 or 1002, MP gets the next
tool’s number. The last tool change returns the first tool number to next_tool$.
The bldnxtool$ variable must be set to 1 to access the next_tool$ variable (this is typically set in
the control definition). See related variable first_tool$.
no$
Use this variable to indicate a false condition. It is typically equal to 0. M L R W MT
nobrk$
M L R MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY
or XY and Z motion. Only affects moves in the XY plane.
Mastercam X added nobrkxz$ and nobrkyz$ plane-specific versions of the legacy nobrk$
variable, so that nobrk$ now applies only to Mill and Router posts when the tool plane is the
XY plane. Use the XY plane control option to set the nobrk$ value:
Use the following control definition options to set the value for nobrkxz$ and nobrkyz$:
In actual practice, the nobrk$ variable is the only one ever used with linear motion. The
nobrk$, nobrkxz$ and nobrkyz$ variables are used when arcs are linearized and there is a helix.
Predefined variables, postblocks, and functions: page 896
Possible values
0 Break rapid moves option. Break rapids into two moves depending on Z motion.
n If the motion is from a greater Z value to a lesser Z value, interpret the move
as going into the part and make the XY move first, followed by a move in Z.
n If the motion is going from a lesser Z to a greater Z, interpret the move as
going out of the part and make the Z move first, followed by a move in XY.
1 Do not break linear motion option. Output moves as a single XYZ (3-axis) move.
2 Break all moves option. Break any single feed move into two moves. Break helical
motion into an XY arc and a Z line component, or a Z line and an XY arc
component. Similar to setting nobrk$ = 0.
nobrkxz$
M L R MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY
or XY and Z motion. Only affects moves in the XZ plane.
Mastercam X added nobrkxz$ and nobrkyz$ plane-specific versions of the legacy nobrk$
variable, so that nobrk$ now applies only to Mill and Router posts when the tool plane is the
XY plane. Use the XY plane control option to set the nobrk$ value:
Use the following control definition options to set the value for nobrkxz$ and nobrkyz$:
In actual practice, the nobrk$ variable is the only one ever used with linear motion. The
nobrk$, nobrkxz$ and nobrkyz$ variables are used when arcs are linearized and there is a helix.
See nobrk$ for list of possible values.
Predefined variables, postblocks, and functions: page 898
nobrkyz$
M L R MT
Controls output of 3-axis moves as a single XYZ move or separate Z and XY
or XY and Z motion. Only affects moves in the YZ plane.
Mastercam X added nobrkxz$ and nobrkyz$ plane-specific versions of the legacy nobrk$
variable, so that nobrk$ now applies only to Mill and Router posts when the tool plane is the
XY plane. Use the XY plane control option to set the nobrk$ value:
Use the following control definition options to set the value for nobrkxz$ and nobrkyz$:
In actual practice, the nobrk$ variable is the only one ever used with linear motion. The
nobrk$, nobrkxz$ and nobrkyz$ variables are used when arcs are linearized and there is a helix.
See nobrk$ for list of possible values.
Predefined variables, postblocks, and functions: page 900
nocore_fin$
W
Flag to indicate that the current pass is the finish contour operation that was
spawned from a no core operation.
Possible values
0 Normal contour
not( )
NOT operator. Reverses the result of the conditional expression x.
no_nc_out$
M L R W MT
Inhibits NC output or forces NC output if inhibited by subprograms.
Set omitseq$ to –1 to prevent sequence numbering from incrementing
during inhibited internal processing without NC output.
Possible values
no_spc$
M L R W MT
Placing this on a command line prevents spaces from being padded to
the next output variable.
When spaces are added, they are added to the front of variables (technically, in front of the
prefix assigned to the output variable).
For example, consider the following postline (with spaces$ : 2):
n$, *sgcode, x$, y$, *speed, *spindle, e$
Note that you can also initialize this variable with a value to use it modally or non-modally.
Setting it to 1 essentially suppresses all spaces, overriding the control definition setting and the
value of spaces$. Setting it to 0 restores it to “single-use” mode as shown in the example above.
Possible values
no_updprv$
M L R W MT
Provides control over when/if the previous (prv_[var]$) value of a
numeric variable updates during NC output.
This processing option was added to allow testing on a previous value prv_[var]$ while the
output line is being generated without MP updating the previous values until after the NC line
is output. Otherwise, the previous value prv_[var]$ is updated as each output statement is
processed.
Up to 25 numeric variables can be buffered on a single output postline for updating the
previous value.
The numeric variable nc_lout$ is set to the current internal postblock call level; immediately
after the output postline to help determine if any NC output occurred. If no NC output was
generated at the last postblock call level, nc_lout$ is set to –1.
The no_updprv$ variable also prevents MP from updating the previous of x$, xr$, xh$; y$, yr$,
yh$; z$, zr$, zh$ with themselves.
In Wire, the cross reference updating is the previous of x$, threadx$, startx$; y$, thready$, starty$;
z$, threadz$, startz$.
Possible values
2 Do not update any of the previous values of any of the numeric variables. The post
writer must update each numeric variable using the update numeric variable
modifier (!var).
py # A postblock to output y
if x$ = prv_x$, y$
nqc$
M L R W MT
OBSOLETE: Number of characters in the string that answers a user-
defined post question.
nspring$
L MT
Number of spring cuts entered in Mastercam for the current threading cycle.
nstartdir$
L MT
Threading direction.
nstarts$
L MT
Number of starts for threading cycle (multiple start thread).
ntools$
M L R W MT
Number of tools used.This variable is available only when the post
switch variable bldnxtool$ is enabled.
nut_ang_pri$
M L R MT
This is used to help define a nutating rotary axis. For a nutating axis, MP
needs to know the tilt angle from the Z+ axis. The angle is signed negative if
the tilt is towards X– or Y–.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically calculate
this from the machine definition. Read the following section to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Predefined variables, postblocks, and functions: page 913
nut_rot_ax$
M L R MT
Controls the axis of rotation for the nutating axis.
Possible values
–3 –Z
–2 –Y
–1 –X
1 X
2 Y
3 Z
else,
[
if nut_rot_ax$ = two, #+Y
[
#default case
]
else, # nut_rot_ax$ = -two (-Y)
[
n_cntr_x = -n_cntr_x
n_cntr_y = -n_cntr_y
]
]
]
Predefined variables, postblocks, and functions: page 916
n_flutes$
M L R MT
Number of flutes on cutter.
n_tap_thds$
M L R MT
For a metric tap, the value is millimeters per thread (this is the pitch). For
an inch tap, the value is the number of threads per inch (the inverse of the
pitch). See also tap_pitch$, which is typically preferred for posts that are X8 or later.
offset$
M L R W MT
Current Wire offset register number entered in Mastercam.
This variable was formerly called lofs$ in older Wire post processors. The
value is copied to the variable for backward compatibility.
offset_mach$
W
The offset type in Mastercam Wire. This is read from the 20200 line when listrad$ is
set to 2.
Possible values
0 Program coordinates; the coordinates in the NCI are already shifted by the stock-
to-leave amount.
offset_total$
W
The calculated total wire offset amount in Mastercam Wire. This equals wire radius
+ overburn + stock-to-leave amount. This is read from the 20200 line when listrad$ is
set to 2.
omitcrlf$
M L R W MT
Omits the carriage return/line feed at the end of each NC line. It is set
with the following option:
The ASCII decimal equivalents for CR/LF are 10/13. See eob$ and use_alt_eob$ for related
information.
Possible values
omitseq$
M L R W MT
Turns sequence number output on or off. Set in the control definition:
NC Output page.
Even when omitseq$ is turned on (equals 1), the sequence number output can still be forced
by adding an asterisk to the sequence number variable *n$, or by declaring the variable non-
modal in its format statement.
Possible values
opcode$
M L R W MT
Operation code: indicates the type of toolpath that generated the
current NCI data.
This is output on the 1013 line primarily to support older posts that use it, but should be
considered obsolete. Instead, tool_op$ (output on the 1016 line) is typically the better option
for modern posts.
opcode$ tells you the general classification of a toolpath, while tool_op$ more specifically
identifies the toolpath type.
Possible values
Mill/Router operations
2 Contour
3 Drill
4 Pocket
5 Ruled
6 2D swept
7 3D swept
8 Revolution
9 Loft
10 Coons
13 Surface finish
14 Surface rough
15 Point
16 Drill 5-axis
17 Curve 5-axis
Predefined variables, postblocks, and functions: page 924
18 Swarf 5-axis
19 Face
20 5-axis multi-surface
21 5-axis slice
22 5-axis port
23 5-axis circle
25 Probe
Lathe operations
103 Groove
104 Thread
Wire operations
202 3D contour
operation_seq$
M L R W MT
Operation sequence number. This indicates the position of the current
operation within the operation list. This is typically used with the
streaminfo function so that you can query the enhanced operation list. The list of operations
includes both:
n operations with tool changes (in other words, operations with a NCI 1000/1001/1002
line).
n operations without tool changes, such as probing operations, manual entry operations,
and lathe misc ops or POCO operations (in other words, operations that only generate
a NCI 999 line).
The value is initially set when the first NCI 999 line is read. Thereafter, for operations that do
not have a tool change, it is set when the NCI 999 is read. For operations that do have a tool
change, it is not incremented until the NCI 1011 line is read.
This is introduced for Mastercam 2017.
op_gcode_chg$
M L R W MT
Helper variable used to set mode of opchng function.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
op_id$
M L R W MT
Internal operation ID number. This will be a unique value for each
operation, but do not assume that the op_id$ values from one operation
to the next will be in numeric order.
orient$
M L R MT
Lathe tool orientation.
Possible values
overburn$
W
The overburn amount entered in Mastercam Wire.
param_read$
M L R W MT
Before Mastercam X, this variable was used to control how the .OPS file
was processed. Use of the .OPS file was discontinued in Mastercam X;
from Mastercam X to X3, this variable was the state of the Write NC operation information
option in the Control Definition Manager:
However, this setting has since been removed from Mastercam. It is now automatically set to
1, and typically does not need to be changed.
Most of the legacy values that were defined for this variable before Mastercam X are now
obsolete. The only other meaningful value for param_read$ is 3. If it’s important for your
application needs, this can be used to limit parameter processing as follows:
n During NCI pre-read and tool table functions (pwrttparam$), it inhibits processing of
both 20000 lines and operation parameters.
n For parameter reads while processing NCI for NC output (pparameter$), it prevents
operation parameter processing, while allowing 20000 lines.
Since the control definition option is no longer available, if you want to do this you need to
explicitly set param_read$ : 3 in your .PST file. However, we recommend as a best practice
to simply leave it as 1.
Possible values
0 Obsolete
–1 Obsolete
2 Obsolete
–2 Obsolete
pass$
W
Current wire pass number.
pdo_type$
W
Flag to indicate the type of contour chained.
Possible values
0 Punch
1 Die
2 Open
3 Other
peck1$
M L R MT
Typically, this is used for the first peck amount (incremental distance). The
text of the label is defined in your post text and can be different for each
drill cycle. Regardless of which cycle is selected or the displayed label, It is always the value of
the first drill cycle parameter.
peck2$
M L R MT
Typically, this is used for the additional peck amount (incremental
distance). The text of the label is defined in your post text and can be
different for each drill cycle. Regardless of which cycle is selected or the displayed label, It is
always the value of the second drill cycle parameter.
peckacel$
M L R MT
Percentage of peck deceleration for non-canned drilling cycles. MP
automatically reduces the size of each subsequent peck by this percentage.
Note that this setting is applied globally. This variable can be set prior to or in pdrill0$ for
explicit post control.
peckclr$
M L R MT
Typically, this is used for the peck clearance (incremental distance). The
text of the label is defined in your post text and can be different for each
drill cycle. Regardless of which cycle is selected or the displayed label, It is always the value of
the third drill cycle parameter.
pi$
M L R W MT
The value of π (pi): 3.141592654... Internally, MP uses 16+ significant
digits.
plane$
M L R W MT
Current cutting plane. This is the user plane assigned at output.
Possible values
–1 Invalid plane
0 XY plane, G17
1 YZ plane, G19
2 XZ plane, G18
plot_2d_uv$
W
Activates the UV display and/or routines to generate post calls that emulate 4-axis
direct and taper NCI calls from 2D contour.
Set the numeric variable plot_2d_uv$ to negative values to activate output as UV direct,
when using the 2-axis conversion and backplot routines. This shuts off both the immediate$
routine (which reduces the two points in the NCI file to a single point output) and the g60_
mode$ routine (which replaces implied corner radius arcs).
You can use plot_2d_uv$ to verify the Mastercam backplot with MP’s interpretation by
enabling display options. Backplots can differ from MP’s interpretation because the NCI file is
not produced with the same precision of data available in Mastercam.
To enable the 2-axis conversion and backplot routines, set the following numeric variables:
n Set use_2d_uv$ to 1.
n Set linarc$ to 1 to produce the 4-axis taper output. By enabling this routine at a point
prior to any output with the conversion routine, arcs are simply broken and calls are
produced to the taper wirepath postblocks. Linear moves are not broken within this
routine.
n The numeric variable chord_tol$ is used to determine the chordal deviation of the
broken arc with this routine.
Once these variables have been set, use plot_2d_uv$ to determine the output type.
Possible values
–3 Enable postblock calls for 4-axis direct output. Do not display backplot.
–2 Enable postblock calls for 4-axis direct output. Save backplot display as geometry.
–1 Enable postblock calls for 4-axis direct output. Normal backplot display.
1 Normal backplot.
posttype$
M L R W MT
Flag to indicate the product that generated the current toolpath. This is
used for mill/turn operations.
Note that value 4 is ignored by MP; it will be forced to Mill.
Possible values
0 Neither
1 Mill/Router toolpaths
2 Lathe toolpaths
3 Wire toolpaths
4 Router toolpaths
post_version$
M L R W MT
Post version. This typically matches the version information in the post
header.
[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V17.00 P4 E1 W17.00
T1391635439 M17.00 I0 O0
This value is typically the same as the Mastercam version (vers_no$) and MP.DLL version (dll_
vers$). These are primarily used internally to verify that your post and the MP.DLL are the
proper version or if either needs to be updated. However, you should not assume that they will
continue to be the same in future releases. See also m_vers_no$.
Possible values
7 Version 7
8 Version 8
9 Version 9
10 Mastercam X
11 Mastercam X2
12 Mastercam X3
13 Mastercam X4
14 Mastercam X5
15 Mastercam X6
16 Mastercam X7
17 Mastercam X8
18 Mastercam X9
19 Mastercam 2017
Predefined variables, postblocks, and functions: page 946
20 Mastercam 2018
power$
W
Current power status.
This variable is set both within the NCI tool change block and extracted from the
contour flag variable cur_cflg$.
See related tank$, water$ and wire$.
Possible values
0 Off
1 On
prg_number$
M L R W MT
[future use]
pri_inthi$
M L R MT
The maximum intersection angle for the primary rotary axis. This is usually
greater than zero. MP uses this to trigger a reposition or unwind move in
the primary rotary axis. This is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
pri_intlo$
M L R MT
The minimum intersection angle for the primary rotary axis. This is usually
negative or zero. MP uses this to trigger a reposition or unwind move in the
primary rotary axis. This is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
pri_limhi$
M L R MT
Positive axis travel limit for the primary rotary axis. This is typically used in
multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
pri_limlo$
M L R MT
Negative rotary axis travel limit for the primary rotary axis. This is typically
used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
pri_limtyp$
M L R MT
Used to set the basic angle range for the secondary rotary axis in a multiaxis
postThis is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post. Posts supplied by CNC Software typically link this to a user-defined variable
called auto_set_lim (automatically set limits) such that it is only used when auto_
set_lim is disabled.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition as described below. When this is done, the auto_set_lim
switch should be removed.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Possible values
1 Equal or greater than 180 degrees and less than 360 degrees
Predefined variables, postblocks, and functions: page 958
auto_set_lim : 0
pri_limtyp$ : 2
sec_limtyp$ : 2
Predefined variables, postblocks, and functions: page 959
prmcode$
M L R W MT
This is the used to support MP’s parameter reading routines for
Mastercam X9 and earlier posts. Its value is automatically set to the
number of the current parameter number as it is being read.
It is typically used together with the string variable sparameter$, which holds the value of the
associated parameter.
For example, if you are create a feature-based pocket toolpath, parameter 12780 tells you the
number of tools that are used. So prmcode$ would equal 12780, while sparameter$ might equal
3, if the FBM operation used three tools.
Beginning with Mastercam 2017, posts should use the new query functions ( opinfo( ), mdinfo( ),
groupinfo( ), cdinfo( ) ) instead of the older techniques based on prmcode$ and pparameter$.
n Please see the Working with tool and operation parameters application guide for the most
complete information about the new query functions introduced in Mastercam 2017 as
well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9 and
earlier posts, or if you need to support an X9 post.
This example code is from a Mastercam 2017 post, using Mastercam 2017's new query
functions.
return : 0
probe_active$
M L R W MT
This is a flag that indicates if probing is active. It is typically used when
x_probe_opt$ is configured so that the inhibit_probe$/uninhibit_probe$
commands are the probe processing triggers (in other words, when the first digit of x_probe_
opt$ = 2).
The value changes in response to specific probing events as listed in the following table.
Possible values
probe_head$
M L R W MT
Use this command to output the probing header data. This is typically
placed in your psof$ postblock. It functions as a call to the pcomment_
probe$ postblock.
This command outputs what is contained in probing operations with a tool_op$/synctool_op$
value of 152. The pcomment_probe$ postblock is called once for each comment in the 152
operation.
Since this functions only as a command keyword, it has no value.
progname$
M L R W MT
Outputs the NC file name as typed or uppercase.
In older versions of Mastercam, this was also used as a command variable
that output the program name as a string when encountered on an output postline. However,
the string variable sprogname$ was introduced Version 9 and should be used for this purpose.
The progname$ variable should only be used as a switch.
Possible values
progno$
M L R W MT
Program number.
pst_mode$
M L R W MT
Represents the method used in Mastercam to launch the post
executable. This is used by MP to write errors to an external file when
posting in batch mode. The file is the NCI file name with the .ERR file extension.
Possible values
6 Setup sheet
pst_return_mode$
M L R W MT
Determines whether or not processing will return to Renishaw
Productivity+ after MP posting. This is automatically set to 1 when a
1042 line is detected in the NCI. You can override this to 0 in your post to prevent Renishaw
processing after MP posting is finished.
If you choose to override this in your post, you should do that in the ppost$ postblock. The
value of this variable does not have any effect on MP processing.
This variable is set up as a “license plate” value, where each digit controls a different
condition. However, currently only a single digit has been defined.
In a typical implementation where probing output is desired, this variable is not included in
your post, and MP sets the value automatically behind the scenes.
Possible values
pst_rpd_fr$
M L R W MT
The speed that the machine uses for rapid moves. It is set with the
following machine definition option:
ptfixx$
M L R W MT
The variables ptfixx$, ptfixy$, and ptfixz$ store the rotation point used
with the rotate function rotp( ). By default, this point is 0,0,0 (the origin).
ptfixy$
M L R W MT
The variables ptfixx$, ptfixy$, and ptfixz$ store the rotation point used
with the rotate function rotp( ). By default, this point is 0,0,0 (the origin).
ptfixz$
M L R W MT
The variables ptfixx$, ptfixy$, and ptfixz$ store the rotation point used
with the rotate function rotp( ). By default, this point is 0,0,0 (the origin).
ptnearx$
M L R W MT
Used by 2D intersection functions to select a point when two
intersection points are found. Returns the point closest to this position.
ptneary$
M L R W MT
Used by 2D intersection functions to select a point when two
intersection points are found. Returns the point closest to this position.
ptnearz$
M L R W MT
Used by 2D intersection functions to select a point when two
intersection points are found. Returns the point closest to this position.
p_svec$
M L R MT
Surface normal vector (p_svec$, q_svec$, r_svec$). These are used for 3-axis
cutter compensation. They are the surface normal at the current tool
position with NCI Gcode 11 data.
qrtyp$
W
Set options for wirepath coordinate output.
Wire angle perpendicular wq$ (Q) and parallel wr$ (R) to the current wire motion
(Agie style).
Possible values
n 0 2D contour: Normal process. Do not set wq$, wr$.
n 4-Axis Direct: Normal process. Set wq$, wr$.
n 4-Axis Taper: Delta u, v, w. Do not set wq$, wr$. Delta u, v, w, calculated as:
u=u–x
v = v – y$
w = w – z$
2 n 2D contour: Normal process. Set wq$, wr$ (wq$ equals wt$, wr$ equals 0).
n 4-Axis Direct: Normal process. Set wq$, wr$.
n 4-Axis Taper: Normal process. Do not set wq$, wr$.
qstep$
W
Status of an immediate taper change with 4-axis direct.
Possible values
q_svec$
M L R MT
Surface normal vector (p_svec$, q_svec$, r_svec$). These are used for 3-axis
cutter compensation. They are the surface normal at the current tool
position with NCI Gcode 11 data.
rad2deg$
M L R W MT
Value used to convert radians to degrees: 57.29577951
ra_block$
R
Block number. This comes from the Aggregate Selection dialog box.
ra_bvecx$
R
Block offset vector from block reference to head reference
ra_bvecy$
R
Block offset vector from block reference to head reference
ra_bvecz$
R
Block offset vector from block reference to head reference
ra_head_grp$
R
Bitwise value that tells you which head numbers are used at this position. For
example, if heads 1,2 and 3 are used, the value of ra_head_grp$ = 7 (1+2+4). If head 4
is used, ra_head_grp$ = 8.
Possible values
1 1
2 2
3 4
4 8
5 16
6 32
7 64
8 128
9 256
10 512
11 1024
12 2048
13 4096
14 8192
15 16384
16 32768
Predefined variables, postblocks, and functions: page 984
ra_hvecx$
R
Vector from zero reference to head reference (user defined)
ra_hvecy$
R
Vector from zero reference to head reference (user defined)
ra_hvecz$
R
Vector from zero reference to head reference (user defined)
ra_offset$
R
Head Work offset override
ra_rot_head$
Flag that indicates if the head has rotary capabilities. R
Possible values
0 Fixed head
ra_station$
R
Station number. For each head, each station is numbered sequentially beginning with
zero.
ra_svecx$
R
Unit vector of initial tool direction (tip to pivot)
ra_svecy$
R
Unit vector of initial tool direction (tip to pivot)
ra_svecz$
R
Unit vector of initial tool direction (tip to pivot)
ra_tc_type$
R
Toolchange type.
Possible values
1 Fixed unit
ra_translated$
R
Flags coordinate translation to the machine view.
Possible values
ra_tvecx$
R
Vector representing the tool offset from the head pivot
ra_tvecy$
R
Vector representing the tool offset from the head pivot
ra_tvecz$
R
Vector representing the tool offset from the head pivot
ra_type$
R
Head type.
Possible values
0 No head (off)
1 Right-angle head
2 Compound-angle head
3 Block drill
ra_vecx$
R
Unit vector of tool direction (tip to pivot). The overall length from the tool
definition is the tool length to pivot and is used to scale this vector when needed.
ra_vecy$
R
Unit vector of tool direction (tip to pivot). The overall length from the tool
definition is the tool length to pivot and is used to scale this vector when needed.
ra_vecz$
R
Unit vector of tool direction (tip to pivot). The overall length from the tool
definition is the tool length to pivot and is used to scale this vector when needed.
rcc_flg$
L MT
Tracks the processing position in the Lathe canned turning cycles.
rd_cd$
M L R W MT
Command variable: calls pmachineinfo$ to get control definition
parameters. Place the rd_cd$ command on a postline in the postblock
where you want to read the parameters. Then, modify the pmachineinfo$ postblock to trap the
desired parameter numbers.
NOTE Thisis typically applicable to posts written for X9 and earlier; posts written for
Mastercam 2017 and later should use the cdinfo function instead.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
rd_exit$
M L R W MT
Obsolete
rd_mch_ent_no$
M L R W MT
Helper variable for rd_md$ for X9 and earlier posts; it determines which
machine definition parameters are read. Use it to specify the scope of the
machine definition parameters to retrieve. For example, you can get parameters for:
n a specific component
n the current axis combination
n general machine parameters; in other words, parameters that apply to the machine as a
whole, instead of a particular component
n the entire machine definition. While this is possible, it typically is not very useful, since
many of the parameters repeat for each component and each successive component will
overwrite the previous component as it is read.
Set the value of rd_mch_ent_no$ before calling rd_md$. Use the values below to set the rd_
md$ mode.
Typically, to get all the parameters for the entire machine definition, you would call rd_md$
multiple times, once for each individual component in the machine definition, such as a single
axis, spindle, chuck, etc.
This is typically applicable to posts written for X9 and earlier; posts written for Mastercam
2017 and later should use the mdinfo function instead.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
Possible values
–2 Uses the value of sparameter$ to find the axis combination. For example,
sparameter$ might equal “Upper Left.” (Note that sparameter$ needs to have been
already set to a value.)
–1 Reads the entire machine definition file. The order is base parameters, axis
combinations, and then components.
Predefined variables, postblocks, and functions: page 1008
0 Reads only the parameters for general machine properties. Only those parameters
included in the CNC_MACHINE_TYPE group are included.
any positive number Get the parameters for a single specific component. In this case,
the value of rd_mch_ent_no$ is the entity ID of the component or axis
combination.
rd_md$
M L R W MT
Command variable: calls pmachineinfo$ to get machine definition
parameters. Place the rd_md$ command on a postline in the postblock
where you want to read the parameters. Then, modify the pmachineinfo$ postblock to trap the
desired parameter numbers. This is typically applicable to posts written for X9 and earlier;
posts written for Mastercam 2017 and later should use the mdinfo function instead.
The rd_md$ command relies on a helper variable, rd_mch_ent_no$, to define the scope of the
parameters that will be read—for example, the specific component or axis combo in the
machine definition. Make sure rd_mch_ent_no$ is set to the proper value before calling rd_md$.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
rd_params$
M L R W MT
In X9 and earlier posts, use the rd_params$ command to call
pparameter$ and read operation parameters from any postblock. This is
similar to way that the rd_md$, rd_cd$, and rd_tlpathgrp$ commands can be placed in any
postblock.
The rd_params$ command relies on a helper variable called rd_prm_op_no$. This specifies the
op_id$ of the operation whose parameters are to be read. Because of this, you cannot use this
function too early in your post (such as the pprep$ postblock), because the op_id$ hasn't been
set yet. If you’re not sure whether you are using rd_params$ in an invalid postblock, just run
the post in the debugger and verify that rd_prm_op_no$ has acquired a non-zero value before
calling rrd_params$.
In general, no matter where you use rd_params$, you need to make sure that rd_prm_op_no$ is
properly set. It is set to 0 by default. Typically, it is a good practice to set it right before the
function is called. Setting it equal to op_id$ is a useful technique to get the parameters for the
current operation.
This is typically applicable to posts written for X9 and earlier; posts written for Mastercam
2017 and later should use the opinfo function instead.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
rd_prm_header$
M L R W MT
Obsolete
rd_prm_op_no$
M L R W MT
This is a helper variable that is used with the rd_params$ command. It
specifies the op_id$ of the operation whose parameters are to be read.
Typically, it is a good practice to set the value of rd_prm_op_no$ right before the rd_params$
command is called. Setting it equal to op_id$ is a useful technique to get the parameters for the
current operation. It is set to 0 by default.
This is typically applicable to posts written for X9 and earlier; posts written for Mastercam
2017 and later should use the opinfo function instead.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
rd_tlpathgrp$
M L R W MT
Command variable: calls pmachineinfo$ to get machine group parameters.
Place the rd_tlpathgrp$ command on a postline in the postblock
where you want to read the parameters. Then, modify the pmachineinfo$ postblock to trap the
desired parameter numbers. This is typically applicable to posts written for X9 and earlier;
posts written for Mastercam 2017 and later should use the groupinfo function instead.
If you are interested in getting parameters for stock, remember that stock models are
considered components in the machine definition. This means that depending on how the
stock model is defined—particularly lathe stock models, along with chuck jaws and tailstock
centers—some of the parameters that you are interested in might need to be accessed as
machine definition component properties, instead of from the machine group properties.
Please note that you can only get parameters for stock models that are defined in machine
group properties or as machine definition components. You cannot access parameters or values
from a stock model operations.
NOTE
Mastercam 2017 introduced significant changes to parameter processing, including a
number of new query functions that make this command obsolete. While the
techniques described in this topic will continue to work in Mastercam 2017 to maintain
compatibility with older posts, posts that are written for Mastercam 2017 or later should
use the new query functions.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
redo_proc$
M L R W MT
The command variable redo_proc$ allows exiting the current postline
and all subsequent processing for 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. Typical uses include:
n linearizing arcs after calling into pcir$
n breaking lines after calling into plin$
n switching long drill cycles on or off
To avoid endless looping, a call to redo_proc$ is performed once and then is disabled until the
next NCI line is read.
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.
MP includes a number of postblocks that let you 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.
Mill/Router/Lathe postlocks:
n plin_end$ (Gcode 0 or 1 termination)
n pcir_end$ (Gcode 2 or 3 termination)
n pmx_end$ (Gcode 11 termination)
n pdrl_end$ (Gcode 81 or 100 termination)
n pthd_end$ (Gcode 201 termination)
n psof_end$ (Gcode 1001 termination or tlchng_aft$ completion)
n ptlchg0_end$ (Gcode 1000 termination or tlchng_aft$ completion)
n ptlchg_end$ (Gcode 1002 termination or tlchng_aft$ completion)
Wire postblocks:
n plin_end$ (Gcode 0, 1, 30 or 31 termination)
n pcir_end$ (Gcode 2, 3, 32, 33 termination)
n pedm_end$ (Gcode 11 termination)
n pcan_end$ (Gcode 81 or 100 termination)
n plow_uv_end$ (Gcode 20, 21, 22, 23 termination—direct lower wire read)
n psof_end$ (Gcode 1001 termination or tlchng_aft$ completion)
n ptlchg0_end$ (Gcode 1000 termination or tlchng_aft$ completion)
n ptlchg_end$ (Gcode 1002 termination or tlchng_aft$ completion)
refht$
M L R MT
n 3-axis drill: Absolute position of the Z location of the reference
height.
n 5-axis drill: Incremental distance from the selected drill point to reference height.
See also drl_sel_ref$.
reg1$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg10$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg2$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg3$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg4$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg5$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg6$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg7$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg8$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
reg9$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.
retr$
M L R MT
Typically, this is used for the chip break retract (incremental distance). The
text of the label is defined in your post text and can be different for each
drill cycle. Regardless of which cycle is selected or the displayed label, It is always the value of
the fourth drill cycle parameter.
rev5$
M L R MT
[future use]
reva$
M L R MT
[not currently used]
revb$
M L R MT
[not currently used]
revc$
M L R MT
[not currently used]
rev_drl5$
M L R MT
Reverses the drill direction from the UVW point to the XYZ point.
rhtilt$
M L R MT
OBSOLETE: Side tilt; tilt perpendicular to the cut direction.
rotary_axis$
M L R MT
The rotary axis orientation in terms of the current tool plane.
Possible values
0 None
rotary_type$
M L R MT
The type of rotary selection made in the Rotary Axis dialog box. The exact
interpretation of the value depends on the machine type.
For mill machines:
Possible values
0 None
1 Axis substitution
rotary_vecx$
M L R MT
The X coordinate of the rotary axis rotation vector in terms of the current
tool plane. Available when the Rotary Axis dialog has been set. See also
rotary_vecy$ and rotary_vecz$.
rotary_vecy$
M L R MT
The Y coordinate of the rotary axis rotation vector in terms of the current
tool plane. Available when the Rotary Axis dialog has been set. See also
rotary_vecx$ and rotary_vecz$.
rotary_vecz$
M L R MT
The Z coordinate of the rotary axis rotation vector in terms of the current
tool plane. Available when the Rotary Axis dialog has been set. See also
rotary_vecy$ and rotary_vecx$.
rotaxis$
M L R MT
Axis substitution/polar conversion flag.
Possible values
0 None
rotaxis1$
M L R MT
The variable used to configure the primary rotary axis zero point. Used with
rotdir1$ to establish the primary rotary axis.
n In posts written before Mastercam 2017, this is initialized in the post to one of 6 vector
values: vecx, -vecx, vecy, -vecy, vecz, or -vecz. The rotary axis is always
perpendicular to the two vectors used.
n Beginning with Mastercam 2017, MP can set this automatically from the machine
definition. Read the section below to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Predefined variables, postblocks, and functions: page 1045
rotaxis2$
M L R MT
The variable used to configure the secondary rotary axis zero point. Used
with rotdir2$ to establish the secondary rotary axis.
n In posts written before Mastercam 2017, this is initialized in the post to one of 6 vector
values: vecx, -vecx, vecy, -vecy, vecz, or -vecz. The rotary axis is always
perpendicular to the two vectors used.
n Beginning with Mastercam 2017, MP can set this automatically from the machine
definition. Read the section below to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Predefined variables, postblocks, and functions: page 1047
rotaxis_dir$
M L R MT
Direction of rotary axis. Available when the Rotary Axis dialog has been set.
Possible values
0 CW
1 CCW
Predefined variables, postblocks, and functions: page 1049
rotaxtyp$
M L R W MT
Sets the rotary axis procedure to be used by MP. Determines the 4/5 axis
type and the base toolplane rotation method. Normal values are –3 to
+5; other values are supported.
Single-axis rotation types require that subsequent tool plane matrix (views) maintain the
original matrix rotation vector. For example, if rotation is about the X axis of the original
matrix and the X axis vector is positive, the subsequent tool plane matrix must maintain the X
axis vector in the positive direction. A reversal of the vector generates an error and incorrect
coordinates.
See related variables a$, c$.
Possible values
–3 Single-axis rotation. Set the reference tool plane matrix to the side view for c$
angle equal to 0. Rotation is about the Z axis of the WCS. c$ is returned in the
range 0 to 360 degrees, CCW positive.
–2 Single-axis rotation. Set the reference tool plane matrix to the front view for c$
angle equal to 0. Rotation is about the Z axis of the WCS. c$ is returned in the
range 0 to 360 degrees, CCW positive.
–1 Single-axis rotation. Set the reference tool plane matrix to the top view for c$ angle
equal to 0. Rotation is about the X or Y axis of the WCS. c$ is returned in the range
0 to 360 degrees, CW positive about X and CCW positive about Y.
0 Single-axis rotation. Set the reference tool plane matrix to the first operation view
in the NCI file for c$ angle equal to 0. Rotation is about the X, Y or Z axis of the
WCS. c$ is returned in the range 0 to 360 degrees, CW positive about X and CCW
positive about Y and Z.
1 Single-axis rotation. Set the reference tool plane matrix to the top view for c$ angle
equal to 0. Rotation is about the X or Y axis of the WCS. c$ is returned in the range
0 to 360 degrees, CW positive about X and CCW positive about Y. This is identical
to the –1 setting.
3 Mill/Turn applications. Resolve a$ and c$ angles when rotated about the X axis.
n Cross: The base view must be view 3 for c$ angle equal to 0. c$ is returned in
the range 0 to 360 degrees, CCW positive. a$ is returned as 0.
n Face: The base view must be view 5 for c$ angle equal to 0. c$ is returned in
the range 0 to 360 degrees, CCW positive. a$ is returned as 90.
n Back: The base view must be view 6 for c$ angle equal to 0. c$ is returned in
the range 0 to 360 degrees, CCW positive. a$ is returned as –90.
4 5-axis rotation, intended for rotary motion in the head. Tool plane positioning:
Support in the post by calls to the postblock pmx0$ on every motion postblock call.
The post writer is responsible for all rotary calculations and position mapping.
5 Shut off rotation. No mapping or angle calculations are performed for tool plane
positioning.
Greater than 6 5-axis rotation, intended to allow rotary support in the post by calls to
the postblock pmx0$ on every motion postblock call from prapid$ to pg32e$.
n Calls for the output postblocks are limited to those normally called with 2D
and 3D contour motion.
n The post writer is responsible for all rotary calculations and position
mapping.
n Note: rotaxtyp$ should be set to a large value (for example, 9999) to allow
future expansion of this variable by CNC Software, Inc.
rotdia$
M L R MT
Current rotary axis diameter set in Mastercam for axis substitution.
rotdir1$
M L R MT
The variable used to identify the positive rotation direction for the primary
rotary axis. This is used with rotaxis1$ to establish the primary rotary axis.
n In posts written before Mastercam 2017, this is initialized in the post to one of 6 vector
values: vecx, -vecx, vecy, -vecy, vecz, or -vecz. The rotary axis is always
perpendicular to the two vectors used. The positive rotary direction is established by
rotating the rotaxis1$ vector towards the rotdir1$ vector.
n Beginning with Mastercam 2017, MP can set this automatically from the machine
definition. Read the section below to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
rotdir2$
M L R MT
The variable used to identify the positive rotation direction for the
secondary rotary axis. This is used with rotaxis2$ to establish the secondary
rotary axis.
n In posts written before Mastercam 2017, this is initialized in the post to one of 6 vector
values: vecx, -vecx, vecy, -vecy, vecz, or -vecz. The rotary axis is always
perpendicular to the two vectors used. The positive rotary direction is established by
rotating the rotaxis2$ vector towards the rotdir2$ vector.
n Beginning with Mastercam 2017, MP can set this automatically from the machine
definition. Read the section below to learn more.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
rotfeed4$
M L R MT
Use rotfeed4$ and rotfeed5$ to determine units for 4-axis and 5-axis rotary
feedrates.
These variables are set in the control definition as shown below:
Possible values
rotfeed5$
M L R MT
Use rotfeed4$ and rotfeed5$ to determine units for 4-axis and 5-axis rotary
feedrates.
These variables are set in the control definition as shown below:
Possible values
round_opt$
M L R W MT
'License-plate' value whose digits configure how values are rounded
during MP processing.
rpd_hght$
W
Wire upper head rapid height.
rpd_typ$
L MT
Lathe contour flag. This variable is extracted from the contour flag variable cur_
cflg$.
Possible values
7 Pause for automatic tool inspection (introduced in X2). This is the only value for
this variable that applies to Mill/Router toolpaths; the other values apply to Lathe
only.
rpd_typ_v7$
M L R W MT
Enables the conversion of NCI data and MP routine variations to
emulate Version 7 posting. This switch was added before Mastercam X
to provide backward compatibility with older posts. There is typically no reason to not have it
set to 0 in modern posts.
Possible values
rtnrefht$
M L R MT
Specifies which value to use for the ending Z position after the last drill
position when canceling a canned drill cycle.
The canned drill cycle output must be enabled (that is, the appropriate usecan$… variable is
set to 1).
Note that the standard posts supplied by CNC Software do not read this variable and use other
logic to calculate the return height.
Possible values
0 Use the initial height initht$ value as the cycle return position.
1 Use the reference height refht$ value as the cycle return position.
r_svec$
M L R MT
Surface normal vector (p_svec$, q_svec$, r_svec$). These are used for 3-axis
cutter compensation. They are the surface normal at the current tool
position with NCI Gcode 11 data.
sa$
M L R W MT
Start angle (in degrees) of the current arc.
scalex$
M L R W MT
Scaling factors for x$. The scaling factors are also applied to xnci$, i$,
xr$, xh$, arcrad$, u$, wx$, threadx$, and startx$ where applicable.
n It is not recommended to use scaling in Mill, Router, or Lathe posts.
n It is generally safe to use scaling in Wire posts.
Note! MP ignores these scaling factors when fastmode$ is set to 1.
Any value may be used. If 0 is used, it is converted to 1 when the post is parsed.
scaley$
M L R W MT
Scaling factors for y$. The scaling factors are also applied toynci$, j$, yr$,
yh$, arcrad$, v$, wy$, thready$, and starty$, where applicable.
n It is not recommended to use scaling in Mill, Router, or Lathe posts.
n It is generally safe to use scaling in Wire posts.
Note! MP ignores these scaling factors when fastmode$ is set to 1.
Any value may be used. If 0 is used, it is converted to 1 when the post is parsed.
scalez$
M L R W MT
Scaling factors for z$. The scaling factors are also applied to znci$, k$,
zr$, zh$, arcrad$, w$, wz$, threadz$, and startz$ where applicable.
n It is not recommended to use scaling in Mill, Router, or Lathe posts.
n It is generally safe to use scaling in Wire posts.
Note! MP ignores these scaling factors when fastmode$ is set to 1.
Any value may be used. If 0 is used, it is converted to 1 when the post is parsed.
sec_inthi$
M L R MT
The maximum intersection angle for the secondary rotary axis. This is
usually greater than zero. MP uses this to trigger a reposition or unwind
move in the secondary rotary axis. This is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
sec_intlo$
M L R MT
The minimum intersection angle for the secondary rotary axis. This is
usually negative or zero. MP uses this to trigger a reposition or unwind
move in the secondary rotary axis. This is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
sec_limhi$
M L R MT
Positive axis travel limit for the secondary rotary axis. This is typically used
in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
sec_limlo$
M L R MT
Negative rotary axis travel limit for the secondary rotary axis. This is
typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).
sec_limtyp$
M L R MT
Used to set the basic angle range for the secondary rotary axis in a multiaxis
post. This is typically used in multiaxis posts.
n In posts written before Mastercam 2017, this variable was typically initialized and set in
the post. Posts supplied by CNC Software typically link this to a user-defined variable
called auto_set_lim (automatically set limits) such that it is only used when auto_
set_lim is disabled.
n In Mastercam 2017, post writers have the option to have MP automatically set it from
the machine definition as described below. When this is done, the auto_set_lim
switch should be removed.
To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.
Possible values
1 Equal or greater than 180 degrees and less than 360 degrees
Predefined variables, postblocks, and functions: page 1077
auto_set_lim : 0
pri_limtyp$ : 2
sec_limtyp$ : 2
Predefined variables, postblocks, and functions: page 1078
seqinc$
M L R W MT
Sequence number increment. This is set in the control definition (NC
Output page) and also output in the NCI tool change line.
See also n$, seqno$, and seqmax$.
seqmax$
M L R W MT
Sets the maximum sequence number allowed by the post processor. Set
in the control definition: NC Output page. Mastercam will reset to the
starting sequence number seqno$ if the seqmax$ value is exceeded. For example, if seqmax$ =
100 and seqinc$ = 1, then n$ = 97, 98, 99, 100, 1, 2, etc.
See also n$, seqinc$, and seqno$.
seqno$
M L R W MT
Starting sequence number. This is set in the control definition (NC
Output page) and also output in the NCI tool change line.
See also n$, seqinc$, and seqmax$.
shftdrl$
M L R MT
Typically, this is used for the boring bar clearance shift amount
(incremental distance). The text of the label is defined in your post text and
can be different for each drill cycle. Regardless of which cycle is selected or the displayed
label, It is always the value of the sixth drill cycle parameter.
sim_no$
M L R W MT
Holds the serial number of the HASP (SIM). Beginning with Mastercam
2017, this will also store the license number if the user's system is using
software licensing instead of a HASP.
sim_type$
M L R W MT
Tells you what type of SIM (HASP) the user is running.
Note that from MP’s perspective, all of the educational SIM types—1, 4,
and 5—are treated the same. Also note that “control” SIMs (type 3) are obsolete.
Possible values
–1 undefined user
0 industrial
1 educational
2 dealer
3 control (obsolete)
4 educational (OEM)
5 educational (new)
skimpass$
W
Skim cut setting for multiple contour passes.
Possible values
0 No skimcut
skipmotest$
M L R W MT
Controls the postblock call of a linear move that contains the same
coordinate data as the previous motion.
If the previous X, Y, and Z coordinates are identical to the current X, Y, and Z coordinates
(formatted values), the line contains no motion. This option is rarely used in modern posts.
Possible values
skp_lead_flgs$
M L R W MT
Controls the handling of the 200/2000 and 300/3000 contour flags. This is
only relevant for old (pre–Mastercam X) posts. For all posts since, this
should be set to 0 and left alone.
If you need to support a V9 or earlier post, the way MP processed these flags changed with MP
Version 9.1.
skp_lead_flgs : 1 indicates that the Version 9.1-style leads (2000s and 200s, 3000s and
300s) for cstart$ and cend$ should be converted to Version 9.0 and earlier style. The Version
9.1-style flags cstart$ and cend$ have more possible values. Pre-Version 9) posts that check the
cstart$ and/or cend$ settings may become confused if you do not have skp_lead_flgs$ : 1
declared in the PST file.
This is especially true for many WIRE post processors!
One method to check to see if your post processor needs this setting is to look for this
declaration in the PST file:
rpd_typ_v7$ : 1 #Use Version 7 style contour flags?
Possible values
so$
M L R W MT
Start octant of the current arc.
The octant numbers on a quadrant line are assigned for arcs having
endpoints that fall within the mtol$ tolerance of the matching quadrant.
Possible values
spaces$
M L R W MT
The number of spaces inserted before an output variable (specifically,
before the prefix that gets added to the variable when it is output).
spdir$
M L R MT
Spindle direction.
Possible values
0 Off
1 CW
–1 CCW
spindle_no$
M L R MT
Which spindle is being used.
Possible values
1 Right (subspindle)
ss$
M L R MT
Spindle speed.
This is a signed value (positive value = forward tool rotation, negative value
= reverse tool rotation). Use absolute value with spdir$.
Possible values
0 Stop spindle
ss_underflow$
M L R W MT
Allows the string select variable to be a value less than zero.
If the ss_underflow$ switch is not active, and the string selector variable
is less than zero, MP will halt with an error.
Introduced with Version 9.10 of the MP DLLs.
Possible values
1 Active
startx$
W
X start position of the wirepath.
The startx$, starty$, and startz$ variables were formerly called xh$, yh$, and
zh$ in old Wire post processors. The values are copied to those variables for backward
compatibility.
See related variables threadx$, thready$, cutx$, and cuty$.
starty$
W
Y start position of the wirepath.
The startx$, starty$, and startz$ variables were formerly called xh$, yh$, and
zh$ in old Wire post processors. The values are copied to those variables for backward
compatibility.
See related variables threadx$, thready$, cutx$, and cuty$.
startz$
W
Z start position of the wirepath.
The startx$, starty$, and startz$ variables were formerly called xh$, yh$, and
zh$ in old Wire post processors. The values are copied to those variables for backward
compatibility.
See related variables threadx$, thready$, cutx$, and cuty$.
stck_adv_fr$
L MT
Stock advance feed rate for stock push/pull operation.
stck_appr_fr$
L MT
Stock approach feed rate for stock push/pull operation.
stck_chuk_end_dx$
L MT
Destination chuck X axis reference position after transfer
stck_chuk_end_dz$
L MT
Destination chuck Z axis reference position after transfer.
stck_chuk_end_x$
L MT
Final X axis chuck position
stck_chuk_end_z$
L MT
Final Z axis chuck position
stck_chuk_st_dx$
L MT
Destination chuck X axis reference position before transfer.
stck_chuk_st_dz$
L MT
Destination chuck Z axis reference position before transfer.
stck_chuk_st_x$
L MT
Initial X axis chuck position
stck_chuk_st_z$
L MT
Initial Z axis chuck position
stck_clear$
L MT
Stock clearance value for stock pull operation.
stck_crnr$
M L R W MT
Stock origin corner.This is selected on the Stock setup tab in the
Machine Group Properties.
Possible values
stck_final_z$
L MT
Final Z position of the stock
stck_grip$
L MT
Grip length value for stock pull operation.
stck_ht$
M L R W MT
The X-axis component of the stock dimensions. This is entered on the
Stock setup tab in the Machine Group Properties.
For Lathe, this is the length of stock along the Z axis, as entered in the Position along axis
field on the Geometry tab for a cylinder stock component.
See also stck_wdth$ and stck_thck$.
Predefined variables, postblocks, and functions: page 1112
stck_init_z$
L MT
Initial Z position of the stock
stck_op$
L MT
Stock advance operation method. See stck_clear$ and stck_grip$.
Possible values
0 Push stock.
2 Pull stock.
stck_spindle$
L MT
Active spindle with stock to transfer.
Possible values
stck_thck$
M L R W MT
The Z-axis component of the stock dimensions. This is entered on the
Stock setup tab in the Machine Group Properties.
stck_tool_x$
L MT
Tool X axis position for bar stop/puller.
stck_wdth$
M L R W MT
The Y-axis component of the stock dimensions. This is entered on the
Stock setup tab in the Machine Group Properties.
For Lathe, this is the maximum diameter of stock. This value is written out to both stck_
wdth$ and stck_thck$.
stck_x$
M L R W MT
Coordinates of the stock origin. These are entered on the Stock setup tab
in the Machine Group Properties.
See also stck_crnr$. For Lathe, the center of stock along Z axis is held in stck_x$ and all other
values are 0.
stck_y$
M L R W MT
Coordinates of the stock origin. These are entered on the Stock setup tab
in the Machine Group Properties.
See also stck_crnr$. For Lathe, the center of stock along Z axis is held in stck_x$ and all other
values are 0.
stck_z$
M L R W MT
Coordinates of the stock origin. These are entered on the Stock setup tab
in the Machine Group Properties.
See also stck_crnr$. For Lathe, the center of stock along Z axis is held in stck_x$ and all other
values are 0.
stock_leave$
W
This is the stock to leave amount entered in Mastercam Wire. This is read from the
NCI 20200 line when listrad$ is set to 2.
streamno$
M L R W MT
[not currently used]
strselstop$
M L R W MT
Enables automatic spindle stop on reversal
strtool_v7$
M L R W MT
Controls how and where the tool name string is read.
The numeric variable strtool_v7$ was introduced in Mastercam V7. It is
used to capture the description from the tool definition to replace the tool name that is output
in the NCI Gcode 1013 line. The tool name is replaced if strtool_v7$ is set. The string is copied
into the predefined string variables strtool$, strtoolpath$ and strtoolext$.
Possible values
0 Read the tool name from the NCI Gcode 1013 line.
1 Read the tool name from the NCI Gcode 20001 line. Split the name into path
components
2 Read the tool name from the NCI Gcode 20001 line. Split the name into path
components but keep strtool$ as the string that was read.
st_str_ix$
M L R W MT
Holds the index of the starting match in a string variable for the scan
function. Note that while this variable is also active when using the strstr
function, it typically is not useful, since it simply equals the return value from the function
itself.
Beginning with Mastercam 2017, this functionality has been extended to the following
parameter read functions:
n rpar
n rparsngl
n rparsprm
See end_str_ix$ to find the end index.
subfile$
M L R W MT
Controls use/creation of nested subprogram files.
With nested subprograms, it is possible to have an unknown number of
nested subprogram levels. Each nested level (tracked with sub_level$) must open a file to write
the NC output to. Analogous to subprg$ = 1 or 2.
Possible values
0 Disabled.
subno$
W
Subprogram number
subout$
M L R W MT
Determines which file output will be written to. Use this to create one or
more alternate streams of NC data that you can write out to different
files or merge together.
Possible values
if not(omitseq$),
[
n$ = seqno$
#set file paths, names and extensions for buffer, aux and NC
sauxfile = spathnc$ + snamenc$ + sextaux$
sbufname2$ = spathnc$ + snamenc$ + sextnc$
sncfile = spathnc$ + snamenc$ + sextnc$
Predefined variables, postblocks, and functions: page 1135
subprg$
M L R W MT
Use this variable to open the .SUB alternate output file. NC output will
be directed to the SUB file when it has been opened with subprg$ and
the subout$ variable is set to 1.
Opening output files
MP supports four different alternate files or NC output streams. Each different output file is
associated with a different command variable. Alternate output files must be recognized as a
valid stream before they can be opened and accessed with the subout$ variable. The file is
actually opened on the first attempt to output to the file.
subout$
Command variable File to be opened
value
Set subout$ to the proper value to send output to the desired file once it has been opened.
See related variables mergesub$, newsub$ and clearsub$.
You can set subprg$ to the appropriate value either by initializing it:
subprg$ : 1 # Allow access to sub file (open and clear it)
Possible values
1 Open the file. If the file already exists, delete all existing contents.
2 Open the file. If the file already exists, append to existing contents.
Predefined variables, postblocks, and functions: page 1137
subtyp$
M L R W MT
Specifies the subprogram type.
Possible values
sub_chn_no$
For non-transform operations, this is the chain number. It is not used for M L R MT
transform operations.
See also esub_chn_no$.
sub_grp_id$
M L R MT
Actual operation ID
sub_inc$
M L R MT
Subprogram absolute or incremental flag. This sets the value of absinc$.
Possible values
0 Absolute
1 Incremental
sub_level$
M L R W MT
This serves two different functions, depending on what processing
routine your post is currently in.
n While the NCI file is being processed, sub_level$ indicate the current subprogram level.
n While the NC code is being created, sub_level$ indicates how automatic subprograms
will be created or implemented.
Usage is different for mill-turn posts, as noted in the values below.
Possible values
–1 Temporarily disable the automatic subprogram level call. This must be done in the
postblocks psub_call_m$, psub_call_mm$, or psub_call_s$.
0 Disable automatic alternate file output control. The subprogram postblocks and
routines are called.
1 Output the top calling level (NC level) to be written to the NC file, subout$ = 0.
2 Output the top calling level (NC level) to be written to the alternate file (AUX
file), subout$ = 3. This allows merging the files with subprograms before the top
level NC code.
0 Subprograms off
4 Embedded-style subprograms
0 Top-level output
sub_m1$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m2$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m3$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m4$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m5$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m6$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m7$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m8$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_m9$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
sub_mny_t$
M L R MT
Indicates if the transform subprogram contains more than one tool.
Possible values
sub_nst_flg$
M L R MT
Subprogram nesting code: output with 1018 line. For internal use only.
sub_nxt_h$
M L R MT
First head number in the transform group.
sub_nxt_t$
M L R MT
First tool in the transform group.
sub_nxt_tid$
M L R MT
[not currently used]
sub_op_id$
M L R MT
Indicates the subprogram number. This is a unique subprogram ID that is
used to produce the subprogram number.
n In transform subprograms, this value is written to the main_prg_no$ for output at the
transform level.
n In non-transform subprograms, this value is written to the sub_prg_no$ for output at the
non-transform level.
The sub_op_id$ is numbered independently for transform and non-transform subprograms. In
most cases, these are sequentially assigned values for each new pattern. Repeated patterns then
reuse the value assigned to the original pattern.
Note the following exceptions and special cases regarding subprogram IDs.
Drill (non-transform)
Any point where a drill cycle definition (G81) is cancelled or assigned a new subprogram ID is
assigned and a new unique subprogram is created. This occurs with jump heights.
Absolute subprograms (non-transform)
Absolute subprograms are problematic because the repeat tool motion has to reset the
machine coordinates relative to any XY pattern shift. New subprogram IDs are assigned to
patterns even if they are repeating to simplify processing the NCI when no machine coordinate
shift occurs.
Non-transform subprograms that are not nested
Depth cuts and drill patterns work as absolute or incremental because there is currently no XY
pattern shift.
Transform subprograms
Transform subprograms and transform subprograms with nested non-transform subprograms
present many special cases. The subprogram numbering is influenced by the operation being
performed (translate, rotate, mirror), work origin shifts, and the absolute incremental setting.
In any case where it is determined that the subprogram cannot be repeated, a new subprogram
with a unique ID will be created.
See also esub_op_id$.
sub_org_chn_no$
M L R MT
Non-transform: Unique number for new chain/chain shift.
Transform: iteration of transform.
This the same as sub_chn_no$ but is used for nested transform subprograms. It is used to
provide access to the 1018 Gcode information for the prior nested level. This feature is not
fully supported at this time and should not be used.
sub_org_grp_id$
M L R MT
Operation ID as seen in the Operations Manager (the transform operation
ID when a Transform subprogram).
This the same as sub_grp_id$ but is used for nested transform subprograms. It is used to provide
access to the 1018 Gcode information for the prior nested level. This feature is not fully
supported at this time and should not be used.
sub_org_inc$
M L R MT
Absolute or incremental flag for subprograms.
This the same as sub_inc$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m1$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m2$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m3$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m4$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m5$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m6$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m7$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m8$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_m9$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.
This the same as sub_m1$ through sub_m9$ but is used for nested transform subprograms. It is
used to provide access to the 1018 Gcode information for the prior nested level. This feature is
not fully supported at this time and should not be used.
sub_org_mny_t$
M L R MT
Transform subprogram contains more than one tool.
This the same as sub_mny_t$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested level. This feature
is not fully supported at this time and should not be used.
sub_org_nst_flg$
M L R MT
This the same as sub_nst_flg$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_nxt_h$
M L R MT
First head number in the transform group.
This the same as sub_nxt_h$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested level. This feature
is not fully supported at this time and should not be used.
sub_org_nxt_t$
M L R MT
Subprogram first tool in the transform group.
sub_org_nxt_tid$
M L R MT
First tool ID in the transform group.
This the same as sub_nxt_tid$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested level. This feature
is not fully supported at this time and should not be used.
sub_org_op_id$
M L R MT
This the same as sub_op_id$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_ref_id$
M L R MT
This the same as sub_ref_id$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_sec_no$
M L R MT
This the same as sub_sec_no$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_totl_no$
M L R MT
This the same as sub_totl_no$ but is used for nested transform subprograms.
It is used to provide access to the 1018 Gcode information for the prior
nested level. This feature is not fully supported at this time and should not be used.
sub_org_trnmthd$
M L R MT
This the same as sub_trnmthd$ but is used for nested transform subprograms.
It is used to provide access to the 1018 Gcode information for the prior
nested level. This feature is not fully supported at this time and should not be used.
sub_org_trnstyp$
M L R MT
This the same as sub_trnstyp$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_trnsx$
M L R MT
This the same as sub_trnsx$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_trnsy$
M L R MT
This the same as sub_trnsy$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_trnsz$
M L R MT
This the same as sub_trnsz$ but is used for nested transform subprograms. It
is used to provide access to the 1018 Gcode information for the prior nested
level. This feature is not fully supported at this time and should not be used.
sub_org_trns_id$
M L R MT
[not currently used]
sub_prg_no$
M L R W MT
Non-transform subprogram number.
The value in sub_op_id$ is written to sub_prg_no$ if sub_ref_id$ is 0 or less.
See sub_op_id$, sub_ref_id$, main_prg_no$ for more information.
sub_prg_seq_end$
M L R W MT
[future use]
sub_prg_seq_st$
M L R W MT
[future use]
sub_rd_level$
M L R W MT
Current internal subprogram nested level.
Possible values
-1 Non-transform subprogram
Greater than 0 Current internal nested subprogram level. Output is buffered at tool
changes, use sub_level$ to get the current output level.
sub_ref_id$
M L R MT
Subprogram reference ID. If the current subprogram is a transform
operation, this value is read from the first parameter of the 1018 line.
Otherwise, it is 0.
See also esub_ref_id$.
Possible values
0 Non-transform
>0 Transform
sub_sec_no$
M L R MT
For non-transform subprograms, the flag indicates the current iteration of
the subprogram pattern. The numbering is from base 1 with non-transform
subprograms. The subprogram code is output when the value is 1 (which indicates the first
iteration). The values are negative if the patterns are copies nested in a transform toolpath, to
prevent output of the copies.
For transform subprograms, the flag indicates the current iteration of the transformed
toolpath. The numbering is from base 0. The subprogram code is output when the value is 0.
The subprogram iterator is used to determine what type of output is to occur.
n At transform level, parameter 4 (sub_sec_no$) is checked to see if it is zero. A value of 0
indicates that the NC code for the actual subprogram is generated and written along
with a call to the subprogram. Any other value only produces a call to the subprogram.
n At non-transform level, parameter 4 (sub_sec_no$) is checked to see if it is 1. A value of
1 indicates that the NC code for the subprogram is generated and written along with a
call to the subprogram. Any other value only produces a call to the subprogram.
This controls the output of the original subprogram.
n Transform subprograms write the original when 0 is assigned
n Non-transform subprograms write the original when 1 is assigned. This condition should
occur only once for any defined subprogram pattern. If it occurs more than once, the
post outputs duplicates of the same subprogram, which is an error.
Therefore, non-transform subprograms nested in transform subprograms must have the non-
transform subprogram iterator (sub_sec_no$) signed negative in transform patterns where they
are copies.
Note: Be aware that the original non-transform subprograms may be outside the first transform
operation so the original transform may contain a copy. This design allows hiding the non-
transform subs without losing the iteration number.
See also esub_sec_no$.
sub_seq_typ$
M L R W MT
Sequence number control for subprograms.
Possible values
sub_totl_no$
M L R MT
The total number of instances. This is the subprogram total count and is
used to track the cumulative number of repeated patterns.
In transform, subprograms track the cumulative number of repeated patterns relative to each
transform referencing the original operation. The original operation has parameter 5 assigned
the cumulative count of the first referenced transform. This allows the user to find the end of
the current transform when multiple transforms were assigned.
In non-transform, subprograms track the number of repeated patterns relative to the current
operation. The total does not increase when copied into transform subprograms.
See also esub_totl_no$.
sub_trnmthd$
M L R MT
Transform method for transform subprograms. The interpretation of its
value is relative to the value of sub_trnstyp$ as described below.
Possible values
when sub_trnstyp$ = 0 (mirror):
0 X-axis
1 Y-axis
2 entity
0 Tplane
2 coordinates
0 Tplane
2 coordinates
sub_trnstyp$
M L R MT
Indicates the type of transform for a transform subprogram. See also helper
variables sub_trnsx$, sub_trnsy$, and sub_trnsz$.
Possible values
0 Mirror
1 Rotate
3 Translate
sub_trnsx$
This is a helper variable for sub_trnstyp$. It provides information about the M L R MT
transform origin; the exact meaning depends on which type of transform is
indicated by sub_trnstyp$.
Possible values
sub_trnsy$
M L R MT
This is a helper variable for sub_trnstyp$. It provides information about the
transform origin; the exact meaning depends on which type of transform is
indicated by sub_trnstyp$.
Possible values
sub_trnsz$
M L R MT
This is a helper variable for sub_trnstyp$. It provides information about the
transform origin; the exact meaning depends on which type of transform is
indicated by sub_trnstyp$.
Possible values
sub_trns_id$
M L R MT
[not currently used]
surrogate$
M L R W MT
Skips reading the NCI file. When surrogate$ is set to 1, MP will run
pprep$ and ppost$ but no other postblocks, and it will not process any
NCI data. For example, it is used with the post file generated with the Runold C-Hook to
launch a post from within a post.
Possible values
sweep$
M L R W MT
Sweep angle in degrees of the current arc, measured from the start angle
to the end angle in the direction of motion.
See related variables do_full_arc$ and breakarcs$.
Possible values
positive CCW
negative CW
syncaxis$
M L R MT
Numeric entity ID of the axis combination. Output with NCI 950.
syncbfor$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.
synclath$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.
syncmode$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.
syncmodebfor$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.
syncop_id$
M L R MT
Code for operation ID. This has the same value as the op_id$. It is output
here on the 999 line so you can access the op_id$ value before the 1016 line
is written,
syncstream$
M L R MT
Stream ID; output with NCI 950 and NCI 999.
synctool_op$
M L R MT
Code for specific operation type. This has the same value as the tool_op$. It
is output here on the 999 line so you can access the tool_op$ value before
the 1016 line is written.
t$
M L R W MT
Tool number.
Use of this numeric variable in Wire is not recommended.It has been
superseded by the numeric variable pass$.
t1$
M L R W MT
Relative position of intersections for 2D intersection postline functions.
t1$ provides the position along the first intersecting element; t2$
provides the position along the second.
If a second intersection exists, t1$ and t2$ represent the first intersection, and prv_t1$ and
prv_t2$ represent the second intersection.
Beginning with Mastercam 2017, t1$ is also used as a helper variable by the opinfo function;
see opinfo to learn more.
Possible values
Less than 0 or greater than 1 Projected intersection, that is, not actually on the
element. Relative to the original element's length, the first endpoint being 0.
-9999 No intersection
t2$
M L R W MT
Relative position of intersections for 2D intersection postline functions.
t1$ provides the position along the first intersecting element; t2$
provides the position along the second.
If a second intersection exists, t1$and t2$ represent the first intersection, and prv_t1$ and prv_
t2$ represent the second intersection.
Possible values
Less than 0 or greater than 1 Projected intersection, that is, not actually on the
element. Relative to the original element's length, the first endpoint being 0.
-9999 No intersection
tabcut$
W
Tab cut type for the current wirepath.
Possible values
tank$
W
Tank fill/empty flag.
This variable is set both within the NCI tool change block and extracted from the
contour flag variable cur_cflg$.
See related power$, water$, and wire$.
Possible values
0 Empty
1 Fill
tap_pitch$
M L R MT
For tapping tools, this is the pitch of the thread on the tap (distance
between threads). This is output in either inches/thread, or mm/thread.
If you use an inch tap in a metric part, the pitch is automatically scaled to mm, and vice versa.
In other words, if the tap is 40 threads/inch, the value in the NCI file will be 0.025 for an inch
part, and 0.635 when used in a metric part.
This variable was introduced in Mastercam X8. Posts from earlier versions of Mastercam relied
on n_tap_thds$, which required logic in your post to properly handle both inch and metric
cases. In these cases, using tap_pitch$ can simplify your post because it is already output in the
proper units.
tcr$
M L R W MT
Tool corner radius. (In Wire, the wire radius.)
td_ct_flg$
W
OBSOLETE. Thread/cut flag; output on 1015 line.
thda1$
L MT
Thread V profile, front angle.
Use of this variable is not recommended. It has been superseded by the numeric
variable thdangle$. This is used in MP to calculate for volume of cut.
thda2$
L MT
Thread V profile, rear angle (in radians). This is used in MP to calculate for
volume of cut.
See related thdangle$.
thdangle$
L MT
Thread infeed angle.
thddepth$
L MT
Thread depth of the current thread pass.
thdequcut$
L MT
Use equal depth thread cuts.
Possible values
0 Off
1 On
thdface$
L MT
Indicates a face thread.
Possible values
0 No
1 Yes
thdfinish$
L MT
Finish allowance amount for the current thread.
thdfirst$
L MT
Amount of the first cut of the thread.
thdflat$
L MT
The flat on the standard V thread profile.The calculation for thdflat$ can be
changed in the postblocks pthdext$ and pthdint$. The default settings are:
n Internal - thdlead$ multiplied by 0.08333
n External - thdlead$ multiplied by 0.16667
thdlast$
L MT
Amount of the last cut of the thread.
thdlead$
L MT
Thread lead for the current thread. This is always converted from lead to
units/thread.
This does not happen in the pre-read (preparatory) function.
thdlng$
L MT
Thread length of the current thread.Calculated as thdz1$ – thdz2$.
See related variable add_thdzclr$.
thdncuts$
L MT
Number of cuts to be performed during the current threading operation.
thdpass$
L MT
Current thread pass number. This is not calculated for canned threads (thdtype$
= 1).
thdpulloff$
L MT
Anticipated pull-off in Z for the current thread.
thdtaper$
L MT
Thread taper angle (in degrees).
thdtype$
L MT
Current thread type. See thdface$ for more information.
Possible values
thdx1$
L MT
X coordinate of the first endpoint of the geometry's vertical line.
thdx1$, thdx2$, and thdx3$ are the X-axis coordinates used to define the current
thread.
n thdx1$ = X coordinate of the first endpoint of the geometry’s vertical line.
n thdx2$ = X coordinate of the second endpoint of the geometry’s vertical line.
n thdx3$ = X coordinate of the second endpoint of the geometry’s horizontal line.
See related variables thdz1$, thdz2$.
thdx2$
L MT
X coordinate of the second endpoint of the geometry's vertical line.
thdx1$, thdx2$, and thdx3$ are the X-axis coordinates used to define the current
thread.
n thdx1$ = X coordinate of the first endpoint of the geometry’s vertical line.
n thdx2$ = X coordinate of the second endpoint of the geometry’s vertical line.
n thdx3$ = X coordinate of the second endpoint of the geometry’s horizontal line.
See related variables thdz1$, thdz2$.
thdx3$
L MT
X coordinate of the second endpoint of the geometry's horizontal line.
thdx1$, thdx2$, and thdx3$ are the X-axis coordinates used to define the current
thread.
n thdx1$ = X coordinate of the first endpoint of the geometry’s vertical line.
n thdx2$ = X coordinate of the second endpoint of the geometry’s vertical line.
n thdx3$ = X coordinate of the second endpoint of the geometry’s horizontal line.
See related variables thdz1$, thdz2$.
thdxclr$
L MT
Allows additional clearance over thread. See related variable thdzclr$.
thdz1$
L MT
Z coordinate of the first endpoint of the geometry's horizontal line.
thdz1$ and thdz2$ are the Z-axis coordinates used to define the current thread.
n thdz1$ = Z coordinate of the first endpoint of the geometry’s horizontal line.
n thdz2$ = Z coordinate of the second endpoint of the geometry’s horizontal line.
See related post switch variable add_thdzclr$.
thdz2$
L MT
Z coordinate of the second endpoint of the geometry's horizontal line.
thdz1$ and thdz2$ are the Z-axis coordinates used to define the current thread.
n thdz1$ = Z coordinate of the first endpoint of the geometry’s horizontal line.
n thdz2$ = Z coordinate of the second endpoint of the geometry’s horizontal line.
See related post switch variable add_thdzclr$.
thdzclr$
L MT
Stock clearance on the Z axis. See the related variables thdxclr$, add_thdzclr$.
thrd_cut$
W
Current wire status.
It is recommended to use thrd_cut$ as the numeric variable selector for a string
select function. This variable is extracted from the contour flag variable cur_cflg$.
Possible values
1 Wire is threaded.
2 Wire is cut.
threadx$
W
Wire thread X (rapid) position in the wirepath.
With the introduction of the wire thread cut flag thrd_cut$, the meaning of this
position as the thread position is lost. These variables were formerly called xr$, yr$, and zr$ in
old Wire post processors. The values are copied to those variables for backward compatibility.
See related variables startx$, starty$, startz$ and cutx$, cuty$.
thready$
W
Wire thread Y (rapid) position in the wirepath.
With the introduction of the wire thread cut flag thrd_cut$, the meaning of this
position as the thread position is lost. These variables were formerly called xr$, yr$, and zr$ in
old Wire post processors. The values are copied to those variables for backward compatibility.
See related variables startx$, starty$, startz$ and cutx$, cuty$.
threadz$
W
Wire thread Z (rapid) position in the wirepath.
With the introduction of the wire thread cut flag thrd_cut$, the meaning of this
position as the thread position is lost. These variables were formerly called xr$, yr$, and zr$ in
old Wire post processors. The values are copied to those variables for backward compatibility.
See related variables startx$, starty$, startz$ and cutx$, cuty$.
tilt$
M L R MT
OBSOLETE: Tilt angle along the cut direction.
time$
The current time from your system. You can use this value in either of M L R W MT
two ways:
n If no format is assigned to this variable, it will output the current system time in the
format HH:MM.
n If you do assign a format to it, the format will be applied to the numeric value HH.MMSS
(hours.minutes-seconds).
See related variables date$, day$, month$, year$, mon$.
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 1248
tlchng_aft$
M L R W MT
Allows MP to look two lines ahead of the tool change to discover the
first rapid move. This is almost always set to 1 in modern posts.
The tlchng_aft$ variable lets MP read the first move following the NCI tool change block as
part of a tool change. It was introduced to avoid skipping the feed rate and contour flags and
to establish the initial table angles with 4- and 5-axis toolpaths that are only available on the
first move following the NCI tool change block. The rapid position move is always repeated
after every NCI tool change block, making the tool change–after mechanism the desired
processing method.
It is highly recommended to enable tlchng_aft$ in all posts.
Possible values
0 Call the tool change postblocks on the NCI Gcode 1000, 1001, 1002 tool change.
(default)
1 Call the tool change postblock for null tool change on the NCI Gcode 1000 tool
change. Otherwise, delay the tool change call until the first motion is read.
2 Delay the tool change call until the first motion is read on all the NCI Gcode 1000,
1001, 1002 tool changes.
tldia$
M L R W MT
Tool diameter (in Wire, this is the wire diameter). See also tlrad$.
tlname$
M L R W MT
OBSOLETE: Command variable to output the tool name output. Use of
this variable is not recommended. It has been superseded by the string
variable strtool$.
tlngno$
M L R W MT
Tool length offset number entered in Mastercam.
tloffno$
M L R W MT
Tool diameter offset number set in Mastercam.
tlplnno$
M L R W MT
Tool plane number. Planes 1–7 are standard planes as noted below.
Higher numbers generally refer to a custom user-defined view. Right-
click on a view in the View Manager and select Info to find out what number is assigned to a
custom view:
Possible values
1 Top
2 Front
3 Back
4 Bottom
5 Right
6 Left
7 Isometric
tlrad$
M L R W MT
Tool radius (in Wire, this is the wire radius)
tlstck_on$
L MT
Retract or engage the tailstock
Possible values
tofs$
W
Return the number of the taper offset list matching the actual taper value.
The list is only called on the NCI Gcodes 0, 1, 2, 3 for 2D contours. The list must be
built internally in MP by setting bldnxtool$ to 1.
See listtpr$ for more information.
tooltable$
M L R W MT
Enables calls to the pwrtt$ (and, by extension, pwrttparam$) postblock for
tool table processing. When tooltable$ is greater than 0, these
postblocks are called during the NCI pre-read process for tool table processing. Typically
tooltable$ is initialized to either 1 or 3 as described below.
If tooltable$ is used as a command word at the start-of-file or later, you cannot initialize it
to a value; you must assign a value before the tooltable$ command as shown above.
When post processing returns from the tool table processing, it is important that you set the
value of the tooltable$ variable to –1 to signify that tool table processing has completed.
The automatic processing and command processing are not mutually exclusive. You can
choose to use both methods in your post.
1—Recall that setting tooltable$ = 3 (or tooltable$ : 3) enables an extra call to pwrtt$ at
the end-of-file NCI code 1003. Setting the 10’s digit to 1 modifies this so that the extra call to
pwrtt$ takes place at the physical end of file. This lets you access comments and other NCI
data that occurs after NCI 1003. For example:
tooltable$ = 13
Note that if the post has been enabled for probing, and probe data has been detected in the
post, this behavior is automatic. Note also that gcode$ will be forced to 1003 at the final call to
pwrtt$. This is to provide backward-compatibility with older posts.
2—When you call tooltable$ as a command word, the normal NCI read process has already
progressed to a certain point when the tooltable$ command is encountered. However,
when tool table processing finishes, MP attempts to restore the normal NCI processing at the
first operation (start-of-file). Setting the 10’s digit to 2 tells MP to read the NCI back to the
point where the tooltable$ command was encountered before resuming normal NCI
processing.
4—If tool table processing ends on the start-of-file and tlchng_aft$ is active, MP typically does
not continue reading the data to the motion line after the tool change. Setting the 10’s digit to
4 enables this behavior.
Notwithstanding options 2 or 4, if the tooltable$ command is encountered before the start-
of-file, when MP is restoring the read location in the ASCII NCI file after tool table processing
has finished, it will never read past the ASCII NCI location that was current when the
tooltable$ command was issued.
This behavior also applies to calls after the start-of-file: rereading the NCI to restore the
location at which normal NCI processing will resume will not go past the location in the file
from where the tool table call was initiated.
Note that while tooltable processing is taking place, MP does update the nci_line$ value.
Possible values
–1 Indicates that the tooltable has already been processed. Typically this is set behind-
the-scenes by MP but if you are using tooltable$ as a command word, you can
do this manually.
3 Call the pwrtt$ postblock at tool changes and, in addition, call it again at the end of
the NCI file (NCI 1003).
Predefined variables, postblocks, and functions: page 1259
1x If 1’s digit is 3, instead of calling pwrtt$ at the 1003 line, it is called at the physical
end of file.
2x When restoring normal NCI processing, read NCI to the point where tooltable$
was called.
4x When restoring normal NCI processing and tlchng_aft$ is active, read NCI to the
motion block after the toolchange.
tooltable_active$
Indicates whether MP is reading the NCI for tool table processing or M L R W MT
normal processing. For example, during the NCI pre-read for tool table
processing, this will be set to 1. When reading the NCI for normal post processing, this will be
set to 0. This will also be set to 1 if tool table processing has been initiated with the tooltable$
command.
Possible values
tool_op$
M L R W MT
Specific toolpath operation code.
Possible values
Mill/Router/Art operations
1 Contour
2 Drill
3 Pocket
4 Transform operation
17 Manual entry
Predefined variables, postblocks, and functions: page 1262
18 Circle mill
19 Point
20 Trimmed
21 Ruled
22 Revolved
23 Letters
24 Swept 2D
25 Swept 3D
26 Coons
27 Lofted
28 5-axis drilling
29 5-axis curve
36 Non-associative contour
Predefined variables, postblocks, and functions: page 1263
37 Non-associative drilling
38 Non-associative pocketing
48 5-axis swarf
102 Facing
135 Saw
416 Engraving
439 Art
440 (obsolete)
Note: For Mastercam X9 and earlier, 440 was used for any advanced multiaxis
toolpath. Beginning with Mastercam 2017, individual codes are output for each
type of operation as listed below, and 440 is no longer output.
Lathe/Mill-Turn operations
53 C axis contouring
57 C axis drilling
60 Rough
61 Finish
63 Threading
64 Drill
Predefined variables, postblocks, and functions: page 1267
65 Point
66 Facing
67 Cutoff
69 Manual entry
220 Pinch-turn
231 Bar feed with tool stop or tool pull (Mill-Turn only)
Wire operations
74 Contour
75 Canned
76 No Core
77 Manual entry
78 Point
79 4-axis
80 Transform
81 Associative trimmed
83 Collar
tool_typ$
M L R W MT
Tool type number
Possible values
0 Undefined
1 Center drill
2 Spot drill
3 Drill
6 Reamer
7 Boring bar
8 Counter bore
9 Counter sink
12 Chamfer mill
13 Face mill
14 Slot mill
15 Radius mill
16 Dovetail mill
17 Tapered mill
Predefined variables, postblocks, and functions: page 1271
18 Lollipop mill
tool_zero$
Enables calling the following postblocks if the current tool number = 0: M L R W MT
psof0$, peof0$, lsof0$, leof0$, msof0$, meof0$
These postblocks are rarely used, and are not required to be in the PST file.
To use these postblocks, you must first define them, and then add the line tool_zero$ : 1,
so that they will be called.
Possible values
tosz$
M L R MT
3-axis drill: Absolute position of the Z location of the top of stock. 5-axis
drill: Not calculated.
tox$
M L R W MT
X coordinate of the tool plane origin.
tox4$
M L R MT
At a tool change, the position of the tox$ mapped to the top view.
The tox$, toy$, and toz$ variables are the work origin position.
toy$
M L R W MT
Y coordinate of the tool plane origin.
toy4$
M L R MT
At a tool change, the position of the toy$ mapped to the top view.
The tox$, toy$, and toz$ variables are the work origin position.
toz$
M L R W MT
Z coordinate of the tool plane origin.
toz4$
M L R MT
At a tool change, the position of the toz$ mapped to the top view.
The tox$, toy$, and toz$ variables are the work origin position.
tplanemode$
M L R W MT
Contains the value of the following control definition setting:
Use this option to tell Mastercam which Tplanes to include when automatically generating
work offset numbers. You can choose to assign work offsets to all Tplanes or just those which
are being transformed.
The variable is provided to the post writer but does no processing in MP. This is done during
the ASCII NCI generation and influences that file.
Possible values
0 None option
transchr$
M L R W MT
Enables ASCII character translation.
Character translation is required for some machine tools that do not
accept the normal ASCII character set. The conversion table is in an external file
(MPTRANS.TBL) that maps ASCII characters 0 to 255 to the corresponding integer in the file
(again 0 to 255). The mapping is based on the file line numbers (starting at 0 for line 1) for the
ASCII integer value and the replacement value entered on the line. Any character that is not
in the table remains unchanged.
The translation table MPTRANS.TBL must be in same directory as the MP.DLL file—
typically, the \apps folder in your Mastercam installation folder.
Possible values
0 No
1 Yes
trans_mi1$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi10$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi2$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi3$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi4$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi5$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi6$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi7$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi8$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mi9$
M L R W MT
One of the 10 miscellaneous integers for transform operations, as entered
in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mi1$ through trans_mi4$); values
5–10 are not supported and should not be used (trans_mi5$ through trans_mi10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Capture these in the ptransint$ postblock.
See also trans_mr1$ through trans_mr10$ and mi1$ through mi10$ for related information.
trans_mr1$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$); values
5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr10$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$);
values 5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr2$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$); values
5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr3$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$);
values 5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr4$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$); values
5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr5$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$);
values 5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr6$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$); values
5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr7$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$);
values 5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr8$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$); values
5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trans_mr9$
M L R W MT
One of the 10 miscellaneous real values for transform operations, as
entered in the Custom parameters dialog box.
Note that Mastercam currently only supports values 1–4 (trans_mr1$ through trans_mr4$);
values 5–10 are not supported and should not be used (trans_mr5$ through trans_mr10$).
Miscellaneous integers let the post writer create custom variables whose values can be entered
individually for each operation. Each post needs to be written to process each value. The
specific individual meanings for each variable are based on how the post processes them.
Always open the post in an editor and read the comments on how the post is using the
miscellaneous integers.
Use the ptransreal$ postblock to capture them.
See also trans_mi1$ through trans_mi10$ and mr1$ through mr10$ for related information.
trflat$
M L R W MT
Size of the tool flat on the end of the cutter. Calculated as (tlrad$ - tcr$)
trimplane1$
W
4-axis XY trimming plane height.
trimplane2$
W
4-axis UV trimming plane height.
trunc_mtol$
M L R W MT
Use this variable to truncate internal NCI data. Normally when
Mastercam reduces a value to the specified level of precision, it rounds
the value. Set this variable if you want to truncate the extra decimals instead of rounding.
Note that the formatting is evaluated before the application of the truncating value. Setting
trunc_mtol$ to 1 replaces the partial fraction formatting from mtol$.
Possible values
0 Off
ttblend$
M L R W MT
Flag to indicate that the end of the tool table has been reached. This can
be useful to identify the last actual tool change. The bldnxtool$ variable
must be set to 1 to access the first_tool$ variable.
Possible values
1 At the end.
ttplane$
M L R W MT
Plane (XY, XZ, or YZ) of NCI motion between tool changes.
The main purpose of this variable is to help the post writer determine if
cutter compensation in control is valid for a toolpath, since many controls do not
accommodate switching arc planes with compensation in control established.
The possible values for this variable were changed for Mastercam X3. At that time, it was also
enhanced to accommodate motion data that may be introduced after a NCI 999 code, but
before the tool change information block (and tool change event list).
The value of ttplane$ is a 4-digit integer, in which the value of each digit indicates the
following scheme:
n The right-most digit (1s place) indicates the first arc plane after the NCI 999 but before
the tool change information.
n The second digit (10s place) indicates all arc planes after NCI 999 but before the tool
change information
n The third digit (100s place) indicates the first arc plane after the tool change
information.
n The left-most digit (1000s place) indicates all arc planes after the tool change
information.
NOTE
Do not get ttplane$ mixed up with tt_plane$; they are two distinct variables.
Possible values
–1 Plane is invalid.
0 XY
1 YZ
2 XZ
3 XY/YZ
4 XY/XZ
5 YZ/XZ
6 All
Predefined variables, postblocks, and functions: page 1308
tt_axis_subs$
M L R W MT
Does this operation use rotary axis substitution? From opinfo/opchng
functions.
This is populated during MP's enhanced tool table routines; it is typically used for opinfo or
opchng queries. See the Working with enhanced tool tables application guide to learn more.
Possible values
0 None
1 X axis
2 Y axis
3 Z axis
tt_axis_subs_dia$
M L R W MT
Diameter for axis substitution, from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
tt_axis_subs_dir$
M L R W MT
Rotary axis substitution direction, from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
Possible values
–1 CW
1 CCW
tt_axiscombo$
M L R W MT
Entity ID of axis combination from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
tt_cc_pos$
M L R W MT
Modal cutter compensation variable from opinfo or opchng functions.
This is the enhanced tool table equivalent of the cc_pos$ variable. This
variable is populated during enhanced tool table processing, while the cc_pos$ variable is
populated during the NCI read.
See cc_pos$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
1 Left (G41).
2 Right (G42).
tt_count$
M L R W MT
If the tool is used multiple times, this variable indicates which instance
of usage is this operation. From opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is typically used for opinfo or
opchng queries. See the Working with enhanced tool tables application guide to learn more.
tt_css_actv$
M L R W MT
Constant surface speed flag from opinfo/opchng functions.
This is the enhanced tool table equivalent of the css_actv$ variable. This
variable is populated during enhanced tool table processing, while the css_actv$ variable is
populated during the NCI read.
See css_actv$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
1 On
tt_drlcycle$
M L R W MT
The drill cycle code, from opinfo/opchng functions.
This is the enhanced tool table equivalent of the drl_cycle$ variable. This
variable is populated during enhanced tool table processing, while the drl_cycle$ variable is
populated during the NCI read.
See drl_cycle$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
0 Simple
1 Peck
2 Chip break
3 Tap
4 Bore #1
5 Bore #2
6 Misc #1
7 Misc #2
tt_force_tlchg$
M L R W MT
Status of the Force tool change option (as set in the toolpath parameters
page inside Mastercam) returned by opinfo/opchng functions.
This is the enhanced tool table equivalent of the force_tlchg$ variable. This variable is
populated during enhanced tool table processing, while the force_tlchg$ variable is populated
during the NCI read.
See force_tlchg$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
0 Off
1 On
tt_fr_pos$
M L R W MT
Positive feed rate from opinfo or opchng functions.
This is the enhanced tool table equivalent of the fr_pos$ variable. This
variable is populated during enhanced tool table processing, while the fr_pos$ variable is
populated during the NCI read.
See fr_pos$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_gcode$
M L R W MT
NCI Gcode value from opinfo/opchng/streaminfo functions.
This is the enhanced tool table equivalent of the gcode$ variable. This is
the tool change Gcode that is validated by MP. This variable is populated during enhanced
tool table processing, while the gcode$ variable is populated during the NCI read.
See gcode$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_ipr_actv$
M L R W MT
Feed rate units (per revolution or per minute) from the opinfo or opchng
functions.
This is the enhanced tool table equivalent of the ipr_actv$ variable. This variable is populated
during enhanced tool table processing, while the ipr_actv$ variable is populated during the NCI
read.
See ipr_actv$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
tt_lturret$
M L R W MT
The lathe turret that is currently being used, from opinfo/opchng
functions.
This is the enhanced tool table equivalent of the lturret$ variable. This variable is populated
during enhanced tool table processing, while the lturret$ variable is populated during the NCI
read.
See lturret$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
0 Bottom turret
1 Upper turret
tt_nesting_op_id$
M L R W MT
Operation ID of the immediate parent nesting operation returned by
opinfo/opchng functions. If the current operation is the result of a nesting
operation, this is the op_id$ of the parent nesting operation.
This is the enhanced tool table equivalent of the nesting_op_id$ variable. This variable is
populated during enhanced tool table processing, while the nesting_op_id$ variable is populated
during the NCI read.
See nesting_op_id$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_offset$
M L R W MT
Current Wire offset register number entered in Mastercam.
This is the enhanced tool table equivalent of the offset$ variable. This
variable is populated during enhanced tool table processing, while the offset$ variable is
populated during the NCI read.
See offset$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_op_id$
M L R W MT
Internal operation ID number from opinfo/opchng/streaminfo functions.
This is the enhanced tool table equivalent of the op_id$ variable. This
variable is populated during enhanced tool table processing, while the op_id$ variable is
populated during the NCI read.
See op_id$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_plane$
M L R W MT
Current cutting plane from opinfo/opchng functions.
This is the enhanced tool table equivalent of the plane$ variable. This
variable is populated during enhanced tool table processing, while the plane$ variable is
populated during the NCI read.
See plane$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
–1 Invalid plane
0 XY plane, G17
1 YZ plane, G19
2 XZ plane, G18
tt_posttype$
M L R W MT
Flag to indicate the product that generated the current toolpath,
returned by opinfo/opchng functions.
This is the enhanced tool table equivalent of the posttype$ variable. This variable is populated
during enhanced tool table processing, while the posttype$ variable is populated during the
NCI read. See the Working with enhanced tool tables application guide to learn more about
enhanced tool tables.
See posttype$ for more info about this variable. Note that value 4 is ignored by MP; it will be
forced to Mill.
Possible values
0 Neither
1 Mill/Router toolpaths
2 Lathe toolpaths
3 Wire toolpaths
4 Router toolpaths
tt_progno$
M L R W MT
Program number from opinfo/opchng functions.
This is the enhanced tool table equivalent of the progno$ variable. This
variable is populated during enhanced tool table processing, while the progno$ variable is
populated during the NCI read.
See progno$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_rot_axis$
M L R W MT
Axis of rotation, from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
Possible values
0 None
1 X axis
2 Y axis
3 Z axis
tt_rot_conv$
M L R W MT
Type of rotary conversion, from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
Possible values
1 Axis substitution
2 Polar conversion
5 Toolplane—convert to polar
6 Toolplane
7 Multiaxis (vector)
tt_rotary_axis$
M L R W MT
Rotary axis orientation in terms of the current tool plane. This is
populated during MP's enhanced tool table routines; it is typically used
for opinfo or opchng queries.
This is the enhanced tool table equivalent of the rotary_axis$ variable, which is the "old
style" rotary setting. See the Working with enhanced tool tables application guide to learn more.
Possible values
0 None
tt_rotary_type$
M L R W MT
The type of rotary selection made in the Rotary Axis dialog box. This is
populated during MP's enhanced tool table routines; it is typically used
for opinfo or opchng queries.
This is the enhanced tool table equivalent of the rotary_type$ variable, which is the "old
style" rotary setting. See the Working with enhanced tool tables application guide to learn more.
Possible values
0 None
1 Axis substitution
tt_speed$
M L R W MT
Spindle speed from opinfo/opchng functions. This is the unsigned
(absolute) value of the spindle speed.
This is populated during MP's enhanced tool table routines; it is typically used for opinfo or
opchng queries. See the Working with enhanced tool tables application guide to learn more.
tt_spindle_no$
M L R W MT
Spindle ID from opinfo/opchng functions.
This is the enhanced tool table equivalent of the spindle_no$ variable.
This variable is populated during enhanced tool table processing, while the spindle_no$ variable
is populated during the NCI read.
See spindle_no$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
Possible values
1 Right (subspindle)
tt_spndl_dir$
M L R W MT
Spindle direction from opinfo/opchng functions.
This is populated during MP's enhanced tool table routines; it is
typically used for opinfo or opchng queries. See the Working with enhanced tool tables
application guide to learn more.
Possible values
–1 CCW
0 Stop
1 CW
tt_state$
M L R W MT
Tool state from opinfo/opchng functions. Indicates whether this tool is
the first tool, last tool, or neither.
This is populated during MP's enhanced tool table routines; it is typically used for opinfo or
opchng queries. See the Working with enhanced tool tables application guide to learn more.
Possible values
1 First tool.
2 Last tool.
3 Both first and last tool (in other words, there is only one tool).
tt_status$
M L R W MT
Helper variable to indicate success or failure of tool table call (in other
words, each time ptooltable$ is called).
This is populated during MP's enhanced tool table routines. See the Working with enhanced
tool tables application guide to learn more.
Possible values
0 Query successful.
1 Query failed. This occurs when the list of operations is valid, but an operator is out-
of-range or similar error.
2 End-of-list.
3 Query failed. This is a higher-level failure than value 1; for example, Mastercam
can't find a starting point for the query.
tt_stream$
M L R W MT
Stream ID from opinfo/opchng functions.
This is currently not used or set; its value will always be zero.
tt_tlngno$
M L R W MT
Tool length offset number from opinfo/opchng functions.
This is the enhanced tool table equivalent of the tlngno$ variable. This
variable is populated during enhanced tool table processing, while the tlngno$ variable is
populated during the NCI read.
See tlngno$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_tool$
M L R W MT
Tool number from opinfo/opchng functions.
This is the enhanced tool table equivalent of the t$ variable. This
variable is populated during enhanced tool table processing, while the t$ variable is populated
during the NCI read.
See t$ for more info about this variable. See the Working with enhanced tool tables application
guide to learn more about enhanced tool tables.
tt_tool_op$
M L R W MT
Specific toolpath operation code from opinfo/opchng/streaminfo functions.
This is the enhanced tool table equivalent of the tool_op$ variable. This
variable is populated during enhanced tool table processing, while the tool_op$ variable is
populated during the NCI read.
See tool_op$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_tool_station$
M L R W MT
Tool station number from opinfo/opchng functions.
This is the enhanced tool table equivalent of the lstation$ variable. This
variable is populated during enhanced tool table processing, while the lstation$ variable is
populated during the NCI read.
See lstation$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_workoffs$
M L R W MT
Work offset number from opinfo/opchng functions.
This is the enhanced tool table equivalent of the workofs$ variable. This
variable is populated during enhanced tool table processing, while the workofs$ variable is
populated during the NCI read.
See workofs$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
tt_xform_op_id$
M L R W MT
Operation ID of the immediate parent transform operation returned by
opinfo/opchng functions.
This is the enhanced tool table equivalent of the xform_op_id$ variable. This variable is
populated during enhanced tool table processing, while the xform_op_id$ variable is populated
during the NCI read.
See xform_op_id$ for more info about this variable. See the Working with enhanced tool tables
application guide to learn more about enhanced tool tables.
t_orgin_x$
M L R W MT
Work Coordinate System (WCS) X origin.
See variables t_wcs_m1$ through t_wcs_m9$ for the WCS matrix
definition.
t_orgin_y$
M L R W MT
Work Coordinate System (WCS) Y origin.
See variables t_wcs_m1$ through t_wcs_m9$ for the WCS matrix
definition.
t_orgin_z$
M L R W MT
Work Coordinate System (WCS) Z origin.
See variables t_wcs_m1$ through t_wcs_m9$ for the WCS matrix
definition.
t_wcs_m1$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m2$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m3$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m4$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m5$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m6$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m7$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m8$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
t_wcs_m9$
M L R W MT
Work Coordinate System matrix. The tool plane matrix is defined
relative to the world coordinate system.
n t_wcs_m1$, t_wcs_m2$, t_wcs_m3$ represent the X vector.
n t_wcs_m4$, t_wcs_m5$, t_wcs_m6$ represent the Y vector.
n t_wcs_m7$, t_wcs_m8$, t_wcs_m9$ represent the Z vector.
See t_orgin_x$, t_orgin_y$, t_orgin_z$ for the WCS origin.
u$
M L R W MT
Absolute endpoint (X coordinate) of the tool axis vector away from
surface (5-axis operations; only with NCI Gcode 11 data).
uninhibit_eof_probe$
M L R W MT
Command variable: resume Renishaw probing output with eof
housekeeping.
This command works just like the uninhibit_probe$ command except that it also does additional
end-of-file processing.
Specifically—in addition to setting the uninhibit_probe$ processing mode—it outputs the
contents of the probe trailer operation. This is the data that is contained in probing operations
with a tool_op$/synctool_op$ value of 153. The pcomment_probe$ postblock will be called once
for each comment in the 153 operation.
Place this command in your peof$ postblock for any post that supports probing.
Since this functions only as a command keyword, it has no value.
uninhibit_probe$
M L R W MT
Command variable: suspend Renishaw probing output.
Use this command to cancel the effect of an inhibit_probe$ command. It
turns NC output back on after it has been turned off by an inhibit_probe$ command.
This command is typically placed:
n near the end of your psof$ postblock, to cancel the inhibit_probe$ command earlier in
that postblock.
n pretract$, to cancel the inhibit_probe$ command in ptlchg$ and ptlchg0$.
Note that use of this command is conditioned by the value of x_probe_opt$. The description in
this section is based on x_probe_opt$ = 1022.
Since this functions only as a command keyword, it has no value.
upper_x$
M L R W MT
[obsolete]
upper_y$
M L R W MT
[obsolete]
upper_z$
M L R W MT
[obsolete]
up_st_mode$
W
Optional tapered wire thread and wire cut position. Defines which of the points to
apply the taper to.
See up_st_vecx$, up_st_vecy$ and up_st_vecz$.
Possible values
0 None
1 Thread
2 Cut
3 Both
up_st_vecx$
W
Optional tapered wire thread and wire cut position. This position is an incremental
distance from the 2D contour positions for wire thread and wire cut in the wirepath.
It applies to both points.
The post must be written to support these variables. See up_st_mode$.
up_st_vecy$
W
Optional tapered wire thread and wire cut position. This position is an incremental
distance from the 2D contour positions for wire thread and wire cut in the wirepath.
It applies to both points.
The post must be written to support these variables. See up_st_mode$.
up_st_vecz$
W
Optional tapered wire thread and wire cut position. This position is an incremental
distance from the 2D contour positions for wire thread and wire cut in the wirepath.
It applies to both points.
The post must be written to support these variables. See up_st_mode$.
usecanbore1$
M L R MT
usecanbore1$ and usecanbore2$ enable the canned drill cycles for boring.
Set these variables with the following control definition options:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanbore1$, lusecanbore2$. These let you maintain separate settings for mill and lathe
operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecanbore2$
M L R MT
usecanbore1$ and usecanbore2$ enable the canned drill cycles for boring.
Set these variables with the following control definition options:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanbore1$, lusecanbore2$. These let you maintain separate settings for mill and lathe
operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecanchip$
M L R MT
Enable the chip break canned cycle for drilling. Set this variable with the
following control definition option:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanchip$. These let you maintain separate settings for mill and lathe operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecandrill$
M L R MT
Enable the canned cycle for simple drilling. Set this variable with the
following control definition option:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecandrill$. These let you maintain separate settings for mill and lathe operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecanmisc1$
M L R MT
usecanmisc1$ and usecanmisc2$ enable the miscellaneous canned drill
cycles. Set these variables with the following control definition options:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanmisc1$, lusecanmisc2$. These let you maintain separate settings for mill and lathe
operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecanmisc2$
M L R MT
usecanmisc1$ and usecanmisc2$ enable the miscellaneous canned drill
cycles. Set these variables with the following control definition options:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanmisc1$, lusecanmisc2$. These let you maintain separate settings for mill and lathe
operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecanpeck$
M L R MT
Enable the canned cycle for peck drilling. Set this variable with the
following control definition option:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecanpeck$. These let you maintain separate settings for mill and lathe operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecantap$
M L R MT
Enable the canned cycle for tap drilling. Set this variable with the following
control definition option:
Mastercam also provides a separate set of lathe-specific variables for use in mill/turn posts:
lusecantap$. These let you maintain separate settings for mill and lathe operations.
Possible values
0 Output long code drilling, calls are made to the linear feed and rapid postblocks.
usecan_lathe$
L MT
Indicates whether the option to Use separate mill and lathe drill cycles has been
selected in the control definition Machine Cyclespage.
This is used in mill/turn posts. It tells MP to use the “luse...” set of variables:
n lusecanbore1$, lusecanbore2$
n lusecanchip$
n lusecandrill$
n lusecanmisc1$, lusecanmisc2$
n lusecanpeck$
n lusecantap$
It is set with the following control definition option:
Possible values
0 The Use separate mill and late drill cycle… option is not selected.
1 The Use separate mill and late drill cycle… option is selected and the lathe-specific
variables are enabled.
uselstation$
M L R MT
Allows the post executable to replace the t $tool number variable with the
lstation$ lathe turret station variable in lathe toolpaths and the head
number in mill toolpaths. Intended for Mill / Turn applications.
Possible values
0 No
1 Yes
use_2d_uv$
W
Activates the conversion routine that produces 4-axis direct and taper positions from
the 2D contour.
This routine relies on the post switch plot_2d_uv$. When plot_2d_uv$ is set to call postblocks
with the 4-axis emulation routine, the value of use_2d_plot$ indicates which of the four
possible 4-axis direct upper wire positions is generated.
Position Variables
Possible values
0 Disabled
1 Enabled
use_alt_eob$
M L R W MT
Use this variable to tell your post to use an alternate end-of-block
character. This is set by the Alternate EOB characters option in the
control definition.
n When the Remove CR/LF at the end of NC block option is selected, MP uses the alternate
EOB character instead of CR/LF.
n When the Remove CR/LF at the end of NC block option is not selected, MP uses the
alternate EOB character in addition to CR/LF.
See eob$ and omitcrlf$ for more information.
Possible values
1 Enables the use of alternate EOB characters and activates the fields where they can
be specified.
use_dec_seq$
Indicates whether sequence numbers are integers or use a decimal point. M L R W MT
This is set by the Use decimal sequence numbers option.
Possible values
uvflag$
W
Indicates whether a wirepath is in the XY (Gcode 0-3) or XY-UV plane (Gcode 20-23
and 30-33 for 4-axis Direct).
Possible values
uvheight$
W
UV height value entered in Mastercam.
v$
M L R W MT
Absolute endpoint (Y coordinate) of the tool axis vector away from
surface (5-axis operations; only with NCI Gcode 11 data).
vdirx$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.
vdiry$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.
vdirz$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.
vers_no$
M L R W MT
Mastercam major version number. See also m_vers_no$.
Possible values
7 Version 7
8 Version 8
9 Version 9
10 Mastercam X
11 Mastercam X2
12 Mastercam X3
13 Mastercam X4
14 Mastercam X5
15 Mastercam X6
16 Mastercam X7
17 Mastercam X8
18 Mastercam X9
19 Mastercam 2017
20 Mastercam 2018
vert_tol$
M L R W MT
Tolerance applied to the tool vector in 5-axis toolpaths to determine if
the vector is to be considered vertical; in other words, if it is facing into
the plane. It is used when rotaxtyp$ = 3.
This variable is used for inch output; see met_vert_tol$ for the metric value.
vert_tool$
M L R W MT
[obsolete]
vox$
M L R MT
OBSOLETE: Axis offset vector.
voy$
M L R MT
OBSOLETE: Axis offset vector.
voz$
M L R MT
OBSOLETE: Axis offset vector.
vtlngz$
M L R MT
Used to pass the tool length to the other variables/functions; see vtlofsx$,
vtlofsy$, vtlofsz$.
vtlofsx$
M L R MT
vtlofsx$, vtlofsy$, and vtlofsz$ are a vector that represent the tool axis
calculated from the mapped tool plane matrix when rotaxtyp$ is less than 6.
This vector is calculated as the vector [0,0,1] scaled by vtlngz$ and mapped to the tool plane
matrix.
vtlofsy$
M L R MT
vtlofsx$, vtlofsy$, and vtlofsz$ are a vector that represent the tool axis
calculated from the mapped tool plane matrix when rotaxtyp$ is less than 6.
This vector is calculated as the vector [0,0,1] scaled by vtlngz$ and mapped to the tool plane
matrix.
vtlofsz$
M L R MT
vtlofsx$, vtlofsy$, and vtlofsz$ are a vector that represent the tool axis
calculated from the mapped tool plane matrix when rotaxtyp$ is less than 6.
This vector is calculated as the vector [0,0,1] scaled by vtlngz$ and mapped to the tool plane
matrix.
vtol$
M L R W MT
OBSOLETE: General tolerance; obsolete since MP v9.16.
n The use of vtol$ in motion breakup as been replaced by the use of chord_tol$.
n The variable vtol$ was also used for internal calculations in the fsg2 and fsg3 functions,
and breakarcs$, breakarcsxz$, breakarcsyz$, lbreakarcsxz$ variables. In these cases, it has been
replaced with xtol$.
vtoolx$
M L R W MT
A unit vector representing the tool axis calculated with 5-axis toolpaths
and from the tool plane matrix when rotaxtyp$ is greater or equal to 2.
Describes the direction of the 5-axis toolpath vector from the XYZ position to the UVW
position or the tool plane matrix vector m7$, m8$, m9$.
vtooly$
M L R W MT
A unit vector representing the tool axis calculated with 5-axis toolpaths
and from the tool plane matrix when rotaxtyp$ is greater or equal to 2.
Describes the direction of the 5-axis toolpath vector from the XYZ position to the UVW
position or the tool plane matrix vector m7$, m8$, m9$.
vtoolz$
M L R W MT
A unit vector representing the tool axis calculated with 5-axis toolpaths
and from the tool plane matrix when rotaxtyp$ is greater or equal to 2.
Describes the direction of the 5-axis toolpath vector from the XYZ position to the UVW
position or the tool plane matrix vector m7$, m8$, m9$.
w$
M L R W MT
Absolute endpoint (Z coordinate) of the tool axis vector away from
surface (5-axis operations; only with NCI Gcode 11 data).
warc_cortyp$
W
Wire arc corner type.
warc_ctyp$
W
Arc geometry type (Wire). This is a parameter is added to all arc motion NCI lines
after the wc_rad$ variable. See related variable warc_rad$.
Possible values
0 Conical
1 Sharp
2 Constant
3 Other
4 Fixed
5 Fishtail
warc_rad$
W
Radius for upper wire (UV) arc geometry and arc corner type options other, fixed,
and fishtail.
warc_rad$ is added to the end of all arc motion.
See related variables warc_ctyp$ and wc_rad$.
warc_radius$
W
Arc radius for wire NCI 32/33 moves.
water$
W
Current water (flushing) status.
This variable is set both within the NCI tool change block and extracted from the
contour flag variable cur_cflg$.
See related power$, tank$, and wire$.
Possible values
0 Off
1 On
wc$
W
Corner type of the current position in the wirepath.
Possible values
0 Conical
1 Sharp
2 Constant
3 Other
wcc$
W
Cutter compensation for 4-axis direct (UV) upper wirepaths.
This variable is never used. See the numeric variable cc$.
wcor$
W
Corner type for 4-axis direct (UV) upper wirepaths. See related variable wcor_rad$.
wcor_rad$
W
Wire corner radius.
wcor_rad_2$
W
The upper corner radius results of the 2-axis to 4-axis conversion are stored in the
wcor_rad_2$ , wcor_rad_3$ , and wcor_rad_4$ variables.
wcor_rad_3$
W
The upper corner radius results of the conversion are stored in these variables.
wcor_rad_4$
W
The upper corner radius results of the conversion are stored in these variables.
wc_rad$
W
Radius for other, fixed, and fishtail corner options when geometry is intersecting
(Wire).
wc_rad$ is added to all linear and arc motion NCI lines. See related variables warc_ctyp$ and
warc_rad$.
wdum3$
W
[not currently used]
wfr$
W
Feed rate setting of 4-axis direct (UV) upper wirepaths.
This variable is never used. See the numeric variable fr$.
wfull_arc_flg$
W
Indicates if the current arc in the UV plane is a full circle (360 deg. sweep) in a single
NC block.
See related variables do_full_arc$, breakarcs$, and full_arc_flg$.
Possible values
whatline$
M L R W MT
OBSOLETE: internal motion counter. Do not use this in any current
post.
whatno$
M L R W MT
OBSOLETE: Mastercam X4 and later automatically initializes this to
yes$ (1), and it does not need to be in your post.
wire$
W
Wire status.
See related power$, tank$, and water$.
Possible values
0 Off
1 On
wire2d$
W
Flags the presence of contour or pocket (no core) wirepaths in the NCI data.
This variable will not be set at the start of the wirepath in question. You must read
the value of wire2d$ in the pwrtt$ postblock.
Also note that once wire2d$ is set to 1, it will not be reset by MP on the next wirepath. If you
need to count how many contour or no core pocket wirepaths are in the program, you can set
wire2d$ = 0 each time, after checking the value.
See related variables wiredirect$ and wiretaper$.
wiredirect$
W
Flags the presence of 4-axis direct wirepaths in the NCI data.
This variable will not be set at the start of the wirepath in question. You must read
the value of wiredirect$ in the pwrtt$ postblock.
Also note that once wiredirect$ is set to 1, it will not be reset by MP on the next wirepath.
If you need to count how many 4-axis direct wirepaths are in the program, you can set
wiredirect$ = 0 each time, after checking the value.
See related variables wire2d$ and wiretaper$.
wiretaper$
W
Flags the presence of 4-axis taper wirepaths in the NCI data.
This variable will not be set at the start of the wirepath in question. You must read
the value of wiretaper$ in the pwrtt$ postblock.
Also note that once wiretaper$ is set to 1, it will not be reset by MP on the next wirepath. If
you need to count how many 4-axis taper wirepaths are in the program, you can set
wiretaper$ = 0 each time, after checking the value.
See related variables wire2d$ and wiredirect$.
workcoord$
M L R W MT
Contains the value of the Work coordinate selection setting in the
control definition Work System page:
For this setting to be effective, your post must be explicitly written to support it. Many
common posts still implement this feature with miscellaneous values (by entering 0, 1, or 2).
You can use this setting to replace that miscellaneous value if you wish.
Possible values
workofs$
M L R W MT
Work offset number.
wox$
X coordinate of the tool plane origin. This is considered obsolete. W
woy$
Y coordinate of the tool plane origin. This is considered obsolete. W
woz$
W
Z coordinate of the tool plane origin.
wplane$
W
Plane setting of 4-axis direct (UV) upper wirepaths.
This variable is never used. See the variable plane$.
wq$
W
Wire angle perpendicular wq$ (Q) and parallel wr$ (R) to the current wire motion
(Agie style). See qrtyp$.
wr$
W
Wire angle perpendicular wq$ (Q) and parallel wr$ (R) to the current wire motion
(Agie style). See qrtyp$.
wt$
W
Taper angle (in degrees) of the current position in the wirepath.
If the immediate$ routine is enabled and immediate$ equals 2, wt$ holds the taper at
the current position and wt_immd$ is set for the immediate taper change.
Possible values
wtpr$
W
Obsolete: Taper angle (in degrees) of the current position. See wt$ instead.
wtrim$
W
The trimming option for 4-axis wirepaths.
Possible values
0 Trim in computer.
1 Trim in control.
2 3D tracking
wt_immd$
W
Taper angle (in degrees) of the second taper at an immediate taper change.
The immediate$ routine must be enabled and immediate$ equals 2.
Possible values
wt_max$
W
Largest wire taper encountered on the 2D contour wirepath between tool changes
(operations).
wx$
W
X coordinate of the 4-axis direct upper wirepath.
wxc$
W
Arc center (X, Y) of the 4-axis direct upper wirepath.
wxc_2$
W
The upper arc center position results of the conversion.
wxc_3$
W
The upper arc center position results of the conversion.
wxc_4$
W
The upper arc center position results of the conversion.
wx_2$
W
The upper contour position results of the conversion.
wx_3$
W
The upper contour position results of the conversion.
wx_4$
W
The upper contour position results of the conversion.
wy$
W
Y coordinate of the 4-axis direct upper wirepath.
wyc$
W
Arc center (X, Y) of the 4-axis direct upper wirepath.
wyc_2$
W
The upper arc center position results of the conversion.
wyc_3$
W
The upper arc center position results of the conversion.
wyc_4$
W
The upper arc center position results of the conversion.
wy_2$
W
The upper contour position results of the conversion.
wy_3$
W
The upper contour position results of the conversion.
wy_4$
W
The upper contour position results of the conversion.
wz$
W
Z coordinate of the 4-axis direct upper wirepath.
wzc$
W
[not currently used]
wz_2$
W
The upper contour position results of the conversion.
wz_3$
W
The upper contour position results of the conversion.
wz_4$
W
The upper contour position results of the conversion.
x$
M L R W MT
The current X coordinate.
The x$, y$, and z$ variables are calculated from the xnci$, ynci$ and znci$
NCI data. Moves are often generated from MP for broken motion routines.
x4$
M L R MT
At a tool change, the position of the prv_x$ mapped to the top view. With
linear motion only, the xnci$ mapped to the top view.
xc$
M L R W MT
The X center, Y center, and Z center of the current arc.
xcnci$
M L R W MT
The X center of the current arc motion from the NCI file.
It is not recommended to use xcnci$, ycnci$, and zcnci$ for NC output.
See xc$, yc$, zc$.
xdrl$
M L R MT
Absolute position of the X location of the selected drill point.
xform_op_id$
M L R W MT
This is the operation ID (op_id$) of the parent transform operation. In
the case of nested transforms, this is the immediate parent. If no
transform is involved, it is the op_id$ of the actual operation.
See also nesting_op_id$.
xh$
M L R W MT
Home position.
The home position variables are usually output at a tool change or the
end of the program to position the machine for the tool change.
xnci$
M L R W MT
Captures the X, Y, and Z values from the NCI file.
Best practice is to not use xnci$, ynci$ and znci$ for NC output.
Although these variables are supposed to remain undisturbed, many routines in MP modify
these values. See x$, y$, z$ instead.
xr$
M L R W MT
Rapid position (X coordinate) at the start of file and tool change line
NCI Gcode 1000, 1001 and 1002.
You should not use this variable if the tlchng_aft$ routines are enabled in your post; instead, for
all linear axis positioning output, use the normal motion output variables x$, y$, z$, or the
methods in your post that use and update them. Using the xr$, yr$, and zr$ variables defeats
modality and typically results in more complicated post logic.
Note that enabling the tlchng_aft$ routines has been considered a best practice in all MP posts
since it was introduced.
xresult$
M L R W MT
Type of intersection bound by a 2D intersection postline function.
Possible values
2 Entities have two intersection points. Two lines can intersect at a maximum of one
point.
xs$
M L R MT
Axis substitution values calculated when rotaxis$ is selected; see also ys$.
They return values based on diameter to length in degrees.
Use of these numeric variables is not recommended. They are not properly calculated with
linear break up routines.
xsrf$
MR
The X, Y, and Z coordinates of the tool contact point. These coordinates represent
the location on the surface of the part that is in actual contact with the tool. This
data is typically used to support 3D cutter compensation. If the tool axis vector is normal to
the surface (and lead/lag angle are 0), this location will be the same as the tip of the tool.
This data was added for Mastercam 2018.
NOTE
This data is only supported for certain multiaxis toolpaths:
n Curve 5-axis (tool_op$ value 29)
n Swarf (tool_op$ value 48)
n Multisurf (tool_op$ value 110)
n Flow (tool_op$ value 45)
n Port (tool_op$ value 112)
This data is not yet supported for the advanced multiaxis toolpaths (in other words,
operations with tool_op$ values of 441 or greater).
For any unsupported operations, the NCI 11 line will have values of (0, 0, 0) for xsrf$,
ysrf$ , and zsrf$ . In particular, this is not supported for multi-axis drilling operations;
but since for drilling the surface contact point and tool tip location will be the same,
the data would not be meaningful for drilling operations.
Then you can easily use the new variable as a condition when you need to access the new
values.
if tool_contact_supported, *xsrf$, *ysrf$, *zsrf$, e$
Predefined variables, postblocks, and functions: page 1470
xtol$
M L R W MT
Intersection tolerance. This is a general math function tolerance used
internally by MP. Some of the places where it is used include:
n Line and arc intersection routines; for example, xla, xaa, and xll.
n fsg1, fsg2, fsg3 functions.
This variable is used for inch output; see met_xtol$ for the metric value. See Tolerances for
intersections to learn more.
xyheight$
W
XY height value entered in Mastercam.
x_max$
M L R W MT
Maximum X axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum
NCI values from axis motion between tool changes. The following discussion mentions z_min$
and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_
min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
x_min$
wzc$M L R W MT
Minimum X axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and
maximum NCI values from axis motion between tool changes. The following discussion
mentions z_min$ and z_max$ but please understand that everything applies equally well to x_
min$, x_max$, y_min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
x_mp_adv_func$
M L R W MT
Mastercam 2017 includes a routine that allows MP to set a number of
predefined variables directly from the machine definition. These settings
are used for multiaxis or 5-axis posts. This affects the following variables:
rotaxis1$
rotaxis2$
rotdir1$
rotdir2$
nut_ang_pri$
pri_limtyp$
sec_limtyp$
pri_limlo$
pri_limhi$
pri_intlo$
pri_inthi$
sec_limlo$
sec_limhi$
sec_intlo$
sec_inthi$
matb1$
matb2$
matb3$
matb4$
matb5$
matb6$
matb7$
matb8$
matb9$
fr_max_ipm$
fr_max_
mpm$
fr_max_ipr$
fr_max_mpr$
fr_max_ideg$
fr_max_
mdeg$
fr_max_iinv$
fr_max_minv$
fr_min_ipm$
fr_min_mpm$
Predefined variables, postblocks, and functions: page 1477
fr_min_ipr$
fr_min_mpr$
fr_min_ideg$
fr_min_
mdeg$
fr_min_iinv$
fr_min_minv$
Before Mastercam 2017, variables in the first three columns were typically initialized manually
in the post. The variables in the last column are new for Mastercam 2017; before Mastercam
2017, post writers typically got these values by capturing machine definition parameters.
Typically when you enable x_mp_adv_func$, you will want to remove any lines in your post
that explicitly initialize the above variables. Any initializations that do occur in your post will
override the value that MP calculates from your machine definition.
Note that if a post initialization overrides the machine definition–derived value, MP will not
display a warning or other message. It is your responsiblity to maintain your post code
properly.
Depending on how an existing post is currently written, you may wish to read some values
from the machine definition, and explicitly initialize others. This is allowed.
NOTE
In many X9 and earlier posts, feed rate settings from the fourth column were typically
accessed via parameter capture routines, as parameter numbers 17054–17067. If your
post has been migrated from an earlier version of Mastercam, look for references to
these parameter numbers. Typically, using the new predefined variables directly is a
better approach.
x_nci_read$
M L R W MT
[future use]
x_probe_opt$
M L R W MT
Helper variable for Renishaw probing. Initialize this to 1022 for normal
probing operation.
x_tooltable$
M L R W MT
Enables enhanced tooltable processing, with resulting calls to ptooltable$
or puidlist$. This was introduced in Mastercam 2017. Use x_tooltable$
instead of the tooltable$ commend that has traditionally been used in Mastercam posts.
NOTE
If you choose to use x_tooltable$, tooltable$ should not be used anywhere in your
post.
1. Set x_tooltable$ to the desired mode by initializing it to the proper value. The table
below details each mode.
2. Implement puidlist$ or ptooltable$ as appropriate for your intended application.
3. At the point in your post where you want processing to begin, place x_tooltable$ on
a line by itself as a command. This can be in any postblock, but pheader$ is a common
location for a typical tool table.
You can either initialize x_tooltable$ to a value in the header area of your post, or assign a
value to it inside a postblock before it is called.
Typically x_tooltable$ will be set to 1 for normal tool table processing; however note the
following values for special applications:
n value 0—call ptooltable$ for single operation only.
n value 2—filter mill/lathe operations for use in mill/turn posts.
You can call x_tooltable$ from anywhere in your post to initiate tool table processing. Note
that if you do this from a postblock after MP has begun processing the NCI file, there is no
impact at all on the NCI processing: MP’s internal “pointer” will remain exactly where it was
when you called x_tooltable$, since the new tool table routines do not rely on reading the
NCI file.
Note also that even though you can call x_tooltable$ before the NCI file is read, if you
want to output tool table records to your NC file, you still must wait until the NC file has been
opened. For example, you cannot write tool table output from pprep$. For most tool table
applications, pheader$ is the most practical choice.
See the Working with enhanced tool tables application guide to learn more.
Predefined variables, postblocks, and functions: page 1481
Possible values
0 Call ptooltable$ for current operation only (defined by current op_id$ value). (This is
the default value.)
2 Call ptooltable$ for each operation in the operation list whose type matches
posttype$ value.
y$
M L R W MT
The current Y coordinate.
The x$, y$, and z$ variables are calculated from the xnci$, ynci$ and znci$
NCI data. Moves are often generated from MP for broken motion routines.
y4$
M L R MT
At a tool change, the position of the prv_y$ mapped to the top view. With
linear motion only, the ynci$ mapped to the top view.
yc$
M L R W MT
The X center, Y center, and Z center of the current arc.
ycnci$
M L R W MT
The Y center of the current arc motion from the NCI file.
It is not recommended to use xcnci$, ycnci$, and zcnci$ for NC output.
See xc$, yc$, zc$.
year$
M L R W MT
Returns the year of the current date.
The variables day$, mon$, month$ and year$ return the day, month and
year of the current date. They behave differently depending on whether you have assigned a
format.
n If no format has been applied, they return the date information as a text string,
according to the table below.
n If a format has been applied, they are treated like a numeric variable and the number
will be formatted as specified when it is output.
For example, assuming the following format statements:
fs 6 0.1
fmt 6 day$
fmt 6 month$
fmt 6 year2
year2 = year$ + 2000 # Change 09 to 2009
The following table shows what the formatted and unformatted output would be:
month$ 09 9.0
year$ 08 8.0
day$ 26 26.0
*progno$, e$
"(", "PROGRAM NAME: ", sprogname$, ")", e$
"(", "DATE: ", month$, "-", day$, "-", year$, ")", e$ # Ex. 02-12-05
"(", "TIME: ", time$, ")", e$
spathnc$ = ucase(spathnc$)
smcname$ = ucase(smcname$)
stck_matl$ = ucase(stck_matl$)
snamenc$ = ucase(snamenc$)
"(", "MCX FILE -", *smcpath$, *smcname$, *smcext$, ")", e$
"(", "NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(", "MATERIAL -", *stck_matl$, ")", e$
spaces$ = sav_spc
pbld, n$, *smetric, e$
Predefined variables, postblocks, and functions: page 1489
yes$
M L R W MT
True condition
yh$
M L R W MT
Home position.
The home position variables are usually output at a tool change or the
end of the program to position the machine for the tool change.
ynci$
M L R W MT
Captures the X, Y, and Z values from the NCI file.
Best practice is to not use xnci$, ynci$ and znci$ for NC output.
Although these variables are supposed to remain undisturbed, many routines in MP modify
these values. See x$, y$, z$ instead.
yr$
M L R W MT
Rapid position (Y coordinate) at the start of file and tool change line
NCI Gcode 1000, 1001 and 1002.
You should not use this variable if the tlchng_aft$ routines are enabled in your post; instead, for
all linear axis positioning output, use the normal motion output variables x$, y$, z$, or the
methods in your post that use and update them. Using the xr$, yr$, and zr$ variables defeats
modality and typically results in more complicated post logic.
Note that enabling the tlchng_aft$ routines has been considered a best practice in all MP posts
since it was introduced.
ys$
M L R MT
Axis substitution values calculated when rotaxis$ is selected; see also xs$.
They return values based on diameter to length in degrees.
Use of these numeric variables is not recommended. They are not properly calculated with
linear break up routines.
y_max$
M L R W MT
Maximum Y axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum
NCI values from axis motion between tool changes. The following discussion mentions z_min$
and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_
min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
y_min$
M L R W MT
Minimum Y axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum
NCI values from axis motion between tool changes. The following discussion mentions z_min$
and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_
min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
ysrf$
MR
The X, Y, and Z coordinates of the tool contact point. These coordinates represent
the location on the surface of the part that is in actual contact with the tool. This
data is typically used to support 3D cutter compensation. If the tool axis vector is normal to
the surface (and lead/lag angle are 0), this location will be the same as the tip of the tool.
This data was added for Mastercam 2018.
NOTE
This data is only supported for certain multiaxis toolpaths:
n Curve 5-axis (tool_op$ value 29)
n Swarf (tool_op$ value 48)
n Multisurf (tool_op$ value 110)
n Flow (tool_op$ value 45)
n Port (tool_op$ value 112)
This data is not yet supported for the advanced multiaxis toolpaths (in other words,
operations with tool_op$ values of 441 or greater).
For any unsupported operations, the NCI 11 line will have values of (0, 0, 0) for xsrf$,
ysrf$ , and zsrf$ . In particular, this is not supported for multi-axis drilling operations;
but since for drilling the surface contact point and tool tip location will be the same,
the data would not be meaningful for drilling operations.
z$
M L R W MT
The current Z coordinate.
The x$, y$, and z$ variables are calculated from the xnci$, ynci$ and znci$
NCI data. Moves are often generated from MP for broken motion routines.
z4$
M L R MT
At a tool change, the position of the prv_z$ mapped to the top view. With
linear motion only, the znci$ mapped to the top view.
zc$
M L R W MT
The X center, Y center, and Z center of the current arc.
zcnci$
M L R W MT
The Z center of the current arc motion from the NCI file.
It is not recommended to use xcnci$, ycnci$, and zcnci$ for NC output.
See xc$, yc$, zc$.
zdrill$
M L R MT
Current incremental distance from the reference point to the current depth
with long drill cycle output.
The drill cycle must be set to output long code (that is, the appropriate usecan$… variable =
0) and rotaxtyp$ must be set less than 6 to access this variable.
zdrl$
M L R MT
n For 3-axis drill, this is the absolute position of the Z location of the
selected drill point.
n For 5-axis drill, this is the selected drill point.
This is calculated as zdrl$ = w$ – initht$.
zh$
M L R W MT
Home position.
The home position variables are usually output at a tool change or the
end of the program to position the machine for the tool change.
znci$
M L R W MT
Captures the X, Y, and Z values from the NCI file.
Best practice is to not use xnci$, ynci$ and znci$ for NC output.
Although these variables are supposed to remain undisturbed, many routines in MP modify
these values. See x$, y$, z$ instead.
zr$
M L R W MT
Rapid position (Z coordinate) at the start of file and tool change line
NCI Gcode 1000, 1001 and 1002.
You should not use this variable if the tlchng_aft$ routines are enabled in your post; instead, for
all linear axis positioning output, use the normal motion output variables x$, y$, z$, or the
methods in your post that use and update them. Using the xr$, yr$, and zr$ variables defeats
modality and typically results in more complicated post logic.
Note that enabling the tlchng_aft$ routines has been considered a best practice in all MP posts
since it was introduced.
zsrf$
MR
The X, Y, and Z coordinates of the tool contact point. These coordinates represent
the location on the surface of the part that is in actual contact with the tool. This
data is typically used to support 3D cutter compensation. If the tool axis vector is normal to
the surface (and lead/lag angle are 0), this location will be the same as the tip of the tool.
This data was added for Mastercam 2018.
NOTE
This data is only supported for certain multiaxis toolpaths:
n Curve 5-axis (tool_op$ value 29)
n Swarf (tool_op$ value 48)
n Multisurf (tool_op$ value 110)
n Flow (tool_op$ value 45)
n Port (tool_op$ value 112)
This data is not yet supported for the advanced multiaxis toolpaths (in other words,
operations with tool_op$ values of 441 or greater).
For any unsupported operations, the NCI 11 line will have values of (0, 0, 0) for xsrf$,
ysrf$ , and zsrf$ . In particular, this is not supported for multi-axis drilling operations;
but since for drilling the surface contact point and tool tip location will be the same,
the data would not be meaningful for drilling operations.
zx$
W
[not currently used]
zy$
W
[not currently used]
zz$
W
[not currently used]
z_max$
M L R W MT
Maximum Z axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum
NCI values from axis motion between tool changes. The following discussion mentions z_min$
and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_
min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
z_min$
M L R W MT
Minimum Z axis value from NCI motion between tool changes.
This is part of a set of variables that capture the minimum and maximum
NCI values from axis motion between tool changes. The following discussion mentions z_min$
and z_max$ but please understand that everything applies equally well to x_min$, x_max$, y_
min$ and y_max$.
Capture these variables in the pwrtt$ postblock to determine the minimum and maximum
values for the entire NCI file.
It is important to understand that because the values of z_min$ and z_max$ can’t be known
until the entire operation has been processed, while the operation is being processed those
variables still have the values from the previous operation. So while pwrtt$ is being executed,
some variables (like t$) always refer to the current tool being processed, but other variables
like z_min$ and z_max$ effectively refer to the previous tool.
This means that if you want to output these values with the current tool number, you need to
do the following:
While z_min$ and z_max$ store the min and max values for the current operation, you can
easily modify the above code so that you can also get the min and max values for the entire
part. Create two new variables (z_min_all and z_max_all) and use them to keep track of
the overall min and max values as each tool is processed. After the tool table has been
processed, you can output them at your convenience.
In example below, the min and max values for each tool are output in the tool table, then the
overall min and max values are output once in the psof$ postblock.
z_pstblock$
M L R MT
When this is set to 1, MP will skip calls to Z-only postblocks, and use the
normal postblocks instead. This is obsolete and should not be used in
modern posts.
Possible values
This section lists all of the predefined postblocks in MP. These are the postblocks whose names
must be followed by a $.
Use the bookmarks on the left to browse the individual entries.
Predefined variables, postblocks, and functions: page 1518
lbore1$
L MT
Define canned drill cycle (feed in, dwell, feed out). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1519
lbore1_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1520
lbore2$
L MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out). Used for lathe
toolpaths.
Predefined variables, postblocks, and functions: page 1521
lbore2_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1522
lchpbrk$
L MT
Define canned drill cycle (feed in, dwell, rapid to retract, rapid to clearance...).
Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1523
lchpbrk_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1524
lcir$
L MT
Postblock call to output the circular move, where:
n NCI Gcode 2: Arc move clockwise
n NCI Gcode 3: Arc move counterclockwise.
Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1525
ldrill$
L MT
Define canned drill cycle (feed in, dwell, rapid out). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1526
ldrill_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1527
leof$
L MT
Postblock call for the end-of-file. Used to generate the rapid return to home
position and the end of NC file codes. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1528
leof0$
L MT
Postblock call for the end-of-file. Used to generate the rapid return to home
position and the end of NC file codes. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1529
llin$
L MT
Linear move at feed rate. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1530
lmisc1$
L MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out). Used for lathe
toolpaths.
Predefined variables, postblocks, and functions: page 1531
lmisc1_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1532
lmisc2$
L MT
Define canned drill cycle (feed in, dwell, rapid out). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1533
lmisc2_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1534
lpeck$
L MT
Define canned drill cycle (feed in, dwell, rapid reference, rapid clearance, feed
in...). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1535
lpeck_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1536
lrapid$
L MT
Linear move at rapid rate. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1537
lsof$
L MT
Postblock call for the start-of-file tool change. Used to perform the first tool
change and rapid position. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1538
lsof0$
L MT
Postblock call for the start-of-file tool change. Used to perform the first tool
change and rapid position. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1539
ltap$
L MT
Define canned drill cycle (feed in, dwell, spindle reverse, feed out). Used for
lathe toolpaths.
Predefined variables, postblocks, and functions: page 1540
ltap_2$
L MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1541
ltlchg$
L MT
Postblock call for an actual tool change. Used to perform the tool change and
rapid position. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1542
ltlchg0$
L MT
Postblock call for a null tool change. Null tool changes occur when moving from
one chain to another. The tool number does not change but tool planes, work
offsets, subprograms or spindle speeds may be different. Used for lathe toolpaths.
Predefined variables, postblocks, and functions: page 1543
ltoolend$
L MT
The 1011 NCI Gcode is the first NCI line that starts the tool change series of NCI
lines. This call is performed before any values are passed from the Miscellaneous
Reals to output NC code to end the prior tool.
n posttype$ = 1 and mtoolend$, call postblock mtoolend$
n posttype$ = 2 and ltoolend$, call postblock ltoolend$
n Otherwise, call postblock ptoolend$.
mbore1$
M R MT
Define canned drill cycle (feed in, dwell, feed out). Used for non-lathe
toolpaths.
Predefined variables, postblocks, and functions: page 1545
mbore1_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1546
mbore2$
M R MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out). Used for
non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1547
mbore2_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1548
mchpbrk$
M R MT
Define canned drill cycle (feed in, dwell, rapid to retract, rapid to
clearance...). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1549
mchpbrk_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1550
mcir$
M R MT
Postblock call to output the circular move, where:
n NCI Gcode 2: Arc move clockwise
n NCI Gcode 3: Arc move counterclockwise.
Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1551
mdrill$
M R MT
Define canned drill cycle (feed in, dwell, rapid out). Used for non-lathe
toolpaths.
Predefined variables, postblocks, and functions: page 1552
mdrill_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1553
meof$
M R MT
Postblock call for the end-of-file. Used to generate the rapid return to home
position and the end of NC file codes. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1554
meof0$
M R MT
Postblock call for the end-of-file. Used to generate the rapid return to home
position and the end of NC file codes. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1555
mlin$
M R MT
Linear move at feed rate. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1556
mmisc1$
M R MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out). Used for
non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1557
mmisc1_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1558
mmisc2$
M R MT
Define canned drill cycle (feed in, dwell, rapid out). Used for non-lathe
toolpaths.
Predefined variables, postblocks, and functions: page 1559
mmisc2_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1560
mpeck$
M R MT
Define canned drill cycle (feed in, dwell, rapid reference, rapid clearance, feed
in...). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1561
mpeck_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1562
mrapid$
M R MT
Linear move at rapid rate. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1563
msof$
M R MT
Postblock call for the start-of-file tool change. Used to perform the first tool
change and rapid position. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1564
msof0$
M R MT
Postblock call for the start-of-file tool change. Used to perform the first tool
change and rapid position. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1565
mtap$
M R MT
Define canned drill cycle (feed in, dwell, spindle reverse, feed out). Used for
non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1566
mtap_2$
M R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81). Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1567
mtlchg$
M R MT
Postblock call for an actual tool change. Used to perform the tool change and
rapid position. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1568
mtlchg0$
M R MT
Postblock call for a null tool change. Null tool changes occur when moving
from one chain to another. The tool number does not change but tool planes,
work offsets, subprograms or spindle speeds may be different. Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1569
mtoolend$
M R MT
The 1011 NCI Gcode is the first NCI line that starts the tool change series of
NCI lines. This call is performed before any values are passed from the
Miscellaneous Reals to output NC code to end the prior tool.
n posttype$ = 1 and mtoolend$, call postblock mtoolend$
n posttype$ = 2 and ltoolend$, call postblock ltoolend$.
n Otherwise, call postblock ptoolend$.
Used for non-lathe toolpaths.
Predefined variables, postblocks, and functions: page 1570
pblockdrl$
R
Used to capture the drill positions from NCI gcode 83 data. These positions are
passed in the variables bdrl_x2$, bdrl_y2$, and bdrl_z2$; this postblock is called on each
line. Block drill executes the drill cycle after the last position has been read.
Predefined variables, postblocks, and functions: page 1571
pbore1$
M L R MT
Define canned drill cycle (feed in, dwell, feed out).
Predefined variables, postblocks, and functions: page 1572
pbore1_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1573
pbore2$
M L R MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out).
Predefined variables, postblocks, and functions: page 1574
pbore2_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1575
pbreaks_in$
M L R MT
[Reserved for future use].
Predefined variables, postblocks, and functions: page 1576
pbreaks_out$
M L R MT
[Reserved for future use].
Predefined variables, postblocks, and functions: page 1577
pcan0$
W
Common pre-output postblock call before call to specific wire canned cycle (pcan1 -
pcan8, pcan1_2 - pcan8_2 and pcancst, pcancst_2).
Predefined variables, postblocks, and functions: page 1578
pcan1$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1579
pcan1_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1580
pcan2$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1581
pcan2_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1582
pcan3$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1583
pcan3_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1584
pcan4$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1585
pcan4_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1586
pcan5$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1587
pcan5_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1588
pcan6$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1589
pcan6_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1590
pcan7$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1591
pcan7_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1592
pcan8$
W
Define wire canned cycle selection number.
Predefined variables, postblocks, and functions: page 1593
pcan8_2$
W
Drill additional points with the wire canned cycle established with define wire can
cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1594
pcancelcc$
M L R W MT
Cancel cutter compensation postblock. OBSOLETE, Gcode 1004
Predefined variables, postblocks, and functions: page 1595
pcancelcyc$
W
Cancel wire canned cycle.
Predefined variables, postblocks, and functions: page 1596
pcanceldc$
M L R MT
Cancel canned drill cycle.
Predefined variables, postblocks, and functions: page 1597
pcancst$
W
Define custom wire canned cycle.
Predefined variables, postblocks, and functions: page 1598
pcancst_2$
W
Drill additional points with the custom wire canned cycle established with define
wire can cycle (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1599
pcan_end$
W
This postblock is called after all calls to the active canned cycle postblock are
completed.
Predefined variables, postblocks, and functions: page 1600
pchpbrk$
M L R MT
Define canned drill cycle (feed in, dwell, rapid to retract, rapid to
clearance...).
Predefined variables, postblocks, and functions: page 1601
pchpbrk_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1602
pchuck$
L MT
Lathe Chuck.
Predefined variables, postblocks, and functions: page 1603
pcir$
M L R W MT
Postblock call to output the circular move, where:
n NCI Gcode 2: Arc move clockwise
n NCI Gcode 3: Arc move counterclockwise.
Predefined variables, postblocks, and functions: page 1604
pcir0$
M L R W MT
This postblock allows manipulation of circular motion NCI data prior to
the normal postblock calls for circular moves.
Predefined variables, postblocks, and functions: page 1605
pcir1$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1606
pcir2$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1607
pcir3$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1608
pcir_end$
M L R W MT
This postblock is called after all calls to pcir$ are completed.
Predefined variables, postblocks, and functions: page 1609
pcomment$
M L R W MT
Postblock call for NC output of NCI file comments. If the command
variable comment$ is in the post customization file, comments before the
tool change in the NCI file are buffered for output at the command word.
Predefined variables, postblocks, and functions: page 1610
pcomment0$
M L R W MT
This postblock is called every time a comment is read in from the NCI
file. This allows the post to examine NCI comments 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$.
Predefined variables, postblocks, and functions: page 1611
pcomment_999$
M L R W MT
Called at the NCI 999 line for probing and manual entry operations.
Predefined variables, postblocks, and functions: page 1612
pcomment_end$
M L R W MT
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.
Predefined variables, postblocks, and functions: page 1613
pcomment_probe$
M L R W MT
Output postblock for Renishaw probe data.
Predefined variables, postblocks, and functions: page 1614
pconchg$
W
Postblock call for technology change on wirepath.
Predefined variables, postblocks, and functions: page 1615
pdir_tapr$
W
Postblock call in wire 2D to 4-axis conversion to allow switching the numeric
variable linarc to select direct or taper processing.
Predefined variables, postblocks, and functions: page 1616
pdir_tp_end$
W
Postblock call in wire 2D to 4-axis conversion to allow switching the numeric
variable linarc off after conversion processing.
Predefined variables, postblocks, and functions: page 1617
pdrill$
M L R MT
Define canned drill cycle (feed in, dwell, rapid out).
Predefined variables, postblocks, and functions: page 1618
pdrill0$
M L R MT
This postblock allows manipulation of drill cycle NCI data prior to the
normal postblock calls for drilling output (canned or long code).
Predefined variables, postblocks, and functions: page 1619
pdrill3$
M L R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1620
pdrill30$
M R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1621
pdrill5$
M L R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1622
pdrill50$
M R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1623
pdrill_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1624
pdrlcst$
M L R MT
Define custom canned drill cycle.
Predefined variables, postblocks, and functions: page 1625
pdrlcst_2$
M L R MT
Drill additional points with the custom canned drill cycles (NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1626
pdrl_end$
M L R MT
This postblock is called after all calls to the active canned cycle postblock
are completed.
Predefined variables, postblocks, and functions: page 1627
pdump$
M L R W MT
This postblock was introduced in Mastercam 2017 to support parameter
dump modes for the following query functions:
n cdinfo( )
n groupinfo( )
n mdinfo( )
n opinfo( )
It works by outputting sparameter$ for value of each parameter, and prmcode$ for the number of
each parameter.
Typically, this postblock is implemented with a single line like this:
~prmcode$ ~sparameter$ e$
NOTE
The pdump$ postblock is called automatically whenever one of the query functions is
called in parameter dump mode. Do not call it directly.
Dump parameters for a specific machine definition return = mdinfo( –1, component_ID )
component.
See mdinfo( ) to learn more about targeting a specific
component.
Predefined variables, postblocks, and functions: page 1628
n Please see the Working with tool and operation parameters application guide for the most
complete information about the new query functions introduced in Mastercam 2017 as
well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9 and
earlier posts, or if you need to support an X9 post.
pdwl_spd$
M L R W MT
Output dwell, spindle speed and direction changes.
Predefined variables, postblocks, and functions: page 1630
pedm$
W
Postblock called for 4-axis taper wirepaths.
Predefined variables, postblocks, and functions: page 1631
pedm0$
W
Allows manipulation of NCI Gcode 11 (taper wirepath) data prior to wr and wq
calculations.
Predefined variables, postblocks, and functions: page 1632
pedm1$
W
OBSOLETE
Predefined variables, postblocks, and functions: page 1633
pedm2$
W
OBSOLETE
Predefined variables, postblocks, and functions: page 1634
pedm3$
W
OBSOLETE
Predefined variables, postblocks, and functions: page 1635
pedm_end$
W
This postblock is called after the call to pedm is completed.
Predefined variables, postblocks, and functions: page 1636
peof$
M L R W MT
Postblock call for the end-of-file. Used to generate the rapid return to
home position and the end of NC file codes.
Predefined variables, postblocks, and functions: page 1637
peof0$
M L R W MT
Postblock call for the end-of-file. Used to generate the rapid return to
home position and the end of NC file codes. Only with zero tool
number.
Predefined variables, postblocks, and functions: page 1638
peof00$
M L R W MT
Allow manipulation of data before calls to end-of-file postblocks.
Predefined variables, postblocks, and functions: page 1639
pfcc_call$
L MT
Lathe canned turning cycle postblock call to output NC code for finish path
recall.
Predefined variables, postblocks, and functions: page 1640
pfcc_end$
L MT
Lathe canned turning cycle postblock call to output NC code for end of finish
path.
Predefined variables, postblocks, and functions: page 1641
pg32$
L MT
Traditional longhand threading postblock call.
Predefined variables, postblocks, and functions: page 1642
pg32e$
L MT
Longhand threading postblock at end of cycle.
Predefined variables, postblocks, and functions: page 1643
pg76$
L MT
Lathe canned thread cycle postblock call.
Predefined variables, postblocks, and functions: page 1644
pg92$
L MT
Selection is for box thread; 'thdtype ' is set to 2.
Predefined variables, postblocks, and functions: page 1645
pheader$
M L R W MT
Write the beginning of the NC program. Normally, the beginning of the
tape or file header is coded in this postblock.
Predefined variables, postblocks, and functions: page 1646
plin$
M L R W MT
Linear move at feed rate.
Predefined variables, postblocks, and functions: page 1647
plin0$
M L R W MT
This postblock allows manipulation of linear motion NCI data prior to
the normal postblock calls for linear moves.
Predefined variables, postblocks, and functions: page 1648
plin1$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1649
plin2$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1650
plin3$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1651
plin_end$
M L R W MT
This postblock is called after all calls to plin are completed.
Predefined variables, postblocks, and functions: page 1652
plow_uv_end$
W
This postblock is called after the calls to plin or pcir is completed.
Predefined variables, postblocks, and functions: page 1653
pmachineinfo$
M L R W MT
Used to read parameters from machine definition, control definition, or
machine group properties. Called automatically with rd_md$, rd_cd$, or
rd_tlpathgrp$ commands.
NOTE
Mastercam 2017 introduced a number of fundamental changes to how parameters are
processed; use of this postblock is not necessary in posts for Mastercam 2017 and later,
except to support backwards compatibility or in posts that have been upgraded from
earlier versions of Mastercam. Please see the Working with tool and operation parameters
application guide or the Working with tool and operation parameters—X9 and earlier posts
application guide to learn more about these changes.
pmat$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1655
pmisc1$
M L R MT
Define canned drill cycle (feed in, dwell, stop spindle, rapid out).
Predefined variables, postblocks, and functions: page 1656
pmisc1_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1657
pmisc2$
M L R MT
Define canned drill cycle (feed in, dwell, rapid out).
Predefined variables, postblocks, and functions: page 1658
pmisc2_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1659
pmiscint$
M L R W MT
Access miscellaneous integers (Gcode 1012).
Predefined variables, postblocks, and functions: page 1660
pmiscop_999$
L MT
Called at the NCI 999 line for lathe misc ops.
Predefined variables, postblocks, and functions: page 1661
pmiscparam$
M L R W MT
Access miscellaneous parameters (Gcode 1013).
Predefined variables, postblocks, and functions: page 1662
pmiscreal$
M L R W MT
Access miscellaneous reals (Gcode 1011).
Predefined variables, postblocks, and functions: page 1663
pmx$
M L R MT
The postblock is for 5-axis NC output specific to the NCI Gcode 11.
Predefined variables, postblocks, and functions: page 1664
pmx0$
M L R MT
The purpose of this postblock is to allow calculations and customization in
the post customization file of 5 axis and tool plane NCI data.
Predefined variables, postblocks, and functions: page 1665
pmx1$
M L R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1666
pmx2$
M L R MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1667
pmx_end$
M L R W MT
This postblock is called after the call to pmx is completed.
Predefined variables, postblocks, and functions: page 1668
pnci20000$
M L R W MT
For reading comments from the 20000s NCI lines, Mastercam 2017 includes
a new predefined postblock called pnci20000$ as an alternative to the
opinfo() function. The pnci20000$ postblock is intended to be a direct replacement for the
pparameter$ postblock. This means that—just like pparameter$—opinfo() will be automatically
executed by MP for each operation if it is implemented in your post.
The difference between opinfo() and pnci20000$ is that pnci20000$ will access the
comments as they are buffered by MP instead of trying to read them directly from the NCI file.
While, technically, you can use pnci20000$ to get any other operation parameter (just like
pparameter$ is used in pre-2017 posts), this doesn’t make any sense for any other parameter
except the 20000s-line comments; the opinfo() function is still the best and most efficient
technique for getting any other value.
To use this postblock to get NCI comments, implement it exactly like pparameter$ would have
been implemented in an X9 or earlier post. The following code is a typical example:
stp_name : "" # Define a string for name of toolplane
pnci20000$ # Implement postblock
if prmcode$ = 20013, stp_name = sparameter$
NOTE
This postblock is only useful if you are using the new parameter-read techniques
introduced in Mastercam 2017. See the Working with tool and operation parameters
application guide to learn more.
Predefined variables, postblocks, and functions: page 1669
pparameter$
M L R W MT
The purpose of this postblock is to allow the operation and tool
parameters to be captured during the normal processing of the NCI
file.To capture a specific parameter value, follow this general outline:
n Use the Operation Parameter Reference to identify the number of the parameter you need
to capture.
n Create a user-defined variable to store the value of each parameter that you need to
capture. This should be either a numeric variable or string to match the individual
parameter.
n Modify the pparameter$ postblock to trap each desired prmcode$ / sparameter$
value, and store each value in the proper variable.
NOTE
Mastercam 2017 introduced a number of fundamental changes to how parameters are
processed; use of this postblock is not necessary in posts for Mastercam 2017 and later,
except to support backwards compatibility or in posts that have been upgraded from
earlier versions of Mastercam. Please see the Working with tool and operation parameters
application guide or the Working with tool and operation parameters—X9 and earlier posts
application guide to learn more about these changes.
NOTE
If you are using the new Mastercam 2017 parameter-read techniques, you can use
pnci20000$ as an alternative to pparameter$ for accessing buffered comments.
ppeck$
M L R MT
Define canned drill cycle (feed in, dwell, rapid reference, rapid clearance,
feed in...).
Predefined variables, postblocks, and functions: page 1671
ppeck_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1672
ppost$
M L R W MT
This postblock is used to process the NC output files after the normal
posting process is complete. Files can be renamed, opened, and modified
by the post writer.
Predefined variables, postblocks, and functions: page 1673
pprep$
M L R W MT
This postblock is used to manipulate any post variables after the post
customization file has been parsed and the variable initializations are
complete. This is called before the NCI and NC files are opened--no NC output is allowed!
Predefined variables, postblocks, and functions: page 1674
pq$
M L R W MT
This postblock is used to manipulate any post variables after the post
customization file has been parsed and the variable initializations are
complete.
Predefined variables, postblocks, and functions: page 1675
pradlist$
W
Call to output wire radius list.
Predefined variables, postblocks, and functions: page 1676
prapid$
M L R W MT
Linear move at rapid rate.
Predefined variables, postblocks, and functions: page 1677
prcc_call_end$
L MT
Lathe canned turning cycle postblock call to output NC code for end of finish
path.
Predefined variables, postblocks, and functions: page 1678
prcc_call_st$
L MT
Lathe canned turning cycle postblock call to output NC code for start of finish
path.
Predefined variables, postblocks, and functions: page 1679
prcc_jump_move$
L MT
Lathe canned turning cycle: postblock call at flag for jump to end of roughing
cycle.
Predefined variables, postblocks, and functions: page 1680
prcc_setup$
L MT
Lathe canned turning cycle postblock call to capture roughing tool information.
This postblock is called at the command variable c_rcc_setup$.
Predefined variables, postblocks, and functions: page 1681
prd1000$
M L R W MT
Intended to allow user to access matm1$ through matm9$ and vtlofsx$,
vtlofsy$, vtlofsz$.
Predefined variables, postblocks, and functions: page 1682
prot$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1683
prot0$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1684
protofs$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1685
pscomm0$
M L R W MT
Postblock call for NC output of NCI file comments without buffering.
Called when NCI comment line is processed.
Predefined variables, postblocks, and functions: page 1686
psof$
M L R W MT
Postblock call for the start-of-file tool change. Used to perform the first
tool change and rapid position.
Predefined variables, postblocks, and functions: page 1687
psof0$
M L R W MT
Postblock call for the start-of-file tool change. Used to perform the first
tool change and rapid position. Only with zero tool number.
Predefined variables, postblocks, and functions: page 1688
psof00$
M L R W MT
Allow manipulation of data before calls to start-of-file postblocks.
Predefined variables, postblocks, and functions: page 1689
psof_end$
M L R W MT
This postblock is called after the call to psof is completed.
Predefined variables, postblocks, and functions: page 1690
pstck_bar_fd$
L MT
Lathe Stock Advance (Bar-Feed/Pull).
Predefined variables, postblocks, and functions: page 1691
pstck_flip$
L MT
Lathe Stock Flip.
Predefined variables, postblocks, and functions: page 1692
pstck_trans$
L MT
Lathe Stock Transfer.
Predefined variables, postblocks, and functions: page 1693
psteadyrest$
L MT
Lathe SteadyRest.
Predefined variables, postblocks, and functions: page 1694
psubcall$
W
Subprogram postblock call in Wire.
Predefined variables, postblocks, and functions: page 1695
psub_call_m$
M L R MT
Subprogram postblock call for transform subprograms with single tool.
Intended for NC output to call the subprogram. This postblock is called at
the command variable c_msng.
Predefined variables, postblocks, and functions: page 1696
psub_call_mm$
M L R MT
Subprogram postblock call for transform subprograms with multiple tools.
Intended for NC output to call the subprogram. This postblock is called at
the command variable c_mmlt$.
Predefined variables, postblocks, and functions: page 1697
psub_call_s$
M L R MT
Subprogram postblock call for non-transform subprograms. Intended for NC
output to call the subprogram.
Predefined variables, postblocks, and functions: page 1698
psub_call_tt$
M L R MT
Call to transform of transform sub.
Predefined variables, postblocks, and functions: page 1699
psub_end_m$
M L R MT
Subprogram postblock call for transform subprograms. Intended for NC
output to end the subprogram.
Predefined variables, postblocks, and functions: page 1700
psub_end_m_r$
M L R MT
End in main level after return to nesting level.
Predefined variables, postblocks, and functions: page 1701
psub_end_s$
M L R MT
Subprogram postblock call for non-transform subprograms. Intended for NC
output to end the subprogram.
Predefined variables, postblocks, and functions: page 1702
psub_end_tt$
M L R MT
End in transform of transform sub.
Predefined variables, postblocks, and functions: page 1703
psub_st_m$
M L R MT
Subprogram postblock call for transform subprograms. Intended for NC
output to start the subprogram.
Predefined variables, postblocks, and functions: page 1704
psub_st_s$
M L R MT
Subprogram postblock call for non-transform subprograms. Intended for NC
output to start the subprogram.
Predefined variables, postblocks, and functions: page 1705
psub_st_tt$
M L R MT
Header in transform of transform sub.
Predefined variables, postblocks, and functions: page 1706
psynclath$
M L R W MT
Called when comment is preceded with ~.
Predefined variables, postblocks, and functions: page 1707
ptailstock$
L MT
Lathe Tailstock.
Predefined variables, postblocks, and functions: page 1708
ptap$
M L R MT
Define canned drill cycle (feed in, dwell, spindle reverse, feed out).
Predefined variables, postblocks, and functions: page 1709
ptap_2$
M L R MT
Drill additional points with the drill cycle established with define drill cycle
(NCI Gcode 81).
Predefined variables, postblocks, and functions: page 1710
pthdext$
L MT
Allows overwriting values used in external thread calculations before the
threading routine calls.
Predefined variables, postblocks, and functions: page 1711
pthdface$
L MT
Allows overwriting values used in face thread calculations before the threading
routine calls.
Predefined variables, postblocks, and functions: page 1712
pthdint$
L MT
Allows overwriting values used in internal thread calculations before the
threading routine calls.
Predefined variables, postblocks, and functions: page 1713
pthd_end$
L MT
This postblock is called after the calls to the threading postblocks are completed.
Predefined variables, postblocks, and functions: page 1714
pthread0$
L MT
Allows access to thread variables after the NCI line is read and before the lathe
thread routines are called.
Predefined variables, postblocks, and functions: page 1715
pthrg32_1$
L MT
Each postblock is called in turn for each thread pass:
n pthrg32_1: Rapid start position at thread start and above thread cut.
n pthrg32_2: Position at cut level before the thread pass.
n pthrg32_3: Thread move to the end of the thread cut.
n pthrg32_4: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1716
pthrg32_2$
L MT
Each postblock is called in turn for each thread pass:
n pthrg32_1: Rapid start position at thread start and above thread cut.
n pthrg32_2: Position at cut level before the thread pass.
n pthrg32_3: Thread move to the end of the thread cut.
n pthrg32_4: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1717
pthrg32_3$
L MT
Each postblock is called in turn for each thread pass:
n pthrg32_1: Rapid start position at thread start and above thread cut.
n pthrg32_2: Position at cut level before the thread pass.
n pthrg32_3: Thread move to the end of the thread cut.
n pthrg32_4: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1718
pthrg32_4$
L MT
Each postblock is called in turn for each thread pass:
n pthrg32_1: Rapid start position at thread start and above thread cut.
n pthrg32_2: Position at cut level before the thread pass.
n pthrg32_3: Thread move to the end of the thread cut.
n pthrg32_4: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1719
pthrg76_1$
L MT
Calculate the position of the lathe canned thread cycle start.
Predefined variables, postblocks, and functions: page 1720
pthrg92_1$
L MT
Each postblock is called in turn for each thread pass:
n pthrg92_1$: Rapid start position at thread start and above thread cut.
n pthrg92_2$: Position at cut level before the thread pass.
n pthrg92_3$: Thread move to the end of the thread cut.
n pthrg92_4$: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1721
pthrg92_2$
L MT
Each postblock is called in turn for each thread pass:
n pthrg92_1$: Rapid start position at thread start and above thread cut.
n pthrg92_2$: Position at cut level before the thread pass.
n pthrg92_3$: Thread move to the end of the thread cut.
n pthrg92_4$: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1722
pthrg92_3$
L MT
Each postblock is called in turn for each thread pass:
n pthrg92_1$: Rapid start position at thread start and above thread cut.
n pthrg92_2$: Position at cut level before the thread pass.
n pthrg92_3$: Thread move to the end of the thread cut.
n pthrg92_4$: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1723
pthrg92_4$
L MT
Each postblock is called in turn for each thread pass:
n pthrg92_1$: Rapid start position at thread start and above thread cut.
n pthrg92_2$: Position at cut level before the thread pass.
n pthrg92_3$: Thread move to the end of the thread cut.
n pthrg92_4$: Retract position from the end of the thread cut.
Predefined variables, postblocks, and functions: page 1724
ptlchg$
M L R W MT
Postblock call for an actual tool change. Used to perform the tool
change and rapid position.
Predefined variables, postblocks, and functions: page 1725
ptlchg0$
M L R W MT
Postblock call for a null tool change. Null tool changes occur when
moving from one chain to another. The tool number does not change
but tool planes, work offsets, subprograms or spindle speeds may be different.
Predefined variables, postblocks, and functions: page 1726
ptlchg00$
M L R W MT
Allow manipulation of data before calls to actual and null tool change
postblocks.
Predefined variables, postblocks, and functions: page 1727
ptlchg0_end$
M L R W MT
This postblock is called after the call to ptlchg0 is completed.
Predefined variables, postblocks, and functions: page 1728
ptlchg1002$
M L R W MT
Postblock called with the tlchng_aft strategy on the actual NCI Gcode
tool change. tlchng_aft strategy reads the first toolpath move after the
tool change NCI Gcode and then calls the normal tool change postblock. This prevents
skipping information on the first move after a tool change.
Predefined variables, postblocks, and functions: page 1729
ptlchg_end$
M L R W MT
This postblock is called after the call to ptlchg is completed.
Predefined variables, postblocks, and functions: page 1730
ptoolend$
M L R W MT
The 1011 NCI Gcode is the first NCI line that starts the tool change
series of NCI lines. This call is performed before any values are passed
from the Miscellaneous Reals to output NC code to end the prior tool.
n posttype$ = 1 and ltoolend$, call postblock mtoolend$
n posttype$ = 2 and ltoolend$, call postblock ltoolend$
n Otherwise, call postblock ptoolend$.
Predefined variables, postblocks, and functions: page 1731
ptooltable$
M L R W MT
The ptooltable$ postblock was introduced in Mastercam 2017 as the
starting point for enhanced tool table logic. It replaces pwrtt$, which has
traditionally been used for tool table processing.
Calls to the ptooltable$ postblock are triggered by the x_tooltable$ command. When x_
tooltable$ is set to 0 or higher, ptooltable$ will be called for each toolpath operation—in
other words, for each operation for which an 1000/1001/1002 line exists in the NCI file.
NOTE
If you choose to use x_tooltable$ and ptooltable$, tooltable$ and pwrtt$ should not be
used anywhere in your post.
NOTE
Many common posts written before Mastercam 2017 employ a user-defined postblock
called ptooltable. Do not confuse this with the new predefined postblock
ptooltable$ introduced in Mastercam 2017. See the Working with enhanced tool tables
application guide to learn more.
where var is the name of a numeric variable to store the value, and n is the number from the
table below. For example, to get the value of misc integer 4, use a statement like this:
my_mi4 = opinfo(33, 0)
See the Working with tool and operation parameters application guide to learn more.
Predefined variables, postblocks, and functions: page 1732
Recall that you can use opinfo( ) in this way to access NCI lines numbered 950 and higher,
including the NCI 20000+ lines that are encapsulated in the tool change NCI block.
See the Working with tool and operation parameters application guide for complete information
and more examples.
ptooltbl$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1735
ptplane$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1736
ptprlist$
W
Call to output wire taper list.
Predefined variables, postblocks, and functions: page 1737
ptransint$
M L R W MT
Entry postblock for 1032 line (misc ints for transform operations).
Predefined variables, postblocks, and functions: page 1738
ptransreal$
M L R W MT
Entry postblock for 1031 line (misc reals for transform operations).
Predefined variables, postblocks, and functions: page 1739
puidlist$
M L R W MT
The puidlist$ postblock is used to cycle through the 20600 NCI
entries for individual components or the 20601 NCI entries for axis
combinations. It was introduced in Mastercam 2017 as a complement to the ptooltable$
postblock for enhanced tool table logic. It is typically used to build lists of component IDs or
axis combo IDs. Like ptooltable$, calls to the puidlist$ postblock are triggered by the x_
tooltable$ command.
n When x_tooltable$ is set to –1 or –2, it will trigger calls to the puidlist$ postblock.
This postblock will be executed for each 20600 line (–1) or 20601 line (–2) in the NCI.
n When x_tooltable$ is set to 0 or higher, ptooltable$ will be called for each toolpath
operation—in other words, for each operation for which an 1000/1001/1002 line exists
in the NCI file.
You are free to combine both uses in the same post so that you process both puidlist$ and
ptooltable$; all you need to do is assign a new value to x_tooltable$, and then call it again.
Position on the
Variable/string …is set to:
20600/20601 line
Recall that parameters 3 & 4 on the 20600 line are the absolute and incremental axis labels for
the component. If you need these strings inside the puidlist$ postblock, you can get them
easily with the uidinfo function:
puidlist$
s_abs_label = uidinfo(1, prmcode$)
s_inc_label = uidinfo(2, prmcode$)
See the Working with tool and operation parameters application guide for complete information
about the uidinfo function. Note also that suser_label$ is a new string introduced in
Mastercam 2017.
Predefined variables, postblocks, and functions: page 1740
pwrtt$
M L R W MT
This is a preparatory postblock that is used for tool table processing. It is
called during the NCI pre-read process when tooltable$ has been set to 1
or 3.
Tool table processing typically follows this outline:
n Initialize tooltable$ to 1 or 3.
n Implement pwrtt$ with the desired logic to output your tool table lines.
n pwrtt$ will then be called for each tool change during the NCI pre-read.
n If tooltable$ = 3, pwrtt$ will also be called again after the final tool change.
NOTE
If tooltable$ has been set to 1 or 3, MP will also call pwrttparam$ so that you can access
operation parameters during tool table processing.
Mastercam 2017 introduced a new set of enhanced tool table processing routines that do not
rely on pwrtt$ or tooltable$. These rely on the ptooltable$ postblock and are enabled by the x_
tooltable$ command. Please see the Working with enhanced tool tables application guide to learn
more.
pwrttparam$
M L R W MT
Preparatory postblock called during the NCI pre-read process. The
purpose of this postblock is to capture operation parameter and
comments during the pre-read routine and tool table processing. In order for this postblock to
be called, tooltable$ must be set to 1 or 3. This will be called once for each tool change (and
again at the end of the file if tooltable$ = 3) so that the captured parameter values can be
output to your tool table.
NOTE
Mastercam 2017 introduced a number of fundamental changes to how parameters are
processed; use of this postblock is not necessary in posts for Mastercam 2017 and later,
except to support backwards compatibility or in posts that have been upgraded from
earlier versions of Mastercam. Please see the Working with tool and operation parameters
application guide or the Working with tool and operation parameters—X9 and earlier posts
application guide to learn more about these changes.
pz$
M L R W MT
Linear feed Z only.
Predefined variables, postblocks, and functions: page 1743
pz1$
M L R W MT
OBSOLETE
Predefined variables, postblocks, and functions: page 1744
pzrapid$
M L R W MT
Linear rapid Z only.
Predefined variables, postblocks, and functions: page 1745
This section includes all of the functions and declaration statements that are included in MP.
n Functions include one or more arguments inside parentheses. They typically return a
value. For example:
result = launch(strEXE, strfilename, 1)
n Declaration statements typically include one or more arguments following the
declaration name. They do not return a value, but are typically used to define
something. For example:
fstack 1 4
They are listed alphabetically. Use the bookmarks on the left to browse.
Predefined variables, postblocks, and functions: page 1746
abs( )
Absolute value. Returns the absolute value of x.
acomboinfo( )
Use the acomboinfo function to:
n get information about the current axis combinations.
n query the NCI 20601 lines (similar to the way uidinfo queries the 20600 lines).
n build arrays of information about the axes on your machine tool and how they’re laid
out.
The most common use of this function is to get the entity IDs of the linear and rotary axis
components in the axis combination. This lets you learn which components are present in the
machine definition and lets you identify the specific components whose parameters you want
to query.
The acomboinfo function has several different function states. Each state is designed to
answer a specific type of question. Whenever you call the acomboinfo function, you need to
specify the function state and the axis combination you are querying.
return numeric or string variable to store the return value. Mastercam will
automatically return either the numeric entity ID or the string UID depending on
the type of variable you use for return.
function_state a number that tells MP what information you are looking for. The
table later in this topic lists all of the function states.
axis_combo the ID of the axis combo that you are querying. You can use either the
numeric entity ID or the string ID.
In most cases, the process of using acomboinfo to drill down to specific components begins
with the entity ID of the current axis combo. This is output on the NCI 950 line (parameter 4)
and is available as the syncaxis$ variable. This variable stores the numeric entity ID of the axis
combo for the current operation. Many times you will simply use syncaxis$ as the second
argument in the acomboinfo function call, particularly when using function states 5–9.
NOTE
The syncaxis$ value is only available after the NCI 950 has been read. If you need it
before that line is read—for example, if you are calling the postblock from pprep$—you
can use the opinfo function to query the enhanced tool table value 8:
syncaxis$ = opinfo(8, 0, 0)
Please see the Working with tool and operation parameters application guide for complete
information about the acomboinfo function.
Predefined variables, postblocks, and functions: page 1748
If a component is present in the axis combination, its entity ID is stored in the array; if
a component is not present in the axis combination, Mastercam returns the default
entity ID for that component type:
n X axis: –1
n Y axis: –2
n Z axis: –3
n A axis: –4
n B axis: –5
n C axis: –6
n An array where the entity IDs are arranged in the order in which they are “stacked” in
the machine definition component tree. For example:
If there are fewer than six axis components, the end of the array is padded with zeros.
In either case, the return argument for the acomboinfo function should be the first variable in
the array.
n Use function state 2 to return the axis components in the order in which they are
laid out in the machine component tree:
var_1 = acomboinfo(2, axis_combo)
Get the string for the user-defined description 3 String. Failure Entity ID or
of the axis combination. (This is parameter 4 makes no change. string ID of
from the 20601 line.) axis combo.
Find out the axis of rotation for the primary, 5 Number Entity ID or
secondary, tertiary rotary axes; in other words, string ID of
find out the linear axis about which each rotary axis combo.
axis rotates, in terms of the axis combination
matrix.
Returns the first variable in a three-variable
array, in which the first variable indicates the
axis of rotation for the primary rotary axis; the
second and third variables indicate this for the
secondary and tertiary axes. Value is 0=X, 1=Y,
2=Z
Predefined variables, postblocks, and functions: page 1751
If you wish, you could modify this logic to test if ent_id_z is not equal to –3 (the default
entity ID) before using calling mdinfo.
Predefined variables, postblocks, and functions: page 1753
acos( )
Arccosine. Returns the angle whose cosine is x.
x the cosine value whose angle you are trying to solve for
Predefined variables, postblocks, and functions: page 1754
altgbl( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1755
and( )
Bitwise AND operator. Compares each bit of two integers i, j and returns a binary integer; if
both bits are 1, the corresponding bit in the return value = 1, otherwise the return bit = 0.
asin( )
Arcsine: Returns the angle whose sine is y.
y the sine value whose angle you are trying to solve for
Predefined variables, postblocks, and functions: page 1757
atan( )
Arctangent. Returns the angle whose tangent value is x.
x the tangent value whose angle you are trying to solve for
Predefined variables, postblocks, and functions: page 1758
atan2( )
Returns the angle between two vectors y and x. The angle is a positive angle between 0 and
360, measured from x to y.
axb( )
Planar cross product of two 2D unitized vectors. Use vaxb for 3D vectors.
return A numeric value which represents the length (magnitude) of the cross-product
vector.
v2 Unitized vector 2.
Predefined variables, postblocks, and functions: page 1760
breaks( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1761
brksps( )
Break string. Breaks a string into two sections at position x.
string the original string. This will be replaced by the first section of the divided
string.
Predefined variables, postblocks, and functions: page 1762
cdinfo( )
Use the cdinfo function to query the control defintion and get parameter values. The cdinfo
function can be used in any postblock.
return a numeric or string variable to store the return value. Use a string or numeric
variable depending on what type of value you are expecting. It is your
responsibility to determine the proper type
param the number of the parameter that you are querying. These will be the 18xxx
group of parameters. They are listed in the Operation Parameter Reference. param =
–1 triggers parameter dump mode. Please see the Working with tool and operation
parameters application guide or click here to learn more.
The cdinfo function was introduced in Mastercam 2017, replacing earlier techniques that
relied on the pmachineinfo$ postblock and rd_cd$ command. Expand the following section to
learn more about the new capabilities.
2. Use the "Control definition: visual reference" section to see pictures of all the dialog
boxes with the parameter numbers noted. This is typically the easiest way to find the
parameter you need.
3. Create a user-defined variable to store the parameter value.
4. Go to the desired postblock where you want to get the value, and add a line like this:
my_var = cdinfo(18xxx)
where 18xxx is the actual parameter number.
comment_fx( )
Shortens a comment or any other string to a maximum length. This is especially intended to
solve the problem where long file paths—which have become increasingly common since
Mastercam moved to the new folder structure in X5—are longer than the maximum comment
length. You can choose to simply truncate the string, or shorten it by inserting '…' in the
middle (typically used for filepaths).
Two different modes let you select the string shortening method.
n Truncate mode simply cuts off the string after the maximum number of characters.
n Shorten mode keeps the beginning and end of the string and inserts “…” to replace the
middle of the string. The following picture shows an example of how this technique
works:
Typically you will use this function in conjunction with the maxnccomment$ setting from your
control definition. This is the maximum length of a comment string that is allowed by your
Predefined variables, postblocks, and functions: page 1765
copyfmt( )
Copy fmt statement. Copies format assignment statement b to statement a. Returns 1 if
successful, otherwise 0.
copyfs( )
Copy a format definition. Copies format definition b to format definition a. Returns 1 if
successful, otherwise 0. This works with both fs and fs2 definitions.
cos( )
Cosine. Returns the cosine of angle a.
a angle in degrees
Predefined variables, postblocks, and functions: page 1769
cpyforce( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1770
db_clr( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1771
db_proc( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1772
db_rot( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1773
db_trn( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1774
db_view( )
View number, where x is the first coordinate of the view matrix. Returns the number of the
view, or -1 if no matching view is found.
delay( )
Pauses post processing for n seconds (minimum value is 0.001). Always returns 1.
directory( )
Use the directory function to create or delete a directory. When you use this function to
delete a directory, MP will also automatically delete the contents of that directory, including
child directories and all files. You can also use this function to test if a directory already exists.
path a string containing the path of the directory that you are creating or deleting.
n Specify the complete path, not a relative path.
n The string must begin with the drive letter.
n Don't include a slash "\" at the end of the path.
Predefined variables, postblocks, and functions: page 1777
dll( )
Use the dll( ) function to launch and run a C-Hook or NetHook from your post. (Use the
launch( ) function to run an .exe executable.)
return an integer variable to store the return value. It returns 1 if the C-Hook or
NetHook was executed successfully, and 0 if it failed. Note that before Mastercam
X5, the function always returned 1.
dllname the name of the C-Hook or NetHook that you want to run, including the
extension. This should be enclosed within quotes. It should include the full path if
it is not located in the same \apps folder as mp.dll.
You can pass up to three arguments to the C-Hook. These arguments are passed to
Mastercam using the exported string variable, post_args[0], post_args[1] and
post_args[2] . Refer to the Mastercam C-Hook API documentation for more
information.
These correspond to the post_args[ ] array inside the C-Hook. To set up the return values,
your C-Hook should contain a function like the following:
extern "C" __declspec(dllexport) int m_main (int not_used)
{
// Set the post_args which will be returned to the PST
strcpy_s(post_args[0] , "MyNew_Arg0");
strcpy_s(post_args[1] , "MyNew_Arg1");
Predefined variables, postblocks, and functions: page 1778
strcpy_s(post_args[2] , "86");
return MC_NOERROR;
}
The values from post_args[ ] are automatically placed in the new string variables, with no
additional processing required.
The sample PST code should produce the following output:
Call this C-Hook : C:\Program Files\mcamX8\chooks\MyCHook.dll
Result (1 = 'success') : result 1.
Return values :
spost_arg_0$ = MyNew_Arg0
spost_arg_1$ = MyNew_Arg1
spost_arg_2$ = 86
For the values to be returned properly, the new spost_arg_0$, spost_arg_1$, and spost_
arg_2$ strings need to be declared and initialized before you call the DLL. However,
initializing them in the PST does not initialize the post_args[ ] array in the C-Hook; for
this, you still need to explicitly pass their initial values as arguments in the dll function as
shown in the example above.
Use the PostingManager class to access it. This can be found in the Mastercam::Posting
namespace of the API. It has a property called PostProcessorArguments which gets and
sets the three arguments using a structure containing three strings.
Predefined variables, postblocks, and functions: page 1780
dot( )
Dot product of two 2D vectors: return = dot(v1, v2) where v1 and v2 are two unitized vectors.
Use dot3 for 3D vectors.
v1 the first vector. v1 and v2 each represent the first element of a two-element array.
dot3( )
Dot product of two 3D vectors.
v1 unitized vector 1
v2 unitized vector 2
Predefined variables, postblocks, and functions: page 1782
drs_str( )
Use the drs_str() function to create strings that replicate a line of NC output. The function
has three modes that you let you construct common building blocks of an NC output line.
mode a value from 0–3 that specifies what type of building block you wish to
construct:
n 0 = return a string that consists of a block of spaces. The number of spaces is
determined by the spaces$ setting.
n 1 = return a string that consists of the end-of-block character.
n 2 = return a string that consists of a numeric variable formatted for normal
output.
number the name of a numeric variable whose value you want to save in a string
form.
The string will represent the number as formatted for normal output, including the prefix or
suffix that is normally output with the value. For example, drs_str(2,xabs) might return a
string of X3.450.
Using the function to return the value of the variable does not change the modality like
normal output would.
NOTE
The number parameter is only used with mode = 2. If the mode is 0 or 1, you can leave
it out.
drwarc( )
Obsolete.
Predefined variables, postblocks, and functions: page 1784
drwlin( )
Obsolete.
Predefined variables, postblocks, and functions: page 1785
exp( )
Exponential function. Returns the value of e raised to the x power.
fbuf
Define a buffer. Example: fbuf 4 0 2 1 1.
keep_flag Use this flag to save the buffer to a text file when the post has completed
processing. Set it to 1 to keep the file or to 0 to discard it. Set to 2 to keep the
buffer even if it is empty.
x size of buffer. For a numeric buffer, this is the number of values per record (max
50). For a string buffer, it is the number of characters in the string.
init_flag Indicates whether to initialize the buffer from a pre-existing ASCII text file.
Set to 1 to initialize or to 0 omit initialization.
NOTE
To maintain compatibility with older posts, if x = 80, MP will assume it is a string buffer
with max string length of 80.
Predefined variables, postblocks, and functions: page 1787
fclose( )
Close file. If x is a string, it is the path and name of the file to be closed; if x is a number, it is
the buffer number. Returns 0 if successful.
fexist( )
Tests if a file exists, where s is the path and name of the file. Returns 1 if the file exists.
finc( )
Use the finc function to increment a value in the output column of a lookup table. It looks
up (in column 2 of the lookup table) the closest match to a value that you provide and then
increments the corresponding value in column 1. The incremented count is the return value.
The most common use of this function is to keep count of the number of times a tool is used.
Once the finc function has been run, the updated count from column 1 can also be accessed
(for reading) by flook or frange.
Before using this function, the table needs to have been already setup with a flktbl statement.
Typically, when creating the table, the values in column 1 will be set to 0 to initialize the
count.
x value that you are searching for. This will be compared to the entries in column 2
of table t.
NOTE
Note that you cannot use finc if either column in the lookup table contains strings.
Later in your post—perhaps in a tool change postblock—use the finc function to count
the tool usage:
times_used = finc( 1, t$ ) # Increase count each time t$ is used
Predefined variables, postblocks, and functions: page 1790
flktbl
Define a lookup table for the flook, frange, or finc functions. Example: flktbl 1 3
flook( )
Use the flook function to look up a value from a table that has been defined with a flktbl
statement. It looks up (in column 2 of the table) the closest match to a value that you provide
and then returns the corresponding value from column 1.
return a variable that stores the value from column 1 of the table
The values in the table can be either numbers or strings. If the lookup values—that is, the
values in column 2 of the table—are strings, then the value supplied with the flook function
must match exactly. There is no “closest match” when using strings.
If the return values—that is, the values in column 1 of the table—are strings, then you can
return a string based on a numeric lookup. In this case, the function is able to use the “closest
match” capability (see example below).
58 64
63 112
64 180
65 224
67 450
73 710
74 900
75 1400
76 1800
77 2800
pmy_postblock
sscode = flook( 1, ss$ )
If ss$ is 24, then sscode will be 58.If ss$ is 425, then sscode will be 67, because 425 is closer
to the higher match value.If ss$ is 700, then sscode will be 73.If ss$ is 1150, then sscode
will be 74, because 1150 is closer to the lower match value.If ss$ is 5000 (or any value greater
than 2800), then sscode will be 77.
Example 2: Declaring a lookup table that uses string values
The following example returns a string from the lookup table, based on a numeric input
value. In this case, it is the responsibility of the post writer to ensure that the return
variable is a string variable.
flktbl 1 3 # Lookup table definition for spindle gears
pmy_postblock
speed_range = flook( 1, ss$ )
fmt
Assign a numbered format statement and (optionally) a prefix/suffix to one or more variables.
Example: fmt P 3 dwell$
s1 the letter or string that will be prefixed to the variable when it is output—either a
literal string enclosed in quotation marks (" ") or name of a string. This is
optional—simply omit it if there is no prefix.
s2 the letter or string suffix that will be added to the end of the variable when it is
output—either a literal string enclosed in quotation marks (" ") or name of a
string. This is optional—simply omit it if there is no suffix.
n/d use n to make the variable non-modal, or d for delta output. These work the same
way as n or d from the fs or fs2 statement ; enter n or d here to override the fs/ fs2
setting for this specific variable. This is new for Mastercam 2017. Note that if you
want to include the n or d argument, you need to include a value for the linked
incremental flag as a placeholder. Use 0 if you are not interested in activating the
linked incremental value for that variable.
fmtrnd( )
Get the rounded value. Returns the rounded value of x, according to the fs/fs2 statement
assigned to x.
fnewsub( )
Rename subprogram file. Renames the subprogram file for level x with the path/name stored
in string s. Returns 1 if successful.
force( )
Forces output of a specified range of variables in the next output line that references them,
where x is the first variable in a range and y the last variable in a range. If you just want to
force a single variable, repeat the variable name in the function call; in other words, force(x,
x).
fprm( )
Use the fprm command to build a parameter table and populate it with values. This lets you
efficiently extract many parameters at one time and store the values in a table. You must use
the fprmtabl statement to define each table before the fprm can be used. They work together
like this:
n Use the fprmtabl statement to create and name the table where the parameter values will
be stored.
n Use the fprm command to get the actual parameter values from your part file and place
them in the table.
In addition to accessing operation parameters, you can also use this technique to build tables
of machine definition, control definition, or machine group parameters.
table_num the number of the parameter table to populate. This should match the
number in a corresponding fprmtabl statement. This is always required.
mode an optional value that can be used when getting operation or machine
definition parameters.
n For operation parameters (param_type = 0), use the mode value to specify
the type of source operation:
n 0 (or omitted) = regular operation.
n 1 = get values from a transform operation (in other words, an
operation that is the result of a transform).
n 2 = get values from a nesting operation (in other words, an operation
that is the result of nesting).
NOTE
It is your responsibility to make sure that the parameter numbers in your fprmtabl table
make sense for the param_type value in the fprm statement. For example, if the
fprmtabl table contains the numbers of 17000-series machine definition parameters, but
param_type = 2 (for control definition), your parameter table will not be populated
with any values.
The param_type argument is typically required. The only exception is to support backward
compatibility with posts from before Mastercam 2017. In these cases, the fprm statement must
be used as described in the Working with tool and operation parameters—X9 and earlier posts
application guide.
In Mastercam 2017, you can use the fprm command in any postblock. Note that operation
parameters for the first operation are available in the pprep$ postblock; parameters for
subsequent operations are available when the tool change gcodes have been read from the
NCI file. When you are using tlchng_aft$ = 2, operation parameters are available in ptlchg1002$.
You can also use fprm during enhanced tool table processing. When calling the tool table, as
MP iterates through the list, it increments the operation so that calls to fprm will refer to that
specific operation. See the Working with enhanced tool tables application guide to learn more.
Please be aware that if you call fprm during any of the following postblocks, it will
automatically trigger “X9-style” processing.
n pparameter$
n pmachineinfo$
n pwrtt$
n pwrttparam$
n any postblock that is called from one of these
Typically there is no reason for you to include these postblocks in your Mastercam 2017 post
except for backwards compatibility. If that is the case, please see the Working with tool and
operation parameters—X9 and earlier posts application guide for how to support older posts.
NOTE
The fprm command—as well as all other parameter read techniques—was significantly
enhanced in Mastercam 2017.
n Please see the Working with tool and operation parameters application guide for
the most complete information about the new query functions introduced in
Mastercam 2017 as well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
1013 sparameter$
10010 xy_stock
10068 z_stock
15346 comp_type
20001 strtool$
fprmtbl
Define a lookup table for the fprm( ) function. Use the fprmtbl declaration together with
fprm to define a table that will store a set of operation parameters. The declaration is
followed by a list of variables. Each variable will store one of the values retrieved by the fprm
function.
n table number. Each table defined by fprmtbl has its own unique ID number; the
fprm function will use this number so that it knows where to store the parameter
values that it is getting.
NOTE
You can use the fprm function to get either operation parameters, machine definition
parameters (17xxx), control definition parameters (18xxx), or machine group
parameters (19xxx). You should not mix parameters from different categories in the
same table. Always create separate tables for each category of parameter with a
separate fprmtbl declaration.
In addition, when getting machine definition parameters, you should create separate
tables for each component or axis combination.
to automatically load parameters in the proper table for the current operation.
NOTE
The fprm command—as well as all other parameter read techniques—was significantly
enhanced in Mastercam 2017.
n Please see the Working with tool and operation parameters application guide for
the most complete information about learning the new tools, techniques, and
Predefined variables, postblocks, and functions: page 1802
functions.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9
and earlier posts, or if you need to support an X9 post.
fq
Define a user prompt that displays a message to the user and accepts input. Example: fq 1
seqno$ "Enter sequence num"
var numeric or string variable to hold the user input. You must use proper type
(numeric or string) to match expected input.
string the text of the prompt that will be displayed to the user
Predefined variables, postblocks, and functions: page 1804
frac( )
Fractional part. Returns the fractional part of decimal value x. If x=4.56, frac(x) = 0.56
frange( )
Use the frange function to look up a value from a table that has been defined with a flktbl
statement. It looks up (in column 2 of the table) the closest match that is equal to or less than
a value that you provide, and then returns the corresponding value from column 1.
return a variable that stores the value from column 1 of the table
The return values—that is, the values in column 1 of the table—can be either numbers or
strings. However, the lookup values—that is, the values in column 2 of the table—must be
numbers.
10 100
20 200
30 300
pmy_postblock
return = frange (1, my_var)
Predefined variables, postblocks, and functions: page 1806
fs
Define a numeric format for inch or metric output. Example: fs 6 3.4
fs2
Define a numeric format for both inch and metric values. Example: fs2 6 3.4 4,3
x1.y1 inch format: number of digits before and after the decimal point
x2,y2 metric format: number of digits before and after the decimal point. Use a
comma or "." for decimal point, as appropriate.
Predefined variables, postblocks, and functions: page 1808
fsg( )
Use the fsg() function to return a value based on a conditional expression. Use this function
as a compact and efficient alternative to a regular boolean code block.
return a variable to store the return value. This can be either a numeric variable or a
string variable, but its type must be the same as x and y.
x the value that is returned if expression is true (or any non-zero value). This can
be a number, the name of a numeric variable, or a mathematical expression.
y the value that is returned if expression is false (or zero). This can be a number,
the name of a numeric variable, or a mathematical expression.
If you use an expression for any of the arguments instead of a simple variable name, the
recommended best practice is to enclose it in parentheses.
NOTE
x and y can also be strings, but they must be the same type: either both strings, or both
numeric values.
Predefined variables, postblocks, and functions: page 1809
fsg1( )
Test whether expression or variable is positive or negative. Returns 0 if less than 0, or 1 if
greater than or equal to 0.
return 0 or 1
fsg2( )
Test whether expression or variable has a non-zero value. Returns 0 if expression has a zero
value, or returns 1 if expression is not equal to 0.
return 0 or 1
fsg3( )
Test whether expression or variable x is positive, negative, or zero. Returns 0 if x<0, 1 if x=0, 2
if x>0. Often used with string selectors.
return 0, 1, or 2
fstack
Use the fstack declaration to define a data stack in memory. This lets you define, create, and
store records that can be accessed later.
n In a typical stack, new records are added to the top of the stack, pushing existing
records down.
n When you read from the stack, you typically read the top record, and the remaining
records are moved up.
Once you define the stack, use the push( ), pop( ), and turn( ) functions to add and retrieve
records.
Records that are added to the stack are typically read from an implied array, where each
variable in the array represents one field from the record. Similarly, when a record is read from
the stack, it is typically stored in an implied array.
# Define stack
fstack 1 2 # define stack #1 with 2 fields per record
fstrsel
Define a string select table. Example: fstrsel sg00 gcode$ sgcode 4
ger( )
Get SIM/level. Used with the get_sim_ver_lev C-Hook function; returns the value in
position x from the 12-element array created by get_sim_ver_lev.
getncstr( )
Gets the buffered NC output string; the result depends on function mode x. Requires helper
variables for proper use.
getstrval( )
Gets the real value associated with a string.
groupinfo( )
Use the groupinfo function to query the control defintion and get parameter values. The
groupinfo function can be used in any postblock.
return a numeric or string variable to store the return value. Use a string or numeric
variable depending on what type of value you are expecting. It is your
responsibility to determine the proper type
param the number of the parameter that you are querying. These will be the 18xxx
group of parameters. They are listed in the Operation Parameter Reference. param =
–1 triggers parameter dump mode. Please see the Working with tool and operation
parameters application guide or click here to learn more.
If you are interested in getting parameters for stock, remember that stock models are
considered components in the machine definition. This means that depending on how the
stock model is defined—particularly lathe stock models, along with chuck jaws and tailstock
centers—some of the parameters that you are interested in might need to be accessed as
machine definition component properties, instead of machine group properties. Use the
mdinfo function to access these.
NOTE
You can only get parameters for stock models that are defined in machine group
properties or as machine definition components. You cannot access parameters or
values from a stock model operation.
The groupinfo function was introduced in Mastercam 2017, replacing earlier techniques that
relied on the pmachineinfo$ postblock and rd_tlpathgrp$ command. Expand the following section
to learn more about the new capabilities.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9 and
earlier posts, or if you need to support an X9 post.
grpix( )
Returns the base index of a group of values that includes x.
inc_var( )
The inc_var( ) function was introduced in Mastercam 2017 to support the new linked
incremental functionality. Use it to disconnect a parent from its linked variable—temporarily
reversing the effect of the switch in the fmt statement that enables the linked incremental
value. When you do this, the value of the parent variable will be output regardless of the
absinc$ value.
return 0 if the state of var does not change, or 1 if the state of var changes.
Use inc_var( ) to override the absinc$ setting so that the linked incremental value is turned
off and the absolute value is output. Instead of changing the absinc$ setting directly—which
will affect all linked variables—you can use the inc_var( ) function to target just a single
variable at a time.
if absinc$ = one,
[
result = inc_var(zabs, zero) # Disconnect linked incremental, use
absolute for output
zabs = z$ - refht$
]
feed = fr_pos$
comment$
pcan
int( )
Integer part. Returns the integer part of decimal value x. If x=4.56, int(x) = 4.
ior( )
Bitwise inclusive OR operator. Compares each bit of two integers i, j and returns a binary
integer; if either bit is 1, the corresponding bit in the return value = 1, otherwise the return bit
= 0.
launch( )
Use the launch() function to launch and run another program from your post. The program to
be run needs to be an executable file with an .exe extension. (Use the dll( ) function to run a
.dll executable.)
return an integer variable to store the return value. The function returns 0 if
successful, otherwise –1.
progname the name of the program that you want to run, including the extension.
This should be enclosed within quotes. It should include the full path if it is not
located in the same \apps folder as mp.dll.
But the proper format for this depends on how the receiving program expects the
arguments to be presented.
mode an optional argument that indicates whether the new program is to be opened
as a modal dialog.
n If this value is 0, Mastercam will be locked and post processing will be
suspended until the new program is closed.
n If this value is 1, Mastercam can be used while the new program is open.
NOTE
The mode parameter was added for Mastercam X8 and is not supported in earlier
versions of Mastercam. If it is not included, the launch command will be processed as
if mode = 0 were specified.
When nesting quotes, use double-quotes " " for the inner set, and single-quotes ' ' for the
outer layer. If you are only using a single set of quotes, use double-quotes.
ppost # ppost is run AFTER all the files processed by MP are closed!
result = launch(strEXE, strfilename, 1)
Predefined variables, postblocks, and functions: page 1827
lcase( )
Lower-case. Return is string s converted to all lower-case.
lng( )
Length (2D). Returns the length of a 2D vector.
lng3( )
Returns the length of a 3D vector.
v 3D vector
Predefined variables, postblocks, and functions: page 1830
log( )
Natural logarithm.
log10( )
Base-10 logarithm.
matt( )
Transpose a matrix.
mdinfo( )
Use the mdinfo function to query the machine defintion and get parameter values. The
mdinfo function can be used in any postblock.
return a numeric or string variable to store the return value. Use a string or numeric
variable depending on what type of value you are expecting. It is your
responsibility to determine the proper type
param the number of the parameter that you are querying. These will be the 17xxx
group of parameters. They are listed in the Operation Parameter Reference.
The mdinfo function was introduced in Mastercam 2017, replacing earlier techniques that
relied on the pmachineinfo$ postblock, rd_md$ command, and rd_mch_ent_no$ helper variable.
Expand the following section to learn more about the new capabilities.
This makes it much more efficient. In addition, the acomboinfo( ) function makes it much easier
to get information about the components in your machine definition, so you can easily target
the specific components that you want to get parameters from.
While the older techniques still work in Mastercam 2017 to maintain compatibility with posts
that have been migrated from older versions, newer posts for Mastercam 2017 and later should
typically be written to use the mdinfo function.
n Please see the Working with tool and operation parameters application guide for the most
complete information about the new query functions introduced in Mastercam 2017 as
well as related tools and techniques.
n Please see the Working with tool and operation parameters—X9 and earlier posts
application guide for complete information on how these functions worked in X9 and
earlier posts, or if you need to support an X9 post.
The mdinfo function also has two special modes:
n You can use it to query whether a specific type of component—for example, a B-axis—is
included in an axis combination.
n Modes –1 and –2 are parameter dump modes. Click here to learn more.
Please see the Working with tool and operation parameters application guide for complete
information about these modes.
To get the entity ID of the Z-axis component, first use acomboinfo in mode 1. This returns
the entity IDs for X-Y-Z-A-B-C axes in that order and stores them as an array. Then use
the vlout function to get the entity ID for the Z-axis, since you know it is stored two
places from the X-axis value.
Example
entid_x : 0 # entity ID of X axis for current axis combo
entid_z : 0 # entity ID of Z axis for current axis combo
z_min_inch : 0 # inch travel limit
z_min_mm : 0 # metric travel limit
mmul( )
Multiply matrix m1 by matrix m2..
m1 first matrix
m2 second matrix
Predefined variables, postblocks, and functions: page 1837
modfs( )
Modify format statement. Updates the definition of format statement n; the value of x
indicates which option to be updated. Returns 1 if successful, otherwise 0.
mprint( )
Displays a pop-up message x, where x can be either a string or a number. n is optional and
indicates the number of the Windows-standard button layout to include with the message. For
example, you can include OK, Cancel, or other Windows-standard buttons.
return a numeric variable to store the return value. The type of return value depends
on whether you use the second argument to add buttons to the message.
n If you don't include n and just use the form mprint(x), the function
returns 0 if x is numeric, or 1 if it is a string.
n If you do include n and use the form mprint(x, n)—and n is greater than
0—the return value indicates which button was pressed:
n 1 = OK
n 2 = Cancel
n 3 = Abort
n 4 = Retry
n 5 = Ignore
n 6 = Yes
n 7 = No
x the content of the message to display. This can be either a number or a string.
n an optional code indicating which buttons will be included in the message box.
The following button layouts are supported:
n 1 = Single button: OK
n 2 = Two buttons: OK and Cancel
n 3 = Three buttons: Abort, Retry, and Ignore
n 4 = Three buttons: Yes, No, and Cancel
n 5 = Two buttons: Yes and No
n 6 = Two buttons: Retry and Cancel
Predefined variables, postblocks, and functions: page 1839
mteq( )
Copy a matrix.
m1 a matrix
Predefined variables, postblocks, and functions: page 1840
newfs( )
Assign new format statement. Assigns the format statement n to variable x, replacing the
existing assignment. Returns 1 if successful.
no2asc( )
ASCII-to-string. Returns the string character whose ASCII code is x, where x is 1-255.
no2str( )
Number-to-string: s = no2str(x). Returns the formatted value of x as a string. See also drs_str.
not( )
NOT operator. Reverses the result of the conditional expression x.
nwadrs( )
Update address (prefix). Assigns s as the new prefix string for the format associated with
variable x. Returns 0 if s was truncated to 15 characters.
nwadrsval( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1846
nwsufx( )
Use the nwsufx() function to change the string suffix that is appended to a variable when it is
output. It is a companion to (and works the same way as) the nwadrs() function, which lets you
change the prefix.
return an integer variable to store the return value. The function returns 1 if
successful, otherwise 0.
var the name of the numeric variable to whose value you want to add the suffix
The suffix is only applied once, when the function used. The next time the number is output,
it will use whatever suffix is assigned in the format statement.
Note that in this example, we needed to use the ASCII value of 35 to represent the #
character—otherwise MP would interpret the rest of the line as a comment.
Predefined variables, postblocks, and functions: page 1847
nwsufxval( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1848
opchng( )
Use the opchng function to update the tt_ enhanced tool table variables anywhere in your
post outside of the ptooltable$ postblock. Also, you can use the opchng function to update the
tt_ variables to any operation in the operation list, not just the current one.
Importantly, the opchng function will also update the previous values of the tt_ variables (
prv_tt_ ) to the tt_ values for the previous operation. So if you use the opchng function
more than once, please understand that the prv_tt_ values will behave differently than you
might expect.
return a numeric variable to store the return value. The return value indicates the
success or failure:
n –2 = no values could be obtained.
n –1 = the prv_tt_ values could not be obtained. This is expected with the
first operation.
n 0 = the tt_ values could not be obtained. This is expected with one
operation past the list end.
n 1 = both sets of values were obtained successfully.
opnum indicates the operation for which you want to populate the tt_ variables. Use
0 to specify the current operation; any other value (positive or negative) is
interpreted as an offset from this. For example, a value of 2 would look ahead two
operations, while –1 would indicate the previous operation.
When opchng updates the prv_tt_ variables, these will be set to the values for the operation
preceding the operation referenced by opnum. For example, if you use opchng( 3 ) to get
values for three operations ahead, the prv_tt_ variables will be set to the values for two
operations ahead.
As an alternative to opchng, if you are using the opinfo function to access the enhanced tool
table data, you can update the tt_ values at the same time with opinfo. Use the optional third
argument in the opinfo function to do this. Set the 100s digit to 1 to populate the tt_ variables.
For example:
next_misc_int = opinfo(33, 1, 100)
In this example, opinfo will update all of the enhanced tool table data to values from the next
operation in the list, and then capture parameter 33 (the value of misc integer 4) from that
operation.
Predefined variables, postblocks, and functions: page 1849
opinfo( )
Use the opinfo function to retrieve operation and tool parameters. Use it to get information
from any of three different sources:
n Operation parameters (in other words, parameters numbered from 10000–16999 and
above 30000).
n NCI data. This includes the tool parameter lines numbered above 20000 as well as any
other NCI line above 950.
n Enhanced tool table data.
Quick start: The most common use of the opinfofunction is very simple; just specify the
parameter number and return variable. For example, to get parameter 10020 (clearance
height), place the following statement in any postblock:
clearance_ht = opinfo(10020, 0)
The opinfo function was introduced in Mastercam 2017, replacing earlier techniques that
relied on the pparameter$, pwrtt$, and pwrttparam$ postblocks. Expand the following section to
learn more about the new capabilities.
return
Predefined variables, postblocks, and functions: page 1850
a numeric or string variable to store the return value. Use a string or numeric
variable depending on what type of value you are expecting. It is your
responsibility to determine the proper type
param a number that specifies the data that you are querying. You can query three
types of data, depending on the range of this number:
n Values from 10000–16999 and from 40000+ (“10000s parameters”) will return the
value of the specified operation parameter. This can be either a string or
numeric value, depending on the specific parameter queried.
n Values from 950–1056, and from 20000–29999, will return a string that contains
all the values from the specified NCI line. Parse the string to extract the desired
value.
n Values from 1–106 let you directly access enhanced tool table data. Enhanced
tool table data was introduced in Mastercam 2017 and does not apply to earlier
versions of Mastercam.
n Values –1 and –2 are special parameter dump modes. Click here to learn more.
Please see the Working with tool and operation parameters application guide for complete
information about these modes.
source_op a number that identifies the operation whose parameters are being queried.
For example, you can get the value of parameter 14752 from the current
operation, or the next operation. You can specify the operation in a number of
different ways—the current operation, an offset from the current operation, or an
absolute op_id$ value. Expand the "Selecting an operation to query" section below
to learn more.
mode an optional four-digit “license plate” value that provides the context for the
source_op value. Expand the "Selecting an operation to query" section below to
learn more.
NOTE
The param and source_op arguments are required; mode is optional. When mode is
omitted, it is the same as value 0.
NOTE
n The pparameter$, pwrtt$, and pwrttparam$ postblocks should not be present in your
post if you use the opinfo function in your post. If any of these postblocks are
present, Mastercam will still loop repeatedly through all of the parameter/NCI
structures. See section "Migrating a post from X9-style to 2017-style" in the
Working with tool and operation parameters application guide for more
information about implementing opinfo in an existing post.
n The opinfo function is not designed to access machine definition, control
definition, or machine group parameters—in other words, parameters numbered
Predefined variables, postblocks, and functions: page 1851
Value
of How it affects “source_op” argument
“mode”
nnn2 Value of source_op is the stream sequence. The sequence of operations = those operations
for which a 999 line exists in NCI file. This lets you query operations for which no tool change
exists, such as probing, manual entry, or POCO operations.
Value
of Effect
“mode”
1nnn Enable multiple processing for multiple instances of the specified param value. Helper variable
t1$ stores the count of which instance is being processed. Use this in a while loop that is linked
to t1$ value.
This is only effective when 1s digit = 1 (mode = nnn1).
plcval( )
Place value function. If s is a string representing a number (e.g. 12.435), this function returns
the digit at position n, where n is a positive or negative offset from the decimal point.
Use the plcval function to scan a string of numerals and return a single digit as an integer
value. It is typically used as a compact, efficient method to implement sophisticated switching
logic in your posts. For example, you might use this to extract a single digit from a “license
plate” variable like arccheck$. The original number that you are searching can be either a
numeric variable or it can be stored in a string.
The plcval function locates the desired digit based on an index value that you supply. It
searches to the left or right of the decimal point depending on the sign of the index value.
n A positive index value searches to the left of the decimal point.
n A negative value searches to the right.
For example, if my_string = 741852.367258, then plcval(my_string,–3) would return 7.
index how many places to the left or right of the decimal point to find the digit. A
positive number searches to the left of the decimal point, a negative number to
the right. Note that if variable is a numeric variable, the index should be
between 9 and –9.
The ability to search a numeric variable was added in Mastercam X3. Before X3, plcval was
only used to scan strings.
Note that if you are using plcval with a numeric argument, you should limit the numeric
value to 12 significant digits. Because your computer internally stores real values in logarithmic
form, the stored value might not be exactly what you expect. Please test your post carefully if
you are using a numeric argument, especially if you are retrieving a digit that represents a very
small fraction.
Predefined variables, postblocks, and functions: page 1854
pop( )
Gets a record from a stack. The stack must already have been created with the fstack
command.
value the first variable in an implied array. Each variable represents a field in the
record that will be retrieved from the stack. As MP reads the record from the
stack, each field will be stored in a variable in the array
option a numeric variable. For most modes, this will store the result of the operation:
either 1 or 0 for success/failure in getting the record. However, some modes use
this value differently as described below. Regardless, it is required that option be
the name of a variable, not just a number.
You can query the stack in any of several different ways. This is determined by the value of the
mode parameter.
n –1 = Write the data record to a buffer that has been previously defined with the fbuf
statement. In this case, option indicates the number of the buffer where the data will
be stored. The success/fail code will be stored in value. Note that because fstack does
not support string data, the buffer must be defined as a real data buffer, not a string
buffer.
n 0 = Return the number of records in the stack. The number will be stored in value.
n 1 = Get the top record from the stack, write it to the array, and remove it from the
stack.
n 2 = Remove the top record from the stack without writing it to the array. In this case,
both value and option will store the success/fail value.
n 3 = Get the top record from the stack, write it to the array, but leave it in the stack.
n 4 = Remove multiple records from the stack. The success/fail code will be stored in
value .
In this case, the option value indicates the number of the first record to be deleted,
and its sign indicates whether to delete the records before or after it.
n If option is positive, pop() will delete that record and all records below it in the
stack. For example, if there are 12 records in the stack, and the value of option
is 5, records 5–12 will be deleted.
Predefined variables, postblocks, and functions: page 1855
n If option is negative, pop() will delete that record and all records above it in
the stack. For example, if there are 12 records in the stack, and the value of
option is –5, records 1–5 will be deleted.
n If the value of option is –1, 0, or 1, all the records in the stack will be deleted.
n 5 = Get a specific record from the stack, write it to the array, but leave it in the stack.
In this case, option indicates the number of the record to get. (Note that the top
record is record number 1; 0 is not a valid index value.)
Note that the success/fail code will be handled differently in this case. If you consider
option to be the first element in an implied 2-element array, the success/fail code will
be written to the second element. For example:
stack_index = 7
pop_result = 999
In this case, the result would be written to pop_result, where stack_index and
pop_result together define a 2D array.
n 6 = Works just like mode 5, but the record is removed from the stack.
n 7 = Get the bottom record from the stack, write it to the array, and remove it from the
stack.
Predefined variables, postblocks, and functions: page 1856
prvneq( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1857
push( )
Adds a record to a stack. The stack must already have been created with the fstack command.
value the first value in an implied array whose elements comprise the record to be
added
option numeric variable. For most modes, this will store the result of the operation:
either 1 or 0 for success/failure in creating the record. However, some modes use
this value differently as described below. Regardless, it is required that option be
the name of a variable, not just a number.
You can add the new record to the stack in any of several different ways, according to the
mode value.
n –1: Read values from a buffer that has been previously defined with the fbuf statement.
In this case, option indicates the number of the buffer from which to read the data.
MP will iterate the buffer, empty the stack, and then copy the data from the buffer to
the top of the stack. The success/fail code will be stored in value. Note that because
fstack does not support string data, the buffer must be defined as a real data buffer,
not a string buffer.
n 0: Push record (indicated by value) to the top of the stack. This is the default mode.
n 1: Push record to the bottom of the stack.
n 2: Push record below a specified record in the stack. In this case, option indicates the
number of the record below which the new record will be inserted. (Note that the top
record is record number 1; 0 is not a valid index value.)
Note that the success/fail code will be handled differently in this case. If you consider
option to be the first element in an implied 2-element array, the success/fail code will
be written to the second element. For example:
stack_index = 7
push_result = 999
In this case, the result would be written to push_result, where stack_index and
push_result together define a 2D array.
Predefined variables, postblocks, and functions: page 1858
raw( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1859
raw3( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1860
raw6( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1861
raw9( )
[Reserved for future use]
Predefined variables, postblocks, and functions: page 1862
rbuf( )
Read a record from a buffer.
return numeric variable. This represents the beginning of an array that will store the
values read from the buffer.
remove( )
Deletes the file whose path and name are represented by s. Returns 0 if successful, -1
otherwise.
rename( )
Rename file. Renames the file whose path and name are represented by s1 to s2. Returns 0 if
successful, -1 otherwise.
rot( )
Rotate a 2D vector x by angle a, and returns the rotated vector.
return A numeric variable which represents the first element of a two-element array.
v .
The vector to be rotated, where v represents the first element of a two-element
array.
Predefined variables, postblocks, and functions: page 1866
rotp( )
Rotates a 3D vector around a pivot point that you specify. Returns the rotated vector.
Requires helper variables to set rotation axis (axisx$, axisy$, axisz$) and pivot point (ptfixx$,
ptfixy$, ptfixz$).
return A numeric variable which represents the first element of a three-element array.
rotv( )
Rotates 3D vector. The pivot point is the origin. Requires helper variables to set rotation axis
(axisx$, axisy$, axisz$).
return A numeric variable which represents the first element of a three-element array.
round( )
Round value. Rounds the value of x to nearest whole number.
rpar( )
Get individual operation parameters from a string of values. Typically this is used to retrieve
all the parameters from a 20000s line. It will store them in an array of user-defined variables.
return numeric variable that indicates the beginning of an implied array. The
variables are filled sequentially beginning with return.
Two helper variables contain the beginning and ending positions of the parameters that were
read:
n The variable st_str_ix$ holds the starting position of the first parameter.
n The variable end_str_ix$ holds the ending position of the last parameter.
For example, if the parameters that you are reading occupy characters 47 through 81 in the
string, st_str_ix$ would equal 47, and end_str_ix$ would equal 81.
hd_ax_x = rpar(sparameter$, 9)
Predefined variables, postblocks, and functions: page 1871
rparsngl( )
Read a single parameter from a string of values, where n is the location of the parameter
within the string. For example, if there are 8 parameters in the string, and you want to read
parameter 5, the value of n would be 5.
Two helper variables contain the beginning and ending positions of the parameter from the
original string:
n The variable st_str_ix$ holds the starting position.
n The variable end_str_ix$ holds the ending position.
For example, if the parameter that you are reading occupies characters 47 through 51 in the
string, st_str_ix$ would equal 47, and end_str_ix$ would equal 51.
rparsprm( )
Read a range of parameters from the current 2xxxx line, represented by the current value of
sparameter$.
Two additional helper variables contain the beginning and ending positions of the parameters
that were read:
n The variable st_str_ix$ holds the starting position of the first parameter.
n The variable end_str_ix$ holds the ending position of the last parameter.
For example, if the parameters that you are reading occupy characters 47 through 81 in the
string, st_str_ix$ would equal 47, and end_str_ix$ would equal 81.
In addition, this function depends on the sparameter$ string as another helper variable:
runvbs( )
Run VB script, where s is the path and name of the VB script to be run. Return value is always
1.
scan( )
Use the scan() function to find a number within a string. Given two strings, s1 and s2, if s1 is a
substring of s2, the scan() function finds and returns the first number after s1. For example, if
s2 = “G1 X1.5 Y2.3 Z4.5” and s1 = “X”, the scan function would return 1.5.
It is important to note that even though you are extracting the number from a string, it is
returned as an actual number, not a string representation of a number. This means your return
variable needs to be a numeric variable, not a string.
MP provides two useful helper variables:
n st_str_ix$ is the position in string s2 where s1 begins.
n end_str_ix$ is the first position in string s2 after s1 ends that isn’t a space, number, “.”
character or “-” character.
return a numeric variable to store the return value. If successful, the function returns
the first number in string s2 following s1, otherwise it returns –9999
s2 the main string that contains the substring and number that you hope to find.
pblock # A postblock
bar_size = scan(string1, string2)
In this example, bar_size equals 0.625. The helper variable st_str_ix$ equals 11, and end_
str_ix$ equals 26.
Predefined variables, postblocks, and functions: page 1876
setinc_var( )
Use a different variable than absinc$ as the absolute/incremental indicator for a specific
variable.
setncstr( )
Use the setncstr() function to manage a list of files that is passed to the editor. Use it to
build the list of files that the editor will open when posting is finished. This function is used
most often when your NC output is distributed among more than one file, or your post needs
to create multiple files, in a single posting session.
return an integer that indicates whether or not the function was successful: 1 if the
function was successful, otherwise 0.
mode an integer or integer variable that indicates the operating mode of the function.
Valid values are 2, 3, and 4.
n A value of 2 indicates that the file indicated by filename is to be added to
the list of files that will be opened by the editor.
n A value of 3 indicates that the file indicated by filename is to be removed
from the list of files that will be opened by the editor.
n A value of 4 indicates that filename specifies the actual editor to be
opened. This should be the full path and name of the editor’s .EXE file.
This overrides the editor that is selected in the user’s configuration file:
If the specified editor is not found (or the string is empty), then the editor
from the configuration file is used. (This value is not supported in
Mastercam X7, only X8 and later.)
filename a string that indicates the full path and filename as described in mode. If you
are using a literal string, enclose it in double-quote marks (" ")
Predefined variables, postblocks, and functions: page 1878
num a two-digit code that controls the editor’s behavior. (This parameter is only valid
when mode=4. It is not supported in Mastercam X7, only X8 and later.)
n When the right (1’s) digit is 0, Mastercam will pause until the editor is
closed. This matches the behavior of Mastercam versions before X7. If
multiple files have been sent to the editor, Mastercam will pause after each
editor session. Use a value of 1 to leave Mastercam running and active along
with the editor window.
n When the left (10’s) digit is 0 (or omitted), Mastercam will create a
separate instance of the editor for each file. Use this to guard against
situations when an editor might not be able to accept multiple files. When
this digit is 1, Mastercam will supply the multiple-file list to the editor. This
is appropriate for editors like Mastercam’s Code Expert Editor, which
support having multiple files open at the same time, with each document in
a separate tab.
Note that this behavior is “hard-wired” for the editor options that come from
Mastercam’s configuration file; in other words, the ones listed here:
n The MASTERCAM editor (in other words, the Code Expert Editor),
CIMCO, and PFE options automatically behave like the left digit is 1.
n The NOTEPAD option automatically behaves like the left digit is 0.
n The editor that you select with OTHER will behave however you set the
left-digit option in the post.
You can override the behavior of the standard editors by including a setncstr() statement in
your post with mode=4, and explicitly referencing the .EXE file for that editor. (But don’t
override the NOTEPAD option—Notepad will not work correctly if you do.)
setseloffs( )
Set selection offset. Sets the real return value of a string from a string select table (specified by
s) equal to an offset n from the zero index. n is typically returned from the grpix function.
setselrtn( )
Sets the value to be used as the overflow/underflow error for a string selector.
setselsel( )
Changes the selector variable for a string selector.
setselsiz( )
Resize string selector table to size n.
setselund( )
Changes the underflow code of string selector table s (typically, from -1) to code n.
setstrval( )
Sets the value of a string s to a new value. The new value can be either a string or number
value.
x the new value of the string. This can be either a numeric variable or another
string.
Predefined variables, postblocks, and functions: page 1886
sin( )
Sine: returns the sine of angle a.
a angle in degrees
Predefined variables, postblocks, and functions: page 1887
slin( )
Copy string to index location: s = (n, base_string). Given an array of strings, copy string s to
the string variable located at offset n from the base_string.
slout( )
Get string from index location. Given an array of strings, get the string located at a specified
offset from a base string.
sqrt( )
Square root. Returns the square root of x.
streaminfo( )
Use the streaminfo function to query an operation from the enhanced operation list. The
enhanced operation list includes all operations that have an NCI 999 line. This lets you access
operations that do not have a NCI traditional tool change line (1000, 1001, 1002), such as
probing operations, misc ops or part handling operations, and manual entry operations.
param a number that specifies the data that you are querying. See the table below for
lists of possible values.
The streaminfo function lets you query a subset of the enhanced tool table data as described
in the following table. See the Working with enhanced tool tables application guide to learn
more.
1 Operation ID
5 Stream ID
10 (internal use)
strlen( )
String length. Returns the length of string s.
strstr( )
Use the strstr() function to determine if one string is a sub string of a second string. Given two
strings, s1 and s2, if s1 is a substring of s2, the strstr() function returns the start index of s1
within s2, or 0 if no match is found.
The helper variable end_str_ix$ is the first position in string s2 after s1 ends. The helper variable
st_str_ix$ is also active, but since its value is equal to the return value (the start position of the
string) it is not very useful.
This example finds the location of M320 inside another string.
string1 : "M320"
string2 : "Fanuc M320ABC"
result : 0
pblock # A postblock
result = strstr(string2, string1)
In this example, result equals 7. The helper variable end_str_ix$ equals 11.
return a numeric variable to store the return value. If successful, the function returns
the position of s1 within s2, otherwise it returns 0.
sysinfo( )
Use the sysinfo() function to get information about the current user; in other words, the
user who posted the part for the current NC file.
result integer variable that indicates whether or not the function was successful: 1 if
the function was successful, otherwise 0.
mode a number or numeric variable that indicates the format in which you want the
user data returned. Valid values are from 0–9.
This function is essentially a wrapper for the Windows WINAPI function GetUserNameEx.
The different function states present the user name in a variety of different formats; these
different formats correspond to the EXTENDED_NAME_FORMAT enumerations defined in the
WINAPI.
The following table illustrates the output from each of the different modes. The sample output
assumes the user is named John R. Martin, working for a company called Acme, with network
domain ACME.COM.
0 NameUnknown None
A detailed discussion of the different extended name formats is outside the scope of this
document; please visit this page on Microsoft’s MSDN site to learn more about the EXTENDED_
NAME_FORMAT enumerations, and this page to learn more about GetUserNameEx.
sresult = sysinfo(result, 3)
sopen_prn, "Posted by: ", sresult, sclose_prn, e$
tan( )
Tangent. Returns the tangent of angle a.
a angle in degrees
Predefined variables, postblocks, and functions: page 1897
turn( )
Use the turn( ) function to cycle the records in a stack. In other words, move the bottom
record to the top and shift the other records down. You can also do the opposite: move the
top record to the bottom, and shift the other records up. The stack must already have been
created with the fstack command and contain at least two records.
t_list( )
Beginning with Mastercam 2017, MP includes new routines that make it easier for you to
access information about the tools used in your part program. This includes a redesigned tool
list. The new tool list includes the following features:
n It includes probes in addition to standard tools.
n It is built and maintained outside of the NCI pre-read processes that have traditionally
been the source of tool information, so you can access it anywhere in your post
independently of which operation is currently being processed.
The t_list( ) function lets you access the new tool list. You can use t_list( ) to query
regular tools, probes, or both, whichever is appropriate for your application.
MP builds the new tool list automatically when you initiate posting. Because it is independent
of the NCI pre-read process, you don’t need to rely on the pwrtt$ postblock to access it. This
makes the t_list( ) function an ideal complement to the x_tooltable$-based enhanced tool
table routines.
return a numeric variable to store the return value. For most of the function modes
this is the number of a specific tool or probe, but see the table "t_list function
states" below for a complete list.
mode the function state (0–16) that tells MP exactly what you are searching for.
These are described in the table "t_list function states" below.
status a coded value that provides additional context about the value that is returned.
This is a “license plate” value where each digit describes a specific property. These
are described in the table "codes for status digits" below.
index the position within the tool list of the selected tool or probe. This gets used in
two ways:
n When you call t_list( ), in most function modes this will determine
where in the tool list to begin searching.
n When t_list( ) returns, this will be set to the position of the tool or
probe that has been found.
For all function modes, index is optional. Its value is set just prior to the
ptlchng1002$ postblock call. If you do not include index , the search will begin by
default with the operation that is currently being processed by the NCI. If you are
calling the t_list( ) function before the NCI has begun processing (for example,
in pheader$), MP will simply start at the beginning of the tool list.
Predefined variables, postblocks, and functions: page 1899
0 The tool number of the first Start position for search. The value of index will be
tool or probe. set to the postion of the tool
or probe.
1 The tool number of the first Start position for search. The value of index will be
standard tool (in other set to the postion of the tool.
words, not a probe).
2 The number of the first Start position for search. The value of index will be
probe. set to the postion of the
probe.
3 The tool number of the next The next tool or probe after The value of index will be
tool or probe. the index value. set to the postion of the tool
or probe.
4 The tool number of the next The next tool after the The value of index will be
standard tool (in other index value. set to the postion of the tool.
words, not a probe).
5 The number of the next The next probe after the The value of index will be
probe. index value. set to the postion of the
probe.
6 The number of the tool or The next tool change after The value of index will be
probe referenced in the next the index value. set to the postion of the tool
change. or probe.
7 The number of the tool The next tool change after The value of index will be
referenced in the next the index value. set to the postion of the tool.
standard (non-probe) tool
change.
8 The number of the next The next tool change after The value of index will be
probe. the index value. set to the postion of the
probe.
9 The tool number of the last Start position for search. The value of index will be
tool or probe in the tool list. set to the postion of the tool
or probe.
10 The tool number of the last Start position for search. The value of index will be
standard tool (in other set to the postion of the tool.
words, not a probe).
Predefined variables, postblocks, and functions: page 1900
11 The number of the last Start position for search. The value of index will be
probe. set to the postion of the
probe.
16 The status code (see next The index position to query. Unchanged.
table) of the tool at the If not present, MP will
referenced index position. query the current tool.
The following table describes the status codes that are set by the t_list( ) function. Note
that values 0 through –3 are not “license plate” values, but are ordinary integers; you can
implement simple logic in your post to test for these error states before trying to evaluate the
other values.
–3 Error scanning the tool list; the beginning of the list was overrun.
–2 Error scanning the tool list; the end of the list was overrun.
nnnnn1 The returned tool number was the first in the list.
nnnnn2 The returned tool number was the first of its type (standard tool or probe) in the
list.
nnn1nn The tool change for the returned tool number was the last in the list.
nnn2nn The tool change for the returned tool number was the last of its type (standard
tool or probe) in the list.
nn1nnn The returned tool number was the last in the list.
nn2nnn The returned tool number was the last of its type (standard tool or probe) in the
list.
ucase( )
Upper-case: return = ucase( s ). Return is string s converted to all upper-case.
uidinfo( )
Use the uidinfo function to get information about specific components from the NCI 20600
lines, as well as other properties of the components.
The most common use of this function is to get the axis label and selected other properties of
the component. For properties that are available with this function, using the uidinfo
function can be easier and more straightforward than querying the parameter number. See the
screen images below to see which axis properties can be queried with the uidinfo function.
You can use the uidinfo function in any postblock where you need the information.
return numeric or string variable to store the return value. Mastercam will
automatically return either the numeric entity ID or the string UID depending on
the type of variable you use for return.
function_state a number that tells MP what information you are looking for. The
table later in this topic lists all of the function states.
component_ID the ID of the component that you are querying. You can use either
the numeric entity ID or the string ID.
In most cases, the process of using uidinfo to drill down to specific components begins with
the entity ID of the current axis combo. This is output on the NCI 950 line (parameter 4) and
is available as the syncaxis$ variable. This variable stores the numeric entity ID of the axis
combo for the current operation. Many times you will simply use uidinfo as the second
argument in the uidinfo function call, particularly when using function states 5–9.
Function
Purpose of query Return value (success / failure)
state #
Get the numeric entity ID of the axis 0 Number. Failure value = –999999.0
combination, based on the string ID.
Get the string for the component’s absolute 1 String with axis label. On failure, there is no
axis label. change in the value of the return variable.
Get the string for the component’s 2 String with axis label. On failure, there is no
incremental axis label. change in the value of the return variable.
Get the string for the user-defined 3 String with axis label. On failure, there is no
component name. change in the value of the return variable.
Get the state of the diameter output option. 4 1 if diameter option is selected.
Get positioning type for a rotary axis 5 0 if not a rotary axis; 1= signed continuous; 2
component. = 0–360, shortest distance; 3 = 0–360, signed
direction. Negative value for reversed.
Get the string ID of the component, based 6 String. On failure, there is no change in the
on the numeric entity ID. value of the return variable.
if ent_id_x > 0,
[
str_x_out_abs = uidinfo(1, ent_id_x)
str_x_out_inc = uidinfo(2, ent_id_x)
]
else, str_x_out_abs = "X", str_x_out_inc = "U"
if ent_id_y > 0,
[
str_y_out_abs = uidinfo(1, ent_id_y)
str_y_out_inc = uidinfo(2, ent_id_y)
]
else, str_y_out_abs = "Y", str_y_out_inc = "V"
if ent_id_z > 0,
[
str_z_out_abs = uidinfo(1, ent_id_z)
str_z_out_inc = uidinfo(2, ent_id_z)
]
else, str_z_out_abs = "Z", str_z_out_inc = "W"
if ent_id_c > 0,
[
str_c_abs = uidinfo(1, ent_id_c)
str_c_inc = uidinfo(2, ent_id_c)
]
else, str_c_abs = "C", str_c_inc = "H"
Predefined variables, postblocks, and functions: page 1908
unforce( )
Removes the force attribute from a specified range of variables, where x is the first variable in a
range and y the last variable in a range. If you just want to unforce a single variable, repeat the
variable name in the function call; in other words, unforce(x, x).
updgbl( )
Update global variable. Changes the definition of the global variable to the equivalent of glob_
var = var1.
updstr( )
Update the target variable for a string selector
vad( )
Vector addition (2D). Adds two 2D vectors v1 and v2.
return A numeric variable which represents the first element of a two-element array.
v1 The first vector. v1 and v2 each represent the first element of a two-element array.
vadd( )
Adds two 3D vectors.
return A numeric variable which represents the first element of a three-element array.
vaxb( )
Cross product of two unitized 3D vectors (x, y, z).
return A numeric variable which represents the first element of a 3D vector (three-
element array).
veq( )
Vector copy (2D). Returns a copy of a 2D vector.
return A numeric variable which represents the first element of a two-element array.
vequ( )
Vector copy (3D). Returns a copy of a 3D vector.
return A numeric variable which represents the first element of a three-element array.
vlh( )
Rotate 2D vector 90-degrees CCW (left-hand). Returns rotated vector.
return A numeric variable which represents the first element of a two-element array.
vlin( )
Copy variable to index location. Given an array of variables, copy x to the variable located at
an offset from a base variable.
mode this is an optional parameter that determines whether to use extended values or
regular values.
This was introduced in Mastercam 2017 to support the extend$ variable. It is a two-
digit “license plate” value:
n Set the right digit to 0 to use the standard value of x; set to 1 to use the
extended value of x.
n Set the left digit to 1 to apply the current value of extend$ when reading x,
where x is considered a target variable.
So the possible values for option are as follows:
n 00 (or omitted completely) = use standard value of x .
n 01, 11 = use extended value of x .
n 10 = use extended value of x if extend$ has been set to 2 or 3.
Predefined variables, postblocks, and functions: page 1918
vlout( )
Get value from index location. Given an array of variables, get the value of the variable
located at offset n from a base variable and store it in var2. extend$
mode this is an optional parameter that determines whether to use extended values or
regular values.
This was introduced in Mastercam 2017 to support the extend$ variable. It is a two-
digit “license plate” value:
n Set the right digit to 0 to use the standard value of var2; set to 1 to use the
extended value of var2.
n Set the left digit to 1 to apply the current value of extend$ when reading
var2 , where var2 is considered a target variable.
So the possible values for option are as follows:
n 00 (or omitted completely) = use standard value of var2 .
n 01, 11 = use extended value of var2 .
n 10 = use extended value of var2 if extend$ has been set to 2 or 3.
Predefined variables, postblocks, and functions: page 1919
vmap( )
Maps the vector v (defined relative to top view) to matrix m. Returns the mapped vector.
return a 3D vector
v vector to be mapped
m mapping matrix
Predefined variables, postblocks, and functions: page 1920
vnr( )
Unitize vector (2D). Unitizes vector v; in other words, scales the vector to a length of 1.
Returns the unitized vector.
return A numeric variable which represents the first element of a two-element array.
vnrm( )
Unitizes a 3D vector; in other words, scales the vector to a length of 1. Returns the unitized
vector.
return A numeric variable which represents the first element of a three-element array.
vrh( )
Rotate 2D vector 90-degrees CW (right-hand). Returns rotated vector.
return A numeric variable which represents the first element of a two-element array.
vsa( )
Resize vector (2D). Scales 2D vector to length x. Returns scaled vector.
return A numeric variable which represents the first element of a two-element array.
vsb( )
Vector subtraction (2D). Subtracts 2D vector v2 from vector v1.
return A numeric variable which represents the first element of a two-element array.
v1 The first vector. v1 and v2 each represent the first element of a two-element array.
vsc( )
Scale vector (2D). Multiplies 2D vector by scalar factor. Returns scaled vector.
return A numeric variable which represents the first element of a two-element array.
vsca( )
Scales 3D vector v to length x. Returns scaled vector.
return A numeric variable which represents the first element of a three-element array.
vscl( )
Scale vector. Multiplies 3D vector v by scalar factor x. Returns scaled vector.
return A numeric variable which represents the first element of a three-element array.
vsub( )
Subtracts 3D vector v2 from vector v1.
return A numeric variable which represents the first element of a three-element array.
v1 The first vector. v1 and v2 each represent the first element of a three-element
array.
wbuf( )
Write to buffer at position x. The values to be written are in the array beginning with var; this
means that there is no true return value.
var numeric variable. This represents the beginning of an array whose values will be
written to the buffer.
n1 the position within the buffer where the values will be written
Predefined variables, postblocks, and functions: page 1930
xaa( )
Find arc intersection. Finds the intersection of two planar arcs a, b. Returns two 3D vectors
representing the two intersection points.
xla( )
Find intersection of line and arc. Finds the intersection of arc a and line x. Returns two 3D
vectors representing the two intersection points.
xll( )
Find intersection of two lines. Finds the intersection of two lines x1 and x2. Returns the
intersection point.
xor( )
Bitwise exclusive OR operator. Compares each bit of two integers i, j and returns a binary
integer; for each bit in i and j, if the values of that bit in i and j are different, that bit in the
return value = 1, otherwise the return bit = 0.