
PROGRAMMING
14. CUSTOM MACRO
B–63444EN/01
156
Modal information specified in blocks up to the immediately preceding
block can be read.
Table 14.2 (h) System variables for modal information
Variable
number
Function
#4001
#4002
#4003
#4004
#4005
#4006
#4007
#4008
#4009
#4012
#4014
#4015
:
#4022
#4109
#4113
#4114
#4115
#4119
#4120
G00, G01, G02, G03, G32 (Group 01)
G96, G97 (Group 02)
(Group 03)
(Group 04)
G98, G99 (Group 05)
G20, G21 (Group 06)
G40, G41, G42 (Group 07)
(Group 08)
(Group 09)
G66, G67 (Group 12)
G54–G59 (Group 14)
(Group 15)
::
(Group 22)
F code
M code
Sequence number
Program number
S code
T code
Example:
When #1=#4006; is executed, the resulting value in #1 is 20 or 21.
When a modal information reading system variable corresponding to a G
code group which cannot be used is specified, a P/S alarm is issued.
Position information cannot be written but can be read.
Table 14.2 (i) System variables for position information
Variable
number
Position
information
Coordinate
system
Tool com-
pensation
value
Read
operation
during
movement
#5001–#5002 Block end point Workpiece
coordinate
system
Not
included
Enabled
#5021–#5022 Current position Machine
coordinate
system
Included Disabled
#5041–#5042 Current position
Workpiece
#5061–#5062 Skip signal
position
coordinate
system
Enabled
#5081–#5082 Tool offset value
Disabled
#5101–#5102 Deviated servo
position
⋅ The first digit (from 1 to 2) represents an axis number.
D Modal information
D Current position