MP Online Reference 2018

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1935

Predefined variables,

postblocks, and functions


(Mastercam 2018)
revision date: Feb. 10, 2017

Contents:
NCI lines
Variables and strings
Predefined postblocks
Functions and declarations

Note: This is a PDF version of the "MP online reference"


from our extranet. It is provided here for the benefit of
users who do not have access to our extranet.
Predefined variables, postblocks, and functions: page 2

MP Reference—Predefined variables, postblocks, and functions


Copyright © 2017 CNC Software, Inc.—All rights reserved
Terms of Use—Use of this document is subject to the Mastercam End User License Agreement.
A copy of the Mastercam End User License Agreement is included with the Mastercam product package.
The Mastercam End User License Agreement can also be found at: http://www.mastercam.com/en-us/Company-Info/Legal/LicenseAgreement/
NCI lines

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$

3 This parameter not used.

Lathe

1 dwell$

2 ss$

3 spdir$

Wire

1 dwell$

2 This parameter not used.

3 This parameter not used.


Predefined variables, postblocks, and functions: page 11

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$

6 This parameter not used.

7 canned4$

8 canned5$

9 canned6$

10 canned7$

11 canned2$

12 canned3$

13 This parameter not used.

14 This parameter not used.


Predefined variables, postblocks, and functions: page 25

15 This parameter not used.

16 This parameter not used.

17 This parameter not used.

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

1 This parameter not used.

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

1 This parameter not used.

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

1 This parameter not used.

2 xnci$

3 ynci$

4 znci$

5 This parameter not used.


Predefined variables, postblocks, and functions: page 32

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$

7 This parameter not used.

8 This parameter not used.

9 This parameter not used.

10 This parameter not used.

11 This parameter not used.

12 This parameter not used.

13 This parameter not used.

14 This parameter not used.

15 This parameter not used.

16 This parameter not used.

17 This parameter not used.


Predefined variables, postblocks, and functions: page 43

18 This parameter not used.

19 This parameter not used.

20 This parameter not used.

21 This parameter not used.

22 This parameter not used.

23 This parameter not used.

24 This parameter not used.

25 This parameter not used.

26 This parameter not used.

Lathe

1 synclath$

2 syncbfor$

3 syncmode$

4 syncaxis$

5 syncstream$

6 syncmodebfor$

7 This parameter not used.

8 This parameter not used.

9 This parameter not used.

10 This parameter not used.


Predefined variables, postblocks, and functions: page 44

11 This parameter not used.

12 This parameter not used.

13 This parameter not used.

14 This parameter not used.

15 This parameter not used.

16 This parameter not used.

17 This parameter not used.

18 This parameter not used.

19 This parameter not used.

20 This parameter not used.

21 This parameter not used.

22 This parameter not used.

23 This parameter not used.

24 This parameter not used.

25 This parameter not used.

26 This parameter not used.


Predefined variables, postblocks, and functions: page 45

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

18 This parameter not used.

Wire

1 progno$

2 seqno$

3 seqinc$

4 pass$

5 ccode$

6 offset$

7 This parameter not used.

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

18 This parameter not used.

Wire

1 progno$

2 seqno$

3 seqinc$

4 pass$

5 ccode$

6 offset$

7 This parameter not used.

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

18 This parameter not used.

Wire

1 progno$

2 seqno$

3 seqinc$

4 pass$

5 ccode$

6 offset$

7 This parameter not used.

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$

2 This parameter not used.

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)

2 This parameter not used.

3 This parameter not used.


Predefined variables, postblocks, and functions: page 65

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$

4 This parameter not used.

5 This parameter not used.

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$

12 This parameter not used.

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$

27 This parameter not used.

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$

27 This parameter not used.


Predefined variables, postblocks, and functions: page 85

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$

11 This parameter not used.

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$

11 This parameter not used.

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

8 This parameter not used.

9 This parameter not used.

10 This parameter not used.

11 tank$

12 This parameter not used.

13 This parameter not used.

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

NCI 20000 lines


MLRW
The sections below list each of the "20000"–series NCI lines. For each
number, only a brief description is provided. Please see the NCI Reference
included with the MP_documentation.pdf for detailed information about each line.
For many lines, only a single string or value is output. If a string of multiple values is output,
the number of parameters is noted.

Mill/Router/generic

20001 Tool name

20002 Tool definition: manufacturer’s tool code

20003 Chuck name

20004 Tool definition: tool parameters [24 parameters]

20005 Tool definition: tool parameters for drills [9 parameters]

20006 Tool definition: tool parameters [8 parameters]

20007 Tool definition: holder parameters [13 parameters]

20008 Tool definition: aggregate head parameters [9 parameters]

20009 Custom tool geometry [2 parameters]

20010 Construction plane name

20011 Construction plane commment

20012 Tool plane name

20013 Tool plane comment

20014 WCS plane name

20015 WCS plane comment


Predefined variables, postblocks, and functions: page 113

20016 Material name

20017 Material comment

20018 Machine group name

20020 Tool holder name

20021 Tool assembly name

20501 Nested sheet: material name

20502 Nested sheet parameters [12 parameters]

20600 Axis combination components [5 parameters]

20601 Axis combination info [4 parameters]

20700 Tool change info per data stream (obsolete)

20800 Tool diameter for multiaxis comp in control

29999 Tool inspection comment

Lathe

20100 Lathe tool definition (programming parameters) [9 parameters]

20101 Lathe tool definition (general cutting parameters) [11 parameters]

20102 Lathe tool definition (geometric parameters) [8 parameters]

20103 Lathe tool definition (insert name)

20104 Lathe tool definition (insert general parameters) [8 parameters]


Predefined variables, postblocks, and functions: page 114

20105 Lathe tool definition (general turning/boring insert parameters) [7


parameters]

20106 Lathe tool definition (threading insert parameters) [12 parameters]

20107 Lathe tool definition (grooving/parting insert parameters) [10 parameters]

20108 Lathe tool definition (drill geometry) [14 parameters]

20109 Lathe tool definition (drilling tool parameters) [6 parameters]

20110 Lathe tool definition (holder name)

20111 Lathe tool definition (holder parameters) [15 parameters]

20112 Lathe tool definition (custom tool geometry file name)

Wire

NCI lines for individual custom interfaces are not included here. They are listed in
the NCI Reference included with the MP_documentation.pdf.

20019 Pass comment from power library

20200 Wirepath stock to leave [7 parameters]

22001 Machine model

22002 Control version

22003 Piece name

22004 Piece material

22005 Piece wire name


Predefined variables, postblocks, and functions: page 116

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.)

Filename and path information


sext$
Pre-defined string variable to hold a file extension string. Not assigned a default value,
must be set by the post writer before use.
sextaux$
File name extension for the alternate file output stream auxprg$. The string is initialized
to .AUX by default, but can be overridden.
sextext$
File name extension for the alternate file output stream extprg$. The string is initialized to
.EXT by default, but can be overridden.
sextlcc$
File name extension for the alternate file output stream lccprg$. The string is initialized to
.LCC by default, but can be overridden.
sextnc$
File name extension for the NC file output stream.
sextnci$
File name extension for the NCI file.
sextpst$
File name extension for the post customization file.
sextspg$
File extension for the automatic subprogram buffer.
sextsub$
File name extension for the alternate file output stream subprg$. The string is initialized
to .SUB by default, but can be overridden.
smc_mcam_dir$
The folder where Mastercam is installed; for example, 'C:\\Program Files\\mcamX8\\'
smc_shared_dir$
The folder that is designated as the Mastercam shared directory; for example,
C:\\users\\public\\documents\\shared mcamx8\\.
smc_user_dir$
The folder that is designated as the Mastercam user directory; for example,
'C:\\Users\\rbb\\Documents\\my mcamx8\\'
smcext$
The file-name extension of the Mastercam file.
smcname$
The name of the Mastercam file. This is output on the NCI 1050 line.
smcpath$
The path of the Mastercam file.
sname$
Predefined variables, postblocks, and functions: page 119

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.

Default axis components


s_aaxis_pre$
The default label that is applied ("A") when a default A-axis component is referenced.
s_aaxisi_pre$
The default incremental label that is applied ("A") when a default A-axis component is
referenced.
s_baxis_pre$
The default label that is applied ("B") when a default B-axis component is referenced.
s_baxisi_pre$
The default incremental label that is applied ("B") when a default B-axis component is
referenced.
s_caxis_pre$
The default label that is applied ("C") when a default C-axis component is referenced.
s_caxisi_pre$
The default incremental label that is applied ("C") when a default C-axis component is
referenced.
s_xaxis_pre$
The default label that is applied ("X") when a default X-axis component is referenced.
s_xaxisi_pre$
The default incremental label that is applied ("X") when a default X-axis component is
referenced.
s_yaxis_pre$
The default label that is applied ("Y") when a default Y-axis component is referenced.
s_yaxisi_pre$
The default incremental label that is applied ("Y") when a default Y-axis component is
referenced.
s_zaxis_pre$
The default label that is applied ("Z") when a default Z-axis component is referenced.
s_zaxisi_pre$
The default incremental label that is applied ("Z") when a default Z-axis component is
referenced.

Strings for representing letters


s_a_pre$
String representing A character.
s_b_pre$
String representing B character.
Predefined variables, postblocks, and functions: page 122

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

String representing V character.


s_w_pre$
String representing W character.
s_x_pre$
String representing X character.
s_y_pre$
String representing Y character.
s_z_pre$
String representing Z character.
Predefined variables, postblocks, and functions: page 124

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!

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 125

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.

Linked incremental values


Mastercam 2017 introduces support for linked incremental values. Many Mastercam posts
include sets of variables and related postblocks to manage incremental output vs. absolute
output. For example, many posts have separate variables called xinc and xabs for the two
values. Then, on output lines where an X coordinate is to be output, there is a call to a
postblock like pxout whose job is to select the proper value depending on the absinc$
setting:
pxout # X output
if absinc$ = zero, xabs, !xinc
else, xinc, !xabs

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.

Turning on linked incremental values


To turn on the linked incremental values, a new parameter (parameter 5) has been added to
the end of the fmt statement definition. The new form of the statement is
fmt "prefix" n var "suffix" i

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

New variables for storing linked incremental values


For each variable for which linked incremental values are turned on, Mastercam automatically
creates a corresponding new variable beginning with the underscore character ( _ ). So when
you activate linked incremental values for my_var, Mastercam creates a new variable called _
my_var . If the value of my_var changes from 4.5 to 5.0, the value of _my_var will be 0.5.
If you link a predefined variable whose name ends with $, Mastercam will replace the $ with
another underscore. So the linked incremental variable for x$ would be _x_.
For each linked incremental variable, Mastercam also creates a prv_ variable to store its
previous value. Note that this means that the name of the prv_ variable includes two
underscores: for example, prv__x_, not prv_x_.

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.

Outputting linked incremental values


Output of the incremental values is intended to be triggered by the absinc$ value. For
Mastercam 2017, the absinc$ variable has been enhanced so that the linked incremental
Predefined variables, postblocks, and functions: page 128

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.

Using inc_var( ) to override absinc$


There are times when you might need 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. Use it to disconnect a parent from its linked
variable—temporarily reversing the effect of the switch in the fmt statement. When you do this,
the value of the parent variable will be output regardless of the absinc$ value.

Possible values

0 Absolute (default)

1 Incremental

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page

How is this used?


Example
# -------------------------------------------------------------
# Select incremental or absolute G code
sg90 : "G90" #Absolute code
sg91 : "G91" #Incremental code
sgabsinc : "" #Target string

fstrsel sg90 absinc$ sgabsinc 2 -1

# -------------------------------------------------------------
# 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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 131

angle_found$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 132

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

The following pictures show some more examples.


n The picture on the left shows the test applied for case 100 and 200. The
distance for NCI data rounded end point (dark blue) (1) and the generated
arc rounded end point (magenta) (2) are compared to arc_tol$ on each axis.
n The picture on the right shows the test applied for case 300. The distance
between the NCI data rounded end point (dark blue) (1) and the generated
arc unrounded end point (red) (2) is compared to arc_tol$. The red circle
represents the tolerance zone.
Predefined variables, postblocks, and functions: page 136

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

10000’s 1= Compare the length of the radius to the minrad$ variable.

More info
The following control definition setting sets this digit to 1:

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 138

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 139

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 140

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 141

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
]
else,
[
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
(plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,
[
#Arc output for IJK
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout #YZ plane code - G19
if plane$ = two, *iout, jout, *kout #XZ plane code - G18
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 &
arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)
Predefined variables, postblocks, and functions: page 142

else, result = nwadrs(srminus, arcrad$)


*arcrad$
]
Predefined variables, postblocks, and functions: page 143

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 144

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 145

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
]
Predefined variables, postblocks, and functions: page 146

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 147

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
]
Predefined variables, postblocks, and functions: page 148

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 149

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
]
Predefined variables, postblocks, and functions: page 150

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
]
else,
[
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
(plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,
[
#Arc output for IJK
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout #YZ plane code - G19
if plane$ = two, *iout, jout, *kout #XZ plane code - G18
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 &
arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)
Predefined variables, postblocks, and functions: page 151

else, result = nwadrs(srminus, arcrad$)


*arcrad$
]
Predefined variables, postblocks, and functions: page 152

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 153

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 154

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.

Table 1: MP output streams

subout$
Command variable File to be opened
value

— Main NC output stream 0

subprg$ Sub output file 1

auxprg$ Aux output file 2

extprg$ Ext output file 3

lccprg$ Lathe canned cycle 4


output file

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)

or by using it in a formula statement inside a postblock:


pblock # A postblock
auxprg$ = 1
# Allow access to aux file (open and clear it)
subout$ = 2 # Re-direct the output to the sub file

Possible values

0 Disable writing to the alternate file.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ppost$ #Post process Postblock
# This postblock is used to renumber sequence numbers after posting
# is complete. Opening the NC file as a buffer and scan
# every line for a line number and replace it with another
# line number. The new NC line is written to the Auxilary file and upon
# processing the entire NC file, the NC and Aux files ares closed,
# the NC file is deletedand the Aux file renamed to a .NC file/

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$

spathaux$ = spathnc$ #Set aux path to that of NC path


snameaux$ = snamenc$ #Set aux file name to that of NC name

auxprg$ = 1 #Intialize a new auxfile (sauxfile)


subout$ = 2 #Set post output to .AUX file
newaux$ #Open new auxilary file for output
...
Predefined variables, postblocks, and functions: page 156

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

1 Rotation about the X axis.

2 Rotation about the Y axis.

