# embedding_metadata

key: chroma:document
string_value:
Within a program that performs a rotational or linear copying, the following must not be specified: 
- Command for changing the selected plane (G17 to G19) 
- Command for specifying polar coordinates 
- Reference position return command 
- Coordinate system rotation, programmable mirror image 
 The command for rotational or linear copying can be specified after a command for coordinate 
system rotation or programmable mirror image is executed. 
M
- Scaling


key: chroma:document
string_value:
M
- Scaling 
 The command for rotational or linear copying can be specified after a command for scaling image is 
executed. 
 - Modes that must not be selected 
Figure copying cannot be specified in the following modes. 
- Chamfering/Corner R 
- Tool offset 
- Tilted working plane indexing command 
- 3-dimensional coordinate system conversion 
T
- Polar coordinate interpolation 
 - Unit system 
The two axes of the plane for copying a figure must have an identical unit system.


key: chroma:document
string_value:
- Single block 
Single-block stops are not performed in a block with G72.1 or G72.2. 
 - Specifying tool radius compensation and the workpiece coordinate system 
In a subprogram for copying a figure, the G code for tool radius / tool nose radius compensation or 
compensation amount (H or D code) cannot be changed. G92 and G54 to G59 cannot be changed either. 
Those codes must be specified before figure copying is started.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 255 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- Copy axially excluding the axis direction of plane selection 
Rotational copying and Linear copying for the copy axially excluding the axis direction of plane selection 
cannot be executed. At the Rotational copying, the rotation center axis command excluding the axis 
direction of plane selection (for example, Z command in Xp-Yp plane (specified by G17)) is ignored. At


key: chroma:document
string_value:
the Linear copying, the shift along the axis excluding the axis direction of plane selection (for example, K 
command in Xp-Yp plane (specified by G17)) is ignored. 
Example 
 - Rotational copying 
Start point
Main program 
O1000 ; 
N10 G92 X40.0 Y50.0 ; 
N20 G00 G90 X_ Y_ ; (P0) 
N30 G01 G17 G41 X_ Y_ D01 F10 ; (P1) 
N40 G72.1 P2000 L3 X0 Y0 R120.0 ; 
N50 G40 G01 X_ Y_ I_ J_ ; (P0) 
N60 G00 X40.0 Y50.0 ; 
N70 M30 ; 
Sub program 
O2000 G03 X_ Y_ R30.0 ; (P2) 
N100 G01 X_ Y_ ; (P3)


key: chroma:document
string_value:
N100 G01 X_ Y_ ; (P3) 
N200 G03 X_ Y_ R10.0 ; (P4) 
N300 G01 X_ Y_ ; (P5) 
N400 G03 X_ Y_ R30.0 ; (P6) 
N500 M99; 
Y 
P3
P0
P1 X 
P6
P5
P4
P2
120°
Fig. 14.1 (b)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 256 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- Rotational copying (spot boring) 
Main program 
O3000 ; 
N10 G92 G17 X80.0 Y50.0 ; (P0) 
N20 G72.1 P4000 L6 X0 Y0 R60.0 ; 
N30 G80 G00 X80.0 Y50.0 ; (P0) 
N40 M30 ; 
Subprogram 
O4000 N100 G90 G81 X_ Y_ R_ Z_ F_ ; (P1) 
N200 M99 ; 
Y 
P1 
P0 
Start point 
60° 
X 
Fig. 14.1 (c) 
 
- Linear copying 
Main program O1000 ;
N10 G92 X-20.0 Y0 ;
N20 G00 G90 X0 Y0 ;
N30 G01 G17 G41 X20. Y0 D01 F10 ; (P0)


key: chroma:document
string_value:
N40 Y20. ; (P1)
N50 X30. ; (P2)
N60 G72.2 P2000 L3 I70.0 J0 ;
N70 X_ Y_ ; (P8)
N80 X0 ;
N90 G00 G40 X-20.0 Y0 ;
N100 M30 ;
Subprogram
O2000 G90 G01 X_ ; (P3)
N100 Y_ ; (P4)
N200 G02 X_ I_ ; (P5)
N300 G01 Y_ ; (P6)
N400 X_ ; (P7)
N500 M99 ;
Start
point
P0 P8
P1
P2
P4
P3
70 70 70
X
P5
P7
Y
P6
Fig. 14.1 (d)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 257 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Combination of rotational copying and linear copying (bolt hole circle) 
Main program 
O1000 ; 
N10 G92 G17 X100.0 Y80.0 ; (P0) 
N20 G72.1 P2000 X0 Y0 L8 R45.0 ; 
N30 G80 G00 X100.0 Y80.0 ; (P0) 
N40 M30 ; 
Subprogram (rotational copy) 
O2000 N100 G72.2 P3000 I0 J_ L3 ; 
N200 M99 ; 
Y 
X 
45° 
P1 
P0 Start point 
Subprogram (linear copy) 
O3000 N110 G90 G81 X_ Y_ R_ Z_ F_ ; (P1) 
N210 M99 ; 
Fig. 14.1 (e)


key: chroma:document
string_value:
N210 M99 ; 
Fig. 14.1 (e) 
14.2 3-DIMENSIONAL COORDINATE SYSTEM CONVERSION 
Coordinate system conversion about an axis can be carried out if the center of rotation, direction of the 
axis of rotation, and angular displacement are specified. This function is very useful in 3-dimensional 
machining by a die-sinking machine or similar machine. For example, if a program specifying machining 
on the XY plane is converted by the 3-dimensional coordinate system conversion function, the identical


key: chroma:document
string_value:
machining can be executed on a desired plane in 3-dimensional space. 
- For milling machining 
X
Y 
Z 
Z Y
X 
Three-dimensional coordinate system conversion 
Fig. 14.2 (a)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 258 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
• For lathe cutting 
X X'
Z'
Z
Surface to be
machined
B
#2 #3
#1 #4
Y
Z
Machining such as milling, pocketing, and drilling is performed.
Fig. 14.2 (b) 
Format 
M
G68 XpX1 Ypy1 Zpz1 Ii1 Jj1 Kk1 Rα ; Starting 3-dimensional coordinate system conversion
 : 
 : 
G69 ; Canceling 3-dimensional coordinate system conversion
Xp, Yp, Zp : Center of rotation (absolute coordinates) on the X, Y, and Z axis or parallel


key: chroma:document
string_value:
axes 
I, J, K : Direction of the axis of rotation 
R : Angular displacement 
T
G68.1 XpX1 Ypy1 Zpz1 Ii1 Jj1 Kk1 Rα ; Starting 3-dimensional coordinate system conversion
 : 
 : 
G69.1 ; Canceling 3-dimensional coordinate system conversion
Xp, Yp, Zp : Center of rotation (absolute coordinates) on the X, Y, and Z axis or parallel 
axes 
I, J, K : Direction of the axis of rotation 
R : Angular displacement 
NOTE 
 The G code of this function is hereinafter described using the format (G68/G69)


key: chroma:document
string_value:
for the machining center system in this section. 
3-dimensional coordinate system conversion mode
3-dimensional coordinate system conversion mode


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 259 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Explanation 
 - Command for 3-dimensional coordinate system conversion (program 
coordinate system) 
N1 G68 Xp x1 Yp y1 Zp z1 I i1 J j1 K k1 R α ; 
N2 G68 Xp x2 Yp y2 Zp z2 I i2 J j2 K k2 R β ; 
N3 
 : 
Nn G69 ; 
3-dimensional coordinate system conversion can be executed twice. 
In the N1 block, specify the center, direction of the axis of rotation, and angular displacement of the first 
rotation.


key: chroma:document
string_value:
rotation. 
When this block is executed, the center of the original coordinate system is shifted to (x1, y1, z1), then 
rotated around the vector (i1, j1, k1) by angular displacement α. The new coordinate system is called 
X'Y'Z'. In the N2 block, specify the center, direction of the axis of rotation, and angular displacement of 
the second rotation. In the N2 block, specify coordinates and the angle with the coordinate system formed


key: chroma:document
string_value:
after the N1 block in Xp, Yp, Zp, I, J, K, and R. When the N2 block is executed, the X'Y'Z' coordinate 
system is shifted to (x2, y2, z2), then rotated around the vector (i2, j2, k2) by angular displacement β. The 
newest coordinate system is called X''Y''Z''. In the subsequent N3 block, coordinates in the X''Y''Z'' 
coordinate system are specified with Xp, Yp, and Zp. The X''Y''Z'' coordinate system is called the 
program coordinate system.


key: chroma:document
string_value:
program coordinate system. 
If (Xp, Yp, Zp) is not specified in the N2 block, (Xp, Yp, Zp) in the N1 block is assumed to be the center 
of the second rotation (the N1 and N2 blocks have a common center of rotation). If the coordinate system 
is to be rotated only once, the N2 block need not be specified. 
y 
Example) G68 Xx0 Yy0 Zz0 I0 J0 K1 Rα ; 
 G68 I1 J0 K0 Rβ ; 
Z 
Y 
X 
O (x0, y0, z0) 
Z" Z' 
Y" 
Y' 
α
P (x, y, z) 
z 
β
β
X, Y, Z : Workpiece coordinate system


key: chroma:document
string_value:
X', Y', Z' : Coordinate system formed after the first conversion 
X", Y", Z" : Coordinate system formed after the second conversion 
α : Angular displacement of the first rotation 
β : Angular displacement of the second rotation 
O (x0, y0, z0) : Center of rotation 
P (x, y, z) : Coordinates in the X''Y''Z'' coordinate system (program coordinate system) 
x 
α
X' X" 
Fig. 14.2 (c)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 260 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Format error 
If one of the following format errors is detected, alarm PS5044, “G68 FORMAT ERROR” occurs: 
1. When I, J, or K is not specified in a block with G68 
2. When I, J, and K are all set to 0 in a block with G68 
3. When R is not specified in a block with G68 
 - Center of rotation 
Specify absolute coordinates with Xp, Yp, and Zp in the G68 block. 
 - Equation for 3-dimensional coordinate system conversion


key: chroma:document
string_value:
The following equation shows the general relationship between (x, y, z) in the program coordinate system 
and (X, Y, Z) in the original coordinate system (workpiece coordinate system). 
( ) 









+










=










1
1
1
1
z
y
x
z
y
x
M
Z
Y
X
When conversion is carried out twice, the relationship is expressed as follows: 
( )( ) ( ) 









+










+









key: chroma:document
string_value:


+










=










1
1
1
2
2
2
1 2 1
z
y
x
z
y
x
M
z
y
x
M M
Z
Y
X
X, Y, Z : Coordinates in the original coordinate system (workpiece coordinate system) 
x, y, z : Programmed value (coordinates in the program coordinate system) 
x1, y1, z1 : Center of rotation of the first conversion 
x2, y2, z2 : Center of rotation of the second conversion 
 (coordinates in the coordinate system formed after the first conversion)


key: chroma:document
string_value:
M1 : First conversion matrix 
M2 : Second conversion matrix 
M1 and M2 are conversion matrices determined by an angular displacement and rotation axis. Generally, 
the matrices are expressed as shown below. 












− − − + + −
− + + − − −
+ − − − − +
θ θ θ θ θ
θ θ θ θ θ
θ θ θ θ θ
(1 cos ) sin (1 cos ) sin (1 ) cos
(1 cos ) sin (1 ) cos (1 cos ) sin
(1 ) cos (1 cos ) sin (1 cos ) sin
2
3
2
1 3 2 2 3 1 3
2 3 1
2
2
2
1 2 3 2
1 2 3 1 3 2
2
1
2
1


key: chroma:document
string_value:
1 2 3 1 3 2
2
1
2
1
n n n n n n n n
n n n n n n n n
n n n n n n n n
n1 : Cosine of the angle made by the rotation axis and X-axis i/p 
n2 : Cosine of the angle made by the rotation axis and Y-axis j/p 
n3 : Cosine of the angle made by the rotation axis and Z-axis k/p 
θ : Angular displacement 
Value p is obtained by the following: 
2 2 2
p = i + j + k
Conversion matrices for rotation on two-dimensional planes are shown below: 
(1) Coordinate system conversion on the XY plane 






key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 261 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
(2) Coordinate system conversion on the YZ plane 










= −
θ θ
θ θ
0 sin cos
0 cos sin
1 0 0
M
(3) Coordinate system conversion on the ZX plane 










−
=
θ θ
θ θ
sin 0 cos
0 1 0
cos 0 sin
M
In the starting block of 3-dimensional coordinate system conversion (G68 : in machining center system,


key: chroma:document
string_value:
G68.1 : in lathe system), the coordinates(x,y,z) in the program coordinate system are generated from the 
coordinates(X,Y,Z) in the original coordinate system(workpiece coordinate system) by the inverse of the 
above conversion equation. 
The generated coordinates(x,y,z) is the starting point for following commands in the program coordinate 
system. 
 - Three basic axes and their parallel axes 
3-dimensional coordinate system conversion can be applied to a desired combination of three axes


key: chroma:document
string_value:
selected out of the basic three axes (X, Y, Z) and their parallel axes. The 3-dimensional coordinate system 
subjected to 3-dimensional coordinate system conversion is determined by axis addresses specified in the 
G68 block. If Xp, Yp, or Zp is not specified, X, Y, or Z of the basic three axes is assumed. However, if 
the basic three axes are not specified in parameter No. 1022, alarm PS0048, “BASIC 3 AXIS NOT 
FOUND” occurs.


key: chroma:document
string_value:
FOUND” occurs. 
In a single G68 block, both a basic axis and a parallel axis cannot be specified. 
If this is attempted, alarm PS0047, “ILLEGAL AXIS SELECT” occurs. 
(Example) 
 When U-axis, V-axis, and W-axis are parallel to the X-axis, Y-axis, and Z-axis respectively 
 (If in lathe system, assume that G code system B or C is used.) 
 G68 X_ I_ J_ K_ R_ ; XYZ coordinate system 
 G68 U_V_ Z_ I_ J_ K_ R_ ; UVZ coordinate system 
 G68 W_ I_ J_ K_ R_ ; XYW coordinate system


key: chroma:document
string_value:
- Specifying the second conversion 
3-dimensional coordinate system conversion can be executed twice. The center of rotation of the second 
conversion must be specified with the axis addresses specified for the first conversion. If the axis 
addresses of the second conversion are different from the axis addresses of the first conversion, the 
different axis addresses are ignored. An attempt to execute 3-dimensional coordinate system conversion


key: chroma:document
string_value:
three or more times causes alarm PS5043, “TOO MANY G68 NESTING”. 
 - Angular displacement R 
A positive angular displacement R indicates a clockwise rotation along the axis of rotation. Specify 
angular displacement R in 0.001 degrees within the range of -360000 to 360000. 
To specify angular displacement R in 0.00001 degrees (one hundred-thousandth), set bit 0 (FRD) of 
parameter No. 11630 to 1. In this case, angular displacement R is specified within the range of -36000000 
to 36000000.


key: chroma:document
string_value:
to 36000000. 
 - G codes that can be specified 
The following G codes can be specified in the 3-dimensional coordinate system conversion mode: 
G00 Positioning 
G01 Linear interpolation 
G02 Circular interpolation / Helical interpolation (clockwise)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 262 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
G03 Circular interpolation / Helical interpolation (counterclockwise) 
G04 Dwell 
G10 Data setting 
G17 Plane selection (XY) 
G18 Plane selection (ZX) 
G19 Plane selection (YZ) 
G28 Reference position return 
G29 Movement from the reference position 
G30 Second, third, or fourth reference position return 
G31 Skip function 
G53 Selecting the machine coordinate system 
G65 Custom macro call


key: chroma:document
string_value:
G65 Custom macro call 
G66 Custom macro modal call 
G67 Custom macro modal call cancel 
G40 Canceling tool radius / tool nose radius compensation 
G41 Tool radius / tool nose radius compensation to the left 
G42 Tool radius / tool nose radius compensation to the right 
G73, G74, G76, G80 to G89 Canned cycle for drilling 
M
G43 Increasing tool length compensation 
G44 Decreasing tool length compensation 
G45 Increasing the tool offset 
G46 Decreasing the tool offset


key: chroma:document
string_value:
G47 Doubling the tool offset 
G48 Halving the tool offset 
G49(G49.1)Canceling tool length compensation 
G50.1 Canceling programmable mirror image 
G51.1 Programmable mirror image 
G90 Absolute programming 
G91 Incremental programming 
G94 Feed per minute 
G95 Feed per revolution 
G98 Canned cycle (return to the initial level) 
G99 Canned cycle (return to the level of point R) 
T
G12.1 Polar coordinate interpolation 
G90 Absolute programming (when G code system B or C is used.)


key: chroma:document
string_value:
G91 Incremental programming (when G code system B or C is used.) 
G94 Feed per minute (when G code system B or C is used.) 
G95 Feed per revolution(when G code system B or C is used.) 
G98 Canned cycle (return to the initial level) (when G code system B or C is used.) 
G99 Canned cycle (return to the level of point R) (when G code system B or C is used.)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 263 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Rapid traverse in a canned cycle for drilling 
By using bit 1 (D3R) of parameter No. 11221, rapid traverse in the drilling direction in a canned cycle for 
drilling in the tilted working plane indexing mode or 3-dimensional coordinate conversion mode can be 
selected and the rapid traverse mode for shift operation in fine boring (G76) or back boring (G87) for the


key: chroma:document
string_value:
M system can also be selected. When bit 1 (D3R) of parameter No. 11221 is set to 0, the cutting feed 
mode is selected; when it is set to 1, the rapid traverse mode is selected. For positioning to the initial level 
at the start of a canned cycle for drilling, however, the rapid traverse mode is used, regardless of whether 
bit 1 (D3R) of parameter No. 11221 is set to 0 or 1. Rapid traverse override can be applied in the rapid


key: chroma:document
string_value:
traverse mode, and cutting feed override can be applied in the cutting feed mode. Bit 1 (D3R) of 
parameter No. 11221 can also be used to change the mode of rapid traverse in the rigid tapping direction. 
For acceleration/deceleration after interpolation 
 When bit 1 (D3R) of parameter No. 11221 is set to 1 (for the rapid traverse mode), rapid traverse in 
the drilling direction in a canned cycle for drilling in the tilted working plane indexing mode or


key: chroma:document
string_value:
3-dimensional coordinate conversion mode compensation mode is accelerated/decelerated along 
each axis independently according to the time constants specified in parameters Nos. 1620 and 1621. 
So, when performing positioning of linear interpolation type with bit 1 (D3R) of parameter No. 
11221 set to 1, make the following settings: 
Bit 1 of (LRP) of parameter No. 1401=1 Selects positioning of linear interpolation type.


key: chroma:document
string_value:
Bit 4 of (PRT) of parameter No. 1603=1 Selects acceleration/deceleration of constant time type. 
Parameter No. 1620 Set the same value for all. 
Parameter No. 1621 Set the same value for all. 
For look-ahead acceleration/deceleration before interpolation 
 In a canned cycle for drilling, linear rapid traverse in the drilling direction is performed at all times. 
Feedrate 
 When bit 1 (D3R) of parameter No. 11221 is set to 1 (for the rapid traverse mode), the rapid traverse


key: chroma:document
string_value:
rate in the drilling direction in a canned cycle for drilling in the tilted working plane indexing mode 
or 3-dimensional coordinate conversion mode is clamped to a parameter value indicated below if the 
rapid traverse override is 100%. In the rapid traverse override F0 mode, however, the rapid traverse 
rate is clamped to the value of parameter No. 1421 or a parameter value listed in Table 14.2 (a), 
whichever smaller. 
Table 14.2 (a) Feedrate in the rapid traverse mode


key: chroma:document
string_value:
Parameter No. 5412=0 Parameter No. 1420 
Parameter No. 5412≠0 Value of parameter No. 1420 or value of parameter No. 5412, whichever smaller 
 However, when the external deceleration function is enabled, the feedrate is clamped to a parameter 
value listed in Table 14.2 (a) that is overridden or an external deceleration speed, whichever smaller. 
NOTE 
1 Set a rapid traverse rate for each axis in parameter No. 1420 and a tangential 
rapid traverse rate in parameter No. 5412.


key: chroma:document
string_value:
2 If rapid traverse of nonlinear interpolation type is performed, the feedrate is 
clamped to the value of parameter No. 1420, regardless of the setting of 
parameter No. 5412. 
3 When the cutting feed mode is selected (when bit 1 (D3R) of parameter No. 
11221 is set to 0), set a tangential rapid traverse rate in parameter No. 5412.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 264 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Compensation functions 
M
If tool length compensation, tool radius / tool nose radius compensation, or tool offset is specified with 
3-dimensional coordinate system conversion, compensation is performed first, followed by 3-dimensional 
coordinate system conversion. 
T
If tool radius / tool nose radius compensation is specified with 3-dimensional coordinate system


key: chroma:document
string_value:
conversion, compensation is performed first, followed by 3-dimensional coordinate system conversion. 
 - Relationship between 3-dimensional and two-dimensional coordinate system 
conversion 
3-dimensional and two-dimensional coordinate system conversion use identical G codes (G68 and G69). 
A G code specified with I, J, and K is processed as the command for 3-dimensional coordinate system 
conversion. A G code not specified with I, J, and K is processed as the command for two-dimensional


key: chroma:document
string_value:
coordinate system conversion. 
 - Custom macro system variables 
Coordinates on the workpiece coordinate system are assigned to system variables #5041 to #5048 (current 
position on each axis). 
 - Reset 
If a reset occurs during 3-dimensional coordinate system conversion mode, the mode is canceled and the 
continuous-state G code is changed to G69. 
Bit 2 (D3R) of parameter No. 5400 determines whether just the G69 code is used to cancel the


key: chroma:document
string_value:
3-dimensional coordinate system conversion mode (G68). When this setting is selected, a CNC reset by a 
reset operation or by an input signal from the PMC will not cancel the 3-dimensional coordinate system 
conversion mode. 
 - Absolute position display 
The absolute coordinates based on the program or workpiece coordinate system can be displayed in the 
3-dimensional coordinate system conversion mode. Specify a desired coordinate system in bit 6 (DAK) of 
parameter No. 3106.


key: chroma:document
string_value:
parameter No. 3106. 
 - Distance to go display 
The distance to go based on the program or workpiece coordinate system can be displayed in the 
3-dimensional coordinate system conversion mode. Specify a desired coordinate system in bit 5 (D3D) of 
parameter No.19602. 
 - 3-dimensional rigid tapping 
By specifying the rigid tapping command in 3-dimensional coordinate system conversion mode, tapping 
can be executed in the direction of the angle programmed by the 3-dimensional coordinate system


key: chroma:document
string_value:
conversion command. 
In 3-dimensional coordinate system conversion mode, "Position Error Z", displayed on the spindle 
adjustment screen, is taken from the longitudinal tapping axis after 3-dimensional conversion. 
Positioning in 3-dimensional coordinate system conversion mode must be linear interpolation positioning 
(bit 1 (LRP) of parameter No.1401 is set to 1).


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 265 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - 3-dimensional coordinate system conversion during tool length compensation 
By setting bit 3 (TLC) of parameter No. 11221 to 1, 3-dimensional coordinate system conversion can be 
used during tool length compensation. In this case, the tool length compensation vector is converted to the 
program coordinate system subject to 3-dimensional coordinate system conversion. This makes


key: chroma:document
string_value:
machining possible while keeping the tool direction to the Z-axis direction of the workpiece coordinate 
system. 
Tool length compensation and 3-dimensional coordinate system conversion must be nested inside each 
other. 
(Example) 
Fig. 14.2 (d) 
- Cutting feedrate clamp 
The cutting feedrate is clamped so that the feedrate of each real axis after the 3-dimensional coordinate 
system conversion does not exceed the maximum cutting feedrate（Parameter No.1432 if look-ahead


key: chroma:document
string_value:
acceleration/deceleration before interpolation is enabled and parameter No.1430 otherwise）. 
T
 - Polar coordinate interpolation in 3-dimensional coordinate system conversion 
G12.1 in 3-dimensional coordinate system conversion selects a polar coordinate interpolation plane. The 
linear axis of polar coordinate interpolation plane is the axis of program coordinate system of 
3-dimensional coordinate system conversion. Polar coordinate interpolation is performed on this plane. 
N10 G43 H1 X_ Y_ Z_ ;


key: chroma:document
string_value:
N10 G43 H1 X_ Y_ Z_ ; 
: 
N20 G68 X0 Y0 Z0 I0.0 J1.0 K0.0 R-30.0 ; 
: 
G69 ; 
: 
G49 X_ Y_ Z_ ;
Workpiece coordinate 
system 
Z 
X 
Z’ 
X’ 
Program coordinate 
system 
N10 N20 
Tool length 
compensation vector


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 266 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Rotary axis (hypothetical axis) 
(unit: mm or inch) 
Linear axis 
(Program coordinate system of 
3-dimensional coordinate system conversion) 
(unit: mm or inch) 
Origin of the coordinate system 
(Or origin of program coordinate system of 3-dimensional
coordinate system conversion) 
Fig. 14.2 (e) Polar coordinate interpolation plane 
- Interlock signal for each axis direction, interlock signal for each axis, external


key: chroma:document
string_value:
deceleration signal 
When bit 2 (D3IT) of parameter No.11600 is set to 1 and bit 5 (ITM) of parameter No.11223 is set to 1, 
the following signals are enabled for axis of machine coordinate system. 
- Interlock signal for each axis direction during manual intervention / manual handle interrupt in 
3-dimensional coordinate system conversion mode 
- Interlock signal for each axis during manual intervention / manual handle interrupt in 3-dimensional 
coordinate system conversion mode


key: chroma:document
string_value:
- External deceleration signal during manual intervention / manual handle interrupt in 3-dimensional 
coordinate system conversion mode 
- External deceleration signal during 3-dimensional coordinate conversion 
By this setting, all signals of controlled axis type are enabled for axis of machine coordinate system 
during 3-dimensional coordinate conversion. 
Table14.2 (b) Relationship between coordinate system of target axis of each signal during 3-dimensional


key: chroma:document
string_value:
coordinate conversion (automatic operation) and parameter setting 
D3IT ITM Interlock for each axis 
direction Interlock for each axis External deceleration 
0 - Programming coordinate 
system Interlock all X, Y, Z-axis Programming coordinate 
system 
1 0 Machine coordinate system Machine coordinate system Programming coordinate 
system 
1 Machine coordinate system Machine coordinate system Machine coordinate system


key: chroma:document
string_value:
Table14.2 (c) Relationship between coordinate system of target axis of each signal during manual 
intervention / manual handle interrupt in 3-dimensional coordinate system conversion mode and parameter 
setting 
D3IT ITM Interlock for each axis 
direction Interlock for each axis External deceleration 
0 - Programming coordinate 
system 
Programming coordinate 
system 
Programming coordinate 
system 
1 0 Programming coordinate 
system 
Programming coordinate 
system 
Programming coordinate


key: chroma:document
string_value:
Programming coordinate 
system 
1 Machine coordinate system Machine coordinate system Machine coordinate system


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 267 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Limitation 
 - Manual intervention 
3-dimensional coordinate system conversion does not affect the degree of manual intervention or manual 
handle interrupt. 
 - Positioning in the machine coordinate system 
3-dimensional coordinate system conversion does not affect positioning in the machine coordinate system 
(e.g. specified with G28, G30, or G53). 
 - Specifying rapid traverse


key: chroma:document
string_value:
- Specifying rapid traverse 
Specify linear rapid traverse when 3-dimensional coordinate system conversion is executed. (Set bit 1 
(LRP) of parameter No.1401 to 1.) 
 - Block with G68 or G69 
In a block with G68 or G69, other G codes must not be specified. G68 must be specified with I, J, and K. 
 - Position display and compensation 
To display the absolute position when 3-dimensional coordinate system conversion is executed, set bits 4 
to 7 (DRL, DRC, DAL, and DAC) of parameters No. 3104 to 0.


key: chroma:document
string_value:
- Positioning by optimum accelerations 
The function for positioning by optimum accelerations is disabled during the 3-dimensional coordinate 
system conversion mode. 
 - Mirror image 
M
Programmable mirror image can be specified, but external mirror image (mirror image by the mirror 
image signal or setting) cannot be specified. 3-dimensional coordinate system conversion is carried out 
after the programmable mirror image function is executed. 
T


key: chroma:document
string_value:
T
External mirror image (mirror image by the mirror image signal or setting) cannot be specified. 
 - 3-dimensional coordinate system conversion and other modal commands 
M
Canned cycles, G41, G42, or G51.1 must be nested between G68 and G69. 
(Example) 
G68 X100.0 Y100.0 Z100.0 I0.0 J0.0 K1. R45.0 ; 
 : 
G41 D01 ; 
 : 
G40 ; 
 : 
G69 ;


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 268 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
T
Canned cycles, G41 or G42 must be nested between G68.1 and G69.1. 
(Example) 
G68.1 X100.0 Y100.0 Z100.0 I0.0 J0.0 K1.0R45.0 ; 
 : 
G41 X_ Z_ I_ K_ ; 
 : 
G40 ; 
 : 
G69.1 ; 
T
 - Relationship between 3-dimensional coordinate system conversion and tool 
offset 
When using a tool offset command, nest the tool offset command within the 3-dimensional coordinate 
system conversion mode. 
(Example)


key: chroma:document
string_value:
(Example) 
G68.1 X100.0 Y100.0 Z100.0 I0.0 J0.0 K1.0 R45.0 ; 
 : 
T0101; 
 : 
T0100; 
 : 
G69.1 ; 
When tool geometry and wear compensation with coordinate shift is enabled and it is not canceled by 
reset, if tool geometry and wear compensation is executed in 3-dimensional coordinate system conversion 
mode, 3-dimensional coordinate system conversion is not canceled by reset. (Even if it is a setting that


key: chroma:document
string_value:
3-dimensional coordinate system conversion is canceled by reset (bit 2 (D3R) of parameter No. 5400 is 
set to 0), it is not canceled.) 
 - PMC axis control 
In the 3-dimensional coordinate system conversion mode, PMC axis control cannot be performed for the 
three axes related to the conversion (alarm PS5131). 
 - Manual operation 
When manual feeding is performed during a 3-dimensional coordinate system conversion, the tangent


key: chroma:document
string_value:
velocity in the coordinate system after conversion (program coordinate system) equals the lowest feedrate 
of those on the selected axes. 
 - Workpiece coordinate system 
Avoid changing the workpiece coordinate system in the 3-dimensional coordinate system conversion 
mode. 
 - Manual reference position return 
If manual reference position return is performed in the 3-dimensional coordinate system conversion mode,


key: chroma:document
string_value:
alarm PS5324 occurs. If you want to perform manual reference position return, cancel the 3-dimensional 
coordinate system conversion mode in advance.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 269 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Cs contour axis 
When specifying the Cs contour axis and rapid traverse at the same time in the 3-dimensional coordinate 
system conversion mode, make a reference position return on the Cs contour axis in advance. If a 
reference position return is made in the first rapid traverse after the Cs contour axis is selected (bit 1


key: chroma:document
string_value:
(NRF) of parameter No.3700 is set to 0), avoid specifying the reference position return command in the 
3-dimensional coordinate system conversion mode. 
Example 
N1 G90 X0 Y0 Z0 ; Carries out positioning to zero point H. 
N2 G68 X10.0 Y0 Z0 I0 J1 K0 R30.0 ; Forms new coordinate system X'Y'Z'. 
N3 G68 X0 Y-10.0 Z0 I0 J0 K1 R-90.0 ; Forms other coordinate system X''Y''Z''. 
The origin agrees with (0, -10, 0) in coordinate system 
X'Y'Z.


key: chroma:document
string_value:
X'Y'Z. 
N4 G90 X0 Y0 Z0 ; Carries out positioning to zero point H'' on coordinate 
system X''Y''Z''. 
N5 X10. Y10. Z0 ; Carries out positioning to (10, 10, 0) on coordinate system 
X''Y''Z''. 
Y Y'
H
Z
N4
H'
X'
Y"
N5
Z"
Z'
H"
(10, 10, 0)
10
-10
30°
30°
X"
-90°
Fig. 14.2 (f)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 270 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3 TILTED WORKING PLANE INDEXING 
14.3.1 Tilted Working Plane Indexing 
Overview 
Programming for creating holes, pockets, and other figures in a datum plane tilted with respect to the 
workpiece would be easy if commands can be specified in a coordinate system fixed to this plane (called 
a feature coordinate system). This function enables commands to be specified in the feature coordinate


key: chroma:document
string_value:
system. The feature coordinate system is defined in the workpiece coordinate system. 
For explanations about the relationship between the feature coordinate system and workpiece coordinate 
system, see Fig. 14.3.1 (a). 
Feature coordinate
system
(G68.2)
Machine coordinate system
Workpiece
coordinate system
(G54)
Fig. 14.3.1 (a) Feature coordinate system 
The G68.2 command causes the programming coordinate system to switch to the feature coordinate


key: chroma:document
string_value:
system. The commands in all subsequent blocks are assumed to be specified in the feature coordinate 
system until G69 appears. 
If G68.2 specifies the relationship between the feature coordinate system and the workpiece coordinate 
system, G53.1 automatically specifies the +Z direction of the feature coordinate system as the tool axis 
direction even if no angle is specified for the rotary axis. (See Fig. 14.3.1 (c).) 
For explanations about the tool axis direction, see Fig. 14.3.1 (b). 
X
Y
Z


key: chroma:document
string_value:
X
Y
Z
The tool axis direction is the
+Z-axis direction.
The tool axis direction is the
+Y-axis direction.
The tool axis direction is the +X-axis direction.
Fig. 14.3.1 (b) Tool axis direction


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 271 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
This function regards the direction normal to the machining plane as the +Z-axis direction of the feature 
coordinate system. After the G53.1 command, the tool is controlled so that it remains perpendicular to the 
machining plane. 
Coordinate system 
origin shift 
(xo,yo,zo)
Xc 
Yc 
Zc 
Workpiece 
coordinate system 
X-Y-Z 
Feature coordinate 
system 
Xc-Yc-Zc
X 
Y 
Z 
• Only G68.2 is specified


key: chroma:document
string_value:
Z 
• Only G68.2 is specified 
• G53.1 is specified after G68.2 
Xc 
Yc 
Zc 
Control point shift (by 
another command)
G53.1 automatically controls 
the rotary axis.
X 
Y 
Z B 
C 
Feature coordinate 
system 
Xc-Yc-Zc
Coordinate system 
origin shift 
(xo,yo,zo)
Workpiece 
coordinate system 
X-Y-Z 
Fig. 14.3.1 (c) G68.2 and G53.1 commands 
This function is applicable to the following machine configurations. (See Fig. 14.3.1 (d).)


key: chroma:document
string_value:
<1> Tool rotation type machine controlled with two tool rotation axes 
<2> Table rotation type machine controlled with two table rotation axes 
<3> Composite type machine controlled with one tool rotation axis and one rotary axis


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 272 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
The function can also be used for a machine configuration in which the rotary axis for controlling the tool 
does not intersect the rotary axis for controlling the table. 
<2> Table rotation type 
machine
<3> Composite type 
machine
<1> Tool rotation 
type machine 
X
C
B
Z
Y
A
C
X
Z
Y
B
Y
X
Z
C
Fig. 14.3.1 (d) Three types of 5-axis machine


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 273 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.1.1 Tilted working plane indexing based on Eulerian angle 
Format 
 - Tilted working plane indexing (G68.2) 
M
G68.2 X x0 Y y0 Z z0 Iα Jβ Kγ ; Tilted working plane indexing
G69 ; Cancels the tilted working plane indexing.
X,Y,Z: Feature coordinate system origin 
 The axes specified here are the three axes of the feature coordinate system.


key: chroma:document
string_value:
Specify the three basic axes or parallel axes set by parameter No. 1022. When 
specification is omitted, the X, Y, and Z of the basic three axes are assumed to 
be 0. 
I,J,K: Euler's angle for determining the orientation of the feature coordinate system
T
G68.2 X x0 Y y0 Z z0 Iα Jβ Kγ ; Tilted working plane indexing
G69.1 ; Cancels the tilted working plane indexing.
X,Y,Z: Feature coordinate system origin 
 The axes specified here are the three axes of the feature coordinate system.


key: chroma:document
string_value:
Specify the three basic axes or parallel axes set by parameter No. 1022. When 
specification is omitted, the X, Y, and Z of the basic three axes are assumed to 
be 0. 
I,J,K: Euler's angle for determining the orientation of the feature coordinate system
 - Tool axis direction control (G53.1) 
G53.1 ; Controls the tool axis direction.
 CAUTION 
1 G53.1 must be specified in a block after the block that contains G68.2. 
 An alarm occurs if G53.1 is specified without G68.2 being specified in a


key: chroma:document
string_value:
preceding block. 
2 G53.1 must be specified in a block in which there is no other command. 
3 The rotary axis moves at the maximum rapid traverse federate in the case of 
rapid traverse and at the specified federate in the case of cutting feed. 
Explanation 
 - Coordinate conversion using an Euler's angle 
Coordinate conversion by rotation is assumed to be performed around the workpiece coordinate system 
origin.


key: chroma:document
string_value:
origin. 
Let the coordinate system obtained by rotating the workpiece coordinate system around the Z-axis by an 
angle of α degrees be coordinate system 1. Similarly, let the coordinate system obtained by rotating 
coordinate system 1 around the X’-axis by an angle of β be coordinate system 2. The feature coordinate 
system is the coordinate system obtained by shifting the coordinate system that is obtained by rotating


key: chroma:document
string_value:
coordinate system 2 around the Z”-axis through an angle of γ degrees from the workpiece coordinate 
system origin by (Xo, Yo, Zo). 
Fig. 14.3.1.1 shows the relationship between the workpiece coordinate system and the feature coordinate 
system. 
The figure also gives examples of displacement on the X-Y plane.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 274 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
γ
zc 
yc 
xc 
x' 
y'' 
γ
Conversion from workpiece 
coordinate system X-Y-Z to 
coordinate system 1 X'-Y'-Z 
x 
z 
y 
x' 
y' 
α
β
X' 
z y'' 
z'' 
y' β Conversion from coordinate 
system 1 X'-Y'-Z to 
coordinate system 2 X'-Y"-Z"
Conversion from coordinate system 2 
X'-Y"-Z" to feature coordinate system 
Xc-Yc-Zc
Fig. 14.3.1.1 Coordinate conversion using an Euler's angle 
 - I0 J0 K0 command


key: chroma:document
string_value:
- I0 J0 K0 command 
When I0 J0 K0 is specified as an Euler's angle, the alarm PS5457, “G68.2 FORMAT ERROR” usually 
occurs. When bit 1 (ATW) of parameter No. 13451 is set to 1, the feature coordinate system with a tilted 
angle of 0 degree is used. 
14.3.1.2 General specifications of the tilted working plane indexing 
 - Constant surface speed control 
Constant surface speed control is exercised by using, as the reference, the machine axis specified in


key: chroma:document
string_value:
address P in a G96 block or the machine axis (not in the feature coordinate system but in the actually 
operating workpiece coordinate system) set in parameter No. 3770. 
 - Workpiece coordinate system selection command during the tilted working 
plane indexing 
By executing the workpiece coordinate system selection command (G54 to G59, G54.1) during the tilted 
working plane indexing when bit 6 (3TW) of parameter No. 1205 is 1, it is possible to change the


key: chroma:document
string_value:
workpiece coordinate system. In this case, the coordinate system zero point shift of the tilted working 
plane indexing is maintained. 
If an attempt is made to execute the workpiece coordinate system selection command (G54 to G59, 
G54.1) during the tilted working plane indexing when bit 6 (3TW) of parameter No. 1205 is 0, alarm 
PS5462, ”ILLEGAL COMMAND(G68.2/G69)” is issued.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 275 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Program coordinate system 
Machine coordinate system 
G54 
G55 
Program coordinate 
system 
Fig. 14.3.1.2 (a) 
- Minimum command unit of rotation angles 
The minimum command unit of the rotation angles (I, J, K, and R) of the tilted working plane indexing is 
0.001 degree regardless of the increment system. By setting bit 2 (TFR) of parameter No. 11630 to 1, the


key: chroma:document
string_value:
minimum command unit of the rotation angles can be set to 0.00001 degree. 
- System variables of skip positions during the tilted working plane indexing 
System variable number and coordinate system of skip are as Table14.3.1.2 (a). The coordinate system of 
#100105- and #151001- changes according to bit 5 (LV3) of parameter No.5400. 
Table14.3.1.2 (a) Parameter LV3 and coordinate system of skip positions 
System variable 
number 
Coordinate system of skip positions


key: chroma:document
string_value:
Parameter LV3=0 Parameter LV3=1 
#100151 - Workpiece coordinate system Feature coordinate system 
#151001 - Feature coordinate system Workpiece coordinate system 
#151101 - Machine coordinate system 
Moreover, skip positions of tool tip position can be read by setting bit 4 (MSV) of parameter No. 6019 for 
machining center system or bit 4 (TSV) of parameter No. 6021 for lathe system. 
When parameter MSV or TSV is set to 0, system variable includes tool length compensation offset


key: chroma:document
string_value:
(control point position). 
When parameter MSV or TSV is set to 1, system variable does not include tool length compensation 
offset (tool tip position).


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 276 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Example (When bit 4 (MSV) of parameter No.6019 is set to 1.) 
Machine coordinate system 
#151101-
Workpiece coordinate system 
#100151-(LV3=0) 
#151001-(LV3=1) 
Feature coordinate 
system 
#151001-(LV3=0) 
#100151-(LV3=1) 
Example (When bit 4 (MSV) of parameter No.6019 is set to 0.) 
Machine coordinate system 
#151101-
Workpiece coordinate system 
#100151-(LV3=0) 
#151001-(LV3=1) 
Feature coordinate 
system


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 277 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- System variables of the feature coordinate system information 
By using custom macro variables #151151 to #151165, the feature coordinate system information can be 
read. 
Feature coordinate system 
Machine coordinate system 
#151154 
#151155 
#151156 
Origin position as seen from the 
machine coordinate system
Xf 
Yf 
Zf 
#151151 
#151152 
#151153 
#151157 
#151158 
#151159 
#151160 
#151161 
#151162


key: chroma:document
string_value:
#151160 
#151161 
#151162 
#151163 
#151164 
#151165 
Z-axis vector 
Y-axis vector
X-axis vector 
Workpiece coordinate system 
Origin position as seen from the 
workpiece coordinate system
System variable 
number 
System 
variable name Attribute Description 
 #151151 to 
#151165 
 [#_FCOORD [n]] R The feature coordinate system information during the tilted 
working plane indexing. 
Note) Subscript n represents a compensation number (1 to 15).


key: chroma:document
string_value:
R is attribute of a variable and indicates read-only. 
Details of each variable are as follows. 
System 
variable 
number 
System 
variable name Description 
#151151 [#_FCOORD [1]] Origin position X as seen from the machine coordinate system 
#151152 [#_FCOORD [2]] Origin position Y as seen from the machine coordinate system 
#151153 [#_FCOORD [3]] Origin position Z as seen from the machine coordinate system 
#151154 [#_FCOORD [4]] Origin position X as seen from the workpiece coordinate system


key: chroma:document
string_value:
#151155 [#_FCOORD [5]] Origin position Y as seen from the workpiece coordinate system 
#151156 [#_FCOORD [6]] Origin position Z as seen from the workpiece coordinate system 
#151157 [#_FCOORD [7]] X of X-axis vector as seen from the machine/workpiece coordinate system 
#151158 [#_FCOORD [8]] Y of X-axis vector as seen from the machine/workpiece coordinate system 
#151159 [#_FCOORD [9]] Z of X-axis vector as seen from the machine/workpiece coordinate system


key: chroma:document
string_value:
#151160 [#_FCOORD [10]] X of Y-axis vector as seen from the machine/workpiece coordinate system 
#151161 [#_FCOORD [11]] Y of Y-axis vector as seen from the machine/workpiece coordinate system 
#151162 [#_FCOORD [12]] Z of Y-axis vector as seen from the machine/workpiece coordinate system 
#151163 [#_FCOORD [13]] X of Z-axis vector as seen from the machine/workpiece coordinate system 
#151164 [#_FCOORD [14]] Y of Z-axis vector as seen from the machine/workpiece coordinate system


key: chroma:document
string_value:
#151165 [#_FCOORD [15]] Z of Z-axis vector as seen from the machine/workpiece coordinate system 
When it is not in the tilted working plane indexing mode, all variables are set to 0.0.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 278 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
The length of the each axis vector on the feature coordinate system (#151157 to #151165) is 1. The vector 
variable is displayed by 9-digits in the decimal part 
Example) Execute the block N20:O1234 of the following NC program. 
O1234 ; 
N10 G54 X0.0 Y0.0 Z0.0 ; 
N20 G68.2 X5.0 Y10.0 Z15.0 I30.0 J0.0 K0.0; 
Set the workpiece coordinate system 
(G54: X=100.0 Y=200.0 Z=300.0) 
Specifying the tilted working plane


key: chroma:document
string_value:
indexing. 
The feature coordinate system made in N20 is the workpiece coordinate system that shifted X5.0 Y10.0 
Z15.0 in parallel and rotated around the Z-axis by angle of 30 degree. The value of each system variable 
at this time is as follows. 
System 
variable 
number 
Value 
System 
variable 
number 
Value 
System 
variable 
number 
Value 
System 
variable 
number 
Value 
System 
variable 
number 
Value 
#151151 105.0 #151154 5.0 #151157 0.866025404 #151160 -0.5 #151163 0.0


key: chroma:document
string_value:
#151152 210.0 #151155 10.0 #151158 0.5 #151161 0.866025404 #151164 0.0 
#151153 315.0 #151156 15.0 #151159 0.0 #151162 0.0 #151165 1.0 
- Minimum command unit of the rotation angles 
The minimum command unit for the rotation angles (I, J, K, R) of the tilted working plane indexing is 
0.001 degree regardless of the setting unit. When bit 2 (TFR) of parameter No.11630 is set to 1, the 
minimum command unit for the rotation angles is 0.00001 degree. 
- Cutting feedrate clamp


key: chroma:document
string_value:
- Cutting feedrate clamp 
The cutting feedrate is clamped so that the feedrate of each real axis after the conversion by the tilted 
working plane indexing does not exceed the maximum cutting feedrate（Parameter No.1432 if look-ahead 
acceleration/deceleration before interpolation is enabled and parameter No.1430 otherwise). 
- Local Coordinate System 
The local coordinate system is available to the feature coordinate system during the tilted working plane 
indexing.


key: chroma:document
string_value:
indexing. 
X,Y,Z commands of the local coordinate system defines a local coordinate system that the feature 
coordinate system is translated in X,Y,Z direction. 
Alarm PS5462 occurs when the tilted working plane indexing is specified on the condition that the offset 
of the local coordinate system is not zero, 
Reference position 
Machine coordinate system origin (Machine coordinate system) 
(G54: Workpiece coordinate system) 
IP_ (Local coordinate system) 
(Feature coordinate system)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 279 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- Absolute position display 
The absolute coordinates based on the program or workpiece coordinate system can be displayed during 
the tilted working plane indexing. Specify a desired coordinate system in bit 6 (DAK) of parameter No. 
3106. 
- Distance to go display 
The distance to go based on the program or workpiece coordinate system can be displayed during the


key: chroma:document
string_value:
tilted working plane indexing. Specify a desired coordinate system in bit 5 (D3D) of parameter No.19602. 
14.3.1.3 Tilted working plane indexing based on roll-pitch-yaw 
Overview 
With the tilted working plane indexing, coordinate system conversion by rotation about the X-axis, 
Y-axis, and Z-axis of a workpiece coordinate system in this order can be used (roll-pitch-yaw). 
The order of rotary axes can be specified using address Q. 
X 
Y 
Z Xc 
Zc 
Yc 
(1) 
(2) 
(3) 
Fig. 14.3.1.3 (a)


key: chroma:document
string_value:
(2) 
(3) 
Fig. 14.3.1.3 (a) 
Format 
Format
G68.2 P1 Qq X_ Y_ Z_ Iα Jβ Kγ; Tilted working plane indexing
G69 ; Cancel tilted working plane indexing (M series).
G69.1; Cancel tilted working plane indexing (T series).
Explanation of symbols 
Q: Order in which axes are rotated 
X_ Y_ Z_: Origin of a feature coordinate system 
I: Angle of rotation about the X-axis (roll angle) 
J: Angle of rotation about the Y-axis (pitch angle) 
K: Angle of rotation about the Z-axis (yaw angle)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 280 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Table 14.3.1.3 (a) 
 First rotation axis Second rotation axis Third rotation axis 
Q 123 X axis Y axis Z axis 
Q 132 X axis Z axis Y axis 
Q 213 Y axis X axis Z axis 
Q 231 Y axis Z axis X axis 
Q 312 Z axis X axis Y axis 
Q 321 Z axis Y axis X axis 
 CAUTION 
1 When address Q is omitted, the X-axis, Y-axis, and Z-axis are rotated in this 
order. (equivalent to Q123)


key: chroma:document
string_value:
order. (equivalent to Q123) 
2 When address Q is set to a value other than the above, alarm PS5457, 
“G68.2/G68.3 FORMAT ERROR” is issued. 
Explanation 
Suppose that the coordinate system is rotated about (1) the X-axis, (2) the Y-axis, and (3) the Z-axis in 
this order. 
A "workpiece coordinate system" rotated by angle α about the X-axis is "coordinate system 1". 
"Coordinate system 1" rotated by angle β about the Y-axis is "coordinate system 2". "Coordinate system


key: chroma:document
string_value:
2" rotated by angle γ about the Z-axis then shifted by (X0,Y0,Z0) from the workpiece coordinate system 
origin is a "feature coordinate system". 
Conversion from the workpiece 
coordinate system X-Y-Z to 
coordinate system 1 X’-Y’-Z’ 
x 
z 
y 
y’ 
z’ 
α
α
x 
z 
y 
y’ 
z’ 
x’’ 
z’’ 
y’’ 
β
β
β
γ
x 
z 
y 
x’’ 
z’’ 
y’’ 
γ
γ
xc 
yc 
zc 
Conversion from coordinate system 
1 X’-Y’-Z’ to coordinate system 2 
X"-Y"-Z" 
Conversion from coordinate system 2


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 281 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Example 
The example of a program when feature coordinate system like the figure below is used is shown below. 
X
Y 
Z 
30°
Xc 
Zc 
Yc 
Workpiece coordinate system X-Y-Z 
Feature coordinate system 
Xc-Yc-Zc 
200.0 
50.0 
Fig. 14.3.1.3 (c) 
- Feature coordinate system origin : (200.0, 0, 50.0) 
- Order in which axes are rotated : X axis → Y axis → Z axis 
- Angle of rotation about the X-axis : 30 degrees


key: chroma:document
string_value:
- Angle of rotation about the Y-axis : 0 degree 
- Angle of rotation about the Z-axis : 90 degrees 
Example of a program 
G68.2 P1 Q123 X200.0 Y0 Z50.0 I30.0 J0 K90.0 ; 
G53.1 ; 
 : 
14.3.1.4 Tilted working plane indexing based on three points 
Overview 
With the tilted working plane indexing, a tilted working plane can be specified by specifying three points 
in a feature coordinate system. 
X 
Y
Z 
P3 
P1 P2 
Xc 
Zc 
Yc 
Fig. 14.3.1.4 (a)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 282 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Format 
Format
G68.2 P2 Q0 X x0 Y y0 Z z0 Rα ; 
G68.2 P2 Q1 X x1 Y y1 Z z1 ; 
G68.2 P2 Q2 X x2 Y y2 Z z2 ; 
G68.2 P2 Q3 X x3 Y y3 Z z3 ; Tilted working plane indexing 
G69 ; Cancel tilted working plane indexing (M series). 
G69.1; Cancel tilted working plane indexing (T series). 
Explanation of symbols 
Q0 X x0 Y y0 Z z0 : Amount of shift from the first point to the origin of a feature coordinate 
system


key: chroma:document
string_value:
system 
 By default, this value is 0. 
Q1 X x1 Y y1 Z z1 : First point. (origin of a feature coordinate system) 
Q2 X x2 Y y2 Z z2 : Second point. 
Q3 X x3 Y y3 Z z3 : Third point. 
R : Angle of rotation about the Z-axis of a feature coordinate system 
 By default, this value is 0. 
 Any block in the G68.2 P2 command can be specified. 
Coordinate system origin shift 
Xc 
Yc Zc 
Workpiece 
coordinate system 
X-Y-Z 
Feature coordinate system Xc-Yc-Zc 
X
Y 
Z 
α
P1 
P3 
P2


key: chroma:document
string_value:
X
Y 
Z 
α
P1 
P3 
P2 
Fig. 14.3.1.4 (b) 
 CAUTION 
1 Three G68.2P2 commands (Q1, Q2, and Q3) determine a tilted plane. If the 
G68.2P2 commands are interrupted, alarm PS5457, "G68.2/G68.3 FORMAT 
ERROR" is issued. 
2 When any of the following conditions is met or address Q is set to a value other 
than the above, alarm PS5457 is issued. 
(1) When two or more points are duplicate (the plane is not determined.) 
(2) When three points are placed on a line (the plane is not determined.)


key: chroma:document
string_value:
(3) When the distance between a line passing two of the three points and the 
remaining point is smaller than the setting of parameter No. 11220 (the plane 
is unstable.)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 283 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Explanation 
 - Determination of a feature coordinate system 
Three entered points are named P1, P2, and P3 in the order of entry. 
The P1-to-P2 direction is defined as the X-axis of a feature coordinate system. Among the directions that 
are on the plane containing the three points and are normal to the X-axis of the feature coordinate system,


key: chroma:document
string_value:
the direction that makes a smaller angle with the P1→P3 vector is defined as the Y-axis of the feature 
coordinate system. The Z-axis of the feature coordinate system is defined according to the right-handed 
system. 
Feature coordinate 
system 
Xc－Yc－Zc 
Y 
X 
P1 
P3 
P2 
Xc 
Yc 
(Yc1) 
Zc 
Z 
Workpiece 
coordinate system 
X－Y－Z 
β
α
Yc2 
On the plane containing three points, there are two directions normal to 
Xc: Yc1 and Yc2. Angles α and β formed relative to the P1→P3 vector


key: chroma:document
string_value:
satisfy α < β, so that Yc1 is selected as Yc. 
Fig. 14.3.1.4 (c) 
 - Origin of the feature coordinate system 
The origin of the feature coordinate system is the first specified point P1. 
By setting an origin shift amount (G68.2 P2 Q0 X_Y_Z_), the origin of the feature coordinate system is 
shifted by (X,Y,Z) from P1. Specify (X,Y,Z) in the feature coordinate system. 
 - Angular displacement R


key: chroma:document
string_value:
- Angular displacement R 
The angular displacement R is positive for clockwise rotation viewed in the Z-axis direction in the feature 
coordinate system.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 284 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Example 
The example of a program when feature coordinate system like the figure below is used is shown below. 
X
Y 
Z 
30°
Xc 
Zc 
Yc 
Workpiece coordinate system X-Y-Z 
Feature coordinate system Xc-Yc-Zc 
200.0 
50.0 First point 
Second point 
Third point 
Fig. 14.3.1.4 (d) 
- First point (origin of a feature coordinate system) : (200.0, 0, 50.0) 
- Second point : (200.0, 100.0, 50.0)


key: chroma:document
string_value:
- Third point : (26.795, 0, 150.0) 
Example of a program 
G68.2 P2 Q1 X200.0 Y0 Z50.0 ; 
G68.2 P2 Q2 X200.0 Y100.0 Z50.0 ; 
G68.2 P2 Q3 X26.795 Y0 Z150.0 ; 
G53.1 ; 
 . . .


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 285 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.1.5 Tilted working plane indexing based on two vectors 
Overview 
With the tilted working plane indexing, a tilted working plane can be specified by specifying an X-axis 
direction vector and a Z-axis direction vector in the feature coordinate system. 
X 
Y 
Z 
Xc 
Zc 
Yc 
V1 
V2 
Fig. 14.3.1.5 (a) 
Format 
Format 
G68.2 P3 Q1 X_ Y_ Z_ Iα1 Jβ1 Kγ1 ; 
G68.2 P3 Q2 Iα2 Jβ2 Kγ2 ; Tilted working plane indexing


key: chroma:document
string_value:
G69 ; Cancel tilted working plane indexing (M series). 
G69.1; Cancel tilted working plane indexing (T series). 
Explanation of symbols
X_ Y_ Z_ : Origin of a feature coordinate system (specifiable in the Q1 block) 
Q1 Iα1 Jβ1 Kγ1 : Feature coordinate system X-axis direction relative to the workpiece 
coordinate system (first vector) 
Q2 Iα2 Jβ2 Kγ2 : Feature coordinate system Z-axis direction relative to the workpiece 
coordinate system (second vector) 
 CAUTION


key: chroma:document
string_value:
CAUTION 
1 The two G68.2P3 commands (Q1 and Q2) determine a tilted plane. The 
G68.2P3 commands are interrupted, alarm PS5457, “G68.2/G68.3 FORMAT 
ERROR” is issued. 
2 If the angle between the two vectors is 5 degrees or more off the 90 degrees, 
alarm PS5457 is issued. 
3 If (I, J, K) is set to a 0 vector, alarm PS5457 is issued.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 286 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Explanation 
 - Determination of a feature coordinate system 
The first vector is defined as the X-axis of the feature coordinate system, and the second vector is defined 
as the Z-axis of the feature coordinate system. The Y-axis of the feature coordinate system is defined 
according to the right-handed system. 
Xc 
Zc 
Yc (Yc1) 
V1 
V2 
Yc2 
There are two vectors normal to the Xc-axis and Zc-axis.


key: chroma:document
string_value:
However, Yc1 is defined as the Yc-axis of the feature 
coordinate system according to the right-handed system. 
Fig. 14.3.1.5 (b) 
 - When the first and second vectors are not normal 
When the first vector and second vector are not normal, the orthographical vector from the second vector 
to plane P normal to the first vector is defined as the Z-axis of the feature coordinate system. 
Xc (first vector) 
Zc Second vector
Plane P normal to the first vector 2
5(Of2- f“f-f+2o).2


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 287 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Example 
The example of a program when feature coordinate system like the figure below is used is shown below. 
X
Y 
Z 
30°
Xc 
Zc 
Yc 
Workpiece coordinate system X-Y-Z 
Feature coordinate system 
Xc-Yc-Zc 
200.0 
50.0 
First vector 
Second vector 
Fig. 14.3.1.5 (d) 
Origin of a feature coordinate system : (200.0, 0, 50.0) 
X-axis direction of a feature coordinate system (First vector) : (0, 1.0, 0)


key: chroma:document
string_value:
Z-axis direction of a feature coordinate system (Second vector) : (100.0, 0, 173.205) 
Example of a program 
G68.2 P3 Q1 X200.0 Y0 Z50.0 I0 J1.0 K0 ; 
G68.2 P3 Q2 I100.0 J0 K173.205 ; 
G53.1 ; 
 . . .


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 288 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.1.6 Tilted working plane indexing based on projection angles 
Overview 
With the tilted working plane indexing, a tilted working plane can be specified based on projection 
angles. 
A plane determined by vector A and vector B produced by rotating the X-axis vector and Y-axis vector of 
the workpiece coordinate system is defined to be a tilted working plane. 
Y X 
β -α
γ
Xc 
Yc 
B A 
Fig. 14.3.1.6 (a) 
Format


key: chroma:document
string_value:
Fig. 14.3.1.6 (a) 
Format 
Format 
G68.2 P4 X_ Y_ Z_ Iα Jβ Kγ; Tilted working plane indexing 
G69 ; Cancel tilted working plane indexing (M series). 
G69.1; Cancel tilted working plane indexing (T series). 
Explanation of symbols 
X_ Y_ Z_ : Origin of a feature coordinate system 
α : Angle by which the X-axis vector is rotated about the Y-axis of the workpiece 
coordinate system 
β : Angle by which the Y-axis vector is rotated about the X-axis of the workpiece 
coordinate system


key: chroma:document
string_value:
coordinate system 
γ : Angle of rotation about the Z-axis of the feature coordinate system 
Explanation 
 - Determination of a feature coordinate system 
The X-axis direction vector of the workpiece coordinate system rotated by α about the Y-axis of the 
workpiece coordinate system is defined as vector A. The Y-axis direction vector of the workpiece 
coordinate system rotated by β about the X-axis of the workpiece coordinate system is defined to be 
vector B.


key: chroma:document
string_value:
vector B. 
The direction normal to plane P containing vector A and vector B (direction of the outer product of A ×
B) is defined to be the Z-axis direction of the feature coordinate system. 
Vector A rotated by γ about the Z-axis of the feature coordinate system is defined to be the X-axis 
direction of the feature coordinate system. The Y-axis of the feature coordinate system is defined 
according to the right-handed system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 289 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
X
Y 
Z 
-α β
A 
B 
Zc 
Plane P 
Fig. 14.3.1.6 (b) 
By the third command angle α and second command angle β, the Z-axis of the feature coordinate system 
are determined. 
X
Y 
Z 
A 
B 
Yc 
γ
Plane P
Zc 
Xc 
Fig. 14.3.1.6 (c) 
By the third command angle γ, the X-axis and Y-axis of the feature coordinate system are determined. 
 CAUTION


key: chroma:document
string_value:
CAUTION 
When vector A and vector B are considered to be parallel with each other (when 
the angle formed by the two vectors is smaller than 1°), alarm PS5457, 
“G68.2/G68.3 FORMAT ERROR” is issued.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 290 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Example 
The example of a program when feature coordinate system like the figure below is used is shown below. 
X
Y 
Z 
30°
Xc 
Zc 
Yc 
Workpiece coordinate system X-Y-Z 
Feature coordinate system Xc-Yc-Zc 
200.0 
50.0 
A 
B 
Fig. 14.3.1.6 (d) 
- Origin of a feature coordinate system : (200.0, 0, 50.0) 
- Angle by which the X-axis vector is rotated about the Y-axis of the workpiece coordinate system


key: chroma:document
string_value:
: 30 degrees 
- Angle by which the Y-axis vector is rotated about the X-axis of the workpiece coordinate system 
 : 0 degree 
- Angle of rotation about the Z-axis of the feature coordinate system 
 : 90 degrees 
Example of a program 
G68.2 P4 X200.0 Y0 Z50.0 I30.0 J0 K90.0 ; 
G53.1 ; 
 :


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 291 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.1.7 Tilted working plane indexing by tool axis direction
Overview 
By specifying G68.3, a coordinate system (feature coordinate system) where the tool axis direction is the 
+Z-axis direction can be automatically specified. When a feature coordinate system is used, a program for 
cutting a hole or pocket in a plane tilted relative to the workpiece coordinate system can be made simpler.


key: chroma:document
string_value:
This function can automatically generate a feature coordinate system that is normal to the tool direction. 
Feature coordinate system (G68.3) 
Machine coordinate system 
Workpiece coordinate system (G54) 
Yc 
Zc 
Xc 
Fig. 14.3.1.7 (a) Feature coordinate system 
When G68.3 is specified in a block, the coordinate system for programming is changed to a feature 
coordinate system. All commands after the block are regarded as commands in the feature coordinate 
system until G69 is specified.


key: chroma:document
string_value:
Format 
Format
G68.3 X x0 Y y0 Z z0 Rα ; Tilted working plane indexing 
G68.3 P1 X x0 Y y0 Z z0 ; Tilted working plane indexing 
G69 ; Cancel tilted working plane indexing (M series). 
G69.1; Cancel tilted working plane indexing (T series). 
Explanation of symbols 
X,Y,Z : Origin of a feature coordinate system (absolute) 
 By default, the current position is used as the origin of the feature coordinate 
system. 
R : Angular displacement about the Z-axis in the feature coordinate system.


key: chroma:document
string_value:
The default is 0°. 
P1 : The feature coordinate system is defined corresponding to tool rotation axis 
position.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 292 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Coordinate system 
origin shift (xo,yo,zo) 
Workpiece 
coordinate 
system X-Y-Z 
Feature coordinate 
system Xc-Yc-Zc 
α
X 
Y 
Z 
Zc 
Yc 
Xc 
Fig.14.3.1.7 (b) G68.3 command 
Explanation 
 - Feature coordinate system 
By specifying G68.3, a feature coordinate system with the tool axis direction being the +Z-axis direction


key: chroma:document
string_value:
can be created. The tool axis direction means the tool axis direction based on the rotation axis position 
reached by automatic operation or manual operation. 
 - Origin of a feature coordinate system 
The origin of a feature coordinate system must be specified using an absolute command. 
Even in the incremental command mode, the specified origin is regarded as an absolute position. 
When 1 address or 2 addresses are omitted in X, Y, Z, alarm PS5457, "G68.2/G68.3 FORMAT ERROR" 
is issued.


key: chroma:document
string_value:
is issued. 
When the origin of a feature coordinate system is not specified, the position when G68.3 is specified is 
used as the origin. 
 - Determination of a feature coordinate system 
Determination of a feature coordinate system depends on whether P1 command is present. 
(1) When G68.3 block does not include P1 command (G68.3) 
When G68.3 is specified, the tool axis direction vector (T

) represents the +Z direction ( Zc
 ) of the 
feature coordinate system.


key: chroma:document
string_value:
feature coordinate system. 
The vector normal to a plane formed by the +Z direction ( Zc
 ) of the feature coordinate system and the 
vertical axis direction vector ( P

) (parameter No. 12321) represents the +X direction ( Xc
 ) of the feature 
coordinate system. 
Expression: Xc P Zc    = ×
The vector normal to the +Z direction ( Zc
 ) of the feature coordinate system and the +X direction ( Xc
 ) 
of the feature coordinate system represents the +Y direction (Yc



key: chroma:document
string_value:

) of the feature coordinate system. 
Expression: Yc Zc Xc    = ×
When R is commanded, a coordinate system rotated by R around Zc from the above-mentioned 
coordinate system is the feature coordinate system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 293 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
X-axis of feature coordinate 
system 
 Y-axis of feature 
 coordinate system 
Vertical axis direction: P 
Z-axis of feature coordinate 
system (Tool axis direction: 
T) 
Xc Yc 
Zc 
Fig.14.3.1.7 (c) Determination of a feature coordinate system 
When the tool axis direction vector (T

) is parallel with the vertical axis direction vector ( P

) (parameter 
No. 12321) (when the angle between the vector (T



key: chroma:document
string_value:

) and the vector ( P

) is equal to or less than the value 
of parameter No. 12322), the feature coordinate system Xc-Yc-Zc is as indicated below. By specifying 
angular displacement R, a feature coordinate system rotated about the Z-axis of this coordinate system 
can be specified. 
Table 14.3.1 (a) 
Parameter 
No. 12321 
Z-axis of feature coordinate 
system 
Zc 
X-axis of feature coordinate 
system 
Xc 
Y-axis of feature coordinate 
system 
Yc


key: chroma:document
string_value:
system 
Yc 
1 +X direction +Y direction +Z direction 
2 +Y direction +Z direction +X direction 
3 +Z direction +X direction +Y direction 
When 0 is set in parameter No. 12321, the vertical axis direction is the reference tool axis direction 
(parameter No. 19697). 
If a value other than 0 through 3 is set in parameter No. 12321, alarm PS5459, “MACHINE 
PARAMETER INCORRECT” is issued. 
 CAUTION 
 Tool axis direction is Z-axis direction of feature coordinate system regardless of


key: chroma:document
string_value:
the reference tool axis direction (parameter No. 19697). 
 - Angular displacement R 
Angular displacement R is positive when a rotation is made clockwise viewed in the Z-axis direction of 
the feature coordinate system. The range of angular displacement R is: 0.0° ≤ R ≤ 360.0°. 
(2) When G68.3 block includes P1 command (G68.3 P1) 
"G68.3 P1" command defines the feature coordinate system corresponding to tool rotation axis position.


key: chroma:document
string_value:
The direction of the feature coordinate system is the direction of reference coordinate system rotated by 
tool rotation axes.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 294 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
M
The direction of this feature coordinate system is the same as the direction of tool axis direction feed / 
tool axis right-angle direction feed of 3-dimensional manual feed when the parameter FLL (No.12320#1) 
is set to zero. 
The reference coordinate system of feature coordinate system (the feature coordinate system that is


key: chroma:document
string_value:
defined when absolute coordinate system of tool rotation axes is zero) is as follows by the parameter 
(No.19697) for reference tool axis direction. 
The feature coordinate system defined by "G68.3 P1" command is the coordinate system that the 
reference coordinate system is rotated by tool rotation axis position and parameter RA (No.19698), RB 
(No.19699). 
Reference tool axis direction : 
Z-axis direction
Parameter (No.19697)=3
Xw 
Yw 
Zw 
XF YF
ZF
Xw 
Yw 
Zw 
ZF XF
YF
Xw 
Yw 
Zw


key: chroma:document
string_value:
Zw 
ZF XF
YF
Xw 
Yw 
Zw 
YF
ZF
XF
Reference tool axis direction : 
X-axis direction
Parameter (No.19697)=1
Reference tool axis direction : 
Y-axis direction
Parameter (No.19697)=2
Fig.14.3.1.7 (d) The reference coordinate system of feature coordinate system (G68.3 P1)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 295 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
C B 
Z 
Y 
X 
B C 
X,Y direction of 
feature coordinate system Z direction of 
feature coordinate system 
Fig.14.3.1.7 (e) Example that reference tool axis direction is Z direction 
 - Machine of table rotation type 
On a machine of table rotation type, the tool direction remains unchanged. So, a feature coordinate system


key: chroma:document
string_value:
based on the reference tool axis direction (parameter No. 19697) is set. However, the origin specification 
of the feature coordinate system and angular displacement R about the Z-axis are valid. 
Workpiece coordinate system X-Y-Z 
Example: When reference tool axis direction represents +Z-axis 
direction (with 3 set in parameter No. 19697) 
Feature coordinate system 
Xc-Yc-Zc 
X 
Y 
Z 
Xc 
Yc 
Zc 
Fig.14.3.1.7 (f) 
Tool rotation axis : C=45deg, B=20deg. 
C B
Z
Y
X
B
C Y
X
Z
B
C


key: chroma:document
string_value:
Z
Y
X
B
C Y
X
Z
B
C
Tool rotation axis : C=45deg, B=0deg. 
Z
Y
X
C
C
Z direction of 
Feature coordinate system 
Y direction of 
Feature coordinate system 
X direction of 
Feature coordinate system 
Y direction of 
Feature coordinate system 
Z direction of 
Feature coordinate system 
X direction of 
Feature coordinate system


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 296 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- G53.1 / G53.6 command in G68.3 mode 
When G53.1 or G53.6 command is executed in G68.3 mode, alarm PS5458, ”ILLEGAL USE OF 
G53.1/G53.6” occurs. 
 - Use in combination with tool length compensation 
The G68.3 command can be specified even during tool length compensation. 
 - Example of operation 
An example of operation on a machine of tool rotation type is given below.


key: chroma:document
string_value:
The machine configuration is "BC type reference tool axis Z-axis". 
B: 2nd rotation axis (slave)
C: 1st rotation axis (master)
Control point 
Tool holder offset value 
 = Parameter No. 19666 
Tool length offset = H01
BC type tool axis Z-axis 
(Axes are intersecting.) 
Tool center point 
Fig.14.3.1.7 (g) 
Sample program 1 
O0100 ; 
N1 G55 ; 
N2 G90 G01 X0Y0Z50.0 F1000 ; 
N3 G43 H01 X0 Y0 Z0 ; 
N4 B-45.0 ; 
N5 G68.3 ; 
: 
N6 G69 ; 
:


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 297 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Xc 
Yc 
Zc 
X
Y 
Z 
X
Y 
Z 
X
Y 
Z 
Machine operation by sample program 1 
N3 command 
N6 command 
N5 command 
N4 command 
Workpiece coorditate system 
X-Y-Z 
Workpiece coordinate system 
X-Y-Z 
Feature coordinate system Xc-Yc-Zc 
Fig.14.3.1.7 (h) 
N3 block: Performs tool length compensation in the workpiece coordinate system.


key: chroma:document
string_value:
The tool center point moves to the origin of the workpiece coordinate system. 
N4 block: Tilts the tool. 
N5 block: Sets a feature coordinate system where the tool axis direction is the Z-axis direction and the 
tool center point is placed at the origin. 
N6 block: Cancels the feature coordinate system to return to the workpiece coordinate system.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 298 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Sample program 2 
O0100 ; 
N1 G54 G90 G00 B0 C0 ; 
N2 B45.0 ; 
N3 C60.0 ; 
N4 G68.3 P1 X0 Y0 Z0 ; 
Fig.14.3.1.7 (i) 
N2 block: Tilts the tool. (B45 deg) 
N3 block: Tilts the tool. (C60 deg) 
N4 block: The direction of the reference coordinate system of feature coordinate system is the direction 
 of workpiece coordinate system because the reference tool axis direction is Z direction. The


key: chroma:document
string_value:
feature coordinate system is the coordinate system that the reference coordinate system is 
 rotated by 45 deg. around Y direction and 60 deg. around Z direction. 
XF : The direction that X direction of workpiece coordinate system is rotated by 60 deg. around Z 
direction after by 45 deg. around Y direction of workpiece coordinate system. 
YF : The direction that Y direction of workpiece coordinate system is rotated by 60 deg. round Z direction 
of workpiece coordinate system.


key: chroma:document
string_value:
ZF : The direction that Z direction of workpiece coordinate system is rotated by 60 deg. around Z 
direction after by 45 deg. around Y direction of workpiece coordinate system. 
 - Multiple G68.3 
After the tool axis direction is changed in G68.3 mode, by specifying G68.3, a new feature coordinate 
system where the tool axis direction is the +Z-axis direction can be specified. 
ZF
N2 command 
X
Y 
Z 
Sample program2 
X
Y 
Z 
X
Y 
Z 
XF
YF
B45.0 
C60.0 
C60°
B45°
C60°
N3 command


key: chroma:document
string_value:
C60°
B45°
C60°
N3 command 
N4 command 
Feature coordinate system XF-YF-ZF 
Workpiece coordinate 
system X-Y-Z 
Workpiece coordinate 
system X-Y-Z


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 299 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 Example of operation 
An example of operation on a machine of tool rotation type is given below. 
The machine configuration is "AC type reference tool axis Z-axis". 
A: 2nd rotation axis (slave)
C: 1st rotation axis (master)
Control point 
Tool holder offset value 
 = Parameter No. 19666 
Tool length offset = H01
AC type tool axis Z-axis 
(Axes are intersecting.) 
Tool center point 
Fig.14.3.1.7 (j)


key: chroma:document
string_value:
Fig.14.3.1.7 (j) 
Sample program 2 
O0200 ; 
N1 G55 ; 
N2 G01 A90.0 F1000 ; 
N3 G68.3 X0 Y0 Z0 R0; 
: 
N4 X10.0 Y0 Z0 ; 
N5 C90.0; 
N6 G68.3 X10.0 Y0 Z0 ; 
: 
N7 G69 ; 
:


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 300 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
N3 command 
N4 command 
N6 command 
N5 command 
X 
Y 
Z 
Machine operation by sample program 2 
Xc 
Yc 
Zc 
Xc 
Yc 
Zc 
Feature coordinate system Xc-Yc-Zc 
X 
Y 
Z 
Xc 
Yc 
Zc 
X 
Y 
Z 
Xc 
Yc 
Zc 
X 
Y 
Z 
Fig.14.3.1.7 (k) 
N3 block: Sets a feature coordinate system according to the tool direction. 
N4 block: Specifies coordinates in the feature coordinate system.


key: chroma:document
string_value:
N5 block: Changes the tool direction. 
N6 block: Sets a feature coordinate system according to the tool direction.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 301 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.2 Multiple Command of Tilted Working Plane Indexing 
14.3.2.1 Absolute multiple command 
By additionally specifying G68.2 in the tilted working plane indexing mode, a feature coordinate system 
produced by additionally applying coordinate system conversion to the workpiece coordinate system can 
be set. The workpiece coordinate system is resumed by specifying G69.


key: chroma:document
string_value:
This function is enabled by setting bit 0 (MTW) of parameter No. 11221. 
Format 
The format of the tilted working plane indexing (G68.2) is applicable. 
Specify the origin of a feature coordinate system in the workpiece coordinate system. 
NOTE 
 Before specifying G68.2, cancel tool length compensation and tool radius 
compensation. If G68.2 is specified during tool length compensation or tool 
radius compensation, alarm PS5462, “ILLEGAL COMMAND (G68.2/G69)” is 
issued. 
Example of operation


key: chroma:document
string_value:
Example of operation 
An example of operation on a tool rotation type machine is explained below. 
The machine configuration is "BC type with the reference tool axis being the Z-axis". 
B: 2nd rotation axis (slave)
C: 1st rotation axis (master)
Control point 
Tool holder offset value 
 = Parameter No. 19666 
Tool length offset = H01
Machine on which tool rotary 
axes cross each other 
Tool center point 
Fig. 14.3.2.1 (a) 
Sample program 2 
O0100 ; 
N1 G55 ;


key: chroma:document
string_value:
O0100 ; 
N1 G55 ; 
N2 G90 G01 X20.0 Y5.0 Z0 F1000 ; 
N3 G68.2 X20.0 Y5.0 Z0 I0 J90.0 K0 ; 
N4 G53.1 ; 
 : 
N5 X-15.0 Y0 Z-15.0 ; 
N6 G68.2 X5.0 Y20.0 Z0 I90.0 J90.0 K0 ; 
N7 G53.1; 
 : 
N8 G69 ; 
 :


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 302 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
N6 command 
X
Y 
Z 
N4 command 
Machine operation by sample program 1 
N7 command 
N5 command 
X
Y 
Z 
X
Y 
Z 
Xc Yc 
Zc 
X
Y 
Z 
Feature coordinate system 
Xc-Yc-Zc 
Feature coordinate system 
Xc-Yc-Zc 
Xc 
Yc 
Zc 
Xc 
Yc 
Zc 
Xc 
Yc 
Zc 
G55 
Machine 
origin 
Fig. 14.3.2.1 (b) 
N4 block: Rotates the tool in the Z-axis direction in the feature coordinate system.


key: chroma:document
string_value:
N5 block: Specifies coordinates in the feature coordinate system. 
N6 block: Sets a new feature coordinate system. 
N7 block: Rotates the tool in the Z-axis direction in the new feature coordinate system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 303 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.2.2 Incremental multiple command 
By specifying G68.4, coordinate system conversion can be applied to the currently set feature coordinate 
system. 
This function is enabled by setting bit 0 (MTW) of parameter No. 11221. 
Format 
The format of the tilted working plane indexing (G68.2) is applicable. 
Specify the origin of a feature coordinate system in the immediately preceding feature coordinate system.


key: chroma:document
string_value:
Table 14.3.2.2 (a) 
Specification method Incremental multiple command 
Eulerian angle G68.4 
Roll-pitch-yaw G68.4 P1 
Three points G68.4 P2 
Two vectors G68.4 P3 
Projection angles G68.4 P4 
NOTE 
 Before specifying G68.4, cancel tool radius compensation. If G68.4 is specified 
during tool radius compensation, alarm PS5462, “ILLEGAL COMMAND 
(G68.2/G69)” is issued. 
Example of operation 
An example of operation on a tool rotation type machine is explained below.


key: chroma:document
string_value:
Rotary axis C rotates about the Z-axis (master axis). 
Rotary axis B rotates about the Y-axis (slave axis). 
B: 2nd rotation axis (slave)
C: 1st rotation axis (master)
Control point 
Tool holder offset value 
 = Parameter No. 19666 
Tool length offset = H01
BC type tool axis Z-axis 
(Axes are intersecting.) 
Tool center point 
Fig. 14.3.2.2 (a) 
Sample program 3 
O0200 ; 
N1 G55 ; 
N2 G90 G01 X20.0 Y5.0 Z0 F1000 ; 
N3 G68.2 X20.0 Y5.0 Z0 I0 J90.0 K0 ; 
N4 G53.1 ; 
 :


key: chroma:document
string_value:
N4 G53.1 ; 
 : 
N5 X-15.0 Y0 Z-15.0 ; 
N6 G68.4 X-15.0 Y0 Z-15.0 I90.0 J90.0 K-90.0 ; 
N7 G53.1; 
 : 
N8 G69 ; 
 :


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 304 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
N6 command 
X
Y 
Z 
N4 command 
Machine operation by sample program 2 
N7 command 
N5 command 
Xc1 
Yc1 
Zc1 
X
Y 
Z 
X
Y 
Z 
Xc2 Yc2 
Zc2 
X
Y 
Z 
Feature coordinate system 
Xc1-Yc1-Zc1 
Feature coordinate system 
Xc2-Yc2-Zc2 
Xc1 
Yc1 
Zc1 
Xc2 
Yc2 
Zc2 
Xc1 
Yc1 
Zc1 
Xc1 
Yc1 
Zc1 
Fig. 14.3.2.2 (b) 
N4 block: Rotates the tool in the Z-axis direction in the feature coordinate system.


key: chroma:document
string_value:
N5 block: Specifies coordinates in the feature coordinate system. 
N6 block: Applies coordinate system conversion to the feature coordinate system based on Eulerian 
angle to set a new feature coordinate system. 
N7 block: Rotates the tool in the Z-axis direction in the new feature coordinate system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 305 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.3 Tool Axis Direction Control 
14.3.3.1 Tool axis direction control 
G53.1 automatically specifies the +Z direction of the feature coordinate system as the tool axis direction. 
Example of operation 
The following gives an operation example in the machine configuration below. 
- Table rotation type 
- Master axis: About the Y-axis (B axis) 
- Slave axis: About the Z-axis (C axis)


key: chroma:document
string_value:
- Reference tool axis direction: Z direction 
- Increment system for the rotation axis: 1/10(IS-C) 
Program example 1 
 G68.2 I90.0 J0.0005 K-90.0 (rotation by 0.0005 degree about the Y-axis) 
 G53.1 
 The rotation axis position after the G53.1 command is as follows: 
- Bit 2 (TFR) of parameter No. 11630 is set to 0 (minimum command unit of the rotation angles: 
0.001 degree): 
B axis: 0.0010 degree 
C axis: 0.0000 degree


key: chroma:document
string_value:
C axis: 0.0000 degree 
- Bit 2 (TFR) of parameter No. 11630 is set to 1 (minimum command unit of the rotation angles: 
0.00001 degree): 
B axis: 0.0005 degree 
C axis: 0.0000 degree 
Program example 2 
 G68.2 I90.0 J10 K-90.0 (rotation by (minimum command unit of the rotation angles × 10) about the 
Y-axis) 
 G53.1 
 The rotation axis position after the G53.1 command is as follows: 
- Bit 2 (TFR) of parameter No. 11630 is set to 0 (minimum command unit of the rotation angles: 
0.001 degree):


key: chroma:document
string_value:
0.001 degree): 
B axis: 0.0100 degree 
C axis: 0.0000 degree 
- Bit 2 (TFR) of parameter No. 11630 is set to 1 (minimum command unit of the rotation angles: 
0.00001 degree): 
B axis: 0.0001 degree 
C axis: 0.0000 degree 
 - Tool rotation type machine 
The following paragraphs describe several cases of the tool rotation type machine operation.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 306 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Operation description 1: 
 When G43 (tool length compensation) is specified for a machine with its axes 
crossing one another 
The G53.1 command, when specified after the G68.2 command, automatically controls the rotary axis in 
such a way that the tool axis will be oriented in the +Z direction of the feature coordinate system. 
Example) 
O100 (Sample Program1) ; 
N1 G55 ; 
N2 G90 G01 X0 Y0 Z30.0 F1000 ;


key: chroma:document
string_value:
N3 G68.2 X100.0 Y100.0 Z50.0 I30.0 J15.0 K20.0 ; 
N4 G01 X0 Y0 Z30.0 F1000 ; 
N5 G53.1 ; 
N6 G43 H01 X0 Y0 Z0 ; 
N7 . . .
In this example, the "BC type tool axis Z-axis" is used as the machine configuration. 
In addition, the tool axis, tool rotation axis B, and tool rotation axis C cross one another. 
B : Second rotation axis (slave) 
C : First rotation axis (master) 
Control 
point
Tool holder offset value = 
Parameter No.19666 
Tool length offset = H01
BC type tool axis Z-axis


key: chroma:document
string_value:
BC type tool axis Z-axis 
(with the axes crossing 
one another) 
Tool center point
Fig. 14.3.3.1 (a) 
Block N3 : Defines a feature coordinate system in the workpiece coordinate system. 
Block N4 : Shifts the control point to point Z30.0 in the feature coordinate system.
Block N5 : Exerts automatic control over the rotary axes. 
Block N6 : Performs tool length compensation in the feature coordinate system. 
 The tool center point is shifted to the origin of the feature coordinate system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 307 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Fig. 14.3.3.1 (b) shows the behavior of the machine when it runs sample program 1. 
N3 command 
Feature coordinate 
system 
Xc-Yc-Zc 
Xc 
Zc Yc 
• Sample program 1 (with axes crossing one another) 
Xc 
Yc 
Zc 
Xc 
Yc 
Zc 
Xc 
Yc 
Zc 
N4 command
N5 command
N6 command
Workpiece 
coordinate 
system 
X-Y-Z 
X
Y 
Z 
Control 
point 
Fig. 14.3.3.1 (b) Tool axis direction control 1


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 308 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Operation description 2: 
 When G43 (tool length compensation) is specified for a machine with no axis 
crossing 
Here is the case where no axis of the machine crosses any other axis. 
It is assumed that sample program 1 is used. 
In this example, the "BC type tool axis Z-axis" is used as the machine configuration. 
It is assumed, however, that the tool axis does not cross the B-axis while the B-axis and C-axis cross each


key: chroma:document
string_value:
other. 
C: First rotation axis (master)
Control 
point
Tool holder offset value = 
Parameter No.19666
Tool length offset = H01
• BC type tool axis Z-axis
(no axis crossing)
Tool center 
point 
B: Second rotation axis (slave)
Intersection offset vector 
between tool axis and 
B-axis = Parameters 
No.19709 - No.19711 
Fig. 14.3.3.1 (c) 
Block N4 : Shifts the control point to point Z30.0 in the feature coordinate system. 
Block N5 : Exerts automatic control over the rotary axes.


key: chroma:document
string_value:
Block N6 : An intersection offset vector between the tool axis and the B-axis with automatic control 
for rotary axes taken into consideration is output in the feature coordinate system. 
 Performs tool length compensation in the feature coordinate system. 
 The tool center point is shifted to the origin of the feature coordinate system. 
This is also true when the B-axis does not cross the C-axis. 
For explanations about the offset to be applied when the B-axis does not cross the C-axis, see the


key: chroma:document
string_value:
descriptions about parameters No.19712, No.19713, and No.19714. 
Fig. 14.3.3.1 (d) shows the behavior of the machine when it runs sample program 1.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 309 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
N3 command
• Sample program 1 (no axis crossing)
N4 command
N5 command
N6 command
Workpiece
coordinate system
X-Y-Z X
Y
Z
Control
point
Xc
Yc
Zc
Zc
Feature coordinate
system
Xc-Yc-Zc
Xc
Yc
Xc
Yc
Zc
Xc
Yc
Zc
An intersection offset vector
between the tool axis and the Baxis with automatic control for
rotation axes taken into
consideration is output in the
feature coordinate system. Tool


key: chroma:document
string_value:
length compensation is also
performed.
The tool center point is controlled
so that it returns to the Xc-Yc-Zc
origin.
Xc
Yc
Zc
Zc 30.0
Zc 30.0
Fig. 14.3.3.1 (d) Tool axis direction control 2


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 310 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Operation description 3: 
 When no G43 (tool length compensation) command is specified or if no G53.1 
(tool axis direction control) command is specified 
Sample program 2 of O200 is equivalent to sample program 1 except that sample program 2 has no tool 
length compensation command (G43). 
Example) 
O200 (Sample Program2) ; 
N1 G55 ; 
N2 G90 G01 X0 Y0 Z30.0 F1000 ; 
N3 G68.2 X100.0 Y100.0 Z50.0 I30.0 J15.0 K20.0 ;


key: chroma:document
string_value:
N4 G01 X0 Y0 Z0 F1000 ; 
N5 G53.1 ; 
N6 . . . ;
In this example, the "BC type tool axis Z-axis" is used as the machine configuration. 
The case in which the axes cross one another and the case in which no axis crosses any other axis are 
described. 
Fig. 14.3.3.1 (e) shows the behavior of the machine when it runs sample program 2. 
Sample program 3 of O300 is equivalent to sample program 1 except that sample program 3 has no tool 
axis direction control command (G53.1). 
Example)


key: chroma:document
string_value:
Example) 
O300 (Sample Program3) ; 
N1 G55 ; 
N2 G90 G01 X0 Y0 Z30.0 F1000 ; 
N3 G68.2 X100.0 Y100.0 Z50.0 I30.0 J15.0 K20.0 ; 
N4 G01 X0 Y0 Z0 F1000 ; 
N5 G43 H01 ; 
N6 . . . ;
In this example, the "BC type tool axis Z-axis" is used as the machine configuration. 
The case in which the axes cross one another and the case in which no axis crosses any other axis are 
described. 
Tool length compensation is applied in the +Z-axis direction of the feature coordinate system.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 311 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Feature coordinate 
system 
Xc-Yc-Zc 
N4 command 
Xc 
Zc Yc 
• Sample program 2 (with axes crossing one another)
Yc 
N5 command 
Workpiece 
coordinate system 
X-Y-Z 
X
Y 
Z 
Control 
point 
Xc 
Zc 
N4 command 
Feature coordinate 
system 
Xc-Yc-Zc 
Xc 
Yc Zc 
• Sample program 2 (no axis crossing) 
N5 command 
Workpiece 
coordinate system 
X-Y-Z 
X
Y 
Z 
Control 
point 
Xc 
Zc Yc


key: chroma:document
string_value:
Control 
point 
Xc 
Zc Yc 
Fig. 14.3.3.1 (e) When the tool length compensation command is not specified


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 312 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
N4 command 
Feature coordinate 
system 
Xc-Yc-Zc 
Xc 
Zc Yc 
• Sample program 3 (with axes crossing one another) 
N5 command 
Workpiece 
coordinate system 
X-Y-Z 
X
Y 
Z 
Control 
point 
Xc 
Zc Yc 
Z N4 command 
Feature coordinate 
system 
Xc-Yc-Zc 
Xc 
Zc Yc 
• Sample program 3 (no axis crossing) 
N5 command 
Workpiece 
coordinate system 
X-Y-Z X
Y 
Control 
point 
Xc 
Zc Yc


key: chroma:document
string_value:
Control 
point 
Xc 
Zc Yc 
Fig. 14.3.3.1 (f) When the tool axis direction control command is not specified


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 313 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Composite type machine 
 Basic operation 
This function is also available for a composite type machine in which the tool head rotates on the tool 
rotation axis and the table rotates on the table rotation axis. 
The feature coordinate system Xc-Yc-Zc is set in the workpiece coordinate system based on the 
coordinate system origin shift (xo, yo, zo) and the Euler's angle.


key: chroma:document
string_value:
Given the A-axis and B-axis shown in Fig. 14.3.3.1 (g), control is performed in such a way that the 
A-axis rotates until Zc comes in the X-Z plane and the B-axis is controlled so that the tool axis is oriented 
toward the +Z-axis direction of the feature coordinate system. 
X
Y
Z
A
X
Y
Z
A
(xo, yo, zo)
Xc
Yc
Zc 
Xc'
Yc'
Zc'
• Tool axis direction control for a composite type machine 
B
Fig. 14.3.3.1 (g) Composite type machine


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 314 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Feature coordinate system with the table rotated by G53.1 (tool axis direction 
control) 
The composite type machine shown in Fig. 14.3.3.1 (g) is explained as an example. 
If the table rotates by the tool axis direction control command (G53.1), the feature coordinate system 
(called the first feature coordinate system), which is set in the workpiece coordinate system by the tilted


key: chroma:document
string_value:
working plane indexing (G68.2), rotates as much as the table rotates. 
The feature coordinate system that has rotated is called the second feature coordinate system. 
Once G53.1 is specified, the subsequent machining commands are assumed to be specified in the second 
feature coordinate system. (See Fig. 14.3.3.1 (h).) 
In the composite type machine, the specified feature coordinate system (the first feature coordinate


key: chroma:document
string_value:
system) may differ from the feature coordinate system to be used for machining (the second feature 
coordinate system). 
X
Y
Z
Xc'
Yc'
Zc'
• G53.1 command
X
Y
Z
Xc'
Yc'
Zc'
G01 Y10.0 F1000
command after G53.1
Second feature coordinate
system
Xc'-Yc'-Zc'
Second feature coordinate
system
Xc'-Yc'-Zc'
Fig. 14.3.3.1 (h) Resetting of the feature coordinate system


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 315 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Rotation direction of the table rotation axis 
The composite type machine shown in Fig. 14.3.3.1 (g) is explained as an example. 
Set parameter No.19684 to 1 if the rotation direction of the rotation table corresponding to the 
positive-direction move command is clockwise when viewed from the positive direction of the rotation


key: chroma:document
string_value:
center axis on which the table rotation axis rotates. If the rotation direction is counterclockwise, set 
parameter No.19684 to 0. 
Let's take sample program 4 of O400 as an example, where the movement of the table is specified by 
G53.1. 
If parameter No.19684 is set to 1, control is performed in such a way that the table is rotated to A-45.0. 
If parameter No.19684 is set to 0, control is performed in such a way that the table is rotated to A45.0. 
Example) 
O400 (Sample Program4) ;


key: chroma:document
string_value:
O400 (Sample Program4) ; 
N1 G68.2 X100.0 Y100.0 Z0 I180.0 J45.0 K0 ; 
N2 G53.1 ; 
N3 . . . ; 
X
Y
Z 
A
Xc
Yc Zc
Yc 
Xc 
Zc 
CCW CW
Rotation to A-45.0 
CCW
Rotation to A45.0 
CCW
Yc
Xc
Zc 
Positive rotation direction when 
parameter No.19684 = 0
Positive rotation direction when 
parameter No.19684 = 1
G53.1 command 
G53.1 command 
Fig. 14.3.3.1 (i) Rotation direction of the table rotation axis


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 316 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Table rotation type machine 
 Basic operation 
This function is also usable for a table rotation type machine with two table rotation axes. 
The feature coordinate system Xc-Yc-Zc is set in the workpiece coordinate system based on the 
coordinate system origin shift (xo, yo, zo) and the Euler's angle. 
Given the A-axis and C-axis shown in Fig. 14.3.3.1 (j), the A-axis and C-axis rotate until Zc comes in the


key: chroma:document
string_value:
X-Z plane and the tool axis is directed toward the +Z-axis direction of the feature coordinate system. 
A
C
Xc
Yc
Zc
Yc'
Xc'
• Tool axis direction control for a table rotation type machine
X
Y
Z
A
X
Y
Z
Zc'
C
Fig. 14.3.3.1 (j) Table rotation type machine


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 317 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Feature coordinate system with the table rotated by G53.1 (tool axis direction 
control) 
The table rotation type machine shown in Fig. 14.3.3.1 (j) is explained as an example. 
If the table rotates by the tool axis direction control command (G53.1), the feature coordinate system 
(called the first feature coordinate system), which is set in the workpiece coordinate system by the tilted


key: chroma:document
string_value:
working plane indexing (G68.2), rotates as much as the table rotates. 
The feature coordinate system that has rotated is called the second feature coordinate system. 
Once G53.1 is specified, the subsequent machining commands are assumed to be specified in the second 
feature coordinate system. (See Fig. 14.3.3.1 (k).) 
In the table rotation type machine, the specified feature coordinate system (the first feature coordinate


key: chroma:document
string_value:
system) may differ from the feature coordinate system to be used for machining (the second feature 
coordinate system). 
• G53.1 command
G01 X10.0 F1000
command after G53.1
Yc'
Xc'
X
Y
Z
Zc'
Yc'
Xc'
X
Y
Z
Zc'
Second feature coordinate
system
Xc'-Yc'-Zc'
Second feature coordinate
system
Xc'-Yc'-Zc'
Fig. 14.3.3.1 (k) Resetting of the feature coordinate system


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 318 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Angle of the rotary axis 
When tool axis direction control (G53.1) has been performed, more than two pairs of "computed angles" 
of the rotary axes usually exist. 
The "computed angle" is the candidate angle at which the rotary axis is to be controlled in the tool axis 
direction specified by G53.1. 
The "output angle" is determined from the "computed angle" based on the "output judgment conditions" 
described below.


key: chroma:document
string_value:
described below. 
When the upper and lower limits of the movement range of rotary axes are specified by parameters No. 
19741 to No. 19744 at this time, a calculated angle that makes the two axes fall within the movement 
range is selected. 
"Output judgment conditions" 
Tool rotation type or table rotation type machine 
<1> The "output angles" are represented by the computed rotary axis angle pair whose master axis (first rotary 
axis) moving angle is smaller. 
 ↓


key: chroma:document
string_value:
↓
 ↓ When the master axis moving angle is the same 
 ↓
<2> The "output angles" are represented by the computed rotary axis angle pair whose slave axis (second rotary 
axis) moving angle is smaller. 
 ↓
 ↓ When the slave axis moving angle is the same 
 ↓
<3> The "output angles" are represented by the computed rotary axis angle pair whose master axis (first rotary 
axis) angle is nearer to 0 degree (multiple of 360 degrees). 
 ↓
 ↓ When the master axis angle is equally near to 0 degree 
 ↓


key: chroma:document
string_value:
↓
<4> The "output angles" are represented by the computed rotary axis angle pair whose slave axis (second rotary 
axis) angle is nearer to 0 degree (multiple of 360 degrees). 
Composite type machine 
<1> The "output angles" are represented by the computed rotary axis angle pair whose table (second rotary axis) 
moving angle is smaller. 
 ↓
 ↓ When the table moving angle is the same 
 ↓
<2> The "output angles" are represented by the computed rotary axis angle pair whose tool (first rotary axis)


key: chroma:document
string_value:
moving angle is smaller. 
 ↓
 ↓ When the tool moving angle is the same 
 ↓
<3> The "output angles" are represented by the computed rotary axis angle pair whose table (second rotary axis) 
angle is nearer to 0 degree (multiple of 360 degrees). 
 ↓
 ↓ When the master axis angle is equally near to 0 degree 
 ↓
<4> The "output angles" are represented by the computed rotary axis angle pair whose tool (first rotary axis) 
angle is nearer to 0 degree (multiple of 360 degrees).


key: chroma:document
string_value:
The process of judging whether the moving angle is smaller or larger as the output judgement condition is 
called "movement judgement." 
When bit 5 (PRI) of parameter No.19608 is 1, the movement judgements for the first rotary axis and 
second rotary axis are made in reverse order. 
The "movement judgement" process is explained below.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 319 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
When the "computed angle" is within the range between 0 and 360 degrees, it is called the "basic 
computed angle." 
Usually, two pairs of "basic computed angles" exist. 
For example, assume that the machine has rotary axis A (master) and rotary axis B (slave) and that there 
are two pairs of basic computed angles as follows: 
(A θ1 degree; B φ1 degree) 
(A θ2 degrees; B φ2 degrees) where θ1 ≤ θ2 and φ1 ≤ φ2.


key: chroma:document
string_value:
The "computed angle" is obtained from either of the following expressions: "basic computed angle" + 360 
degrees × N or "basic computed angle" - 360 degrees × N. 
The current position of rotary axis A (master) is PA, and that of rotary axis B (slave) is 0 degree. 
Based on the PA angle, the "movement judgement" process is done as follows (when bit 5 (PRI) of 
parameter No.19608 is 0). 
• Computed angle A 
-360 × (N + 1) degrees 
θ1 - 360 × N 
-360 × N degrees


key: chroma:document
string_value:
-360 × N degrees 
θ2 - 360 × θ2 - 360 × N (N + 1) θ1 - 360 × (N - 1) 
(*1) 
0 degree 360 degrees 
θ2 - 360 θ1 θ2 θ1 + 360 
(*2) 
360 × (N + 1) degrees 
θ1 + 360 × N 
360 × N degrees 
θ2 + 360 × θ2 + 360 × N (N - 1) θ1 + 360 × (N + 1) 
(*3) 
Fig. 14.3.3.1 (l) "Movement judgment" 
When the PA angle is (*1): 
The output angle is: (A θ2 - 360 × (N + 1) degrees; B φ2 degrees). 
Namely, θ2 - 360 × (N + 1) degrees is adopted that is nearer to the computed angle of A, and φ2, which is


key: chroma:document
string_value:
the same group as θ2, is adopted as the computed angle of B. 
When the PA angle is (*2): 
The output angle is: (A θ1 degrees; B φ1 degrees). 
Namely, θ1 degrees is adopted that is nearer to the computed angle of A, and φ1, which is the same group 
as θ1, is adopted as the computed angle of B. 
When the PA angle is (*3): 
The output angle is: (A θ2 + 360 × N degrees; B φ2 degrees). 
Namely, θ2 + 360 × N degrees is adopted that is nearer to the computed angle of A, and φ2, which is the


key: chroma:document
string_value:
same group as θ2. is adopted as the computed angle of B. 
When the moving angle of rotary axis A (master) is the same, a "movement judgement" is made for rotary 
axis B (slave) according to the "output judgment conditions."


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 320 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
If the "output angle" of rotary axis A is determined by the "movement judgement" for rotary axis A, the 
computed angle representing the "smaller moving angle" is adopted as the "output angle" of rotary axis B. 
Similarly, if the "output angle" of rotary axis B is determined by the "movement judgement" for rotary 
axis B, the computed angle representing the "smaller moving angle" is adopted as the "output angle" of


key: chroma:document
string_value:
rotary axis A. 
 CAUTION 
1 To use the rotary axis roll-over function, set parameter No. 1260 (amount of 
rotary axis movement per rotation) to 360 degrees. 
2 A stroke limit before movement is applied to the rotary axis subject to tool axis 
direction control. 
3 If the setting of the lower limit (parameters Nos. 19742 and 19744) is greater 
than that of the upper limit (parameters Nos. 19741 and 19743), alarm PS5459 , 
“MACHINE PARAMETER INCORRECT” is issued.


key: chroma:document
string_value:
4 If there is no calculated angle that falls within the movement range because the 
movement range is too small, alarm PS5459 is issued. 
5 When the parameters that specify the upper limit and lower limit of the 
movement range are set to 0, no movement range is assumed to be specified. 
The "output angle" is explained below using a tool rotation type machine as an example. (Assume that bit 
5 (PRI) of parameter No.19608 is 0.) 
This example illustrates a machine having a "BC type tool axis Z."


key: chroma:document
string_value:
• BC type tool axis Z 
X
Y
Z 
C-axis: First rotation axis 
(master) 
B-axis: Second rotation axis 
(slave) 
Fig. 14.3.3.1 (m) BC type tool axis Z 
The following two pairs of "computed basic angles" exist that direct the tool axis toward the +X-axis 
direction. 
(B 90 degrees; C 180 degrees) 
(B 270 degrees; C 0 degree) 
<1> When the current rotary axis angles are (B -70 degrees; C 30 degrees) 
 The "output angles" are (B -90 degrees; C 0 degree).


key: chroma:document
string_value:
0 degree is adopted because it is nearer to the current position (30 degrees) of the C-axis that is the 
master axis. For the B-axis, 270 degrees is adopted which is the same group. However, this is 
changed to -90 degrees (270 degrees - 360 degrees) which is the nearest to the current position of the 
B-axis (-70 degrees). 
<2> When the current rotary axis angles are (B 80 degrees; C 500 degrees) 
 The "output angles" are (B 90 degrees; C 540 degrees).


key: chroma:document
string_value:
540 degrees (180 degrees + 360 degrees) is adopted because it is nearer to the current position (500 
degrees) of the C-axis that is the master axis. For the B-axis, 90 degrees is adopted which is the same 
group. 
<3> When the current rotary axis angles are (B 60 degrees; C 90 degrees) 
 The "output angles" are (B 90 degrees; C 180 degrees). 
 Since the two candidates are equally near to the current position (90 degrees) of the C-axis that is the


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 321 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
because it is nearer to the current position (60 degrees) of the B-axis that is the slave axis. For the 
C-axis, 180 degrees is adopted which is the same group. 
<4> When the current rotary axis angles are (B 180 degrees; C 90 degrees) 
 The "output angles" are (B 270 degrees; C 0 degree). 
 Since the two candidates are equally near to the current position (90 degrees) of the C-axis that is the


key: chroma:document
string_value:
master axis, a judgment is made based on the current position of the B-axis. In this case, however, 
the two candidates are also equally near to the current position of the B-axis (180 degrees). 
Therefore, the candidate is adopted in which the C-axis (master axis) is nearer to 0 degree. 
 That is, the pair is adopted whose C-axis angle is 0 degree and whose B-axis angle is 270 degrees. 
When the slave axis angle is 0 degree, the direction of the tool axis becomes fixed regardless of the


key: chroma:document
string_value:
master axis angle. 
In that case, the master axis does not move from the current angle. 
An explanation is shown below using a machine having a "BC type tool axis Z" as an example. 
• BC type tool axis Z 
X
Y
Z 
C
Fig. 14.3.3.1 (n) BC type tool axis Z 
When the current rotary axis angles are (B 45 degrees; C 90 degrees), the "output angles" are (B 0 degree; 
C 90 degrees). 
 - Specification for rotary axes


key: chroma:document
string_value:
The tilted working plane indexing assumes that positioning of a rotary axis is performed by tool axis 
direction control (G53.1) and then machining is performed without the rotary axis being moved. 
When movement is made with the rotary axis specified directly, the movement of the rotary axis is not 
considered in the movement of the linear axis. Do not specify the movement of the rotary axis during 
execution of the tilted working plane indexing to ensure correct machining.


key: chroma:document
string_value:
Second Rotation Axis Control in Tool Axis Direction Control Where the End 
Point is a Singular Point 
When the end point of tool axis direction control (G53.1/G53.6) during execution of the tilted working 
plane indexing is a singular point, the second rotation axis is controlled so that the direction of the second 
feature coordinate system matches that of the workpiece coordinate system. 
To enable this function, set bit 4 (CFW) of parameter No. 11221 to 1.


key: chroma:document
string_value:
When bit 4 (CFW) of parameter No. 11221 is set to 0, if the end point of tool axis direction control 
(G53.1/G53.6) is a singular point, the second rotation axis does not operate and only the first rotation axis 
turns. As a result, the X- and Y-directions of the feature coordinate system depend on the second 
rotation axis immediately before tool axis direction control. (Fig. 14.3.3.1 (o), Fig. 
14.3.3.1 (p))


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 322 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Xw Yw 
Zw 
XF 
YF 
ZF
A0 B45 Xw Yw 
Zw 
XF 
YF 
ZF 
A-90 B45 
Fig. 14.3.3.1 (o) Before G53.1 Fig. 14.3.3.1 (p) After G53.1 
The second rotation axis (B-axis) does not turn. 
When this function is enabled (bit 4 (CFW) of parameter No. 11221 = 1), the second rotation axis is 
controlled so that the direction of the second feature coordinate system matches that of the workpiece


key: chroma:document
string_value:
coordinate system. (Fig. 14.3.3.1 (q),Fig. 14.3.3.1 (r)) 
Xw Yw 
Zw 
XF 
YF 
ZF
A0 B45 Xw Yw 
Zw 
A-90 B0 
Xw Yw 
Zw 
Fig. 14.3.3.1 (q) Before G53.1 Fig. 14.3.3.1 (r) After G53.1 
The second rotation axis (B-axis) moves so that the 
direction of the second feature coordinate system 
matches that of the workpiece coordinate system. 
14.3.3.2 Tool center point retention type tool axis direction control


key: chroma:document
string_value:
In tilted working plane indexing, tool center point retention type tool axis direction control (G53.6) can 
be specified so that tool can be perpendicular to the tilted plane with the tool center point maintained on 
the workpiece. In tool center point retention type tool axis direction control, end point of tool center point 
can be specified. Then tool center point moves on the feature coordinate system fixed on the workpiece.


key: chroma:document
string_value:
The cycle time can be shortened by moving tool axis direction and tool center point simultaneously. 
By specifying the distance between the tool center point to the rotation center with R, it is possible to 
move the tool so that it is perpendicular to the titled plane while retaining the rotation center shifted from 
the tool center point.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 323 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Format 
M G53.6 (H_) (R_) X_ Y_ Z_ ; Tool center point retention type tool axis direction 
control
H : Tool compensation number 
R : Distance from the tool center point to the rotation center 
 (Specify R as a radius value.) 
X_ Y_ Z_ : End point of tool center point 
G53.6 is a one shot G code. 
To use tool center point retention type tool axis direction control, a tool length offset number is required.


key: chroma:document
string_value:
If no H command is specified, the H code is regarded as modal information. 
To shift the rotation center from the tool center point, enter the distance from the tool center point to the 
rotation center, using the R command. If no R command is specified, the distance is regarded as R0, and 
the tool moves while retaining the tool center position on the workpiece so that it is perpendicular to the 
tilted plane. 
Specify end point of tool center point in feature coordinate system. 
T


key: chroma:document
string_value:
T
G53.6 (D_) (R_) X_ Y_ Z_ ; Tool center point retention type tool axis direction 
control
D : Tool compensation number 
R : Distance from the tool center point to the rotation center 
 (Specify R as a radius value.) 
X_ Y_ Z_ : End point of tool center point 
To use tool center point retention type tool axis direction control on a T series machine, enable the 
extended tool selection function (set bit 3 (TCT) of parameter No. 5040 = 1). 
Use D as the tool length offset number.


key: chroma:document
string_value:
Other restrictions are the same as those on the M series. 
 CAUTION 
1 Specify tool center point retention type tool axis direction control (G53.6) in tool 
length compensation cancel mode (G49). If it is specified in a mode other than 
G49 mode, alarm PS5458, ”ILLEGAL USE OF G53.1/G53.6” is issued. 
2 If G68.2 is not specified before G53.6 is specified, alarm PS5458 is issued. 
3 Specify G53.6 independently. If an axis movement command is specified in the 
same block, alarm PS5458 is issued.


key: chroma:document
string_value:
4 The tool center point retention type tool axis direction control (G53.6) block 
becomes a block that suppresses buffering. 
5 If tool center point retention type tool axis direction control does not have an H 
command (D command for the T series), and the modal information for H (D) is 
0, alarm PS5458 is issued.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 324 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 CAUTION 
6 For the feedrate, the movement speed of the rotation axis is applied. During 
rapid traverse, it is regarded as the maximum rapid traverse rate, and as the 
specified speed during cutting feed. 
7 Specify tool center point retention type tool axis direction control (G53.6) in 
cutter compensation cancel mode (G40). If it is specified in a mode other than 
G40 mode, alarm PS5458 is issued.


key: chroma:document
string_value:
8 Specify tool center point retention type tool axis direction control (G53.6) in 
either G00 or G01 mode. 
9 Specify tool center point retention type tool axis direction control (G53.6) with 
feed per minute or feed per revolution. 
10 Do not perform manual intervention during tool center point retention type tool 
axis direction control (G53.6). Otherwise, alarm PS5458 is issued. 
11 If the R command is specified, and if an exceedingly large value is input as R,


key: chroma:document
string_value:
alarm PS0143, ”COMMAND DATA OVERFLOW” may be issued. 
Example 
Tool center point retention type tool axis direction control with R not specified 
Fig. 14.3.3.2 (a) and Fig. 14.3.3.2 (b) show tool center point retention type tool axis direction control with 
R not specified. The tool moves so that it is perpendicular to the tilted plane while retaining the tool 
center point on the workpiece. 
This function can be used by specifying G53.6 and specifying a tool length offset number with H (D for


key: chroma:document
string_value:
the T series). (If H (D) has the modal information for the currently used tool, this function can be used 
without specifying H (D).) 
O0002(TCP-HOLD-TYPE) 
G00 B0 C0 
G5.1 Q1 
G68.2 X0 Y0 Z0 I90.0 J45.0 K0 
G53.6 H1 (G53.6 D1 for the T series) 
Control point 
Tool length vector Tool center 
point 
Z 
X 
Workpiece coordinate system 
Fig. 14.3.3.2 (a) Operation of tool center point retention type tool axis direction control (tool rotation type)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 325 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
Z 
X 
Z’ 
Y’ 
Workpiece 
coordinate system 
1st feature 
coordinate system 
Tool length vector 
Tool center point 
Control point 
Z’’ 
Y’’ 
2nd feature coordinate system 
Table 
Fig. 14.3.3.2 (b) Operation of tool center point retention type tool axis direction control (table rotation type) 
Fig.14.3.3.2 (c) and Fig.14.3.3.2 (d) show tool center point retention type tool axis direction control


key: chroma:document
string_value:
specified with end point of tool center point. Tool center point moves on the feature coordinate system 
fixed on the workpiece. 
O0012(TCP-HOLD-TYPE-TOOL_ROT) 
G00 B0 C0 
G5.1 Q1 
G68.2 X0 Y0 Z0 I90.0 J45.0 K-90.0 
G53.6 H1 X100.0 Y0 Z0 (G53.6 D1 X100.0 Y0 Z0 for the T series) 
Zf 
Z Xf 
X 
Control point 
Tool length vector
Tool center 
point 
Workpiece 
coordinate 
system 
Feature 
coordinate 
system


key: chroma:document
string_value:
Feature 
coordinate 
system 
Fig.14.3.3.2 (c) Operation of tool center point retention type tool axis direction control specified with end 
point of tool center point (tool rotation type)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 326 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
O0022(TCP-HOLD-TYPE-TABLE_ROT) 
G00 B0 C0 
G5.1 Q1 
G68.2 X0 Y0 Z0 I90.0 J45.0 K-90.0 
G53.6 H1 X0 Y0 Z0 (G53.6 D1 X0 Y0 Z0 for the T series) 
Xf 
Zf Zf 
Xf 
Table 
1st feature 
coordinate system 
2nd feature 
coordinate 
system 
Fig.14.3.3.2 (d) Operation of tool center point retention type tool axis direction control specified with end 
point of tool center point (table rotation type)


key: chroma:document
string_value:
Rotation center compensation with the tool center point retention type 
In tool center point retention type tool axis direction control, the rotation center can be shifted from the 
tool center point by specifying R. 
Fig. 14.3.3.2 (e) and Fig. 14.3.3.2 (f) show cases in which the rotation center is shifted by specifying the 
distance from the tool center point to the workpiece with R. 
By specifying this, the tool moves so that it is perpendicular to the titled plane while retaining the rotation


key: chroma:document
string_value:
center on the workpiece. 
This function can be used by specifying G53.6 and specifying a tool length offset number with H (D for 
the T series) and specifying the distance from the tool center point to the rotation center with R. 
O0003(CENTER-OF-ROTATION-HOLD-TYPE) 
G00 B0 C0 
G5.1 Q1 
G68.2 X0 Y0 Z0 I90.0 J45.0 K0 
G53.6 H1 R200.0 (G53.6 D1 R200.0 for the T series)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 327 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
r 
r 
Control point 
Tool length vector
Tool center point 
Rotation center 
Z 
X 
Z’ 
Y’ 
Workpiece 
coordinate system 
Feature coordinate 
system 
r: Distance from the tool center point to the rotation center 
Fig. 14.3.3.2 (e) Operation of rotation center compensation with tool center point retention type tool axis 
direction control (tool rotation type) 
r 
Rotation 
center 
Z 
X 
Z’ 
Y’ 
Workpiece


key: chroma:document
string_value:
Z 
X 
Z’ 
Y’ 
Workpiece 
coordinate 
system 
1st feature 
coordinate system 
r: Distance from the tool center point to the rotation center 
Tool length vector
Tool center point 
Control point 
Z’’ 
r 2nd feature coordinate system 
Y’’ 
Table 
Fig. 14.3.3.2 (f) Operation of rotation center compensation with tool center point retention type tool axis 
direction control (table rotation type)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 328 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.4 Tilted Working Plane Indexing in Tool Length Compensation 
Overview 
In tool length compensation (G43), G68.2/G68.4 (tilted working plane indexing) and G53.1 (tool axis 
direction control)/G53.6 (tool center point retention type tool axis direction control) can be specified. 
Accordingly, the G68.2/G68.4 and G53.1/G53.6 commands can be used without canceling tool length 
compensation. 
Explanation


key: chroma:document
string_value:
compensation. 
Explanation 
 - G68.2/G68.4 command in tool length compensation 
The G68.2/G68.4 command can be executed in tool length compensation. 
Absolute coordinates after the G68.2/G68.4 command are based on the position of the tool center point on 
the feature coordinate system. 
When the tilted working plane indexing is executed with the tool or table tilted on the rotation axis, 
absolute coordinates are based on the position of the tool center point with the position of the rotation


key: chroma:document
string_value:
axis considered. 
Accordingly, machining is allowed even when the tool axis direction is not the Z-axis direction on the 
feature coordinate system. 
Example of operation 1 
N10 G69 ; 
N20 G54 G43 H1 X0 Y0 Z0 ; 
N30 G68.2 X_ Y_ Z_ I90. 0J-30.0 K-90.0 ; (rotation by -30 degrees about the Y-axis) 
N40 X100.0 Y0 Z0 ; 
X 
Z 
G54 
ZF
XF
Feature coordinate 
system 
N30 
N20 
N40 
Fig. 14.3.4 (a) Example of operation 1 
Example of operation 2 
N10 G69 ; 
N20 G54 G43 H1 X0 Y0 Z0 B0 ;


key: chroma:document
string_value:
N20 G54 G43 H1 X0 Y0 Z0 B0 ; 
N30 B20.0 ; 
N40 G68.2 X_ Y_ Z_ I90.0 J-30.0 K-90.0 ; (rotation by -30 degrees about the Y-axis) 
N50 X100.0 Y0 Z0 ;


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 329 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
X 
Z 
G54 
ZF
XF
N20 
N50 N30 Feature coordinate 
system 
N40 
Fig. 14.3.4 (b) Example of operation 2 (tool rotation type) 
G54 
N20 
X 
Z 
ZF
XF
N30 
G54 
N20 
X 
Z 
ZF
N50 XF
Specify the tilted 
working plane in 
the B0 state in 
N40. 
The feature coordinate system specified in N40 moves
according to the movement about the table rotation axis. 
Feature coordinate 
system 
N40


key: chroma:document
string_value:
system 
N40 
Fig. 14.3.4 (c) Example of operation 2 (table rotation type) 
Example of operation 3 
N30 G43 X0 Y0 Z0 B20.0 ; 
N40 G68.2 X_ Y_ Z_ I90.0 J-30.0 K-90.0 ; (rotation by -30 degrees about the Y-axis) 
N50 X100.0 Y0 Z0 ; 
N60 B-20.0 
N70 G68.4 X_ Y_ Z_ I90.0 J40.0 K-90.0 ;（incremental multiple command: rotation by 40 degrees about 
the Y-axis）
N80 X100.0 Y0 Z0 ;


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 330 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
ZF1 
XF1 
N80 
N50 
N60 
ZF1 
XF1 
Feature coordinate 
system 
N40 
Feature coordinate 
system 
N70 
Fig. 14.3.4 (d) Example of operation 3 (tool rotation type) 
N60 
N80 
ZF1
N50 XF1
Specify the tilted 
working plane in the 
B20 state in N70.
The feature coordinate system specified in N70 moves 
according to the movement about the table rotation axis.
ZF1
XF1
ZF2
XF2
ZF2
XF2
Feature coordinate


key: chroma:document
string_value:
ZF2
XF2
Feature coordinate 
system 
N70 
Feature coordinate 
system 
N40 
Fig. 14.3.4 (e) Example of operation 3 (table rotation type) 
G53.1 command in tool length compensation 
The G53.1 command can be executed in tool length compensation. 
G53.1 operation in tool length compensation is performed in the same way as in the tool length 
compensation cancel mode. 
Absolute coordinates after the G53.1 command are based on the position of the tool center point on the


key: chroma:document
string_value:
feature coordinate system after the G53.1 command is specified. 
Example of operation 4 
N10 G54 G43 H1 X_ Y_ Z_ ; 
N20 G68.2 X_ Y_ Z_ I90.0 J-30.0 K-90.0 ; (rotation by -30 degrees about the Y-axis) 
N30 G53.1 ; 
N40 X100.0 Y0 Z0 ;


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 331 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
X 
Z 
G54 
ZF
XF
N10 N4 
N30 
Feature coordinate 
system 
N20 
Fig. 14.3.4 (f) Example of operation 4 (tool rotation type) 
G54 
N10 
X 
Z 
ZF
XF
N30 
G54 
X 
Z 
ZF
XF
N40 
Feature coordinate 
system 
N20 
Second feature 
coordinate system 
N30 
Fig. 14.3.4 (g) Example of operation 4 (table rotation type) 
G53.6 command in tool length compensation


key: chroma:document
string_value:
The G53.6 command can be executed in tool length compensation. 
G53.6 operation in tool length compensation is performed in the same way as in the tool length 
compensation cancel mode. 
G69 command in tool length compensation 
The G69 command can be executed in tool length compensation. 
After G69 operation in tool length compensation, the tool length compensation vector represents the Z 
direction of the workpiece coordinate system regardless of the position of the rotation axis.


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 332 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
14.3.5 Restrictions of Tilted Working Plane Indexing 
 - Basic restrictions 
The restrictions imposed on 3-dimensional coordinate conversion also apply to the tilted working plane 
indexing. 
 - Increment system 
The same increment system must be used for the basic three axes used by this function. 
 - Rapid traverse command


key: chroma:document
string_value:
- Rapid traverse command 
Linear rapid traverse (bit 1 (LRP) of parameter No. 1401 = 1) must be set for the rapid traverse command. 
 - 3-dimensional coordinate system conversion 
If an attempt is made to set a new coordinate system by performing 3-dimensional coordinate conversion 
in a feature coordinate system, an alarm is also raised. 
 - Positioning in the machine coordinate system 
Positioning commands in the machine coordinate system such as G28, G30, and G53 operate in the


key: chroma:document
string_value:
machine coordinate system rather than the feature coordinate system. 
 - External mirror image 
If an attempt is made to use this function and an external mirror image function simultaneously, this 
function takes effect before the external mirror image function. 
Actual path 
Y 
X 
Yc 
Xc 
Programmed path 
Feature coordinate system 
Workpiece coordinate system Position where mirroring is applied 
Fig. 14.3.5 
 - Tool center point retention type tool axis direction control


key: chroma:document
string_value:
Performing a reset during tool center point retention type tool axis direction control results in the 
operation to be performed when the following parameters are set regardless of whether the reset is 
performed in the foreground or background. Thus, do not use the background during tool center point 
retention type tool axis direction control. 
(1) Bit 2 (D3R) of parameter No. 5400 = 0: Clears the tilted working plane indexing. 
(2) Bit 6 (CLR) of parameter No. 3402 = 1: Clears with a reset.


key: chroma:document
string_value:
(3) Bit 0 (C08) of parameter No. 3407 = 0: Clears the G code in group 08. 
(4) Bit 7 (C23) of parameter No. 3408 = 0: Clears the G code in group 23. 
(5) Bit 7 (CFH) of parameter No. 3409 = 0: Clears the F, H, D, and T codes. 
(6) Bit 6 (LVK) of parameter No. 5003 = 0: Clears the tool length compensation vector.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 333 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
 - Relationships with other modal commands 
G41, G42, and G40 (cutter compensation), G43, G49 (tool length compensation), G51.1 and G50.1 
(programmable mirror image), and canned cycle commands must have nesting relationships with G68.2. 
In other words, first issue G68.2 when the modes mentioned above are off, turn the modes on and off, 
then issue G69. 
 - Manual reference position return


key: chroma:document
string_value:
Manual reference position return in the tilted working plane indexing mode results in alarm PS5324, 
“REFERENCE RETURN INCOMPLETE”. If you want to perform manual reference position return, 
cancel the tilted working plane indexing mode. 
- Hypothetical axis of a table rotation axis 
When a table rotation axis is set as a hypothetical axis, tilted working plane indexing is performed on the 
assumption that the table rotation axis is at 0 degrees. 
 - Specifiable G codes


key: chroma:document
string_value:
- Specifiable G codes
The G codes that can be specified in the tilted working plane indexing mode are listed below. 
Specifying a G code other than these codes results in alarm PS5462, “ILLEGAL COMMAND 
(G68.2/G69)”. 
- Positioning (G00) 
- Linear interpolation (G01) 
- Circular interpolation / helical interpolation (G02/G03) 
- Dwell (G04) 
- AI contour control OFF/ON (G05.1 Q0/Q1) 
- Exact stop(G09) 
- Programmable data input (G10) 
- Tool retract and recover (G10.6)


key: chroma:document
string_value:
- Programmable data input mode cancel (G11) 
- Plane selection (G17/G18/G19) 
- Automatic return to reference position (G28) 
- Movement from reference position (G29) 
- 2nd, 3rd and 4th reference position return (G30) 
- Skip function (G31) 
- Cutter compensation : cancel (G40) 
- Tool radius or tool nose radius compensation(G41/G42) 
- Tool length compensation + (G43) 
- Tool length compensation - (G44) 
- Tool length compensation cancel (G49,G49.1)


key: chroma:document
string_value:
- Programmable mirror image cancel (G50.1) 
- Local coordinate system (G52) 
- Machine coordinate system setting (G53) 
- Tool axis direction control (G53.1) 
- Workpiece coordinate system selection (G54 to G59, G54.1) 
- Exact stop (G61) 
- Tapping mode (G63) 
- Cutting mode (G64) 
- Macro call (G65) 
- Macro modal call A (G66) 
- Macro modal call B (G66.1) 
- Macro modal call A/B cancel (G67) 
- Canned cycle for drilling (G73, G74, G76, G80 to G89) 
- Absolute programming (G90)


key: chroma:document
string_value:
- Absolute programming (G90) 
- Incremental programming (G91) 
- Constant surface speed control (G96)


key: chroma:document
string_value:
PROGRAMMING B-64694EN/01
- 334 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
- Constant surface speed control cancel (G97) 
- Canned cycle : return to initial level (G98) 
- Canned cycle : return to R point level (G99) 
M
- Scaling cancel (G50) 
- Scaling(G51) 
- Programmable mirror image (G51.1) 
- Automatic corner override (G62) 
- Coordinate system rotation cancel or 3-dimensional coordinate system conversion mode off (G69) 
- Inverse time feed (G93) 
- Feed per minute (G94)


key: chroma:document
string_value:
- Feed per minute (G94) 
- Feed per revolution (G95) 
T
- Coordinate system rotation cancel or 3-dimensional coordinate system conversion mode off (G69.1) 
- Feed per minute (G98 (G94)) 
- Feed per revolution (G99 (G95)) 
 - Modal G codes that allow specification of a tilted working plane indexing 
A tilted working plane indexing can be specified in the modal G code states listed below. 
In a modal state other than the following modal G codes, specifying the tilted working plane indexing


key: chroma:document
string_value:
results in alarm PS5462: 
- Positioning (G00) 
- Linear interpolation (G01) 
- Programmable data input mode cancel (G11) 
- Plane selection (G17/G18/G19) 
- Polar coordinates command cancel (G15) 
- Input in inch (G20 (G70)) 
- Input in mm (G21 (G71)) 
- Stored stroke check function (G22/G23) 
- Cutter compensation : cancel (G40) 
- Tool length compensation cancel (G49,G49.1) 
- Programmable mirror image cancel (G50.1) 
- Workpiece coordinate system selection (G54 to G59, G54.1)


key: chroma:document
string_value:
- Exact stop mode (G61) 
- Tapping mode (G63) 
- Cutting mode (G64) 
- Macro modal call A/B cancel (G67) 
- Canned cycle cancel (G80) 
- Absolute programming (G90) 
- Incremental programming (G91) 
- Constant surface speed control cancel (G97) 
- Canned cycle : return to initial level (G98) 
- Canned cycle : return to R point level (G99) 
M
- Scaling cancel (G50) 
- Automatic corner override (G62)


key: chroma:document
string_value:
- Coordinate system rotation cancel or 3-dimensional coordinate system conversion mode off (G69) 
- Inverse time feed (G93) 
- Feed per minute (G94) 
- Feed per revolution (G95)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 
- 335 - 
14. FUNCTIONS TO SIMPLIFY 
PROGRAMMING 
T
- Polar coordinate interpolation mode cancel (G13.1) 
- Polygon turning cancel (G50.2) 
- Mirror image for double turret off/balanced cutting mode cancel (G69) 
- Coordinate system rotation cancel or 3-dimensional coordinate system conversion mode off (G69.1) 
- Feed per minute (G98 (G94)) 
- Feed per revolution (G99 (G95)) 
- Polar coordinate interpolation mode cancel (G113)


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 336 - 
15 COMPENSATION FUNCTION 
15.1 TOOL LENGTH COMPENSATION (G43, G44, G49) 
This function can be used by setting the difference between the tool length assumed during programming 
and the actual tool length of the tool used into the offset memory. It is possible to compensate the 
difference without changing the program. 
Specify the direction of offset with G43 or G44. Select a tool length compensation value from the offset


key: chroma:document
string_value:
memory by entering the corresponding address and number (H code). 
Tool assumed
during programming
Actual tool
Specify this distance as
the value of tool length
compensation.
Fig. 15.1 Tool length compensation 
15.1.1 Overview 
The following three methods of tool length compensation can be used, depending on the axis along which 
tool length compensation can be made. 
- Tool length compensation A 
 Compensates for the difference in tool length along the basic Z-axis.


key: chroma:document
string_value:
- Tool length compensation B 
 Compensates for the difference in tool length in the direction normal to a selected plane. 
- Tool length compensation C 
 Compensates for the difference in tool length along a specified axis. 
Format 
Type Format Description 
Tool length compensation A G43 Z_ H_ ; 
G44 Z_ H_ ; G43 : Positive offset 
G44 : Negative offset 
G17 : XY plane selection 
G18 : ZX plane selection 
G19 : YZ plane selection 
α : Address of a specified axis


key: chroma:document
string_value:
H : Address for specifying the tool 
length compensation value 
X, Y, Z : Offset move command 
Tool length compensation B 
G17 G43 Z_ H_ ; 
G17 G44 Z_ H_ ; 
G18 G43 Y_ H_ ; 
G18 G44 Y_ H_ ; 
G19 G43 X_ H_ ; 
G19 G44 X_ H_ ; 
Tool length compensation C G43 α_H_ ; 
G44 α_H_ ; 
Tool length compensation cancel G49 ; or H0 ;


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 337 -
Explanation
- Selection of tool length compensation
Select tool length compensation A, B, or C, by setting bits 0 (TLC) and 1 (TLB) of parameter No. 5001 .
Parameter No.5001 Type Bit 1 (TLB) Bit 0 (TLC)
0 0 Tool length compensation A
1 0 Tool length compensation B
0/1 1 Tool length compensation C
- Direction of the offset
When G43 is specified, the tool length compensation value (stored in offset memory) specified with the H


key: chroma:document
string_value:
code is added to the coordinates of the end position specified by a command in the program. When G44 is 
specified, the same value is subtracted from the coordinates of the end position. The resulting coordinates 
indicate the end position after compensation, regardless of whether the absolute or incremental mode is 
selected.
When the specification of an axis is omitted, a movement is made by the tool length compensation value.


key: chroma:document
string_value:
G43 and G44 are modal G codes. They are valid until another G code belonging to the same group is 
used.
- Specification of the tool length compensation value
The tool length compensation value assigned to the number (offset number) specified in the H code is 
selected from offset memory and added to or subtracted from the moving command in the program.
Example
:
H1 ; The offset value of offset number 1 is selected.
:
G43 Z_ ; Offset is applied according to the offset value of offset number 1.
:


key: chroma:document
string_value:
:
H2 ; Offset is applied according to the offset value of offset number 2.
:
H0 ; Offset is applied according to the offset value 0.
:
H3 ; Offset is applied according to the offset value of offset number 3.
:
G49 ; Offset is canceled.
:
H4 ; The offset value of offset number 4 is selected.
:
A tool length compensation value is to be set in the offset memory corresponding to an offset number.


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 338 -
CAUTION
When another offset number is specified, the tool length compensation value just
changes to a new value. The new tool length compensation value is not added to 
the old tool length compensation value.
H1 : Tool length compensation value 20.0
H2 : Tool length compensation value 30.0
G90 G43 Z100.0 H1 ; Z will move to 120.0
G90 G43 Z100.0 H2 ; Z will move to 130.0
NOTE


key: chroma:document
string_value:
NOTE
The tool length compensation value corresponding to offset No. 0, that is, H0 
always means 0. It is impossible to set any other tool length compensation value 
to H0.
- Performing tool length compensation along two or more axes
Tool length compensation B can be executed along two or more axes when the axes are specified in two 
or more blocks.
By setting bit 3 (TAL) of parameter No. 5001 to 1, tool length compensation C can also can be executed


key: chroma:document
string_value:
along two or more axes when the axes are specified in two or more blocks. If no axis is specified in the 
same block, the alarm PS0027, “NO AXES COMMANDED IN G43/G44” is issued. If two or more axes
are specified in the same block, the alarm PS0336, “TOOL COMPENSATION COMMANDED MORE 
TWO AXES” is issued.
Example 1
When tool length compensation B is executed along the X-axis and Y-axis
G19 G43 H_ ; Offset in X axis 
G18 G43 H_ ; Offset in Y axis 
Example 2


key: chroma:document
string_value:
Example 2
When tool length compensation C is executed along the X-axis and Y-axis
G43 X_ H_ ; Offset in X axis 
G43 Y_ H_ ; Offset in Y axis 
Example 3
When an alarm is issued with tool length compensation C
G43 X_ Y_ H_ ; An alarm PS0336 occurs
- Tool length compensation cancel
To cancel tool length compensation, specify G49 or H0. After G49 or H0 is specified, the system 
immediately cancels the offset mode.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 339 -
NOTE
1 If offset is executed along two or more axes, offset along all axes is canceled by 
specifying G49. If H0 is used to specify cancellation, offset along only the axis
normal to a selected plane is canceled in the case of tool length compensation
B, or offset along only the last axis specified by G43 or G44 is canceled in the 
case of tool length compensation C.


key: chroma:document
string_value:
2 If offset is executed along three or more axes, and offset along all axes is 
canceled using G49, the alarm PS0015, “TOO MANY SIMULTANEOUS AXES”
may be issued. By using H0 together, for example, cancel offset so that the 
number of simultaneously controlled axes (the number of axes along which 
movements are made simultaneously) does not exceed the allowable range of 
the system.
3 If tool length compensation and 3-dimensional coordinate system conversion are


key: chroma:document
string_value:
canceled by a reset with 3-dimensional coordinate system conversion performed
during tool length compensation, the direction of tool length compensation vector 
cancellation becomes incorrect. By setting bit 6 (LVK) of parameter No. 5003 to 
1 and setting bit 2 (D3R) of parameter No. 5400 to 1, ensure that the tool length 
compensation vector and 3-dimensional coordinate system conversion are not 
canceled by a reset.
Example)
 G43 H1 ;
 G68 X_ Y_ Z_ I_ J_ K_ R_ ;
 :


key: chroma:document
string_value:
:
 : Ensure that tool length compensation and three-dimensional
 : coordinate conversion are not canceled by a reset in this range.
G69 ;
G49 ;


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 340 -
Example
Actual position
Programmed 
position
Offset value
=4mm
#1
20
30
30
120
#3
#2
+Y
+X
30 50 +Z
3 35
30
18 22
8
Tool length compensation (in boring holes #1, #2, and #3)
(1)
(2)
(3)
(4)
(5)
(6)
(7) (8)
(9) (13)
(10)
(11)
(12)
Program
H1=-4.0 (Tool length compensation value)
N1 G91 G00 X120.0 Y80.0 ;...............(1)
N2 G43 Z-32.0 H1 ; ...........................(2)


key: chroma:document
string_value:
N3 G01 Z-21.0 F1000 ; ......................(3)
N4 G04 P2000 ; ...................................(4)
N5 G00 Z21.0 ; ....................................(5)
N6 X30.0 Y-50.0 ; ...............................(6)
N7 G01 Z-41.0 ;...................................(7)
N8 G00 Z41.0 ; ....................................(8)
N9 X50.0 Y30.0 ;.................................(9)
N10 G01 Z-25.0 ;.................................(10)
N11 G04 P2000 ; ...............................(11)


key: chroma:document
string_value:
N12 G00 Z57.0 H0 ; ..........................(12)
N13 X-200.0 Y-60.0 ; ..........................(13)
N14 M2 ;
T
When this function is used in the lathe system, "EXTENDED TOOL SELECTION" function is needed.
Moreover, it should be ATC type (parameter TCT (No.5040#3)=1) as for the tool exchange method.
Notes
- Command for setting a workpiece coordinate system in the tool length 
compensation mode
Executing a workpiece coordinate system setting G code command (G92 or, for G code system A in the


key: chroma:document
string_value:
lathe system, G50) presets a coordinate system in such a way that the specified position will be a 
pre-compensation position.
However, this G code cannot be used together with a block where tool length compensation vectors vary. 
For details, see “Notes” in Subsection 7.2.1, “Setting a Workpiece Coordinate System.”


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 341 -
15.1.2 G53, G28, and G30 Commands in Tool Length Compensation 
Mode
This section describes the tool length compensation cancellation and restoration performed when G53, 
G28, or G30 is specified in tool length compensation mode. Also described is the timing of tool length 
compensation. 
As mentioned in "SAFETY PRECAUTIONS WARNINGS AND CAUTIONS RELATED TO


key: chroma:document
string_value:
PROGRAMMING" on this manual, it is recommended to cancel tool length compensation mode before 
executing the G53, G28, and G30 commands.
Explanation
- Tool length compensation vector cancellation
When G53, G28, or G30 is specified in tool length compensation mode, tool length compensation vectors 
are canceled as described below. However, the previously specified modal G code remains displayed; 
modal code display is not switched to G49.
(1) When G53 is specified
Command Specified axis Operation


key: chroma:document
string_value:
G53 IP_ Tool length compensation axis Canceled upon movement being performed
Other than tool length compensation axis Not canceled
G49 G53 IP_ Tool length compensation axis Canceled upon movement being performed
Other than tool length compensation axis Canceled
(IP_ : Dimension word)
CAUTION
If tool length compensation is applied along multiple axes, the offset vector along 
the axis specified by G53 is canceled.
(2) When G28,or G30 is specified 
Command Specified axis Operation
G28 IP_


key: chroma:document
string_value:
G28 IP_
Tool length compensation axis Not canceled at an intermediate point. 
Canceled at the reference position.
Other than tool length compensation axis Not canceled at an intermediate point. 
Canceled at the reference position.
G49 G28 IP_
Tool length compensation axis Canceled when a movement is made to an 
intermediate point.
Other than tool length compensation axis Canceled when a movement is made to an 
intermediate point.
(IP_ : Dimension word)
CAUTION


key: chroma:document
string_value:
CAUTION
If tool length compensation is applied along multiple axes, the offset vector along 
the axis on which a reference position return operation has been performed is 
canceled.


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 342 -
- Tool length compensation vector restoration
Tool length compensation vectors, canceled by specifying G53, G28, or G30 in tool length compensation 
mode, are restored as described below.
Type Bit 6 (EVO) of parameter No. 5001 Restoration condition
A/B 0 The H command or G43 (G44) is specified.
1 Restored by the next buffered block.
C The H command or G43 (G44)IP_ is specified.
(IP_ : Dimension word)
CAUTION


key: chroma:document
string_value:
CAUTION
1 If a tool length compensation vector is restored only with H_, G43, or G44 when 
tool length compensation is applied along multiple axes, the tool length
compensation vector along only the axis normal to a selected plane is restored in 
the case of tool length compensation B, or the tool length compensation vector 
along only the last axis for which tool length compensation is specified is 
restored in the case of tool length compensation C. The tool length


key: chroma:document
string_value:
compensation vector along any other axes is not restored.
2 In the block in which the tool length compensation vector is restored, do not 
execute commands other than positioning with G00 or G01, G04, and a single 
block with EOB.
15.2 SCALING (G50, G51)
M
Overview
A programmed figure can be magnified or reduced (scaling).
Two types of scaling are available, one in which the same magnification rate is applied to each axis and


key: chroma:document
string_value:
the other in which different magnification rates are applied to different axes.
The magnification rate can be specified in the program.
Unless specified in the program, the magnification rate specified in the parameter is applied.
Y
X
P4
P4’
P1
P1’
P3’
P2’
P2
P3
P0
P0 : Scaling center
P1 to P4 : Programmed figure
P1’ to P4’ : Scaled figure
0
Fig. 15.2 (a) Scaling


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 343 -
Format
Scaling up or down along all axes at the same rate of magnification 
(When bit 6 (XSC) of parameter No. 5400 = 0)
Format Meaning of command
G51 IP_P_ ; Scaling start
Scaling is effective.
(Scaling mode)
G50 ; Scaling cancel
IP_ : Absolute command for center coordinate 
value of scaling
P_ : Scaling magnification
Scaling up or down along each axes at a different rate of magnification (mirror image)


key: chroma:document
string_value:
(When bit 6 (XSC) of parameter No. 5400 = 1)
Format Meaning of command
G51 IP_I_J_K_; Scaling start
Scaling is effective.
(Scaling mode)
G50 ; Scaling cancel
IP_ : Absolute command for center coordinate 
value of scaling
I_J_K_ : Scaling magnification for basic 3 axes (X, Y, 
and Z axes) respectively
T
NOTE
This function is available when the G-code system B or C is set.
CAUTION
1 Specify G51 in a separate block.


key: chroma:document
string_value:
2 After the figure is enlarged or reduced, specify G50 to cancel the scaling mode.
NOTE
1 Entering electronic calculator decimal point input mode (bit 0 (DPI) of parameter 
No. 3401 = 1) does not cause the units of the magnification rates P, I, J, and K 
to change.
2 Setting the least input increment equal to 10 times the least command increment 
(bit 7 (IPR) of parameter No. 1004 = 1) does not cause the units of the 
magnification rates P, I, J, and K to change.


key: chroma:document
string_value:
3 An attempt to specify 0 as a magnification rate causes alarm PS0142, “ILLEGAL 
SCALE RATE” to occur in a G51 block.
Explanation
- Axis for which scaling is to be enabled
For the axis for which scaling is to be enabled, set bit 0 (SCL) of parameter No. 5401 to 1.
- Minimum unit of scaling magnification
Least input increment of scaling magnification is: 0.001 or 0.00001.
It is 0.00001 (one hundred thousandth) if bit 7 (SCR) of parameter No. 5400 is 0 and 0.001 if it is 1.
- Scaling center


key: chroma:document
string_value:
- Scaling center
Even in incremental command (G91) mode, the scaling center coordinates IP_ specified in the G51 block 
are assumed those of an absolute position.
If the scaling center coordinates are omitted, the position assumed when G51 is specified is assumed the 
scaling center.


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 344 -
CAUTION
With the move command subsequent to the G51 block, execute an absolute 
(G90 mode) position command.
If no absolute position command is executed after the G51 block, the position 
assumed when G51 is specified is assumed the scaling center; once an absolute 
position command is executed, the scaling center assumes the coordinates 
specified in the G51 block, after that block.


key: chroma:document
string_value:
- Scaling along each axis at the same rate of magnification
Set bit 6 (XSC) of parameter No. 5400 to 0.
If the scaling magnification P is not specified, the magnification set in parameter No. 5411 is used.
Decimal point input is not accepted as the magnification P. If decimal point input is made, alarm PS0007, 
“ILLEGAL USE OF DECIMAL POINT” will occur.
A negative value cannot be specified as the magnification P. If a negative value is specified, alarm


key: chroma:document
string_value:
PS0006, “ILLEGAL USE OF MINUS SIGN” will occur.
The allowable magnification range is from 0.00001 to 9999.99999.
- Scaling of each axis, programmable mirror image (negative magnification)
Each axis can be scaled by different magnifications. Also when a negative magnification is specified, a 
mirror image is applied. The axis subject to the mirror image is the one that contains the scaling center.
Set bit 6 (XSC) of parameter No. 5400 to 1 to validate each axis scaling (mirror image).


key: chroma:document
string_value:
Using I, J, and K, specify the scaling magnifications for the basic 3 axes (X to Z axes). Use parameter No. 
1022 to specify which axes to use as the basic 3 axes. For those of the X to Z axes for which I, J, and K 
are not specified and for axes other than the basic 3 axes, the magnification set with parameter No. 5421 
is used.
A value other than 0 must be set to parameter No. 5421.
Decimal point programming can not be used to specify the rate of magnification (I, J, K).


key: chroma:document
string_value:
Magnification can be set within the range of ±0.00001 to ±9999.99999.
Y axis
X axis
b
a
d
a/b : Scaling magnification of X axis
c/d : Scaling magnification of Y axis
 o : Scaling center
Programmed figure
Scaled figure
o
c
Fig. 15.2 (b) Scaling of each axis


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 345 -
CAUTION
Specifying the following commands at the same time causes them to be 
executed in the order indicated below:
<1> Programmable mirror image (G51.1)
<2> Scaling (G51) (including a mirror image with a negative magnification)
<3> Mirror image due to the external switch of the CNC or the settings of the 
CNC
In this case, the programmable mirror image is effective to the scaling center 
and magnification as well.


key: chroma:document
string_value:
and magnification as well.
To specify G51.1 and G51 at the same time, specify them in this order; to cancel 
them, specify them in the reverse order.
- Scaling of circular interpolation
Even if different magnifications are applied to each axis in circular interpolation, the tool will not trace an 
ellipse.
G90 G00 X0.0 Y100.0 Z0.0;
G51 X0.0 Y0.0 Z0.0 I2000 J1000;
(A magnification of 2 is applied to the X-component and a magnification of 1 is applied to the 
Y-component.)


key: chroma:document
string_value:
Y-component.) 
G02 X100.0 Y0.0 I0 J–100.0 F500;
Above commands are equivalent to the following command:
G90 G00 X0.0 Y100.0 Z0.0;
G02 X200.0 Y0.0 I0 J–100.0 F500;
(Because the end point is not on an arc, spiral interpolation is assumed.)
(0,0) (100.0) (200.0)
Y
X
Scaled shape
Fig. 15.2 (c) Scaling for circular interpolation
Even for an R-specified arc, scaling is applied to each of I, J, and K after the radius value (R) is converted 
into a vector in the center direction of each axis.


key: chroma:document
string_value:
If, therefore, the above G02 block contains the following R-specified arc, the operation will be same as 
that in which I and J are specified.
G02 X100.0 Y0.0 R100.0 F500 ;
- Scaling and coordinate system rotation
If both scaling and coordinate system rotation are specified at the same time, scaling is performed first, 
followed by coordinate system rotation. In this case, scaling is effective to the rotation center as well.


key: chroma:document
string_value:
To specify both of them, specify scaling first and then coordinate system rotation. To cancel them, 
specify them in the reverse order.
Example
Main program
O1
G90 G00 X20.0 Y10.0 ;


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 346 -
M98 P1000 ;
G51 X20.0 Y10.0 I3000 J2000 ; (×3 in the X direction and ×2 in the Y direction)
M98 P1000 ;
G17 G68 X35.0 Y20.0 R30. ;
M98 P1000 ;
G69 ;
G50 ;
M30 ;
Subprogram
O1000 ;
G01 X20.0 Y10.0 F500 ;
G01 X50.0 ;
G01 Y30.0 ;
G01 X20.0 ;
G01 Y10.0 ;
M99 ;
Y
X
Scaling center
Original program
Shape after
coordinate system
rotation Scaled shape
Rotation center of
coordinate system
after scaling
Rotation center


key: chroma:document
string_value:
after scaling
Rotation center
of coordinate
system before
scaling
Fig. 15.2 (d) Scaling and coordinate system rotation
- Scaling and optional chamfering/corner R
Chamfering
Scaling
x 2 in the X direction
x 1 in the Y direction
Corner R
If different magnifications are applied to the individual axes, corner R results 
in a spiral, not an arc, because scaling is applied to the end point and radius 
of the arc.
Scaling
x 2 in the X direction
x 1 in the Y direction


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 347 -
Limitation
- Tool compensation
This scaling is not applicable to tool radius tool nose radius compensation values, tool length 
compensation values, and tool offset values (Fig. 15.2 (f)).
Cutter compensation values are not scaled.
Programmed figure
Scaled figure
Fig. 15.2 (f) Scaling during cutter compensation
- Invalid scaling
M
Scaling is not applied to the travel distance during canned cycle shown below.


key: chroma:document
string_value:
• Cut-in value Q and retraction value d of peck drilling cycle (G83, G73).
• Fine boring cycle (G76)
• Shift value Q of X and Y axes in back boring cycle (G87).
In manual operation, the travel distance cannot be increased or decreased using the scaling.
T
This function is available to G code systems B and C only; it is not available to G code system A.
During scaling, the following functions cannot be used. If any of them is specified, alarm PS0300, 
“ILLEGAL COMMAND IN SCALING” will occur.


key: chroma:document
string_value:
• Finishing cycle (G70, G72)
• Outer surface rough cutting cycle (G71, G73)
• End rough cutting cycle (G72, G74)
• Closed loop cutting cycle (G73, G75)
• End cutting off cycle (G74, G76)
• Outer/inner surface cutting off cycle (G75, G77)
• Multiple threading cycle (G76, G78)
• Traverse grinding cycle (for grinding machines) (G71, G72)
• Traverse direct constant-size grinding cycle (for grinding machines) (G72, G73)
• Oscillation grinding cycle (for grinding machines) (G73, G74)


key: chroma:document
string_value:
• Oscillation direct constant-size grinding cycle (for grinding machines) (G74, G75)
• Face drilling cycle (G83, G83)
• Face tapping cycle (G84, G84)


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 348 -
• Face boring cycle (G85, G85)
• Side drilling cycle (G87, G87)
• Side tapping cycle (G88, G88)
• Side boring cycle (G89, G89)
• Outer/inner surface turning cycle (G77, G20)
• Threading cycle (G78, G21)
• End turning cycle (G79, G24) (The G code in system B is given first, followed by that of system C.)
In manual operation, the travel distance cannot be increased or decreased using the scaling.


key: chroma:document
string_value:
If, during scaling, tool position compensation with a coordinate system shift (bit 2 (LWT) of parameter 
No. 5002 = 1 or bit 4 (LGT) of parameter No. 5002 = 0) is specified, alarm PS0509, "TOOL OFFSET 
COMMAND IS NOT AVAILABLE", is issued. This is also true if bit 6 (EVO) of parameter No. 5001 is 
set to 1 and the tool position compensation value is changed.
CAUTION
1 If a parameter setting value is employed as a scaling magnification without


key: chroma:document
string_value:
specifying P, the setting value at G51 command time is employed as the scaling 
magnification, and a change of this value, if any, is not effective.
2 Before specifying the G code for reference position return (G27, G28, G29, G30, 
etc.) or coordinate system setting (G52 to G59, G92, etc.), cancel the scaling 
mode. If any of them is specified during scaling, alarm PS0412, “AN UNUSABLE 
G CODE WAS USED”, will occur.
3 If scaling results are rounded by counting fractions of 5 and over as a unit and


key: chroma:document
string_value:
disregarding the rest, the move amount may become zero. In this case, the 
block is regarded as a no movement block, and therefore, it may affect the tool 
movement by cutter compensation. See the description of cutter compensation.
4 Refrain from scaling on a rotation axis for which the rollover function is enabled. 
Otherwise, the tool may rotate in a short-cut manner, possibly resulting in 
unexpected movement.
NOTE
1 The position display represents the coordinate value after scaling.


key: chroma:document
string_value:
2 When a mirror image was applied to one axis of the specified plane, the 
following results:
(1) Circular command .........................................Direction of rotation is reversed.
(2) Tool radius ⋅ tool nose radius compensation .Offset direction is reversed.
(3) Coordinate system rotation ...........................Rotation angle is reversed.
Example
Sample program of a scaling in each axis
O1;
G51 X20.0 Y10.0 I750 J250; (× 0.75 in the X direction, × 0.25 in the Y direction)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 349 -
Y axis
X axis
100
75
Programmed figure
Scaled figure
Scaling center
80
20
90
10
20 95 120
30
(60,50)
Fig. 15.2 (g) Program example of scaling in each axis 
15.3 PROGRAMMABLE MIRROR IMAGE (G50.1, G51.1)
A mirror image of a programmed command can be produced with respect to a programmed axis of
symmetry (Fig. 15.3 (a)).
Y
60 100
50
50 X
60
100
(2) (1)
(3) (4)
(1) Original image of a programmed command


key: chroma:document
string_value:
(2) Image symmetrical about a line parallel to the Y-axis and crossing the
X-axis at 50
(3) Image symmetrical about point (50, 50)
(4) Image symmetrical about a line parallel to the X-axis and crossing the
Y-axis at 50
Axis of symmetry (X=50)
Axis of symmetry
(Y=50) 40
0
0 40
Fig. 15.3 (a) Programmable mirror image


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 350 -
Format
G51.1 IP_ ; Setting a programmable image
:
:
:
G50.1 IP_ ; Canceling a programmable mirror image
IP_ : Point (position) and axis of symmetry for producing a mirror image when specified with 
G51.1.
Axis of symmetry for producing a mirror image when specified with G50.1. Point of 
symmetry is not specified.
Explanation
- Mirror image by setting


key: chroma:document
string_value:
- Mirror image by setting
If the programmable mirror image function is specified when the command for producing a mirror image 
is also selected by a CNC external switch or CNC setting (see III Section 4.8, “MIRROR IMAGE”), the 
programmable mirror image function is executed first.
- Mirror image on a single axis in a specified plane
Applying a mirror image to one of the axes on a specified plane changes the following commands as 
follows :
Command Explanation


key: chroma:document
string_value:
follows :
Command Explanation
Circular command G02 and G03 are interchanged.
Tool radius ⋅ tool nose radius compensation G41 and G42 are interchanged.
Coordinate system rotation CW and CCW (directions of rotation) are interchanged.
- Mirror image to rotary axis
The programmable mirror image function is executed to a rotary axis as well as a linear axis.
Limitation
- Scaling and coordinate system rotation


key: chroma:document
string_value:
Processing proceeds from program mirror image to scaling and coordinate system rotation in the stated 
order. The commands should be specified in this order, and, for cancellation, in the reverse order. Do not 
specify G50.1 or G51.1 during scaling or coordinate system rotation mode.
- Commands related to reference position return and coordinate system
In programmable mirror image mode, G codes related to reference position return (G27, G28, G29, G30,


key: chroma:document
string_value:
etc.) and those for changing the coordinate system (G52 to G59, G92, etc.) must not be specified. If any 
of these G codes is necessary, specify it only after canceling the programmable mirror image mode.
T
If, during the programmable mirror image mode, tool position compensation with a coordinate system 
shift (bit 2 (LWT) of parameter No. 5002 = 1 or bit 4 (LGT) of parameter No. 5002 = 0) is specified, 
alarm PS0509, "TOOL OFFSET COMMAND IS NOT AVAILABLE", is issued.


key: chroma:document
string_value:
This is also true if bit 6 (EVO) of parameter No. 5001 is set to 1 and the tool position compensation value 
is changed.
A mirror image of a command specified in these blocks is produced
with respect to the axis of symmetry specified by G51.1 IP_;.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 351 -
15.4 NORMAL DIRECTION CONTROL (G40.1,G41.1,G42.1)
Overview
When a tool with a rotation axis (C-axis) is moved in the XY plane during cutting, the normal direction 
control function can control the tool so that the C-axis is always perpendicular to the tool path (Fig. 15.4
(a)). 
Tool
Tool
Programmed tool path
Normal direction (in 
which the tool moves)
C-axis
C-axis
Fig. 15.4 (a) Sample Movement of the tool
Format


key: chroma:document
string_value:
Format
G41.1 ; Normal direction control, left
G42.1 ; Normal direction control, right
G40.1 ; Cancel normal direction control
The normal direction control, left (G41.1) command is used when the workpiece is on the 
right side of the tool as viewed while you are looking into the tool’s way.
Once either G41.1 or G42.1 is issued, normal direction control is enabled (normal 
direction control mode).
Issuing G40.1 cancels the normal direction control mode.


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 352 -
Center of the arc
Programmed tool path
Tool center path Tool center path
Programmed tool path
Fig. 15.4 (b) Normal direction control, left (G41.1) Fig. 15.4 (c) Normal direction control, right (G42.1)
Explanation
- Angle of the C axis
When viewed from the center of rotation around the C-axis, the angular displacement about the C-axis is


key: chroma:document
string_value:
determined as shown in Fig. 15.4 (d). The positive side of the X-axis is assumed to be 0, the positive side 
of the Y-axis is 90°, the negative side of the X-axis is 180°, and the negative side of the Y-axis is 270°.
Center of rotation
+Y
180° +X
270°
0°
90°
Fig. 15.4 (d) Angle of the C axis
- Normal direction control of the C axis
When the cancel mode is switched to the normal direction control mode, the C-axis becomes


key: chroma:document
string_value:
perpendicular to the tool path at the beginning of the block containing G41.1 or G42.1.
In the interface between blocks in the normal direction control mode, a command to move the tool is 
automatically inserted so that the C-axis becomes perpendicular to the tool path at the beginning of each 
block. The tool is first oriented so that the C-axis becomes perpendicular to the tool path specified by the 
move command, then it is moved along the X- and Y axes.


key: chroma:document
string_value:
In the cutter compensation mode, the tool is oriented so that the C-axis becomes perpendicular to the tool 
path created after compensation.
In single-block operation, the tool is not stopped between a command for rotation of the tool and a 
command for movement along the X- and Y-axes. A single-block stop always occurs after the tool is 
moved along the X- and Y-axes.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 353 -
S
N1
N2
S
N3
S
Programmed tool path
S : Single block stop point
Tool center path
S
S
Fig. 15.4 (e) Point at which a single-block stop occurs in the normal direction control mode
Before circular interpolation is started, the C-axis is rotated so that the C-axis becomes normal to the arc 
at the start point. During circular interpolation, the tool is controlled so that the C-axis is always


key: chroma:document
string_value:
perpendicular to the tool path determined by circular interpolation.
Center of the arc
Programmed tool path
Tool center path
The tool is controlled so that the C-axis 
is always normal to the tool path 
determined by circular interpolation.
A rotation command is inserted so 
that the C-axis becomes normal to 
the arc at the start point.
Fig. 15.4 (f) Normal direction control of the circular interpolation
NOTE
During normal direction control, the C axis always rotates through an angle less


key: chroma:document
string_value:
than 180 deg. I.e., it rotates in whichever direction provides the shorter route.
- C axis feedrate
Movement of the tool inserted at the beginning of each block is executed at the feedrate set in parameter 
5481. If dry run mode is on at that time, the dry run feedrate is applied. If the tool is to be moved along 
the X-and Y-axes in rapid traverse (G00) mode, the rapid traverse feedrate is applied.
The feedrate of the C axis during circular interpolation is defined by the following formula.


key: chroma:document
string_value:
F × Amount of movement of the C axis (deg) (deg/min) Length of arc (mm or inch)
F : Feedrate (mm/min or inch/min) specified by the corresponding block of the arc
Amount of movement of the C axis : The difference in angles at the beginning and the end of the block.
NOTE
If the feedrate of the C axis exceeds the maximum cutting speed of the C axis 
specified to parameter No. 1430, the feedrate of each of the other axes is 
clamped to keep the feedrate of the C axis below the maximum cutting speed of


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 354 -
- Normal direction control axis
A C-axis to which normal-direction control is applied can be assigned to any axis with parameter No. 
5480.
- Angle for which figure insertion is ignored
When the rotation angle to be inserted, calculated by normal-direction control, is smaller than the value 
set with parameter No. 5482, the corresponding rotation block is not inserted for the axis to which


key: chroma:document
string_value:
normal-direction control is applied. This ignored rotation angle is added to the next rotation angle to be 
inserted, the total angle being subject to the same check at the next block.
If an angle of 360 degrees or more is specified, the corresponding rotation block is not inserted.
If an angle of 180 degrees or more is specified in a block other than that for circular interpolation with a 
C-axis rotation angle of 180 degrees or more, the corresponding rotation block is not inserted.


key: chroma:document
string_value:
- Movement for which arc insertion is ignored
Specify the maximum distance for which machining is performed with the same normal direction as that 
of the preceding block.
• Linear movement
When distance N2, shown below, is smaller than the set value, machining for block N2 is performed 
using the same direction as that for block N1.
N1
N2
N3
Tool center path
Distance
Programmed tool path
• Circular movement


key: chroma:document
string_value:
• Circular movement
When the diameter of block N2, shown below, is smaller than the set value, machining for block N2 
is performed using the same normal direction as that for block N1. And control as compensation 
along the circular arc is not performed.
N1
N2
N3
Tool center path
Programmed tool path
Diameter


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 355 -
NOTE
1 Do not specify any command to the C axis during normal direction control. Any 
command specified at this time is ignored.
2 Before processing starts, it is necessary to correlate the workpiece coordinate of 
the C axis with the actual position of the C axis on the machine using the 
coordinate system setting (G92) or the like.
3 The helical cutting option is required to use this function. Helical cutting cannot


key: chroma:document
string_value:
be specified in the normal direction control mode.
4 Normal direction control cannot be performed by the G53 move command.
5 The C-axis must be a rotation axis.
6 The following functions must be commanded with normal direction control cancel 
mode (G40.1).
- Plane selection command
- AI contour control
T
NOTE
In the normal direction control mode, the following commands cannot be issued. 
An attempt to issue any of them results in alarm PS1471 being raised.


key: chroma:document
string_value:
- Plane selection command (G17, G18, G19)
- Automatic reference position return(G28)
- 2nd/3rd/4th reference position return(G30)
- Move from the reference position (G29)


key: chroma:document
string_value:
15. COMPENSATION FUNCTION PROGRAMMING B-64694EN/01
- 356 -
15.5 TOOL OFFSET FOR MILLING AND TURNING FUNCTION
(G43.7)
T
Overview
In the past, the tool offset screen for the machining center system was different from that for the lathe 
system. This function enables display and manipulation of offset data on a common tool offset screen.
Format
Conforms to the format for the lathe system. For details, refer to "EXTENDED TOOL SELECTION" in 
"OPERATOR'S MANUAL (For Lathe System) (B-64694EN-1)"


key: chroma:document
string_value:
Explanation
- Tool length compensation on the Z-axis
Of the compensation amounts used with the functions below, only the value set for "Z/LENGTH" on the 
tool offset screen are used. Values set for "X", "Y", "NOSE R/RAD", etc. are not used.
G43 / G44: Tool length offset
- Programmable data input (G10)
The data format used to input/output offset data on the tool offset screen and to input offset data due to 
program operation is the G10 format, below.
- G10 data format


key: chroma:document
string_value:
- G10 data format
G10 Lbaaa ＋ Various tool offset formats
- L format: Lbaaa
aaa : 200- Tool offset, tool-nose radius compensation (cutter compensation), 
virtual tool tip direction
Tool wear compensation
: 201- Tool offset, tool-nose radius compensation (cutter compensation), 
virtual tool tip direction
Tool geometry compensation
b : 0- Writes the specified data over the existing data.
: 1- Adds the specified data to the existing data.
- Various tool offset formats


key: chroma:document
string_value:
- Various tool offset formats
aaa : 200,201- Tool offset, tool-nose radius compensation (cutter 
compensation), virtual tool tip direction
P_ : Tool offset number
X_ : Tool offset amount on the X-axis
Z_ : Tool offset amount on the Z-axis (tool length compensation)
R_ : Tool-nose radius compensation amount (cutter 
compensation amount)
Q_ : Virtual tool tip direction
Y_ : Tool offset amount on the Y-axis


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 15. COMPENSATION FUNCTION
- 357 -
• Example
O0010;
G10L200P1X_Z_R_Q_Y_; Overwrite tool wear compensation, such as tool offset.
G10L1200P1X_Z_R_Q_Y_; Add tool wear compensation, such as tool offset.
G10L201P1X_Z_R_Y_; Overwrite tool geometry compensation, such as tool offset.
G10L1201P1X_Z_R_Y_; Add tool geometry compensation, such as tool offset.
: :
M02;
- Input in the G10 format 
Offset data can be input in the G10 format of the lathe system.


key: chroma:document
string_value:
G10P1X1.001Z2.001R3.001Q4Y5.001
Pn : Tool offset number (1 to number of tool compensation values)
Pn ≤ 10000 : Tool wear compensation
Pn ≥ 10001 : Tool geometry compensation
X_ : X axis tool offset 
Z_ : Z axis tool offset
R_ : Tool nose radius compensation
Q_ : Virtual tool tip direction
Y_ : Y axis tool offset
- Custom macro system variables
In this function, there is no change in the referred custom macro system variables.
Limitation


key: chroma:document
string_value:
Limitation
(1) Functions that cannot be used together with this function
- MANUAL GUIDE i
If the above function is ordered together with this function, the tool offset screen is replaced by the 
conventional screen, so that G43.7 cannot be used.
(2) If this function is used, part of the specifications of the function below is limited.
Tool offset protection cannot be performed with the 8-level data protection function.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 358 -
16 CUSTOM MACRO
Although subprograms are useful for repeating the same operation, the custom macro function also allows 
use of variables, arithmetic and logic operations, and conditional branches for easy development of 
general programs such as pocketing and user-defined canned cycles.
A machining program can call a custom macro with a simple command, just like a subprogram.
O0001 ;
 :
 :
 :
G65 P9010 R50.0 L2 ;
 :
 :
M30 ;


key: chroma:document
string_value:
:
 :
M30 ;
Machining program Custom macro
O9010 ;
#1=#18/2 ;
G01 G42 X#1 Y#1 F300 ;
02 X#1 Y-#1 R#1 ;
 :
 :
 :
M99 ;
16.1 VARIABLES
An ordinary machining program specifies a G code and the travel distance directly with a numeric value; 
examples are G00 X100.0.
With a custom macro, numeric values can be specified directly or using a variable number. When a 
variable number is used, the variable value can be changed by a program or using operations on the MDI 
unit.
#1=#2+100 ;


key: chroma:document
string_value:
unit.
#1=#2+100 ;
G01 X#1 F300 ;
Explanation
- Variable representation
When specifying a variable, specify a number sign (#) followed by a variable number.
#i (i = 1, 2, 3, 4, .....)
[Example] #5
#109
#1005
A variable can also be represented as follows using <expression> described in the section about 
arithmetic and logic operation commands.
#[<expression>]
[Example] #[#100]
#[#1001-1]
#[#6/2]
Variable #i shown in the following can be replaced with a variable of #[<expression>].


key: chroma:document
string_value:
- Types of variables
Variables can be classified as local variables, common variables, and system variables according to the 
variable number. Each of those variables has its own usage and characteristics. Read-only system 
constants are also provided.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 359 -
- Range of variable values
Local and common variables can have a value in the following ranges. If the result of calculation exceeds 
the range, an alarm PS0111, “OVERFLOW :FLOATING” is issued.
When bit 0 (F16) of parameter No.6008 = 0
Maximum value: approx. ±10308
Minimum value: approx. ±10-308
Numeric data handled by a custom macro conforms to the IEEE standard and is handled as a


key: chroma:document
string_value:
double-precision real number. An error resulting from operation depends on the precision.
When bit 0 (F16) of parameter No.6008 = 1
Maximum value: approx. ±1047
Minimum value: approx. ±10-29
- Local variable (#1-#33)
A local variable is a variable that is used locally in a macro. That is, local variable #i used by a macro 
called at a certain time is different from that used by a macro called at another time, regardless of whether


key: chroma:document
string_value:
the two macros are the same. Therefore, for example, when macro A calls macro B during multiple calls 
or the like, it is impossible for macro B to corrupt a local variable used by macro A by erroneously using 
the variable.
A local variable is used to pass arguments. For information on correspondence between arguments and 
addresses, see the section about macro calling commands. The initial state of a local variable to which no


key: chroma:document
string_value:
arguments are passed is <null> and the user can freely use the variable. The attribute of a local variable is 
READ/WRITE enabled.
- Common variable (#100-#199, #500-#999, #98000-#98499)
A common variable is shared among the main program, subprograms called by the main program, and 
macros while a local variable is used locally in a macro. That is, #i used by a macro is the same as that used 
by another macro. Therefore, a resultant common variable obtained by using a macro can be used by another


key: chroma:document
string_value:
macro. The attribute of a common variable is basically READ/WRITE enabled. However, the common 
variable can be protected (its attribute is set to READ only) by specifying its variable number using 
parameters Nos.6031 and 6032. A common variable can be freely used by the user even when its usage is 
not defined by the system. The number of common variables can be specified by selecting one of the 
following.
(a) 100 common variables (Bit 6 (NCV) of parameter No. 8135 is 1)


key: chroma:document
string_value:
The common variables #100 to #149 and #500 to #549 can be used. The variables #100 to #149 are 
cleared during power-down, but the variables #500 to #549 are retained during power-down.
(b) 600 common variables (Bit 6 (NCV) of parameter No. 8135 is 0)
The common variables #100 to #199 and #500 to #999 can be used. The variables #100 to #199 are 
cleared during power-down, but the variables #500 to #999 are retained during power-down.


key: chroma:document
string_value:
(c) 1100 common variables (Addition of custom macro variables 1000 required.)
The common variables #100 to #199, #500 to #999 and #98000 to #98499 can be used. The 
variables #100 to #199 are cleared during power-down, but the variables #500 to #999 and #98000 
to #98499 are retained during power-down.
NOTE
The default value of the common variables (#100 to #149(#199)) that are
cleared during power-down is <null>.
The default value of the common variables (#500 to #549(#999) , (#98000 to


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 360 -
- Write protection of a common variable
Multiple common variables (#500 to #999) can be protected (their attributes are set to READ only) by 
setting variable numbers in parameters Nos.6031 and 6032. This protection is enabled for both Input/All 
Clear by MDI on the macro screen and write operation by a macro program. If the NC program specifies 
WRITE operation (used in the left side) for a common program in the set range, an alarm PS0116,


key: chroma:document
string_value:
“WRITE PROTECTED VARIABLE” is issued.
- Custom macro common variables between each path
Some or all of the custom macro common variables (#100 to #149 (#199, #499) and #500 to #599 (#999)) 
can be made common to all paths by setting parameter No. 6036 (#100 to #149 (#199, #499)) and 
parameter No. 6037 (#500 to #599 (#999)) appropriately. Also, whether or not to make the variables 
common can be selected on a path-by-path basis by setting bit 0 (NC1) of parameter No. 6020 for


key: chroma:document
string_value:
parameter No. 6036 and bit 1 (NC2) of parameter No. 6020 for parameter No. 6037 appropriately.
[Example]
Assume that system common parameter No. 6036 is set to 20.
If the setting of parameter No. 6036 is not to be reflected in the fourth path only, make the settings 
below (Table 16.1 (a)).
Table 16.1 (a)
Path number No.6036 NC1 Area of the custom macro variables used
1
20
0
Variables #100 to #119 are common to all paths, while 
other variables for each path are independent. 2 0
3 0


key: chroma:document
string_value:
3 0
4 1 Variables for path 4 are all independent.
- System variable
A variable whose usage does not vary in the system. The attribute of a system variable is READ only, 
WRITE only, or READ/WRITE enabled depending on the nature of a system variable.
- System constant
A system constant can be referenced as with a variable even though its value is fixed. The attribute of a 
system constant is READ only.
- Omission of the decimal point


key: chroma:document
string_value:
When a variable value is defined in a program, the decimal point can be omitted.
[Example] When #1 = 123; is defined, the actual value of variable #1 is 123.000.
- Referencing variables
The value following an address can be replaced with a variable. When programming as <address>#i or 
<address>-#i, the variable value or the complement of it is used as the specified value of the address.
[Example] F#33 is the same as F1.5 when #33 = 1.5.
Z-#18 is the same as Z-20.0 when #18 = 20.0.


key: chroma:document
string_value:
G#130 is the same as G3 when #130 = 3.0.
A variable cannot be referenced using address/, :, or O and N.
[Example] Programming such as O#27 or N#1 is not allowed.
n (n = 1 to 9) in the optional block skip /n cannot be a variable.
A variable number cannot be specified by a direct variable.
[Example] When replacing 5 in #5 with #30, specify #[#30] instead of ##30. No values 
exceeding the maximum allowable value for each address can be specified.


key: chroma:document
string_value:
[Example] When #140 = 10000, G#140 exceeds the maximum allowable value.
When a variable is used as address data, the variable is automatically rounded off 
to the number of significant figures of each address or less.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 361 -
[Example] For a machine with an increment system of 1/1000 mm (IS-B), when #1 = 12.3456, 
G00 X#1; becomes G00 X12.346;.
If <expression>, described later, is used, the value following an address can be 
replaced with <expression>.
<address>[<expression>] or <address>-[<expression>]
The program code shown above indicates the value of <expression> or the 
complement of the value is used as an address value. Note that a constant with no


key: chroma:document
string_value:
decimal point, enclosed in brackets ([ ]), is assumed to have a decimal point at the 
end.
[Example] X[#24+#18*COS[#1]]
Z-[#18+#26]
- Undefined variable
When the value of a variable is not defined, such a variable is referred to as a "null" variable. Variables 
#0 and #3100 are always null variables. They cannot be written to, but they can be read.
(a) Quotation
When an undefined variable is quoted, the address itself is also ignored.
Original command G90 X100 Y#1


key: chroma:document
string_value:
Original command G90 X100 Y#1
Equivalent command when #1 = <null> G90 X100
Equivalent command when #1 = 0 G90 X100 Y0
(b) Definition/replacement, addition, multiplication
When a local variable or common variable is directly replaced with <null>, the result is <null>. 
When a system variable is directly replaced with <null> or the result of calculation including <null> 
is replaced, a variable value of 0 is assumed.
Original expression (local variable) #2=#1 #2=#1*5 #2=#1+#1


key: chroma:document
string_value:
Replacement result (when #1 = <null>) <null> 0 0
Replacement result (when #1 = 0) 0 0 0
Original expression (common variable) #100=#1 #100=#1*5 #100=#1+#1
Replacement result
(when #1 = <null>) <null> 0 0
Replacement result (when #1 = 0) 0 0 0
Original expression (system variable) #2001=#1 #2001=#1*5 #2001=#1+#1
Replacement result (when #1 = <null>) 0 0 0
Replacement result (when #1 = 0) 0 0 0
(c) Comparison
<null> differs from 0 only for EQ and NE.
<null> is equal to 0 for GE, GT, LE, and LT.


key: chroma:document
string_value:
- When <null> is assigned to #1
Conditional 
expression #1 EQ #0 #1 NE 0 #1 GE #0 #1 GT 0 #1 LE #0 #1 LT 0
Evaluation 
result
Established 
(true)
Established 
(true)
Established 
(true)
Not 
established 
(false)
Established 
(true)
Not 
established 
(false)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 362 -
- When 0 is assigned to #1
Conditional 
expression #1 EQ #0 #1 NE 0 #1 GE #0 #1 GT 0 #1 LE #0 #1 LT 0
Evaluation
result
Not 
established 
(false)
Not 
established 
(false)
Established 
(true)
Not 
established 
(false)
Established 
(true)
Not 
established 
(false)
- Specifying a system variable (constant) by its name
A system variable (constant) is specified by its variable number, but it can also be specified by its


key: chroma:document
string_value:
predetermined system variable (constant) name. A system variable (constant) name begins with an 
underscore (_), followed by up to seven uppercase letters, numerics, or underscores. For axis-dependent 
variables (such as coordinates) or variables having a lot of data of similar types (such as tool 
compensation), subscript [n] (n: integer) can be used to specify values. In this case, n can be specified in 
<expression> format (calculation format).


key: chroma:document
string_value:
The command format must be specified in [#system-variable-name] format, as shown below.
 [#_DATE]
[Example]
[#_DATE]=20040117 ; : 2004.01.17 is assigned to #3011 (year month date).
[#_TIME]=161705 ; : 16:17:05 is assigned to #3012 (time minute second).
#101=[#_ABSMT[1]] ; : #5021 (machine coordinate value of the 1st axis) is read off 
and assigned to #101.
 #102=[#_ABSKP[#500*2]] ; : #506x (skip position of [#500*2]th axis) is read off and 
assigned to #102.


key: chroma:document
string_value:
assigned to #102.
If a value other than an integer is specified for subscript n, a variable value is referenced, assuming that 
the fractional portion is rounded off.
[Example]
[#_ABSIO[1.4999999]] : This value is assumed to be [#_ABSIO[1]], that is, #5001.
[#_ABSIO[1.5000000]] : This value is assumed to be [#_ABSIO[2]], that is, #5002.
NOTE
1 When the specified variable name is not registered, an alarm PS1098, “NO 
VARIABLE NAME” is issued.


key: chroma:document
string_value:
VARIABLE NAME” is issued.
2 When a negative or other invalid subscript is specified, an alarm PS1099, 
“ILLLEGAL SUFFIX [ ]” is issued.
- System constant #0, #3100-#3102 (Attribute: R)
Constants used as fixed values in the system can be used as system variables. Such constants are called 
system constants. The system constants provided are shown below.
Constant number Constant name Description
#0, #3100 [#_EMPTY] Null
#3101 [#_PI] Circular constant π = 3.14159265358979323846


key: chroma:document
string_value:
#3102 [#_E] Base of natural logarithm e = 2.71828182845904523536
- Specifying a common variable by its name
Specifying a variable name set by the SETVN command described later allows reading from or writing to 
a common variable.
The command must be specified in the form [#common-variable-name] such as [#VAR500].
[Example]
X[#POS1] Y[#POS2] ; : Specifying a position by the variable name
[#POS1] = #100+#101 ; : Executing a assignment statement by the variable name


key: chroma:document
string_value:
#[100+[#ABS]] = 500 ; : Same as above (by a variable number)
#500 = [1000+[#POS2]*10] ; : Reading a variable by a variable name


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 363 -
- Setting and specifying the name of a common variable (SETVN)
For the 50 common variables, #500 to #549, a name of up to eight characters can be specified by using a 
command as shown below. If the custom macro variable name expansion function is enabled, a name of 
up to 31 characters can be specified.
SETVN n [VAR500, VAR501, VAR502,......] ;
n represents the starting number of a common variable for which the name is specified.


key: chroma:document
string_value:
VAR500 is the variable name of variable n, VAR501 is the variable name of variable n+1, and VAR502 
is the variable name of variable number n+2, and so on. Each string is delimited by a comma (,). All 
codes that can be used as meaningful information in a program except control in, control out, [, ], EOB, 
EOR, and : (colon in a program number) can be used. However, each name must begin with an 
alphabetical character. Variable names are not cleared on switch-off.


key: chroma:document
string_value:
Specifying a set variable name allows reading from or writing to the common variable. The command 
must be specified in the form [#common-variable-name] such as [#VAR500].
[Example] SETVN 510[ TOOL_NO, WORK_NO, COUNTER1, COUNTER2 ];
The command above names the variables as follows.
Variable Name
#510 TOOL_NO
#511 WORK_NO
#512 COUNTER1
#513 COUNTER2
The names specified by the command can be used in a program. For example, when 10 is assigned to


key: chroma:document
string_value:
#510, the expression [#TOOL_NO]=10; can be used instead #510=10;.
If the custom macro variable name expansion function is enabled,
the SETVN 510[TOOL_NUMBER000001_CHANGE_DETECT]; command assigns a name of 31 
characters to the variable.
Variable Name
#510 TOOL_NUMBER000001_CHANGE_DETECT
NOTE
If the same name was specified for different common variables, only the variable 
which has the smaller variable number can be referenced with the specified 
name.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 364 -
16.2 SYSTEM VARIABLES
System variables can be used to read and write internal CNC data such as tool compensation values and 
current position data. System variables are essential for automation and general-purpose program 
development.
List of system variables and constants
n represents a subscript.
R, W, and R/W are attributes of a variable and indicate read-only, write-only, and read/write enabled, 
respectively.
- Interface signals
System


key: chroma:document
string_value:
- Interface signals
System 
variable 
number
System 
variable 
name
Attribute Description
#1000-#1031 [#_UI[n]] R Interface input signals (BIT), UI000-UI031
NOTE) Subscript n represents a BIT position (0-31).
#1032-#1035 [#_UIL[n]] R Interface input signals (LONG), UI000-UI031/ UI100-UI131/
UI200-UI231/UI300-UI331
NOTE) Subscript n (0-3): 0 = UI000-UI031, 1 = UI100-UI131, 
2 = UI200-UI231, 3 = UI300-UI331
#1036-#1067 [#_UI[n]] R Interface input signals (BIT), UI400-UI431


key: chroma:document
string_value:
NOTE) Subscript n represents a BIT position (32-63).
#1068-#1071 [#_UIL[n]] R Interface input signals (LONG), UI400-UI431 / UI500-UI531 / 
UI600-UI631 / UI700-UI731
NOTE) Subscript n (4-7): 4=UI400-UI431, 5=UI500-UI531, 
6=UI600-UI631, 7=UI700-UI731
#1100-#1131 [#_UO[n]] R/W Interface output signals (BIT), UO000-UO031
NOTE) Subscript n represents a BIT position (0-31).
#1132-#1135 [#_UOL[n]] R/W Interface output signals (LONG), UO000-UO031/ 
UO100-UO131/UO200-UO231/UO300-UO331


key: chroma:document
string_value:
NOTE) Subscript n (0-3): 0 = UO000-UO031, 1 = UO100-UO131, 
2 = UO200-UO231, 3 = UO300-UO331
#1136-#1167 [#_UO[n]] R/W Interface output signals (BIT), UO400-UO431
NOTE) Subscript n represents a BIT position (32-63).
#1168-#1171 [#_UOL[n]] R/W Interface output signals (LONG), UO400-UO431/ UO500-UO531 / 
UO600-UO631 / UO700-UO731
NOTE) Subscript n (4-7): 4=UO400-UO431, 5=UO500-UO531,
6=UO600-UO631, 7=UO700-UO731


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 365 -
- Tool compensation value
M
When bit 3 (V15) of parameter No.6000 = 0
System variable 
number
System 
variable name Attribute Description
#2001-#2200 [#_OFSHW[n]] R/W Tool compensation value (H code, wear)
Note) Subscript n represents a compensation number (1 to 200).
#10001-#10999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).


key: chroma:document
string_value:
#2201-#2400 [#_OFSHG[n]] R/W Tool compensation value (H code, geometry)
Note) Subscript n represents a compensation number (1 to 200).
#11001-#11999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).
#12001-#12999 [#_OFSDW[n]] R/W Tool compensation value (D code, wear)
Note) Subscript n represents a compensation number (1 to 999).
# 13001-#13999 [#_OFSDG[n]] R/W Tool compensation value (D code, geometry)


key: chroma:document
string_value:
Note) Subscript n represents a compensation number (1 to 999).
When bit 3 (V15) of parameter No.6000 = 1
System variable 
number
System 
variable name Attribute Description
#2001-#2200 [#_OFSHG[n]] R/W Tool compensation value (H code, geometry)
Note) Subscript n represents a compensation number (1 to 200).
#10001-#10999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).
#2201-#2400 [#_OFSHW[n]] R/W Tool compensation value (H code, wear)


key: chroma:document
string_value:
Note) Subscript n represents a compensation number (1 to 200).
#11001-#11999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).
#2401-#2600 [#_OFSDG[n]] R/W Tool compensation value (D code, geometry) (Note 1)
Subscript n represents a compensation number (1 to 200).
Note 1) Enabled when bit 5 (D15) of parameter No.6004 = 1.
#12001-#12999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).


key: chroma:document
string_value:
#2601-#2800 [#_OFSDW[n]] R/W Tool compensation value (D code, wear) (Note 1)
Subscript n represents a compensation number (1 to 200).
Note 1) Enabled when bit 5 (D15) of parameter No.6004 = 1.
#13001-#13999 The numbers to the left can also be used.
Note) Subscript n represents a compensation number (1 to 999).
System variables not dependent on bit 3 (V15) of parameter No. 6000
System variable 
number
System 
variable name Attribute Description


key: chroma:document
string_value:
#21001-#21999 [#_CORR_G[n]] R/W Corner R offset (geometry)
Note) Subscript n represents a compensation number (1 to 999).
#22001-#22999
[#_CORR_W[n]]
R/W Corner R offset (wear)
Note) Subscript n represents a compensation number (1 to 999).


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 366 -
- Tool compensation value
T
Without tool geometry/wear compensation memory
System variable 
number
System 
variable name Attribute Description
#2001-#2064
#10001-#10999
[#_OFSX[n]] R/W X-axis compensation value (*1)
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2101-#2164


key: chroma:document
string_value:
#2101-#2164
#11001-#11999
[#_OFSZ[n]] R/W Z-axis compensation value (*1)
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2201-#2264
#12001-#12999
[#_OFSR[n]] R/W Tool nose radius compensation value
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left


key: chroma:document
string_value:
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2301-#2364
#13001-#13999
[#_OFST[n]] R/W Virtual tool tip T position
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2401-#2449
#14001-#14999
[#_OFSY[n]] R/W Y-axis compensation value (*1)
Note) Subscript n represents a compensation number (1 to 49).


key: chroma:document
string_value:
When the number of sets is larger than 49, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes
With tool geometry/wear compensation memory
System variable 
number
System 
variable name
Attribute Description
#2001-#2064
#10001-#10999
[#_OFSXW[n]] R/W X-axis compensation value (wear) (*1)


key: chroma:document
string_value:
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2101-#2164
#11001-#11999
[#_OFSZW[n]] R/W Z-axis compensation value (wear) (*1)
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).


key: chroma:document
string_value:
#2201-#2264
#12001-#12999
[#_OFSRW[n]] R/W Tool nose radius compensation value (wear)
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2301-#2364
#13001-#13999
[#_OFST[n]] R/W Virtual tool tip T position
Note) Subscript n represents a compensation number (1 to 64).
When the number of sets is larger than 64, the numbers to the left


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 367 -
System variable 
number
System 
variable name
Attribute Description
#2401-#2449
#14001-#14999
[#_OFSYW[n]] R/W Y-axis compensation value (wear) (*1)
Note) Subscript n represents a compensation number (1 to 49).
When the number of sets is larger than 49, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2451-#2499
#19001-#19999
[#_OFSYG[n]] R/W Y-axis compensation value (geometry) (*1)


key: chroma:document
string_value:
Note) Subscript n represents a compensation number (1 to 49).
When the number of sets is larger than 49, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2701-#2749
#15001-#15999
[#_OFSXG[n]] R/W X-axis compensation value (geometry) (*1)
Note) Subscript n represents a compensation number (1 to 49).
When the number of sets is larger than 49, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 49).


key: chroma:document
string_value:
#2801-#2849
#16001-#16999
[#_OFSZG[n]] R/W Z-axis compensation value (geometry) (*1)
Note) Subscript n represents a compensation number (1 to 49).
When the number of sets is larger than 49, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
#2901-#2964
#17001-#17999
[#_OFSRG[n]] R/W Tool nose radius compensation value (geometry)
Note) Subscript n represents a compensation number (1 to 64).


key: chroma:document
string_value:
When the number of sets is larger than 64, the numbers to the left 
can be used.
Note) Subscript n represents a compensation number (1 to 999).
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes
- Workpiece coordinate system shift amount
T
System variable 
number
System variable 
name
Attribute Description
#2501 [#_WKSFTX] R/W X-axis workpiece shift amount
#2601 [#_WKSFTZ] R/W Z-axis workpiece shift amount


key: chroma:document
string_value:
#100751-#100800 [#_WZ_SFT [n]] R/W nth axis workpiece shift amount
Note) Subscript n represents an axis number (1 to 50).
X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes
- Automatic operation or the like
System variable 
number
System variable 
name
Attribute Description
#3000 [#_ALM] W Macro alarm
#3001 [#_CLOCK1] R/W Clock 1 (ms)
#3002 [#_CLOCK2] R/W Clock 2 (hr)
#3003 [#_CNTL1] R/W Enable or disable the suppression of single block stop.


key: chroma:document
string_value:
Enable or disable the waiting of the auxiliary function 
completion signal.
#3003 bit 0 [#_M_SBK] R/W Enable or disable the suppression of single block stop.
#3003 bit 1 [#_M_FIN] R/W Enable or disable waiting for the auxiliary function completion 
signal.
#3004 [#_CNTL2] R/W Enable or disable feed hold.
Enable or disable feedrate override.
Enable or disable exact stop check.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 368 -
System variable 
number
System variable 
name
Attribute Description
#3004 bit 0 [#_M_FHD] R/W Enable or disable feed hold.
#3004 bit 1 [#_M_OV] R/W Enable or disable feedrate override.
#3004 bit 2 [#_M_EST] R/W Enable or disable exact stop check.
#3005 [#_SETDT] R/W Read/write setting data.
#3006 [#_MSGSTP] W Stop with a message.
#3007 [#_MRIMG] R Status of a mirror image (DI and setting)
#3008 [#_PRSTR] R Restarting/not restarting a program


key: chroma:document
string_value:
- Time
System variable 
number
System variable 
name
Attribute Description
#3011 [#_DATE] R Year/Month/Date
#3012 [#_TIME] R Hour/Minute/Second
- Path number of the parameter to be read or written
System variable 
number
System variable 
name
Attribute Description
#3018 － R/W Path number of the parameter to be read or written
- Number of the path on which a macro is being executed
System variable 
number
System variable 
name
Attribute Description


key: chroma:document
string_value:
name
Attribute Description
#3019 [#_PATH_NO] R Number of the path on which a macro is being executed
- Number of parts
System variable 
number
System variable 
name
Attribute Description
#3901 [#_PRTSA] R/W Total number of parts
#3902 [#_PRTSN] R/W Number of required parts
- Tool compensation memory
M
System variable 
number
System variable 
name
Attribute Description
#3980 [#_OFSMEM] R Tool compensation memory information
- Main program number
System variable 
number


key: chroma:document
string_value:
System variable 
number
System variable 
name
Attribute Description
#4000 [#_MAINO] R Main program number
- Modal information
M
System variable 
number
System variable 
name
Attribute Description
#4001-#4030 [#_BUFG[n]] R Modal information on blocks that have been specified by last 
minute (G code)
Note) Subscript n represents a G code group number.
#4102 [#_BUFB] R Modal information on blocks that have been specified by last 
minute (B code)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 369 -
System variable 
number
System variable 
name
Attribute Description
#4107 [#_BUFD] R Modal information on blocks that have been specified by last 
minute (D code)
#4108 [#_BUFE] R Modal information on blocks that have been specified by last 
minute (E code)
#4109 [#_BUFF] R Modal information on blocks that have been specified by last 
minute (F code)
#4111 [#_BUFH] R Modal information on blocks that have been specified by last 
minute (H code)


key: chroma:document
string_value:
minute (H code)
#4113 [#_BUFM] R Modal information on blocks that have been specified by last 
minute (M code)
#4114 [#_BUFN] R Modal information on blocks that have been specified by last 
minute (sequence number)
#4115 [#_BUFO] R Modal information on blocks that have been specified by last 
minute (program number)
#4119 [#_BUFS] R Modal information on blocks that have been specified by last 
minute (S code)
#4120 [#_BUFT] R Modal information on blocks that have been specified by last


key: chroma:document
string_value:
minute (T code)
#4130 [#_BUFWZP] R Modal information on blocks that have been specified by last 
minute (additional workpiece coordinate system number)
#4201-#4230 [#_ACTG[n]] R Modal information on the block currently being executed (G
code)
Note) Subscript n represents a G code group number.
#4302 [#_ACTB] R Modal information on the block currently being executed (B
code)
#4307 [#_ACTD] R Modal information on the block currently being executed (D
code)


key: chroma:document
string_value:
code)
#4308 [#_ACTE] R Modal information on the block currently being executed (E
code)
#4309 [#_ACTF] R Modal information on the block currently being executed (F
code)
#4311 [#_ACTH] R Modal information on the block currently being executed (H
code)
#4313 [#_ACTM] R Modal information on the block currently being executed (M
code)
#4314 [#_ACTN] R Modal information on the block currently being executed 
(sequence number)
#4315 [#_ACTO] R Modal information on the block currently being executed


key: chroma:document
string_value:
(program number)
#4319 [#_ACTS] R Modal information on the block currently being executed (S
code)
#4320 [#_ACTT] R Modal information on the block currently being executed (T
code)
#4330 [#_ACTWZP] R Modal information on the block currently being executed 
(additional workpiece coordinate system number)
#4401-#4430 [#_INTG[n]] R Modal information on interrupted blocks (G code)
Note) Subscript n represents a G code group number.
#4502 [#_INTB] R Modal information on interrupted blocks (B code)


key: chroma:document
string_value:
#4507 [#_INTD] R Modal information on interrupted blocks (D code)
#4508 [#_INTE] R Modal information on interrupted blocks (E code)
#4509 [#_INTF] R Modal information on interrupted blocks (F code)
#4511 [#_INTH] R Modal information on interrupted blocks (H code)
#4513 [#_INTM] R Modal information on interrupted blocks (M code)
#4514 [#_INTN] R Modal information on interrupted blocks (sequence number)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 370 -
System variable 
number
System variable 
name
Attribute Description
#4515 [#_INTO] R Modal information on interrupted blocks (program number)
#4519 [#_INTS] R Modal information on interrupted blocks (S code)
#4520 [#_INTT] R Modal information on interrupted blocks (T code)
#4530 [#_INTWZP] R Modal information on interrupted blocks (additional workpiece 
coordinate system number)
T
System variable 
number
System variable 
name


key: chroma:document
string_value:
number
System variable 
name
Attribute Description
#4001-#4030 [#_BUFG[n]] R Modal information on blocks that have been specified by last 
minute (G code)
Note) Subscript n represents a G code group number.
#4102 [#_BUFB] R Modal information on blocks that have been specified by last 
minute (B code)
#4108 [#_BUFE] R Modal information on blocks that have been specified by last 
minute (E code)
#4109 [#_BUFF] R Modal information on blocks that have been specified by last 
minute (F code)


key: chroma:document
string_value:
minute (F code)
#4113 [#_BUFM] R Modal information on blocks that have been specified by last 
minute (M code)
#4114 [#_BUFN] R Modal information on blocks that have been specified by last 
minute (sequence number)
#4115 [#_BUFO] R Modal information on blocks that have been specified by last 
minute (program number)
#4119 [#_BUFS] R Modal information on blocks that have been specified by last 
minute (S code)
#4120 [#_BUFT] R Modal information on blocks that have been specified by last


key: chroma:document
string_value:
minute (T code)
#4130 [#_BUFWZP] R Modal information on blocks that have been specified by last 
minute (additional workpiece coordinate system number)
#4201-#4230 [#_ACTG[n]] R Modal information on the block currently being executed (G
code)
Note) Subscript n represents a G code group number.
#4302 [#_ACTB] R Modal information on the block currently being executed (B
code)
#4308 [#_ACTE] R Modal information on the block currently being executed (E
code)


key: chroma:document
string_value:
code)
#4309 [#_ACTF] R Modal information on the block currently being executed (F
code)
#4313 [#_ACTM] R Modal information on the block currently being executed (M
code)
#4314 [#_ACTN] R Modal information on the block currently being executed 
(sequence number)
#4315 [#_ACTO] R Modal information on the block currently being executed 
(program number)
#4319 [#_ACTS] R Modal information on the block currently being executed (S
code)


key: chroma:document
string_value:
code)
#4320 [#_ACTT] R Modal information on the block currently being executed (T
code)
#4330 [#_ACTWZP] R Modal information on the block currently being executed 
(additional workpiece coordinate system number)
#4401-#4430 [#_INTG[n]] R Modal information on interrupted blocks (G code)
Note) Subscript n represents a G code group number.
#4502 [#_INTB] R Modal information on interrupted blocks (B code)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 371 -
System variable 
number
System variable 
name
Attribute Description
#4508 [#_INTE] R Modal information on interrupted blocks (E code)
#4509 [#_INTF] R Modal information on interrupted blocks (F code)
#4513 [#_INTM] R Modal information on interrupted blocks (M code)
#4514 [#_INTN] R Modal information on interrupted blocks (sequence number)
#4515 [#_INTO] R Modal information on interrupted blocks (program number)


key: chroma:document
string_value:
#4519 [#_INTS] R Modal information on interrupted blocks (S code)
#4520 [#_INTT] R Modal information on interrupted blocks (T code)
#4530 [#_INTWZP] R Modal information on interrupted blocks (additional workpiece 
coordinate system number)
- Position information
System variable 
number
System variable 
name
Attribute Description
#5001-#5020 [#_ABSIO[n]] R End point position of the previous block (workpiece 
coordinate system)
Note) Subscript n represents an axis number (1 to 20)


key: chroma:document
string_value:
#100001-#100050 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
#5021-#5040 [#_ABSMT[n]] R Specified current position of input unit (machine coordinate 
system)
Note) Subscript n represents an axis number (1 to 20).
#100051-#100100 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
#5041-#5060 [#_ABSOT[n]] R Specified current position (workpiece coordinate system)


key: chroma:document
string_value:
Note) Subscript n represents an axis number (1 to 20).
#100101-#100150 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
#5061-#5080 [#_ABSKP[n]] R Skip position (workpiece coordinate system)
Note) Subscript n represents an axis number (1 to 20).
#100151-#100200 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
#118601-#118650 [#_MCNPOS[n]] R Specified current position of machine unit (machine


key: chroma:document
string_value:
coordinate system). Value of the specified current position 
without servo delay and acceleration / deceleration delay.
Note) Subscript n represents an axis number (1 to 50).
#118651-#118700 [#_ACTMCN [n]] R Current position of machine unit (machine coordinate 
system). Value of the current position with servo delay and 
acceleration / deceleration delay.
Note) Subscript n represents an axis number (1 to 50).
- Tool length compensation value
M
System variable 
number
System variable 
name


key: chroma:document
string_value:
number
System variable 
name
Attribute Description
#5081-#5100 [#_TOFS[n]] R Tool length compensation value
Note) Subscript n represents an axis number (1 to 20).
#100201-#100250 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 372 -
- Tool offset value
T
System variable 
number
System variable
name
Attribute Description
#5081, #100201 [#_TOFSWX] R X-axis tool offset (wear)
#5082, #100202 [#_TOFSWZ] Z-axis tool offset (wear)
#5083, #100203 [#_TOFSWY] Y-axis tool offset (wear)
#5084 - #5100 [#_TOFS[n]] Tool offset (wear) for an arbitrary axis
Note) Subscript n represents an axis number (4 to 20).
#100204-#100250 Tool offset (wear) for an arbitrary axis


key: chroma:document
string_value:
Note) Subscript n represents an axis number (4 to 50).
#5121, #100901 [#_TOFSGX] R X-axis tool offset (geometry)
#5122, #100902 [#_TOFSGZ] Z-axis tool offset (geometry)
#5123, #100903 [#_TOFSGY] Y-axis tool offset (geometry)
#5124 - #5140 [#_TOFSG[n]] Tool offset (geometry) for an arbitrary axis
Note) Subscript n represents an axis number (4 to 20).
#100904-#100950 Tool offset (geometry) for an arbitrary axis
Note) Subscript n represents an axis number (4 to 50).


key: chroma:document
string_value:
X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three axes
- Servo position deviation
System variable 
number
System variable 
name
Attribute Description
#5101-#5120 [#_SVERR[n]] R Servo positional deviation
Note) Subscript n represents an axis number (1 to 20).
#100251-#100300 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
- Manual handle interruption
System variable 
number
System variable


key: chroma:document
string_value:
number
System variable 
name
Attribute Description
#5121-#5140 [#_MIRTP[n]] R Manual handle interruption
Note) Subscript n represents an axis number (1 to 20).
#100651-#100700 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
- Distance to go
System variable 
number
System variable 
name
Attribute Description
#5181-#5200 [#_DIST[n]] R Distance to go
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
#100801-#100850 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
- Workpiece origin offset value, extended workpiece origin offset value
M
System variable 
number
System variable 
name
Attribute Description
#5201-#5220 [#_WZCMN[n]] R/W External workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5221-#5240 [#_WZG54[n]] R/W G54 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 373 -
System variable 
number
System variable 
name
Attribute Description
#5241-#5260 [#_WZG55[n]] R/W G55 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5261-#5280 [#_WZG56[n]] R/W G56 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5281-#5300 [#_WZG57[n]] R/W G57 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
#5301-#5320 [#_WZG58[n]] R/W G58 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5321-#5340 [#_WZG59[n]] R/W G59 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#100301-#100350 [#_WZCMN[n]] R/W External workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100351-#100400 [#_WZG54[n]] R/W G54 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
#100401-#100450 [#_WZG55[n]] R/W G55 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100451-#100500 [#_WZG56[n]] R/W G56 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100501-#100550 [#_WZG57[n]] R/W G57 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100551-#100600 [#_WZG58[n]] R/W G58 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
#100601-#100650 [#_WZG59[n]] R/W G59 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
Extended workpiece origin offset value
#7001-#7020 [#_WZP1[n]] R/W G54.1P1 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#7021-#7040 [#_WZP2[n]] R/W G54.1P2 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
:
:
:
:
:
:
:
:
#7941-#7960 [#_WZP48[n]] R/W G54.1P48 workpiece origin offset value


key: chroma:document
string_value:
Note) Subscript n represents an axis number (1 to 20).
#14001-#14020 [#_WZP1[n]] R/W G54.1P1 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#14021-#14040 [#_WZP2[n]] R/W G54.1P2 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
:
:
:
:
:
:
:
:
#19981-#20000 [#_WZP300[n]] R/W G54.1P300 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
#101001-#101050 [#_WZP1[n]] R/W G54.1P1 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#101051-#101100 [#_WZP2[n]] R/W G54.1P2 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
:
:
:
:
:
:
:
:
#115901-#115950 [#_WZP299[n]] R/W G54.1P299 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#115951-#116000 [#_WZP300[n]] R/W G54.1P300 workpiece origin offset value


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 374 -
T
System variable 
number
System variable 
name
Attribute Description
#5201-#5220 [#_WZCMN[n]] R/W External workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5221-#5240 [#_WZG54[n]] R/W G54 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5241-#5260 [#_WZG55[n]] R/W G55 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
#5261-#5280 [#_WZG56[n]] R/W G56 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5281-#5300 [#_WZG57[n]] R/W G57 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5301-#5320 [#_WZG58[n]] R/W G58 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#5321-#5340 [#_WZG59[n]] R/W G59 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).


key: chroma:document
string_value:
#100301-#100350 [#_WZCMN[n]] R/W External workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100351-#100400 [#_WZG54[n]] R/W G54 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100401-#100450 [#_WZG55[n]] R/W G55 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100451-#100500 [#_WZG56[n]] R/W G56 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
#100501-#100550 [#_WZG57[n]] R/W G57 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100551-#100600 [#_WZG58[n]] R/W G58 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#100601-#100650 [#_WZG59[n]] R/W G59 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
Extended workpiece origin offset value
#7001-#7020 [#_WZP1[n]] R/W G54.1P1 workpiece origin offset value


key: chroma:document
string_value:
Note) Subscript n represents an axis number (1 to 20).
#7021-#7040 [#_WZP2[n]] R/W G54.1P2 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
:
:
:
:
:
:
:
:
#7941-#7960 [#_WZP48[n]] R/W G54.1P48 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 20).
#101001-#101050 [#_WZP1[n]] R/W G54.1P1 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
#101051-#101100 [#_WZP2[n]] R/W G54.1P2 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
:
:
:
:
:
:
:
:
#115901-#115950 [#_WZP299[n]] R/W G54.1P299 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).
#115951-#116000 [#_WZP300[n]] R/W G54.1P300 workpiece origin offset value
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 375 -
- Skip position (detection unit)
System variable 
number
System variable 
name
Attribute Description
#5421-#5440 [#_SKPDTC[n]] R Skip position (detection unit)
Note) Subscript n represents an axis number (1 to 20).
#100701-#100750 The numbers to the left can also be used.
Note) Subscript n represents an axis number (1 to 50).
- Second geometry tool offset value
T
System variable 
number
System variable 
name
Attribute Description


key: chroma:document
string_value:
name
Attribute Description
#5801-#5832
#27001-#27999
[#_OFSX2G[n]] R/W Second geometry tool offset X-axis compensation value
Note) Subscript n represents a compensation number (1 to 
32).
If the number of pairs is greater than 32, the numbers on the 
left are also permitted.
Note) Subscript n represents a compensation number (1 to 
999).
#5833-#5864
#28001-#28999
[#_OFSZ2G[n]] R/W Second geometry tool offset Z-axis compensation value
Note) Subscript n represents a compensation number (1 to


key: chroma:document
string_value:
32).
If the number of pairs is greater than 32, the numbers on the 
left are also permitted.
Note) Subscript n represents a compensation number (1 to 
999).
#5865-#5896
#29001-#29999
[#_OFSY2G[n]] R/W Second geometry tool offset Y-axis compensation value
Note) Subscript n represents a compensation number (1 to 
32).
If the number of pairs is greater than 32, the numbers on the 
left are also permitted.
Note) Subscript n represents a compensation number (1 to 
999).
- Tool management function


key: chroma:document
string_value:
- Tool management function
M
System variable 
number
System variable 
name
Attribute Description
#8400 - R/W Cartridge number
#8401 - R Data number
#8402 - R Tool type number (T)
#8403 - R Tool life counter
#8404 - R Maximum tool life value
#8405 - R Tool notice life value
#8406 - R Tool life status
#8407 - R Customize data 0 (bit)
#8408 - R Tool information
#8409 - R Tool length compensation number (H)
#8410 - R Cutter compensation number (D)
#8411 - R Spindle speed (S)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 376 -
T
System variable 
number
System variable 
name
Attribute Description
#8400 - R/W Cartridge number
#8401 - R Data number
#8402 - R Tool type number (T)
#8403 - R Tool life counter
#8404 - R Maximum tool life value
#8405 - R Tool notice life value
#8406 - R Tool life status
#8407 - R Customize data 0 (bit)
#8408 - R Tool information
#8411 - R Spindle speed (S)
#8412 - R Cutting feedrate (F)
#8413 - R Tool geometry compensation number (G)


key: chroma:document
string_value:
#8414 - R Tool wear compensation number (W)
#8431-#8470 - R Customize data 1 to 40
- Feedrate reduction ratio for rapid traverse overlap
System variable 
number
System variable 
name
Attribute Description
#100851- #100900 [#_ROVLP [n]] R/W Feedrate reduction ratio for rapid traverse overlap
Note) Subscript n represents an axis number (1 to 50).
- Serial spindle
System variable 
number
System variable 
name
Attribute Description
#100951-#100954 [#_SPSTAT[n]] R State of each spindle


key: chroma:document
string_value:
Note) Subscript n represents a spindle number (1 to 4).
- Clamp value of spindle maximum speed
System variable 
number
System variable 
name
Attribute Description
#100959 [#_CSSSMAX] R Spindle maximum speed commanded at clamp command of 
maximum spindle speed
- Dynamic standard tool compensation value
M
System variable 
number
System variable 
name
Attribute Description
#118051-#118100 [#_DOFS1[n]] R/W Dynamic standard tool compensation value (first set)


key: chroma:document
string_value:
Note) Subscript n represents an axis number (1 to 50).
#118101-#118150 [#_DOFS2[n]] R/W Dynamic standard tool compensation value (second set)
Note) Subscript n represents an axis number (1 to 50).
#118151-#118200 [#_DOFS3[n]] R/W Dynamic standard tool compensation value (third set)
Note) Subscript n represents an axis number (1 to 50).
#118201-#118250 [#_DOFS4[n]] R/W Dynamic standard tool compensation value (fourth set)
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
#118251-#118300 [#_DOFS5[n]] R/W Dynamic standard tool compensation value (fifth set)
Note) Subscript n represents an axis number (1 to 50).
#118301-#118350 [#_DOFS6[n]] R/W Dynamic standard tool compensation value (sixth set)
Note) Subscript n represents an axis number (1 to 50).


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 377 -
System variable 
number
System variable 
name
Attribute Description
#118351-#118400 [#_DOFS7[n]] R/W Dynamic standard tool compensation value (seventh set)
Note) Subscript n represents an axis number (1 to 50).
#118401-#118450 [#_DOFS8[n]] R/W Dynamic standard tool compensation value (eighth set)
Note) Subscript n represents an axis number (1 to 50).
- Local coordinate system offset value
System variable 
number
System


key: chroma:document
string_value:
number
System 
variable name Attribute Description
#118501-#118550 [#_LCLOFS[n]] R Local coordinate system offset value
Note) Subscript n represents an axis number (1 to 50).
- Torque difference of Axis synchronous
System variable 
number
System 
variable name Attribute Description
#180801-#180850 [#_SYNTD[n]] R Torque difference of master axis and slave axis in Axis 
synchronous control
Range：-32768 to 32767
Unit：Unit in which the set value corresponding to Nominal


key: chroma:document
string_value:
current limit of Amplifier [Ap] is 6554.
(Note) Subscript n represents an axis number (1 to 50).
- Tool life management
System constant 
number
System 
constant name Attribute Description
#181000 [#_TLMGN_C] R Tool life management data (Tool group numbers)
#181001 [#_TLMML_C] R Tool life management data (Tool life values)
#181002 [#_TLMLC_C] R Tool life management data (Life counter values)
- Others
System constant 
number
System 
constant name Attribute Description


key: chroma:document
string_value:
#8570 - R/W Switching of P-CODE variables/system variables (#10000 
and above)
- System constant
System constant 
number
System 
constant name Attribute Description
#0, #3100 [#_EMPTY] R Null
#3101 [#_PI] R Circular constant π = 3.14159265358979323846
#3102 [#_E] R Base of natural logarithm e = 2.71828182845904523536
- Exclusion control between each path
System constant 
number
System 
constant name Attribute Description
#182001-#182010 [#_PRIO[n]] R/W System variable for exclusion control


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 378 -
Explanation
R, W, and R/W are attributes of a variable and represents read-only, write-only, and read/write enabled, 
respectively.
- Interface signal #1000-#1031, #1032, #1033-#1035 (Attribute: R)
#1100-#1131, #1132, #1133-#1135 (Attribute: R/W)
[Input signal]
The status of interface input signals can be obtained by reading the value of system variables #1000 to 
#1032.
Variable number Variable name Point Interface input signal


key: chroma:document
string_value:
#1000 [#_UI[0]] 1 UI000 (20
)
#1001 [#_UI[1]] 1 UI001 (21
)
#1002 [#_UI[2]] 1 UI002 (22
)
#1003 [#_UI[3]] 1 UI003 (23
)
#1004 [#_UI[4]] 1 UI004 (24
)
#1005 [#_UI[5]] 1 UI005 (25
)
#1006 [#_UI[6]] 1 UI006 (26
)
#1007 [#_UI[7]] 1 UI007 (27
)
#1008 [#_UI[8]] 1 UI008 (28
)
#1009 [#_UI[9]] 1 UI009 (29
)
#1010 [#_UI[10]] 1 UI010 (210)
#1011 [#_UI[11]] 1 UI011 (211)
#1012 [#_UI[12]] 1 UI012 (212)
#1013 [#_UI[13]] 1 UI013 (213)
#1014 [#_UI[14]] 1 UI014 (214)
#1015 [#_UI[15]] 1 UI015 (215)


key: chroma:document
string_value:
#1015 [#_UI[15]] 1 UI015 (215)
#1016 [#_UI[16]] 1 UI016 (216)
#1017 [#_UI[17]] 1 UI017 (217)
#1018 [#_UI[18]] 1 UI018 (218)
#1019 [#_UI[19]] 1 UI019 (219)
#1020 [#_UI[20]] 1 UI020 (220)
#1021 [#_UI[21]] 1 UI021 (221)
#1022 [#_UI[22]] 1 UI022 (222)
#1023 [#_UI[23]] 1 UI023 (223)
#1024 [#_UI[24]] 1 UI024 (224)
#1025 [#_UI[25]] 1 UI025 (225)
#1026 [#_UI[26]] 1 UI026 (226)
#1027 [#_UI[27]] 1 UI027 (227)
#1028 [#_UI[28]] 1 UI028 (228)
#1029 [#_UI[29]] 1 UI029 (229)
#1030 [#_UI[30]] 1 UI030 (230)


key: chroma:document
string_value:
#1030 [#_UI[30]] 1 UI030 (230)
#1031 [#_UI[31]] 1 UI031 (231)
#1032 [#_UIL[0]] 32 UI000-UI031
#1033 [#_UIL[1]] 32 UI100-UI131
#1034 [#_UIL[2]] 32 UI200-UI231
#1035 [#_UIL[3]] 32 UI300-UI331
Variable value Input signal
1.0 Contact closed
0.0 Contact opened


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 379 -
Since the read value is 1.0 or 0.0 regardless of the unit system, the unit system must be considered when a 
macro is created.
The input signals at 32 points can be read at a time by reading from system variables #1032 to #1035.
31
30
0
#1032 =∑#[1000 + ]× 2 −#1031× 2
=
i
i
i
∑{ } =
+ = × − ×
30
0
31
31 #[1032 ] 2 2
i
i
i n V V
When UIni = 0, Vi = 0.
When UIni = 1, Vi = 1.
n = 0-3
[Output signal]


key: chroma:document
string_value:
n = 0-3
[Output signal]
Interface output signals can be sent by assigning values to system variables #1100 to #1132 for sending 
interface signals.
Variable number Variable name Point Interface input signal
#1100 [#_UO[0]] 1 UO000 (20
)
#1101 [#_UO[1]] 1 UO001 (21
)
#1102 [#_UO[2]] 1 UO002 (22
)
#1103 [#_UO[3]] 1 UO003 (23
)
#1104 [#_UO[4]] 1 UO004 (24
)
#1105 [#_UO[5]] 1 UO005 (25
)
#1106 [#_UO[6]] 1 UO006 (26
)
#1107 [#_UO[7]] 1 UO007 (27
)
#1108 [#_UO[8]] 1 UO008 (28
)


key: chroma:document
string_value:
#1108 [#_UO[8]] 1 UO008 (28
)
#1109 [#_UO[9]] 1 UO009 (29
)
#1110 [#_UO[10]] 1 UO010 (210)
#1111 [#_UO[11]] 1 UO011 (211)
#1112 [#_UO[12]] 1 UO012 (212)
#1113 [#_UO[13]] 1 UO013 (213)
#1114 [#_UO[14]] 1 UO014 (214)
#1115 [#_UO[15]] 1 UO015 (215)
#1116 [#_UO[16]] 1 UO016 (216)
#1117 [#_UO[17]] 1 UO017 (217)
#1118 [#_UO[18]] 1 UO018 (218)
#1119 [#_UO[19]] 1 UO019 (219)
#1120 [#_UO[20]] 1 UO020 (220)
#1121 [#_UO[21]] 1 UO021 (221)
#1122 [#_UO[22]] 1 UO022 (222)
#1123 [#_UO[23]] 1 UO023 (223)


key: chroma:document
string_value:
#1123 [#_UO[23]] 1 UO023 (223)
#1124 [#_UO[24]] 1 UO024 (224)
#1125 [#_UO[25]] 1 UO025 (225)
#1126 [#_UO[26]] 1 UO026 (226)
#1127 [#_UO[27]] 1 UO027 (227)
#1128 [#_UO[28]] 1 UO028 (228)
#1129 [#_UO[29]] 1 UO029 (229)
#1130 [#_UO[30]] 1 UO030 (230)
#1131 [#_UO[31]] 1 UO031 (231)
#1132 [#_UOL[0]] 32 UO000-UO031
#1133 [#_UOL[1]] 32 UO100-UO131
#1134 [#_UOL[2]] 32 UO200-UO231
#1135 [#_UOL[3]] 32 UO300-UO331


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 380 -
Variable value Input signal
1.0 Contact closed
0.0 Contact opened
The output signals at 32 points can be written at a time by writing to system variables #1132 to #1135. 
The signals can also be read.
31
30
0
#1132 =∑#[1000 + ]× 2 −#1131× 2
=
i
i
i
∑{ } =
+ = × − ×
30
0
31
31 #[1132 ] 2 2
i
i
i n V V
When UIni = 0, Vi = 0.
When UIni = 1, Vi = 1.
n = 0-3
NOTE


key: chroma:document
string_value:
n = 0-3
NOTE
1 When a value other than 1.0 or 0.0 is assigned to variables #1100 to #1131, it is 
assumed as follows.
<null> is assumed to be 0.
A value other than <null> or 0 is assumed to be 1.
Where, a value less than 0.00000001 is undefined.
2 When any of UI016 to UI031, UI100 to UI131, UI200 to UI231, UI300 to UI331,
UO016 to UO031, UO200 to UO231, and UO300 to UO331 are used, bit 0 (MIF) 
of parameter No. 6001 must be set to 1.
Example
Structure of DI


key: chroma:document
string_value:
Example
Structure of DI
215 214 213 212 211 210 29 28 27 26 25 24 23 22 21 20
Used for other 
purposes
Sign 102 101 100
Structure of DO
28 27 26 25 24 23 22 21 20
Not used Used for other purposes Address
<1> The specified address D value is output to DO and signed BCD 3 digits are read into #100.
Macro calling instruction
G65 P9100 D (address); 
A custom macro body is created as follows.
O9100 ; 
#1132 = #1132 AND 496 OR#7 ; : Address output


key: chroma:document
string_value:
G65 P9101 T60 ; : Timer macro. For details, refer to the example of clock (#3001).
#100 = BIN[#1032 AND 4095] ; : BCD 3 digits are read.
IF [#1012 EQ 0] GOTO 9100 ; : A sign is attached.
#100 = -#100
N9100 M99


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 381 -
<2> Eight types of specified address D values are output to DO and signed BCD 6 digits (3-digit integer 
part + 3-digit fractional part) are read into #101.
Structure on the machine side
When DO 20 = 0: Data with 3 decimal places
When DO 20 = 1: Data with 3-digit integer part
When DO 23 to 21 = 000: No1 data when #1 = 0
When DO 23 to 21 = 001: No2 data when #2 = 0
 :
When DO 23 to 21 = 111: No8 data when #8 = 0
Macro calling instruction


key: chroma:document
string_value:
Macro calling instruction
G65 P9111 D (data number);
A custom macro body is created as follows.
O9111 ; 
G65 P9100 D[#7*2+1] ; : Call the macro of <1> O9100
#101 = #100 ; 
G65 P9100 D[#7*2] ; 
#101 = #101 + #100/1000 ; 
M99 ;
- Interface signal R address
#1036 to #1067, #1068, #1069 to #1071 (Attribute: R)
#1136 to #1167, #1168, #1169 to #1171 (Attribute: R/W)
By setting bit 2 (IFR) of parameter No. 6020 to 1, this function is enabled. Set the start address of each R


key: chroma:document
string_value:
area in parameter No. 6093 or 6094. From the start address, 128 signal inputs or outputs are assigned. Set 
a multiple of 4 (0, 4, 8, ...) in parameters Nos. 6093 and 6094.
[Input signal]
The status of the input signal at each R address can be read with the value of system variable #1036 to 
#1071.
Variable number Variable name Point Interface input signal
#1036 [#_UI[32]] 1 UI400 (20
)
#1037 [#_UI[33]] 1 UI401 (21
)
to to to to 
#1067 [#_UI[63]] 1 UI431 (231)


key: chroma:document
string_value:
#1067 [#_UI[63]] 1 UI431 (231)
#1068 [#_UIL[4]] 32 UI400 to UI431
#1069 [#_UIL[5]] 32 UI500 to UI531
#1070 [#_UIL[6]] 32 UI600 to UI631
#1071 [#_UIL[7]] 32 UI700 to UI731
Variable value Input signal
1.0 Contact closed
0.0 Contact opened
[Output signal]
A value can be written to the output signal at each R address and the status of the signal can be read with 
the value of system variable #1136 to #1171.
Variable number Variable name Point Interface input signal
#1136 [#_UO[32]] 1 UO400 (20
)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 382 -
Variable number Variable name Point Interface input signal
#1167 [#_UO[63]] 1 UO431 (231)
#1168 [#_UOL[4]] 32 UO400 to UO431
#1169 [#_UOL[5]] 32 UO500 to UO531
#1170 [#_UOL[6]] 32 UO600 to UO631
#1171 [#_UOL[7]] 32 UO700 to UO731
Variable value Input signal
1.0 Contact closed
0.0 Contact opened
NOTE
1 When signals UO400 to UO431 are handled from system variables #1136 to


key: chroma:document
string_value:
#1171, do not write any of signals UO400 to UO431 from a ladder or another 
interface. Specifying a write may cause a conflict between read from and write to 
the signal, resulting in an unexpected change to the signal.
2 For signals UO400 to UO731, R addresses are used, while for signals UO000 to 
UO331, F addresses are used. Therefore, to handle these signals with a ladder, 
it is necessary to consider synchronization processing of I/O signals. For details,


key: chroma:document
string_value:
refer to Subsection, “Synchronization Processing of I/O Signals”, in the “PMC 
Programming Manual (B-64513EN)”.
- Tool compensation value #2001-#2800, #10001-#13999, #21001-#22999
(Attribute: R/W)
M
The compensation values can be obtained by reading system variables #2001 to #2800, #10001 to #13999, 
or #21001 to #22999 for tool compensation. The compensation values can also be changed by assigning 
values to the system variables.
- When the number of compensations is 200 or less


key: chroma:document
string_value:
When bit 3 (V15) of parameter No.6000 = 0
H code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #2201 [#_OFSHG[1]]
 or
[#_OFSZG[1]]
#2001 [#_OFSHW[1]]
 or
[#_OFSZW[1]]
2 #2202 [#_OFSHG[2]]
 or
[#_OFSZG[2]]
#2002 [#_OFSHW[2]]
 or
[#_OFSZW[2]]
3 #2203 [#_OFSHG[3]]
 or
[#_OFSZG[3]]
#2003 [#_OFSHW[3]]
 or
[#_OFSZW[3]]
: : : : :
199 #2399 [#_OFSHG[199]]
 or
[#_OFSZG[199]]
#2199 [#_OFSHW[199]]
 or
[#_OFSZW[199]]


key: chroma:document
string_value:
or
[#_OFSZW[199]]
200 #2400 [#_OFSHG[200]]
 or
[#_OFSZG[200]]
#2200 [#_OFSHW[200]]
 or
[#_OFSZW[200]]


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 383 -
When bit 3 (V15) of parameter No.6000 = 1
H code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #2001 [#_OFSHG[1]]
 or
[#_OFSZG[1]]
#2201 [#_OFSHW[1]]
 or
[#_OFSZW[1]]
2 #2002 [#_OFSHG[2]]
 or
[#_OFSZG[2]]
#2202 [#_OFSHW[2]]
 or
[#_OFSZW[2]]
3 #2003 [#_OFSHG[3]]
 or
[#_OFSZG[3]]
#2203 [#_OFSHW[3]]
 or
[#_OFSZW[3]]
: : : : :
199 #2199 [#_OFSHG[199]]
 or
[#_OFSZG[199]]


key: chroma:document
string_value:
or
[#_OFSZG[199]]
#2399 [#_OFSHW[199]]
 or
[#_OFSZW[199]]
200 #2200 [#_OFSHG[200]]
 or
[#_OFSZG[200]]
#2400 [#_OFSHW[200]]
 or
[#_OFSZW[200]]
D code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #2401 [#_OFSDG[1]]
 or
[#_OFSRG[1]]
#2601 [#_OFSDW[1]]
 or
[#_OFSRW[1]]
2 #2402 [#_OFSDG[2]]
 or
[#_OFSRG[2]]
#2602 [#_OFSDW[2]]
 or
[#_OFSRW[2]]
3 #2403 [#_OFSDG[3]]
 or
[#_OFSRG[3]]
#2603 [#_OFSDW[3]]
 or
[#_OFSRW[3]]
: : : : :


key: chroma:document
string_value:
or
[#_OFSRW[3]]
: : : : :
199 #2599 [#_OFSDG[199]]
 or
[#_OFSRG[199]]
#2799 [#_OFSDW[199]]
 or
[#_OFSRW[199]]
200 #2600 [#_OFSDG[200]]
 or
[#_OFSRG[200]]
#2800 [#_OFSDW[200]]
 or
[#_OFSRW200]]
NOTE
1 When #2401 to #2800 are used for reading or writing of D codes, bit 5 (D15) of 
parameter No.6004 must be set to 1.
2 When bit 5 (D15) of parameter No.6004 is set to 1, system variables #2500 to 
#2806 for workpiece origin offset cannot be used. Use system variables #5201
to #5324.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 384 -
- When the number of compensations is more than 200 (For compensation with a compensation 
number of 200 or less, #2001 to #2800 can also be used.)
When bit 3 (V15) of parameter No.6000 = 0
H code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #11001 [#_OFSHG[1]]
 or
[#_OFSZG[1]]
#10001 [#_OFSHW[1]]
 or
[#_OFSZW[1]]
2 #11002 [#_OFSHＧ[2]]
 or
[#_OFSZG[2]]
#10002 [#_OFSHW[2]]
 or


key: chroma:document
string_value:
#10002 [#_OFSHW[2]]
 or
[#_OFSZW[2]]
3 #11003 [#_OFSHＧ[3]]
 or
[#_OFSZG[3]]
#10003 [#_OFSHW[3]]
 or
[#_OFSZW[3]]
: : : : :
998 #11998 [#_OFSHＧ[998]]
 or
[#_OFSZG[998]]
#10998 [#_OFSHW[998]]
 or
[#_OFSZW[998]]
999 #11999 [#_OFSHＧ[999]]
 or
[#_OFSZG[999]]
#10999 [#_OFSHW[999]]
 or
[#_OFSZW[999]]
D code
Compensation
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #13001 [#_OFSDG[1]]
 or
[#_OFSRG[1]]
#12001 [#_OFSDW[1]]
 or
[#_OFSRW[1]]


key: chroma:document
string_value:
or
[#_OFSRW[1]]
2 #13002 [#_OFSDG[2]]
 or
[#_OFSRG[2]]
#12002 [#_OFSDW[2]]
 or
[#_OFSRW[2]]
3 #13003 [#_OFSDG[3]]
 or
[#_OFSRG[3]]
#12003 [#_OFSDW[3]]
 or
[#_OFSRW[3]]
: : : : :
998 #13998 [#_OFSDG[998]]
 or
[#_OFSRG[998]]
#12998 [#_OFSDW[998]]
 or
[#_OFSRW[998]]
999 #13999 [#_OFSDG[999]]
 or
[#_OFSRG[999]]
#12999 [#_OFSDW[999]]
 or
[#_OFSRW[999]]


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 385 -
When bit 3 (V15) of parameter No.6000 = 1
H code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #10001 [#_OFSHG[1]]
 or
[#_OFSZG[1]]
#11001 [#_OFSHW[1]]
 or
[#_OFSZW[1]]
2 #10002 [#_OFSHG[2]]
 or
[#_OFSZG[2]]
#11002 [#_OFSHW[2]]
 or
[#_OFSZW[2]]
3 #10003 [#_OFSHG[3]]
 or
[#_OFSZG[3]]
#11003 [#_OFSHW[3]]
 or
[#_OFSZW[3]]
: : : : :
998 #10998 [#_OFSHG[998]]
 or
[#_OFSZG[998]]


key: chroma:document
string_value:
or
[#_OFSZG[998]]
#11998 [#_OFSHW[998]]
 or
[#_OFSZW[998]]
999 #10999 [#_OFSHG[999]]
 or
[#_OFSZG[999]]
#11999 [#_OFSHW[999]]
 or
[#_OFSZW[999]]
D code
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #12001 [#_OFSDG[1]]
 or
[#_OFSRG[1]]
#13001 [#_OFSDW[1]]
 or
[#_OFSRW[1]]
2 #12002 [#_OFSDG[2]]
 or
[#_OFSRG[2]]
#13002 [#_OFSDW[2]]
 or
[#_OFSRW[2]]
3 #12003 [#_OFSDG[3]]
 or
[#_OFSRG[3]]
#13003 [#_OFSDW[3]]
 or
[#_OFSRW[3]]


key: chroma:document
string_value:
or
[#_OFSRW[3]]
: : : : :
998 #12998 [#_OFSDG[998]]
 or
[#_OFSRG[998]]
#13998 [#_OFSDW[998]]
 or
[#_OFSRW[998]]
999 #12999 [#_OFSDG[999]]
 or
[#_OFSRG[999]]
#13999 [#_OFSDW[999]]
 or
[#_OFSRW[999]]
System variables not dependent on bit 3 (V15) of parameter No. 6000
Corner R offset
Compensation 
number
Geometry Wear
Variable number Variable name Variable number Variable name
1 #21001 [#_CORR_G[1]] #22001 [#_CORR_W[1]]
2 #21002 [#_CORR_G[2]] #22002 [#_CORR_W[2]]


key: chroma:document
string_value:
3 #21003 [#_CORR_G[3]] #22003 [#_CORR_W[3]]
: : : : :
998 #21998 [#_CORR_G[998]] #22998 [#_CORR_W[998]]
999 #21999 [#_CORR_G[999]] #22999 [#_CORR_W[999]]


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 386 -
- Tool compensation value #2001-#2964, #10001-#19999 (Attribute: R/W)
T
The compensation values can be obtained by reading system variables #2001 to #2964 or #10001 to 
#19999 for tool compensation. The compensation values can also be changed by assigning values to the 
system variables.
<1> Without tool geometry/wear compensation memory
- When the number of compensations is 64 or less
Compensation number Variable number Variable name Description


key: chroma:document
string_value:
1 #2001 [#_OFSX[1]]
X-axis compensation value (*1)
2 #2002 [#_OFSX[2]]
3 #2003 [#_OFSX[3]]
: : :
63 #2063 [#_OFSX[63]]
64 #2064 [#_OFSX[64]]
1 #2101 [#_OFSZ[1]]
Z-axis compensation value (*1)
2 #2102 [#_OFSZ[2]]
3 #2103 [#_OFSZ[3]]
: : :
63 #2163 [#_OFSZ[63]]
64 #2164 [#_OFSZ[64]]
1 #2201 [#_OFSR[1]]
Tool nose radius compensation value
2 #2202 [#_OFSR[2]]
3 #2203 [#_OFSR[3]]
: : :
63 #2263 [#_OFSR[63]]
64 #2264 [#_OFSR[64]]
1 #2301 [#_OFST[1]]
Virtual tool tipT position


key: chroma:document
string_value:
Virtual tool tipT position
2 #2302 [#_OFST[2]]
3 #2303 [#_OFST[3]]
: : :
63 #2363 [#_OFST[63]]
64 #2364 [#_OFST[64]]
1 #2401 [#_OFSY[1]]
Y-axis compensation value (*1)
2 #2402 [#_OFSY[2]]
3 #2403 [#_OFSY[3]]
: : :
48 #2448 [#_OFSY[48]]
49 #2449 [#_OFSY[49]]
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 387 -
- When the number of compensations is more than 64 (For compensation with a compensation 
number of 64 or less, #2001 to #2449 can also be used.)
Compensation number Variable number Variable name Description
1 #10001 [#_OFSX[1]]
X-axis compensation value (*1)
2 #10002 [#_OFSX[2]]
3 #10003 [#_OFSX[3]]
: : :
998 #10998 [#_OFSX[998]]
999 #10999 [#_OFSX[999]]
1 #11001 [#_OFSZ[1]]
Z-axis compensation value (*1)
2 #11002 [#_OFSZ[2]]


key: chroma:document
string_value:
2 #11002 [#_OFSZ[2]]
3 #11003 [#_OFSZ[3]]
: : :
998 #11998 [#_OFSZ[998]]
999 #11999 [#_OFSZ[999]]
1 #12001 [#_OFSR[1]]
Tool nose radius compensation value
2 #12002 [#_OFSR[2]]
3 #12003 [#_OFSR[3]]
: : :
998 #12998 [#_OFSR[998]]
999 #12999 [#_OFSR[999]]
1 #13001 [#_OFST[1]]
Virtual tool tip T position
2 #13002 [#_OFST[2]]
3 #13003 [#_OFST[3]]
: : :
998 #13998 [#_OFST[998]]
999 #13999 [#_OFST[999]]
1 #14001 [#_OFSY[1]]
Y-axis compensation value (*1)
2 #14002 [#_OFSY[2]]


key: chroma:document
string_value:
2 #14002 [#_OFSY[2]]
3 #14003 [#_OFSY[3]]
: : :
998 #14998 [#_OFSY[998]]
999 #14999 [#_OFSY[999]]
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes
<2> With tool geometry/wear compensation memory
- When the number of compensations is 64 or less
Compensation number Variable number Variable name Description
1 #2001 [#_OFSXW[1]]
X-axis compensation value (wear) (*1)
2 #2002 [#_OFSXW[2]]
3 #2003 [#_OFSXW[3]]
: : :


key: chroma:document
string_value:
3 #2003 [#_OFSXW[3]]
: : :
63 #2063 [#_OFSXW[63]]
64 #2064 [#_OFSXW[64]]
1 #2101 [#_OFSZW[1]]
Z-axis compensation value (wear) (*1)
2 #2102 [#_OFSZW[2]]
3 #2103 [#_OFSZW[3]]
: : :
63 #2163 [#_OFSZW[63]]
64 #2164 [#_OFSZW[64]]


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 388 -
Compensation number Variable number Variable name Description
1 #2201 [#_OFSRW[1]]
Tool nose radius compensation value 
(wear)
2 #2202 [#_OFSRW [2]]
3 #2203 [#_OFSRW [3]]
: : :
63 #2263 [#_OFSRW [63]]
64 #2264 [#_OFSRW [64]]
1 #2301 [#_OFST[1]]
Virtual tool tip T position
2 #2302 [#_OFST[2]]
3 #2303 [#_OFST[3]]
: : :
63 #2363 [#_OFST[63]]
64 #2364 [#_OFST[64]]
1 #2401 [#_OFSYW[1]]
Y-axis compensation value (wear) (*1)


key: chroma:document
string_value:
2 #2402 [#_OFSYW [2]]
3 #2403 [#_OFSYW [3]]
: : :
48 #2448 [#_OFSYW [48]]
49 #2449 [#_OFSYW [49]]
1 #2451 [#_OFSYG[1]]
Y-axis compensation value (geometry) 
(*1)
2 #2452 [#_OFSYG [2]]
3 #2453 [#_OFSYG [3]]
: : :
48 #2498 [#_OFSYG [48]]
49 #2499 [#_OFSYG [49]]
1 #2701 [#_OFSXG[1]]
X-axis compensation value (geometry) 
(*1)
2 #2702 [#_OFSXG[2]]
3 #2703 [#_OFSXG [3]]
: : :
48 #2748 [#_OFSXG [48]]
49 #2749 [#_OFSXG [49]]
1 #2801 [#_OFSZG[1]]
Z-axis compensation value (geometry) 
(*1)


key: chroma:document
string_value:
(*1)
2 #2802 [#_OFSZG[2]]
3 #2803 [#_OFSZG[3]]
: : :
48 #2848 [#_OFSZG[48]]
49 #2849 [#_OFSZG[49]]
1 #2901 [#_OFSRG[1]]
Tool nose radius compensation value 
(geometry)
2 #2902 [#_OFSRG[2]]
3 #2903 [#_OFSRG[3]]
: : :
63 #2963 [#_OFSRG[63]]
64 #2964 [#_OFSRG[64]]
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes
- When the number of compensations is more than 64 (For compensation with a compensation


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 389 -
Compensation number Variable number Variable name Description
1 #10001 [#_OFSXW[1]]
X-axis compensation value (wear) (*1)
2 #10002 [#_OFSXW[2]]
3 #10003 [#_OFSXW[3]]
: : :
998 #10998 [#_OFSXW[998]]
999 #10999 [#_OFSXW[999]]
1 #11001 [#_OFSZW[1]]
Z-axis compensation value (wear) (*1)
2 #11002 [#_OFSZW[2]]
3 #11003 [#_OFSZW[3]]
: : :
998 #11998 [#_OFSZW[998]]
999 #11999 [#_OFSZW[999]]
1 #12001 [#_OFSRW[1]]


key: chroma:document
string_value:
1 #12001 [#_OFSRW[1]]
Tool nose radius compensation value 
(wear)
2 #12002 [#_OFSRW [2]]
3 #12003 [#_OFSRW [3]]
: : :
998 #12998 [#_OFSRW [998]]
999 #12999 [#_OFSRW [999]]
1 #13001 [#_OFST[1]]
Virtual tool tip T position
2 #13002 [#_OFST[2]]
3 #13003 [#_OFST[3]]
: : :
998 #13998 [#_OFST[998]]
999 #13999 [#_OFST[999]]
1 #14001 [#_OFSYW[1]]
Y-axis compensation value (wear) (*1)
2 #14002 [#_OFSYW [2]]
3 #14003 [#_OFSYW [3]]
: : :
998 #14998 [#_OFSYW [998]]
999 #14999 [#_OFSYW [999]]


key: chroma:document
string_value:
999 #14999 [#_OFSYW [999]]
1 #15001 [#_OFSXG[1]]
X-axis compensation value (geometry) 
(*1)
2 #15002 [#_OFSXG[2]]
3 #15003 [#_OFSXG [3]]
: : :
998 #15998 [#_OFSXG [998]]
999 #15999 [#_OFSXG [999]]
1 #16001 [#_OFSZG[1]]
Z-axis compensation value (geometry) 
(*1)
2 #16002 [#_OFSZG[2]]
3 #16003 [#_OFSZG[3]]
: : :
998 #16998 [#_OFSZG[998]]
999 #16999 [#_OFSZG[999]]
1 #17001 [#_OFSRG[1]]
Tool nose radius compensation value 
(geometry)
2 #17002 [#_OFSRG[2]]
3 #17003 [#_OFSRG[3]]
: : :


key: chroma:document
string_value:
3 #17003 [#_OFSRG[3]]
: : :
998 #17998 [#_OFSRG[998]]
999 #17999 [#_OFSRG[999]]
1 #19001 [#_OFSYG[1]]
Y-axis compensation value (geometry) 
(*1)
2 #19002 [#_OFSYG[2]]
3 #19003 [#_OFSYG[3]]
: : :
998 #19998 [#_OFSYG[998]]
999 #19999 [#_OFSYG[999]]


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 390 -
(*1) X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic three axes, Y-axis: Y-axis of basic three 
axes
- Alarm #3000 (Attribute: W)
When an error is detected in a macro, an unit can enter the alarm state. In addition, an alarm message of 
up to 60 characters with alphabet and numerals can be specified between a control-out and a control-in 
after the expression. When an alarm message is not specified, a macro alarm is used instead.


key: chroma:document
string_value:
Variable number Variable name Description
#3000 [#_ALM] Macro alarm
When bit 1 (MCA) of parameter No.6008 = 0
#3000 = n (ALARM MESSAGE); (n: 0-200)
On the screen, the alarm number obtained by adding the value of #3000 to 3000 and alarm message 
appear after MC.
(Example) #3000 = 1 (ALARM MESSAGE); 
=> "MC3001 ALARM MESSAGE" appears on the alarm screen.
When bit 1 (MCA) of parameter No.6008 = 1
#3000 = n (ALARM MESSAGE); (n: 0-4095)


key: chroma:document
string_value:
On the screen, the alarm number of #3000 and alarm message appear after MC.
(Example) #3000=1 (ALARM MESSAGE); 
=> "MC0001 ALARM MESSAGE" appears on the alarm screen.
When #3000 is commanded with the comment section, the order of alarm message and the comment 
section change places by setting value of bit 3 (NCM) of parameter No.6020.
When bit 3 (NCM) of parameter No.6020 is set to 0
The first section is an alarm message and followings are comments.


key: chroma:document
string_value:
(Example) #3000 =1 (ALARM MESSAGE) (COMMENT 1) (COMMENT 2);
When bit 3 (NCM) of parameter No.6020) is set to 1
The last section is an alarm message and others are comments.
(Example) #3000 =1 (COMMENT 1) (COMMENT 2) (ALARM MESSAGE);
- Clock #3001, #3002 (Attribute: R/W)
The clock time can be obtained by reading system variables #3001 and #3002 for clocks. The time can be 
preset by entering a value in the system variables.
Type Variable 
number Variable name Unit At power-on Count condition


key: chroma:document
string_value:
Clock 1 #3001 [#_CLOCK1] 1 ms Reset to 0 Anytime
Clock 2 #3002 [#_CLOCK2] 1 hour Same as at power-down When the STL signal is on
The clock accuracy is 16 ms. Clock 1 returns to 0 after a lapse of 2147483648 ms. Clock 2 returns to 0 
after a lapse of 9544.37176 hours.
[Example]
Timer
Macro calling command
G65 P9101 T (wait time) ms ;
A macro is created as follows.
O9101;
#3001 = 0; Initial setting
WHILE [#3001 LE #20] DO1: Wait for a specified time
END1 ; 
M99 ;


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 391 -
 - Controlling of single block stop and waiting for the auxiliary function 
completion signal #3003 (Attribute: R/W)
Assigning the following values in system variable #3003 allows the specification of whether single block 
stop is disabled in the following blocks or whether a wait for the completion signal (FIN) of the auxiliary 
function (M, S, T, or B) before going to the next block is enabled. When a wait for completion signal is


key: chroma:document
string_value:
disabled, the distribution end signal (DEN) is not sent. Be careful not to specify the next auxiliary 
function without waiting for the completion signal.
Variable number and variable name Value Single block stop Auxiliary function completion signal
#3003
[#_CNTL1]
0 Enabled Waiting
1 Disabled Waiting
2 Enabled Not waiting
3 Disabled Not waiting
In addition, the following variable names can be used to enable or disable single block stop and a wait for


key: chroma:document
string_value:
the auxiliary function completion signal, individually.
Variable name Value Single block stop Auxiliary function completion
[#_M_SBK] 0 Enabled -
1 Disabled -
[#_M_FIN] 0 - Waiting
1 - Not waiting
[Example]
Drill cycle (for incremental programming)
(G81 equivalent)
Macro calling command
G65 P9081 L Iterations R R point Z Z point;
A custom macro body is created as follows.
O9081 ;
#3003 = 1 ;
G00 Z#18 ;
G01 Z#26 ; 
G00 Z-[ ROUND[#18] + ROUND[#26] ] ;
#3003 = 0 ;
M99 ;
NOTE


key: chroma:document
string_value:
#3003 = 0 ;
M99 ;
NOTE
#3003 is cleared by a reset.
- Enabling of feed hold, feedrate override, and exact stop check #3004
(Attribute: R/W)
Assigning the following values in system variable #3004 allows the specification of whether feed hold 
and feedrate override are enabled in the following blocks or whether exact stop in G61 mode or by G09 
command is disabled.
Variable number and variable name Value Field hold Feedrate override Exact stop
#3004
[#_CNTL2]
0 Enabled Enabled Enabled


key: chroma:document
string_value:
0 Enabled Enabled Enabled
1 Disabled Enabled Enabled
2 Enabled Disabled Enabled
3 Disabled Disabled Enabled
4 Enabled Enabled Disabled
5 Disabled Enabled Disabled
6 Enabled Disabled Disabled
7 Disabled Disabled Disabled
Disable single block stop.
#18 corresponds to R and #26 to Z.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 392 -
In addition, the following variable names can be used to enable or disable feed hold, feedrate override, 
and exact stop in G61 mode or by the G09 command, individually.
Variable number and variable name Value Feed hold Feedrate override Exact stop
[#_M_FHD] 0 Enabled - -
1 Disabled - -
[#_M_OV] 0 - Enabled -
1 - Disabled -
[#_M_EST] 0 - - Enabled
1 - - Disabled
NOTE


key: chroma:document
string_value:
1 - - Disabled
NOTE
1 These system variables are provided to maintain compatibility with conventional 
NC programs. It is recommended that functions provided by G63, G09, G61, and 
other G codes be used to enable or disable feed hold, feedrate override, and 
exact stop.
2 When the feed hold button is pressed during execution of a block for which feed 
hold is disabled:
<1> If the feed hold button is kept pressed, operation stops after execution of


key: chroma:document
string_value:
the block. When single block stop is disabled, however, operation does not 
stop.
<2> If the pressed feed hold button is released, the feed hold lamp lights, but 
operation does not stop until the end of the first block that was enabled.
3 #3004 is cleared by a reset.
4 If exact stop is disabled by #3004, the original exact stop position between 
cutting feed and positioning block is not affected. #3004 can temporarily disable 
exact stop in G61 mode or by the G09 command between cutting feed and


key: chroma:document
string_value:
cutting feed.
- Settings #3005 (Attribute: R/W)
Settings can be read and written.
Binary values are converted to decimals.
#3005
#15 #14 #13 #12 #11 #10 #9 #8
Setting FCV
#7 #6 #5 #4 #3 #2 #1 #0
Setting SEQ INI ISO TVC
#9 (FCV) : Whether to use the FANUC Series 15 program format conversion capability
#5 (SEQ) : Whether to automatically insert sequence numbers
#2 (INI) : Millimeter input or inch input
#1 (ISO) : Whether to use EIA or ISO as the output code
#0 (TVC) : Whether to make a TV check


key: chroma:document
string_value:
- Stop with a message #3006 (Attribute: W)
When "#3006=1 (MESSAGE);" is commanded in the macro, the program executes blocks up to the 
immediately previous one and then stops. When a message of up to 60 characters with alphabet and 
numerals, which is enclosed by a control-in character and control-out character, is programmed in the 
same block, the message is displayed on the external operator message screen.
Variable number Variable name Description
#3006 [#_MSGSTP] Stop with a message


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 393 -
When #3006 is commanded with the comment section, the order of message and the comment section 
changes places by setting value of bit 3 (NCM) of parameter No.6020.
When bit 3 (NCM) of parameter No.6020 is set to 0
It is assumed that it message first, and assumes since the second to be comment section.
(Example) #3000 =1 (MACRO MESSAGE) (COMMENT 1) (COMMENT 2);
When bit 3 (NCM) of parameter No.6020 is set to 1


key: chroma:document
string_value:
The end is assumed to be message, and it assumes to be comment section from it ahead.
(Example) #3000 =1 (COMMENT 1) (COMMENT 2) (MACRO MESSAGE);
NOTE
If the single block stop is disabled by #3003=1 command, the program does not 
stop even if #3006=1 is commanded. However, the message commanded by 
#3006=1 is displayed on the external operator message screen.
- Status of a mirror image #3007 (Attribute: R)


key: chroma:document
string_value:
The status of an mirror image (setting or DI) at that point in time can be obtained for each axis by reading 
#3007.
Variable number Variable name Description
#3007 [#_MRIMG] Status of a mirror image
When the status is indicated in binary, each bit corresponds with an axis as follows.
Bit 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16
nth axis 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17
Bit 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0
nth axis 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1


key: chroma:document
string_value:
For the 32 bits, 0 indicates that a mirror image is disabled and 1 indicates that a mirror image is enabled.
[Example] When #3007 is 3, a mirror image is enabled for the 1st and 2nd axes.
NOTE
1 The status of a programmable mirror image is not reflected on this variable.
2 When the mirror image function is set for the same axis by the mirror image 
signal and setting, the signal value and setting value are ORed and then output.


key: chroma:document
string_value:
3 When mirror image signals for axes other than the controlled axes are turned on, 
they are not read into system variable #3007.
- Status during restart of a program #3008 (Attribute: R)
Whether a program is restarting can be determined by reading #3008.
Variable number Variable name Description
#3008 [#_PRSTR] 0: Program is not restarting.
1: Program is restarting.
- Time #3011, #3012 (Attribute: R)


key: chroma:document
string_value:
Year/month/date and hour/minute/second can be obtained by reading system variables #3011 and #3012. 
This variable is read-only. To change year/month/date and hour/minute/second, use the timer screen.
[Example] May 20, 2004, PM 04:17:05
#3011 = 20040520
#3012 = 161705


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 394 -
- Path number of the parameter to be read or written #3018 (Attribute: R/W)
If a parameter for another path is to be read or written using parameter reading with the operation 
command PRM or using parameter writing with programmable parameter input (G10L52), this system 
variable is used to specify that path.
Relationships between specified values and path numbers are as follows:
#3018 Selected path
0 Local path
1 Path 1
2 Path 2
3 Path 3


key: chroma:document
string_value:
1 Path 1
2 Path 2
3 Path 3
4 Path 4
Variable number Variable name Description
#3018 － Path number of the parameter to be read or written
- Number of the path on which a macro is being executed #3019 (Attribute: R)
This system variable can be used to read the number of the path on which a macro is being executed.
By using this variable, it is possible to execute a single program differently for different paths.
The path number can be read as follows:
Path #3019
Path 1 1
Path 2 2
Path 3 3


key: chroma:document
string_value:
Path 1 1
Path 2 2
Path 3 3
Path 4 4
Variable number Variable name Description
#3019 [#_PATH_NO] Path number
- Total number of parts and the number of required parts #3901 and #3902 
(Attribute: R/W)
The number of required parts and the number of machined parts can be displayed on the screen by using 
the operation time and part number displaying function. When the (total) number of machined parts


key: chroma:document
string_value:
reaches the number of required parts, a signal indicating the fact is sent to the machine (PMC side).
The system variables can be used to read or write the total number of parts and the number of required 
parts.
Variable number Variable name Description
#3901 [#_PRTSA] Total number of parts
#3902 [#_PRTSN] Number of required parts
- Type of tool compensation memory #3980 (Attribute: R)
M
System variable #3980 can be used to read the type of compensation memory.


key: chroma:document
string_value:
Variable number Variable name Description
#3980 [#_OFSMEM] Types of tool compensation memory
0: Tool compensation memory A
2: Tool compensation memory C


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 395 -
- Main program number #4000 (Attribute: R)
System variable #4000 can be used to read the main program number regardless of the level of a 
subprogram.
Variable number Variable name Description
#4000 [#_MAINO] Main program number
NOTE
1 The main program number indicates the number of the program that is first 
started.
2 When an O number is specified by MDI during execution of the main program or


key: chroma:document
string_value:
when the second O number is specified in DNC mode, the value of #4000 
changes to the specified O number. In addition, when no programs are 
registered or when no O numbers are specified in DNC mode, the value of 
#4000 changes to 0.
- Modal information #4001-#4130, #4201-#4330, #4401-#4530 (Attribute: R)
The modal information specified before the previous block of the macro statement that reads system


key: chroma:document
string_value:
variables #4001 to #4130 can be obtained in the block currently being looked ahead, by reading system 
variables #4001 to #4130.
The modal information of the block currently being executed can be obtained by reading system variables 
#4201 to #4330.
The modal information specified before the block interrupted by an interruption type custom macro by 
reading system variables #4401 to #4530.
The unit used when it was specified is applied.
M


key: chroma:document
string_value:
M
(Category: <1> Previous block, <2> Running block, <3> Interrupted block)
Category Variable number Variable name Description
<1>
<2>
<3>
#4001
#4201
#4401
[#_BUFG[1]]
[#_ACTG[1]]
[#_INTG[1]]
Modal information (G code: group 1)
<1>
<2>
<3>
#4002
#4202
#4402
[#_BUFG[2]]
[#_ACTG[2]]
[#_INTG[2]]
Modal information (G code: group 2)
: : : :
<1>
<2>
<3>
#4030
#4230
#4430
[#_BUFG[30]]
[#_ACTG[30]]
[#_INTG[30]]
Modal information (G code: group 30)
<1>
<2>
<3>
#4102
#4302


key: chroma:document
string_value:
<1>
<2>
<3>
#4102
#4302
#4502
[#_BUFB]
[#_ACTB]
[#_INTB]
Modal information (B code)
<1>
<2>
<3>
#4107
#4307
#4507
[#_BUFD]
[#_ACTD]
[#_INTD]
Modal information (D code)
<1>
<2>
<3>
#4108
#4308
#4508
[#_BUFE]
[#_ACTE]
[#_INTE]
Modal information (E code)
<1>
<2>
<3>
#4109
#4309
#4509
[#_BUFF]
[#_ACTF]
[#_INTF]
Modal information (F code)
<1>
<2>
<3>
#4111
#4311
#4511
[#_BUFH]
[#_ACTH]
[#_INTH]
Modal information (H code)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 396 -
Category Variable number Variable name Description
<1>
<2>
<3>
#4113
#4313
#4513
[#_BUFM]
[#_ACTM]
[#_INTM]
Modal information (M code)
<1>
<2>
<3>
#4114
#4314
#4514
[#_BUFN]
[#_ACTN]
[#_INTN]
Modal information (sequence number N)
<1>
<2>
<3>
#4115
#4315
#4515
[#_BUFO]
[#_ACTO]
[#_INTO]
Modal information (sequence number O)
<1>
<2>
<3>
#4119
#4319
#4519
[#_BUFS]
[#_ACTS]
[#_INTS]
Modal information (S code)
<1>
<2>


key: chroma:document
string_value:
<1>
<2>
<3>
#4120
#4320
#4520
[#_BUFT]
[#_ACTT]
[#_INTT]
Modal information (T code)
<1>
<2>
<3>
#4130
#4330
#4530
[#_BUFWZP]
[#_ACTWZP]
[#_INTWZP]
Modal information (additional workpiece coordinate 
system number P)
T
(Category: <1> Previous block, <2> Running block, <3> Interrupted block)
Category Variable number Variable name Description
<1>
<2>
<3>
#4001
#4201
#4401
[#_BUFG[1]]
[#_ACTG[1]]
[#_INTG[1]]
Modal information (G code: group 1)
<1>
<2>
<3>
#4002
#4202


key: chroma:document
string_value:
<1>
<2>
<3>
#4002
#4202
#4402
[#_BUFG[2]]
[#_ACTG[2]]
[#_INTG[2]]
Modal information (G code: group 2)
: : : :
<1>
<2>
<3>
#4030
#4230
#4430
[#_BUFG[30]]
[#_ACTG[30]]
[#_INTG[30]]
Modal information (G code: group 30)
<1>
<2>
<3>
#4102
#4302
#4502
[#_BUFB]
[#_ACTB]
[#_INTB]
Modal information (B code)
<1>
<2>
<3>
#4108
#4308
#4508
[#_BUFE]
[#_ACTE]
[#_INTE]
Modal information (E code)
<1>
<2>
<3>
#4109
#4309
#4509
[#_BUFF]
[#_ACTF]
[#_INTF]


key: chroma:document
string_value:
[#_BUFF]
[#_ACTF]
[#_INTF]
Modal information (F code)
<1>
<2>
<3>
#4113
#4313
#4513
[#_BUFM]
[#_ACTM]
[#_INTM]
Modal information (M code)
<1>
<2>
<3>
#4114
#4314
#4514
[#_BUFN]
[#_ACTN]
[#_INTN]
Modal information (sequence number N)
<1>
<2>
<3>
#4115
#4315
#4515
[#_BUFO]
[#_ACTO]
[#_INTO]
Modal information (sequence number O)
<1>
<2>
<3>
#4119
#4319
#4519
[#_BUFS]
[#_ACTS]
[#_INTS]
Modal information (S code)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 397 -
Category Variable number Variable name Description
<1>
<2>
<3>
#4120
#4320
#4520
[#_BUFT]
[#_ACTT]
[#_INTT]
Modal information (T code)
<1>
<2>
<3>
#4130
#4330
#4530
[#_BUFWZP]
[#_ACTWZP]
[#_INTWZP]
Modal information
(additional workpiece coordinate system number P)
NOTE
1 Previous block and running block
Since the CNC reads the block that is ahead of the block currently being


key: chroma:document
string_value:
executed by the machining program, the block being retrieved by the CNC is 
normally different from that currently being executed. The previous block 
indicates the block that is ahead of the block being retrieved by the CNC, that is, 
the block that is ahead of the program block in which #4001 to #4130 are 
specified.
2 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
[Example] O1234 ;
N10 G00 G90 X200. Y200. ;


key: chroma:document
string_value:
N10 G00 G90 X200. Y200. ; 
N20 G01 G91 X1000. Y1000. F10. ;
 :
 :
N50 G00 G90 X500. Y500. ; 
N60 #1 = #4003 ; 
Assume that the CNC is currently executing N20. If the CNC retrieved and processed the blocks up to 
N60 as shown above, the running block is N20 and the previous block is N50. Therefore, group 3 modal 
information in the running block is G91 and group 3 modal information in the previous block is G90.
When N60 #1 = #4203, #1 = 91.
When N60 #1 = #4003, #1 = 90.


key: chroma:document
string_value:
When N60 #1 = #4003, #1 = 90.
- Position information #5001-#5080, #100001-#100200, #118601-#118700 
(Attribute: R)
The end position of the previous block, the specified current position (for the machine coordinate system 
and workpiece coordinate system), and the skip signal position can be obtained by reading the values of 
system variables #5001 to #5080 or #100001 to -#100200.
System variable #118601 to #118650 can obtain the specified current position (machine coordinate


key: chroma:document
string_value:
system) in machine units, this machine coordinate is the value of the specified position without servo 
delay (servo position deviation) and acceleration / deceleration delay.
System variable #118651 to #118700 can obtain the current position (machine coordinate system) in 
machine units, this machine coordinate is the value with the servo delay(servo position deviation) and the 
acceleration / deceleration delay together.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 398 -
Variable 
number Variable name Position information Coordinate 
system
Tool 
position/tool 
length/cutter 
compensation
Servo delay 
and 
acceleration/ 
deceleration 
delay
Reading 
operation 
during 
movement
#5001
#5002
 :
#5020
[#_ABSIO[1]]
[#_ABSIO[2]]
 :
[#_ABSIO[20]]
1st axis block end point position
2nd axis block end point position
:
20th axis block end point position Workpiece 
coordinate 
system


key: chroma:document
string_value:
coordinate 
system
Not included Not included Enabled #100001
#100002 
:
#100050
[#_ABSIO[1]]
[#_ABSIO[2]]
 :
[#_ABSIO[50]]
1st axis block end point position
2nd axis block end point position
:
50th axis block end point position
#5021
#5022
 :
#5040
[#_ABSMT[1]]
[#_ABSMT[2]]
 :
[#_ABSMT[20]]
1st axis current position
2nd axis current position
:
20th axis current position
Machine 
coordinate 
system
(input unit)
Included Not included Disabled #100051
#100052
 :
#100100


key: chroma:document
string_value:
#100052
 :
#100100
[#_ABSMT[1]]
[#_ABSMT[2]]
 :
[#_ABSMT[50]]
1st axis current position
2nd axis current position
:
50th axis current position
#5041
#5042
 :
#5060
[#_ABSOT[1]]
[#_ABSOT[2]]
 :
[#_ABSOT[20]]
1st axis current position
2nd axis current position
:
20th axis current position Workpiece 
coordinate 
system
Included Not included Disabled #100101
#100102
 :
#100150
[#_ABSOT[1]]
[#_ABSOT[2]]
 :
[#_ABSOT[50]]
1st axis current position
2nd axis current position
:


key: chroma:document
string_value:
2nd axis current position
:
50th axis current position
#5061
#5062
 :
#5080
[#_ABSKP[1]]
[#_ABSKP[2]]
 :
[#_ABSKP[20]]
1st axis skip position
2nd axis skip position
:
20th axis skip position Workpiece 
coordinate 
system
Included
Bit 1(SEB)
of parameter 
No.6201
Enabled #100151
#100152
 :
#100200
[#_ABSKP[1]]
[#_ABSKP[2]]
 :
[#_ABSKP[50]]
1st axis skip position
2nd axis skip position
:
50th axis skip position
#118601
#118602 
:
#118650
[#_MCNPOS[1]]
[#_MCNPOS[2]] 
 :


key: chroma:document
string_value:
[#_MCNPOS[2]] 
 :
[#_MCNPOS[50]]
1st axis current position
2nd axis current position
:
50th axis current position
Machine 
coordinate 
system
(mahine 
unit)
Included Not included Disabled
#118651
#118652 
:
#118700
[#_ACTMCN[1]]
[#_ACTMCN[2]]
 :
[#_ACTMCN[50]]
1st axis current position
2nd axis current position
:
50th axis current position
Machine 
coordinate 
system
(machine 
unit)
Included Included Enabled


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 399 -
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The position information for 20th or earlier axis can be used with #5001 to 
#5080.
3 The block end point position (ABSIO) of the skip (G31) is the position where the 
skip signal is turned on. If the skip signal is not turned on, the position is the end 
position of the block.


key: chroma:document
string_value:
position of the block.
4 "Read operation during movement is disabled" means that the accurate reading 
of values during movement is not guaranteed.
- Tool length compensation value #5081-#5100, #100201-#100250 (Attribute: R)
M
Tool length compensation in the block currently being executed can be obtained for each axis by reading 
system variables #5081 to #5100 or #100201 to #100250.
Variable 
number Variable name Position information Read operation 
during movement
#5081
#5082
 :
#5100


key: chroma:document
string_value:
#5081
#5082
 :
#5100
[#_TOFS[1]]
[#_TOFS[2]]
 :
[#_TOFS[20]]
1st axis tool length compensation value
2nd axis tool length compensation value
:
20th axis tool length compensation value Disabled #100201
#100202
 :
#100250
[#_TOFS[1]]
[#_TOFS[2]]
 :
[#_TOFS[50]]
1st axis tool length compensation value
2nd axis tool length compensation value
:
50th axis tool length compensation value
NOTE
1 When variables exceeding the number of control axes are specified, the alarm


key: chroma:document
string_value:
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The tool length compensation for 20th or earlier axis can also be used with 
#5081 to #5100.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 400 -
- Tool offset #5081-#5100, #5121-#5140 (Attribute: R)
#100201-#100250, #100901-#100950
T
Tool offset in the block currently being executed can be obtained for each axis by reading system 
variables #5081 to #5100 or #5121 to #5140. (X-axis: X-axis of basic three axes, Z-axis: Z-axis of basic 
three axes, Y-axis: Y-axis of basic three axes)
<1> Without tool geometry/wear compensation memory
Variable


key: chroma:document
string_value:
Variable 
number Variable name Position information Read operation 
during movement
#5081
#5082
#5083
#5084
 :
#5100
[#_TOFSWX]
[#_TOFSWZ]
[#_TOFSWY]
[#_TOFS[4]]
 :
[#_TOFS[20]]
X-axis tool offset value
Z-axis tool offset value
Y-axis tool offset value
4th axis tool offset value
 :
20th axis tool offset value Disabled #100201
#100202
#100203
#100204
 :
#100250
[#_TOFSWX]
[#_TOFSWZ]
[#_TOFSWY]
[#_TOFS[4]]
 :
[#_TOFS[50]]
X-axis tool offset value
Z-axis tool offset value


key: chroma:document
string_value:
Z-axis tool offset value
Y-axis tool offset value
4th axis tool offset value
 :
50th axis tool offset value
<2> With tool geometry/wear compensation memory
Variable 
number Variable name Position information Read operation 
during movement
#5081
#5082
#5083
#5084
 :
#5100
[#_TOFSWX]
[#_TOFSWZ]
[#_TOFSWY]
[#_TOFS[4]]
 :
[#_TOFS[20]]
X-axis tool offset value (geometry)
Z-axis tool offset value (geometry)
Y-axis tool offset value (geometry)
4th axis tool offset value (geometry)
 :


key: chroma:document
string_value:
:
20th axis tool offset value (geometry) Disabled #100201
#100202
#100203
#100204
 :
#100250
[#_TOFSWX]
[#_TOFSWZ]
[#_TOFSWY]
[#_TOFS[4]]
 :
[#_TOFS[50]]
X-axis tool offset value (geometry)
Z-axis tool offset value (geometry)
Y-axis tool offset value (geometry)
4th axis tool offset value (geometry)
 :
50th axis tool offset value (geometry)
#5121
#5122
#5123
#5124
 :
#5140
[#_TOFSGX]
[#_TOFSGZ]
[#_TOFSGY]
[#_TOFSG[4]]
 :
[#_TOFSG[20]]
X-axis tool offset value (geometry)


key: chroma:document
string_value:
Z-axis tool offset value (geometry)
Y-axis tool offset value (geometry)
4th axis tool offset value (geometry)
 :
20th axis tool offset value (geometry) Disabled #100901
#100902
#100903
#100904
 :
#100950
[#_TOFSGX]
[#_TOFSGZ]
[#_TOFSGY]
[#_TOFSG[4]]
 :
[#_TOFSG[50]]
X-axis tool offset value (geometry)
Z-axis tool offset value (geometry)
Y-axis tool offset value (geometry)
4th axis tool offset value (geometry)
 :
50th axis tool offset value (geometry)


key: chroma:document
string_value:
When tool geometry/wear compensation memory exists, the system variable values vary as follows 
depending on bit 2 (LWT) of parameter No. 5002 and bit 4 (LGT) of parameter No. 5002.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 401 -
Variable 
number
LWT=0
LGT=0
LWT=1
LGT=0
LWT=0
LGT=1
LWT=1
LGT=1
#5081
 :
#5100
Wear compensation 0 Wear compensation Wear compensation
#5121
 :
#5140
Geometry 
compensation
Wear compensation + 
Geometry 
compensation
Geometry 
compensation
Geometry 
compensation
NOTE
1 The set value is read as the tool offset regardless of bit 1 (ORC) of parameter 
No.5004 and bit 0 (OWD) of parameter No.5040.


key: chroma:document
string_value:
2 To read the tool offset (geometry) using #5121 to #5140, set bit 2 (VHD) of 
parameter No.6004 to 0.
- Servo position deviation #5101-#5120, #100251-#100300 (Attribute: R)
The servo position deviation for each axis can be obtained by reading system variables #5101 to #5120 or 
#100251 to #100300.
Variable 
number Variable name Position information Read operation 
during movement
#5101
#5102
 :
#5120
[#_SVERR[1]]
[#_SVERR[2]]
 :
[#_SVERR[20]]
1st axis servo position deviation


key: chroma:document
string_value:
2nd axis servo position deviation
:
20th axis servo position deviation Disabled #100251
#100252
 :
#100300
[#_SVERR[1]]
[#_SVERR[2]]
 :
[#_SVERR[50]]
1st axis servo position deviation
2nd axis servo position deviation
:
50th axis servo position deviation
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The servo position deviation for 20th or earlier axis can be used with #5101 to 
#5120.


key: chroma:document
string_value:
#5120.
- Manual handle interruption #5121-#5140, #100651-#100700 (Attribute: R)
The manual handle interruption for each axis can be obtained by reading system variables #5121 to #5140 
or #100651 to #100700.
Variable 
number Variable name Position information Read operation 
during movement
#5121
#5122
 :
#5140
[#_MIRTP[1]]
[#_MIRTP[2]]
 :
[#_MIRTP[20]]
1st axis manual handle interruption
2nd axis manual handle interruption
:
20th axis manual handle interruption Disabled #100651
#100652


key: chroma:document
string_value:
#100652
 :
#100700
[#_MIRTP[1]]
[#_MIRTP[2]]
 :
[#_MIRTP[50]]
1st axis manual handle interruption
2nd axis manual handle interruption
:
50th axis manual handle interruption


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 402 -
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The manual handle interruption for 20th or earlier axis can be used with #5121 to 
#5140.
T
NOTE
#5121 to #5140 are enabled only when bit 2 (VHD) of parameter No.6004 is set 
to 1.
- Distance to go #5181-#5200, #100801-#100850 (Attribute: R)


key: chroma:document
string_value:
The distance to go value for each axis can be obtained by reading system variables #5181 to #5200 or 
#100801 to #100850.
Variable 
number Variable name Position information Read operation 
during movement
#5181
#5182
 :
#5200
[#_DIST[1]]
[#_DIST[2]]
 :
[#_DIST[20]]
1st axis distance to go value
2nd axis distance to go value
:
20th axis distance to go value Disabled #100801
#100802
 :
#100850
[#_DIST[1]]
[#_DIST[2]]
 :
[#_DIST[50]]
1st axis distance to go value


key: chroma:document
string_value:
1st axis distance to go value
2nd axis distance to go value
:
50th axis distance to go value
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The distance to go values for 20th or earlier axis can be used with #5181 to 
#5200.
- Workpiece coordinate system shift value #2501, #2601, #100751-#100800 
(Attribute: R/W)
T


key: chroma:document
string_value:
(Attribute: R/W)
T
The X-axis workpiece coordinate system shift value can be obtained by system variable #2501 while 
Z-axis workpiece coordinate system shift value by system variable #2601. Each workpiece coordinate 
system shift value can be obtained by system variable #100751-#100800. The X-axis or Z-axis workpiece 
coordinate system shift value can be changed by assigning values to the system variables. (X-axis: X-axis 
of basic three axes, Z-axis: Z-axis of basic three axes)


key: chroma:document
string_value:
Variable number Variable name Description
#2501 [#_WZ_SFTX] X-axis workpiece shift value
#2601 [#_WZ_SFTZ] Z-axis workpiece shift value
#100751
#100752
 :
#100800
[#_WZ_SFT[1]] 
[#_WZ_SFT [2]]
 :
[#_WZ_SFT [50]]
1st axis workpiece shift value
2nd axis workpiece shift value
:
50th axis workpiece shift value


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 403 -
NOTE
1 The value of a variable with a number greater than the number of controlled axes 
is undefined.
2 The X-axis of three basic axes can also be used in system variable #2501, and 
the Z-axis of three basic axes can also be used in system variable #2601.
- Workpiece origin offset value #5201-#5340, #100301-#100650 (Attribute: R/W)
The workpiece origin offset value can be obtained by reading system variables #5201 to #5340 or


key: chroma:document
string_value:
#100301 to #100650. The offset value can also be changed by assigning values to the system variables.
Variable 
number Variable name Controlled axis Workpiece 
coordinate system
#5201
#5202
:
#5220
[#_WZCMN[1]]
[#_WZCMN[2]]
:
[#_WZCMN[20]]
1st axis external workpiece origin offset value
2nd axis external workpiece origin offset value
:
20th axis external workpiece origin offset value
External workpiece 
origin offset value 
(applied to all 
coordinate systems)
#5221
#5222
:
#5240


key: chroma:document
string_value:
#5221
#5222
:
#5240
[#_WZG54[1]]
[#_WZG54[2]]
:
[#_WZG54[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G54
#5241
#5242
:
#5260
[#_WZG55[1]]
[#_WZG55[2]]
:
[#_WZG55[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G55
#5261
#5262
:
#5280
[#_WZG56[1]]
[#_WZG56[2]]
:
[#_WZG56[20]]
1st axis workpiece origin offset value


key: chroma:document
string_value:
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G56
#5281
#5282
:
#5300
[#_WZG57[1]]
[#_WZG57[2]]
:
[#_WZG57[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G57
#5301
#5302
:
#5320
[#_WZG58[1]]
[#_WZG58[2]]
:
[#_WZG58[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G58
#5321
#5322
:
#5340


key: chroma:document
string_value:
G58
#5321
#5322
:
#5340
[#_WZG59[1]]
[#_WZG59[2]]
:
[#_WZG59[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
G59
Variable 
number Variable name Controlled axis Workpiece 
coordinate system
#100301
#100302
:
#100350
[#_WZCMN[1]]
[#_WZCMN[2]]
:
[#_WZCMN[50]]
1st axis external workpiece origin offset value
2nd axis external workpiece origin offset value
:
50th axis external workpiece origin offset value


key: chroma:document
string_value:
External workpiece 
origin offset value 
(applied to all 
coordinate systems)
#100351
#100352
:
#100400
[#_WZG54[1]]
[#_WZG54[2]]
:
[#_WZG54[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
G54
#100401
#100402
:
#100450
[#_WZG55[1]]
[#_WZG55[2]]
:
[#_WZG55[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
G55


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 404 -
Variable 
number Variable name Controlled axis Workpiece 
coordinate system
#100451
#100452
:
#100500
[#_WZG56[1]]
[#_WZG56[2]]
:
[#_WZG56[50]]
1st axis workpiece origin offset
2nd axis workpiece origin offset
:
50th axis workpiece origin offset
G56
#100501
#100502
:
#100550
[#_WZG57[1]]
[#_WZG57[2]]
:
[#_WZG57[50]]
1st axis workpiece origin offset
2nd axis workpiece origin offset
:
50th axis workpiece origin offset
G57


key: chroma:document
string_value:
G57
#100551
#100552
:
#100600
[#_WZG58[1]]
[#_WZG58[2]]
:
[#_WZG58[50]]
1st axis workpiece origin offset
2nd axis workpiece origin offset
:
50th axis workpiece origin offset
G58
#100601
#100602
:
#100650
[#_WZG59[1]]
[#_WZG59[2]]
:
[#_WZG59[50]]
1st axis workpiece origin offset
2nd axis workpiece origin offset
:
50th axis workpiece origin offset
G59
M
The following variables can also be used when bit 5 (D15) of parameter No. 6004 is set to 0:
Axis Function Variable number


key: chroma:document
string_value:
Axis Function Variable number
1st axis External workpiece origin offset value #2500
G54 workpiece origin offset value #2501
G55 workpiece origin offset value #2502
G56 workpiece origin offset value #2503
G57 workpiece origin offset value #2504
G58 workpiece origin offset value #2505
G59 workpiece origin offset value #2506
2nd axis External workpiece origin offset value #2600
G54 workpiece origin offset value #2601
G55 workpiece origin offset value #2602
G56 workpiece origin offset value #2603


key: chroma:document
string_value:
G57 workpiece origin offset value #2604
G58 workpiece origin offset value #2605
G59 workpiece origin offset value #2606
3rd axis External workpiece origin offset value #2700
G54 workpiece origin offset value #2701
G55 workpiece origin offset value #2702
G56 workpiece origin offset value #2703
G57 workpiece origin offset value #2704
G58 workpiece origin offset value #2705
G59 workpiece origin offset value #2706
4th axis External workpiece origin offset value #2800


key: chroma:document
string_value:
G54 workpiece origin offset value #2801
G55 workpiece origin offset value #2802
G56 workpiece origin offset value #2803
G57 workpiece origin offset value #2804
G58 workpiece origin offset value #2805
G59 workpiece origin offset value #2806


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 405 -
T
The following variables can be used to maintain compatibility with conventional models.
Axis Function Variable number
1st axis External workpiece origin offset value #2550
G54 workpiece origin offset value #2551
G55 workpiece origin offset value #2552
G56 workpiece origin offset value #2553
G57 workpiece origin offset value #2554
G58 workpiece origin offset value #2555
G59 workpiece origin offset value #2556


key: chroma:document
string_value:
2nd axis External workpiece origin offset value #2650
G54 workpiece origin offset value #2651
G55 workpiece origin offset value #2652
G56 workpiece origin offset value #2653
G57 workpiece origin offset value #2654
G58 workpiece origin offset value #2655
G59 workpiece origin offset value #2656
3rd axis External workpiece origin offset value #2750
G54 workpiece origin offset value #2751
G55 workpiece origin offset value #2752
G56 workpiece origin offset value #2753


key: chroma:document
string_value:
G57 workpiece origin offset value #2754
G58 workpiece origin offset value #2755
G59 workpiece origin offset value #2756
4th axis External workpiece origin offset value #2850
G54 workpiece origin offset value #2851
G55 workpiece origin offset value #2852
G56 workpiece origin offset value #2853
G57 workpiece origin offset value #2854
G58 workpiece origin offset value #2855
G59 workpiece origin offset value #2856
NOTE
1 When variables exceeding the number of control axes are specified, the alarm


key: chroma:document
string_value:
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 The workpiece origin offset value for 20th or earlier axis can be used with #5201
to #5340.
M
NOTE
To use variables #2500 to #2806, #5201 to #5340, and #100301 to #100650, 
setting that bit 0 (NWA) of parameter No. 8136 is 0 is necessary.
T
NOTE
To use variables #2550 to #2856, #5201 to #5340, and #100301 to #100650, 
setting that bit 0 (NWA) of parameter No. 8136 is 0 is necessary.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 406 -
- Workpiece origin offset value of the additional workpiece coordinate system 
#7001-#7960, #101001-#116000 (Attribute: R/W)
M
#14001-#20000 (Attribute: R/W)
The workpiece origin offset value of the additional workpiece coordinate system can be obtained by 
reading system variables #7001 to #7960, #14001 to #20000, #101001 to #116000. The offset value can 
also be changed by assigning values to the system variables.
Variable


key: chroma:document
string_value:
Variable 
number Variable name Controlled axis Additional workpiece 
system number
#7001
#7002
 :
#7020
[#_WZP1[1]]
[#_WZP1[2]]
 :
[#_WZP1[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
1
(G54.1 P1)
#7021
#7022
 :
#7040
[#_WZP2[1]]
[#_WZP2[2]]
 :
[#_WZP2[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
2
(G54.1 P2)
#7041


key: chroma:document
string_value:
2
(G54.1 P2)
#7041
#7042
 :
#7060
[#_WZP3[1]]
[#_WZP3[2]]
 :
[#_WZP3[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
3
(G54.1 P3)
: : : :
#7941
#7942
 :
#7960
[#_WZP48[1]]
[#_WZP48[2]]
 :
[#_WZP48[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
48
(G54.1 P48)


key: chroma:document
string_value:
48
(G54.1 P48)
System variable number = 7000 + (Coordinate system number -1) × 20 + Axis number
Coordinate number: 1 to 48
Axis number: 1 to 20
M
Variable 
number Variable name Controlled axis Additional workpiece 
system number
#14001
#14002
 :
#14020
[#_WZP1[1]]
[#_WZP1[2]]
 :
[#_WZP1[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
1
(G54.1 P1)
#14021
#14022
 :
#14040
[#_WZP2[1]]
[#_WZP2[2]]
 :


key: chroma:document
string_value:
[#_WZP2[1]]
[#_WZP2[2]]
 :
[#_WZP2[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
2
(G54.1 P2)
#14041
#14042
 :
#14060
[#_WZP3[1]]
[#_WZP3[2]]
 :
[#_WZP3[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
3
(G54.1 P3)
: : : :
#19981
#19982
 :
#20000
[#_WZP300[1]]
[#_WZP300[2]]
 :
[#_WZP300[20]]


key: chroma:document
string_value:
:
[#_WZP300[20]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
20th axis workpiece origin offset value
300
(G54.1 P300)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 407 -
System variable number = 14000 + (Coordinate system number -1) × 20 + Axis number
Coordinate number: 1 to 300
Axis number: 1 to 20
Variable 
number Variable name Controlled axis Additional workpiece 
system number
#101001
#101002
 :
#101050
[#_WZP1[1]]
[#_WZP1[2]]
 :
[#_WZP1[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
1
(G54.1 P1)
#101051
#101052
 :


key: chroma:document
string_value:
#101051
#101052
 :
#101100
[#_WZP2[1]]
[#_WZP2[2]]
 :
[#_WZP2[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
2
(G54.1 P2)
#101101
#101102
 :
#101150
[#_WZP3[1]]
[#_WZP3[2]]
 :
[#_WZP3[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
3
(G54.1 P3)
: : : :
#115951
#115952
 :
#116000
[#_WZP300[1]]
[#_WZP300[2]]
 :


key: chroma:document
string_value:
[#_WZP300[2]]
 :
[#_WZP300[50]]
1st axis workpiece origin offset value
2nd axis workpiece origin offset value
:
50th axis workpiece origin offset value
300
(G54.1 P300)
System variable number = 101000 + (Coordinate system number -1) × 50 + Axis number
Coordinate number: 1 to 300
Axis number: 1 to 50
M
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.


key: chroma:document
string_value:
2 The workpiece origin offset of additional workpiece coordinate system for 20th or 
earlier axis can be used with #7001 to #7960 or #14001 to #20000.
3 To use #7001 to #7960 (G54.1 P1 to G54.1 P48), Addition of workpiece 
coordinate system pair (48 pairs) (bits 0 (NWZ) and 2 (NWN) of parameter No. 
8136) is required. To use #14001 to #20000, and #101001 to #116000 (G54.1 
P1 to G54.1 P300), Addition of workpiece coordinate system pair (300 pairs) is


key: chroma:document
string_value:
required. In this case, #7001 to #7960 can also be used.
T
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
2 To use #7001 to #7960 (G54.1 P1 to G54.1 P48), Addition of workpiece 
coordinate system pair (48 pairs) (bits 0 (NWZ) and 2 (NWN) of parameter No. 
8136) is required.
3 To use #101001 to #116000 (G54.1 P1 to G54.1 P300), Addition of workpiece


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 408 -
- Skip position (detection unit) #5421-#5440, #100701-#100750 (Attribute: R)
The skip position with the detection unit can be obtained by reading system variables #5421 to #5440 or 
#100701 to #100750. The values of these variables are integers, and values in the workpiece coordinate 
system.
Variable 
number Variable name Position information Read operation 
during movement
#5421
#5422
 :
#5440
[#_SKPDTC[1]]
[#_SKPDTC[2]]
 :
[#_SKPDTC[20]]


key: chroma:document
string_value:
:
[#_SKPDTC[20]]
1st axis skip position (detection unit)
2nd axis skip position (detection unit)
:
20th axis skip position (detection unit) Disabled #100701
#100702
 :
#100750
[#_SKPDTC[1]]
[#_SKPDTC[2]]
 :
[#_SKPDTC[50]]
1st axis skip position (detection unit)
2nd axis skip position (detection unit)
:
50th axis skip position (detection unit)
NOTE
1 When variables exceeding the number of control axes are specified, the alarm 
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.


key: chroma:document
string_value:
2 The skip position (detection unit) for 20th or earlier axis can be used with #5421
to #5440.
3 To specify these variables, set bit 2 (DSK) of parameter No. 6210 to 1. (If an 
attempt is made to specify them when DSK is 0, alarm PS0115 is issued.)
- Second geometry tool offset value #5801-#5896, #27001-#29999 (Attribute: 
R/W)
T
By reading the values of system variables #5801 to #5896 and #27001 to #29999, it is possible to


key: chroma:document
string_value:
determine the second geometry tool offset value, and by assigning values to the system variables, it is 
possible to change the second geometry tool offset value.
- For compensation numbers up to 32
Compensation 
number
Variable 
number Variable name Attribute Description
1 #5801 [#_OFSX2G[1]] R/W
Second geometry tool offset X-axis 
compensation value : : : :
32 #5832 [#_OFSX2G[32]] R/W
1 #5833 [#_OFSZ2G[1]] R/W
Second geometry tool offset Z-axis 
compensation value : : : :


key: chroma:document
string_value:
compensation value : : : :
32 #5864 [#_OFSZ2G[32]] R/W
1 #5865 [#_OFSY2G[1]] R/W
Second geometry tool offset Y-axis 
compensation value : : : :
32 #5896 [#_OFSY2G[32]] R/W
- For compensation numbers greater than 32 (Compensation values with compensation numbers of up 
to 32 can also be used in variables #5801 to #5896.)
Compensation 
number
Variable 
number Variable name Attribute Description
1 #27001 [#_OFSX2G[1]] R/W Second geometry tool offset X-axis 
compensation value : : : :


key: chroma:document
string_value:
compensation value : : : :
999 #27999 [#_OFSX2G[999]] R/W
1 #28001 [#_OFSZ2G[1]] R/W Second geometry tool offset Z-axis 
compensation value : : : :
999 #28999 [#_OFSZ2G[999]] R/W
1 #29001 [#_OFSY2G[1]] R/W Second geometry tool offset Y-axis 
: : : : compensation value


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 409 -
Compensation 
number
Variable 
number Variable name Attribute Description
999 #29999 [#_OFSY2G[999]] R/W
- Cartridge number of the tool management function #8400 (Attribute: R/W)
By specifying the cartridge number of a spindle position (11 to 14) or standby position (21 to 24) in 
#8400, information about the corresponding position can be read. For details of the tool management 
function, refer to subsection "TOOL MANAGEMENT FUNCTION".


key: chroma:document
string_value:
Variable number Variable name Description
#8400 - Cartridge number of the tool management function
- Tool management data #8401-#8414, #8431-#8470 (Attribute: R)
By reading system variables #8401 to #8414 and #8431 to #8470, it is possible to determine the tool 
management data about the position specified in #8400. For details of the tool management function, refer 
to subsection "TOOL MANAGEMENT FUNCTION".
M
Variable number Variable name Description
#8401 - Data number


key: chroma:document
string_value:
#8401 - Data number
#8402 - Tool type number (T)
#8403 - Tool life counter
#8404 - Maximum tool life value
#8405 - Tool notice life value
#8406 - Tool life status
#8407 - Customize data 0 (bit)
#8408 - Tool information
#8409 - Tool length compensation number (H)
#8410 - Cutter compensation number (D)
#8411 - Spindle speed (S)
#8412 - Cutting feedrate (F)
#8431
 :
#8470
-
:
-
Customize data 1
 :
Customize data 40
T
Variable number Variable name Description
#8401 - Data number


key: chroma:document
string_value:
#8401 - Data number
#8402 - Tool type number (T)
#8403 - Tool life counter
#8404 - Maximum tool life value
#8405 - Tool notice life value
#8406 - Tool life status
#8407 - Customize data 0 (bit)
#8408 - Tool information
#8411 - Spindle speed (S)
#8412 - Cutting feedrate (F)
#8413 - Tool geometry compensation number (G)
#8414 - Tool wear compensation number (W)
#8431
 :
#8470
-
:
-
Customize data 1
 :
Customize data 40


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 410 -
- Feedrate reduction ratio for rapid traverse overlap #100851-#100900 (Attribute: 
R/W) 
The feedrate reduction ratio for rapid traverse overlap can also be changed by setting values to the system 
variables #100851 to #100900.
Variable number Variable name Controlled axis
#100851
#100852
 :
#100900
[#_ROVLP[1]]
[#_ROVLP[2]]
 :
[#_ROVLP[50]]
1st axis feedrate reduction ratio for rapid traverse overlap


key: chroma:document
string_value:
2nd axis feedrate reduction ratio for rapid traverse overlap
:
50th axis feedrate reduction ratio for rapid traverse overlap
- States of serial spindles #100951 to #100954 (Attribute: R)
Using system variables #100951 to #100954, it is possible to determine the states of serial spindles. The 
relationships between the values of the variables and the states of spindles are as follows:
1 : Normal operation
2 : Orientation
3 : Synchronous control
4 : Rigid tapping
5 : Cs contour control


key: chroma:document
string_value:
5 : Cs contour control
Variable number Variable name Description 
#100951
#100952
#100953
#100954
[#_SPSTAT[1]]
[#_SPSTAT[2]]
[#_SPSTAT[3]]
[#_SPSTAT[4]]
State of the first spindle on the path
State of the second spindle on the path
State of the third spindle on the path
State of the fourth spindle on the path
- Clamp value of spindle maximum speed #100959 (Attribute: R)
Using system variables #100959, it is possible to obtain the spindle maximum speed commanded at clamp


key: chroma:document
string_value:
command of maximum spindle speed. In the following case, #100959 is -1.
- Clamp command of maximum spindle speed G92 (G50 in G code system A of T series) has not been 
executed after turning on the power.
Variable number Variable name Description 
#100959 [#_CSSSMAX] Spindle maximum speed commanded at clamp command of maximum 
spindle speed
- Dynamic reference tool compensation value #118051-#118450 (Attribute: R/W)
M


key: chroma:document
string_value:
M
The dynamic reference tool compensation value in the rotary head dynamic tool compensation function 
can be obtained by reading system variables #118051 to #118450. The dynamic reference tool 
compensation value can also be obtained by assigning values to the system variables.
Variable 
number Variable name Controlled axis Dynamic tool 
offset number
#118051
#118052
 :
#118100
[#_DOFS1[1]]
[#_DOFS1[2]]
 :
[#_DOFS1[50]]
1st axis dynamic reference tool compensation value


key: chroma:document
string_value:
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
1
(G43.2H1)
#118101
#118102
 :
#118150
[#_DOFS2[1]]
[#_DOFS2[2]]
 :
[#_DOFS2[50]]
1st axis dynamic reference tool compensation value
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
2
(G43.2H2)
#118151
#118152
 :
#118200
[#_DOFS3[1]]
[#_DOFS3[2]]
 :
[#_DOFS3[50]]
1st axis dynamic reference tool compensation value


key: chroma:document
string_value:
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
3
(G43.2H3)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 411 -
Variable 
number Variable name Controlled axis Dynamic tool 
offset number
#118201
#118202
 :
#118250
[#_DOFS4[1]]
[#_DOFS4[2]]
 :
[#_DOFS4[50]]
1st axis dynamic reference tool compensation value
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
4
(G43.2H4)
#118251
#118252
 :
#118300
[#_DOFS5[1]]
[#_DOFS5[2]]
 :
[#_DOFS5[50]]
1st axis dynamic reference tool compensation value


key: chroma:document
string_value:
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
5
(G43.2H5)
: : : :
#118401
#118402
 :
#118450
[#_DOFS8[1]]
[#_DOFS8[2]]
 :
[#_DOFS8[50]]
1st axis dynamic reference tool compensation value
2nd axis dynamic reference tool compensation value
:
50th axis dynamic reference tool compensation value
8
(G43.2H8)
NOTE
When variables exceeding the number of control axes are specified, the alarm


key: chroma:document
string_value:
PS0115, “VARIABLE NO. OUT OF RANGE” occurs.
- Local coordinate system offset value #118501-#118550 (Attribute: R)
Using system variables #118501 to #118550, it is possible to determine the local coordinate system (G52) 
offset value.
Variable
number Variable name Description
#118501
#118502
:
#118550
[#_LCLOFS[1]] 
[#_LCLOFS[2]]
 :
[#_LCLOFS[50]]
1st axis local coordinate system offset value
2nd axis local coordinate system offset value
:
50th axis local coordinate system offset value


key: chroma:document
string_value:
- Torque difference of Axis synchronous #180801-#180850 (Attribute: R)
Using system variables #180801 to #180850, it is possible to determine the torque difference of master 
axis and slave axis in Axis synchronous control. Parameter (No.8311) determines the combination of 
master axis and slave axis, and torque difference of master axis and slave axis is output to system variable 
of slave axis during synchronous operation and normal operation. The output torque difference is the


key: chroma:document
string_value:
value obtained by subtracting torque value of slave axis from the torque value of master axis.
System value is read “0” in master axis. The case of axis more than the number of axis in a path is read 
“0” as with master axis.
Variable
number Variable name Description
#180801
#180802
:
#180850
[#_SYNTD[1]] 
[#_SYNTD [2]]
 :
[#_SYNTD [50]]
1st axis torque difference of Axis synchronous
2nd axis torque difference of Axis synchronous
:
50th axis torque difference of Axis synchronous
NOTE


key: chroma:document
string_value:
NOTE
When value of parameter (No.8311) is incorrect, data of system variable cannot 
be read and becomes alarm (PS5580) “CANNOT GET SYSTEM VARIABLE”.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 412 -
- Tool life management #181000-#181002 (Attribute: R)
Using system variables #181000 to #181002, it is possible to determine the information (tool group 
numbers, tool life values and life counter values of a group being used).
Variable
number Variable name Description
#181000 [#_TLMGN_C] Tool life management data (Tool group numbers)
#181001 [#_TLMML_C] Tool life management data (Tool life values)


key: chroma:document
string_value:
#181002 [#_TLMLC_C] Tool life management data (Life counter values)
- Switching between P-CODE variables and system variables (#10000 or later)
#8570 (Attribute: R/W)
This system variable allows read/write operations of P-CODE variables (#10000 to #89999) for the macro 
executor function. For details on P-CODE variables, refer to the Macro Executor Programming Manual
(B-63943EN-2).
System variable #8570 can be used to make variables #10000 or later correspond to either P-CODE


key: chroma:document
string_value:
variables or system variables.
#8570 setting Specified variable Corresponding variable
#8570 = 1
#10000
:
#89999
P-CODE variables (#10000)
:
P-CODE variables (#89999)
#8570 = 0
#10000
:
#89999
System variables (#10000)
:
System variables (#89999)
Example
#8570 = 0 ; 
#10001 = 123 ; → Writing to system variable #10001 (tool compensation)
#8570 = 1 ;
#10001 = 456 ; → Writing to P-CODE variable #10001 (tool compensation)
NOTE


key: chroma:document
string_value:
NOTE
1 Variable #8570 can be used only when the macro executor function is enabled.
2 System variables (#10000 or later) always correspond to system variables 
specified by their variable names even when #8570 is 1.
3 When an attempt is made to access a variable that cannot be used with 
P-CODE variables (#10000 or later), an alarm PS0115, “VARIABLE NO. OUT 
OF RANGE” occurs.
- Exclusion control between each path #182001-#182010 (Attribute: R/W)


key: chroma:document
string_value:
In the custom macro of multi-path, if it is not convenient to operate at the same time in the multi-path, 
a single path that can be execution on the system variable will be notified.
Exclusive control in a custom macro between each path will be available by this function.
By writing a non-zero to the system variable from #182001 to #182010, execute the acquisition of 
priority.
If the path was able to get the priority, 1 can be read from the system variable from #182001 to #182010.


key: chroma:document
string_value:
If the path has not acquired priority, 0 can be read from the system variable.
By writing a 0 to the system variable from #182001 to #182010, execute the abandon of priority.
By writing a non-zero to the system variable, the following path will be able to get the priority.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 413 -
NOTE
By writing a NULL to the system variable from #182001 to #182010, It is treated
as 0.
The state of the priority does not change at the reset input. If bit 0 (SPR) of parameter No. 6022 is set to 1, 
it is possible to abandon the priority at the reset.
Variable
number
Variable name Description
#182001
:
#182010
[#_PRIO[1]]
 :
[#_PRIO[10]]
System variables for the 1st exclusive control
:
System variables for the 10th exclusive control


key: chroma:document
string_value:
16.3 DISPLAY OF SYSTEM VARIABLES
System variables are displayed on the custom macro screen.
Explanation
System variables of the previous section (#1000-#8499, #10000-#89999, #100000-#199999 ) can be 
displayed on the custom macro screen when bit 4 (CSD) of parameter No.11369 is set to 1. The value of 
system variables which is not used is not displayed. 
Refer to the section of "Displaying and Setting Custom Macro Common Variables" for the display of the 
custom macro screen.


key: chroma:document
string_value:
custom macro screen.
When macro executor is effective, the P-CODE variable can be used. The number of the P-CODE 
variable overlaps with the number of system variables (#10000-#89999) because #10000-#89999 is used 
for the P-CODE variable. Therefore, the treatment of the system variable and the P-CODE variable can be 
changed by system variable #8570. Refer to the previous section for system variable #8570.


key: chroma:document
string_value:
When bit 4 (CSD) of parameter No.11369 is 1, the display of #10000-#89999 is switched as follows by 
setting of #8570.
- In case of #8570=0, system variables are displayed in #10000-#89999. 
- In case of #8570=1, P-CODE variables are displayed in #10000-#89999. 
NOTE
When macro executor is effective, the macro screen of macro executor is 
displayed besides the macro screen of the custom macro. (Macro screen of 
execution macro, conversational macro, auxiliary macro) However, bit 4 (CSD)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 414 -
16.4 READING AND WRITING VARIABLES FOR ANOTHER 
PATH
By adding a path number to the high-order 8th and 9th digits of a variable, it is possible to read and write 
a common variable or a system variable for another path.
For a list of variables that can be read and written, see "List of variables that can be read and written".
Format
#ppxxxxxxx
pp: Path number 
Omitted = Local path
1 = First path
: :
4 = Forth path
xxxxxxx: Variable number


key: chroma:document
string_value:
xxxxxxx: Variable number
Common variable (#100 to #499(Note), #500 to #999(Note)) or system variable number (1000 and above, 
10000 and above, 100000 and above)
NOTE
Available common variables and system variables differ depending on the 
system configuration.
Example
Machine coordinates for path 1 Machine coordinates for path 2
X1 123.456 X2 -123.456
Y1 45.670 Z2 78.900
Z1 345.789 C2 45.000
In the case above, if #100=#5023 is executed on path 1, the machine coordinate


key: chroma:document
string_value:
345.789 on the third axis on path 1 is read into variable #100.
If #100=#20005023 is executed, the machine coordinate 45.0 on the third axis 
on path 2 is read into variable #100.
NOTE
1 Variable names cannot be specified.
2 If a path number out of the range is specified, alarm PS0115, “VARIABLE NO. 
OUT OF RANGE” is issued.
3 Local variables for another path cannot be read or written.
4 If reading or writing variables for another path is executed using a real time


key: chroma:document
string_value:
custom macro, alarm PS0390, “ILLEGAL MACRO VAR” is issued.
Caution
CAUTION
System variables include those that affect automatic operation (for example, 
variables #3000 to #3999), and they affect the operation on another path. Use 
great caution when writing them.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 415 -
List of variables that can be read and written
This function can read and write the following variables for another path.
For details of system variables, see the description of variables in the previous section.
R, W, and R/W are variable attributes, and respectively represent READ only, WRITE only, and 
READ/WRITE.
- Common variable
System variable number Attribute Description
#100 to #149(#199)
#200 to #499
#500 to #549(#999)


key: chroma:document
string_value:
#500 to #549(#999)
R/W Available common variables differ depending on the system 
configuration.
- Interface signals
System variable number Attribute Description
#1000 to #1035 R Interface input signals
#1100 to #1135 R/W Interface output signals
- Tool compensation value
System variable number Attribute Description
#2001 to #2964
#10001 to #19999
R/W Tool compensation value
- Workpiece coordinate system shift amount
T
System variable number Attribute Description


key: chroma:document
string_value:
#100751 to #100800 R/W Workpiece coordinate system shift amount
- Automatic operation or the like
System variable number Attribute Description
#3001, #3002 R/W Clock 
#3003 R/W Control for waiting for a single block stop and the auxiliary function 
completion signal
#3004 R/W Feed hold, feedrate override, exact stop check
#3005 R/W Setting data.
#3007 R Status of a mirror image (DI and setting)
#3008 R State during a program restart
- Time
System variable number Attribute Description


key: chroma:document
string_value:
#3011 to #3012 R Year/Month/Date, Hour/Minute/Second
- Number of parts
System variable number Attribute Description
#3901 to #3902 R/W Total number of parts, Number of required parts
- Tool compensation memory
M
System variable number Attribute Description
#3980 R Tool compensation memory information


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 416 -
- Main program number
System variable number Attribute Description
#4000 R Main program number
- Modal information
System variable number Attribute Description
#4001 to #4530 R Modal information
- Position information
System variable number Attribute Description
#5001 to #5020
#100001 to #100050
R End point position of the block (workpiece coordinate system)
#5021 to #5040
#100051 to #100100


key: chroma:document
string_value:
#100051 to #100100
R Specified current position of input unit (machine coordinate system)
#5041 to #5060
#100101 to #100150
R Specified current position (workpiece coordinate system)
#5061 to #5080
#100151 to #100200
R Skip position (workpiece coordinate system)
#118601 to #118650 R Specified current position of machine unit (machine coordinate system).
Value of the specified current position without servo delay and 
acceleration / deceleration delay.


key: chroma:document
string_value:
#118651 to #118700 R Current position of machine unit (machine coordinate system).
Value of the current position with servo delay and acceleration / 
deceleration delay.
- Tool length compensation value
M
System variable number Attribute Description
#5081 to #5100
#100201 to #100250
R Tool length compensation value
- Tool offset value
T
System variable number Attribute Description
#5081 to #5083
#100201～#100250
R Tool offset value (wear)
#5121 to #5123
#100901～#100950


key: chroma:document
string_value:
#100901～#100950
R Tool offset value (geometry)
- Servo position deviation
System variable number Attribute Description
#5101 to #5120
#100251 to #100300
R Servo positional deviation
- Manual handle interruption
System variable number Attribute Description
#5121 to #5140
#100651 to #100700
R Manual handle interruption


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 417 -
- Distance to go
System variable number Attribute Description
#5181 to #5200
#100801 to #100850
R Distance to go
- Workpiece origin offset value, extended workpiece origin offset value
M
System variable number Attribute Description
#5201 to #5340
#100301 to #100650
R/W Workpiece origin offset value
Extended workpiece origin offset value
#7001 to #7960
#14001 to #20000
#101001 to #116000
R/W Workpiece origin offset value
T


key: chroma:document
string_value:
T
System variable number Attribute Description
#5201 to #5340
#100301 to #100650
R/W Workpiece origin offset value
Extended workpiece origin offset value
#7001 to #7960
#101001 to #116000
R/W Workpiece origin offset value
- Skip position (detection unit)
System variable number Attribute Description
#5421 to #5440
#100701 to #100750
R Skip position (detection unit)
- Second geometry tool offset value
T
System variable number Attribute Description


key: chroma:document
string_value:
#27001 to #29999 R/W Second geometry tool offset value
- Tool life management
System variable number Attribute Description
#181000 R Tool life management data (Tool group numbers)
#181001 R Tool life management data (Tool life values)
#181002 R Tool life management data (Life counter values)
- Others (#8570)
System variable number Attribute Description
#8570 R/W Switching of P-CODE variables/system variables (#10000 and above)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 418 -
16.5 ARITHMETIC AND LOGIC OPERATION
Various operations can be performed on variables. Program an arithmetic and logic operation in the same 
way as for a general arithmetic expression.
#i=<expression>
<Expression>
The expression to the right of the arithmetic and logic operation contains constants and/or variables 
combined by a function or operator. Variables #j and #k below can be replaced with a constant. If a


key: chroma:document
string_value:
constant used in an expression has no decimal point, it is assumed to end with a decimal point.
Table 16.5 (a) Arithmetic and logic operation 
Type of operation Operation Description
<1> Definition or 
replacement
#i=#j Definition or replacement of a variable
<2> Addition-type 
operations
#i=#j+#k
#i=#j-#k
#i=#j OR #k
#i=#j XOR #k
Addition
Subtraction
Logical OR (bit by bit of 32 bits)
Exclusive OR (bit by bit of 32 bits)
<3> Multiplication-type 
operations
#i=#j*#k
#i=#j/#k


key: chroma:document
string_value:
operations
#i=#j*#k
#i=#j/#k
#i=#j AND #k
#i=#j MOD #k
Multiplication
Division
Logical AND (bit by bit of 32 bits)
Remainder (A remainder is obtained after #j and #k are 
rounded to their nearest whole numbers. When #j is a 
negative value, #i is assumed to be a negative value.)
<4> Functions #i=SIN[#j]
#i=COS[#j]
#i=TAN[#j]
#i=ASIN[#j]
#i=ACOS[#j]
#i=ATAN[#j]
#i=ATAN[#j]/[#k]
#i=ATAN[#j,#k]
#i=SQRT[#j]
#i=ABS[#j]
#i=BIN[#j]
#i=BCD[#j]
#i=ROUND[#j]
#i=FIX[#j]
#i=FUP[#j]
#i=LN[#j]


key: chroma:document
string_value:
#i=FUP[#j]
#i=LN[#j]
#i=EXP[#j]
#i=POW[#j,#k]
#i=ADP[#j]
#i=PRM[#j]
#i=PRM[#j,#k]
#i=PRM[#j]/[#l]
#i=PRM[#j,#k]/[#l]
Sine (in degrees)
Cosine (in degrees)
Tangent (in degrees)
Arc sine
Arc cosine
Arc tangent (one argument), ATN can also be used.
Arc tangent (two arguments), ATN can also be used.
Arc tangent (two arguments), ATN can also be used.
Square root, SQR can also be used.
Absolute value
Conversion from BCD to binary
Conversion from binary to BCD


key: chroma:document
string_value:
Conversion from binary to BCD
Rounding off, RND can also be used.
Rounding down to an integer
Rounding up to an integer
Natural logarithm
Exponent using base e (2.718...)
Power (#j to the #kth power)
Addition of a decimal point
Parameter reading (system common, path, or machine group 
parameter)
Parameter reading (system common, path, or machine group 
parameter bit number specification)
Parameter reading (axis or spindle parameter)
Parameter reading (axis or spindle parameter bit number


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 419 -
Explanation
- Angle units
The units of angles used with the SIN, COS, ASIN, ACOS, TAN, and ATAN functions are degrees. For 
example, 90 degrees and 30 minutes is represented as 90.5 degrees. 
- ARCSIN #i = ASIN[#j];
- The solution ranges are as indicated below:
When the bit 0 (NAT) of parameter No. 6004 is set to 0: 270° to 90°
When the bit 0 (NAT) of parameter No. 6004 is set to 1: -90° to 90°


key: chroma:document
string_value:
- When #j is beyond the range of -1 to 1, an alarm PS0119, “ARGUMENT VALUE OUT OF 
RANGE” is issued.
- A constant can be used instead of the #j variable.
- ARCCOS #i = ACOS[#j];
- The solution ranges from 180° to 0°.
- When #j is beyond the range of -1 to 1, an alarm PS0119, “ARGUMENT VALUE OUT OF 
RANGE” is issued.
- A constant can be used instead of the #j variable.
- ARCTAN #i = ATAN[#j]/[#k]; (two arguments)
- ATAN[#j,#k] is equivalent to ATAN[#j]/[#k].


key: chroma:document
string_value:
- When point (#k,#j) on plane X-Y is given, this function returns the value of the arc tangent for the 
angle made by the point.
- A constant can be used instead of the #j variable.
- If the #j=0 and #k=0, an alarm PS0119, “ARGUMENT VALUE OUT OF RANGE” is issued.
- The solution ranges are as follows:
When the bit 0 (NAT) of parameter No. 6004 is set to 0: 0° to 360°
Example: When #1 = ATAN[-1]/[-1]; is specified, #1 is 225.0.
When the bit 0 (NAT) of parameter No. 6004 is set to 1: -180° to 180°


key: chroma:document
string_value:
Example: When #1 = ATAN[-1]/[-1]; is specified, #1 is -135.0.
- ARCTAN #i = ATAN[#j]; (one argument)
- When ATAN is specified with one argument, this function returns the main value of arc tangent 
(-90° ≤ ATAN[#j] ≤ 90°). In other word, this function returns the same value as ATAN in calculator 
specifications.
- To use this function as the dividend of a division, be sure to enclose it with brackets ([]). If this 
function is not enclosed, ATAN[#j]/[#k] is assumed.
Example:


key: chroma:document
string_value:
Example:
#100 = [ATAN[1]]/10 ; : Divides ATAN with one argument by 10.
#100 = ATAN[1]/[10] ; : Executes ATAN with two arguments.
#100 = ATAN[1]/10 ; : Assumes ATAN with two arguments, but issues an alarm PS1131, 
“MISSING OPEN BRACKET” because the X coordinate 
specification is not enclosed with brackets ([]).
- Natural logarithm #i = LN[#j];
- When the antilogarithm (#j) is zero or smaller, an alarm PS0119, “ARGUMENT VALUE OUT OF 
RANGE” is issued.


key: chroma:document
string_value:
RANGE” is issued.
- A constant can be used instead of the #j variable.
- Exponential function #i = EXP[#j];
- When the result of the operation overflows, an alarm PS0111, “OVERFLOW :FLOATING” is 
issued.
- A constant can be used instead of the #j variable.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 420 -
- ROUND function 
- When the ROUND function is included in an arithmetic or logic operation command, IF statement, 
or WHILE statement, the ROUND function rounds off at the first decimal place.
Example:
When #1=ROUND[#2]; is executed where #2 holds 1.2345, the value of variable #1 is 
1.0. 
- When the ROUND function is used in NC statement addresses, the ROUND function rounds off the


key: chroma:document
string_value:
specified value according to the least input increment of the address.
Example:
Creation of a drilling program that cuts according to the values of variables #1 and #2, 
then returns to the original position 
Suppose that the increment system is 1/1000 mm, variable #1 holds 1.2345, and 
variable #2 holds 2.3456. Then, 
G00 G91 X-#1; Moves 1.235 mm in negative direction.
G01 X-#2 F300; Moves 2.346 mm in negative direction.


key: chroma:document
string_value:
G00 X[#1+#2]; Since 1.2345 + 2.3456 = 3.5801 in positive direction, the travel 
distance is 3.580 mm, which does not return the tool to the original position.
This difference comes from whether addition is performed before or after rounding off. 
G00X-[ROUND[#1]+ROUND[#2]]; must be specified to return the tool to the original 
position.
- Add decimal point (ADP) function
- ADP[#n] (n = 1 to 33) can be executed to add a decimal point to an argument passed with no 
decimal point, in the subprogram.


key: chroma:document
string_value:
Example:
In the subprogram called with G65 P_X10;, the value of ADP[#24] is a value to which a 
decimal point is added at its end (that is, 10.). Use this function when you do not want 
to consider the increment system in the subprogram. When bit 4 (CVA) of parameter 
No. 6007 is set to 1, however, the ADP function cannot be used because any 
argument is converted to 0.01 the moment it is passed.
NOTE
For compatibility among programs, it is recommended that the ADP function be


key: chroma:document
string_value:
not used, and decimal points be added in the argument specification for a macro 
call.
- Rounding up and down to an integer (FUP and FIX)
With CNC, when the absolute value of the integer produced by an operation on a number is greater than 
the absolute value of the original number, such an operation is referred to as rounding up to an integer. 
Conversely, when the absolute value of the integer produced by an operation on a number is less than the


key: chroma:document
string_value:
absolute value of the original number, such an operation is referred to as rounding down to an integer. Be 
particularly careful when handling negative numbers.
Example:
Suppose that #1=1.2 and #2=-1.2.
When #3=FUP[#1] is executed, 2.0 is assigned to #3.
When #3=FIX[#1] is executed, 1.0 is assigned to #3.
When #3=FUP[#2] is executed, -2.0 is assigned to #3.
When #3=FIX[#2] is executed, -1.0 is assigned to #3.
- Parameter reading (PRM)


key: chroma:document
string_value:
- Parameter reading (PRM)
・ The following formats are available depending on the parameter type and the data to be read.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 421 -
Format Remarks
#i = PRM[#j]; Format for a system common, path, or machine group parameter.
#i = PRM[#j, #k]; Format for specifying the number of a bit of a system common, path, or machine group 
parameter.
#i = PRM[#j] /[#l]; Format for an axis or spindle parameter
#i =PRM[#j, #k] /[#l]; Format for specifying the number of a bit of an axis or spindle parameter
- For #j, set a parameter number.
- For #k, set a bit number.


key: chroma:document
string_value:
- For #k, set a bit number.
- For #l, set an axis number or a spindle number.
- By specifying a path number, it is possible to read a parameter for that path. There are two ways to 
specify a path number.
a) Adding a path number to a parameter number
b) Specifying a path number using a system variable
a) Adding a path number to a parameter number
By adding a path number to the 8th and 9th high-order digits of the parameter number specified


key: chroma:document
string_value:
with the operation command PRM, it is possible to read the parameter for the specified path.
 #i = PRM[#j];
#j = ppxxxxxxx ; For pp, set a path number and for xxxxxxx, set a parameter number.
NOTE
1 If a path number is omitted or if 0 is specified, a parameter for the local path will 
be read.
2 If a path number out of the range is specified, alarm PS0115, “VARIABLE NO. 
OUT OF RANGE” is issued.
b) Specifying a path number using a system variable


key: chroma:document
string_value:
By specifying a path number using system variable #3018, it is possible to read a parameter for 
the specified path.
Example
Reading the fourth axis of parameter No. 01322 for the second path
#3018 = 2 ; .................Set the second path.
#1 =PRM[1322] /[4] ; ..Read the fourth axis of parameter No. 01322 for the 
 : second path and write it to variable #1 for the local path.
#3018= 0 ; ..................Return the path number to that of the local path.


key: chroma:document
string_value:
- Abbreviations of arithmetic and logic operation commands
When a function is specified in a program, the first two characters of the function name can be used to 
specify the function.
Example: ROUND → RO
FIX → FI
NOTE
POW cannot be abbreviated.
- Priority of operations
<1> Functions
<2> Operations such as multiplication and division (*, /, AND)
<3> Operations such as addition and subtraction (+, -, OR, XOR)


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 422 -
Example) #1=#2+#3*SIN[#4];
<1>, <2> and <3> indicate the order of
operations.
<1>
<2>
<3>
- Bracket nesting
Brackets are used to change the order of operations. Brackets can be used to a depth of five levels 
including the brackets used to enclose a function. When a depth of five levels is exceeded, an alarm 
PS0118, “TOO MANY BRACKET NESTING” occurs.
Example) #1=SIN [ [ [#2+#3] *#4 +#5] *#6];
<1> to <5> indicate the order of operations.
<1>


key: chroma:document
string_value:
<1>
<2>
<3>
<4>
<5>
Limitation
- Caution concerning decreased precision
When bit 0 (F16) of parameter No. 6008 is set to 0
- Addition and subtraction
Note that when an absolute value is subtracted from another absolute value in addition or subtraction, 
the relative error may become 10-15 or greater.
For example, assume that #1 and #2 have the following true values in the process of operation.
(The following values are examples in the process of operation and cannot actually be specified from


key: chroma:document
string_value:
any program.)
#1=9876543210.987654321
#2=9876543210.987657777
You cannot obtain the following result with operation #2-#1:
#2-#1=0.000003456
This is because the precision of custom macro variables is 15 decimal digits. With this precision, the 
values of #1 and #2 become:
#1=9876543210.987650000
#2=9876543210.987660000
(Precisely, the actual values are slightly different from the above values because they are internally 
processed in binary.) Therefore, the result is:
#2-1=0.000010000


key: chroma:document
string_value:
#2-1=0.000010000
A large error occurs.
- Logical expressions
Be aware of errors that can result from conditional expressions using EQ, NE, GT, LT, GE, and LE 
because they are processed basically in the same way as addition and subtraction. For example, if the 
following statement is used to decide whether #1 is equal to #2 in the above example, a correct 
decision may not be resulted because errors may occur:
IF [#1 EQ #2]
Evaluate the difference between #1 and #2 with:
IF [ABS [#1-#2]LT 0.1]


key: chroma:document
string_value:
IF [ABS [#1-#2]LT 0.1]
Then, assume that the values are equal when the difference does not exceed the allowable error 
range.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 423 -
- Trigonometric functions
The absolute error is guaranteed for trigonometric functions. However, the relative error is 10-15 or 
greater. Carefully perform multiplication or division after executing a trigonometric function.
- FIX function
When using the FIX function for the result of an operation, be careful with the precision. For 
example, when the following operations are performed, the value of #3 may not always be 2.
N10 #1=0.002;


key: chroma:document
string_value:
N10 #1=0.002;
N20 #2=#1*1000;
N30 #3=FIX[#2];
This is because an error may occur in operation N20 and the result may not be 
#2=2.0000000000000000
but a value a little smaller than 2 such as the following:
#2=1.9999999999999997
To prevent this, specify N30 as follows:
N30 #3=FIX[#2+0.001];
Generally, specify the FIX function as follows:
FIX[expression] → FIX[expression ±ε]
(Specify +ε when the value of the expression is positive or -ε when it is negative, and 0.1, 0.01,


key: chroma:document
string_value:
0.001, ... for ε as required.)
NOTE
The operation result of exponential function #i=EXP[#j]; overflows when #j 
exceeds about 790.
When bit 0 (F16) of parameter No. 6008 is set to 1
Errors may occur when operations are performed.
Table 16.5 (b) Errors involved in operations
Operation Average error Maximum error Type of error
a = b*c 1.55×10-10 4.66×10-10 Relative error(*1)
a = b / c 4.66×10-10 1.88×10-9
a = b 1.24×10-9 3.73×10-9
a = b + c
a = b – c
2.33×10-10 5.32×10-10 (*2)
a = SIN [ b ]


key: chroma:document
string_value:
a = SIN [ b ]
a = COS [ b ]
5.0×10-9 1.0×10-8 Absolute error(*3)
 deg
a = ATAN [ b ] / [ c ] 1.8×10-6 3.6×10-6
NOTE
1 The relative error depends on the result of the operation.
2 Smaller of the two types of errors is used.
3 The absolute error is constant, regardless of the result of the operation.
4 Function TAN performs SIN/COS.
5 Note that, in the case of natural logarithm #i=LN[#j]; and exponential function 
#i=EXP[#j];, the relative error may become 10-8 or greater.


key: chroma:document
string_value:
6 The operation result of exponential function #i=EXP[#j]; overflows when #j 
exceeds about 110.
- The precision of variable values is about 8 decimal digits. When very large numbers are handled in 
an addition or subtraction, the expected results may not be obtained. 
ε
a
ε
MIN ε ε
b c


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 424 -
Example:
When an attempt is made to assign the following values to variables #1 and #2:
#1=9876543210123.456
#2=9876543277777.777
the values of the variables become:
#1=9876543200000.000
#2=9876543300000.000
In this case, when #3=#2-#1; is calculated, #3=100000.000 results. (The actual result 
of this calculation is slightly different because it is performed in binary.)


key: chroma:document
string_value:
- Also be aware of errors that can result from conditional expressions using EQ, NE, GE, GT, LE, and 
LT.
Example:
IF[#1 EQ #2] is effected by errors in both #1 and #2, possibly resulting in an incorrect 
decision.
Therefore, instead find the difference between the two variables with IF[ABS[#1-#2] LT 
0.001].
Then, assume that the values of the two variables are equal when the difference does 
not exceed an allowable limit (0.001 in this case).
- Also, be careful when rounding down a value.


key: chroma:document
string_value:
Example:
When #2=#1*1000; is calculated where #1=0.002;, the resulting value of variable #2 is 
not exactly 2 but 1.99999997.
Here, when #3=FIX[#2]; is specified, the resulting value of variable #3 is not 2.0 but 
1.0.
In this case, round down the value after correcting the error so that the result is greater 
than the expected number, or round it off as follows:
#3=FIX[#2+0.001]
#3=ROUND[#2]
- Brackets
Brackets ([ ]) are used to enclose an expression.


key: chroma:document
string_value:
Note that parentheses ( ) are used for comments.
- Divisor
When a divisor of zero is specified in a division, an alarm PS0112, “ZERO DIVIDE” occurs.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 425 -
16.6 INDIRECT AXIS ADDRESS SPECIFICATION
Overview
When the custom macro function is enabled, you can use AX[(axis-number)] 
in an axis address specification to indirectly specify an axis with its axis 
number and not to directly specify it with its axis name.
You can also use AXNUM[(axis-name)] to obtain the axis number for an axis name.
Explanation
- Indirect axis address


key: chroma:document
string_value:
- Indirect axis address
You can use indirect axis address AX[ ] to specify an axis with its axis number. (An equal sign (=) is 
always required following AX[ ].)
AX[(axis-number)] = (numeric-value) ;
(axis-number): 1 to the number of controlled axes (number of controlled axes for each 
path in a multi-path system)
(numeric-value): Value specified for the axis specified with its axis number
If an invalid axis number is specified, an alarm PS0331, “ILLEGAL AXIS NUMBER IN AX[]” occurs.


key: chroma:document
string_value:
If a value is put in a decimal place, the number is rounded off to an integer and the result is treated as the 
axis number.
You can also specify a variable (local, common, or system variable) for (axis-number). To specify an 
operation using a variable name in (axis-number), however, enclose the variable name with brackets ([ ]).
1. AX[1]=100.0;
Specifies a value of 100.000 for the first axis.
2. AX[#500]=200.0;


key: chroma:document
string_value:
2. AX[#500]=200.0;
Specifies a value of 200.000 for the axis having the axis number indicated by the value stored in #500.
3. AX[#500+1]=300.0;
Specifies a value of 300.000 for the axis having the axis number obtained by adding 1 to the value stored in 
#500.
4. SETVN 500 [ABC];
AX[#ABC]=400.0;
Specifies a value of 400.000 for the axis having the axis number indicated by the value stored in #ABC 
(#500).
5. SETVN 500 [ABC];
AX[[#ABC]+1]=500.0;


key: chroma:document
string_value:
AX[[#ABC]+1]=500.0;
Specifies a value of 400.000 for the axis having the axis number obtained by adding 1 to the value stored in 
#ABC (#500).
6. SETVN 500 [ABC];
AX[#ABC+1]=500.0;
Alarm PS0331 occurs.
- AXNUM function
You can use AXNUM[ ] to obtain an axis number.
AXNUM[(axis-name)];
If an invalid axis name is specified, an alarm PS0332, “ILLEGAL AXIS ADDRESS IN AXNUM[]”
occurs.
When bit 3 (AXN) of parameter No.6021 is set to 1, in AXNUM function of custom macro, <null> can be


key: chroma:document
string_value:
obtained when the axis name that does not exist in the CNC is commanded, and the alarm does not occur. 
Therefore, it is possible to distinguish an axis is exist or not by custom macro program. Thus, the


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 426 -
common custom macro program can be created among different axis name and different machine 
configurations.
When the number of controlled axes is 3, the name of the first axis is X, that of the second axis is Y, and 
that of the third axis is Z
1. #500=AXNUM[X];
A value of 1 is stored in #500.
2. #501=AXNUM[Y];
A value of 2 is stored in #501.
3. #502=AXNUM[Z];
A value of 3 is stored in #502.
4. #503=AXNUM[A];
Alarm PS0332 occurs.
Example


key: chroma:document
string_value:
Alarm PS0332 occurs.
Example
Examples when the name of the first axis is X, that of the second axis is Y, and that of the third axis is Z1
N10 SETVN 500[AXIS1,AXIS2,AXIS3] ;
N20 [#AXIS1]=AXNUM[X] ;
N30 [#AXIS2]=AXNUM[Y] ;
N40 [#AXIS3]=AXNUM[Z1] ;
N50 G92 AX[#AXIS1]=0 AX[#AXIS2]=0 AX[#AXIS3]=0 ;
N60 G90G01F1000. ;
N70 AX[#AXIS1]=100.0 AX[#AXIS2]=100.0 AX[#AXIS3]=100.0 ;
N80 G02 AX[#AXIS1]=100. 0 AX[#AXIS2]= 0.0 R50.0 ;
N90 M02;
Limitation


key: chroma:document
string_value:
N90 M02;
Limitation
When the custom macro function is enabled, AX and AXN cannot be used as an extended axis name. AX 
is assumed to be AX[ ] and AXN is assumed to be AXNUM[ ].
16.7 READING PARAMETERS
Overview
By using the PRM function, it is possible to read parameters.
Format Remarks
#i = PRM[ #j, #k ] ; In the case of parameters other than axis type parameters and 
spindle type parameters
#i = PRM[ #j, #k ] / [ #l ] ; In the case of axis type parameters or spindle type parameters
Explanation


key: chroma:document
string_value:
Explanation
- Reading a parameter
#i=PRM[#j,#k]
#i=PRM[#j,#k]/[#l]
- For #j, enter a parameter number. If the number of a parameter that cannot be read, alarm PS0119, 
"ARGUMENT VALUE OUT OF RANGE", is issued.
- To read a bit type parameter, specify, for #k, the bit number of the bit type parameter in the range of 
0 to 7. If a bit number is specified, data with the specified bit is read. If none is specified, data with


key: chroma:document
string_value:
all bits is read. For parameters other than bit type parameters, the bit number is ignored.
- For #l, set the axis number of an axis type parameter or an spindle type parameter in the range of 1 
to the number of controlled axes or the number of controlled spindles. If an axis type parameter or 
an spindle type parameter is to be read but #l is not specified, alarm PS0119 is issued. For 
parameters other than axis type parameters and spindle type parameters, #1 may be omitted together 
with '/'.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 427 -
Example
1. Reading the value of the third axis of bit 0 (MIR) of bit axis type parameter No. 0012
If parameter No. 0012 (third axis) = 10010001
#2=12 ; Parameter number setting
#3=0 ; Bit number setting
#4=3 ; Axis number setting
If reading data with all bits
#1=PRM[#2]/[#4] ; #1=10010001
If reading data with a specified bit
#1=PRM[#2, #3]/[#4] ; #1=1
2. Reading the value of the fourth axis of axis type parameter No. 1322


key: chroma:document
string_value:
#2=1322 ; Parameter number setting
#4=4 ; Axis number setting
#1=PRM[#2]/[#4] ;
3. Reading bit 2 (SBP) of bit type parameter No. 3404
If parameter No.3404 = 01010000
#2=3404 ; Parameter number setting
#3=2 ; Bit number setting
If reading data with all bits
#1=PRM[#2] ; #1=1010000
If reading data with a specified bit
#1=PRM[#2,#3] ; #1=0
16.8 MACRO STATEMENTS AND NC STATEMENTS
The following blocks are referred to as macro statements:
- Blocks containing an arithmetic or logic operation (=)


key: chroma:document
string_value:
- Blocks containing a control statement (such as GOTO, DO, END)
- Blocks containing a macro call command (such as macro calls by G65, G66, G66.1, G67, or other G 
codes, or by M codes) 
Any block other than a macro statement is referred to as an NC statement.
Explanation
- Differences from NC statements
- Even when single block mode is on, the machine does not stop. Note, however, that the machine 
stops in the single block mode when bit 5 (SBM) of parameter No. 6000 is 1.


key: chroma:document
string_value:
- Macro blocks are not regarded as blocks that involve no movement in the cutter compensation mode.
- NC statements that have the same property as macro statements
- NC statements that include a subprogram call command (such as subprogram calls by M98 or other 
M codes, or by T codes) and not include other command addresses except an O, file name, N, P, or L 
address have the same property as macro statements.


key: chroma:document
string_value:
- NC statements that include M99 and those do not include other command addresses except an O, file 
name, N, P, or L address have the same property as macro statements.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 428 -
16.9 BRANCH AND REPETITION
In a program, the flow of control can be changed using the GOTO statement and IF statement. Four types 
of branch and repetition operations are used: 
Branch and repetition GOTO / LGOTO (unconditional branch / unconditional 
branch with label)
IF (conditional branch: if ..., then...)
WHILE (repetition while ...)
SWITCH-CASE (multidirectional branch)
16.9.1 Unconditional Branch (GOTO Statement) / Unconditional


key: chroma:document
string_value:
Branch with label (LGOTO Statement)
Unconditional Branch (GOTO Statement)
A branch to sequence number n occurs. When a sequence number outside of the range 1 to 99999999 is 
specified, an alarm PS1128, “SEQUENCE NUMBER OUT OF RANGE” occurs. A sequence number can 
also be specified using an expression.
GOTOn ; n: Sequence number (1 to 99999999)
Example: GOTO 1;
GOTO #10;
WARNING
Do not specify multiple blocks with the same sequence number in a single


key: chroma:document
string_value:
program. It is very dangerous to specify such blocks because the destination of a 
branch from the GOTO statement is undefined.
NOTE
1 A backward branch takes more time as compared with a forward branch.
2 In the destination of GOTOn, that is, the block with sequence number n, the 
sequence number must appear at the beginning of the block. If the sequence 
number is not at the beginning of the block, a branch cannot be made.
Unconditional Branch with label (LGOTO Statement)


key: chroma:document
string_value:
It is possible to branch to the label (arbitrary character string) unconditionally.
LGOTO[ label ] ;
…
LBL[ label ] ;
- The character that can be used for the label is capital letter alphabet (A-Z), number (0-9), and 
underscore (_). However, the number cannot be used for the first character.
- The number of characters that can be used for the label is 31 characters or less.
- LBL[label] can be used together with the NC statement, the macro statement, the sequence number, 
and the comment.


key: chroma:document
string_value:
and the comment.
- Bit 0 (NOB) of parameter No.3404 and bit 4 (NBN) of parameter No.3451 are valid to LBL[label] as 
well as the sequence number. When the block only of LBL[label] is executed by setting NOB=1 and 
NBN=0, it is ignored.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 429 -
Example
N1 LGOTO[BBB];
…
N11 LBL[AAA] G90 G00 X100.0 ;
…
N22 LBL[BBB] G90 G00 Y50.0 (LABEL BBB);
…
N33 LBL[CCC] #100 = 10.0 ;
…
It jumps to N22 block by LGOTO[BBB] of N1.
WARNING
Do not specify multiple blocks with the same label in a single program. It is very 
dangerous to specify such blocks because the destination of a branch from the 
LGOTO statement is undefined.
NOTE
1 LG statement cannot be used as omitted LGOTO statement. When LG


key: chroma:document
string_value:
statement is commanded, the alarm PS0125 "MACRO STATEMENT FORMAT 
ERROR" occurs.
2 When any mistake (the character that cannot be used is used , etc.) is found in 
the LGOTO[label] block, the alarm PS0114 "ILLEGAL EXPRESSION FORMAT" 
occurs.
3 When the label specified by LGOTO[label] is not found in the program, the alarm 
PS1135 " SPECIFIED LABEL IS NOT FOUND " occurs.
4 When LBL[label] block that the mistake (the character that cannot be used is


key: chroma:document
string_value:
used , etc.) is found in the format is executed, the alarm PS1151 "LABEL 
FORMAT ERROR" occurs.
5 A backward branch takes more time as compared with a forward branch.
16.9.2 GOTO Statement Using Stored Sequence Numbers / LGOTO 
Statement Using Stored Label
When the GOTO/LGOTO statement is executed in a custom macro control command, a sequence number 
search/a label search is made for sequence numbers/LBL[label] stored at previous execution of the 
corresponding blocks at a high speed.


key: chroma:document
string_value:
As a "sequence number/LBL[label] stored at previous execution of the corresponding block", a unique 
sequence number/LBL[label] within the same program or the sequence number/LBL[label] of a 
subprogram call with which the block was executed is stored.
The storage type differs depending on the values of the following parameters.
(1) When bit 1 (MGO) of parameter No. 6000 is set to 1
- Fixed type: Up to 20 sequence numbers/LBL[label] stored at execution of the corresponding


key: chroma:document
string_value:
blocks from the start of operation
(2) When bit 4 (HGO) of parameter No. 6000 is set to 1
- Variable type: Up to 30 sequence numbers/LBL[label] stored at execution of the corresponding 
blocks before execution of the GOTO/LGOTO statement
- History type: Up to 10 sequence numbers/LBL[label] stored by a sequence number search/a 
label search previously made using the GOTO/LGOTO statement
The stored sequence numbers/LBL[label] are canceled in the following cases:
- Immediately after power-on


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 430 -
A branch to 
N10 before 
the GOTO 
statement 
occurs.
A branch to 
N10 after the 
GOTO 
statement 
occurs.
A branch to 
LBL[ AAA ] 
before the 
LGOTO 
statement 
A branch to 
LBL[ AAA ] 
after the 
LGOTO 
statement 
- After a reset
- Operation after program registration or editing (including background editing and MDI program 
editing)
WARNING
Do not specify multiple blocks with the same sequence number/LBL[label] in a


key: chroma:document
string_value:
single program.
It is very dangerous to specify the sequence number/LBL[label] of the branch 
destination before and after the GOTO/LGOTO statement and execute the 
GOTO/LGOTO statement because the branch destination changes according to 
the values of the parameters as shown below:
When bit 1 (MGO) or 4 (HGO) of parameter No. 
6000 is set to 1
When both bits 1 (MGO) and 4 (HGO) of 
parameter No. 6000 are set to 0
 :
 N10; 
 : 
GOTO10; 
 :
 N10;
 :
 N10; 
 : 
GOTO10; 
 :
 N10; 
 :


key: chroma:document
string_value:
: 
GOTO10; 
 :
 N10; 
 :
 LBL[ AAA ] ; 
 : 
 LGOTO[ AAA ] ; 
 :
 LBL[ AAA ] ;
 :
 LBL[ AAA ] ; 
 : 
 LGOTO[ AAA ] ; 
 :
 LBL[ AAA] ; 
When bit 1 (MGO) or 4 (HGO) of parameter No. 6000 is set to 1 and the 
GOTO/LGOTO statement is executed, the sequence number/LBL[label] of the 
branch destination may not be contained in the sequence numbers/LBL[label]
stored at previous execution of the corresponding blocks. In this case, a branch to


key: chroma:document
string_value:
the sequence number/LBL[label] in a block following the GOTO/LGOTO 
statement occurs (the destination is the same as when both bits are set to 0).


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 431 -
NOTE
1 When an external program is read and executed by DNC operation, the 
executed sequence numbers/LBL[label] are not stored.
When a program registered in memory is executed by a subprogram call, the 
sequence numbers/LBL[label] are stored.
2 Set bit 1 (SMI) of parameter No.11651 to 1 when the memory operation on the 
data server or the memory card is executing.
 Parameter SMI
When GOTO statement using stored sequence numbers/LGOTO statement


key: chroma:document
string_value:
using stored label is enabled and
 memory operation of a program on Data Server/Memory card is executed,
 sequence numbers/LBL[label] in the program are:
 0:Stored.
 1:Not stored.
3 The number of destinations that can be stored by LGOTO Statement using 
stored label is shared by GOTO statement using stored sequence numbers.
Example :
The number that can be stored by fixed type is 20 or less.
In this case, the number that can be stored is as follows.


key: chroma:document
string_value:
(the number of the sequence number + the number of LBL[ label ]) ≤ 20
CAUTION
According to the restrictions on the GOTO/LGOTO statement, no branch to a 
sequence number within a DO-END loop cannot be made. If a program in which 
a branch to a sequence number within a loop occurs is executed, operation may 
differ depending on whether the GOTO statement using stored sequence 
numbers/LGOTO statement using stored label is used.
16.9.3 Conditional Branch (IF Statement)


key: chroma:document
string_value:
Specify a <conditional expression> after IF.
There are 5 kinds of instruction formats as follows. The executable instruction formats are decided by 
setting bit 2 (ESE) of parameter No.11648.
(a) IF[<conditional expression>]GOTOn;
If the specified <conditional expression> is satisfied (true), a branch to sequence number n occurs. If the 
specified condition is not satisfied, the next block is executed.
If the value of variable #1 is greater than 10, a branch to sequence number N2 occurs.


key: chroma:document
string_value:
If the condition is 
not satisfied
IF [#1 GT 10] GOTO 2 ;
N2 G00 G91 X10.0 ;
:
Processing If the condition is satisfied
(b) IF[<conditional expression>]THEN;
If the specified <conditional expression> is satisfied (true), a macro statement specified after THEN is 
executed. 
Only a single macro statement is executed.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 432 -
If the values of #1 and #2 are the same, 0 is assigned to #3.
IF[#1 EQ #2] THEN#3=0 ;
(c) IF[<conditional expression>] THEN; Multiple statements; ENDIF;
If the specified <conditional expression> is satisfied (true), the multiple statements specified in between 
THEN and ENDIF are executed. If the specified condition is not satisfied, the multiple statements are
skipped.


key: chroma:document
string_value:
skipped.
Two or more NC statements and macro statements can be specified between THEN and ENDIF.
If the values of #1 and #2 are the same, the multiple blocks specified between THEN and ENDIF are executed.
IF[#1 EQ #2] THEN;
 #101 = #4201;
 #102 = #5041;
 G91 G28 X0;
ENDIF;
(d) IF[<conditional expression>] THEN Macro statement 1;
ELSE Macro statement 2;
If the specified <conditional expression> is satisfied (true), Macro statement 1 specified after THEN is


key: chroma:document
string_value:
executed. If the specified condition is not satisfied, Macro statement 2 specified after ELSE is executed.
Only a single macro statement can be specified to Macro statement 1 or Macro statement 2.
If the values of #1 and #2 are the same, 0 is assigned to #3. If the both values are the different, 0 is assigned to #4.
IF[#1 EQ #2] THEN #3=0;
 ELSE #4=0;
(e) IF[<conditional expression>] THEN; Multiple statements 1;
 ELSE; Multiple statements 2; ENDIF;


key: chroma:document
string_value:
If the specified <conditional expression> is satisfied (true), Multiple statements 1 specified between 
THEN and ELSE are executed. If the specified condition is not satisfied, Multiple statements 2 specified 
between ELSE and ENDIF are executed.
Two or more NC statements and macro statements can be specified to Multiple statements 1 or Multiple 
statements 2.
If the values of #1 and #2 are the same, the multiple blocks specified between THEN and ELSE are executed. If the


key: chroma:document
string_value:
both values are the different, the multiple blocks specified between ELSE and ENDIF are executed.
IF[#1 EQ #2] THEN;
 #101 = #4201;
 #111 = #5041;
 G91 G28 X0;
ELSE;
 #102 = #4202;
 #112 = #5042;
 G91 G28 Y0;
ENDIF;
Explanation
- Relation between bit 2 (ESE) of parameter No.11648 and executable function
The executable functions are decided by setting bit 2 (ESE) of parameter No.11648.
When bit 2 (ESE) of parameter No.11648 is set to 0.


key: chroma:document
string_value:
- ELSE statement is invalid. 2 kinds of instruction formats a),b) are effective.
- Nesting of IF statement is impossible.
- "ELSE", and "ENDIF" are not reserved words.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 433 -
When bit 2 (ESE) of parameter No.11648 is set to 1.
- ELSE statement is effective. 5 kinds of instruction formats a)-e) are effective.
- Nesting of IF statement is enabled.
- "ELSE", and "ENDIF" are added to reserved words.
NOTE
When bit 2 (ESE) of parameter No.11648 is set to 1, the program display of 
Manual Guide i cannot treat the program including "ELSE" or "ENDIF". When the 
program is displayed, the delimitation of the word is not correct.


key: chroma:document
string_value:
- <Conditional expression>
<Conditional expressions> are divided into <simple conditional expressions> and <complex conditional 
expressions>. In a <simple conditional expression>, a relational operator described in Table 16.9.3 (a) is 
specified between two variables or between a variable and constant to be compared. An <expression> can 
be used instead of a variable. With a <complex conditional expression>, an AND (logical AND), OR


key: chroma:document
string_value:
(logical OR), or XOR (exclusive OR) operation is performed for the results (true or false) of multiple 
<simple conditional expressions>.
If the values of #1 and #2 are the same and those of #3 and #4 are also the same, 0 is assigned to #5.
IF[[#1 EQ #2] AND [#3 EQ #4]] THEN#5=0 ;
If the values of #1 and #2 are the same or those of #3 and #4 are the same, 0 is assigned to #5.
IF[[#1 EQ #2] OR [#3 EQ #4]] THEN#5=0 ;
- Relational operators


key: chroma:document
string_value:
- Relational operators
Relational operators each consist of two letters and are used to compare two values to determine whether 
they are equal or one value is smaller or greater than the other value. Note that the equal sign (=) and 
inequality sign (>, <) cannot be used as a relational operator.
Table 16.9.3 (a)Relational operators
Operator Meaning
EQ Equal to(=)
NE Not equal to(≠)
GT Greater than(>)
GE Greater than or equal to(≥)
LT Less than(<)
LE Less than or equal to(≤)


key: chroma:document
string_value:
LE Less than or equal to(≤)
- About how to combine the instruction format
Instruct in the commands “IF” , “THEN”, “ELSE”, “ENDIF” so as not to contradict the combination. 
When the combinations are contradicted, alarm (PS1129) “MISSING IF STATEMENT” is occur.
Above-mentioned instruction format (a)-(e) are basic type.
It is possible to instruct by combining single macro statement and multiple statements as follows.


key: chroma:document
string_value:
If the values of #1 and #2 are the same, 0 is assigned to #3. If the both values are the different, the multiple blocks 
specified between ELSE and ENDIF are executed.
IF[#1 EQ #2] THEN #3=0;
 ELSE;
 #102 = #4202;
 #112 = #5042;
 G91 G28 Y0;
 ENDIF;


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 434 -
If the values of #1 and #2 are the same, the multiple blocks specified between THEN and ELSE are executed. If the 
both values are the different, 0 is assigned to #4.
IF[#1 EQ #2] THEN;
 #101 = #4201;
 #111 = #5041;
 G91 G28 X0;
 ELSE #4=0;
However, it is not possible to instruct by combining GOTO statement and ELSE statement as follows.
If the values of #1 and #2 are the same, a branch to sequence number N20 occurs. If the both values are the


key: chroma:document
string_value:
different, a macro statement is executed.
The following instructions cannot be executed (ELSE statement is continued to GOTO statement).
 IF[#1 EQ #2] GOTO 20; 
 ELSE macro statement;
In such a case, divide the instructions into IF-GOTO block and the block of macro statement as follows.
 IF[#1 EQ #2] GOTO 20; If the values of #1 and #2 are the same, a branch to sequence number N20 occurs.
 macro statement; If the both values are the different, this block is executed as a macro statement.


key: chroma:document
string_value:
- Nesting of IF statement
IF statement can do nesting like the following examples. Up to 10 levels of nesting of IF statement are 
allowed. When the maximum value of the nesting of IF statement is exceeded, alarm (PS1130) “TOO 
MANY IF STATEMENT NESTING” is occur.
EXAMPLE
The following is an example of 3 levels of nesting, but up to 10 levels of nesting 
are allowed.
IF[...] THEN ;
 IF [...] THEN ;
 Statement ;
 :
 ELSE ;
 IF[...] THEN ;
 Statement ;
 ENDIF ;
 ENDIF ;
 Statement ;
 :


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 435 -
CAUTION
When only a single macro statement is to be executed, the macro statement can be 
specified immediately after THEN/ELSE. In this case, no ENDIF statement is usually 
required. However, an ENDIF statement is required when IF [...] THEN macro 
statement; is specified just before ELSE or ENDIF of the previous nesting as shown 
below:
N10 IF[...] THEN ;
 N21 IF [...] THEN macro statement;
 N22 IF [...] THEN macro statement;


key: chroma:document
string_value:
ENDIF ; ⇐ To specify the thing that ELSE statement has paired
 with N10 IF statement, ENDIF statement that pairs
 with N22 IF statement is needed.
 ELSE ;
 N23 IF [...] THEN macro statement;
 N24 IF [...] THEN macro statement;
 ENDIF ; ⇐ To specify the thing that next ENDIF statement has
 paired with N10 IF statement, ENDIF statement that
 pairs with N24 IF statement is needed.
 ENDIF;
NOTE
The nesting of IF statement is checked only by the custom macro.


key: chroma:document
string_value:
Because macro compiler checks nesting in the execution macro, it doesn't do in 
automatic operation.
- MDI intervention during automatic operation
When MDI intervention during automatic operations is done, the nesting of IF statement in automatic 
operation is succeeded to MDI operation.
Up to 5 levels of nesting of IF statement are allowed in MDI operation after nesting becomes 5 levels by automatic 
operation.
IF[#1 EQ #1] THEN ; 
 IF[#1 EQ #2] THEN ;
 IF[#1 EQ #3] THEN ;
 IF[#1 EQ #4] THEN ;


key: chroma:document
string_value:
IF[#1 EQ #4] THEN ;
 IF[#1 EQ #5] THEN ;
 #101 = #4201;
 #102 = #5041; <= Up to 5 levels of nesting of IF statement are allowed in MDI intervention during 
 G91 G28 X0 ; automatic operations.
 ENDIF ;
 ENDIF ;
 ENDIF ;
 ENDIF ;
ENDIF ;


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 436 -
Sample program
The sample program below finds the total of numbers 1 to 10.
O9500;
#1=0;................................ Initial value of the variable to hold the sum
#2=1;................................ Initial value of the variable as an addend
N1 IF[#2 GT 10] GOTO 2; ... Branch to N2 when the addend is greater than 10
#1=#1+#2;........................ Calculation to find the sum
#2=#2+1;.......................... Next addend


key: chroma:document
string_value:
GOTO 1; .......................... Branch to N1
N2 M30;............................... End of program
16.9.4 Repetition (WHILE Statement)
Specify a conditional expression after WHILE. While the specified condition is satisfied, the program 
from DO to END is executed. If the specified condition is not satisfied, program execution proceeds to 
the block after END.
If the
condition
is not
satisfied
WHILE [conditional expression] DO m ; (m=1,2,3)
END m ;
 :
Processing If the
condition


key: chroma:document
string_value:
Processing If the
condition
is satisfied
Explanation
While the specified condition is satisfied, the program from DO to END after WHILE is executed. If the 
specified condition is not satisfied, program execution proceeds to the block after END. The same format 
as for the IF statement applies. A number after DO and a number after END are identification numbers 
for specifying the range of execution. The numbers 1, 2, and 3 can be used. When a number other than 1,


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 437 -
- Nesting
The identification numbers (1 to 3) in a DO-END loop can be used as many times as desired. Note, 
however, when a program includes overlapped DO ranges, or a program includes branches into the loop, 
an alarm PS1124, “MISSING DO STATEMENT” occurs when the END statement is executed.
Processing
1. The identification numbers (1 
to 3) can be used as many 
times as required.
WHILE [ … ] DO 1 ;
END 1 ;
 :
Processing
WHILE [ … ] DO 1 ;


key: chroma:document
string_value:
Processing
WHILE [ … ] DO 1 ;
END 1 ;
 :
2. DO ranges cannot 
overlap.
Processing
WHILE [ … ] DO 1 ;
END 1 ;
Processing
WHILE [ … ] DO 2 ;
 :
END 2 ;
3. DO loops can be nested to a 
maximum depth of three levels.
WHILE [ … ] DO 1 ;
 :
WHILE [ … ] DO 2 ;
 :
WHILE [ … ] DO 3 ;
Processing
END 3 ;
 :
END 2 ;
 :
END 1 ;
4. Control can be transferred 
to the outside of a loop.
WHILE [ … ] DO 1 ;
END 1 ;
IF [ … ] GOTO n ;
Nn
5. Branches cannot be made to a


key: chroma:document
string_value:
location within a loop.
WHILE [ … ] DO 1 ;
 :
END 1 ;
IF [ … ] GOTO n ;
 :
Nn … ;
Limitation
- Infinite loops
When DO m is specified without specifying the WHILE statement, an infinite loop ranging from DO to 
END is produced.
- Processing time
When a branch to the sequence number specified in a GOTO statement occurs, the sequence number is 
searched for. For this reason, processing in the reverse direction takes a longer time than processing in the


key: chroma:document
string_value:
forward direction. Therefore, in the case of processing in the reverse direction, use the WHILE statement 
for repetition to reduce processing time.
- Undefined variable
In a conditional expression that uses EQ or NE, a <null> and zero have different effects. In other types of 
conditional expressions, a <null> is regarded as zero.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 438 -
Sample program
The sample program below finds the total of numbers 1 to 10.
O0001;
#1=0;
#2=1; 
WHILE[#2 LE 10]DO 1;
#1=#1+#2;
#2=#2+1;
END 1;
M30; 
16.9.5 Precision Specification for Macro Relational Operators
When making a comparison using a relational operator in a custom macro, you can specify the number of 
decimal places in the two values to be compared. The values are compared after rounded off to the


key: chroma:document
string_value:
specified number of decimal places.
Setting bit 5 (EDP) of parameter No. 6019 to 1 enables this function. Specify the number of significant 
decimal places you want to set in parameter No. 6100.
Relational operators
The precision specification is valid for the following relational operators.
Operator Meaning
EQ Equal to(=)
NE Not equal to(≠)
GT Greater than(>)
GE Greater than or equal to(≥)
LT Less than(<)
LE Less than or equal to(≤)
Limitation


key: chroma:document
string_value:
Limitation
The precision specification for macro relational operators is valid for the following functions:
- Custom macro
- Macro executor
NOTE
The precision specification is invalid for real-time custom macros.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 439 -
Example
Macro program
O1000 ;
#100=1.2344567 ;
#101=1.2345678 ;
N10 IF[#100 EQ #101] GOTO 20 ;
...
N20 ;
N30 IF[#100 NE #101] GOTO 40 ;
...
N40 ;
...
When a comparison is executed, the target two values are compared after rounded off to the specified 
number of decimal places.
The actual values are not rounded.
#100=1. 2344567
^^^ The number of significant decimal places is 3.
^Rounded off.


key: chroma:document
string_value:
^Rounded off.
1. When the precision specification for macro relational operators is disabled
Bit 5 (EDP) of parameter No. 6019 is set to 0.
The values of #100 and #101 are compared as is. In the N10 block, a branch to N20 does not occur. 
In the N30 block, a branch to N40 occurs.
2. When the precision specification for macro relational operators is enabled - 1
Bit 5 (EDP) of parameter No. 6019 is set to 1 and parameter No. 6100 is set to 2.


key: chroma:document
string_value:
The value obtained by rounding off the value of #100, 1.23, is compared with the value obtained by 
rounding off the value of #101, 1.23. The values of #100 and #101 are not changed.
In the N10 block, a branch to N20 occurs. In the N30 block, a branch to N40 does not occur.
3. When the precision specification for macro relational operators is enabled - 2
Bit 5 (EDP) of parameter No. 6019 is set to 1 and parameter No. 6100 is set to 3.


key: chroma:document
string_value:
The value obtained by rounding off the value of #100, 1.234, is compared with the value obtained by 
rounding off the value of #101, 1.235. The values of #100 and #101 are not changed.
In the N10 block, a branch to N20 does not occur. In the N30 block, a branch to N40 occurs.
When variable values are negative, processing is performed as follows:
Macro program
O1000 ;
#100=-1.2344 ;
#101=-1.2345 ;
N10 IF[#100 EQ #101] GOTO 20 ;
...
N20 ;
...
#100=- 1. 2345


key: chroma:document
string_value:
N20 ;
...
#100=- 1. 2345
^^^ The number of significant decimal places is 3.
^Rounded off.
1. When the precision specification for macro relational operators is enabled
Bit 5 (EDP) of parameter No. 6019 is set to 1 and parameter No. 6100 is set to 3.
The value obtained by rounding off the value of #100, -1.234, is compared with the value obtained 
by rounding off the value of #101, -1.235. The values of #100 and #101 are not changed.
In the N10 block, a branch to N20 does not occur.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 440 -
16.9.6 Multidirectional branch (SWITCH-CASE Statement)
The flow of control can be changed in multidirectional.
Explanation
This function is composed of SWITCH statement, CASE statement, and DEFAULT statement. The flow 
of the program can be changed in multidirectional according to the expression specified by SWITCH 
statement. There are one block command and multiple block command in the format.
One block command format


key: chroma:document
string_value:
One block command format
SWITCH[<expression>] CASE[<expression 1>] GOTOn1 CASE[<expression 2>] GOTOn2 ... DEFAULT[ ] 
GOTOnx ;
Multiple block command format
SWITCH[<expression>] ;
CASE[<expression 1>] GOTOn1 ;
CASE[<expression 2>] GOTOn2 ;
...
DEFAULT[ ] GOTOnx ;
- SWITCH statement : SWITCH[<expression>]
The calculation result of <expression> is saved. The saved value is compared to the value specified in 
the CASE statement. The value saved by SWITCH statement is maintained until GOTO of CASE


key: chroma:document
string_value:
statement is executed or DEFAULT statement is executed.
- CASE statement : CASE[<expression>] GOTOn
When the value saved by SWITCH statement is corresponding to <expression>, GOTO statement is 
executed. Moreover, the value saved by SWITCH statement is cleared. That is, it makes the program to 
the state that doesn't execute SWITCH statement. When the value saved by SWITCH statement is not 
corresponding to <expression>, CASE statement does not do anything.


key: chroma:document
string_value:
- DEFAULT statement : DEFAULT[ ] or DEFAULT[ ] GOTOn
It is the command for the case which the value saved by SWITCH statement is not corresponding to 
any <expression>. GOTO statement is unconditionally executed. Moreover, the value saved by 
SWITCH statement as well as CASE statement is cleared. When not command GOTO statement, 
DEFAULT statement only clears the value saved by SWITCH statement. Do not put anything in 
brackets “[ ]”. There is no problem even if not command DEFAULT statement.


key: chroma:document
string_value:
One block command
N1 #101=30;
N2 SWITCH[#100] CASE[10] GOTO22 CASE[20] GOTO33 CASE[#101] GOTO44 
DEFAULT[ ] GOTO100;
N22 #500=1;
…
N33 #500=2;
…
N44 #500=3;
…
N100 #500=4;
…
In SWITCH statement of N2 block,
It jumps to N22 block when #100 is 10. 
It jumps to N44 block when #100 is 30. 
It jumps to N100 block when #100 is not 10, 20, or 30.


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 441 -
Multiple block command
N1 #101=30;
N2 SWITCH[#100];
N3 CASE[10] GOTO22;
N4 CASE[20] GOTO33;
N5 CASE[#101] GOTO44;
N6 DEFAULT[ ] GOTO100;
N22 #500=1;
…
N33 #500=2;
…
N44 #500=3;
…
N100 #500=4;
…
In SWITCH statement of N2 block,
It jumps to N22 block in N3 block when #100 is 10. 
It jumps to N44 block in N5 block when #100 is 30. 
It jumps to N100 block in N6 block when #100 is not 10, 20, or 30.
NOTE


key: chroma:document
string_value:
NOTE
1 SWITCH statement, CASE statement, DEFAULT statement can not be omitted 
command (command of the first two characters only), such as in the following 
example. When the omitted command as SW, CA, and DE is commanded, the 
alarm PS0125 "MACRO STATEMENT FORMAT ERROR" occurs.
example)
ROUND -> RO
FIX -> FI
2 When the power is turned off or the reset is executed, the value saved by 
SWITCH statement is cleared.
3 The value of <expression> of SWITCH and CASE is treated as an integral value


key: chroma:document
string_value:
in which it rounds off below the decimal point. (half-adjust)
Example 1)
In the following cases, SWITCH statement saves 1.
#100=1.4999;
SWITCH[#100];
Example 2)
In the following cases, SWITCH statement saves 2.
#100=1.5000;
SWITCH[#100];
4 SWITCH statement, CASE statement, and DEFAULT statement is executed in 
the order in which they are commanded. Therefore, even if there is CASE 
statement that is corresponding to the value saved by SWITCH statement, when


key: chroma:document
string_value:
there is DEFAULT statement earlier, DEFAULT statement is executed.
Example 1)
In the following cases, GOTO100 of DEFAULT[ ] is executed. GOTO44 of CASE 
[30] is not executed.
N1 #100=30;
N2 SWITCH[#100] CASE[10] GOTO22 DEFAULT[ ] GOTO100 CASE[20]


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 442 -
NOTE
GOTO33 CASE[30] GOTO44;
…
N100 #500=1;
Example 2)
In the following cases, GOTO11 of DEFAULT[ ] is executed. GOTO2 of CASE 
[10] is not executed.
N1 #100=10;
N2 SWITCH[#100]
N3 DEFAULT[ ] GOTO11
N4 CASE[10] GOTO2
N5 CASE[20] GOTO4
…
N11 #500=1;
5 When SWITCH statement is executed , the value of <expression> is saved. 
Even if the value of <expression> is changed, the saved value is not changed.
Example)


key: chroma:document
string_value:
Example)
In the following cases, 10 is saved in N2 block. The saved value in N3 block is 
not changed. Therefore, GOTO5 of N5 block is executed.
N1 #100=10;
N2 SWITCH[#100];
N3 #100=20;
N4 CASE[20] GOTO2;
N5 CASE[10] GOTO5;
6 In the case of multiple block command, the command between the blocks of 
SWITCH statement, CASE statement, and DEFAULT statement is executed.
Example)
In the following cases, N3 block, N6 block, and N7 block which is commanded


key: chroma:document
string_value:
between SWITCH statement and CASE statement are also executed. Therefore, 
GOTO44 of CASE [30] of N8 block is not executed.
N1 #100=30;
N2 SWITCH[#100];
N3 #500=1;
N4 CASE[10] GOTO22;
N5 CASE[20] GOTO33;
N6 #500=2;
N7 GOTO77;
N8 CASE[30] GOTO44;
…
N77#500=3;
7 When SWITCH statement is executed in succession, the saved value is the 
value of the SWITCH statement that last is executed.
Example)
The following case, 20 is saved by SWITCH statement of N3 block. However,


key: chroma:document
string_value:
because it is overwritten to 10 by SWITCH statement of N4 block, GOTO3 of N5 
block is executed.
N1 #100=20;


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 443 -
NOTE
N2 #101=10;
N3 SWITCH[#100];
N4 SWITCH[#101];
N5 CASE[10] GOTO3;
N6 CASE[20] GOTO5;
8 When SWITCH statement contains an error, the alarm PS1148 "SWITCH 
STATEMENT ERROR" occurs.
The cause may be one of the following:
1. Format error
 - Not “SWITCH[<expression>]”
 - The next of “SWITCH[<expression>]” is not “EOB”, “CASE” or “DEFAULT”.
2. The value of <expression> is out-of-range (-2147483648 to 2147483647).


key: chroma:document
string_value:
<Empty> is regarded as out-of-range value.
9 When CASE statement contains an error, the alarm PS1149 "CASE
STATEMENT ERROR" occurs.
The cause may be one of the following:
1. CASE statement is commanded with SWITCH statement not executed.
2. Format error
 - Not “CASE[<expression>]”
 - The next of “CASE[<expression>]” is not “GOTO”. However, when the value 
 saved by SWITCH statement is not corresponding to <expression>, the 
 alarm does not occur.


key: chroma:document
string_value:
alarm does not occur.
3. The value of <expression> is out-of-range (-2147483648 to 2147483647). 
 <Empty> is regarded as out-of-range value.
10 When DEFAULT statement contains an error, the alarm PS1150 "DEFAULT
STATEMENT ERROR" occurs.
The cause may be one of the following:
1. DEFAULT statement is commanded with SWITCH statement not executed.
2. Format error
 - Not “DEFAULT[ ]”
 - The next of “DEFAULT[ ]” in not “EOB” or “GOTO”.


key: chroma:document
string_value:
11 When SWITCH statement, CASE statement, or DEFAULT statement contain an 
error, the alarm PS1148, PS1149, or PS1150 occurs. However, the alarm does 
not occur when GOTO statement is executed in front of a place where contains 
an error in one block command.
Example)
In the following cases, “#100 = 30” does not follow the format. However, the 
alarm does not occur because GOTO55 of CASE[10] is executed.
N1 #100=10;
N2 SWITCH[#100] CASE[10] GOTO55 CASE #100=30 [20] GOTO66 
DEFAULT[ ] GOTO100;
…


key: chroma:document
string_value:
DEFAULT[ ] GOTO100;
…
N55 #500=1;
12 Place where it is possible to put a comment is place of the following example.
Example)
Comment : (AA)
SWITCH[#100] (AA) CASE[10] (AA) GOTO55 (AA) CASE[20] (AA) GOTO66 
(AA) DEFAULT[ ] (AA) GOTO100 (AA) ;
13 The value saved by SWITCH statement of program that is called at some point


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 444 -
NOTE
is different from the value saved by SWITCH statement of program that is called
at other times. The value saved by SWITCH statement is not succeeded.
Example 1)
O1000 from O0001 is called, and O2000 from O1000 is called. And SWITCH[10] 
in O0001, SWITCH[20] in O1000, and SWITCH[30] in O2000 is executed. At this 
time, the saved value in O0001 is 10. Therefore, in O0001, GOTO30 of N5 block 
is executed.
O0001;
N1 SWITCH[10];
N2 M98 P1000;


key: chroma:document
string_value:
N1 SWITCH[10];
N2 M98 P1000;
N3 CASE[30] GOTO10;
N4 CASE[20] GOTO20;
N5 CASE[10] GOTO30;
N10 #100=10;
N20 #101=20;
N30 #102=30;
N6 M30
O1000;
N1 SWITCH[20];
N2 M98 P2000;
N3 M99;
O2000;
N1 SWITCH[30];
N2 M99;
Example 2)
SWITCH statement is executed in O0002. However, the alarm PS1149 "CASE
STATEMENT ERROR" occurs in CASE[30] because SWITCH statement is not 
executed in O3000.
O0002;
N1 SWITCH[50];
N2 M98 P3000;
N3 M30
O3000;
N1 CASE[30] GOTO10;
N10 #100=10;
N2 M99;
Example 3)


key: chroma:document
string_value:
N2 M99;
Example 3)
Even Macro modal call, the value saved by SWITCH statement is not 
succeeded. When O4000 is called from A1.0 of N2 block in O0003, SWITCH 
statement is executed. However, the alarm PS1149 "CASE STATEMENT 
ERROR" occurs in CASE[30] because CASE statement is commanded with 
SWITCH statement not executed when O4000 is called from A2.0 of N3 block in


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 445 -
NOTE
O0003.
O0003;
N1 G66.1 P4000 A0;
N2 A1.0;
N3 A2.0;
N4 M30;
O4000;
N1 SWITCH[#1] CASE[1] GOTO10 CASE[2] GOTO20 DEFAULT[ ] GOTO100
N10
N2 SWITCH[10];
N3 M99;
N20
N4 CASE[10] GOTO30;
N30 #100=1;
N5 M99
N100
N6 M99
16.10 MACRO CALL
A macro program can be called using the following methods. The calling methods can roughly be divided 
into two types: macro calls and subprogram calls.


key: chroma:document
string_value:
A macro program can also be called during MDI operation in the same way.
Macro call Simple call (G65)
Modal call (G66, G66.1, G67)
Macro call using a G code
Macro call using an M code
Subprogram call using an M code
Subprogram call using a T code
Subprogram call using an S code
Subprogram call using a second auxiliary function code
Subprogram call using a specific code
Limitation - Call nesting


key: chroma:document
string_value:
Limitation - Call nesting
Macro calls can be nested to a depth of up to five levels. Subprogram calls can be nested to a depth of up 
to 15 levels including macro calls.
- Differences between macro calls and subprogram calls
Macro call (G66, G66.1, Ggg, or Mmm) differs from subprogram call (for example M98, Mmm, or Ttt) 
as described below.
- With a macro call, an argument (data passed to a macro) can be specified. A subprogram call does 
not have this capability.


key: chroma:document
string_value:
not have this capability.
- If a macro call block contains another NC command (such as G01 X100.0 G65 Pp), an alarm 
PS0127, “DUPLICATE NC,MACRO STATEMENT” occurs.
- If a subprogram call block contains another NC command (such as G01 X100.0 M98 Pp), the 
subprogram is called after the command is executed.
Subprogram call


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 446 -
- In any macro call block, the machine does not stop in the single block mode.
If a subprogram call block contains another NC command (such as G01 X100.0 M98 Pp), the 
machine stops in the single block mode.
- With a macro call, the level of local variables changes. With a subprogram call, the level of local 
variables does not change. (See "Local variable levels" in Limitation of Subsection, “Simple Call 
(G65)”.)


key: chroma:document
string_value:
(G65)”.)
- Called program and folders to be searched
The order in which folders are called depends on the method of calling a macro or subprogram.
Folders are searched in sequence and the program found first is called. For details, see the "Managing 
Programs" chapter.
16.10.1 Simple Call (G65)
When G65 is specified, the custom macro specified at address P is called. Data (argument) can be passed 
to the custom macro program.
P : Number of the program to call
 : Repetition count (1 by default)


key: chroma:document
string_value:
Argument : Data passed to the macro
O0001 ;
 :
G65 P9010 L2 A1.0 B2.0 ;
 :
M30 ;
O9010 ;
#3=#1+#2 ;
IF [#3 GT 360] GOTO 9 ;
G00 G91 X#3 ;
N9 M99 ;
G65 P p L  <argumentspecification> ;
Explanation
- Call
- After G65, specify at address P the program number of the custom macro to call.
- When the number of repetitions is required, specify a number from 1 to 99999999 after address L. 
When L is omitted, 1 is assumed.


key: chroma:document
string_value:
- By using argument specification, values are assigned to corresponding local variables.
- Argument specification
Two types of argument specification are available. Argument specification I uses letters other than G, L, 
O, N, and P once each. Argument specification II uses A, B, and C once each and also uses I, J, and K up 
to ten times. The type of argument specification is determined automatically according to the letters used.
- Argument specification I
Address Variable
number
A
B
C
D
E
F


key: chroma:document
string_value:
number
A
B
C
D
E
F
H
#1
#2
#3
#7
#8
#9
#11
I
J
K
M
Q
R
S
#4
#5
#6
#13
#17
#18
#19
T
U
V
W
X
Y
Z
#20
#21
#22
#23
#24
#25
#26
Address Variable
number
Address Variable
number
- Addresses G, L, N, O, and P cannot be used in arguments.
- Addresses that need not be specified can be omitted. Local variables corresponding to an omitted 
address are set to null.
- Addresses do not need to be specified alphabetically. They conform to word address format.


key: chroma:document
string_value:
I, J, and K need to be specified alphabetically, however.
Argument specification I is always used for I, J, and K by setting bit 7 (IJK) of parameter No. 6008 
to 1


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 447 -
Example
- When bit 7 (IJK) of parameter No. 6008 is 0, I_J_K_ means that I = #4, J = #5, 
and K = #6 while K_J_I_ means K = #6, J = #8, and I= #10 because argument 
specification II is used.
- When bit 7 (IJK) of parameter No. 6008 is 1, K_J_I_ means that I = #4, J = #5, 
and K = #6, which is the same as with I_J_K_, because argument specification I 
is used.
- Argument specification II


key: chroma:document
string_value:
- Argument specification II 
Argument specification II uses A, B, and C once each and uses I, J, and K up to ten times. Argument 
specification II is used to pass values such as 3-dimensional coordinates as arguments.
Address Variable
number
A
B
C
I1
J1
K1
I2
J2
K2
I3
J3
#1
#2
#3
#4
#5
#6
#7
#8
#9
#10
#11
IK3
I4
J4
K4
I5
J5
K5
I6
J6
K6
I7
#12
#13
#14
#15
#16
#17
#18
#19
#20
#21
#22
J7
K7
I8
J8
K8
I9
J9
K9
I10
J10
K10
#23
#24
#25
#26
#27
#28


key: chroma:document
string_value:
#23
#24
#25
#26
#27
#28
#29
#30
#31
#32
#33
Address Variable
number
Address Variable
number
- Subscripts of I, J, and K for indicating the order of argument specification are not written in the 
actual program.
NOTE
When bit 7 (IJK) of parameter No. 6008 is 1, argument II cannot be used.
Limitation
- Format
G65 must be specified before any argument.
- Mixture of argument specifications I and II


key: chroma:document
string_value:
The CNC internally identifies argument specification I and argument specification II. If a mixture of 
argument specification I and argument specification II is specified, the type of argument specification 
specified later takes precedence.
[Example]
G65 A1.0 B2.0 I-3.0 I4.0 D5.0 P1000 ;
(Variables)
#1:1.0
#2:2.0
#3:
#4:-3.0
#5:
#6:
#7:4.0 5.0
When both the I4.0 and D5.0 arguments are commanded for variable #7 in this example, the latter, D5.0, 
is valid.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 448 -
- Position of the decimal point
The units used for argument data passed without a decimal point correspond to the least input increment 
of each address. 
CAUTION
The value of an argument passed without a decimal point may vary according to 
the system configuration of the machine. It is good practice to use decimal points 
in macro call arguments to maintain program compatibility.
- Extended axis name


key: chroma:document
string_value:
- Extended axis name
The axis address of an extended axis name cannot be specified as an argument. If an attempt is made to 
specify it, alarm PS0129, “'G' AS ARGUMENT” is issued.
M
When a value is specified with no decimal point, the number of decimal places is determined as follows.
Address For a non-axis address For an axis address
D, E, H, M, S, or T 0
Q or R α (NOTE 2)
A, C, I, J, K, X, Y, or Z α (NOTE 2) β (NOTE 3)
B, U, V(NOTE 1), or W 0 β (NOTE 3)
Second auxiliary function γ (NOTE 4)


key: chroma:document
string_value:
Address Metric input Inch input
F (G93 mode) 3
F (G94 mode) 0 2
F (G95 mode) 2 (NOTE 5) 4 (NOTE 5)
NOTE
1 When V is used in a call using a specific code, the number of decimal places is 
determined according to the setting for the reference axis.
2 α is determined according to the increment system for the reference axis (axis 
specified with parameter No. 1031) as listed in the table in NOTE 3.
3 β is determined according to the increment system for the corresponding axis


key: chroma:document
string_value:
address as listed in the following table.
Increment 
system Linear axis (metric input) Linear axis (inch input) Rotation axis
IS-A 2 3 2
IS-B 3 4 3
IS-C 4 5 4
When bit 7 (IPR) of parameter No. 1004 is set to 1, the above values from which 
1 is subtracted are used. When the increment system for an axis is IS-A, 
however, the setting of bit 7 (IPR) of parameter No. 1004 is not effective.
When calculator-type decimal notation for each axis is used (bit 0 (ADX) of


key: chroma:document
string_value:
parameter No. 3455 is set to 1), the number of decimal places is 0. When bit 7 
(EAP) of parameter No. 3452 is set to 1, however, calculator-type decimal 
notation is not effective and the number of decimal places is determined as listed 
in the above table.
4 γ is determined according to the increment system for the reference axis (axis 
specified with parameter No. 1031) as listed in the following table. (When bit 7 
(BDX) of parameter No. 3450 is set to 1, γ is also determined in the same way.)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 449 -
NOTE
Increment system for 
the reference axis
AUP (No.3450#0)
= 0
AUP(No.3450#0) = 1
AUX (No.3405#0) = 0 AUX (No.3405#0) = 1
Metric Inch Metric Inch
IS-A
0
2 2 3
IS-B 3 3 4
IS-C 4 4 5
5 When bit 1 (FR3) of parameter No. 1405 is 1, the values in the table need to be 
incremented by 1.
6 When calculator-type decimal notation is used (bit 0 (DPI) of parameter No. 3401 
is set to 1), the number of decimal places is 0.
T


key: chroma:document
string_value:
T
When a value is specified with no decimal point, the number of decimal places is determined as follows.
Address For a non-axis address For an axis address
H, M, Q, S, or T 0
D α
R 0 or α (NOTE 6)
A, B, C, I, J, K, U, V, W, X, Y, or Z α (NOTE 1) β (NOTE 2)
Second auxiliary function γ (NOTE 3)
Address Metric input Inch input
E, F (G98 mode) 0 (NOTE 4) 2 (NOTE 4)
E, F (G99 mode) 4 6
NOTE
1 α is determined according to the increment system for the reference axis (axis


key: chroma:document
string_value:
specified with parameter No. 1031) as listed in the table in NOTE 2.
2 β is determined according to the increment system for the corresponding axis 
address as listed in the following table.
Increment system Linear axis (metric input) Linear axis (inch input) Rotation axis
IS-A 2 3 2
IS-B 3 4 3
IS-C 4 5 4
When bit 7 (IPR) of parameter No. 1004 is set to 1, the above values from which 
1 is subtracted are used. When the increment system for an axis is IS-A,


key: chroma:document
string_value:
however, the setting of bit 7 (IPR) of parameter No. 1004 is not effective.
When calculator-type decimal notation for each axis is used (bit 0 (ADX) of 
parameter No. 3455 is set to 1), the number of decimal places is 0. When bit 7 
(EAP) of parameter No. 3452 is set to 1, however, calculator-type decimal 
notation is not effective and the number of decimal places is determined as listed 
in the above table.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 450 -
NOTE
3 γ is determined according to the increment system for the reference axis (axis 
specified with parameter No. 1031) as listed in the following table. (When bit 7 
(BDX) of parameter No. 3450 is set to 1, γ is also determined in the same way.)
Increment system for 
the reference axis
AUP (No.3450#0)
= 0
AUP(No.3450#0) = 1
AUX (No.3405#0) = 0 AUX (No.3405#0) = 1
Metric Inch Metric Inch
IS-A
0
2 2 3
IS-B 3 3 4
IS-C 4 4 5


key: chroma:document
string_value:
2 2 3
IS-B 3 3 4
IS-C 4 4 5
4 When bit 2 (FM3) of parameter No. 1404 is 1, the values in the table need to be 
incremented by 3.
5 When calculator-type decimal notation is used (bit 0 (DPI) of parameter No. 3401 
is set to 1), the number of decimal places is 0.
6 If bit 2 (DPD) of parameter No. 6019 is 0, the number of decimal places is 0, and if 
DPD is 1, it is α.
- Call nesting
Macro calls can be nested to a depth of up to five levels including simple calls (G65) and modal calls


key: chroma:document
string_value:
(G66/G66.1). Subprogram calls can be nested to a depth of up to 15 levels including macro calls.
A macro program can also be called during MDI operation in the same way.
- Local variable levels
- Local variables from level 0 to 5 are provided for nesting.
- The level of the main program is 0.
- Each time a macro is called (with G66, G66.1, Ggg, or Mmm), the local variable level is 
incremented by one. The values of the local variables at the previous level are saved in the CNC.


key: chroma:document
string_value:
- When M99 is executed in a macro program, control returns to the calling program. At that time, the 
local variable level is decremented by one; the values of the local variables saved when the macro 
was called are restored.
Macro 
(level 4)
 O0006 
 :
 :
 :
 :
 :
M99 ;
Local variables 
(level 0) (Level 1)
#1
 :
 : 
#33
1
:
#1
 :
 :
#33
2
:
(Level 2)
#1
 :
 :
#33
3
:
(Level 3)
#1
 :
 :
#33
4
:
(Level 4)
#1
 :
 :
#33
5
:
Common variables


key: chroma:document
string_value:
#33
5
:
Common variables
#100-, #500- Variables that can be read from and written to by macros at different levels
O0001 ;
 :
#1=1 ;
G65 P2 A2 ;
 :
 :
M30 ;
Main program 
(level 0)
Macro 
(level 1)
Macro 
(level 2)
Macro 
(level 3)
O0002 ;
 :
 :
G65 P3 A 3;
 :
 :
M99 ;
O0003 ;
 :
 :
G65 P4 A4 ;
 :
 :
M99 ;
O0004 ;
 :
 :
G65 P5 A5 ;
 :
 :
M99 ;
O0005 ;
 :
 :
G65 P6 A6 ;
 :
 :
M99 ;
(Level 5)
#1
 :
 :
#33
:
6
Macro 
(level 5)


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 451 - 
Sample program (bolt hole circle) 
M
A macro is created which drills H holes at intervals of B degrees after a start angle of A degrees along the 
periphery of a circle with radius I. 
The center of the circle is (X,Y). Commands can be specified in either the absolute or incremental 
programming. 
To drill in the clockwise direction, specify a negative value for B. 
H=
H=
H=
H=
A
B B
Center 
Radius 
 - Calling format


key: chroma:document
string_value:
Radius 
 - Calling format 
G65 P9100 Xx Yy Zz Rr Ff Ii Aa Bb Hh ; 
X : X coordinate of the center of the circle (absolute or incremental programming) .......................... (#24) 
Y : Y coordinate of the center of the circle (absolute or incremental programming) .......................... (#25) 
Z : Hole depth ...................................................................................................................................... (#26)


key: chroma:document
string_value:
R : Coordinates of an approach point .................................................................................................. (#18) 
F : Cutting feedrate ................................................................................................................................ (#9) 
I : Radius of the circle........................................................................................................................... (#4)


key: chroma:document
string_value:
A : Drilling start angle ........................................................................................................................... (#1) 
B : Incremental angle (clockwise when a negative value is specified) .................................................. (#2) 
H : Number of holes ............................................................................................................................. (#11) 
 - Program calling a macro program 
O0002; 
G90 G92 X0 Y0 Z100.0;


key: chroma:document
string_value:
G90 G92 X0 Y0 Z100.0; 
G65 P9100 X100.0 Y50.0 R30.0 Z-50.0 F500 I100.0 A0 B45.0 H5; 
M30; 
 - Macro program (called program) 
O9100; 
#3=#4003; ................................ Stores G code of group 3. 
G81 Z#26 R#18 F#9 K0; (Note) .. Drilling cycle. 
 Note: L0 can also be used. 
IF[#3 EQ 90]GOTO 1; .............. Branches to N1 in the G90 mode. 
#24=#5001+#24; ...................... Calculates the X coordinate of the center.


key: chroma:document
string_value:
#25=#5002+#25; .................... Calculates the Y coordinate of the center. 
N1 WHILE[#11 GT 0]DO 1; ..... Until the number of remaining holes reaches 0 
#5=#24+#4*COS[#1]; .............. Calculates a drilling position on the X-axis.


key: chroma:document
string_value:
16. CUSTOM MACRO PROGRAMMING B-64694EN/01
- 452 -
#6=#25+#4*SIN[#1]; ................Calculates a drilling position on the Y-axis.
G90 X#5 Y#6;...........................Performs drilling after moving to the target position.
#1=#1+#2;................................Updates the angle.
#11=#11-1;...............................Decrements the number of holes.
END 1;
G#3 G80;..................................Returns the G code to the original state.
M99;
Meaning of variables:


key: chroma:document
string_value:
M99;
Meaning of variables:
#3: Stores the G code of group 3.
#5: X coordinate of the next hole to drill
#6: Y coordinate of the next hole to drill
Sample program (Drill cycle)
T
Move the tool beforehand along the X- and Z-axes to the position where a drilling cycle starts. Specify Z 
or W for the depth of a hole, K for the depth of a cut, and F for the cutting feedrate to drill the hole.
Z W
K
Cutting
Rapid traverse
- Calling format
G65 P9100 Kk Ff ;
Z : Hole depth (absolute programming)


key: chroma:document
string_value:
W : Hole depth (incremental programming)
K : Cutting amount per cycle
F : Cutting feedrate
- Program calling a macro program
O0002;
G50 X100.0 Z200.0 ;
G00 X0 Z102.0 S1000 M03 ;
G65 P9100 Z50.0 K20.0 F0.3 ;
G00 X100.0 Z200.0 M05 ;
M30
- Macro program (called program)
O9100;
#1=0 ;................................................... Clear the data for the depth of the current hole.
#2=0 ;................................................... Clear the data for the depth of the preceding hole.
Zz


key: chroma:document
string_value:
B-64694EN/01 PROGRAMMING 16. CUSTOM MACRO
- 453 -
IF [#23 NE #0] GOTO 1 ;..................... If incremental programming, specifies the jump to 
N1.
IF [#26 EQ #0] GOTO 8 ; .................... If neither Z nor W is specified, an error occurs.
#23=#5002-#26 ; ................................. Calculates the depth of a hole.
N1 #1=#1+#6 ;........................................... Calculates the depth of the current hole.


key: chroma:document
string_value:
IF [#1 LE #23] GOTO 2 ;..................... Determines whether the hole to be cut is too deep?
#1=#23 ;............................................... Clamps at the depth of the current hole.
N2 G00 W-#2 ; .......................................... Moves the tool to the depth of the preceding hole at 
the cutting feedrate.
G01 W- [#1-#2] F#9 ;........................... Drills the hole.
G00 W#1 ;............................................ Moves the tool to the drilling start point.


key: chroma:document
string_value:
IF [#1 GE #23] GOTO 9 ; .................... Checks whether drilling is completed.
#2=#1 ;.................................................Stores the depth of the current hole.
GOTO 1 ;
N9 M99 
N8 #3000=1 (NOT Z OR W COMMAND).. Issues an alarm.
16.10.2 Modal Call: Call After the Move Command (G66)
Once G66 is issued to specify a modal call a macro is called after a block specifying movement along 
axes is executed. This continues until G67 is issued to cancel a modal call.
Explanation
- Call


