
PROGRAMMING16. CUSTOM MACRO
B–63684EN/01
292
Meaning
Note
(In case not to
command M code
preventing buffer-
ing or G53 block.)
Number of
Variable
Read
Write
Time information
Read
Write
#3001,#3002 The data is read / writ-
ten at buffering a mac-
ro program.
Read #3011,#3012 The data is read at
buffering a macro pro-
gram.
Automatic operation
control
Write #3003, #3004 Setting data is avail-
able at maximum 2
blocks before a macro
program.
Settings Write #3005 The data is written at
buffering a macro pro-
gram.
Mirror image Read #3007 The data is read at
buffering a macro pro-
gram.
Currently selected
additional workpiece
coordinate system
Read #4130(P)
#4014
(G54 – G59)
The data is read at
maximum 3 blocks
before a macro pro-
gram.
Current position
(Machine coordinate
system)
Read #5021 – #5028 The uncertain position
in moving is read.
Current position
(Workpiece coordi-
nate system)
Read #5041 – #5048 The uncertain position
in moving is read.
Deviated servo
position
Read #5101 – #5108 The uncertain devi-
ation in moving is
read.
Workpiece zero
point offset value
Write #5201 – #5328 The data is written at
buffering a macro pro-
gram.
Example)
O0001 O2000
N1 X10.Y10.; (Mxx ;) Specify preventing buffering M code or G53
N2 M98P2000; N100 #1=#5041;(Reading X axis current position)
N3 Y200.0; N101 #2=#5042;(Reading Y axis current position)
: :
M99;
In above case, the buffering of N2 block is done and the macro program
of O2000 is read and executed during N1 block of main program O1000
execution. Therefore, the current position readings are executed during
axes movements at N1 block. So the unexpected position data can be read
to #1 and #2 because of axes movements. In this case, please specify M
code preventing buffering Mxx ; (or G53 ;) just before N100 block of
O2000. By this, the position data at completing the execution of N1 block
can be read to #1 and #2 because O2000 is executed after completing the
execution of N1 block of O0001.