3 Rotation about the Z axis.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 157

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pxyzcout2 #polar interpolation
#Drill polar is toolplane drilling toward center
#if not a coincident axis
#Also, Capture initial index position for Polar Milling
if (opcode$ = three & rot_on_x <> three), pxyzcout0
else,
[
if rot_on_x = one, #X axis rotation
[
csav = atan2(y$, z$) #Z+ zero
axisx$ = vequ(aaxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = two, #Y axis rotation
[
csav = atan2(-x$, z$) #Z+ zero
axisx$ = vequ(baxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = three, #Z axis rotation
[
csav = atan2(-y$, x$) #X+ zero
axisx$ = vequ(caxisx)
xabs = rotp(csav, x$)
]
csav = csav + c$
]
Predefined variables, postblocks, and functions: page 158

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pxyzcout2 #polar interpolation
#Drill polar is toolplane drilling toward center
#if not a coincident axis
#Also, Capture initial index position for Polar Milling
if (opcode$ = three & rot_on_x <> three), pxyzcout0
else,
[
if rot_on_x = one, #X axis rotation
[
csav = atan2(y$, z$) #Z+ zero
axisx$ = vequ(aaxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = two, #Y axis rotation
[
csav = atan2(-x$, z$) #Z+ zero
axisx$ = vequ(baxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = three, #Z axis rotation
[
csav = atan2(-y$, x$) #X+ zero
axisx$ = vequ(caxisx)
xabs = rotp(csav, x$)
]
csav = csav + c$
]
Predefined variables, postblocks, and functions: page 159

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pxyzcout2 #polar interpolation
#Drill polar is toolplane drilling toward center
#if not a coincident axis
#Also, Capture initial index position for Polar Milling
if (opcode$ = three & rot_on_x <> three), pxyzcout0
else,
[
if rot_on_x = one, #X axis rotation
[
csav = atan2(y$, z$) #Z+ zero
axisx$ = vequ(aaxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = two, #Y axis rotation
[
csav = atan2(-x$, z$) #Z+ zero
axisx$ = vequ(baxisx)
xabs = rotp(csav, x$)
]
if rot_on_x = three, #Z axis rotation
[
csav = atan2(-y$, x$) #X+ zero
axisx$ = vequ(caxisx)
xabs = rotp(csav, x$)
]
csav = csav + c$
]
Predefined variables, postblocks, and functions: page 160

azero$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 161

b$
This variable should not be used. Unlike a$ and a$, this value is not set by MP.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 162

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:

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 163

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:

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 164

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:

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 165

bdrl_tool_grp$
R
Tool group number. It comes from the following setting in Mastercam:

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 166

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

Where does this value come from?


Output on following NCI lines
83

Control definition page


None

How is this used?


Example
pchk_tools # Modal Tool Output Raise and/or Lower tools sequentially
local_int = zero
while local_int < max_tools & local_int < 32,
[
last_result = and(2^local_int, sav_t)
result = and(2^local_int, bdrl_tool_no$)
if result = zero,
[
tool_off = one
result = 2^local_int
]
else, tool_off = zero
local_int = local_int + 1
tool_sel = local_int * 2 + tool_off
#Set up for boolean test to control modality
if last_result <> zero, last_result = local_int * two
else, last_result = local_int * two + one
if tool_sel <> last_result, pbld, n$, *stl, e$
]
sav_t = bdrl_tool_no$
Predefined variables, postblocks, and functions: page 168

bdrl_tool_no2$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 169

bdrl_tool_no3$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 170

bdrl_tool_no4$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 171

bdrl_tool_no5$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 172

bdrl_tool_no6$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 173

bdrl_tool_no7$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 174

bdrl_tool_no8$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 175

bdrl_tool_no9$
R
Bitwise tool code of tools used at this position

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 176

bdrl_u$
R
Position of lead drill at initial (clearance) height - X axis.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 177

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 178

bdrl_v$
R
Position of lead drill at initial (clearance) height - Y axis.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 179

bdrl_w$
R
Position of lead drill at initial (clearance) height - Z axis.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 180

bdrl_wrk_ofs$
R
Work Offset for block drill position.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 181

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.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 182

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 183

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.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 184

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 185

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.

Where does this value come from?


Output on following NCI lines
83

Control definition page


None
Predefined variables, postblocks, and functions: page 186

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 187

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tool page
Predefined variables, postblocks, and functions: page 188

bool____result$
M L R W MT
OBSOLETE: The result returned with the conditional branching
statements (if) and (while).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 189

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 191

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 193

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Possible values

0 Don’t break arcs; arcs remain as they are read from the NCI file.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 195

brklineslen$
M L R W MT
Length of the broken line segments that are created with brklinestype$.
See brklinestype$ for more information.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 196

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.

Which lines should be broken?


In most cases, you will not want all of the lines in a toolpath to be broken. Typically, you will
only need to break linear motion that can’t be interpolated by one or more linear axes. As
soon as you combine a linear axis with rotary motion, the line must be broken into segments
to avoid cutting a radius.
For example, consider a C-axis milling operation. Assume that, in this example, the machine
either does not have a Y axis or that there is not enough travel in Y to cut the desired path. If
the intended move contains motion in the Y direction that can't be interpolated by first
rotating C and using the X axis, the line will be interpolated using a combination of X and C
motion. This can be accomplished by setting brklinestype$ to 6 so that all linear motion is
broken, except for linear motion that goes directly toward or away from the Z axis (center of
rotation) and linear motion that runs parallel to the Z axis.

brklinestype$ and rapid moves


The variable brklinestype$ typically works on linear motion at feed rate. However, it can be
manipulated to break rapid motion by assigning a value of 1 to the gcode$ variable in the plin0$
postblock. The variable gcode$ can then be restored in the final output postblock as required.

Possible values

0 No break

1 Break method: Chord height


Do not break lines that only contain X-axis motion.
Predefined variables, postblocks, and functions: page 197

2 Break method: Chord height


Do not break lines that only contain Y-axis motion.

3 Break method: Chord height


Do not break lines that only contain Z-axis motion.

4 Break method: Chord height


Do not break these lines: Toward/from/parallel to the X axis

5 Break method: Chord height


Do not break these lines: Toward/from/parallel to the Y axis

6 Break method: Chord height


Do not break these lines: Toward/from/parallel to the Z axis

7 Break method: Chord height


Break all lines.

8 Break method: Segment length


Do not break lines that only contain X-axis motion.

9 Break method: Segment length


Do not break lines that only contain Y-axis motion.

10 Break method: Segment length


Do not break lines that only contain Z-axis motion.

11 Break method: Segment length


Break all lines

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
plin0$ #Pre-linear movement postblock
if posttype$ <> two,
[
Predefined variables, postblocks, and functions: page 198

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 201

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 203

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 205

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 207

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 209

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 211

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 213

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 215

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 217

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 219

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 221

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 223

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 225

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 227

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 229

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 231

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 233

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 235

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.

Properties of broken elements


When a single move is broken into multiple moves, the variables listed in the following table
will not have the same value on all of the segments of the broken move.
For example, if a move has cc_pos$ equal 1 to indicate G41 and the move is broken into
multiple moves, the G41 should appear only on the last segment of the broken move, not all of
the segments. Thus, cc_pos$ should remain modal (equal to the previous cc_pos$ value) on
all segments except the last segment. On the last segment, cc_pos$ should set to the value of
the original (unbroken) move.
The variables listed in the following table will have values shown for all but the last segment of
a broken move. On the last segment, each variable is restored to the original value of the
unbroken move.

Variable Value

cantext$ 0

commvar$ 0

cc$ 0

ccomp$ 0

cc_pos$ Previous value

epac_flg$ 0

nextop$ Gcode of next segment, line, or arc

nextccomp$ Original ccomp$ (not the ccomp$ of the next segment)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 237

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
rc1 : 1 # Declare and initialize buffer read record index
ppostblock
buf_no_index$ = 1 # Do not automatically increment buffer index
x = rbuf( one , rc1 )
# rc1 is still one after the buffer read function
Predefined variables, postblocks, and functions: page 238

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

0 No NC file displayed (default)

1 Display the NC file in a viewing window after processing.

2 Display the NC file in the editor program specified in the current Mastercam
configuration.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 239

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 240

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 241

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

–2 Output extended values with ~ operator.

–1 Output raw, unformatted values with ~ operator.

0 or greater Output formatted values with ~ operator.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Default value
0
Predefined variables, postblocks, and functions: page 242

bug9$
M L R W MT
OBSOLETE: Indicates the current drill position with long drill code
output.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 243

bzero$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 244

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!

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 245

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
canceldc$ : 1
drl_usecan : 0
sav_plane : 0 #Save plane when drilling

pdrill0$ #Pre-process before drill call


drl_plane$ = plane2
sav_dgcode = gcode$ #Capture gcode for 5 axis drill
sav_plane = plane$
if drl_cycle$ < 8 & opcode$ <> 16,
Predefined variables, postblocks, and functions: page 246

[
#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

0 - 19 The type of cycle

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 248

canned1$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 249

canned2$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 250

canned3$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 251

canned4$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 252

canned5$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 253

canned6$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 254

canned7$
W
The custom canned parameters passed with the drill cycle NCI Gcode 81 data.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 255

canned8$
W
Obsolete; not used. This has been removed in Mastercam 2017.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 256

canned9$
W
Obsolete; not used. This has been removed in Mastercam 2017.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 257

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 258

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pcan # Canned text - before output call
strcantext = sblank
if cant_no$ > zero,
[
if cant_pos1$ = zero | cant_pos1$ = three, pcant_1
if cant_pos2$ = zero | cant_pos2$ = three, pcant_2
if cant_pos3$ = zero | cant_pos3$ = three, pcant_3
if cant_pos4$ = zero | cant_pos4$ = three, pcant_4
if cant_pos5$ = zero | cant_pos5$ = three, pcant_5
if cant_pos6$ = zero | cant_pos6$ = three, pcant_6
if cant_pos7$ = zero | cant_pos7$ = three, pcant_7
if cant_pos8$ = zero | cant_pos8$ = three, pcant_8
if cant_pos9$ = zero | cant_pos9$ = three, pcant_9
if cant_pos10$ = zero | cant_pos10$ = three, pcant_10
if cant_pos11$ = zero | cant_pos11$ = three, pcant_11
if cant_pos12$ = zero | cant_pos12$ = three, pcant_12
if cant_pos13$ = zero | cant_pos13$ = three, pcant_13
if cant_pos14$ = zero | cant_pos14$ = three, pcant_14
if cant_pos15$ = zero | cant_pos15$ = three, pcant_15
if cant_pos16$ = zero | cant_pos16$ = three, pcant_16
if cant_pos17$ = zero | cant_pos17$ = three, pcant_17
if cant_pos18$ = zero | cant_pos18$ = three, pcant_18
if cant_pos19$ = zero | cant_pos19$ = three, pcant_19
if cant_pos20$ = zero | cant_pos20$ = three, pcant_20
pbld, n$, strcantext, e$
strcantext = sblank
]
Predefined variables, postblocks, and functions: page 259

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 260

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 261

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 262

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 263

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 264

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 265

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 266

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 267

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 268

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 269

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 270

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 271

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 272

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 273

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 274

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 275

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 276

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 277

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 278

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 279

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 280

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 281

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 282

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 283

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 284

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 285

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 286

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 287

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 288

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 289

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 290

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 291

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 292

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 293

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 294

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 295

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 296

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 297

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.
n The third parameter is 4057, so cant_val4$ is 57 (057) and cant_pos4$ is 4. A value
of 4 indicates that this is a coolant command, not canned text, and it will be output
with the move on the next NCI line.

NOTE
cant_pos11$ –cant_pos20$ were added for Mastercam X.

Possible values

0 Before (canned text)

1 With (canned text)


Predefined variables, postblocks, and functions: page 298

2 After (canned text)

3 Before (coolant)

4 With (coolant)

5 After (coolant)

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 299

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 300

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 302

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 304

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 306

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 308

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 310

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 312

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 314

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 316

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 318

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 320

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 322

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 324

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 326

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 328

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 330

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 332

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 334

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 336

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 338

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

n The first parameter is 2010, so cant_val1$ is 10 (010) and cant_pos1$ is 2. Therefore,


the canned text will be output after the move on the next NCI line.
n The second parameter is 4, so cant_val2$ is 4. Since there is nothing in the 1000’s
place, cant_pos2$ is 0. Therefore, the canned text will be output before the move on
the next NCI line.
n The third parameter is 1006, so cant_val3$ is 6 (006) and cant_pos3$ is 1. Therefore,
the canned text will be output with the move on the next NCI line.

NOTE
cant_val11$ –cant_val20$ were added for Mastercam X.

Values for coolant events


Values for coolant events are offset by 50 so that you can distinguish them easily. For example:
n A cant_val of 50 = coolant event 1 ON
n 51 = coolant event 1 OFF
n 52 = coolant event 2 ON
n 53 = coolant event 2 OFF, and so on, until...
n 68 = coolant event 10 ON
n 69 = coolant event 10 OFF
So in this example of a 1025 line:
1025
5052 4 1006 2007 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

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

Where does this value come from?


Output on following NCI lines
1025

Control definition page


None
Predefined variables, postblocks, and functions: page 340

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

40 Cancel cutter compensation in the control.

41 Cutter compensation in the control = left.

42 Cutter compensation in the control = right.

140 Cancel compensation in the control with last move.

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 1013

Control definition page


None
Predefined variables, postblocks, and functions: page 341

ccend$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 342

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1010

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
pbld, n$, *ccode$, *offset$, e$ #Wire condition change
#if gcode = 1010, pbld, n$, ccode$, offset$, e$ #Wire condition change
#else, ccode$, offset$
Predefined variables, postblocks, and functions: page 343

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

0 The condition code of the approach move has not changed.

1 The condition code of the approach move has changed.

Where does this value come from?


Output on following NCI lines
1010

Control definition page


None
Predefined variables, postblocks, and functions: page 344

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

4 Cancel with last move.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 345

ccstart$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 346

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

0 Compensate to tool center.

1 Compensate to tool tip.

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 347

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 348

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

0 Cutter compensation in computer is not selected

41 Cutter compensation in computer is set left.

42 Cutter compensation in computer is set right.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 349

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

0 Cutter compensation is off (G40)

1 Left (G41).

2 Right (G42).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Cutter compensation G code selection, plane 0
sg40 G40 #Cancel cutter compensation
sg41 G41 #Cutter compensation left
sg42 G42 #Cutter compensation right
sccomp #Target for string

fstrsel sg40 cc_pos$ sccomp 3 -1


Predefined variables, postblocks, and functions: page 350

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.

Where does this value come from?


Output on following NCI lines
20200
Control definition page
None

How is this used?


Example
pradlist$ #Generate wire radius list
if listrad$ = 2, # Process 20200 lines
[
if offset_mach$, # Apply extra offset to mach offst reg was selected
[ # Mach offst reg is NA for computer comp or off
if cc_type$ = 1, # Control
[
tlrad$ = offset_total$ # Use total offset value
]
if cc_type$ = 2 | cc_type$ = 3, # Both or reverse both
[
tlrad$ = stock_leave$ # Shift by stock to leave value.
]
]
else, # Apply additional offset to program coordinates was selected
[
if cc_type$ = 1, # Control
[
Predefined variables, postblocks, and functions: page 351

tlrad$ = tlrad$ + overburn$ # Shift by wire radius and overburn.


]
else, # Computer, both, reverse both or off
[
tlrad$ = 0 # NCI has been shifted by total offset value
] # Off=shift NCI for stk to leave only, offst reg set to 0
] # Ignore overburn and wire rad -- centerline cutting.
]
!spaces$
spaces$ = zero
if rad_cnt = 0,
[
"H000", "=", "0", e$
rad_cnt = 1
]
*offset$, "=", *tlrad$, e$
prv_offset$ = -1
spaces$ = prv_spaces$
Predefined variables, postblocks, and functions: page 352

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

1 (100) End-of-contour point

2 (200) Compensation OFF position

3 (300) Both (end-of-contour and compensation off) on same point

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 353

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pcan1 #Canned text - with move
strcantext = sblank
if cant_no$ > zero,
[
if cant_pos1$ = one | cant_pos1$ = four, pcant_1
if cant_pos2$ = one | cant_pos2$ = four, pcant_2
if cant_pos3$ = one | cant_pos3$ = four, pcant_3
if cant_pos4$ = one | cant_pos4$ = four, pcant_4
if cant_pos5$ = one | cant_pos5$ = four, pcant_5
if cant_pos6$ = one | cant_pos6$ = four, pcant_6
if cant_pos7$ = one | cant_pos7$ = four, pcant_7
if cant_pos8$ = one | cant_pos8$ = four, pcant_8
if cant_pos9$ = one | cant_pos9$ = four, pcant_9
if cant_pos10$ = one | cant_pos10$ = four, pcant_10
if cant_pos11$ = one | cant_pos11$ = four, pcant_11
if cant_pos12$ = one | cant_pos12$ = four, pcant_12
if cant_pos13$ = one | cant_pos13$ = four, pcant_13
if cant_pos14$ = one | cant_pos14$ = four, pcant_14
if cant_pos15$ = one | cant_pos15$ = four, pcant_15
if cant_pos16$ = one | cant_pos16$ = four, pcant_16
if cant_pos17$ = one | cant_pos17$ = four, pcant_17
Predefined variables, postblocks, and functions: page 354

if cant_pos18$ = one | cant_pos18$ = four, pcant_18


if cant_pos19$ = one | cant_pos19$ = four, pcant_19
if cant_pos20$ = one | cant_pos20$ = four, pcant_20
]
if cstop$, strcantext = strcantext + sm00
if cgstop$, strcantext = strcantext + sm01
#Output of strcantext occurs at the end of the output line
Predefined variables, postblocks, and functions: page 355

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 356

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

clearsub$ Empty sub output file.

clearaux$ Empty auxiliary output file.

clearext$ Empty external output file.

clearlcc$ Empty lathe canned cycle output file.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergeaux$
clearaux$
"%", e$
Predefined variables, postblocks, and functions: page 357

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

clearsub$ Empty sub output file.

clearaux$ Empty auxiliary output file.

clearext$ Empty external output file.

clearlcc$ Empty lathe canned cycle output file.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
toolchng = one
pretract
comment$
n$, "M30", e$
subout$ = zero
mergeext$
clearext$
snameprg = no2str(sav_progno)
sorgncfile = spathnc$ + snamenc$ + sextnc$
sprgncfile = spathnc$ + snameprg + sextnc$
Predefined variables, postblocks, and functions: page 358

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$ Empty sub output file.

clearaux$ Empty auxiliary output file.

clearext$ Empty external output file.

clearlcc$ Empty lathe canned cycle output file.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
toolchng = one
pretract
comment$
n$, "M30", e$
subout$ = four
mergelcc$
clearlcc$
snameprg = no2str(sav_progno)
sorgncfile = spathnc$ + snamenc$ + sextnc$
sprgncfile = spathnc$ + snameprg + sextnc$
Predefined variables, postblocks, and functions: page 359

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

clearsub$ Empty sub output file.

clearaux$ Empty auxiliary output file.

clearext$ Empty external output file.

clearlcc$ Empty lathe canned cycle output file.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergeaux$
clearaux$
"%", e$
Predefined variables, postblocks, and functions: page 360

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

Where does this value come from?


Output on following NCI lines
903

Control definition page


None
Predefined variables, postblocks, and functions: page 361

clmp_spindle$
L MT
Active spindle for clamp/unclamp

Possible values

0 Left spindle

1 Right spindle

Where does this value come from?


Output on following NCI lines
903

Control definition page


None
Predefined variables, postblocks, and functions: page 362

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 363

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 364

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 365

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 366

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 367

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 368

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 369

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 370

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

cm1$–cm3$ X-axis vector

cm4$–cm6$ Y-axis vector

cm7$–cm9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1017

Control definition page


None
Predefined variables, postblocks, and functions: page 371

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 372

How is this used?


Example
ltlchg0$ #Call from NCI null tool change, lathe
copy_x = vequ(x$)
c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.
pcom_moveb #Get machine position, set inc. from last position
c_mmlt$ #Position multi-tool sub, sets inc. current if G54...
comment$
pcan
toolno = t$ * 100 + tloffno$
pbld, n$, toolno, e$
pspindle
pnullspindle
pbld, n$, pscool,e$
if home_type > one & workofs$ <> prv_workofs$,
[
sav_absinc = absinc$
absinc$ = zero
pbld, n$, psgcode, pwcs, pfxout, pfzout, e$
pe_inc_calc #Update previous
ps_inc_calc #Set current inc.
absinc$ = sav_absinc
]
Predefined variables, postblocks, and functions: page 373

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 374

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 375

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 376

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 377

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 378

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 379

comm_end_nci$
M L R W MT
NCI line number of the last comment to be output.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 380

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:

These options set 4 of the 10 digits in the comm_filter$ value.


n Please be aware that selecting the check box sets the digit to 0.
n Clearing the check box sets it to 1.
The options shown in this picture result in a comm_filter$ value of 0011100000. (The blue
digits are the ones set in the control definition. Note that if you look at this variable in the
debugger, you will not see the leading zeros.)
The digits that are not set by the control definition have a default value of zero.
Note also that the same comm_filter$ digits can also be set from the Machine Group
Properties. The machine group settings override the control definition settings.

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

1’s digit NCI 1005 comment—manual entry, as comment

10’s NCI 1006 comment—manual entry, as code

100’s NCI 1007 comment—manual entry, as comment, output with move

1000’s NCI 1008 comment—operation comment. Set this digit with the Output
operation comment to NC option.

10000’s NCI 1026 comment—manual entry, as code, output with move

100000’s NCI 1051 comment—Output machine name to NC option

1000000’s NCI 1052 comment—Output group comment to NC option

10000000’s NCI 1053 comment—Output group name to NC option

100000000’s NCI 1054 comment—Output MCX file descriptor option

1000000000’s NCI 1056 comment—Probe data

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page

How is this used?


Example
# This is from a set-up sheet, not a post. This deliberately overrides the CD
settings.

pprep$ #Pre-process postblock


#Allows post instructions after the post is parsed
#but before the NC and NCI file are opened.
#DO NOT ATTEMPT TO OUTPUT TO THE NC FILE IN THIS POSTBLOCK (OR ANY POSTBLOCKS
Predefined variables, postblocks, and functions: page 382

#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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 384

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

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 385

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

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 386

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.

In the Agievision post, you will see this line:


sx_nci_default$ : "1.11" #Enable posting for integrated Agievision

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

0 Generic (non-Agie) control selected.

1–11 Numeric code that indicates the specific Agie control model.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Control Model page
Predefined variables, postblocks, and functions: page 388

controltype$
M L R W MT
Indicates product key for post.

Possible values

0 Mill

1 Router

2 Lathe

3 Wire

4 Mill/Turn

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 389

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 390

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)

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 391

corgx$
M L R W MT
Construction plane origin X value.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 392

corgy$
M L R W MT
Construction plane origin Y value.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 393

corgz$
M L R W MT
Construction plane origin Z value.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 394

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

other values User-defined view

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 395

css_actv$
M L R MT
Constant surface speed flag. See also ipr_actv$, ss$, spdir$.

Possible values

0 Off (always off with Mill and Router toolpaths)

1 On

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 396

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

1 (1000) Start-of-contour point

2 (2000) Compensation ON point

3 (3000) Both (start-of-contour and compensation point) on same point

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 397

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pcan1 #Canned text - with move
strcantext = sblank
if cant_no$ > zero,
[
if cant_pos1$ = one | cant_pos1$ = four, pcant_1
if cant_pos2$ = one | cant_pos2$ = four, pcant_2
if cant_pos3$ = one | cant_pos3$ = four, pcant_3
if cant_pos4$ = one | cant_pos4$ = four, pcant_4
if cant_pos5$ = one | cant_pos5$ = four, pcant_5
if cant_pos6$ = one | cant_pos6$ = four, pcant_6
if cant_pos7$ = one | cant_pos7$ = four, pcant_7
if cant_pos8$ = one | cant_pos8$ = four, pcant_8
if cant_pos9$ = one | cant_pos9$ = four, pcant_9
if cant_pos10$ = one | cant_pos10$ = four, pcant_10
if cant_pos11$ = one | cant_pos11$ = four, pcant_11
if cant_pos12$ = one | cant_pos12$ = four, pcant_12
if cant_pos13$ = one | cant_pos13$ = four, pcant_13
if cant_pos14$ = one | cant_pos14$ = four, pcant_14
if cant_pos15$ = one | cant_pos15$ = four, pcant_15
if cant_pos16$ = one | cant_pos16$ = four, pcant_16
if cant_pos17$ = one | cant_pos17$ = four, pcant_17
Predefined variables, postblocks, and functions: page 398

if cant_pos18$ = one | cant_pos18$ = four, pcant_18


if cant_pos19$ = one | cant_pos19$ = four, pcant_19
if cant_pos20$ = one | cant_pos20$ = four, pcant_20
]
if cstop$, strcantext = strcantext + sm00
if cgstop$, strcantext = strcantext + sm01
#Output of strcantext occurs at the end of the output line
Predefined variables, postblocks, and functions: page 399

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

1 Contour stop : cstop$


Predefined variables, postblocks, and functions: page 400

10 Contour optional stop : cgstop$

100 Contour end : cend$

1000 Contour start : cstart$

10000 Rapid type : rpd_typ$

100000 Coolant off/ flood/ mist/ tool : coolant$

1000000 Indicates how to process rotation angles for primary and secondary axes :
rev5$

Wire

1 Contour stop : cstop$

10 Contour optional stop : cgstop$

100 Contour end : cend$

1000 Contour start : cstart$

10000 Wire status (cut/threaded) : thrd_cut$

100000 Flushing status : water$

1000000 Power on/off : power$

10000000 Tank empty/full : tank$

100000000 New power setting or condition code for approach : epac_flg$

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 401

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.

3 On end of cut, last point on surface, chained contour, etc.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 402

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

0 Before start point, reset at each tool change, including null.

1 Start point, first point on surface.

2 In cut.

3 On end of cut, last point on surface.

4 Lead-in motion.

5 Lead-out motion.

6 Safety zone.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 403

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

0 Before start point; reset at each tool change, including null.

1 Start point, first point on surface, chained contour, etc.

2 In cut.

3 On end of cut, last point on surface, chained contour, etc.

4 After end of cut.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pfcalc #Feedrate calculations, gcode 0 does not evaluate
if gcode$ <> zero,
[
if fmtrnd(cabs) = prvcabs | index, pfcalc_u_min
else,
[
if cuttype = one & (cutpos2$ <= one | cutpos2$ = four),
pfcalc_u_min
else, pfclc_deg_inv
]
if ipr_type <> prv_ipr_type, prv_feed = c9k
]
Predefined variables, postblocks, and functions: page 404

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

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 405

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 406

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$.

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 407

cutz$
W
Reserved for future use.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 408

czero$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 409

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psof$ #Start of file for non-zero tool number
pcuttype
toolchng = one
if ntools$ = one,
[
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
]
sav_absinc = absinc$
if mi1$ <= one, #Work coordinate system
[
absinc$ = one
pfbld, n$, sgabsinc, "G28", "Z0.", e$
pfbld, n$, "G28", "X0.", "Y0.", e$
pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
absinc$ = sav_absinc
]
pcom_moveb
c_mmlt$ #Multiple tool subprogram call
" ", e$ # Blank line
ptoolcomment
comment$
pcan
Predefined variables, postblocks, and functions: page 410

if stagetool >= zero, pbld, *t$, "M6", e$


pindex
if mi1$ > one, absinc$ = zero
pcan1, pbld, n$, *sgcode, *sgabsinc, pfxout, pfyout,
*speed, *spindle, pgear, pwcs, strcantext, e$
pbld, n$, pfzout, scoolant, next_tool$, e$
absinc$ = sav_absinc
pcom_movea
toolchng = zero
c_msng$ #Single tool subprogram call
Predefined variables, postblocks, and functions: page 411

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psof$ #Start of file for non-zero tool number
pcuttype
toolchng = one
if ntools$ = one,
[
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
]
sav_absinc = absinc$
if mi1$ <= one, #Work coordinate system
[
absinc$ = one
pfbld, n$, sgabsinc, "G28", "Z0.", e$
pfbld, n$, "G28", "X0.", "Y0.", e$
pfbld, n$, "G92", *xh$, *yh$, *zh$, e$
absinc$ = sav_absinc
]
pcom_moveb
c_mmlt$ #Multiple tool subprogram call
" ", e$ # Blank line
ptoolcomment
comment$
pcan
Predefined variables, postblocks, and functions: page 412

if stagetool >= zero, pbld, *t$, "M6", e$


pindex
if mi1$ > one, absinc$ = zero
pcan1, pbld, n$, *sgcode, *sgabsinc, pfxout, pfyout,
*speed, *spindle, pgear, pwcs, strcantext, e$
pbld, n$, pfzout, scoolant, next_tool$, e$
absinc$ = sav_absinc
pcom_movea
toolchng = zero
c_msng$ #Single tool subprogram call
Predefined variables, postblocks, and functions: page 413

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ltlchg$ #Toolchange, lathe
toolchng = one
gcode$ = zero
copy_x = vequ(x$)
pcc_capture #Capture LCC ends, stop output RLCC
c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.
pcom_moveb #Get machine position, set inc. from c1_xh
c_mmlt$ #Position multi-tool sub, sets inc. current if G54...
ptoolcomment
comment$

pl_ncoutput #Movement output


pcom_moveb #Get machine position, set inc. from last position
pcan
c_rcc_setup$ #Save original in sav_xa and shift copy_x for LCC comp.
if gcode$ = zero, prapidout
if gcode$ = one, plinout
if gcode$ > one & gcode$ < four, pcirout
if lcc_cc_pos, plcc_cc_pos #Use sav_xa to position with comp. LCC
pcom_movea #Update previous, pcan2
Predefined variables, postblocks, and functions: page 414

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
*progno$, e$
"(", "PROGRAM NAME - ", sprogname$, ")", e$
"(", "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, ")", e$
#Date and time output Ex. 12-02-05 15:52

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:

Variable Unformatted (string) Formatted (number)

mon$ Sep 9.0

month$ 09 9.0

year$ 08 8.0

day$ 26 26.0

See related variables date$, time$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
Predefined variables, postblocks, and functions: page 416

*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]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 418

db_lvl_trg$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 419

db_repaint$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 420

db_restore$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 421

db_save$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 422

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.

See also use_dec_seq$, dec_seq_right$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 423

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.

See also use_dec_seq$, dec_seq_left$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 424

deg2rad$
M L R W MT
The value required to convert constant degrees to radians (0.017453293).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 425

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pdrill$ #Canned Drill Cycle
pdrlcommonb
pcan1, pbld, n$, pfxout, pfyout, e$
pbld, n$, "G300", prdrlout, e$
pbld, n$, "G308", *depth$, e$
pbld, n$, "G324", *drl_feed, strcantext,e$
pbld, n$, *sgdrill, e$
pbld, n$, pfxout, pfyout, e$
pcom_movea
Predefined variables, postblocks, and functions: page 426

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 427

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
serr_wrongdll "THIS POST MUST RUN WITH MP.DLL v19"
ppostblock
if dll_vers$ < 19,
[
result = mprint(serr_wrongdll)
exitpost$
]
Predefined variables, postblocks, and functions: page 428

dlm_strsel$
M L R W MT
When set negative, adjusts the location of the setseloffs return by the
absolute value in this variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 429

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 430

dofs$
W
Current wire condition. This is considered obsolete for modern posts; use ccode$
instead.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 431

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

0 Full 360-degree arcs will be broken into two 180-degree moves.

1 Any full 360-degree arcs will passed to the post processor.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 432

Control definition page


Arc page
Predefined variables, postblocks, and functions: page 433

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

0 Full 360-degree arcs will be broken into two 180-degree moves.

1 Any full 360-degree arcs will passed to the post processor.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 434

Control definition page


Arc page
Predefined variables, postblocks, and functions: page 435

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

0 Full 360-degree arcs will be broken into two 180-degree moves.

1 Any full 360-degree arcs will passed to the post processor.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 436

Control definition page


Arc page
Predefined variables, postblocks, and functions: page 437

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

0 Allow arcs in the selected plane.

1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 438

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

0 Allow arcs in the selected plane.

1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 439

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

0 Allow arcs in the selected plane.

1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 440

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

0 5-axis drilling is not active.

1 5-axis drilling is active.

Greater than 1 If rotaxtyp$ is less than 6, this variable acts as a counter and is
incremented for each additional continuous drill position.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#Pre-process rotary motion control flags, mill
pmx0$ #5 ax Drill
if cuttype = five,
[
if drill5$ = one, z$ = initht$ * z_mult
else,
[
if fr$ = -2,gcode$ = zero
else, gcode$ = one
]
]
Predefined variables, postblocks, and functions: page 441

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

0 Drilling is not active

1 Drilling is active

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#Pre-process rotary motion control flags
pmx0$ # 5-axis gcode setup
if drillcur$ = zero,
[
if fr$ = -2, gcode$ = zero
else, gcode$ = one
]
Predefined variables, postblocks, and functions: page 442

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

8–19 Custom cycles

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 443

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

8–19 Custom cycles

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 444

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

–1 Active (after a Gcode 100 NCI lines has been read)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pdrill0$ #Pre-process before drill call
drl_plane$ = plane2
sav_dgcode = gcode$ #Capture gcode for 5 axis drill
sav_plane = plane$
if drl_cycle$ < 8 & opcode$ <> 16,
[
#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,
# [
Predefined variables, postblocks, and functions: page 445

# drl_usecan = vlout(drl_cycle, prv_usecandrill)


# drl_usecan = vlin(drl_cycle, usecandrill)
# ]
]
!drl_plane$
Predefined variables, postblocks, and functions: page 446

drl_depth_x$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None

How is this used?


Example
pdrlcommonb #Canned Drill Cycle common call, before
if sav_dgcode = 81,
[
result = newfs (two, zinc)
if drillcyc$ = three, drlgsel = fsg1(-ss$) + drillcyc$ * two
else, drlgsel = fsg2(dwell$) + drillcyc$ * two
drillrefx = vsub(drl_init_x$, drl_ref_x$)
if lng3(drillrefx) > vtol$, drillref = zero
else, drillref = one
prv_refht_a = c9k
prv_refht_i = c9k
prv_dwell$ = zero
]
prv_zia = drl_init_z$
x$ = vequ(drl_depth_x$)
pcom_moveb
feed = fr_pos$
pcan
plane$ = drl_plane$
Predefined variables, postblocks, and functions: page 447

drl_depth_y$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None

How is this used?


Example
pdrlcommonb #Canned Drill Cycle common call, before
if sav_dgcode = 81,
[
result = newfs (two, zinc)
if drillcyc$ = three, drlgsel = fsg1(-ss$) + drillcyc$ * two
else, drlgsel = fsg2(dwell$) + drillcyc$ * two
drillrefx = vsub(drl_init_x$, drl_ref_x$)
if lng3(drillrefx) > vtol$, drillref = zero
else, drillref = one
prv_refht_a = c9k
prv_refht_i = c9k
prv_dwell$ = zero
]
prv_zia = drl_init_z$
x$ = vequ(drl_depth_x$)
pcom_moveb
feed = fr_pos$
pcan
plane$ = drl_plane$
Predefined variables, postblocks, and functions: page 448

drl_depth_z$
M L R MT
The drill depth point in space (rotated or mapped based on post processor
settings).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None

How is this used?


Example
pdrlcommonb #Canned Drill Cycle common call, before
if sav_dgcode = 81,
[
result = newfs (two, zinc)
if drillcyc$ = three, drlgsel = fsg1(-ss$) + drillcyc$ * two
else, drlgsel = fsg2(dwell$) + drillcyc$ * two
drillrefx = vsub(drl_init_x$, drl_ref_x$)
if lng3(drillrefx) > vtol$, drillref = zero
else, drillref = one
prv_refht_a = c9k
prv_refht_i = c9k
prv_dwell$ = zero
]
prv_zia = drl_init_z$
x$ = vequ(drl_depth_x$)
pcom_moveb
feed = fr_pos$
pcan
plane$ = drl_plane$
Predefined variables, postblocks, and functions: page 449

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.

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 450

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).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 451

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).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 452

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).

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 453

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 454

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 455

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 456

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 457

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 458

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 459

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 460

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 461

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 462

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 463

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 464

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 465

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 466

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 467

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 468

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 469

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_m1$–drl_m3$ X-axis vector

drl_m4$–drl_m6$ Y-axis vector

drl_m7$–drl_m9$ Z-axis vector


Predefined variables, postblocks, and functions: page 470

Where does this value come from?


Output on following NCI lines
100

Control definition page


None
Predefined variables, postblocks, and functions: page 471

drl_plane$
M L R MT
The plane relative to the drill direction motion.

Possible values

–1 no match (see drl_skewed$)

0 for direction only in Z

1 for direction only in X

2 for direction only in Y

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
canceldc$ : 1
drl_usecan : 0
sav_plane : 0 #Save plane when drilling

pdrill0$ #Pre-process before drill call


drl_plane$ = plane2
sav_dgcode = gcode$ #Capture gcode for 5 axis drill
sav_plane = plane$
if drl_cycle$ < 8 & opcode$ <> 16,
[
#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$)
]
Predefined variables, postblocks, and functions: page 472

]
!drl_plane$
Predefined variables, postblocks, and functions: page 473

drl_prm1$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 474

drl_prm10$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 475

drl_prm2$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 476

drl_prm3$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 477

drl_prm4$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 478

drl_prm5$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 479

drl_prm6$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 480

drl_prm7$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 481

drl_prm8$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 482

drl_prm9$
M L R W MT
The custom drill parameters:

Where does this value come from?


Output on following NCI lines
82

Control definition page


None
Predefined variables, postblocks, and functions: page 483

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 484

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 485

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 486

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.

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 487

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.

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 488

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.

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 489

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 490

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 491

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 492

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 493

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 494

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 495

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 496

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 497

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 498

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 499

dum$
M L R W MT
Reserved for internal processing only. Never use this variable!

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 500

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:

Where does this value come from?


Output on following NCI lines
4 81 100

Control definition page


None

How is this used?


Example
pdwl_spd$ #Output to NC, spindle, dwell changes
pset_g_speed
pspindle
comment$
pnullspindle
pcan
if fmtrnd(dwell$), pdwell1
Predefined variables, postblocks, and functions: page 501

else, pcan1, pbld, n$, strcantext, e$


pcan2
Predefined variables, postblocks, and functions: page 502

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pwritecc # User-defined postblock to "cancel ccomp"
*e$ # Empty line with only cr/lf
n$, "G40", e$
Predefined variables, postblocks, and functions: page 503

ea$
M L R W MT
End angle (in degrees) of an arc move.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 504

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

1000 next tool change will be a null tool change

1002 next tool change will be a real tool change

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
if end_gcode$ = 1000,
[
# Null toolchange
if end_op_id$ <> op_id$, pretract_mov
]
else,
[
# Actual toolchange
pretract
]
Predefined variables, postblocks, and functions: page 505

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
#Determine if cancelling mapping mode
if top_map,
[
if tlplnno$ <> end_tlplnno$ | workofs$ <> end_workofs$ | end_rot_type$
| not(end_opcode$ <= 16 | end_opcode$ = 19),
map_mode = zero
]

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
if end_gcode$ = 1000,
[
#Null toolchange
if end_op_id$ <> op_id$, pretract_mov
]
else,
[
#Actual toolchange
pretract
]
Predefined variables, postblocks, and functions: page 507

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

3 Rotary axis positioning

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
#Determine if cancelling mapping mode
if top_map,
[
if tlplnno$ <> end_tlplnno$ | workofs$ <> end_workofs$ | end_rot_type$
| not(end_opcode$ <= 16 | end_opcode$ = 19),
map_mode = zero
]

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pfindrec4_id # Find a record in the UST file on ID and existsel
rc4 = one
find_rec4 = zero
size4 = rbuf(4, zero)
while rc4 <= size4 & find_rec4 = zero,
[
s_exist_tech = rbuf(4, rc4)
found = strstr(sspace, s_exist_tech)
sdummy = brksps(end_str_ix$ - one, s_exist_tech)
b4_ra = rpar(sdummy, 7)
if b4_id = existsel,
[
find_rec4 = one
rc4_id_ix = rc4 - one
]
]
Predefined variables, postblocks, and functions: page 510

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
#Determine if cancelling mapping mode
if top_map,
[
if tlplnno$ <> end_tlplnno$ | workofs$ <> end_workofs$ | end_rot_type$
| not(end_opcode$ <= 16 | end_opcode$ = 19),
map_mode = zero
]

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptoolend$ #End of tool path, before reading new tool data
#Determine if cancelling mapping mode
if top_map,
[
if tlplnno$ <> end_tlplnno$ | workofs$ <> end_workofs$ | end_rot_type$
| not(end_opcode$ <= 16 | end_opcode$ = 19),
map_mode = zero
]

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.

See the related variables sa$, ea$ and so$.

Possible values

0 through 16 octant number

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 513

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

0 Turn off end-of-block character.

1–255 ASCII decimal equivalent of the end-of-block character.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 514

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

0 Default; no change to power settings.

1 Indicates that the approach point uses different power settings or condition code.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 515

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

0 Send all error messages to an error log file (default).

1 Send all error messages encountered to screen (log file is generated but not saved)

2 Send only one error message of each type encountered to screen.


Predefined variables, postblocks, and functions: page 516

Where does this value come from?


Output on following NCI lines
None
Control definition page
Files page
Predefined variables, postblocks, and functions: page 517

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

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 518

Control definition page


Files page
Predefined variables, postblocks, and functions: page 519

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$.

Where does this value come from?


Output on following NCI lines
1019

Control definition page


None
Predefined variables, postblocks, and functions: page 520

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.

Where does this value come from?


Output on following NCI lines
1019

Control definition page


None
Predefined variables, postblocks, and functions: page 521

esub_op_id$
This is a unique ID number for the subprogram. M L R MT
See sub_op_id$ for much more information.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 522

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 being referenced by a transform somewhere else.

0 Non-transform

>0 Transform

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 523

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.

Where does this value come from?


Output on following NCI lines
1019

Control definition page


None
Predefined variables, postblocks, and functions: page 524

esub_totl_no$
M L R MT
Total number of subprogram instances.
See sub_totl_no$ for much more information.

Where does this value come from?


Output on following NCI lines
1019

Control definition page


None
Predefined variables, postblocks, and functions: page 525

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

Where does this value come from?


Output on following NCI lines
1019

Control definition page


None
Predefined variables, postblocks, and functions: page 526

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptlchg$ #Tool change - Output time calculations for the last tool run
if op_id$ = prv_op_id$, ex$
ptooldata #Total ending data for tool (Path Length and Times)
tmax_fr = fr_pos$ #Initialize (max fr used in current tool)
tmin_fr = fr_pos$ #Initialize (min fr used in current tool)
psetup #Call for toolchange info output
!op_id$
Predefined variables, postblocks, and functions: page 527

exitpost$
M L R W MT
Aborts the entire posting process and exits the post executable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
symoterror "WARNING-Y AXIS MOTION ENCOUNTERED. NO Y AXIS DEFINED IN MACHINE -
CHECK AXIS COMBINATION"

pcheck #Y output should not happen on a c-axis lathe


if not(toolchng) & yinc, [if (mprint(symoterror, 2) = 2), exitpost$]
Predefined variables, postblocks, and functions: page 528

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:

extend$ value Target values Source values

0 (default) Standard Standard

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

axisx$, axisy$, axisz$ rotp, rotv reading value

ptfixx$, ptfixy$, ptfixz$ rotp reading value

t1$, t2$, xresult$ xll, xla, xaa setting value

ptnearx$, ptneary$, xll, xla reading value


ptnearz$

st_str_ix$, end_str_ix$ rpar, rparsngl, rparsprm, strstr, scan setting value

spaces$ drs_str reading value

Extended values and string functions


Many of you are aware that strings also have an associated numeric value that can be set and
manipulated. Extended values are also supported for these as well. For 2017, the getstrval( ) and
setstrval( ) functions have been enhanced with an additional option that lets you get/set the
extended values associated with a string independently of the current extend$ value. The vlin(
) and vlout( ) functions have also been enhanced to support extended values.

Passing extended values to postblocks


You can use the extend$ value to control whether extended values are passed to a postblock
or used within it. When extend$ is set to a value other than 0, MP interprets the variables
that are passed to the postblock or returned from it as “source,” and the variables that are
referenced in the postblock declaration as “target.”

Extended values in debug output


For Mastercam 2017, an additional value has been defined for the bug4$ variable that lets you
output extended values as debug output. To do this, set bug4$ = –2 in your post. But please
note that bug4$ should only be set to –2 while extend$ = 0.

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

3 Use extended values for both target and source.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 532

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.

Table 2: MP output streams

subout$
Command variable File to be opened
value

— Main NC output stream 0

subprg$ Sub output file 1

auxprg$ Aux output file 2

extprg$ Ext output file 3

lccprg$ Lathe canned cycle 4


output file

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)

or by using it in a formula statement inside a postblock:


pblock # A postblock
extprg$ = 1
# Allow access to ext file (open and clear it)
subout$ = 3 # Re-direct the output to the ext file

Possible values

0 Disable writing to the alternate file.

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 534

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

0 Do not use fastmode$ (default).

1 Use fastmode$

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
fastmode$ : no$ # Turn on scaling
Predefined variables, postblocks, and functions: page 535

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:

See also rotfeed4$, rotfeed5$, inversefeed$, and convert_rpd$, lconvert_rpd$.


Note that the setting to Adjust feedrate on arc moves is not available as a predefined variable
and must be read from the operation parameters as parameter 18701.

Possible values

0 Use inverse feedrates

1 Use conventional feedrates (units/min.)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 536

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:

See also rotfeed4$, rotfeed5$, inversefeed$, and convert_rpd$, lconvert_rpd$.


Note that the setting to Adjust feedrate on arc moves is not available as a predefined variable
and must be read from the operation parameters as parameter 18701.

Possible values

0 Use inverse feedrates

1 Use conventional feedrates (units/min.)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 537

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:

See also rotfeed4$, rotfeed5$, inversefeed$, and convert_rpd$, lconvert_rpd$.


Note that the setting to Adjust feedrate on arc moves is not available as a predefined variable
and must be read from the operation parameters as parameter 18701.

Possible values

0 Use inverse feedrates

1 Use conventional feedrates (units/min.)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 538

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 539

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 540

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 541

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
pretract
comment$
if stagetool = one, pbld, n$, *first_tool$, e$
n$, "M05", "M26", "M30",e$
" ", e$
mergesub$
clearsub$
mergeaux$
clearaux$
Predefined variables, postblocks, and functions: page 542

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ncldr$ : 25 # Initialize the number of leader characters to output
ldrcode$ : 0 # Initialize the leader character to output
# (0 = decimal equivalent of the "null" character)

pheader$ # Call before start of file


fleader$ # Output the tape leader
"%", e$
*progno$, e$
"(PROGRAM NAME - ", progname$, ")", e$
"(DATE, Day-Month-Year - ", date$, " TIME, Hr:Min - ", time$, ")"

peof$ # End of file


n$, "M30", e$
"%", e$
ncldr$ = 30 # Change the number of leader characters to output
ldrcode$ = 42 # Change the leader character to output decimal
# equivalent( 42 = the "*" character)
fleader$ # Output the tape trailer
Predefined variables, postblocks, and functions: page 543

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

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None
Predefined variables, postblocks, and functions: page 544

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

any positive value Feed rate in inches or mm per minute

–1 Feed rate unchanged

–2 Rapid

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 1000 1001 1002

Control definition page


None

How is this used?


Example
#Pre-process rotary motion control flags, mill
pmx0$ #5 ax Drill
if cuttype = five,
[
if drill5$ = one, z$ = initht$ * z_mult
else,
[
if fr$ = -2, gcode$ = zero
else, gcode$ = one
]
]
Predefined variables, postblocks, and functions: page 545

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

any positive value Feed rate in inches or mm per minute

–1 Feed rate unchanged

–2 Rapid

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 546

fr_a_pvtrad$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 547

fr_b_pvtrad$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 548

fr_cut_dpth$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 549

fr_cut_opt$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 550

fr_c_pvtrad$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 551

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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.

To enable these variables, initialize x_mp_adv_func$ to 1 in your post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
When x_mp_adv_func$ is set to 1 (Mastercam 2017 or later), this value is automatically set
from the General Machine Parameters > Op. feed rate limits tab in the machine definition .
How is this used?
Example
x_mp_adv_func$ : 1 # Enable machine def variables

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pxyzcout #Map coordinates
xabs = vequ(x$) #Retrieve X,Y,Z positions into xabs,yabs,zabs
iout = vequ(i$)
feed = fr_pos$
if feed > maxfeedpm, feed = maxfeedpm
Predefined variables, postblocks, and functions: page 584

fr_zero_def$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 585

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

0 No, this is not a full arc.

1 Yes, this is a full arc.

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33

Control definition page


None

How is this used?


Example
parcijk #Select the arc output
if arcoutput$ = zero | full_arc_flg$,
[
#Arc output for IJK
iout, jout, kout
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=arc180 | arcoutput$=one, result = nwadrs(srad, arcrad$)
else, result = nwadrs(srminus, arcrad$)
*arcrad$
]
]
Predefined variables, postblocks, and functions: page 586

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#Motion G code selection, post uses g20code for output of string
sg00 G00 #Rapid
sg01 G01 #Linear feed
Predefined variables, postblocks, and functions: page 587

sg02 G02 #Circular interpolation CW


sg03 G03 #Circular interpolation CCW
sg04 G30 #Dwell
sg20code #Target for string
sg30code #Target for string

fstrsel sg00 g20code$ sg20code 5 -1


fstrsel sg00 g30code$ sg30code 6 -1
Predefined variables, postblocks, and functions: page 588

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#Motion G code selection, post uses g20code for output of string
sg00 G00 #Rapid
sg01 G01 #Linear feed
sg02 G02 #Circular interpolation CW
Predefined variables, postblocks, and functions: page 589

sg03 G03 #Circular interpolation CCW


sg04 G30 #Dwell
sg20code #Target for string
sg30code #Target for string

fstrsel sg00 g20code$ sg20code 5 -1


fstrsel sg00 g30code$ sg30code 6 -1
Predefined variables, postblocks, and functions: page 590

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 591

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 592

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 593

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

Which arcs will be replaced?


Conditions for the arc replacement can be set with the sweep$ and atol$ variables:
n sweep$—The sweep of the arc is tested before the routine is called. The arc sweep limit
is set by initializing sweep$ to the desired limit. This must be done in the initialization
because it is read only once from this section. For example:
sweep$ : 179 #Max. angle for G60 conversion, set during post read

n atol$—This determines the angle tolerance to determine if arc-to-line intersections


should be considered tangent. If the intersection angle exceeds the value set in atol$, the
condition is considered intersecting and the routine is aborted. The value of atol$ is set
in the control definition.

Variables modified by the routine


When a valid line-arc-line condition exists, the arc replacement routine must modify the data
that is seen by the post. The data read from the NCI file is buffered and modified before calls
are made to the output postblocks. This appears seamless to the post.
The value of g60_mode$ is set to 2 when the following occurs:
n Line endpoints at arc tangency are replaced with the intersection of the two lines. The
NCI position xnci$ and ynci$ are replaced.
n Arc radius variable arcrad$ is set to the radius of the replaced arc.
In some cases the post writer may need some of the data that is skipped or hidden by this
routine. This usually happens when taper changes have occurred in the area of the replaced
arc. The immediate$ variable tells you where the taper occurs relative to the replaced arc.
In addition, when g60_mode$ is active, nextwt$ is set to the first taper at the arc start and
nextwt_immd$ is set to the taper of the next actual move. Also, last_g60_wt$ is set for immediate
taper at the start of the replaced arc. The previous and current values for taper change are set
for in this variable.

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

1 Enable the routine

2 Indicates that a line-arc-line tangent condition has been found and the arc was
removed, indicating that this is the altered location.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Corner page
Predefined variables, postblocks, and functions: page 596

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Motion G code selection
sg00 G0 #Rapid
sg01 G1 #Linear feed
sg02 G2 #Circular interpolation CW
sg03 G3 #Circular interpolation CCW
sg04 G4 #Dwell
sgcode #Target for string

fstrsel sg00 gcode$ sgcode 5 -1


Predefined variables, postblocks, and functions: page 597

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

Table 3: Mill, Lathe, Router

NCI Gcode
Variables captured
value

0 or 1 nextop$, nextccomp$, nextx$, nexty$, nextz$, nextcflg$

2 or 3 nextop$, nextccomp$, nextx$, nexty$, nextz$, nextcflg$, nextplane$, nextxc$, nextyc$,


nextzc$, nextfullarcflg$

11 nextop$, nextx$, nexty$, nextz$, nextu$, nextv$, nextw$, nextcflg$

81 nextop$, nextx$, nexty$, nextz$, nextdc$

100 nextop$, nextx$, nexty$, nextz$

201 (Lathe nextop$


only)

1000 nextop$

1001 nextop$

1002 nextop$

1003 nextop$, nextccomp$

1004 and get_ nextop$


1004$

1013 nextop$

Table 4: Wire

NCI Gcode
Variables captured
value

0, 1, 20 or 21 nextop$, nextccomp$, nextx$, nexty$, nextz$, nextwt$, nextwc$, nextcflg$


Predefined variables, postblocks, and functions: page 598

NCI Gcode
Variables captured
value

2, 3, 22 or 23 nextop$, nextccomp$, nextx$, nexty$, nextz$, nextcflg$, nextplane$, nextxc$, nextyc$,


nextzc$, nextfullarcflg$

11 nextop$, nextx$, nexty$, nextz$, nextu$, nextv$, nextw$, nextcflg$

81 nextop$, nextx$, nexty$, nextz$, nextdc$

100 nextop$, nextx$, nexty$, nextz$

201 (Lathe nextop$


only)

1000 nextop$

1001 nextop$

1002 nextop$

1003 nextop$, nextccomp$

1004 and get_ nextop$


1004$

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

1004 is also skipped if the variable get_1004$ is 0.


If you need to know the original Gcode, the original nextop$ is stored in prv_nextop$. The
original nextccomp$ is stored in prv_nextccomp$, and the original nextdc$ is stored in prv_
nextdc$.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
getnextop$ : 1 #Declare and set =1 to enable getnext variables
Predefined variables, postblocks, and functions: page 600

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 601

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

See also gcode$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 602

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

0 Control does not have a cylindrical interpolation cycle.

1 Control supports cylindrical interpolation.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 603

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

0 Control does not have a high-speed cycle.

1 Control supports high-speed machining.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 604

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

0 Control does not have a polar interpolation cycle.

1 Control supports polar interpolation.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 605

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:

See arc_pitch$ and helix_tol$ for related information.

Possible values

0 Do not output arcs on helix motion. Mastercam will linearize the helixes.

1 Allow arc output on helix motion in all planes.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 606

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 607

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
]
else,
[
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
(plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,
[
#Arc output for IJK
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout #YZ plane code - G19
if plane$ = two, *iout, jout, *kout #XZ plane code - G18
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 &
arctypeyz$ = five) |
Predefined variables, postblocks, and functions: page 608

(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)


else, result = nwadrs(srminus, arcrad$)
*arcrad$
]
Predefined variables, postblocks, and functions: page 609

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

0 Do not use the routine (initialization).

1 Enable the routine (initialization), not an immediate taper change during NCI file
processing.

2 g60_mode$ is 0 (off) or currently 1 : Immediate taper.

3 g60_mode$ is currently 2: Immediate taper is on the start of replaced arc.

4 g60_mode$ is currently 2: Immediate taper is on the end of replaced arc.

5 g60_mode$ is currently 2: Immediate taper is on the start and end of replaced arc.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pmiscint$ #Check misc. integer setting to set flag
brk_cc_pos$ = –1 #Set to see if a move is being broken at start
linarc$ = zero
#Miscellaneous integer variable 2 Main program,0=Abs. 1=Inc.? 0
absinc$ = mi2$
#mi10 = zero # Don't allow this mode
# mi10 - Convert 2D wirepath to 4 axis:
# 0 = off
# 1 = 4 axis direct (Output XY:XY format)
# 2 = 4 axis taper (Output XYUV format)
if mi10$,
[
immediate$ = zero
Predefined variables, postblocks, and functions: page 610

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptlchg$ #Tool change
pcuttype
toolchng = one
if mi1$ = one, #Work coordinate system
[
pfbld, n$, *sg28ref, "X0.", "Y0.", e$
pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
]
inhibit_probe$
if prog_stop = 1, pbld, n$, *sm01, e$
if prog_stop = 2, pbld, n$, *sm00, e$
Predefined variables, postblocks, and functions: page 612

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pdrill0$ #Pre-drill postblock call
x$ = xnci$
y$ = ynci$
z$ = refht$
copy_x = vequ(x$)
pshft_map_xa
pxyzcout
refht_x = vequ(xabs)
z$ = depth$
copy_x = vequ(x$)
pshft_map_xa
pxyzcout
depth_x = vequ(xabs)
z$ = zdrl$
copy_x = vequ(x$)
pshft_map_xa
pxyzcout
zdrl_x = vequ(xabs)
z$ = initht$ #Initial is last
copy_x = vequ(x$)
pshft_map_xa
pxyzcout
initht_x = vequ(xabs)
znci$ = initht$
ps_inc_calc
Predefined variables, postblocks, and functions: page 613

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

negative Taper, left

0 No taper

positive Taper, right

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None

How is this used?


Example
ptlchg1002$ #Call at actual toolchange, examine start position
pthdstrttype #Determine the start/thread position type
cntrflag = zero
if nosubs = yes$ | subtyp$ = zero, subsflag = zero
else,
[
subsflag = one
prv_cend$ = zero
prv_cstart$ = zero
]
if g60_mod_on = one & wtmax, g60_mode$ = one
else, g60_mode$ = zero
sav_wt = inittaper$ # Save Initial Taper setting
postlchng = one
Predefined variables, postblocks, and functions: page 614

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page

How is this used?


Example
if inversefeed$, #Feedrate in seconds
[
frinv = (fr_pos$*(1/60))/cldelta
if frinv > (maxfrinv/60), frinv = (maxfrinv/60)
]
else, #Feedrate in minutes
[
frinv = fr_pos$/cldelta
if frinv > maxfrinv, frinv = maxfrinv
]
feed = frinv
]
Predefined variables, postblocks, and functions: page 615

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

0 Units per minute

1 Units per revolution

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ipr_actv$ : -1 #Initialize active feed type

# Feed mode G code selection


sg98 G98 #UPM
sg99 G99 #UPR
sgfeed #Target for string

fstrsel sg98 ipr_actv$ sgfeed 2 -1


Predefined variables, postblocks, and functions: page 616

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
]
else,
[
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
(plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,
[
#Arc output for IJK
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout #YZ plane code - G19
if plane$ = two, *iout, jout, *kout #XZ plane code - G18
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 &
arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)
Predefined variables, postblocks, and functions: page 617

else, result = nwadrs(srminus, arcrad$)


*arcrad$
]
Predefined variables, postblocks, and functions: page 618

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
parc #Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) | #XY Plane
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)), #XZ Plane
[
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
]
else,
[
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
]
if (plane$ = 0 & arctype$ < five) | (plane$ = 1 & arctypeyz$ < five) |
(plane$ = 2 & arctypexz$ < five) | full_arc_flg$ | arc_pitch$,
[
#Arc output for IJK
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout #YZ plane code - G19
if plane$ = two, *iout, jout, *kout #XZ plane code - G18
!i$, !j$, !k$
]
else,
[
#Arc output for R
if abs(sweep$)<=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 &
arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)
Predefined variables, postblocks, and functions: page 619

else, result = nwadrs(srminus, arcrad$)


*arcrad$
]
Predefined variables, postblocks, and functions: page 620

