FANUC Series 30i/300i/300is-MODEL A. Machining Center System. User's manual - page 65

 

  Index      Manuals     FANUC Series 30i/300i/300is-MODEL A. Machining Center System. User's manual (B-63944EN/03)

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     63      64      65      66     ..

 

 

 

FANUC Series 30i/300i/300is-MODEL A. Machining Center System. User's manual - page 65

 

 

16.CUSTOM MACRO

 PROGRAMMING 

B-63944EN/03

 

 

- 476 - 

Compensation 

number 

Variable 

number

Variable name

Description 

1 #15001 

[#_OFSXG[1]] 

2 #15002 

[#_OFSXG[2]] 

3 #15003 

[#_OFSXG 

[3]] 

: :  : 

998 #15998 

[#_OFSXG 

[998]]

999 #15999 

[#_OFSXG 

[999]]

X-axis compensation value 

(geometry) (*1) 

1 #16001 

[#_OFSZG[1]] 

2 #16002 

[#_OFSZG[2]] 

3 #16003 

[#_OFSZG[3]] 

: :  : 

998 #16998 

[#_OFSZG[998]]

999 #16999 

[#_OFSZG[999]]

Z-axis compensation value 

(geometry) (*1) 

1 #17001 

[#_OFSRG[1]] 

2 #17002 

[#_OFSRG[2]] 

3 #17003 

[#_OFSRG[3]] 

: :  : 

998 #17998 

[#_OFSRG[998]]

999 #17999 

[#_OFSRG[999]]

Tool nose radius 

compensation value 

(geometry) 

1 #19001 

[#_OFSYG[1]] 

2 #19002 

[#_OFSYG[2]] 

3 #19003 

[#_OFSYG[3]] 

: :  : 

998 #19998 

[#_OFSYG[998]]

999 #19999 

[#_OFSYG[999]]

Y-axis compensation value 

(geometry) (*1) 

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

 

 

B-63944EN/03

 PROGRAMMING 

16.CUSTOM MACRO

 

 

- 477 - 

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

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. 

(Example) 

#3000 = 1 (ALARM MESSAGE);   

 

  "3001 ALARM MESSAGE" appears on the alarm 

screen.

 

When bit 1 (MCA) of parameter No.6008 = 1 
 

#3000 = n (ALARM MESSAGE);    (n: 0-4095)

 

 

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. 

 

  - 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 

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 

;

 

16.CUSTOM MACRO

 PROGRAMMING 

B-63944EN/03

 

 

- 478 - 

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

0 Enabled 

Waiting 

1 Disabled 

Waiting 

2 Enabled  Not 

waiting 

#3003 

[#_CNTL1] 

3 Disabled  Not 

waiting 

 
In addition, the following variable names can be used to enable or 
disable single block stop and a wait for the auxiliary function 
completion signal, individually. 
 

Variable name 

Value

Single block stop 

Auxiliary function 

completion 

0 Enabled 

[#_M_SBK] 

1 Disabled 

0 - 

Waiting 

[#_M_FIN] 

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 

 

#3003 is cleared by a reset. 

 
 

Disable single block stop. 
#18 corresponds to R and 
#26 to Z. 

B-63944EN/03

 PROGRAMMING 

16.CUSTOM MACRO

 

 

- 479 - 

  - 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

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

#3004 

[#_CNTL2] 

7 Disabled Disabled 

Disabled

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

0 Enabled 

[#_M_FHD] 

1 Disabled 

0 - Enabled - 

[#_M_OV] 

1 - Disabled 

0 - 

- Enabled 

[#_M_EST] 

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 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 cutting feed. 

16.CUSTOM MACRO

 PROGRAMMING 

B-63944EN/03

 

 

- 480 - 

 

 - 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 

 

  - 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 

 

  - Status of a mirror image #3007 (Attribute:    R) 

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

 
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. 

 

B-63944EN/03

 PROGRAMMING 

16.CUSTOM MACRO

 

 

- 481 - 

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. 

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) 

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 

 

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

 

16.CUSTOM MACRO

 PROGRAMMING 

B-63944EN/03

 

 

- 482 - 

  - Type of tool compensation memory #3980 (Attribute:    R) 

 

M

 

System variable #3980 can be used to read the type of compensation 
memory. 
 

Variable number

Variable name

Description 

#3980 [#_OFSMEM] 

Types 

of 

tool compensation memory

0:    Tool compensation memory A
1:    Tool compensation memory B
2:    Tool compensation memory C

 

 

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

 

B-63944EN/03

 PROGRAMMING 

16.CUSTOM MACRO

 

 

- 483 - 

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

 

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

<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 
(program number O) 

 

 

 

 

 

 

 

Content      ..     63      64      65      66     ..