landheight$
W
Land height value from wirepath contour parameters page.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 621

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 622

larcoutput$
L MT
Obsolete; use larctype$ instead. This was used in Mastercam X to help control
how older posts were updated.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 623

larcoutputxz$
L MT
Obsolete; use larctypexz$ instead. This was used in Mastercam X to help control
how older posts were updated.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 624

larcoutputyz$
L MT
Obsolete; use larctypeyz$ instead. This was used in Mastercam X to help control
how older posts were updated.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 625

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 626

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 627

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 628

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 629

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

2 Delta (start to center)

3 Delta (center to start)

4 Unsigned incremental (use absolute format)


Predefined variables, postblocks, and functions: page 630

5 Unsigned radius

6 Signed radius

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 631

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pget_wt_last #Assign last_g60_wt to wtout
if prv_cntrflag = two, pget_wt
wtgcode = fsg3(last_g60_wt$)
wtout = abs(last_g60_wt$)
Predefined variables, postblocks, and functions: page 632

last_tool$
M L R W MT
Holds the number of the last tool used in the NCI file.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 633

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 635

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 637

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.

1 Break arcs at quadrants.

2 Break arcs so that no segment is greater than 180 degrees of sweep.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 639

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.

Table 5: MP output streams

subout$
Command variable File to be opened
value

— Main NC output stream 0

subprg$ Sub output file 1

auxprg$ Aux output file 2

extprg$ Ext output file 3

lccprg$ Lathe canned cycle 4


output file

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)

or by using it in a formula statement inside a postblock:


pblock # A postblock
lccprg$ = 1
# Allow access to lcc file (open and clear it)
subout$ = 4 # Re-direct the output to the lcc file

Possible values

0 Disable writing to the alternate file.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ppost$ #Post process postblock
#set file paths, names and extensions for buffer, lcc and NC
slccfile = spathnc$ + snamenc$ + sextlcc$
sbufname4$ = spathnc$ + snamenc$ + sextnc$
sncfile = spathnc$ + snamenc$ + sextnc$

spathlcc$ = spathnc$ #Set lcc path equal to NC path


snamelcc$ = snamenc$ #Set lcc file name equal to NC name

lccprg$ = 1 #Intialize a new lccfile


subout$ = 4 #Set post output to .lcc file
newlcc$ #Open new lathe canned cycle file for output
Predefined variables, postblocks, and functions: page 641

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 642

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.

3 On end of cut, last point on surface, chained contour, etc.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 643

ldina1$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 644

ldina2$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 645

ldinl1$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 646

ldinl2$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 647

ldouta1$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 648

ldouta2$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 649

ldoutl1$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 650

ldoutl2$
M R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 651

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 652

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

0 Full 360-degree arcs will be broken into two 180-degree moves.

1 Any full 360-degree arcs will passed to the post processor.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 653

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 654

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 655

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

0 Allow arcs in the selected plane.

1 Arcs are not allowed in the selected plane, any arcs that occur will be linearized.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 656

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 657

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ncldr$ : 25 # Initialize the number of leader characters to output
ldrcode$ : 0 # Initialize the leader character to output
# (0 = decimal equivalent of the "null" character)

pheader$ # Call before start of file


fleader$ # Output the tape leader
"%", e$
*progno$, e$
"(PROGRAM NAME - ", progname$, ")", e$
"(DATE, Day-Month-Year - ", date$, " TIME, Hr:Min - ", time$, ")"

peof$ # End of file


n$, "M30", e$
"%", e$
ncldr$ = 30 # Change the number of leader characters to output
ldrcode$ = 42 # Change the leader character to output decimal
# equivalent( 42 = the "*" character)
fleader$ # Output the tape trailer
Predefined variables, postblocks, and functions: page 658

lfeedtype3$
L MT
Determine the type of feed rate that is used for 3-axis motion (lathe).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 659

lfeedtype4$
L MT
Determine the type of feed rate that is used for 4-axis motion (lathe).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 660

lfeedtype5$
L MT
Determine the type of feed rate that is used for 5-axis motion (lathe).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 661

lhelix_arc$
L MT
Controls output of arcs when doing helix motion (Lathe)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Arc page
Predefined variables, postblocks, and functions: page 662

lima1$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 663

lima2$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 664

limb1$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 665

limb2$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 666

limc1$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 667

limc2$
M L R MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 668

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

0 No, do not breakup arc motion.

1 Yes, break up (linearize) arc moves.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 669

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

0 Do not automatically assign values to Lathe canned cycle variables (default).

1 Assign values to Lathe canned cycle variables from the Mill equivalents.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 670

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

0 Do not automatically assign values to new arc variables (default).

1 Assign values to new arc variables from the Mill equivalents.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 671

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

0 Do not automatically assign values to metric tolerance variables (default).

1 Assign values to metric tolerances from the inch equivalents.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 672

linversefeed$
L MT
Indicates whether the lathe inverse feed rate is specified in in minutes (0) or
seconds (1).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 673

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$.

Using the taper and radius list in Wire


The taper and radius lists are used on some wire EDM machines to replace an explicit address
and values on the NC motion line with the machine tools register that holds the value. For
example:
O0100 (T)
N100 H1=0.0
N100 H2=3.0
N100 H3=1.0
N100 G00 G20 G90
N110 G75 X-.70479 Y.20024
N120 G92 X-.70479 Y.20024 I-.375 J0.
N130 S1 D1
N140 M37
N150 G42 G51 G01 X-.715 Y.1301 H2
N160 Y.062
N170 X-.25
N180 Y.012
N190 X-.2601 G60 R.007
N200 Y-.301 H3
N210 X-.5634
N220 G50 Y-.58923 H1
N230 X-1.01 Y-.84708
N240 G40 X-1.00616 Y-.91045
N250 M45
N260 M30
%

In this example, the H offset register is read for the taper to be used in the toolpath.

Enabling taper and radius lists


To enable the taper and radius lists, the tool table routine must be enabled. This routine
processes through the NCI file as a pre-read routine and finds all the 2D contour motion that
contains the wire tapers. It also finds all the NCI lines (1010 and 1013) that have wire
diameters and calculates the wire radius. These are then written to the appropriate list. To
enable this routine, in your post initialize the value of bldnxtool$ to 1:
bldnxtool$ : 1 # Builds table of taper and radius

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

set in the post.

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

*offset$, " = ", *tlrad$, e$

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.

How taper and radius values are processed


The taper list captures the taper values from the NCI Gcode 0, 1, 2 and 3 lines. Each value is
stored in the numeric variable wt$ after it is read, and then written to the list in the order it is
found (if it is not a duplicate). The index position is stored in the numeric variable tofs$. The
list starts at base of 1 (tofs$ = 1) and this is pre-assigned the value zero. The postblock ptprlist$
is called at each list entry that was written in ascending order.
During the processing of the NCI file, each time MP reads an NCI Gcode 0, 1, 2 and 3, it takes
the current value for wire taper wt$ from the NCI parameters and compares it to the taper list.
It returns the index in the list to the variable tofs$, which is the variable used in the output
statement.
plinout # Sample postblock for linear motion output
n$, x$, y$, z$, tofs$, e$

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

0 Disabled. pradlist$ is not called

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.)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Variables required to build wire radius and taper lists

bldnxtool$ : 1 # Builds table of taper and radius


listrad$ : 2 # Enable radius list output

pradlist$ # Generate wire radius list


if listrad$ = 2, #Process 20200 lines
[
if offset_mach$, # Apply additional offset to machine
Predefined variables, postblocks, and functions: page 676

# offset register was selected.


[ # Machine offset register is not available
# when computer comp or off are selected.
if cc_type$ = 1, # Control
[ # Use ttl_offset value pulled from operation
# parameters - NCI has not been shifted.
]
if cc_type$ = 2 | cc_type$ = 3, #Both or reverse both
[
tlrad$ = stock_leave$ # Shift by stock to leave value.
# NCI has been shifted by wire
# radius and overburn.
]
]
else, # Apply additional offset to program coordinates was selected
[
if cc_type$ = 1, #Control
[
tlrad$ = tlrad$ + overburn$ # Shift by wire radius and overburn.
# NCI has been shifted by stock-to-
# leave value.
]
else, # Computer, both, reverse both or off
[
tlrad$ = 0 # For computer, both and reverse both,
# NCI has been shifted by total offset value.
] # When off, NCI is shifted for stock to leave only
# and offset register is set to 0.
] # Overburn and wire radius are ignored - we are centerline cutting.
]
if (hreg_style <> one & hreg_style <> two & hreg_style <> three),
hreg_style = one # If passed a bad setting, assume this 'H' mode
# 'H' variable offset use format (settings: 1, 2, or 3)
if (hreg_style <> 2 & hreg_style <> 3), *offset$, "=", *tlrad$, e$
Predefined variables, postblocks, and functions: page 677

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
bldnxtool$ : 1 # Builds table of taper and radius
listtpr$ : 1 # Enable taper list output

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$
Predefined variables, postblocks, and functions: page 678

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

0 No, do not breakup arc motion.

1 Yes, break up (linearize) arc moves.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 679

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 680

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 681

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 682

lofs$
W
Current offset register number as entered in Mastercam. This is now obsolete; use
offset$ instead.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 683

lower_x$
M L R W MT
0

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 684

lower_y$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 685

lower_z$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 686

lrotfeed4$
L MT
Indicates the units used for 4-axis rotary feed rates (lathe).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 687

lrotfeed5$
L MT
Indicates the units used for 5-axis rotary feed rates (lathe).

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 688

lstation$
M L R MT
Lathe station for mill/turn applications. Head number in Mill and Router.
See related variable uselstation$.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 689

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 690

ltool_id$
M L R MT
Unique tool ID number for Lathe tools.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 691

lturret$
M L R MT
The lathe turret that is currently being used.

Possible values

0 Bottom turret

1 Upper turret

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 692

lusecanbore1$
L MT
Enable the first lathe canned drill cycle for boring.
Set lusecanbore1$ and lusecanbore2$ with the following control definition
options:

These are lathe versions of the mill variables usecanbore1$, usecanbore2$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles postblocks.


Predefined variables, postblocks, and functions: page 693

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 694

lusecanbore2$
L MT
Enable the second lathe canned drill cycle for boring.
Set lusecanbore1$ and lusecanbore2$ with the following control definition
options:

These are lathe versions of the mill variables usecanbore1$, usecanbore2$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles postblocks.


Predefined variables, postblocks, and functions: page 695

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 696

lusecanchip$
L MT
Enable the lathe chip break canned cycle for drilling. Set this variable with the
following control definition option:

This a lathe version of the mill variable usecanchip$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles postblock lchpbrk$.


Predefined variables, postblocks, and functions: page 697

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 698

lusecandrill$
L MT
Enable the canned cycle for lathe drilling. Set this variable with the following
control definition option:

This a lathe version of the mill variable usecandrill$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles cycles postblock ldrill$.


Predefined variables, postblocks, and functions: page 699

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 700

lusecanmisc1$
L MT
Enable the first miscellaneous lathe canned drill cycle.
Set lusecanmisc$ and lusecanmisc2$ with the following control definition
options:

These are lathe versions of the mill variables usecanmisc1$, usecanmisc2$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles cycles postblock lmisc1$.


Predefined variables, postblocks, and functions: page 701

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 702

lusecanmisc2$
L MT
Enable the second miscellaneous lathe canned drill cycle.
Set lusecanmisc$ and lusecanmisc2$ with the following control definition
options:

These are lathe versions of the mill variables usecanmisc1$, usecanmisc2$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles cycles postblock lmisc2$.


Predefined variables, postblocks, and functions: page 703

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 704

lusecanpeck$
L MT
Enable the canned cycle for lathe peck drilling. Set this variable with the
following control definition option:

This a lathe version of the mill variable usecanpeck$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles cycles postblock lpeck$.


Predefined variables, postblocks, and functions: page 705

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 706

lusecantap$
L MT
Enable the canned cycle for lathe tap drilling. Set this variable with the
following control definition option:

This a lathe version of the mill variable usecantap$.


These are designed to be used with mill-turn posts when you need to maintain separate sets of
values for mill and lathe operations.
n Before the lathe variables can be used, they need to be enabled by setting usecan_lathe$
to 1. Use the following option on the control definition Machine cycles page to do this:

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.

1 Enable call to canned drill cycles cycles postblock ltap$.


Predefined variables, postblocks, and functions: page 707

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 708

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 709

Control definition page


None
Predefined variables, postblocks, and functions: page 710

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 711

Control definition page


None
Predefined variables, postblocks, and functions: page 712

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 713

Control definition page


None
Predefined variables, postblocks, and functions: page 714

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 715

Control definition page


None
Predefined variables, postblocks, and functions: page 716

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 717

Control definition page


None
Predefined variables, postblocks, and functions: page 718

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 719

Control definition page


None
Predefined variables, postblocks, and functions: page 720

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 721

Control definition page


None
Predefined variables, postblocks, and functions: page 722

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 723

Control definition page


None
Predefined variables, postblocks, and functions: page 724

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

m1$–m3$ X-axis vector

m4$–m6$ Y-axis vector

m7$–m9$ Z-axis vector

Where does this value come from?


Output on following NCI lines
1014
Predefined variables, postblocks, and functions: page 725

Control definition page


None
Predefined variables, postblocks, and functions: page 726

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
p_postblock
pbld, n$, "M98", *main_prg_no$, e$
Predefined variables, postblocks, and functions: page 727

main_prg_no_offs$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 728

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 729

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Work System page
Predefined variables, postblocks, and functions: page 730

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 732

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 733

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 735

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 736

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 738

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 739

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 741

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 742

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 744

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 745

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 747

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 748

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 750

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 751

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 753

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 754

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.

Setting the matrix directly from the machine definition


Beginning with Mastercam 2017, MP can calculate the matrix and set the variables directly
from the Positive axis direction vector for each linear axis. This is the vector that is circled in
Predefined variables, postblocks, and functions: page 756

the picture, adjusted by the Tilt Angle (if any):

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
pmatrix_su #Establish mapping matrix 'mmtx1' for 4-ax router
tmtx1 = matt(aaxisx)
tmtx1 = mmul(tmtx1,m1$)
rmtx1 = matt(m1$)
mmtx1 = mmul(rmtx1,matb1$)
Predefined variables, postblocks, and functions: page 757

matm2$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 758

matm2$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 759

matm3$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 760

matm4$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 761

matm5$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 762

matm6$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 763

matm7$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 764

matm8$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 765

matm9$
M L R W MT
Internal mapping matrix. These variables expose the internal coordinate
mapping matrix for rotaxtyp$ = 2 and rotaxtyp$ = 4.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 766

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 767

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 768

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

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1020

Control definition page


None

How is this used?


Example
pcssg50 #Output Constant surface speed clamp
if css_actv$, pbld, n$, *sg50, *maxss$, e$
Predefined variables, postblocks, and functions: page 770

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page

How is this used?


Example
#set tangency flag
if abs(move_ang$) > atol$ & abs(move_ang$) < max_atol$, tanflag = zero
else, tanflag = one
Predefined variables, postblocks, and functions: page 771

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 772

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 773

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 774

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 775

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 776

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.

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 777

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

The following is a legal use of the merge function:


pblock # A postblock
subout$ = 0 # Direct the output to the NC file
mergeaux$ # Append the aux file to the NC file

See related variables auxprg$, clearaux$ and nchaux$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergeaux$
clearaux$
"%", e$
Predefined variables, postblocks, and functions: page 778

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

The following is a legal use of the merge function:


pblock # A postblock
subout$ = 0 # Direct the output to the NC file
mergeext$ # Append the ext file to the NC file

See related variables extprg$, clearext$ and nchext$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergeext$
clearext$
"%", e$
Predefined variables, postblocks, and functions: page 779

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

The following is a legal use of the merge function:


pblock # A postblock
subout$ = 0 # Direct the output to the NC file
mergelcc$ # Append the lcc file to the NC file

See related variables lccprg$, clearlcc$ and nchlcc$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergelcc$
clearlcc$
"%", e$
Predefined variables, postblocks, and functions: page 780

mergenumber$
M L R MT
OBSOLETE: Used to support the Runclath C-Hook to provide the ordered
sequence number of the current operation.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 781

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

The following is a legal use of the merge function:


pblock # A postblock
subout$ = 0 # Direct the output to the NC file
mergesub$ # Append the sub file to the NC file

See related variables subprg$, clearsub$ and nchsub$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
n$, "M30", e$
mergesub$
clearsub$
mergeext$
clearext$
"%", e$
Predefined variables, postblocks, and functions: page 782

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 783

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 784

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 785

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 786

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 787

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 788

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 789

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 790

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 791

How is this used?


Example
ptimecss #Feed time and length calc, CSS
if abs(dx) <= met_mtol$, ptimecs1 #No X axis motion
else, ptimecs2 #Yes, there was X axis motion
Predefined variables, postblocks, and functions: page 792

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

0 Inch configuration setting

1 Metric configuration setting

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None

How is this used?


Example
#Select english/metric code
sg20 G20 #Inch code
sg21 G21 #Metric code
smetric #Target string

fstrsel sg20 met_tool$ smetric 2 -1


Predefined variables, postblocks, and functions: page 793

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 794

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 795

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 796

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 797

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 798

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 799

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 800

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 801

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 802

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 803

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 804

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.

Where does this value come from?


Output on following NCI lines
1012

Control definition page


None

How is this used?


Example
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 805

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

0 Not a 5-axis operation

1 5-axis milling operation

2 5-axis drill operation

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pcuttype #Determine the cut type
#cuttype (0 = Tool Plane, 1 = Axis Subs, 2 = Polar, 3 = 4/5 axis)
cuttype = rotary_type$
if cuttype = three, cuttype = zero
if mill5$,
[
if rot_on_x = zero, result = mprint(saxisoff)
cuttype = three
]
if rotary_axis$,
[
if rotary_axis$ <> rot_on_x, result = mprint(saxiswarn)
rot_on_x = rotary_axis$
]
#Check for Tool Origin in Polar Milling
if cuttype = two & (tox$ | toy$ | toz$), result = mprint(stlorgerr)
#Transform Rotate, set mr_rt_actv if user selected 'coordinates'
if sub_trnstyp$ = one & sub_trnmthd$ = two,
[
#Calculate the rotation incremental angle for G68
rt_csav = atan2(sub_m2$, sub_m1$)
Predefined variables, postblocks, and functions: page 806

rt_cinc = prv_rt_csav - rt_csav


while rt_cinc > 180, rt_cinc = rt_cinc - 360
while rt_cinc < -180, rt_cinc = rt_cinc + 360
if rot_ccw_pos = one, rt_cinc = -rt_cinc
!rt_csav
if sub_sec_no$, mr_rt_actv = two
else, mr_rt_actv = one
]
else, mr_rt_actv = zero
pfcalc_u_min
pmotion_su
Predefined variables, postblocks, and functions: page 807

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 808

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 809

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 810

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 811

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 812

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 813

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 814

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 815

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 816

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 817

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 818

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.

Where does this value come from?


Output on following NCI lines
912

Control definition page


None
Predefined variables, postblocks, and functions: page 819

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 820

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 821

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 822

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 823

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 824

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 825

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 826

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 827

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 828

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.

Where does this value come from?


Output on following NCI lines
911

Control definition page


None
Predefined variables, postblocks, and functions: page 829

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:

Variable Unformatted (string) Formatted (number)

mon$ Sep 9.0

month$ 09 9.0

year$ 08 8.0

day$ 26 26.0

See related variables date$, time$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
Predefined variables, postblocks, and functions: page 830

*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:

Variable Unformatted (string) Formatted (number)

mon$ Sep 9.0

month$ 09 9.0

year$ 08 8.0

day$ 26 26.0

See related variables date$, time$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
Predefined variables, postblocks, and functions: page 832

*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]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 834

motion_rot$
M L R W MT
[reserved for future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 835

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

3 Motion in X and Y only

4 Motion in Z only

5 Motion in X and Z only

6 Motion in Y and Z only

7 Motion in X, Y, and Z only

8 No motion except wire taper or wire corner change with Wire.

9 No motion except wire corner change with Wire.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ptlchg$ #Tool change
suppress_init_thd = 0
pcuttype #Determine the cut type, 0=2D, 1=direct, 2=taper
if prv_dir4ax & pass$ = 1, #If previous op was 4-ax direct
[
dir4ax = 0 #Upper and Lower heteromorphism OFF
Predefined variables, postblocks, and functions: page 836

pbld, n$, sdirect4ax, e$ #4-Axis Direct


]
if prv_taper4ax & pass$ = 1, #If previous op was 4-ax taper
[
taper4ax = 0 #4 Axes controlled simultaneously OFF
pbld, n$, staper4ax, e$ #4-Axis Taper
]
g20code$ = zero
if pass$ > 1,
[
ppasscomm
comment$
]
#if there was no motion, stop gcode, else force motion
if (motst$ < one | motst$ > 7) & not(strtflag), !g20code$
else,
[
prv_g20code$ = -1
prv_xabs = c9k
prv_yabs = c9k
]
Predefined variables, postblocks, and functions: page 837

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

positive Indicates a turn to the right of the current direction of motion.

negative Indicates a turn to the left of the current direction of motion.

–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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#set tangent flag
if abs(move_ang$) > atol$ & abs(move_ang$) < max_atol$, tanflag = zero
else, tanflag = one
Predefined variables, postblocks, and functions: page 838

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

positive Angle (0–180 degrees). 0 degrees is tangent.

–9999 First or last toolpath move.

9999 No motion (coincident positions).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 839

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

–3 XZ plane; automatic processing

–2 YZ plane; automatic processing

–1 XY plane; automatic processing

0 XY plane; static value. This value is processed the same as 1. It is provided to


maintain compatibility with existing posts.

1 XY plane; static value

2 YZ plane; static value

3 XZ plane; static value

4 or greater Disable all move angle calculations

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 840

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 841

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 842

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 843

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 844

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 845

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 846

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 847

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 848

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 849

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.

Where does this value come from?


Output on following NCI lines
1011

Control definition page


None

How is this used?


Example
pmiscreal$ # Set the misc. real values
clear_vec = mr1$
cut_ra_head = mr2$
safe_z_ret = mr6$
nut_z_dist = mr10$
Predefined variables, postblocks, and functions: page 850

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 851

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 852

How is this used?


Example
ptimecss #Feed time and length calc, CSS
if abs(dx) <= mtol$, ptimecs1 #No X axis motion
else, ptimecs2 #Yes, there was X axis motion
Predefined variables, postblocks, and functions: page 853

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

Where does this value come from?


Output on following NCI lines
1050

Control definition page


None
Predefined variables, postblocks, and functions: page 855

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pblock # A postblock
n$, x$, y$, z$, e$
Predefined variables, postblocks, and functions: page 856

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
if nchar$ = 0, "NOTHING WAS WRITTEN TO THE FILE"
Predefined variables, postblocks, and functions: page 857

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
pbld, n$, "M02",e$
if nchaux$ > one,
[
" ", e$
mergeaux$
clearaux$
]
"%", e$
Predefined variables, postblocks, and functions: page 858

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
pbld, n$, "M02",e$
if nchext$ > one,
[
" ", e$
mergeext$
clearext$
]
"%", e$
Predefined variables, postblocks, and functions: page 859

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
pbld, n$, "M02",e$
if nchlcc$ > one,
[
" ", e$
mergelcc$
clearlcc$
]
"%", e$
Predefined variables, postblocks, and functions: page 860

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
ptoolend$
comment$
pbld, n$, "M02",e$
if nchsub$ > one,
[
" ", e$
mergesub$
clearsub$
]
"%", e$
Predefined variables, postblocks, and functions: page 861

nci_buffer_size$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 862

nci_line$
M L R W MT
NCI line number currently being processed. This is typically only used
for testing or debugging purposes.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 863

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
loop_var : 0
peof # In this example, the post is run through twice
while loop_var < 2,
[
loop_var = loop_var + 1
nci_rewind$
]
Predefined variables, postblocks, and functions: page 864

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ncldr$ : 25 # Initialize the number of leader characters to output
ldrcode$ : 0 # Initialize the leader character to output
# (0 = decimal equivalent of the "null" character)

pheader$ # Call before start of file


fleader$ # Output the tape leader
"%", e$
*progno$, e$
"(PROGRAM NAME - ", progname$, ")", e$
"(DATE, Day-Month-Year - ", date$, " TIME, Hr:Min - ", time$, ")"

peof$ # End of file


n$, "M30", e$
"%", e$
ncldr$ = 30 # Change the number of leader characters to output
ldrcode$ = 42 # Change the leader character to output decimal
# equivalent( 42 = the "*" character)
fleader$ # Output the tape trailer
Predefined variables, postblocks, and functions: page 865

nc_lout$
M L R W MT
Indicates if NC output was generated. See no_updprv$ for more
information.

Possible values

-1 No output was generated.

0 and greater Indicates the postblock level that generated output.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
plinout #Output to NC of linear movement - feed
punclamp
pcan1, pbld, n$, `sgcode, sgplane, sgabsinc, `sgfeed, pccdia,
xout, yout, zout, p_out, s_out, `feed, strcantext, scoolant, e$
if nc_lout$ <> –1 & feed = zero, psfeederror
pclamp
Predefined variables, postblocks, and functions: page 866

nc_prv_modal$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 867

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$.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 868

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pblock #sample postblock to set paths/names/extensions for buffer,
# aux and NC files

sauxfile = spathnc$ + snamenc$ + sextaux$


sbufname2$ = spathnc$ + snamenc$ + sextnc$
sncfile = spathnc$ + snamenc$ + sextnc$

spathaux$ = spathnc$ #Set aux path to that of NC path


snameaux$ = snamenc$ #Set aux file name to that of NC name

auxprg$ = 1 #Intialize a new auxfile (sauxfile)


subout$ = 2 #Set post output to .AUX file
newaux$ #Open new auxilary file for output
Predefined variables, postblocks, and functions: page 869

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psubname_x #Name the alt subprogram
snameext$ = no2str(main_prg_no$)
newext$
Predefined variables, postblocks, and functions: page 870

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example uses two global variables called roughing and finishing that are set to 1
based on the tool_op$ value before being used in a conditional statement inside a
postblock.
newglobal$ : 1 # Error checking for global variables
#Define operations to include in CYCLE832 tech finish qualities
roughing =
(
tool_op$ = 5 | #Multisurface rough parallel
tool_op$ = 6 | #Multisurface rough radial
tool_op$ = 7 | #Multisurface rough project
tool_op$ = 8 | #Multisurface rough flowline
tool_op$ = 9 | #Multisurface rough contour
tool_op$ = 10 | #Multisurface rough pocket
tool_op$ = 44 | #Multisurface rough plunge
tool_op$ = 107 | #Multi-surface rough restmill
tool_op$ = 110 | #Multi-surface 5axis, rough
tool_op$ = 131 #Multi-surface rough pocket, light
)

finishing =
(
Predefined variables, postblocks, and functions: page 871

tool_op$ = 11 | #Multisurface finish parallel


tool_op$ = 12 | #Multisurface finish radial
tool_op$ = 13 | #Multisurface finish project
tool_op$ = 14 | #Multisurface finish flowline
tool_op$ = 15 | #Multisurface finish contour
tool_op$ = 39 | #Multisurface finish pencil trace
tool_op$ = 40 | #Multisurface finish leftover stock
tool_op$ = 41 | #Multisurface finish steep
tool_op$ = 42 | #Multisurface finish shallow
tool_op$ = 43 | #Multisurface finish constant scallop
tool_op$ = 45 | #Multisurface finish 5-axis flowline
tool_op$ = 46 | #Multisurface finish 4-axis
tool_op$ = 109 #Multi-surface finish blend
)

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pblock #sample postblock to set paths/names/extensions for buffer,
# lcc and NC files

sauxfile = spathnc$ + snamenc$ + sextlcc$


sbufname4$ = spathnc$ + snamenc$ + sextnc$
sncfile = spathnc$ + snamenc$ + sextnc$

spathalcc$ = spathnc$ #Set lcc path to that of NC path


snamelcc$ = snamenc$ #Set lcc file name to that of NC name

lccprg$ = 1 #Intialize a new lccfile (slccfile)


subout$ = 4 #Set post output to .LCC file
newlcc$ #Open new LCC file for output
Predefined variables, postblocks, and functions: page 873

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psubname_m #Name the main subprogram
snamesub$ = no2str(main_prg_no$)
newsub$
Predefined variables, postblocks, and functions: page 874

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

40 Cancel cutter compensation in the control.

41 Cutter compensation in the control = left.

42 Cutter compensation in the control = right.

140 Cancel compensation in the control with last move.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 875

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pstarttest #Toolchange reposition from last contour test
gcode$ = zero
xa = startx$
ya = starty$
pstarttest2
xa = threadx$
ya = thready$
scflg = no2str(nextcflg$)
cstart$ = plcval(scflg, 4)
if cstart$ = 9999, cstart$ = 0
pstarttest2
if strtest = zero, pbuffer1
!strtest
if mi1$ <> zero, prv_strtest = one
strtest = zero
Predefined variables, postblocks, and functions: page 876

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pcaxis_on_m #Toolchange C axis enable, mill, check prv_ to current
if (rc1 = two | prv_posttype$ = two),
[
pbld, n$, *sm23, e$
if nextdc$ = three, pbld, n$, "M49", e$ #Disable tap
]
Predefined variables, postblocks, and functions: page 877

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 878

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 879

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 880

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 881

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 882

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 883

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 884

nextwt$
W
Provides the next NCI Gcode wire taper.

Possible values

Positive Right tilt in the direction of travel

Negative Left tilt in the direction of travel

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 885

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

Positive Right tilt in the direction of travel

Negative Left tilt in the direction of travel

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 886

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 887

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 888

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 889

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 890

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 891

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 892

next_t$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 893

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pstagetool #Pre-stage tools
if stagetool = 1,
[
if ttblend$, #Check for last toolchange
[
if stagetltype = 1, *next_tool$ #Stage first tool at last toolchange
]
else, *next_tool$ #Stage tool at every toolchange
]
Predefined variables, postblocks, and functions: page 894

no$
Use this variable to indicate a false condition. It is typically equal to 0. M L R W MT

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 895

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 897

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 899

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
Linear page
Predefined variables, postblocks, and functions: page 901

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

1 Associated to no core finish contour.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 902

not( )
NOT operator. Reverses the result of the conditional expression x.

The general form is:


return = not(x).
where
where
returnReturns 0 if x is TRUE, 1 if x is FALSE.xconditional expression to be
evaluatedXXYYXXYY
Predefined variables, postblocks, and functions: page 903

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

-1 Override all output inhibitors and forces output.

0 Process normally (default).

1 Process post instructions internally; inhibit NC output.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 904

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$

This might generates the following NC code:


N101 G00 X1.0 Y2.0 S750 M03

If you add the no_spc$ command in the postline as follows:


n$, *sgcode, x$, y$, *speed, no_spc$, *spindle, e$

The NC code would be output like this:


N101 G00 X1.0 Y2.0 S750M03

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

0 Omit spaces, one time only

1 Modal omit spaces

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 905

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

0 Process normally (default)

1 Buffer the following output statement variable types:


n Undressed numeric variable (var)
n Forced numeric variable *var)
n Dependent numeric variable (`var)
n Numeric variable selector (used within a string select function)
n Update the previous values after the NC line is output.

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 906

How is this used?


Example
no_updprv$ : 1
pblock # A postblock
n$, x$, py, z$, e$

py # A postblock to output y
if x$ = prv_x$, y$

# In this example, without no_updprv$ this condition would always


# evaluate true because x$ would update as a postline statement.
Predefined variables, postblocks, and functions: page 907

nqc$
M L R W MT
OBSOLETE: Number of characters in the string that answers a user-
defined post question.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 908

nspring$
L MT
Number of spring cuts entered in Mastercam for the current threading cycle.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None

How is this used?


Example
pg76new #G76 threading new style
pbld, n$, *sthdgcode, *nspring$, *thdpull, *thdang, *thdlast$,
*thdfinish$, e$
pbld, n$, *sthdgcode, pfxout, pfzout, *thddepth$, *thdfirst$,
*thdrdlt, pffr, e$
Predefined variables, postblocks, and functions: page 909

nstartdir$
L MT
Threading direction.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 910

nstarts$
L MT
Number of starts for threading cycle (multiple start thread).

Where does this value come from?


Output on following NCI lines
200

Control definition page


None

How is this used?


Example
pg76$ #G76 threading
comment$
gcode$ = zero
lrapid$
sav_xa = vequ(copy_x)
if thdface$ = zero, copy_x = thdx2$
else, copy_z = thdx2$
if thdface$ = zero, copy_z = thdz2$
else, copy_x = thdz2$
pcom_moveb
nstart_cnt = zero
while nstart_cnt < nstarts$, pg76nstart
pcom_movea
prv_gcode$ = -1
copy_x = vequ(sav_xa)
copy_x = copy_x + (thd_dirx * (nstarts$ - one))
copy_z = copy_z + (thd_dirz * (nstarts$ - one))
pcom_moveb
pe_inc_calc
!gcode$, !xabs, !yabs, !zabs, !xinc, !yinc, !zinc
Predefined variables, postblocks, and functions: page 911

ntools$
M L R W MT
Number of tools used.This variable is available only when the post
switch variable bldnxtool$ is enabled.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psof$ #Start of file for non-zero tool number
pcuttype
toolchng = one
if ntools$ = one,
[
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
]
Predefined variables, postblocks, and functions: page 912

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, MP can calculate this directly from the Tilt angle and rotary
axis orientation in the machine definition:

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
#Nutating machine (mtype 3-5) describe the plane that the nutated axis
#is in, this is the plane perpendicular to the primary axis and
#secondary axis

nut_ang_pri$ : -45 #Nutating head secondary axis angle from machine Z+


Predefined variables, postblocks, and functions: page 914

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
#Map the center of rotation for nutating
#Must be X or Y
if nut_rot_ax$ = one, #+X
[
n_ang_pri_c = n_cntr_x
n_cntr_x = n_cntr_y
n_cntr_y = -n_ang_pri_c
]
else,
[
if nut_rot_ax$ = m_one, #-X
[
n_ang_pri_c = n_cntr_x
n_cntr_x = -n_cntr_y
n_cntr_y = n_ang_pri_c
]
Predefined variables, postblocks, and functions: page 915

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.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 917

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.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None

How is this used?


Example
if met_tool$, pitch = n_tap_thds$ # Tap pitch (mm per thread)
else, pitch = 1/n_tap_thds$ # Tap pitch (inches per thread)
Predefined variables, postblocks, and functions: page 918

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1010

Control definition page


None

How is this used?


Example
pagcompmi3 #Start of agie comp routine for pocket
g4code = 0
pm60comp
mi3_ccode = ccode$
mi3_reg2 = reg2$
pregreset
pstrtfile, n$, *offset$, *reg1$, *ccode$, *reg2$, *sg4code, e$
if prv_t95 = -1, t95 = 0
if prv_t95 = -1, !t95
agcompmi3 = -1 #Stop M22 with mi3
Predefined variables, postblocks, and functions: page 919

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.

1 Machine offset register; the stock-to-leave offset is done at the control.

Where does this value come from?


Output on following NCI lines
20200
Control definition page
None
Predefined variables, postblocks, and functions: page 920

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.

Where does this value come from?


Output on following NCI lines
20200
Control definition page
None
Predefined variables, postblocks, and functions: page 921

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

0 Output the CR/LF.

1 Do not output the CR/LF.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 922

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

0 Output sequence numbers (default)

1 Do not output sequence numbers

–1 Enable sequence numbering but inhibit numbering when NC output is inhibited by


no_nc_out$, subprograms, or canned cycles.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 923

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

0, 1, 11, 12, 24 Not used

Lathe operations

101 Lathe rough

102 Lathe finish

103 Groove

104 Thread

105 Lathe roughing

106 Lathe point

107 Stock transfer

108 Stock flip

109 Bar feed

110 Chuck clamp/unclamp


Predefined variables, postblocks, and functions: page 925

111 Tailstock position

112 Steady rest position

113 Custom operation with lathe tool

114 Turret park

Wire operations

201 2D contour (no skim cuts, just single rough)

202 3D contour

203 Canned (drill)

204 No core (pocket)

205 4-axis taper, no skim

206 2D reverse skim cut

207 Not used

208 4-axis direct, reverse skim cuts

209 4-axis direct, no skim cuts

210 4-axis taper, reverse skim cuts

211 4-axis taper, one-way skim cuts

212 4-axis direct, one-way skim cuts

213 2D one-way skim cuts

214 Point operation (always rapid)


Predefined variables, postblocks, and functions: page 926

215 2-axis, one-way Agie collar skim cut

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 927

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 928

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 929

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.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 930

orient$
M L R MT
Lathe tool orientation.

Possible values

1 Vertical tool - insert down, left

2 Vertical tool - insert down, right

3 Vertical tool - insert up, right

4 Vertical tool - insert up, left

5 Horizontal tool - insert down, left

6 Horizontal tool - insert down, right

7 Horizontal tool - insert up, right

8 Horizontal tool - insert up, left

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 931

overburn$
W
The overburn amount entered in Mastercam Wire.

Where does this value come from?


Output on following NCI lines
1010 1013

Control definition page


None
Predefined variables, postblocks, and functions: page 932

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 Normal parameter processing (default)

–1 Obsolete

2 Obsolete

–2 Obsolete

3 Limited parameter processing


Predefined variables, postblocks, and functions: page 933

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 934

pass$
W
Current wire pass number.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 935

pdo_type$
W
Flag to indicate the type of contour chained.

Possible values

0 Punch

1 Die

2 Open

3 Other

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 936

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.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 937

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.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 938

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.

Only used with usecanpeck$ or usecanchip$ are turned off.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 939

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.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 940

pi$
M L R W MT
The value of π (pi): 3.141592654... Internally, MP uses 16+ significant
digits.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 941

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

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33 1000 1001 1002

Control definition page


None

How is this used?


Example
parc # Mill example: IJK arc center output
if plane$ = zero, *i$, *j$, k$ # G17 plane - force I and J output
if plane$ = one, i$, *j$, *k$ # G19 plane - force J and K output
if plane$ = two, *i$, j$, *k$ # G18 plane - force I and K output
Predefined variables, postblocks, and functions: page 942

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.

0 Do not display backplot.

1 Normal backplot.

2 Keep geometry after backplot.

3 Do not display backplot.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 943

Control definition page


None

How is this used?


Example
pmiscint$ #Check misc. integer setting to set flag
brk_cc_pos$ = -1 #Set to see if a move is being broken at start
linarc$ = zero
#Miscellaneous integer variable 2 Main program,0=Abs. 1=Inc.? 0
absinc$ = mi2$
#mi10 = zero # Don't allow this mode
# mi10 - Convert 2D wirepath to 4 axis:
# 0 = off
# 1 = 4 axis direct (Output XY:XY format)
# 2 = 4 axis taper (Output XYUV format)
if mi10$,
[
immediate$ = zero
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 944

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 945

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

3 Version 6 (yes, it really is 3...)

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 947

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

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 948

prg_number$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 949

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the intersection angles for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 950

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 951

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the intersection angles for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 952

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
Example
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 953

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 954

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 955

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 956

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 957

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Possible values

0 Less than 180 degrees

1 Equal or greater than 180 degrees and less than 360 degrees
Predefined variables, postblocks, and functions: page 958

2 Soft limit at 0-360 degrees with hard limits slightly beyond.


n Set pri_limhi$ and pri_limlo$ to hard limits, pri_inthi$ and pri_intlo$ to 360
degrees total.
n pri_limhi$ and pri_limlo$ are expected to be an equal amount from pri_inthi$
and pri_intlo$.

3 Greater than 360 degrees

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
# Set pri_limtyp$ and sec_limtyp$ on following conditions:
# 0 = Less than 180 degrees
# 1 = Equal or greater than 180 degrees and less than 360 degrees
# 2 = Soft limit at 0-360 degrees with hard limits slightly beyond
# Set limhi-limlo to hard limits, inthi-intlo to 360 degrees total
# limhi-limlo are expected equal amount from inthi-intlo
# 3 = Greater than 360 degrees

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example code is from an X9 or earlier post.
snci_file : "" # Define a string

pparameter$ # Predefined parameter postblock


if prmcode$ = 15107, snci_file = sparameter$

This example code is from a Mastercam 2017 post, using Mastercam 2017's new query
functions.
return : 0

pheader$ # Call query functions

"----- Machine definition parameters -----", e$


return = mdinfo(-2)
" ", e$
Predefined variables, postblocks, and functions: page 960

"----- Control definition parameters -----", e$


return = cdinfo(-1)
" ", e$

"----- Machine group parameters -----", e$


return = groupinfo(-1)
" ", e$

"----- Operation parameters -----", e$


return = opinfo (-2)
" ", e$

"----- End param dump -----", e$

pdump$ # Output parameter values


~prmcode$ ~sparameter$ e$
Predefined variables, postblocks, and functions: page 961

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

1 1042 line encountered; probing is active.

2 An inhibit_probe$ command has been issued inside the probing section.

3 1043 line encountered; exit from probe section.

0 An uninhibit_probe$ command has been issued.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 962

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
psof$ #Start of file for non-zero tool number
probe_head$
prv_tloffno$ = c9k
pcuttype
toolchng = one
if ntools$ = one,
[
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
]
pbld, n$, *smetric, e$
pbld, n$, *sgcode, *sgplane, scc0, sg49, sg80, *sgabsinc, e$
inhibit_probe$
sav_absinc = absinc$
Predefined variables, postblocks, and functions: page 963

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

0 Output as typed (default).

1 Output in all capital letters.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
progname$ : 1 # Use uppercase for program name

pblock_a # Old method -- no longer supported


"(PROGRAM NAME - ", progname$, ")", e$

pblock_b # Preferred method since v9


"(PROGRAM NAME - ", sprogname$, ")", e$ # Use the string var.
Predefined variables, postblocks, and functions: page 964

progno$
M L R W MT
Program number.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None

How is this used?


Example
pheader #Called before start of file
"%", e$
*progno$, e$
Predefined variables, postblocks, and functions: page 965

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

–2, –1, 0 Obsolete.

1 Post run in batch mode.

2 Post run from the Operations Manager.

3 Post run from the Run menu (obsolete).

4 Post run using the C-Hook shortcut [Alt + C] (obsolete)

5 Post run from the Operations Manager (Debugger)

6 Setup sheet

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 966

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

0 Prevent Renishaw processing.

1 Allow Renishaw processing.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 967

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:

MP automatically selects the proper inch or metric value.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 968

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 969

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 970

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 971

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 972

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 973

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 974

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 975

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$

1 n 2D contour: Normal process. Do not set wq$, wr$.


n 4-Axis Direct: Normal process. Set wq$, wr$.
n 4-Axis Taper: Normal process. Set wq$, wr$.

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 976

qstep$
W
Status of an immediate taper change with 4-axis direct.

Possible values

0 No immediate taper change

1 Immediate taper change

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 977

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 978

rad2deg$
M L R W MT
Value used to convert radians to degrees: 57.29577951

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 979

ra_block$
R
Block number. This comes from the Aggregate Selection dialog box.

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 980

ra_bvecx$
R
Block offset vector from block reference to head reference

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 981

ra_bvecy$
R
Block offset vector from block reference to head reference

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 982

ra_bvecz$
R
Block offset vector from block reference to head reference

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 983

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

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 985

ra_hvecx$
R
Vector from zero reference to head reference (user defined)

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 986

ra_hvecy$
R
Vector from zero reference to head reference (user defined)

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 987

ra_hvecz$
R
Vector from zero reference to head reference (user defined)

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 988

ra_offset$
R
Head Work offset override

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 989

ra_rot_head$
Flag that indicates if the head has rotary capabilities. R

Possible values

0 Fixed head

1 Rotary motion in head

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 990

ra_station$
R
Station number. For each head, each station is numbered sequentially beginning with
zero.

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 991

ra_svecx$
R
Unit vector of initial tool direction (tip to pivot)

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 992

ra_svecy$
R
Unit vector of initial tool direction (tip to pivot)

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 993

ra_svecz$
R
Unit vector of initial tool direction (tip to pivot)

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 994

ra_tc_type$
R
Toolchange type.

Possible values

0 Auto tool change (default)

1 Fixed unit

2 Manual tool change

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 995

ra_translated$
R
Flags coordinate translation to the machine view.

Possible values

0 Coordinates are not translated to the machine view.

1 All coordinates are translated to the machine view.

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 996

ra_tvecx$
R
Vector representing the tool offset from the head pivot

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 997

ra_tvecy$
R
Vector representing the tool offset from the head pivot

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 998

ra_tvecz$
R
Vector representing the tool offset from the head pivot

Where does this value come from?


Output on following NCI lines
1029

Control definition page


None
Predefined variables, postblocks, and functions: page 999

ra_type$
R
Head type.

Possible values

0 No head (off)

1 Right-angle head

2 Compound-angle head

3 Block drill

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 1000

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.

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 1001

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.

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 1002

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.

Where does this value come from?


Output on following NCI lines
1028

Control definition page


None
Predefined variables, postblocks, and functions: page 1003

rcc_flg$
L MT
Tracks the processing position in the Lathe canned turning cycles.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1004

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
ssetup_sheet : "" # Define string variable for setup sheet string
wear_support : 0 # Does control support wear comp?
rev_wear_support : 0 # Does control support reverse wear comp?

psof$ # Start of file postblock


rd_cd$ # Get the control parameters - call pmachineinfo$

pmachineinfo$ # Parameter capture postblock


# Capture string data for the name of the setup sheet
if prmcode$ = 18160, ssetup_sheet = sparameter$
Predefined variables, postblocks, and functions: page 1005

# Capture desired parameter values


if prmcode$ = 18706, wear_support = rpar(sparameter$, 1)
if prmcode$ = 18707, rev_wear_support = rpar(sparameter$, 1)
Predefined variables, postblocks, and functions: page 1006

rd_exit$
M L R W MT
Obsolete

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1007

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
all_cool_off : 0 # First coolant off command shuts off
# ALL coolant options

pprep$ # Pre-process postblock - Allows post instructions


# after the post is parsed but before the NC and NCI
# file are opened.
rd_mch_ent_no$ = 0 # Read only the machine base parameters
rd_md$ # Read machine definition parameters

pmachineinfo$ #Machine information parameters postblock


if prmcode$ = 17101, all_cool_off = rpar(sparameter$, 1)
Predefined variables, postblocks, and functions: page 1009

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
all_cool_off : 0 # First coolant off command shuts off
# ALL coolant options

pprep$ # Pre-process postblock - Allows post instructions


# after the post is parsed but before the NC and NCI
# file are opened.
rd_mch_ent_no$ = 0 # Read only the machine base parameters
rd_md$ # Read machine definition parameters
Predefined variables, postblocks, and functions: page 1010

pmachineinfo$ #Machine information parameters postblock


if prmcode$ = 17101, all_cool_off = rpar(sparameter$, 1)
Predefined variables, postblocks, and functions: page 1011

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
Predefined variables, postblocks, and functions: page 1012

sop_type_name # Define string variable for the operation type


num_rough_cuts : 0 # Define numeric variable for the number of rough cuts
spcng_rough_cuts : 0 # Define numeric variable for
# the spacing between the rough cuts

psof$ # Start of file postblock


rd_prm_op_no$ = op_id$ # The number of the operation whose
# parameters you want to retrieve
rd_params$ # Get the parameters - call pparameter$

pparameter$ # Parameter capture postblock


# Get operation type string
if prmcode$ = 10000, sop_type_name = sparameter$

# Capture numeric data for component ID and type


if prmcode$ = 10106, num_rough_cuts = rpar(sparameter$, 1)
if prmcode$ = 10107, spcng_rough_cuts = rpar(sparameter$, 1)
Predefined variables, postblocks, and functions: page 1013

rd_prm_header$
M L R W MT
Obsolete

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1014

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
sop_type_name # Define string variable for the operation type
num_rough_cuts : 0 # Define numeric variable for the number of rough cuts
spcng_rough_cuts : 0 # Define numeric variable for
# the spacing between the rough cuts

psof$ # Start of file postblock


rd_prm_op_no$ = op_id$ # The number of the operation whose
# parameters you want to retrieve
rd_params$ # Get the parameters - call pparameter$

pparameter$ # Parameter capture postblock


Predefined variables, postblocks, and functions: page 1015

# Get operation type string


if prmcode$ = 10000, sop_type_name = sparameter$

# Capture numeric data for component ID and type


if prmcode$ = 10106, num_rough_cuts = rpar(sparameter$, 1)
if prmcode$ = 10107, spcng_rough_cuts = rpar(sparameter$, 1)
Predefined variables, postblocks, and functions: page 1016

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
This example shows the X9-style parameter processing.
smd_file_name : "" # Define string variable for name of
# the machine definition file

stp_grp_name : "" # Define string variable for name of


# the machine group
Predefined variables, postblocks, and functions: page 1017

tp_grp_number : 0 # Define numeric variable for the


# machine group number

psof$ # Start of file postblock


rd_tlpathgrp$ # Get the machine group parameters - call pmachineinfo

pmachineinfo$ # Parameter capture postblock

# Capture numeric data for toolpath group number


if prmcode$ = 19247, tp_grp_number = rpar(sparameter$, 1)

# Capture string data for machine filename and group name


if prmcode$ = 19248, stp_grp_name = sparameter$
if prmcode$ = 19105, smd_file_name = sparameter$
Predefined variables, postblocks, and functions: page 1018

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)

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1019

Control definition page


None

How is this used?


Example
pcoutrev #Rotary axis revolution calculation (Modify for wind-up)
cdelta = csav - prv_csav
if cuttype = one & rot_type > zero & not(index) & toolchng = zero &
toolchng0 = zero, # Axis sub and signed direction or shortesat direction
[
cdelta_calc = abs(cdelta)
cdelta_calc = fmtrnd(cdelta_calc)
if cdelta_calc > 360, #Break rotary motion
[
rev_brkflag = one #Break every 90 or 360 degrees (see plin0$)
redo_proc$ #Reprocess NCI line
]
]
Predefined variables, postblocks, and functions: page 1020

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1021

reg1$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1022

reg10$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1023

reg2$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1024

reg3$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1025

reg4$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1026

reg5$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1027

reg6$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1028

reg7$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1029

reg8$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1030

reg9$
W
Current register entry for technology settings.
The register parameters are provided to allow custom support in the post for
technology settings.

Where does this value come from?


Output on following NCI lines
1010 1015

Control definition page


None

How is this used?


Example
pconchg$ #Control setting change
if gcode$ = 1010, pbld$, n$, ccode$, offset$, reg1$, reg2$, e$
else, ccode$, offset$, reg1$, reg2$
Predefined variables, postblocks, and functions: page 1031

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.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 1032

rev5$
M L R MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1033

reva$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1034

revb$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1035

revc$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1036

rev_drl5$
M L R MT
Reverses the drill direction from the UVW point to the XYZ point.

Where does this value come from?


Output on following NCI lines
81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 1037

rhtilt$
M L R MT
OBSOLETE: Side tilt; tilt perpendicular to the cut direction.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1038

rotary_axis$
M L R MT
The rotary axis orientation in terms of the current tool plane.

Possible values

0 None

1 Rotation about the X axis.

2 Rotation about the Y axis.

3 Rotation about the Z axis.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1039

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:

For lathe and mill-turn machines:

Possible values

0 None

1 Axis substitution

2 3-axis (mill) or C-axis (lathe, mill-turn)

3 4-axis/rotary output (mill) or Y-axis (lathe, mill-turn)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1040

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$.

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None
Predefined variables, postblocks, and functions: page 1041

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$.

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None
Predefined variables, postblocks, and functions: page 1042

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$.

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None
Predefined variables, postblocks, and functions: page 1043

rotaxis$
M L R MT
Axis substitution/polar conversion flag.

Possible values

-2 Axis substitution, substitute Y, CCW

-1 Axis substitution, substitute X, CCW

0 None

1 Axis substitution, substitute X, CW

2 Axis substitution, substitute Y, CW

11 Polar conversion, rotate about X

12 Polar conversion, rotate about Y

13 Polar conversion, rotate about Z

21 4-axis, rotate about X

22 4-axis, rotate about Y

23 4-axis, rotate about Z

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1044

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the direction and zero point for each rotary axis can be read
directly from the following machine definition settings:

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1046

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the direction and zero point for each rotary axis can be read
directly from the following machine definition settings:

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1048

rotaxis_dir$
M L R MT
Direction of rotary axis. Available when the Rotary Axis dialog has been set.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

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.

2 5-axis rotation, intended for rotary motion in the tables.


Tool plane toolpaths: 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.
Predefined variables, postblocks, and functions: page 1050

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1051

rotdia$
M L R MT
Current rotary axis diameter set in Mastercam for axis substitution.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1052

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the direction and zero point for each rotary axis can be read
directly from the following machine definition settings:
Predefined variables, postblocks, and functions: page 1053

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1054

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the direction and zero point for each rotary axis can be read
directly from the following machine definition settings:
Predefined variables, postblocks, and functions: page 1055

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1056

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

0 Use units/minute feedrates

1 Use degrees/minute feedrates)

2 Use inverse feedrate (for 4-axis rotary feedrates only)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 1057

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

0 Use units/minute feedrates

1 Use degrees/minute feedrates)

2 Use inverse feedrate (for 4-axis rotary feedrates only)

Where does this value come from?


Output on following NCI lines
None
Control definition page
Feed page
Predefined variables, postblocks, and functions: page 1058

round_opt$
M L R W MT
'License-plate' value whose digits configure how values are rounded
during MP processing.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1059

rpd_hght$
W
Wire upper head rapid height.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1060

rpd_typ$
L MT
Lathe contour flag. This variable is extracted from the contour flag variable cur_
cflg$.

Possible values

0 No flags (normal move).

1 Clearance moves to home position.

2 Rapid moves from home position to start position.

3 Rapid moves created around an obstruction.

4 Rapid moves between points.

5 Entry and exit moves.

6 End and start of canned turning cycle roughing path.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1061

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

0 Use Version 8 (and later) data and routines (default).

1 Convert data and use routines to emulate Version 7.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1062

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 1063

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1064

sa$
M L R W MT
Start angle (in degrees) of the current arc.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1065

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Position control variables
scalex$ : 2 # Scale factor for X, (zero is off for scale)
scaley$ : 2 # Scale factor for Y
scalez$ : 2 # Scale factor for Z
Predefined variables, postblocks, and functions: page 1066

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Position control variables
scalex$ : 2 # Scale factor for X, (zero is off for scale)
scaley$ : 2 # Scale factor for Y
scalez$ : 2 # Scale factor for Z
Predefined variables, postblocks, and functions: page 1067

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
# Position control variables
scalex$ : 2 # Scale factor for X, (zero is off for scale)
scaley$ : 2 # Scale factor for Y
scalez$ : 2 # Scale factor for Z
Predefined variables, postblocks, and functions: page 1068

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the intersection angles for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1069

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1070

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the intersection angles for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1071

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1072

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1073

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1074

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1075

Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
mtype : 2 # Machine type: tilting head on tilting head (gantry)
rotaxis1$ = -vecy # Zero
rotdir1$ = vecx # Direction
rotaxis2$ = vecz # Zero
rotdir2$ = -vecy # Direction
use_tlength : 1 # Use tool length, read from tool overall length
toollength : 100 # Tool length if not read from overall
length_shift_z_pvt : 1 # Shift Z by tool length, head/head program to pivot
# (Z axis only)
pri_limlo$ : -5
pri_limhi$ : 365
pri_intlo$ : 0
pri_inthi$ : 360
sec_limlo$ : -135
sec_limhi$ : 135
sec_intlo$ : -135
sec_inthi$ : 135
Predefined variables, postblocks, and functions: page 1076

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.

Setting this value directly from the machine definition


Beginning with Mastercam 2017, the travel limit settings for each rotary axis can be read
directly from the following machine definition settings:

To do this, set x_mp_adv_func$ = 1 in your post, and remove any lines that manually initialize
the variable.

Possible values

0 Less than 180 degrees

1 Equal or greater than 180 degrees and less than 360 degrees
Predefined variables, postblocks, and functions: page 1077

2 Soft limit at 0-360 degrees with hard limits slightly beyond.


n Set sec_limhi$ and sec_limlo$ to hard limits, sec_inthi$ and sec_intlo$ to 360
degrees total.
n sec_limhi$ and sec_limlo$ are expected to be an equal amount from sec_inthi$
and sec_intlo$.

3 Greater than 360 degrees

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Machine definition
This value is automatically set from the machine definition when x_mp_adv_func$ is set to
1 (Mastercam 2017 or later).

How is this used?


Example
This example is from a pre-2017 post, where the value is explicitly initialized rather than
read directly from the machine definition.
# Set pri_limtyp$ and sec_limtyp$ on following conditions:
# 0 = Less than 180 degrees
# 1 = Equal or greater than 180 degrees and less than 360 degrees
# 2 = Soft limit at 0-360 degrees with hard limits slightly beyond
# Set limhi-limlo to hard limits, inthi-intlo to 360 degrees total
# limhi-limlo are expected equal amount from inthi-intlo
# 3 = Greater than 360 degrees

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


NC Output page
Predefined variables, postblocks, and functions: page 1079

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 1080

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


NC Output page
Predefined variables, postblocks, and functions: page 1081

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.

Where does this value come from?


Output on following NCI lines
81

Control definition page


None
Predefined variables, postblocks, and functions: page 1082

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1083

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)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1084

skimpass$
W
Skim cut setting for multiple contour passes.

Possible values

0 No skimcut

1 First skim pass on a contour

–1 Subsequent skim pass on a contour

–2 Last skim pass on a contour

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1085

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

0 Skip standard postblock call if no motion.

1 Perform standard postblock regardless of motion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1086

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?

If so, add the skp_lead_flgs$ : 1 setting:


rpd_typ_v7$ : 1 # Use Version 7 style contour flags?

skp_lead_flgs$ : 1 # Do NOT use v9.1 contour flag processing

See cur_cflg$ for contour flag information.

Possible values

0 Use new-style contour flags (introduced with v9.1) (default)

1 Do NOT use new-style contour flags

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1087

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.

See the related variables sa$, ea$ and eo$.

Possible values

0 through 16 octant number

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1088

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).

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 1089

spdir$
M L R MT
Spindle direction.

Possible values

0 Off

1 CW

–1 CCW

Where does this value come from?


Output on following NCI lines
4 1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1090

spindle_no$
M L R MT
Which spindle is being used.

Possible values

0 Left (main spindle)

1 Right (subspindle)

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1091

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

negative Reverse tool rotation

positive Forward tool rotation

Where does this value come from?


Output on following NCI lines
4 1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1092

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

0 Not active (default)

1 Active

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
sg-17 G17 # Plane code whnd drill direction is skewed
sg17 G17 # XY plane code
sg19 G19 # YZ plane code
sg18 G18 # XZ plane code
sgplane
fstrsel sg-17 plane sgplane
Predefined variables, postblocks, and functions: page 1093

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1094

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1095

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1096

stck_adv_fr$
L MT
Stock advance feed rate for stock push/pull operation.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1097

stck_appr_fr$
L MT
Stock approach feed rate for stock push/pull operation.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1098

stck_chuk_end_dx$
L MT
Destination chuck X axis reference position after transfer

Where does this value come from?


Output on following NCI lines
900

Control definition page


None
Predefined variables, postblocks, and functions: page 1099

stck_chuk_end_dz$
L MT
Destination chuck Z axis reference position after transfer.

Where does this value come from?


Output on following NCI lines
900

Control definition page


None
Predefined variables, postblocks, and functions: page 1100

stck_chuk_end_x$
L MT
Final X axis chuck position

Where does this value come from?


Output on following NCI lines
900 901 902 903

Control definition page


None
Predefined variables, postblocks, and functions: page 1101

stck_chuk_end_z$
L MT
Final Z axis chuck position

Where does this value come from?


Output on following NCI lines
900 901 902 903

Control definition page


None
Predefined variables, postblocks, and functions: page 1102

stck_chuk_st_dx$
L MT
Destination chuck X axis reference position before transfer.

Where does this value come from?


Output on following NCI lines
900

Control definition page


None
Predefined variables, postblocks, and functions: page 1103

stck_chuk_st_dz$
L MT
Destination chuck Z axis reference position before transfer.

Where does this value come from?


Output on following NCI lines
900

Control definition page


None
Predefined variables, postblocks, and functions: page 1104

stck_chuk_st_x$
L MT
Initial X axis chuck position

Where does this value come from?


Output on following NCI lines
900 901 902 903

Control definition page


None
Predefined variables, postblocks, and functions: page 1105

stck_chuk_st_z$
L MT
Initial Z axis chuck position

Where does this value come from?


Output on following NCI lines
900 901 902 903

Control definition page


None
Predefined variables, postblocks, and functions: page 1106

stck_clear$
L MT
Stock clearance value for stock pull operation.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1107

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

0 Top - center (always 0 in Lathe)

1 Top - upper left


Predefined variables, postblocks, and functions: page 1108

2 Top - upper right

3 Top - lower right

4 Top - lower left

5 Bottom - upper left

6 Bottom - upper right

7 Bottom - lower right

8 Bottom - lower left

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1109

stck_final_z$
L MT
Final Z position of the stock

Where does this value come from?


Output on following NCI lines
900 901 902 904 905

Control definition page


None
Predefined variables, postblocks, and functions: page 1110

stck_grip$
L MT
Grip length value for stock pull operation.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1111

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

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1113

stck_init_z$
L MT
Initial Z position of the stock

Where does this value come from?


Output on following NCI lines
900 901 902 904 905

Control definition page


None
Predefined variables, postblocks, and functions: page 1114

stck_op$
L MT
Stock advance operation method. See stck_clear$ and stck_grip$.

Possible values

0 Push stock.

1 Push stock with Use tool stop option.

2 Pull stock.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1115

stck_spindle$
L MT
Active spindle with stock to transfer.

Possible values

0 Left (main) spindle

1 Right (sub) spindle

Where does this value come from?


Output on following NCI lines
900 901 902

Control definition page


None
Predefined variables, postblocks, and functions: page 1116

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.

Where does this value come from?


Output on following NCI lines
1020
Predefined variables, postblocks, and functions: page 1117

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1118

stck_tool_x$
L MT
Tool X axis position for bar stop/puller.

Where does this value come from?


Output on following NCI lines
902

Control definition page


None
Predefined variables, postblocks, and functions: page 1119

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$.

Where does this value come from?


Output on following NCI lines
1020
Predefined variables, postblocks, and functions: page 1120

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1121

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.

Where does this value come from?


Output on following NCI lines
1020
Predefined variables, postblocks, and functions: page 1122

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1123

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.

Where does this value come from?


Output on following NCI lines
1020
Predefined variables, postblocks, and functions: page 1124

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1125

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.

Where does this value come from?


Output on following NCI lines
1020
Predefined variables, postblocks, and functions: page 1126

Control definition page


None

How is this used?


Example
pblkform #Output the 'BLK FORM' statements at start of program
if blk_form,
[
if stck_crnr$ = 0, #Top - Center
[
stck_x_min = stck_x$ - stck_ht$/2
stck_y_min = stck_y$ - stck_wdth$/2
stck_z_min = stck_z$ - stck_thck$
stck_x_max = stck_x$ + stck_ht$/2
stck_y_max = stck_y$ + stck_wdth$/2
stck_z_max = stck_z$
]

if stck_crnr$ = 1, #Top - Upper Left


[
stck_x_min = stck_x$
stck_y_min = stck_y$ - stck_wdth$
stck_z_min = stck_z$ - stck_thck$
stck_x_max
Predefined variables, postblocks, and functions: page 1127

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.

Where does this value come from?


Output on following NCI lines
20200
Control definition page
None
Predefined variables, postblocks, and functions: page 1128

streamno$
M L R W MT
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1129

strselstop$
M L R W MT
Enables automatic spindle stop on reversal

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1130

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1131

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1132

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.

1 Open the file, removing all contents.

2 Open the file and append to contents.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1133

subno$
W
Subprogram number

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1134

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

0 Output stream is to the NC file (.NC)

1 Output stream is to the Sub file (.SUB) See subprg$.

2 Output stream is to Aux file (.AUX) See auxprg$.

3 Output stream is to Ext file (.EXT) See extprg$.

4 Output stream is to lathe canned cycle file (.LCC) See lccprg$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
ppost$ #Post process Postblock
# This postblock is used to renumber sequence numbers after posting
# is complete. Opening the NC file as a buffer and scan
# every line for a line number and replace it with another
# line number. The new NC line is written to the Auxilary file and upon
# processing the entire NC file, the NC and Aux files ares closed,
# the NC file is deletedand the Aux file renamed to a .NC file/

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

spathaux$ = spathnc$ #Set aux path to that of NC path


snameaux$ = snamenc$ #Set aux file name to that of NC name

auxprg$ = 1 #Intialize a new auxfile (sauxfile)


subout$ = 2 #Set post output to .AUX file
newaux$ #Open new auxilary file for output
...
Predefined variables, postblocks, and functions: page 1136

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.

Table 6: MP output streams

subout$
Command variable File to be opened
value

— Main NC output stream 0

subprg$ Sub output file 1

auxprg$ Aux output file 2

extprg$ Ext output file 3

lccprg$ Lathe canned cycle 4


output file

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)

or by using it in a formula statement inside a postblock:


pblock # A postblock
subprg$ = 1
# Allow access to sub file (open and clear it)
subout$ = 1 # Re-direct the output to the sub file

Possible values

0 Disable writing to the alternate file.

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1138

subtyp$
M L R W MT
Specifies the subprogram type.

Possible values

0 Not a subprogram wirepath.

1 Write to the subprogram.

2 Write the call to the subprogram.

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1139

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$.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1140

sub_grp_id$
M L R MT
Actual operation ID

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1141

sub_inc$
M L R MT
Subprogram absolute or incremental flag. This sets the value of absinc$.

Possible values

0 Absolute

1 Incremental

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1142

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

–2 Disable/ignore all subprogram NCI data and calls.

–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.

The following values apply when using mill-turn posts:

0 Subprograms off

1 Subprograms inserted after main

2 Subprograms inserted before main

3 Subprograms are separate files

4 Embedded-style subprograms

During NCI processing:

0 Top-level output

1 Main (transform) subprogram level


Predefined variables, postblocks, and functions: page 1143

2 Sub (non-transform) subprogram level

Where does this value come from?


Output on following NCI lines
None
Control definition page
Subprograms page
Predefined variables, postblocks, and functions: page 1144

sub_m1$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1145

sub_m2$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1146

sub_m3$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1147

sub_m4$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1148

sub_m5$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1149

sub_m6$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1150

sub_m7$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1151

sub_m8$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1152

sub_m9$
M L R MT
For transform subprograms, this is the matrix of the tool plane in which the
transform is occurring.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1153

sub_mny_t$
M L R MT
Indicates if the transform subprogram contains more than one tool.

Possible values

0 Single tool in subprogram.

1 Multiple tools in subprogram.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1154

sub_nst_flg$
M L R MT
Subprogram nesting code: output with 1018 line. For internal use only.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1155

sub_nxt_h$
M L R MT
First head number in the transform group.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1156

sub_nxt_t$
M L R MT
First tool in the transform group.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1157

sub_nxt_tid$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1158

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1159

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1160

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1161

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1162

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1163

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1164

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1165

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1166

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1167

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1168

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1169

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1170

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1171

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1172

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1173

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1174

sub_org_nxt_t$
M L R MT
Subprogram first tool in the transform group.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1175

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1176

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1177

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1178

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1179

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1180

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1181

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1182

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1183

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1184

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1185

sub_org_trns_id$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1186

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1187

sub_prg_seq_end$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1188

sub_prg_seq_st$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1189

sub_rd_level$
M L R W MT
Current internal subprogram nested level.

Possible values

-1 Non-transform subprogram

0 The main output level (NC)

Greater than 0 Current internal nested subprogram level. Output is buffered at tool
changes, use sub_level$ to get the current output level.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1190

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 being referenced by a transform somewhere else.

0 Non-transform

>0 Transform

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1191

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$.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1192

sub_seq_typ$
M L R W MT
Sequence number control for subprograms.

Possible values

0 No sequence numbering control

1 Resets the sequence number to seqno$ at the start of each subprogram.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 1193

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$.

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1194

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

when sub_trnstyp$ = 1 (rotate):

0 Tplane

1 Tplane origin only

2 coordinates

when sub_trnstyp$ = 3 (translate):

0 Tplane

1 Tplane origin only

2 coordinates

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1195

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

2 Scale (not used)

3 Translate

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1196

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

When sub_trnstyp$ = 0 sub_trnsx$ = Y mirror, X intersection

When sub_trnstyp$ = 1 sub_trnsx$ = X coordinate of center rotation

When sub_trnstyp$ = 2 (not used)

When sub_trnstyp$ = 3 sub_trnsx$ = X coordinate of translation relative origin

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1197

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

When sub_trnstyp$ = 0 sub_trnsy$ = X mirror, Y intersection

When sub_trnstyp$ = 1 sub_trnsy$ = Y coordinate of center rotation

When sub_trnstyp$ = 2 (not used)

When sub_trnstyp$ = 3 sub_trnsy$ = Y coordinate of translation relative origin

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1198

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

When sub_trnstyp$ = 0 sub_trnsz$ is not used

When sub_trnstyp$ = 1 sub_trnsz$ = Z coordinate of center rotation

When sub_trnstyp$ = 2 (not used)

When sub_trnstyp$ = 3 sub_trnsz$ = Z coordinate of translation relative origin

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1199

sub_trns_id$
M L R MT
[not currently used]

Where does this value come from?


Output on following NCI lines
1018

Control definition page


None
Predefined variables, postblocks, and functions: page 1200

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

0 Process NCI file (default).

1 Skip the NCI file read.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1201

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1202

syncaxis$
M L R MT
Numeric entity ID of the axis combination. Output with NCI 950.

Where does this value come from?


Output on following NCI lines
950

Control definition page


None
Predefined variables, postblocks, and functions: page 1203

syncbfor$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.

Where does this value come from?


Output on following NCI lines
950

Control definition page


None
Predefined variables, postblocks, and functions: page 1204

synclath$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.

Where does this value come from?


Output on following NCI lines
950

Control definition page


None
Predefined variables, postblocks, and functions: page 1205

syncmode$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.

Where does this value come from?


Output on following NCI lines
950

Control definition page


None
Predefined variables, postblocks, and functions: page 1206

syncmodebfor$
M L R MT
OBSOLETE: Used to support the Synclath C-Hook; output with NCI 950.

Where does this value come from?


Output on following NCI lines
950

Control definition page


None
Predefined variables, postblocks, and functions: page 1207

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,

Where does this value come from?


Output on following NCI lines
999

Control definition page


None
Predefined variables, postblocks, and functions: page 1208

syncstream$
M L R MT
Stream ID; output with NCI 950 and NCI 999.

Where does this value come from?


Output on following NCI lines
950 999

Control definition page


None
Predefined variables, postblocks, and functions: page 1209

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.

Where does this value come from?


Output on following NCI lines
999

Control definition page


None
Predefined variables, postblocks, and functions: page 1210

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1211

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

0 to 1 Intersection along an original element, relative to the original element’s length,


the first endpoint being 0.

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1212

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

0 to 1 Intersection along an original element, relative to the original element’s length,


the first endpoint being 0.

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1213

tabcut$
W
Tab cut type for the current wirepath.

Possible values

0 Not a tab cut path

1 Tab cut path

2 Contour with tab cut included

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1214

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

Where does this value come from?


Output on following NCI lines
1020

Control definition page


None
Predefined variables, postblocks, and functions: page 1215

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.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1216

tcr$
M L R W MT
Tool corner radius. (In Wire, the wire radius.)

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1217

td_ct_flg$
W
OBSOLETE. Thread/cut flag; output on 1015 line.

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1218

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.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1219

thda2$
L MT
Thread V profile, rear angle (in radians). This is used in MP to calculate for
volume of cut.
See related thdangle$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1220

thdangle$
L MT
Thread infeed angle.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1221

thddepth$
L MT
Thread depth of the current thread pass.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1222

thdequcut$
L MT
Use equal depth thread cuts.

Possible values

0 Off

1 On

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1223

thdface$
L MT
Indicates a face thread.

Possible values

0 No

1 Yes

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1224

thdfinish$
L MT
Finish allowance amount for the current thread.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1225

thdfirst$
L MT
Amount of the first cut of the thread.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1226

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1227

thdlast$
L MT
Amount of the last cut of the thread.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1228

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.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1229

thdlng$
L MT
Thread length of the current thread.Calculated as thdz1$ – thdz2$.
See related variable add_thdzclr$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1230

thdncuts$
L MT
Number of cuts to be performed during the current threading operation.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1231

thdpass$
L MT
Current thread pass number. This is not calculated for canned threads (thdtype$
= 1).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1232

thdpulloff$
L MT
Anticipated pull-off in Z for the current thread.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1233

thdtaper$
L MT
Thread taper angle (in degrees).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1234

thdtype$
L MT
Current thread type. See thdface$ for more information.

Possible values

0 Simple (longhand cycle)—example, G32

1 Canned thread—example, G76

2 Box thread—example, G92

3 Alternating (longhand cycle)—example, G32

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1235

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$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1236

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$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1237

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$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1238

thdxclr$
L MT
Allows additional clearance over thread. See related variable thdzclr$.

Where does this value come from?


Output on following NCI lines
200

Control definition page


None
Predefined variables, postblocks, and functions: page 1239

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$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1240

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$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1241

thdzclr$
L MT
Stock clearance on the Z axis. See the related variables thdxclr$, add_thdzclr$.

Where does this value come from?


Output on following NCI lines
201

Control definition page


None
Predefined variables, postblocks, and functions: page 1242

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

0 Wire is cut (initial state).

1 Wire is threaded.

2 Wire is cut.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1243

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1244

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1245

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1246

tilt$
M L R MT
OBSOLETE: Tilt angle along the cut direction.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1247

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
*progno$, e$
"(", "PROGRAM NAME - ", sprogname$, ")", e$
"(", "DATE=DD-MM-YY - ", date$, " TIME=HH:MM - ", time$, ")", e$
#Date and time output Ex. 12-02-05 15:52

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1249

tldia$
M L R W MT
Tool diameter (in Wire, this is the wire diameter). See also tlrad$.

Where does this value come from?


Output on following NCI lines
1010 1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1250

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1251

tlngno$
M L R W MT
Tool length offset number entered in Mastercam.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1252

tloffno$
M L R W MT
Tool diameter offset number set in Mastercam.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1253

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

other values User-defined view

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1254

tlrad$
M L R W MT
Tool radius (in Wire, this is the wire radius)

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1255

tlstck_on$
L MT
Retract or engage the tailstock

Possible values

0 Retract tailstock operation

1 Engage tailstock operation

Where does this value come from?


Output on following NCI lines
904

Control definition page


None
Predefined variables, postblocks, and functions: page 1256

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1257

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.

Assigning a value to tooltable$ instead of initializing it


In addition to initializing tooltable$, you can also assign a value to it in either of these
postblocks:
n pprep$
n pq$
Because these postblocks are executed before MP initially captures the value of tooltable$,
you can set or override its value within them in time for the NCI pre-read process.
This is also true of certain other postblocks, but because they may be called again later, you
should not attempt to use them to assign a value to tooltable$. Please limit this practice to
pprep$ and pq$.

Using tooltable$ as a command word


tooltable$ can also be used as a command word. Do this to initiate tool table processing
from within any postblock.
Note that you should NOT do this from within pwrtt$ or pwrttparam$, since this will create a
recursive process.
Even when used as a command word, its value must still be set to 1 or 3 before it is called.
Typically you assign a value just before calling it. For example:
p_mypostblock
tooltable$ = 3
tooltable$
tooltable$ = –1

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.

Configuring tooltable$ as a “license plate” value


The tooltable$ value can have an optional second digit in the 10’s place, to the left of the
traditional value. This extra digit lets you further configure its processing. Values of 1, 2, and 4
are supported.
Predefined variables, postblocks, and functions: page 1258

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.

0 Disable tooltable processing. (default)

1 Call the pwrtt$ postblock at tool changes.

2 Obsolete value. For backward compatibility, if encountered in a modern post, MP


processes it the same as 1.

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
tooltable$ : 3 #Pre-read -- call the pwrtt$ postblock

pwrtt$ # Initiate tool table processing


if tool_info > 1 & t$ > 0 & gcode$ <> 1003, p_output_tt_line
Predefined variables, postblocks, and functions: page 1260

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

0 Normal NCI processing

1 NCI read for tooltable processing

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1261

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

5 Multisurface rough parallel

6 Multisurface rough radial

7 Multisurface rough project

8 Multisurface rough flowline

9 Multisurface rough contour

10 Multisurface rough pocket

11 Multisurface finish parallel

12 Multisurface finish radial

13 Multisurface finish project

14 Multisurface finish flowline

15 Multisurface finish contour

16 For C-Hook- created operations

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

30 Project toolpath onto a plane

31 Project toolpath onto a cylinder

32 Project toolpath onto a sphere

33 Project toolpath onto a cone

34 Project toolpath onto a cross section

35 Project toolpath onto a surface

36 Non-associative contour
Predefined variables, postblocks, and functions: page 1263

37 Non-associative drilling

38 Non-associative pocketing

39 Multisurface finish pencil trace

40 Multisurface finish leftover stock

41 Multisurface finish steep

42 Multisurface finish shallow

43 Multisurface finish constant scallop

44 Multisurface rough plunge

45 Multisurface finish 5-axis flowline

46 Multisurface finish 4-axis

47 Merged in ASCII NCI

48 5-axis swarf

49 5-axis roll die

100 Thread mill

101 Edit common operation parameters

102 Facing

103 Associative trimmed

104 Solid drill control operation

105 Slot mill


Predefined variables, postblocks, and functions: page 1264

106 Helix bore

107 Multi-surface rough restmill

108 Associative nesting container operation

109 Multi-surface finish blend

110 Multi-surface 5axis, rough

111 Slice 5axis

112 Port 5axis

113 5-axis circle

130 Tab cutoff

131 Multi-surface rough pocket, light

132 High-speed surface toolpaths

133 Nesting onionskin operation

134 2-D hardmill machining/peel mill

135 Saw

136 FBM drill control operation

137 FBM mill pocket operation

138 FBM mill contour operation

139 Solid model operation

150 Probe cycle: probe motion


Predefined variables, postblocks, and functions: page 1265

151 Probe cycle command block

152 Probe cycle header

153 Probe cycle trailer

154 SafetyZone linking or multiaxis linking operation

301 Router contour (obsolete)

302 Router pocket (obsolete)

303 Router circmill (obsolete)

304 Router cutoff (obsolete)

305 Router surface rough pocket (obsolete)

306 Block drill

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.

441 Advanced multiaxis—swarf

442 Advanced multiaxis—morph

443 Advanced multiaxis—parallel

444 Advanced multiaxis—along curve


Predefined variables, postblocks, and functions: page 1266

445 Advanced multiaxis—triangular mesh

446 Advanced multiaxis—roughing

447 Advanced multiaxis—project

448 Convert to 5axis

449 Port Expert

450 Blade Expert

451 Rotary advanced

Lathe/Mill-Turn operations

51 Face contouring (C axis)

52 Cross contouring (C axis)

53 C axis contouring

55 Face drilling (C axis)

56 Cross drilling (C axis)

57 C axis drilling

60 Rough

61 Finish

62 Grooving (note that chained grooves use 68.)

63 Threading

64 Drill
Predefined variables, postblocks, and functions: page 1267

65 Point

66 Facing

67 Cutoff

68 Plunge rough; also, chained grooves

69 Manual entry

70 Merged in ASCII NCI

71 Lathe dynamic rough

72 Lathe contour rough

201 Canned finish

202 Canned rough

203 Canned rough and finish

204 Canned rough face

205 Canned rough and finish face

206 Canned pattern repeat rough

207 Canned pattern repeat rough and finish

208 Canned groove rough

209 Canned groove finish

210 Quick rough

211 Quick finish


Predefined variables, postblocks, and functions: page 1268

212 Quick groove

213 C-hook generated

214 Stock transfer

215 Stock flip

216 Bar feed

217 Chuck clamp/unclamp

218 Tailstock operation

219 Steadyrest operation

220 Pinch-turn operation

220 Pinch-turn

221 Custom operation with tool

222 Custom operation without tool

223 Custom operation reference

224 Plunge turn (chained geometry)

225 Plunge turn (point geometry)

226 Turret park operation

230 Simple bar feed (Mill-Turn only)

231 Bar feed with tool stop or tool pull (Mill-Turn only)

232 Spindle clamp/unclamp (Mill-Turn only)


Predefined variables, postblocks, and functions: page 1269

233 Spindle advance/retract (Mill-Turn only)

234 Spindle sync (Mill-Turn only)

235 Tailstock advance/retract (Mill-Turn only)

236 Turret park (Mill-Turn only)

237 Center operation(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

82 Merged in ASCII NCI

83 Collar

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1270

tool_typ$
M L R W MT
Tool type number

Possible values

0 Undefined

1 Center drill

2 Spot drill

3 Drill

4 Right hand tap

5 Left hand tap

6 Reamer

7 Boring bar

8 Counter bore

9 Counter sink

10 End mill - flat

11 End mill - spherical

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

19 End mill - bullnose

20 Block drilling head

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1272

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

0 Do NOT call __0-type postblocks

1 Call the __0-type postblocks if tool number = 0

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1273

tosz$
M L R MT
3-axis drill: Absolute position of the Z location of the top of stock. 5-axis
drill: Not calculated.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1274

tox$
M L R W MT
X coordinate of the tool plane origin.

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1275

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1276

toy$
M L R W MT
Y coordinate of the tool plane origin.

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1277

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1278

toz$
M L R W MT
Z coordinate of the tool plane origin.

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1279

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1280

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

1 All Tplanes option

2 Only transform Tplanes option

Where does this value come from?


Output on following NCI lines
None
Control definition page
Work System page
Predefined variables, postblocks, and functions: page 1281

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1282

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1283

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1284

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1285

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1286

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1287

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1288

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1289

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1290

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1291

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.

Where does this value come from?


Output on following NCI lines
1032

Control definition page


None
Predefined variables, postblocks, and functions: page 1292

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1293

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1294

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1295

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1296

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1297

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1298

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1299

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1300

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1301

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.

Where does this value come from?


Output on following NCI lines
1031

Control definition page


None
Predefined variables, postblocks, and functions: page 1302

trflat$
M L R W MT
Size of the tool flat on the end of the cutter. Calculated as (tlrad$ - tcr$)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1303

trimplane1$
W
4-axis XY trimming plane height.

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1304

trimplane2$
W
4-axis UV trimming plane height.

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1305

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

1 Set partial fraction to 9 and truncate NCI value.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 1306

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

0 Not at the end.

1 At the end.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1307

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1309

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1310

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1311

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

0 None (not axis substitution)

1 CCW

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1312

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1313

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

0 Cutter compensation is off (G40)

1 Left (G41).

2 Right (G42).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1314

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1315

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

0 Off (always off with Mill and Router toolpaths)

1 On

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1316

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

8–19 Custom cycles

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1317

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1318

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1319

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1320

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

0 Units per minute

1 Units per revolution

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1321

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1322

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1323

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1324

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1325

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1326

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1327

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1328

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

4 Rotary axis is skewed

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1329

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

0 None (normally for lathe tool path)

1 Axis substitution

2 Polar conversion

3 Axis substitution—rotary axis and conversion axis match

4 Polar conversion—rotary axis and conversion axis match

5 Toolplane—convert to polar

6 Toolplane

7 Multiaxis (vector)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1330

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

1 Rotation about the X axis.

2 Rotation about the Y axis.

3 Rotation about the Z axis.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1331

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

2 3-axis (mill) or C-axis (lathe, mill-turn)

3 4-axis/rotary output (mill) or Y-axis (lathe, mill-turn)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1332

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1333

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

0 Left (main spindle)

1 Right (subspindle)

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1334

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1335

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

0 Neither first nor last tool.

1 First tool.

2 Last tool.

3 Both first and last tool (in other words, there is only one tool).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1336

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1337

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1338

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1339

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1340

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1341

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1342

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1343

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1344

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1345

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1346

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1347

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1348

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1349

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1350

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1351

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1352

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1353

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1354

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1355

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.

Where does this value come from?


Output on following NCI lines
1027

Control definition page


None
Predefined variables, postblocks, and functions: page 1356

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).

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1357

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
peof$ #End of file for non-zero tool
pretract
comment$
if stagetool = 1 & stagetltype = 2, pbld, n$, *first_tool$, e$
uninhibit_eof_probe$
n$, "M30", e$
mergesub$
clearsub$
mergeaux$
clearaux$
"%", e$
Predefined variables, postblocks, and functions: page 1358

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pretract #End of tool path, toolchange
sav_absinc = absinc$
absinc$ = one
# cc_pos is reset in the toolchange here
cc_pos$ = zero
gcode$ = zero
pbld, n$, sccomp, *sm05, psub_end_mny, e$
pbld, n$, sgabsinc, sgcode, *sg28ref, "Z0.", scoolant, e$
if nextop$ = 1003 | tlchg_home, pbld, n$, *sg28ref, "X0.",
"Y0.", protretinc, e$
else, pbld, n$, protretinc, e$
absinc$ = sav_absinc
coolant$ = sav_coolant
uninhibit_probe$
Predefined variables, postblocks, and functions: page 1359

upper_x$
M L R W MT
[obsolete]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1360

upper_y$
M L R W MT
[obsolete]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1361

upper_z$
M L R W MT
[obsolete]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1362

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

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1363

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1364

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1365

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$.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1366

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.

1 Enable call to canned drill cycles postblocks pbore1$, pbore2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1367

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.

1 Enable call to canned drill cycles postblocks pbore1$, pbore2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1368

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.

1 Enable call to canned drill cycles postblocks pchpbrk$, pchpbrk_2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1369

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.

1 Enable call to canned drill cycles postblocks pdrill$, pdrill_2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1370

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.

1 Enable call to canned drill cycles postblocks pmisc1$, pmisc2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1371

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.

1 Enable call to canned drill cycles postblocks pmisc1$, pmisc2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1372

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.

1 Enable call to canned drill cycles postblocks ppeck$, ppeck_2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1373

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.

1 Enable call to canned drill cycles postblocks ptap$, ptap_2$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Drill Cycles page
Predefined variables, postblocks, and functions: page 1374

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Machine Cycles page
Predefined variables, postblocks, and functions: page 1375

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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1376

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

1 g30code$, wx$, wy$, wz$, wxc$, wyc$, wcor_rad$

2 g30code_2$, wx_2$, wy_2$, wz_2$, wxc_2$, wyc_2$, wcor_rad_2$

3 g30code_3$, wx_3$, wy_3$, wz_3$, wxc_3$, wyc_3$, wcor_rad_3$

4 g30code_4$, wx_4$, wy_4$, wz_4$, wxc_4$, wyc_4$, wcor_rad_4$

Possible values

0 Disabled

1 Enabled

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1377

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

0 Option is not selected; the alternate characters will not be output.

1 Enables the use of alternate EOB characters and activates the fields where they can
be specified.

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 1378

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

0 Do not use decimal values

1 Use decimal values (the option is selected).

Where does this value come from?


Output on following NCI lines
None
Control definition page
NC Output page
Predefined variables, postblocks, and functions: page 1379

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

0 2D contour or 4-axis taper

2 4-axis direct, linear upper wire

3 4-axis direct, arc upper wire

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1380

uvheight$
W
UV height value entered in Mastercam.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1381

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).

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1382

vdirx$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1383

vdiry$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1384

vdirz$
M L R MT
OBSOLETE: Returns the cut direction vector with 5-axis toolpaths.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1385

vers_no$
M L R W MT
Mastercam major version number. See also m_vers_no$.

Possible values

3 Version 6 (yes, it really is 3...)

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

Where does this value come from?


Output on following NCI lines
1050
Predefined variables, postblocks, and functions: page 1386

Control definition page


None

How is this used?


Example
ptoolwr1 # Write tool table line - if not already done !
if vers_no$ = 8,
tlrad$ = tlrad$ * 2 # If using Wire v8 Wire Libs
result = newfs (18, tlrad$)
if hreg_style = two,
[
*offset$, "= "
*tlrad$ # Load the 'H' variable
]
else,
*offset$, "=", "0.0000" # Load the 'H' variable with ZERO
phecode # Do 'H' registers for the 'E' power settings
phfcode # Do 'H' registers for the 'F'eedrate settings
e$ # End the current output block
Predefined variables, postblocks, and functions: page 1387

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 1388

vert_tool$
M L R W MT
[obsolete]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1389

vox$
M L R MT
OBSOLETE: Axis offset vector.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1390

voy$
M L R MT
OBSOLETE: Axis offset vector.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1391

voz$
M L R MT
OBSOLETE: Axis offset vector.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1392

vtlngz$
M L R MT
Used to pass the tool length to the other variables/functions; see vtlofsx$,
vtlofsy$, vtlofsz$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1393

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1394

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1395

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1396

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1397

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1398

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1399

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1400

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).

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1401

warc_cortyp$
W
Wire arc corner type.

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1402

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

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1403

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$.

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1404

warc_radius$
W
Arc radius for wire NCI 32/33 moves.

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1405

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

2 Other (a post-specific setting)

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1406

wc$
W
Corner type of the current position in the wirepath.

Possible values

0 Conical

1 Sharp

2 Constant

3 Other

Where does this value come from?


Output on following NCI lines
0 1 2 3 20 21 22 23 30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1407

wcc$
W
Cutter compensation for 4-axis direct (UV) upper wirepaths.
This variable is never used. See the numeric variable cc$.

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1408

wcor$
W
Corner type for 4-axis direct (UV) upper wirepaths. See related variable wcor_rad$.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1409

wcor_rad$
W
Wire corner radius.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1410

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1411

wcor_rad_3$
W
The upper corner radius results of the conversion are stored in these variables.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1412

wcor_rad_4$
W
The upper corner radius results of the conversion are stored in these variables.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1413

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$.

Where does this value come from?


Output on following NCI lines
0 1 2 3 20 21 22 23 30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1414

wdum3$
W
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1415

wfr$
W
Feed rate setting of 4-axis direct (UV) upper wirepaths.
This variable is never used. See the numeric variable fr$.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1416

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

0 No, this is not a full arc

1 Yes, this is a full arc

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1417

whatline$
M L R W MT
OBSOLETE: internal motion counter. Do not use this in any current
post.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1418

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1419

wire$
W
Wire status.
See related power$, tank$, and water$.

Possible values

0 Off

1 On

Where does this value come from?


Output on following NCI lines
1013

Control definition page


None
Predefined variables, postblocks, and functions: page 1420

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1421

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1422

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1423

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

0 Work offsets option—for example, G54, E1

1 Home position option—typically, G90/91

2 Local work offsets option—typically, G92

3 Other option—custom implementation in post

Where does this value come from?


Output on following NCI lines
None
Control definition page
Work System page
Predefined variables, postblocks, and functions: page 1424

workofs$
M L R W MT
Work offset number.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1425

wox$
X coordinate of the tool plane origin. This is considered obsolete. W

Where does this value come from?


Output on following NCI lines
1013 1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1426

woy$
Y coordinate of the tool plane origin. This is considered obsolete. W

Where does this value come from?


Output on following NCI lines
1013 1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1427

woz$
W
Z coordinate of the tool plane origin.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1428

wplane$
W
Plane setting of 4-axis direct (UV) upper wirepaths.
This variable is never used. See the variable plane$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1429

wq$
W
Wire angle perpendicular wq$ (Q) and parallel wr$ (R) to the current wire motion
(Agie style). See qrtyp$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1430

wr$
W
Wire angle perpendicular wq$ (Q) and parallel wr$ (R) to the current wire motion
(Agie style). See qrtyp$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1431

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

Positive Right tilt in the direction of travel

Negative Left tilt in the direction of travel

Where does this value come from?


Output on following NCI lines
0 1 2 3 20 21 22 23 30 31 32 33

Control definition page


None

How is this used?


Example
plin$ # A postblock
n$, x$, y$, z$, wt$, e$
Predefined variables, postblocks, and functions: page 1432

wtpr$
W
Obsolete: Taper angle (in degrees) of the current position. See wt$ instead.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1433

wtrim$
W
The trimming option for 4-axis wirepaths.

Possible values

0 Trim in computer.

1 Trim in control.

2 3D tracking

Where does this value come from?


Output on following NCI lines
1015

Control definition page


None
Predefined variables, postblocks, and functions: page 1434

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

Positive Right tilt in the direction of travel

Negative Left tilt in the direction of travel

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
plin$ # A postblock
if immediate$ = 2, n$, x$, y$, z$, wt_immd$, e$
else, n$, x$, y$, z$, wt$, e$
Predefined variables, postblocks, and functions: page 1435

wt_max$
W
Largest wire taper encountered on the 2D contour wirepath between tool changes
(operations).

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1436

wx$
W
X coordinate of the 4-axis direct upper wirepath.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None

How is this used?


Example
if cuttype$ < two, u$ = vequ(wx$)
Predefined variables, postblocks, and functions: page 1437

wxc$
W
Arc center (X, Y) of the 4-axis direct upper wirepath.

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None

How is this used?


Example
if kltyp_lin = four, kout = vequ( wxc$ )
Predefined variables, postblocks, and functions: page 1438

wxc_2$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1439

wxc_3$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1440

wxc_4$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1441

wx_2$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1442

wx_3$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1443

wx_4$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1444

wy$
W
Y coordinate of the 4-axis direct upper wirepath.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None

How is this used?


Example
if cuttype$ < two, v$ = vequ(wy$)
Predefined variables, postblocks, and functions: page 1445

wyc$
W
Arc center (X, Y) of the 4-axis direct upper wirepath.

Where does this value come from?


Output on following NCI lines
32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1446

wyc_2$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1447

wyc_3$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1448

wyc_4$
W
The upper arc center position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1449

wy_2$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1450

wy_3$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1451

wy_4$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1452

wz$
W
Z coordinate of the 4-axis direct upper wirepath.

Where does this value come from?


Output on following NCI lines
30 31 32 33

Control definition page


None

How is this used?


Example
if cuttype$ < two, w$ = vequ(wz$)
Predefined variables, postblocks, and functions: page 1453

wzc$
W
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1454

wz_2$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1455

wz_3$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1456

wz_4$
W
The upper contour position results of the conversion.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1457

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1458

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1459

xc$
M L R W MT
The X center, Y center, and Z center of the current arc.

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1460

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1461

xdrl$
M L R MT
Absolute position of the X location of the selected drill point.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1462

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$.

Where does this value come from?


Output on following NCI lines
1016

Control definition page


None
Predefined variables, postblocks, and functions: page 1463

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1464

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.

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 1465

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1466

xresult$
M L R W MT
Type of intersection bound by a 2D intersection postline function.

Possible values

–1 Entities are coincident. (Does not apply to line-arc intersections.)

0 Entities do not intersect.

1 Entities have one intersection point.

2 Entities have two intersection points. Two lines can intersect at a maximum of one
point.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1467

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1468

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None

How is this used?


Example
If you decide to modify your post to use the new NCI data, chances are you will want to
test to see if the NCI 11 line has been created by one of the supported toolpath types. The
following code shows a compact and efficient technique for doing this.
First define a Boolean variable whose value will indicate whether or not the current
operation is a supported toolpath. Then use a block of OR statements to set its value.
tool_contact_supported =
(
tool_op$ = 29 | # Curve 5-axis
tool_op$ = 48 | # Swarf
tool_op$ = 110 | # Multisurf
tool_op$ = 45 | # Flow
Predefined variables, postblocks, and functions: page 1469

tool_op$ = 112 # Port


)

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
Tolerance page
Predefined variables, postblocks, and functions: page 1471

xyheight$
W
XY height value entered in Mastercam.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1472

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1473

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1474

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1475

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1476

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.

Configuring your post to support these variables


The routine that allows MP to automatically set these variables needs to be explicitly enabled
in your post. This has been done to support backward compatibility with the many existing
posts that initialize them manually. A new predefined variable has been added for this
purpose: x_mp_adv_func$. Simply initialize it to 1 to automatically read the values from the
machine definition:
x_mp_adv_func$ : 1 #Set the 5 axis variables

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1478

x_nci_read$
M L R W MT
[future use]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1479

x_probe_opt$
M L R W MT
Helper variable for Renishaw probing. Initialize this to 1022 for normal
probing operation.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1480

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.

x_tooltable$ has two main applications:


n When it 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. You can use this
to build lists of all the component IDs or axis combo IDs.
n When it is set to 0 or higher, it will trigger calls to the ptooltable$ postblock. This
postblock is run for each toolpath operation—in other words, each operation that
creates an 1000/1001/1002 line 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.
Follow this general outline:

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

–2 Call puidlist$ for each 20601 entry (axis combination)

–1 Call puidlist$ for each 20600 entry (component)

0 Call ptooltable$ for current operation only (defined by current op_id$ value). (This is
the default value.)

1 Call ptooltable$ for each operation in the operation list.

2 Call ptooltable$ for each operation in the operation list whose type matches
posttype$ value.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
The following code shows how the new tool table routines might be implemented in a typical
Mill post. The tool table routines are called directly from pheader$, immediately after it has
output several header lines to the NC file.
Notice that the ptooltable$ postblock uses the new tt_ variables that were introduced in
Mastercam 2017, instead of the normal NCI variables. At the point in the post where x_
tooltable$ is called, the NCI variables have not been set (since the NCI has not yet been
processed), so the tt_ variables are used.
This example also references the tldia$ value, which is a traditional NCI variable that is output
on the 1013 line. Since the NCI has not yet been read, the post gets the 1013 line from a
parameter table.
fprmtbl 101 5 # Operation - tool table
1013 sparameter$
10010 xy_stock
10068 z_stock
15346 comp_type
20001 strtool$

pheader$ # Call before start of file


"%", e$
Predefined variables, postblocks, and functions: page 1482

"(DATE=DD-MM-YY - ", date$, ")", e$


"(MCX FILE - ", *smcpath$, *smcname$, *smcext$, ")", e$
"(NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(MATERIAL - ", *stck_matl$, ")", e$
x_tooltable$ = 1 # Process all operations in order
x_tooltable$ # Call the tooltable

ptooltable$ # Tooltable output


if tool_info > 1 & tt_count$ = 1,
[
# Copy prefix string
s_t_pre_tt = s_t_pre$, s_d_pre_tt = s_d_pre$,
s_h_pre_tt = s_h_pre$
# Get the data from parameter lookup
result = fprm (101, 0, 0)
# Tool diameter from 1013 string
tldia$ = rparsngl (sparameter$, 2)
# Output tool table line
"(", *tt_tool$, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$
if tt_drlcycle$ = –1, # No stock with drill
[
if comp_type > 0 & comp_type < 4,
[
sdelimiter, tt_offset$, sdelimiter, *scomp_type,
sdelimiter, *tldia$
]
if xy_stock <> 0 | z_stock <> 0,
[
sdelimiter, *xy_stock, sdelimiter, *z_stock
]
]
")", e$
]
Predefined variables, postblocks, and functions: page 1483

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1484

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1485

yc$
M L R W MT
The X center, Y center, and Z center of the current arc.

Where does this value come from?


Output on following NCI lines
2 3 22 23 32 33

Control definition page


None
Predefined variables, postblocks, and functions: page 1486

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1487

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:

Variable Unformatted (string) Formatted (number)

mon$ Sep 9.0

month$ 09 9.0

year$ 08 8.0

day$ 26 26.0

See related variables date$, time$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None

How is this used?


Example
pheader$ #Start of file
"%", e$
sav_spc = spaces$
spaces$ = 0
#*progno$, " (", sprogname$, ")", e$
Predefined variables, postblocks, and functions: page 1488

*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

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1490

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1491

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.

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 1492

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1493

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1494

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1495

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1496

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1497

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1498

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1499

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1500

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1501

zc$
M L R W MT
The X center, Y center, and Z center of the current arc.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1502

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1503

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.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1504

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$.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1505

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002 1003

Control definition page


None
Predefined variables, postblocks, and functions: page 1506

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.

Where does this value come from?


Output on following NCI lines
0 1 2 3 11 20 21 22 23 30 31 32 33 81 100

Control definition page


None
Predefined variables, postblocks, and functions: page 1507

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.

Where does this value come from?


Output on following NCI lines
1000 1001 1002

Control definition page


None
Predefined variables, postblocks, and functions: page 1508

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.

Where does this value come from?


Output on following NCI lines
11

Control definition page


None
Predefined variables, postblocks, and functions: page 1509

zx$
W
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1510

zy$
W
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1511

zz$
W
[not currently used]

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined variables, postblocks, and functions: page 1512

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1513

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1514

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:

1. Ignore the first call to pwrtt$.


2. Set toolchange$ = 3. This will add an extra final call to pwrtt$ so you can capture the
min and max values for the last operation.
3. Create a variable to store the number of the previous tool.
The following code shows how you might accomplish this:
tooltable$ : 3
sav_t : 0
pwrtt$ # Tool table output
if t$ > 0,
[
if gcode$ <> 1001, "[", *sav_t, *z_min$, *z_max$, "]", e$
sav_t = t$
]

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.

Where does this value come from?


Output on following NCI lines
None
Predefined variables, postblocks, and functions: page 1515

Control definition page


None

How is this used?


Example
tooltable$ : 3
sav_t : 0
z_min_all : 0
z_max_all : 0
pwrtt$ #Tool Table Output
if t$ > 0,
[
if gcode$ <> 1001,
[
"[", *sav_t, *z_min$, *z_max$, "]", e$
if z_min$ < z_min_all, z_min_all = z_min$
if z_max$ > z_max_all, z_max_all = z_max$
]
sav_t = t$
]
psof$ #Start Of File
"[", *z_min_all, *z_max_all, "]", e$
Predefined variables, postblocks, and functions: page 1516

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

0 Disable switch (default)

1 Enable switch; skip calls to Z-only postblocks.

Where does this value come from?


Output on following NCI lines
None
Control definition page
None
Predefined postblocks

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$.

Used for lathe toolpaths.


Predefined variables, postblocks, and functions: page 1544

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.

Using query functions for parameter dumps


The following table describes the parameter dump format for each of the query functions. You
need to invoke separate functions to dump each type of parameter (operation, machine
definition, control definition, and machine group).
To dump the parameters, follow this general workflow:
1. Go to the postblock where you want to initiate the parameter dump. A typical choice is
pheader$, but it can be any postblock.
2. Add the desired query function from the table below.
3. Add the pdump$ postblock, and implement it as shown in the sample code.

Table 1: Parameter dump modes for query functions

Type of query Function format

Dump parameters for a specific operation. return = opinfo( –1, source_op,


mode )
See opinfo( ) to learn more about targeting a specific
operation.

Dump all operation parameters for all operations. return = opinfo( –2 )

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

Type of query Function format

Dump all machine definition parameters. return = mdinfo( –1 )

Dump control definition parameters. return = cdinfo( –1 )

Dump machine group parameters. return = groupinfo( –1 )

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.

How is this used?


Example
return : 0

pheader$ # Call query functions


"----- Machine definition parameters -----", e$
return = mdinfo(-2)
" ", e$
"----- Control definition parameters -----", e$
return = cdinfo(-1)
" ", e$
"----- Machine group parameters -----", e$
return = groupinfo(-1)
" ", e$
"----- Operation parameters -----", e$
return = opinfo (-2)
" ", e$
"----- End param dump -----", e$

pdump$ # Output parameter values


~prmcode$ ~sparameter$ e$
Predefined variables, postblocks, and functions: page 1629

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.

How is this used?


Example
This example shows how pmachineinfo$ can be used in an X9 or earlier post. First it
populates two parameter tables, one each for machine definition and control definition
parameters; then it reads two specific parameters from the machine definition and sets
other variables based on their values.
pmachineinfo$ #Machine information parameters postblock
if prmcode$ >= 17000 & prmcode$ < 18000, result = fprm(17000) #Run the
parameter table for Machine Definition Parameters
if prmcode$ >= 18000 & prmcode$ < 19000, result = fprm(18000) #Run the
parameter table for Control Definition Parameters

#Determine Z direction - set vmc


if prmcode$ = 17392 & axis_label = 3,
[
z_dir = rpar(sparameter$, 1) #Z axis direction - +X=1,+Y=2,+Z=3,-X=7,-
Y=8,-Z=9
if z_dir <> 3 & z_dir <> 9, vmc = 0 #0 = Horizontal Machine, 1 =
Vertical Mill
else, vmc = 1
]

#Set axis of rotation for rotary component


if prmcode$ = 17399,
[
rot_axis = rpar(sparameter$, 1) #Axis of rotation - +X=1,+Y=2,+Z=3,-
X=7,-Y=8,-Z=9
if rot_axis > 3, rot_axis = rot_axis - 6 #Keep value positive
(+X,+Y,+Z) for use in rot_on_x
]
Predefined variables, postblocks, and functions: page 1654

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.

How is this used?


Example
This example shows how pparameter$ would have been used in an X9 or earlier post.
This example shows how to get the name of the NCI file, which is available as parameter
15107.
snci_file : "" # Define a string

pparameter$ # Predefined parameter postblock


if prmcode$ = 15107, snci_file = sparameter$
Predefined variables, postblocks, and functions: page 1670

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.

Information that is available to ptooltable$


To support the enhanced tool table processing routines, a new class of data objects has been
created. Legacy tool table processing (in other words, tooltable processing triggered by the
tooltable$ variable) relies on NCI variables that are populated during the NCI pre-read. Since
the enhanced tool table routines do not use the NCI pre-read, the traditional NCI variables
are not available, so new data objects have been created that can be used instead.
The enhanced tool table processing has access to a set of 106 data objects. A complete list is
included in the Working with enhanced tool tables application guide. While some of these are
still only for internal use, most of them have been exposed to the post writer through new
predefined variables whose names begin with tt_; you can see which settings are available by
browsing through the Contents panel in the All variables by category >  Enhanced tool table
queries section. Most of these correspond to traditional NCI variables; the difference is that
the tt_ variables are set from the new tool table routines, while the traditional variables are
set from reading the NCI data.
Having the two sets of values in different sets of variables means that you do not need to worry
about the tool table data overwriting the NCI data, and vice versa. Any of the tt_ variables
can be used freely in the ptooltable postblock.
If you do need access to one of the new data objects for which a predefined variable has not
been created—for example, one of the misc ints or reals—you can use the opinfo( ) function to
get it. Use a statement of the following form:
var = opinfo(n, 0)

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

Getting operation parameters from inside ptooltable$


In addition to the new tt_ variables, the ptooltable postblock can access operation
parameters. Use either of these techniques:
n Define parameter tables, then populate them with fprm statements in ptooltable$.
n Use the opinfo( ) function to query them directly. Remember also that the opinfo( )
function also lets you get parameters for previous/next operations.
Similar to opinfo( ), use the mdinfo( ), cdinfo( ), or groupinfo( ) functions to get parameters from the
machine definition, control definition, or machine group.
See the Working with tool and operation parameters application guide for complete information
about using these functions.
Getting NCI data from inside ptooltable$
If the data that you need for your tool table is not available as one of the new tt_ variables,
you can use the opinfo( ) function to directly access tool change NCI lines. The opinfo( )
function will typically return an entire line of NCI parameters as a single string which would
need to be parsed with rparsngl to extract the desired value. For example:
ptooltable$ # Tooltable output
# Tool diameter from 1013 string
tldia$ = rparsngl (opinfo(1013, 0), 2)

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.

How is this used?


Example
The following code shows how the new tool table routines might be implemented in a
typical Mill post. The tool table routines are called directly from pheader$, immediately
after it has output several header lines to the NC file.
Notice that the ptooltable$ postblock uses the new tt_ variables that were introduced
in Mastercam 2017, instead of the normal NCI variables. At the point in the post where x_
tooltable$ is called, the NCI variables have not been set (since the NCI has not yet been
processed), so the tt_ variables are used.
This example also references the tldia$ value, which is a traditional NCI variable that is
output on the 1013 line. Since the NCI has not yet been read, the post gets the 1013 line
from a parameter table.
fprmtbl 101 5 # Operation - tool table
1013 sparameter$
10010 xy_stock
10068 z_stock
15346 comp_type
20001 strtool$
Predefined variables, postblocks, and functions: page 1733

pheader$ # Call before start of file


"%", e$
"(DATE=DD-MM-YY - ", date$, ")", e$
"(MCX FILE - ", *smcpath$, *smcname$, *smcext$, ")", e$
"(NC FILE - ", *spathnc$, *snamenc$, *sextnc$, ")", e$
"(MATERIAL - ", *stck_matl$, ")", e$
x_tooltable$ = 1 # Process all operations in order
x_tooltable$ # Call the tooltable

ptooltable$ # Tooltable output


if tool_info > 1 & tt_count$ = 1,
[
# Copy prefix string
s_t_pre_tt = s_t_pre$, s_d_pre_tt = s_d_pre$,
s_h_pre_tt = s_h_pre$
# Get the data from parameter lookup
result = fprm (101, 0, 0)
# Tool diameter from 1013 string
tldia$ = rparsngl (sparameter$, 2)
# Output tool table line
"(", *tt_tool$, sdelimiter, pstrtool, sdelimiter, *tt_tlngno$
if tt_drlcycle$ = –1, # No stock with drill
[
if comp_type > 0 & comp_type < 4,
[
sdelimiter, tt_offset$, sdelimiter, *scomp_type,
sdelimiter, *tldia$
]
if xy_stock <> 0 | z_stock <> 0,
[
sdelimiter, *xy_stock, sdelimiter, *z_stock
]
]
")", e$
]
Predefined variables, postblocks, and functions: page 1734

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.

Information available to puidlist$


As a convenience, the following variables are automatically populated from each 20600/20601
entry as puidlist$ is being executed:

Table 2: Information available to puidlist$

Position on the
Variable/string …is set to:
20600/20601 line

prmcode$ the numeric entity ID of the Param #1


component or axis combination

sparameter$ the string ID of the component or Param #1


axis combination

suser_label$ the name of the component or axis 20600: param #5


combination 20601: param #4

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.

How is this used?


Example
tooltable$ : 3 #Pre-read -- call the pwrtt$ postblock

pwrtt$ # Initiate tool table processing


if t$ > 0 & gcode$ <> 1003, p_output_tt_line
Predefined variables, postblocks, and functions: page 1741

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.

How is this used?


Example
tooltable$ : 3 #Pre-read -- initiate tooltable processing
pwrttparam$ #Pre-read parameter data
if prmcode$ = 15346, comp_type = rpar(sparameter$, 1) # Cutter
compensation type
if prmcode$ = 10010, xy_stock = rpar(sparameter$, 1) # Capture stock to
leave (XY)
if prmcode$ = 10068, z_stock = rpar(sparameter$, 1) # Capture stock to
leave (Z)
Predefined variables, postblocks, and functions: page 1742

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

Functions and declarations

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.

The general form is:


return = abs(x) 0 1 2 3 limit is 1
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1747

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.

The general form is:


return = acomboinfo(function_state, axis_combo)
where

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

Returning arrays of component information


Probably the most important and common use of the acomboinfo function is using it to
return an array of the six axis components in the current axis combination: X, Y, Z, A, B, C.
You can choose to return the array in either of two forms:
n An array where the entity IDs are presented in a fixed order X-Y-Z-A-B-C. For example:

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.

More about component stacking order


The second array deserves some more explanation. If you look at the component tree in the
Machine Definition Manager, “stacking order” is interpreted as the sequence of components
that you encounter as you move in a circuit from the part (in this case, the Stock or Machine
Table components) to the tool (in this case, the Tool Spindle component).
Predefined variables, postblocks, and functions: page 1749

Follow this general workflow for working with acomboinfo:


1. First, define an array of six variables.
2. Then, when you use the acomboinfo function, use the first variable in the array as the
return variable. You can use the acomboinfo function in any postblock.
n Use function state 1 to return the axis components in X-Y-Z-A-B-C order:

var_1 = acomboinfo(1, axis_combo)

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)

Function states for acomboinfo


The simplest forms of the acomboinfo function query the current operation with a statement
of the form acomboinfo(param, 0) where the source_op argument = 0 and the mode
argument is omitted. However, you can configure the source_op and mode values so that you
can query almost any operation in your part file—even operations that do not have a tool
change—no matter what operation is currently being processed.

Table 3: Function states for acomboinfo

Return value Value for


Function
Purpose of query (success / argument
state #
failure) 2

Get the numeric entity ID of the axis 0 Number. Failure String ID of


combination, based on the string ID. value = –999999.0 axis combo.
Predefined variables, postblocks, and functions: page 1750

Return value Value for


Function
Purpose of query (success / argument
state #
failure) 2

Build X-Y-Z-A-B-C array of axis component 1 Value of first Entity ID or


IDs (numeric values) given the ID of the axis variable in array. string ID of
combo. On failure, the axis combo.
array is populated
with default entity
IDs.

Build array of axis component IDs as stacked 2 Value of first Entity ID or


on machine, given the ID of the axis combo. variable in array. string ID of
On failure, the axis combo.
array is populated
with default entity
IDs.

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.

Indicates if the direction of the axis combination 4 Number Entity ID or


matrix vector is reversed relative to the world string ID of
coordinate matrix. axis combo.
Returns the first variable in a three-variable
array (X-Y-Z).
Value is 0 if the direction is same as world
coordinates, or 1 if reversed.

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

Return value Value for


Function
Purpose of query (success / argument
state #
failure) 2

Find out if each rotation axis is head-type. 6 Number Entity ID or


string ID of
Returns the first variable in a three-variable
axis combo.
array, in which the first variable indicates the
type of A axis, second is B, and third is C. Value
= 1 for head-type rotation, otherwise 0.

Find out which rotary axis is the primary, 7 Number Entity ID or


secondary, and tertiary rotary axis. string ID of
axis combo.
Returns the first variable in a three-variable
array, in which the first variable indicates the
primary rotation axis; the second and third
variables indicate the secondary and tertiary
axes: 0=A, 1=B, 2=C.

The number of linear axes in the axis 8 Number Entity ID or


combination. string ID of
axis combo.

The number of rotary axes in the axis 9 Number Entity ID or


combination. string ID of
axis combo.

The string ID of the axis combination, given the 10 String Entity ID of


entity ID. axis combo.

The number of axis combinations in the NCI 11 Number Entity ID or


file (in other words, how many 20601 lines there string ID of
are). axis combo.

Get entity ID of component in axis 17683 to Number for Entity ID or


combination. This function state is a special 17696 17683–17695; string ID of
case: the first argument is the number of the string for 17696. axis combo.
parameter that is linked to a pre-built array of
axis combination components. Please see the
Working with tool and operation parameters
application guide for more information.

How is this used?


Example
This example builds an array to store the entity IDs for all the axis components. It then
uses acomboinfo with function state 1 to populate the array. Finally, it uses one of the
stored entity IDs to get some specific parameter values—in this case, the min and max Z-
axis travel limits.
Predefined variables, postblocks, and functions: page 1752

# Define array for acomboinfo return values


ent_id_x : 0 # Entity ID of X-axis component
ent_id_y : 0 # Entity ID of Y-axis component
ent_id_z : 0 # Entity ID of Z-axis component
ent_id_a : 0 # Entity ID of A-axis component
ent_id_b : 0 # Entity ID of B-axis component
ent_id_c : 0 # Entity ID of C-axis component

# Define variables to store parameter values


z_lim_min : 0 # Z-axis travel limit (min)
z_lim_max : 0 # Z-axis travel limit (max)

p_my_postblock # Any postblock where you need this data


ent_id_x = acomboinfo(1, syncaxis$) # populate array
z_lim_min = mdinfo(17723, ent_id_z) # get min limit
z_lim_max = mdinfo(17724, ent_id_z) # get max limit

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.

The general form is:


return = acos(x)
where

return numeric variable

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.

The general form is:


return = and(i, j)
Predefined variables, postblocks, and functions: page 1756

asin( )
Arcsine: Returns the angle whose sine is y.

The general form is:


return = asin(y)
where

return numeric variable

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.

The general form is:


return = atan(x)
where

return numeric variable

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.

The general form is:


return = atan2(y, x)
where

return numeric variable

x start angle or vector

y end angle or vector


Predefined variables, postblocks, and functions: page 1759

axb( )
Planar cross product of two 2D unitized vectors. Use vaxb for 3D vectors.

The general form is:


return = axb(v1, v2)
where

return A numeric value which represents the length (magnitude) of the cross-product
vector.

v1 Unitized vector 1. v1 and v2 each represent the first element of a two-element


array.

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.

The general form is:


return = brksps(x, string)
where

return the second section of the divided string

x the position where the string will be divided

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.

The general form is:


return = cdinfo(param)
where

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.

Improvements from earlier parameter read techniques


Techniques for reading parameters in X9 and earlier posts relied on repeatedly looping through
parameter and NCI structures until the requested parameters were encountered. The cdinfo
function, in contrast, simply goes and gets the requested data—and only the requested data.
This makes it much more efficient.
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 cdinfo 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.

Workflow for getting a control definition parameter


Follow these steps to get single control definition parameters. If you want to get many
parameters, consider building a table; see fprm( ) and fprmtbl.
1. Go to the Operation Parameter Reference volume to look up the desired parameter
number.
Predefined variables, postblocks, and functions: page 1763

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.

How is this used?


Example
ssetup_sheet : "" # String variable for setup sheet string
wear_support : 0 # Does control support wear comp?
rev_wear_support : 0 # Does control support reverse wear comp?

p_my_postblock # Any postblock where you need this data


ssetup_sheet = cdinfo(18160)
wear_support = cdinfo(18706)
rev_wear_support = cdinfo(18707)
Predefined variables, postblocks, and functions: page 1764

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).

The general form is:


return = comment_fx( x, string, mode )
where

return string to store shortened string

x maximum length of string

string the string or file path that you want to shorten

mode 0 = truncate, 1 = shorten. See descriptions below

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

control. This is set on the NC Output page:


Predefined variables, postblocks, and functions: page 1766

copyfmt( )
Copy fmt statement. Copies format assignment statement b to statement a. Returns 1 if
successful, otherwise 0.

The general form is:


return = copyfmt(a, b)
Predefined variables, postblocks, and functions: page 1767

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.

The general form is:


return = copyfs(a, b)
Predefined variables, postblocks, and functions: page 1768

cos( )
Cosine. Returns the cosine of angle a.

The general form is:


return = cos(a)
where

return numeric variable

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.

The general form is:


return = db_view(x)
Predefined variables, postblocks, and functions: page 1775

delay( )
Pauses post processing for n seconds (minimum value is 0.001). Always returns 1.

The general form is:


return = delay(n)
Predefined variables, postblocks, and functions: page 1776

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.

The general form is:


return = directory(mode, path)
where

return success or fail code, as described below.

mode tell MP what you want to do:


n 0 = delete the specified directory and all its contents, including files and
child directories. Returns 1 if successful, 0 if failure.
n 1 = create the specified directory. Returns 1 if successful or if the directory
already exists, 0 if failure.
n 2 = check if the directory already exists. Returns 1 if it already exists, or 0 if
it does not.

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.)

The general form is:


return = dll(dllname, argument)
where

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.

argument an optional string that contains arguments to be passed to the program.


Multiple arguments are typically enclosed in nested quote marks like this:
' "arg1" "arg2" "arg3" '

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.

Returning arguments from your C-Hook


Beginning with Mastercam X5, you have the ability to return values from the C-Hook back to
your post.
To start, declare and initialize up to three new predefined strings that have been created to
hold the return values. These are:
spost_arg_0$
spost_arg_1$
spost_arg_2$

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;
}

Then, your PST file should have the following logic:


# Define string for the name of the C-Hook.
sDLL : "C:\Program Files\mcamX8\chooks\MyCHook.dll"
#Define string with initial values to be passed to post_args [ ]
sARGS : ' "Arg0" "Arg1" "Arg2" ' # Args to pass to the DLL
# Define and initialize the new predefined strings.
# These will receive the values that are set by the C-Hook
# and returned to the post.
spost_arg_0$ : ""
spost_arg_1$ : ""
spost_arg_2$ : ""
pcallDLL # Call a CHook DLL...
"Call this C-Hook : ", sDLL, e$
result = dll(sDLL, sARGS)
"Result (1 = 'success') : ", *result, e$
"Return values : ", e$
" spost_arg_0$ = ", *spost_arg_0$, e$
" spost_arg_1$ = ", *spost_arg_1$, e$
" spost_arg_2$ = ", *spost_arg_2$, e$

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.

Returning values from a NetHook


This functionality has also been added to the NetHook API for Mastercam X5. To accomplish
this, the NetHook API now includes the post_args[ ] array.
Predefined variables, postblocks, and functions: page 1779

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.

The general form is:


return = dot(v1, v2)
where

return numeric variable

v1 the first vector. v1 and v2 each represent the first element of a two-element array.

v2 the second vector


Predefined variables, postblocks, and functions: page 1781

dot3( )
Dot product of two 3D vectors.

The general form is:


return = dot3(v1, v2)
where

return numeric variable

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.

The general form is:


return = drs_str(mode, number)
where

return string variable to store the return string.

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.

How is this used?


Example
This example uses the drs_str() function to build a string that consists of a line of
typical NC output.
str_nc = drs_str(2, n$) + drs_str(0)+ drs_str(2, xabs) + drs_str(1)

drs_str(2, n$) adds the formatted sequence number to the string.


drs_str(0) adds the spaces separator.
drs_str(2, xabs) adds the formatted X coordinate position to the string.
drs_str(1) adds the end-of-block character.
Predefined variables, postblocks, and functions: page 1783

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.

The general form is:


return = exp(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1786

fbuf
Define a buffer. Example: fbuf 4 0 2 1 1.

The general form is:


fbuf n keep_flag x init_flag y
where

n buffer number (1 –10)

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.

y code for type of buffer. 0 = numeric, 1 = string. If this value is omitted, 0 is


assumed.

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.

The general form is:


return = fclose(x)
Predefined variables, postblocks, and functions: page 1788

fexist( )
Tests if a file exists, where s is the path and name of the file. Returns 1 if the file exists.

The general form is:


return = fexist(s)
Predefined variables, postblocks, and functions: page 1789

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.

The general form is:


return = finc(t, x)
where

return a variable that stores the incremented count

t the number of the table created with the flktbl function

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.

How is this used?


Example
First define the lookup table and create a variable to store the count. Notice that each
value in the first column is 0. The second column represents a list of tool numbers.
times_used : 0 # variable to store the return value

flktbl 1 30 # Lookup table for tool usage tracking (30 entries)


0 1 # Tool number
0 2
0 3
[…remainder of the table is not shown…]

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

The general form is:


flktbl n x
where

n number of the table

x size of the table (optional)


Predefined variables, postblocks, and functions: page 1791

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.

The general form is:


return = flook(t, x)
where

return a variable that stores the value from column 1 of the table

t the number of the table created with the flktbl function

x value that you are searching for

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).

How is this used?


Example 1: Using flook( ) to return a value from a table
The following example shows a sample lookup table to look up spindle codes (sscode)
for a range of spindle speeds (ss$).
flktbl 1 10 # Define table with ten entries

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$ )

The logic works as follows:


Predefined variables, postblocks, and functions: page 1792

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

"Low" 0 # Low gear range


"Med" 400 # Medium gear range
"High" 2250 " High gear range

pmy_postblock
speed_range = flook( 1, ss$ )

For example, if ss$ is 425, speed_range would be Med.


Predefined variables, postblocks, and functions: page 1793

fmt
Assign a numbered format statement and (optionally) a prefix/suffix to one or more variables.
Example: fmt P 3 dwell$

The general form is:


fmt s1 n var s2 i n/d
where

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.

n the number of the fs or fs2 statement that will be used

var the name of the variable that is being formatted

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.

i flag to activate linked incremental values (use 1 to activate, otherwise 0 or


omitted). This is new for Mastercam 2017; see the absinc$ entry or the Introduction
to Mastercam Posts pdf to learn more.

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.

How is this used?


Example
The following example shows some common format assignments. Each variable to be
formatted has its own format statement. Notice that the last three use the linked
incremental flag.
fmt "T" 4 t$ #Tool number
fmt "T" 4 first_tool$ #First tool used
fmt "T" 4 next_tool$ #Next tool used
fmt "D" 4 tloffno$ #Diameter offset number
fmt "H" 4 tlngno$ #Length offset number
Predefined variables, postblocks, and functions: page 1794

fmt "G" 4 g_wcs #WCS G address


fmt "P" 4 p_wcs #WCS P address
fmt "S" 4 speed #Spindle Speed
fmt "M" 4 gear #Gear range
fmt "N" 21 n$ #Sequence number
fmt "X" 2 xabs #X position output
fmt "X" 3 xinc #X position output
fmt "Y" 3 yinc #Y position output
fmt "K" 3 kout #Arc center description in Z
fmt "R" 2 arcrad$ #Arc Radius
fmt "F" 15 feed #Feedrate
fmt "P" 11 dwell$ #Dwell
fmt "M" 5 cantext$ #Canned text
fmt "F" 2 pitch #Tap pitch (units per thread)
fmt "O" 7 progno$ #Program number
fmt "X" 2 xabs 1 #X position output: linked incremental
fmt "Y" 2 yabs 1 #Y position output: linked incremental
fmt "Z" 2 zabs 1 #Z position output: linked incremental
Predefined variables, postblocks, and functions: page 1795

fmtrnd( )
Get the rounded value. Returns the rounded value of x, according to the fs/fs2 statement
assigned to x.

The general form is:


return = fmtrnd(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1796

fnewsub( )
Rename subprogram file. Renames the subprogram file for level x with the path/name stored
in string s. Returns 1 if successful.

The general form is:


return = fnewsub(s, x)
Predefined variables, postblocks, and functions: page 1797

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).

The general form is:


result = force(x, y)
where

return result of operation

x first variable in range

y second variable in range


Predefined variables, postblocks, and functions: page 1798

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.

The general form is:


result = fprm(table_num, param_type, mode)
where

return 0 if parameter table is not found, otherwise 1

table_num the number of the parameter table to populate. This should match the
number in a corresponding fprmtabl statement. This is always required.

param_type indicates the type of parameter you are searching for:


n 0 = operation parameters (10000–16999, 40000+)
n 1 = machine definition parameters (17000–17999)
n 2 = control definition parameters (18000–18999)
n 3 = machine group parameters (19000–19999)

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).

n For machine definition parameters (param_type = 1), set the mode= 0 to


query general or overall machine properties. Otherwise, set the mode to the
entity ID of the specific axis combo or component whose parameters you
want to query.
Predefined variables, postblocks, and functions: page 1799

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.

How is this used?


Example
# Operation Parameters
fprmtbl 101 5 # Operation - tool table
Predefined variables, postblocks, and functions: page 1800

1013 sparameter$
10010 xy_stock
10068 z_stock
15346 comp_type
20001 strtool$

# Machine Definition Parameters


fprmtbl 17000 3 # Machine definition - general settings
17022 brk_rot_motion # Break rot motion at combined angle?
17023 brk_rot_angle # Angle for breaking rotary motion
17101 all_cool_off # First coolant off command shuts off ALL coolant
options

fprmtbl 102 4 # Machine definition - rotary component


17402 rot_ccw_pos # Rotary direction
17408 rot_index # Index or continuous
17409 rot_angle # Index step
17410 rot_type # Rotary type

result : 0 # return value for fprm function

pset_mach #Set post switches by reading machine def parameters


result = fprm (17000, one, zero) # Get general machine params
result = fprm (102, one, entid_pri) # Get rotary axis info

ptooltable$ #Tool table output


if tool_info > one & tt_count$ = one,
result = fprm (101, zero, zero) # Get parameter data
Predefined variables, postblocks, and functions: page 1801

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.

The general form is:


fprmtbl n x
where

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.

x size of the table.

Follow these rules for indents:


n The fprmtbl declaration line is flush left and not indented.
n The variable lines that follow (the body of the table) ARE indented.

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.

Storing parameters by tool_op$ value


A common technique is to define tables of parameters for different operation types, numbering
each table with the tool_op$ of the operation it refers to. You can then use a statement like
this:
p_mypostblock # Any postblock
result = fprm(tool_op$, 0)

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.

How is this used?


Example
# Operation Parameters
fprmtbl 101 5 # Operation - tool table
1013 sparameter$
10010 xy_stock
10068 z_stock
15346 comp_type
20001 strtool$

# Machine Definition Parameters


fprmtbl 17000 3 # Machine definition - general settings
17022 brk_rot_motion # Break rot motion at combined angle?
17023 brk_rot_angle # Angle for breaking rotary motion
17101 all_cool_off # First coolant off command shuts off ALL coolant
options

fprmtbl 102 4 # Machine definition - rotary component


17402 rot_ccw_pos # Rotary direction
17408 rot_index # Index or continuous
17409 rot_angle # Index step
17410 rot_type # Rotary type

result : 0 # return value for fprm function

pset_mach #Set post switches by reading machine def parameters


result = fprm (17000, one, zero) # Get general machine params
result = fprm (102, one, entid_pri) # Get rotary axis info

ptooltable$ #Tool table output


if tool_info > one & tt_count$ = one,
result = fprm (101, zero, zero) # Get parameter data
Predefined variables, postblocks, and functions: page 1803

fq
Define a user prompt that displays a message to the user and accepts input. Example: fq 1
seqno$ "Enter sequence num"

The general form is:


fq n var string
where

n number of the question

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

The general form is:


result = frac(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1805

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.

The general form is:


return = frange(t, x)
where

return a variable that stores the value from column 1 of the table

t the number of the table created with the flktbl function

x value that you are searching for

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.

How is this used?


Example
In the following example, my_var will be equal to 10 after the frange( ) function
executes.
my_var : 175
flktbl 1 3 # Define table

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

The general form is:


fs n x.y
where

n the format number (integer)

x number of digits before the decimal

y number of digits after the decimal


Predefined variables, postblocks, and functions: page 1807

fs2
Define a numeric format for both inch and metric values. Example: fs2 6 3.4 4,3

The general form is:


fs2 n x1.y1 x2,y2
where

n the format number (integer)

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.

The general form is:


return = fsg(expression, x, y)
where

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.

expression a numeric variable, boolean expression, or other mathematical expression.


The following examples are all valid:

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.

The general form is:


return=fsg1(x)
where

return 0 or 1

x variable or expression to be evaluated


Predefined variables, postblocks, and functions: page 1810

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.

The general form is:


return=fsg2(x)
where

return 0 or 1

x variable or expression to be evaluated


Predefined variables, postblocks, and functions: page 1811

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.

The general form is:


return=fsg3(x)
where

return 0, 1, or 2

x variable or expression to be evaluated


Predefined variables, postblocks, and functions: page 1812

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.

The general form is:


fstack n x
where

n the ID number of the stack

x the number of fields in each record

How is this used?


Example
This example creates a data stack with two fields per record. It then uses the push( ) and
pop( ) functions to add a record; query the stack size; and get a record.
# Define helper variables
stack_size : 0 # number of records in stack
result : 0 # used to report success/failure

# Define implied array


t_1 : 0 # first field in record
t_2 : 0 # second field in record

# Define stack
fstack 1 2 # define stack #1 with 2 fields per record

t_1 = t_1 + 1 # set values for t_1...


t_2 = t$ # ...and t_2

t_1 = push(1, result, 0) # create first record by pushing


# t_1 and t_2 onto the top of stack 1
Predefined variables, postblocks, and functions: page 1813

stack_size = pop(1, result, 0) # query how many records are in stack 1

t_1 = pop(1, result, 1) # get the top record of the stack...


# ... and store values in t_1 and t_2
Predefined variables, postblocks, and functions: page 1814

fstrsel
Define a string select table. Example: fstrsel sg00 gcode$ sgcode 4

The general form is:


fstrsel s1 var s2 n
where

s1 the first string in the string select table

var the numeric variable that is used as the selector variable

s2 the target string

n number of items in the table


Predefined variables, postblocks, and functions: page 1815

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.

The general form is:


result = ger(x)
Predefined variables, postblocks, and functions: page 1816

getncstr( )
Gets the buffered NC output string; the result depends on function mode x. Requires helper
variables for proper use.

The general form is:


return = getncstr(x, s)
where

return Returns 1 if successful.

x See documentation for function modes.


Predefined variables, postblocks, and functions: page 1817

getstrval( )
Gets the real value associated with a string.

The general form is:


return = getstrval( s )
where

return numeric variable

s the string whose real value you want to retrieve


Predefined variables, postblocks, and functions: page 1818

groupinfo( )
Use the groupinfo function to query the control defintion and get parameter values. The
groupinfo function can be used in any postblock.

The general form is:


return = groupinfo(param)
where

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.

Improvements from earlier parameter read techniques


Techniques for reading parameters in X9 and earlier posts relied on repeatedly looping through
parameter and NCI structures until the requested parameters were encountered. The
groupinfo function, in contrast, simply goes and gets the requested data—and only the
requested data. This makes it much more efficient.
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 groupinfo 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.
Predefined variables, postblocks, and functions: page 1819

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.

Workflow for getting a machine group parameter


Follow these steps to get single machine group parameters. If you want to get many
parameters, consider building a table; see fprm( ) and fprmtbl.
1. Go to the Operation Parameter Reference volume to look up the desired parameter
number.
2. Use the "Machine group: 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 = groupinfo(19xxx)
where 19xxx is the actual parameter number.

How is this used?


Example
# Define variable to store parameter values
smd_file_name : "" # String for machine definition file
stp_grp_name : "" # String for machine group name
tp_grp_number : 0 # Variable for machine group number

p_my_postblock # Any postblock where you need this data


tp_grp_number = groupinfo(19247)
stp_grp_name = groupinfo(19248)
smd_file_name = groupinfo(19105)
Predefined variables, postblocks, and functions: page 1820

grpix( )
Returns the base index of a group of values that includes x.

The general form is:


return = grpix(x, n)
where

return numeric variable

x number or numeric variable

n the number of values in the group


Predefined variables, postblocks, and functions: page 1821

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.

The general form is:


return = inc_var(var, mode)
where

return 0 if the state of var does not change, or 1 if the state of var changes.

var the variable whose state you want to set.

mode 0: disconnect from the incremental variable, 1: connect to the incremental


variable.

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.

How is this used?


Example
This example uses inc_var() to turn off incremental values for zabs while calculating a
home position for a canned drill cycle. It then turns the incremental values back on when
finishing the canned cycle processing.
pdrlcommonb # Canned Drill Cycle common call, before
if initht$ <> refht$, drillref = zero
else, drillref = one
if gcode$ = 81,
[
if drillcyc$ = three | drillcyc$ = 7, drlgsel = fsg1(-ss$) + drillcyc$
* two
else, drlgsel = fsg2(dwell$) + drillcyc$ * two
prv_refht_a = c9k
prv_refht_i = c9k
prv_dwell$ = zero
prv_shftdrl$ = zero
]
z$ = depth$
pcom_moveb
Predefined variables, postblocks, and functions: page 1822

if absinc$ = one,
[
result = inc_var(zabs, zero) # Disconnect linked incremental, use
absolute for output
zabs = z$ - refht$
]
feed = fr_pos$
comment$
pcan

pcanceldc$ #Cancel canned drill cycle


result = inc_var(zabs, one) # Reconnect to linked incremental
z$ = initht$
pxyzcout
!zabs
prv_gcode$ = zero
pcan
pcan1, pbld, n$, sg80, strcantext, e$
if (drillcyc$ = 3 | drillcyc$ = 7) & tap_feedtype, pbld, n$, sg94, e$
result = newfs(15, feed) #Reset the output format for 'feed'
pcan2
Predefined variables, postblocks, and functions: page 1823

int( )
Integer part. Returns the integer part of decimal value x. If x=4.56, int(x) = 4.

The general form is:


result = int(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1824

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.

The general form is:


return = ior(i, j)
Predefined variables, postblocks, and functions: page 1825

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.)

The general form is:


return = launch(progname, argument, mode)
where

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.

argument an optional string that contains arguments to be passed to the program.


Multiple arguments are typically enclosed in nested quote marks like this:
' "arg1" "arg2" "arg3" '

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.

Using nested quote marks


The name and path of the program to be run should be enclosed in quote marks if you are
passing it as a literal string, but does not require nested quotes even if it contains spaces. The
second argument—the list of arguments to be passed to the destination program—might or
might not require nested quotes. If the individual strings contain spaces, use nested quotes as a
best practice.
Predefined variables, postblocks, and functions: page 1826

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.

How is this used?


Example
This example launches an external program after post processing has been completed. It
passes the new program the name and location of the NC file that has just been created
by the post. The new program opens as a modeless dialog, so you can continue to use
Mastercam while the new program is running.
# Define the full path\name of the EXE to be run
strEXE "C:\Program Files (x86)\MyUtilities\myutility.exe"

# Create string with path\name of NC file


strfilename : spathnc$ + snamenc$ + sextnc$

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.

The general form is:


return = lcase(s)
Predefined variables, postblocks, and functions: page 1828

lng( )
Length (2D). Returns the length of a 2D vector.

The general form is:


return = lng(v)
where

return numeric variable

v The vector, where v represents the first element of a two-element array.


Predefined variables, postblocks, and functions: page 1829

lng3( )
Returns the length of a 3D vector.

The general form is:


return = lng3(v)
where

return numeric variable

v 3D vector
Predefined variables, postblocks, and functions: page 1830

log( )
Natural logarithm.

The general form is:


return = log(x)
where

return numeric variable

x number or numeric variable where x is greater than 0


Predefined variables, postblocks, and functions: page 1831

log10( )
Base-10 logarithm.

The general form is:


return = log10(x)
where

return numeric variable

x number or numeric variable where x is greater than 0


Predefined variables, postblocks, and functions: page 1832

matt( )
Transpose a matrix.

The general form is:


return = matt(x)
where

return numeric variable

x the first variable in the matrix definition


Predefined variables, postblocks, and functions: page 1833

mdinfo( )
Use the mdinfo function to query the machine defintion and get parameter values. The
mdinfo function can be used in any postblock.

The general form is:


return = mdinfo(param, component)
where

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.

component the entity ID or string ID of the specific component or axis combination


in the machine definition: for example, the X-axis component, instead of the Y-
axis or Z-axis component.
n For most uses of the mdinfo function, you can provide either the string ID
or entity ID.
n Typically, you will use acomboinfo( ) to get the ID.
n Some parameters—like the General Machine Parameters—apply to the
entire machine, not a specific component. Use a component value of 0 to
query these parameters:

Specifically, if you look at the Operation Parameter Reference volume, the


parameters that can be accessed when component = 0 are in the CNC_
MACHINE_TYPE group.

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.

Improvements from earlier parameter read techniques


Techniques for reading parameters in X9 and earlier posts relied on repeatedly looping through
parameter and NCI structures until the requested parameters were encountered. The mdinfo
function, in contrast, simply goes and gets the requested data—and only the requested data.
Predefined variables, postblocks, and functions: page 1834

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.

Workflow for getting a machine definition parameter


Follow these steps to get single machine definition parameters. If you want to get many
parameters, consider building a table; see fprm( ) and fprmtbl.
1. Go to the Operation Parameter Reference volume to look up the desired parameter
number.
2. Use the "Machine 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. Figure out if the parameter that you want to get belongs to a specific component; if so,
you will need to get the entity ID or UID of the component. See acomboinfo( ) to learn
more.
5. Go to the desired postblock where you want to get the value, and add a line like this:
my_var = mdinfo(17xxx, component)
where 17xxx is the actual parameter number. Use a component value of 0 to query the
general machine parameters, otherwise set this to the entity ID or UID of the desired
component or axis combination.

How is this used?


The following example gets minimum Z-axis travel limits (inch and metric values) for the
current axis combination. These are parameters 17719 (inch) and 17721 (metric) for a
linear axis.
Predefined variables, postblocks, and functions: page 1835

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

p_my_postblock # Any postblock where you need this data


entid_x = acomboinfo (1, syncaxis$) # Get array of entity IDs
entid_z = vlout(2, entid_x, 0) # Get Z-axis entity ID

z_min_inch = mdinfo(17719, entid_z)


z_min_mm = mdinfo(17721, entid_z)
Predefined variables, postblocks, and functions: page 1836

mmul( )
Multiply matrix m1 by matrix m2..

The general form is:


return = mmul(m1, m2)
where

return the matrix that results from multiplying matrix x1 by matrix x2

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.

The general form is:


return = modfs(x, n)
Predefined variables, postblocks, and functions: page 1838

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.

The general form is:


return = mprint(x, n)
where

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.

The general form is:


return = mteq(m)
where

return the copy of the 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.

The general form is:


return = newfs(n, x)
Predefined variables, postblocks, and functions: page 1841

no2asc( )
ASCII-to-string. Returns the string character whose ASCII code is x, where x is 1-255.

The general form is:


s = no2asc(x)
Predefined variables, postblocks, and functions: page 1842

no2str( )
Number-to-string: s = no2str(x). Returns the formatted value of x as a string. See also drs_str.

The general form is:


s = no2str(x)
Predefined variables, postblocks, and functions: page 1843

not( )
NOT operator. Reverses the result of the conditional expression x.

The general form is:


return = not(x)
where

return Returns 0 if x is TRUE, 1 if x is FALSE.

x conditional expression to be evaluated


Predefined variables, postblocks, and functions: page 1844

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.

The general form is:


return = nwadrs(s, x)
Predefined variables, postblocks, and functions: page 1845

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.

The general form is:


return = nwsufx(string, var)
where

return an integer variable to store the return value. The function returns 1 if
successful, otherwise 0.

string the string that you want to use as the suffix.

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.

How is this used?


Example
This example appends #200 to the X value when it is output.
my_str : 35 + "200"
poutput
n$, nwsufx(my_str, xabs), e$

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.

The general form is:


return = opchng( opnum )
where

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.

Improvements from earlier parameter read techniques


Techniques for reading parameters in X9 and earlier posts relied on repeatedly looping through
parameter and NCI structures until the requested parameters were encountered. The opinfo
function, in contrast, simply goes and gets the requested data—and only the requested data.
This makes it much more efficient. In addition:
n You can access information from any operation, not just the current one. You can
navigate forwards or backwards in the operation sequence to get information about,
say, the next operation, the last operation, etc.
n You can use it in any postblock.
While those 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 opinfo 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 general form is:


return = opinfo(param, source_op, mode)
where

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

from 17000–19999. Separate mdinfo( ), cdinfo( ), and groupinfo( ) functions are


provided to access those parameters.

Selecting the operation to query


The simplest forms of the opinfo function query the current operation with a statement of
the form opinfo(param, 0) where the source_op argument = 0 and the mode argument is
omitted. However, you can configure the source_op and mode values so that you can query
almost any operation in your part file—even operations that do not have a tool change—no
matter what operation is currently being processed.
The mode value is a four-digit “license plate” value that tells MP what the the source_op
value is pointing to. The following tables explain in detail how the mode value is used. If the
mode value is omitted, it has the same effect as effect as mode = 0000.

Table 4: opinfo mode selection: 1s digit

Value
of How it affects “source_op” argument
“mode”

nnn0 Value of source_op is offset from current operation.


n 0 = query current operation
n 1 = query next operation
n –1 = query previous operation
n other positive value = look ahead by that many operations
n other negative value = look backward that many previous operations
The sequence of operations = those operations for which a 1000/1001/1002 line exists in NCI
file.

nnn1 Value of source_op is operation ID (op_id$ value).

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.

Table 5: opinfo mode selection: 10s digit

Value of “mode” How it affects “source_op” argument

nn0n In case of nested or transform operations, query the source operation.

nn1n In case of transform operations, query the transform parameters.

nn2n In case of nested operations, query the nesting parameters.


Predefined variables, postblocks, and functions: page 1852

Table 6: opinfo mode selection: 100s digit

Value of “mode” Effect

n0nn Do not populate the tt_ enhanced tool table variables.

n1nn Populate the tt_ enhanced tool table variables.

Table 7: opinfo mode selection: 1000s digit

Value
of Effect
“mode”

0nnn Normal processing.

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).

How is this used?


Example
This example gets some values for a nesting application. First, it gets the value of the
clearance plane parameter (parameter number 10020) from the current and next
operations so you can compare them. Then it gets the value of parameter 41756, which
indicates if the user has selected the option to automatically use the smallest tool.
For the first parameter, the post is querying the source operations; for the second, it will
query the nested operation.
clearance : 0 # clearance height for current op
clearance_next : 0 # clearance height for next op
tool_dia_flag : 0 # use smallest tool?

p_getparams # can read parameters from any postblock


clearance = opinfo(10020, 0)
clearance_next = opinfo(10020, 1)
tool_dia_flag = opinfo(41756, 0, 20)
Predefined variables, postblocks, and functions: page 1853

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.

The general form is:


return = plcval(variable, index)
where

return numeric variable; returns 9999 if n is out-of-range.

variable the numeric or string variable to search

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.

The general form is:


value = pop(n, option, mode)
where

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

n the number of the stack to read from

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.

mode the function mode, as described below.

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

val1 = pop(stack, stack_index, 5)

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.

The general form is:


value = push(n, option, mode)
where

value the first value in an implied array whose elements comprise the record to be
added

n the number of the stack to write to

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.

mode The operating mode, as described below.

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

val1 = push(stack, stack_index, 2)

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.

The general form is:


return = rbuf(n, x)
where

return numeric variable. This represents the beginning of an array that will store the
values read from the buffer.

n the number of the buffer to read

x the number of the record to read


Predefined variables, postblocks, and functions: page 1863

remove( )
Deletes the file whose path and name are represented by s. Returns 0 if successful, -1
otherwise.

The general form is:


return = remove( s )
Predefined variables, postblocks, and functions: page 1864

rename( )
Rename file. Renames the file whose path and name are represented by s1 to s2. Returns 0 if
successful, -1 otherwise.

The general form is:


return = rename( s1, s2 )
Predefined variables, postblocks, and functions: page 1865

rot( )
Rotate a 2D vector x by angle a, and returns the rotated vector.

The general form is:


return = rot(a, v)
where

return A numeric variable which represents the first element of a two-element array.

a The rotation angle

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$).

The general form is:


return = rotp(a, x)
where

return A numeric variable which represents the first element of a three-element array.

x the vector to be rotated

a the rotation angle


Predefined variables, postblocks, and functions: page 1867

rotv( )
Rotates 3D vector. The pivot point is the origin. Requires helper variables to set rotation axis
(axisx$, axisy$, axisz$).

The general form is:


return = rotv(a, x)
where

return A numeric variable which represents the first element of a three-element array.

x the vector to be rotated

a the rotation angle


Predefined variables, postblocks, and functions: page 1868

round( )
Round value. Rounds the value of x to nearest whole number.

The general form is:


return = round(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1869

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.

The general form is:


return = rpar(s n)
where

return numeric variable that indicates the beginning of an implied array. The
variables are filled sequentially beginning with return.

s a string of parameter values. The values should be separated by spaces.

n the number of values to be read

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.

How is this used?


Example
This example uses rpar to get the aggregate head parameters from the 20008 line. There
are 9 values output with this particular line. Note that this example relies on the opinfo
function, which was introduced in Mastercam 2017.
# Numeric variables to hold '20008' agg head parameters
# Do NOT change the order of these (9) variable definitions !

hd_ax_x : 0 # Head axis in X


hd_ax_y : 0 # Head axis in Y
hd_ax_z : 0 # Head axis in Z
hd_body_typ : 0 # Head body type
hd_body_dia : 0 # Head body diameter
hd_body_len : 0 # Head body length
stat_body_typ : 0 # Station body type
stat_body_dia : 0 # Station body diameter
stat_body_len : 0 # Station body length

p_get_my_parameter # Any postblock where you need the value


sparameter$ = opinfo(20008, 0)
Predefined variables, postblocks, and functions: page 1870

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.

The general form is:


return = rparsngl(s, n)
where

return numeric variable

s a string of parameter values. The values should be separated by spaces.

n the position within the string of the value to be read.

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.

How is this used?


Example
This example uses rparsngl to get the station body length from the 20008 line
(aggregate head parameters) for both the current and previous operations. Note that this
example relies on the opinfo function, which was introduced in Mastercam 2017.
This example also gets the head number from both operations. The head number of the
current operation is available as parameter 14 on the 1016 line, which is stored in the
lstation$ predefined variable. To get the value for the previous operation, you can use
opinfo to directly query that operation’s 1016 line.
gauge_length : 0 # Station body length
gauge_length_old : 0 # Value from previous operation
lstation_old : 0 # Value from previous operation

p_get_my_parameter # Any postblock where you need the value


sparameter$ = opinfo(20008, 0)
gauge_length = rparsngl(sparameter$, 9)

sparameter$ = opinfo(20008, –1)


gauge_length_old = rparsngl(sparameter$, 9)
Predefined variables, postblocks, and functions: page 1872

sparameter$ = opinfo(1016, –1)


lstation_old = rparsngl(sparameter$, 14)
Predefined variables, postblocks, and functions: page 1873

rparsprm( )
Read a range of parameters from the current 2xxxx line, represented by the current value of
sparameter$.

The general form is:


return = rparsprm(n1, n2)
where

return numeric variable that indicates the beginning of an array

n1 the position of the first parameter to be read from sparameter$

n2 the position of the last parameter to be read from 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: 

How is this used?


Example
This example uses rparsprm to get the fourth through seventh values from the 20007
line. Using rpar, you would have needed to define seven variables to store all seven values.
Using rparsprm, you only need to define variables for just the four values that you want
to retrieve. Note that this example relies on the opinfo function, which was introduced
in Mastercam 2017.
# User-defined numeric variables
# (This creates an implied array)
tl_shoulder_length : # Shoulder length
tl_arbor_diam : # Arbor diameter
tl_holder_diam : # Holder diameter
tl_holder_length : # Holder length

p_get_my_parameter # Any postblock where you need the value


sparameter$ = opinfo(20007, 0)
tl_shoulder_length = rparsprm(4, 4)
Predefined variables, postblocks, and functions: page 1874

runvbs( )
Run VB script, where s is the path and name of the VB script to be run. Return value is always
1.

The general form is:


return = runvbs(s)
Predefined variables, postblocks, and functions: page 1875

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.

The general form is:


return = scan(s1, s2)
where

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

s1 the substring that you are searching for

s2 the main string that contains the substring and number that you hope to find.

How is this used?


Example
This example gets the bar size from a string of information about the stock.
string1 : "aluminum"
string2 : "Material: aluminum 0.625 bar"
bar_size : 0

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.

The general form is:


return = (a, b)
where

return numeric variable

a The variable whose absolute/incremental status you want to control.

b When b=1, a is incremental, otherwise a is absolute.


Predefined variables, postblocks, and functions: page 1877

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.

The general form is:


return = setncstr(mode, filename, num)
where

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.)

How is this used?


Example
This example builds a list of NC files for each stream, then specifies the editor that will be
used. Because the final parameter = 11, all four files will open at the same time, with the
Mastercam window and editor window both enabled.
Because of the final line, this example will only work in Mastercam X8 and later.
result = setncstr(2, spathnc$ + snamenc$ + "_STREAM1" +sextnc$)
result = setncstr(2, spathnc$ + snamenc$ + "_STREAM2" +sextnc$)
Predefined variables, postblocks, and functions: page 1879

result = setncstr(2, spathnc$ + snamenc$ + "_STREAM3" +sextnc$)


result = setncstr(2, spathnc$ + snamenc$ + "_STREAM4" +sextnc$)
result = setncstr(4, "C:\Program Files\MyEditor\ACME-Edit.exe", 11)
Predefined variables, postblocks, and functions: page 1880

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.

The general form is:


return = setseloffs(s, n)
where

return numeric variable

s a string select table

n offset value within the table


Predefined variables, postblocks, and functions: page 1881

setselrtn( )
Sets the value to be used as the overflow/underflow error for a string selector.

The general form is:


return = setselrtn(s, n)
where

return Returns 0 if n equals the current overflow/underflow error code, otherwise 1.

s a string select table

n new underflow/overflow value


Predefined variables, postblocks, and functions: page 1882

setselsel( )
Changes the selector variable for a string selector.

The general form is:


return = setselsel(s, var)
where

return Returns 0 if var is already the selector variable, otherwise 1.

s a string select table

var the new selector variable


Predefined variables, postblocks, and functions: page 1883

setselsiz( )
Resize string selector table to size n.

The general form is:


return = setselsiz(s, n)
where

return Returns 0 if n is equal to the current size, otherwise 1.

s a string select table

n new size for the string selector table


Predefined variables, postblocks, and functions: page 1884

setselund( )
Changes the underflow code of string selector table s (typically, from -1) to code n.

The general form is:


return = setselund(s, n)
where

return Returns 0 if n is equal to the current underflow code, otherwise 1.

s a string select table

n new underflow indicator value


Predefined variables, postblocks, and functions: page 1885

setstrval( )
Sets the value of a string s to a new value. The new value can be either a string or number
value.

The general form is:


return = setstrval(s, x)
where

return 0 if current string value is already equal to x, otherwise 1

s the string to set

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.

The general form is:


return =sin(a)
where

return numeric variable

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.

The general form is:


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.
Predefined variables, postblocks, and functions: page 1888

slout( )
Get string from index location. Given an array of strings, get the string located at a specified
offset from a base string.

The general form is:


s = slout(n, base_string)
where

s the string that is returned

base_string a string in an array

n the number places in the array to offset from base_string


Predefined variables, postblocks, and functions: page 1889

sqrt( )
Square root. Returns the square root of x.

The general form is:


return = sqrt(x)
where

return numeric variable

x number or numeric variable


Predefined variables, postblocks, and functions: page 1890

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.

The general form is:


return = streaminfo( param, source_op )
where

return a numeric variable to store the return value.

param a number that specifies the data that you are querying. See the table below for
lists of possible values.

source_op a number that identifies which operation sequence is being queried; in


other words, a value of 4 indicates the fourth operation in the sequence of
operations. The operation_seq$ variable is typically used for this purpose.

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.

Table 8: Data available with the streaminfo function

Parameter number Description of data

0 This is a special case—it returns the number


of entries in the operation list that
corresponds to parameter 97 below. The
source_op argument is ignored and can be
omitted if you use param = 0.

1 Operation ID

5 Stream ID

7 Toolpath operation code

10 (internal use)

44 Gcode from ASCII NCI tool change line

92 Validated tool change Gcode


Predefined variables, postblocks, and functions: page 1891

Parameter number Description of data

97 The sequence number of this operation


within the overall sequence of operations that
have an NCI 1000/1001/1002 line.

101 Flag indicating if this operation has a tool


change.
Predefined variables, postblocks, and functions: page 1892

strlen( )
String length. Returns the length of string s.

The general form is:


return = strlen( s )
Predefined variables, postblocks, and functions: page 1893

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.

The general form is:


return = strstr(s1, s2)
where

return a numeric variable to store the return value. If successful, the function returns
the position of s1 within s2, otherwise it returns 0.

s1 the substring that you are searching for

s2 the main string that contains the substring.


Predefined variables, postblocks, and functions: page 1894

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.

The general form is:


s = sysinfo(result, mode)
where

s a string variable that stores the user name/data.

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.

Table 9: sysinfo() function states

Mode Extended name format type Sample output

0 NameUnknown None

1 NameFullyQualifiedDN—the fully qualified CN=John Martin,


distinguished name. CN=Users,DC=ACME,DC=com

2 NameSamCompatible—legacy account name. ACME\JRM

3 NameDisplay—the name in a user-friendly format. John Martin

4 NameUniqueId—GUID string as presented by {2afe5c63-8360-4030-b704-


Windows’ IIDFromString function. 2c92e46c01cc}

5 NameCanonical—complete canonical name. ACME.COM/Users/John


Martin

6 NameUserPrincipal—the user principal name. JRM@ACME.COM


Predefined variables, postblocks, and functions: page 1895

Mode Extended name format type Sample output

7 NameCanonicalEx—this is the same as mode 5, ACME.COM/Users


except that the right-most “/” is replaced by a line feed. John Martin

8 NameServicePrincipal—the generalized form www/www.acme.com@acme.com


of the service principle name.

9 NameDnsDomain—The DNS domain name and the ACME.COM\JRM


SAM user name, separated by a backslash “\”.

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.

Getting the directory names


In addition to the sysinfo() function, MP also includes a set of predefined strings that are
automatically populated with the locations of the user’s personal folder (for example, \my
mcamx8 for Mastercam X8 users), shared folder, and the folder in which Mastercam is
installed. For example, for X8 users, these might be:
n smc_user_dir$ = C:\Users\jrm\Documents\my mcamx8\
n smc_shared_dir$ = C:\Users\jrm\Documents\shared mcamx8\
n smc_mcam_dir$ = C:\Program Files\mcamx8\

How is this used?


Example
This example gets the user name and outputs it at the beginning of the header section.
sresult : ""
result : 0

pheader$ #Call before start of file


"%", e$
sav_spc = spaces$
spaces$ = 0
*progno$, sopen_prn, sprogname$, sclose_prn, e$

sresult = sysinfo(result, 3)
sopen_prn, "Posted by: ", sresult, sclose_prn, e$

sopen_prn, "On: ", date$, ": ", time$, sclose_prn, e$


Predefined variables, postblocks, and functions: page 1896

tan( )
Tangent. Returns the tangent of angle a.

The general form is:


return = tan(a)
where

return numeric variable

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.

The general form is:


return = turn(n, mode)
where

return 1 if successful, 0 if fail

n the number of the stack to read from

mode There are two possible values:


n 0 = Move bottom item to top and shift records down.
n 1 = Move top item to bottom and shift records up.
Predefined variables, postblocks, and functions: page 1898

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.

The general form is:


return = t_list(mode, status, index)
where

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

Table 10: t_list function states

Function How ‘index’ is used: How ‘index’ is used: when


Return value
state when t_list is called t_list returns

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

Function How ‘index’ is used: How ‘index’ is used: when


Return value
state when t_list is called t_list returns

11 The number of the last Start position for search. The value of index will be
probe. set to the postion of the
probe.

12 The total number of tools Not used. Unchanged.


and probes in the tool list.

13 The total number of Not used. Unchanged.


standard (non-probe) tools
in the tool list.

14 The total number probes in Not used. Unchanged.


the tool list.

15 The index position in the tool Not used. Unchanged.


list of the tool used in the
operation that is currently
being processed from the
NCI file.

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.

Table 11: codes for “status” digits

Value of 'status' What it means

–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.

–1 Error scanning the tool list; no tool/probe was found.

0 A tool or probe number was returned successfully, but no other information.

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.

nnnn1n Only non-probing tool changes were scanned.


Predefined variables, postblocks, and functions: page 1901

Value of 'status' What it means

nnnn2n Tool changes including probing were scanned.

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.

1nnnnn The returned tool number is a probe.


Predefined variables, postblocks, and functions: page 1902

ucase( )
Upper-case: return = ucase( s ). Return is string s converted to all upper-case.

The general form is:


return = ucase( s )
Predefined variables, postblocks, and functions: page 1903

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.

The general form is:


return = uidinfo(function_state, component_ID)
where

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.

Linear and rotary axis properties available with uidinfo


The highlighted axis properties are available with the uidinfo function. Please see the
function state table in the next section to see which state to use to access each property.
Predefined variables, postblocks, and functions: page 1904
Predefined variables, postblocks, and functions: page 1905
Predefined variables, postblocks, and functions: page 1906

Function states for uidinfo

Table 12: Function states for uidinfo

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.

How is this used?


Example
This example uses the uidinfo function to query the absolute and incremental axis labels
for the X-Y-Z-C axes in the current axis combination. First, the acomboinfo function is
used to retrieve the entity IDs for all the axes. These are stored in an array beginning with
ent_id_x . Then the uidinfo function reads the axis labels for each component. If no
entity ID is actually stored in the array for that axis, a default string is assigned.
# Define array for uidinfo return values
ent_id_x : 0 # Entity ID of X-axis component
ent_id_y : 0 # Entity ID of Y-axis component
ent_id_z : 0 # Entity ID of Z-axis component
ent_id_a : 0 # Entity ID of A-axis component
ent_id_b : 0 # Entity ID of B-axis component
ent_id_c : 0 # Entity ID of C-axis component

p_getparams # can read parameters from any postblock


# Get the entity IDs for current axis combo
ent_id_x = acomboinfo(1, syncaxis$)

# Get the abs & inc labels for each axis


Predefined variables, postblocks, and functions: page 1907

# If no entity ID is stored in the array, assign default value.

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).

The general form is:


result = unforce(x, y)
where

return result of operation

x first variable in range

y second variable in range


Predefined variables, postblocks, and functions: page 1909

updgbl( )
Update global variable. Changes the definition of the global variable to the equivalent of glob_
var = var1.

The general form is:


return = updgbl(glob_var, var1)
where

return numeric variable

glob_var the global variable to be updated

var1 numeric variable


Predefined variables, postblocks, and functions: page 1910

updstr( )
Update the target variable for a string selector

The general form is:


return = updstr( s )
where

return Returns 1 if update, 0 if not updated--in other words, if there is no change in


the value of the selector variable

s a string select table


Predefined variables, postblocks, and functions: page 1911

vad( )
Vector addition (2D). Adds two 2D vectors v1 and v2.

The general form is:


return = vad(v1, v2)
where

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.

v2 The second vector


Predefined variables, postblocks, and functions: page 1912

vadd( )
Adds two 3D vectors.

The general form is:


return = vadd(v1, v2)
where

return A numeric variable which represents the first element of a three-element array.

v1 the first vector

v2 the second vector


Predefined variables, postblocks, and functions: page 1913

vaxb( )
Cross product of two unitized 3D vectors (x, y, z).

The general form is:


return = vaxb(v1, v2)
where

return A numeric variable which represents the first element of a 3D vector (three-
element array).

v1 The first vector. This is the first element of a three-element array.

v2 The second vector. This is the first element of a three-element array.


Predefined variables, postblocks, and functions: page 1914

veq( )
Vector copy (2D). Returns a copy of a 2D vector.

The general form is:


return = veq(v)
where

return A numeric variable which represents the first element of a two-element array.

v The vector to be copied, where v represents the first element of a two-element


array.
Predefined variables, postblocks, and functions: page 1915

vequ( )
Vector copy (3D). Returns a copy of a 3D vector.

The general form is:


return = vequ(v)
where

return A numeric variable which represents the first element of a three-element array.

v The vector to be copied, where v represents the first element of a three-element


array.
Predefined variables, postblocks, and functions: page 1916

vlh( )
Rotate 2D vector 90-degrees CCW (left-hand). Returns rotated vector.

The general form is:


return = vlh(v)
where

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 1917

vlin( )
Copy variable to index location. Given an array of variables, copy x to the variable located at
an offset from a base variable.

The general form is:


x = vlin(n, base_var, mode)
where

x the variable whose value is being copied

base_var a variable in an array

n the number of places in the array to offset from base_var

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$

The general form is:


var2 = vlout(n, base_var, option)
where

var2 the variable to store the retrieved value

base_var a variable in an array

n the number of places in the array to offset from base_var

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.

The general form is:


return = vmap(v, m)
where

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.

The general form is:


return = vnr(v)
where

return A numeric variable which represents the first element of a two-element array.

v The vector to be unitized, where v represents the first element of a two-element


array.
Predefined variables, postblocks, and functions: page 1921

vnrm( )
Unitizes a 3D vector; in other words, scales the vector to a length of 1. Returns the unitized
vector.

The general form is:


return = vnrm(v)
where

return A numeric variable which represents the first element of a three-element array.

v The vector to be unitized, where v represents the first element of a three-element


array.
Predefined variables, postblocks, and functions: page 1922

vrh( )
Rotate 2D vector 90-degrees CW (right-hand). Returns rotated vector.

The general form is:


return = vlh(v)
where

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 1923

vsa( )
Resize vector (2D). Scales 2D vector to length x. Returns scaled vector.

The general form is:


return = vsa(x, v)
where

return A numeric variable which represents the first element of a two-element array.

x The desired length

v The vector to be resized, where v represents the first element of a two-element


array.
Predefined variables, postblocks, and functions: page 1924

vsb( )
Vector subtraction (2D). Subtracts 2D vector v2 from vector v1.

The general form is:


return = vsb(v1, v2)
where

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.

v2 The second vector.


Predefined variables, postblocks, and functions: page 1925

vsc( )
Scale vector (2D). Multiplies 2D vector by scalar factor. Returns scaled vector.

The general form is:


return = vsc(x, v)
where

return A numeric variable which represents the first element of a two-element array.

x The scaling factor

v The vector to be scaled, where v represents the first element of a two-element


array.
Predefined variables, postblocks, and functions: page 1926

vsca( )
Scales 3D vector v to length x. Returns scaled vector.

The general form is:


return = vsca(x, v)
where

return A numeric variable which represents the first element of a three-element array.

x the scaling factor

v the vector to be scaled


Predefined variables, postblocks, and functions: page 1927

vscl( )
Scale vector. Multiplies 3D vector v by scalar factor x. Returns scaled vector.

The general form is:


return = vscl(x, v)
where

return A numeric variable which represents the first element of a three-element array.

x The scaling factor.

v The vector to be scaled, where v represents the first element of a three-element


array.
Predefined variables, postblocks, and functions: page 1928

vsub( )
Subtracts 3D vector v2 from vector v1.

The general form is:


return = vsb(v1, v2)
where

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.

v2 The second vector


Predefined variables, postblocks, and functions: page 1929

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.

The general form is:


var = wbuf(n, x)
where

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.

The general form is:


return = xaa(a, b)
Predefined variables, postblocks, and functions: page 1931

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.

The general form is:


return = xla(x, a)
Predefined variables, postblocks, and functions: page 1932

xll( )
Find intersection of two lines. Finds the intersection of two lines x1 and x2. Returns the
intersection point.

The general form is:


return = xll(x1, x2)
Predefined variables, postblocks, and functions: page 1933

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.

The general form is:


return = xor(i, j)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy