FANUC Series 0i-MODEL F Plus. CONNECTION MANUAL (FUNCTION) - page 265

 

  Index      Manuals     FANUC Series 0i-MODEL F Plus. CONNECTION MANUAL (FUNCTION) B-64693EN-1/01

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     263      264      265      266     ..

 

 

 

FANUC Series 0i-MODEL F Plus. CONNECTION MANUAL (FUNCTION) - page 265

 

 

12. PROGRAM COMMAND

 

 

B-64693EN-1/01

 

- 2074 - 

12.6.2 

Indirect Axis Address Command 

Overview 

When the custom macro function is enabled, indirect specification by an axis number can be performed 
by using AX[(axis-number)] instead of directly specifying an axis name during specification for an axis 
address. 
In addition, the axis number corresponding to the axis name can be obtained by  using 
AXNUM[(axis-name)]. 
 

Explanation 

  - 

Indirect axis address 

Indirect axis address AX[] can be used to perform a command for an axis with an axis number (AX[] 
must be followed by “=”). 
 
AX[(axis-number)]=(value); 

 

(axis-number)  :1 to number-of-control-axis (Number of each path for a multipath system) 
(value) 

 

:Value for the axis specified by its axis number 

 
When the specified (axis-number) is invalid, the alarm PS0331, "ILLEGAL AXIS NUMBER IN AX[]" 
occurs. If there is a value in the decimal place digits, the number rounded off is treated as (axis number). 
A variable such as a local variable, common variable, or system variable can also be used as 
(axis-number). When calculation using a variable name is performed for (axis-number), however, the 
variable name must be enclosed with []. 
 

1.  AX[1]=100.0; 
 

A value of 100.000 is specified for the first axis. 

2.  AX[#500]=200.0; 
 

A value of 200.000 is specified for the axis having the value stored in #500 as its 
axis number. 

3.  AX[#500+1]=300.0; 
 

A value of 300.000 is specified for the axis having the value stored in #500 plus 
1 as its axis number. 

4.  SETVN 500 [ABC]; 
 

AX[#ABC]=400.0; 

 

A value of 400.000 is specified for the axis having the value stored in 
#ABC(#500) as its axis number. 

5.  SETVN 500 [ABC]; 
 

AX[[#ABC]+1]=500.0; 

 

A value of 500.000 is specified for the axis having the value stored in 
#ABC(#500) plus 1 as its axis number. 

6.  SETVN 500 [ABC]; 
 

AX[#ABC+1]=500.0; 

 

The alarm PS0114”ILLEGAL EXPRESSION FORMAT” occurs. 

 

  - 

AXNUM function 

AXNUM[] can be used to obtain an axis number. 
 

AXNUM[(axis-name)]; 

 
If the specified (axis-name) is invalid, the alarm PS0332, "ILLEGAL AXIS ADDRESS IN AXNUM[]"   
occurs. 

B-64693EN-1/01

 

 

12. PROGRAM COMMAND

 

- 2075 - 

 

When the number of control axes is three and the first axis name is "X", the second 
axis name is "Y", and the third axis name 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 3is stored in #502. 

4.  #503=AXNUM[A]; 
 

The alarm PS0332 occurs. 

 

Example 

Example where the first axis name is "X", the second axis name is "Y", and the third axis name 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 G01F1000. ; 
N70 AX[#AXIS1]=100.0 AX[#AXIS2]=100.0 AX[#AXIS3]=100.0 ; 
N80 G02 AX[#AXIS1]=200. 0 AX[#AXIS1]=200.0 R50.0 ; 
N90 M02; 
 

Limitation 

When the custom macro function is enabled, "AX" and "AXN" cannot be used as extended axis names 
and are assumed as AX[] and AXNUM[], respectively. 
 

Alarm and message 

Number 

Message 

Description 

PS0331 

ILLEGAL AXIS NUMBER IN AX[] 

An illegal value is specified for an AX[] axis number. 

PS0332 

ILLEGAL AXIS ADDRESS IN 
AXNUM[] 

An illegal value is specified for an AXNUM[] axis address.   

 

12.6.3 

Interruption Type Custom Macro 

Overview 

When a program is being executed, another program can be called by inputting an interrupt signal UINT 
<Gn053.3> from the machine. This function is referred to as an interruption type custom macro function.   
 

Explanation 

Program an interrupt command in the following format: 

 

M96 Pxxxx; 

Enables custom macro interrupt 

M97 ; 

Disables custom macro interrupt 

 
Use of the interruption type custom macro function allows the user to call a program during execution of 
an arbitrary block of another program. This allows programs to be operated to match situations which 
vary from time to time. 
(1)  When a tool abnormality is detected, processing to handle the abnormality is started by an external 

signal. 

12. PROGRAM COMMAND

 

 

B-64693EN-1/01

 

- 2076 - 

(2)  A sequence of machining operations is interrupted by another machining operation without the 

cancellation of the current operation. 

(3)  At regular intervals, information on current machining is read. 
     : 
Listed above are examples like adaptive control applications of the interruption type custom macro 
function. 

 

Interrupt signal 
UINT* 

Interrupt signal 
UINT 

Interrupt signal 
UINT* 

M96 Pxxxx; 

Nyyyy; 

M97  ; 

M99 (Pyyyy); 

O xxxx; 

 

Fig. 12.6.3  Interruption type custom macro function 

 
When M96Pxxxx is specified in a program, subsequent program operation can be interrupted by an 
interrupt signal UINT input to execute the program specified by Pxxxx. When the interrupt signal UINT 
(marked with an asterisk (*) in Fig.  12.6.3) is input during execution of the interrupt program or after 
M97, it is ignored. 
 

Signal 

Interrupt signal for custom macro UINT<Gn053.3> 

  [Classification]  Input signal 
 

[Function]  This signal calls and executes a program in memory. 

During execution, a program in automatic operation is suspended. 
To enable this signal to be accepted, a particular miscellaneous function must be specified 
in a command program for automatic operation. In addition, automatic operation must 
already be started to accept this signal. The particular miscellaneous function code is set 
by parameter Nos. 6003, 6033 and 6034.   
 

Signal address 

 

 

#7 

#6 

#5 

#4 

#3 

#2 

#1 

#0 

Gn053 

 

 

 

 

 

UINT 

 

 

 

 

Parameter 

  - 

Various Setting for Custom Macro 

 

 

#7 

#6 

#5 

#4 

#3 

#2 

#1 

#0 

6003 

 

MUS 

 

MSB 

MPR 

TSE 

MIN 

MSK 

 

 

 

[Input type]  Parameter input 

 

[Data type]  Bit path 

 

B-64693EN-1/01

 

 

12. PROGRAM COMMAND

 

- 2077 - 

NOTE 

 

When at least one of these parameters is set, the power must be 
turned off before operation is continued. 

 

 

#1  MSK

  Absolute coordinates at that time during custom macro interrupt 

0: 

Not set to the skip coordinates (system variables #5061 and later) 

1: 

Set to the skip coordinates (system variables #5061 and later) 

 

 

#2  MIN

  Custom macro interrupt 

0: 

Performed by interrupting an in-execution block (Custom macro interrupt type I) 

1: 

Performed after an in-execution block is completed (Custom macro interrupt type II) 

 

 

#3  TSE

  Custom macro interrupt signal UINT 

0: 

Edge trigger method (Rising edge) 

1: 

Status trigger method 

 

 

#4  MPR

  Custom macro interrupt valid/invalid M code 

0: 

M96/M97 

1: 

M code set using parameters Nos. 6033 and 6034 

 

 

#5  MSB

  Interrupt program 

0: 

Uses a dedicated local variable (Macro-type interrupt) 

1: 

Uses the same local variable as in the main program (Subprogram- type interrupt) 

 

 

#7  MUS

  Interrupt-type custom macro 

0: 

Not used 

1: 

Used 

 

  - 

Setting M code that makes custom macro interrupt effective/ineffective 

6033 

 

M code that validates a custom macro interrupt 

 

6034 

 

M code that invalidates a custom macro interrupt 

 

 

[Input type]  Parameter input 

 

[Data type]  2-word path 

[Valid data range]  03 to 99999999 (excluding 30, 98 and 99) 

These parameters can be used when bit 4 (MPR) of parameter No. 6003 is 1. M96 is used 
as a valid M code and M97 is used as an invalid M code when MPR is 0, irrespective of 
the state of this parameter.   
 

Note 

NOTE 

1  No interrupt-type custom macro can be used during multiple repetitive canned 

cycle execution. 

2  No interrupt-type custom macro can be used during return operation in dry run 

after search operation when the program is restarted. 

12. PROGRAM COMMAND

 

 

B-64693EN-1/01

 

- 2078 - 

NOTE 

3  The alarm PS1101 is issued in the following cases: 

<1>  Case where an interrupt is made in the programmable mirror image 

(G51.1) mode and G51.1 is further specified in the interrupted program 

<2>  Case where an interrupt is made in the coordinate system rotation (G68) 

mode and G68 is further specified in the interrupted program 

<3>  Case where an interrupt is made in the scaling (G51) mode and G51 is 

further specified in the interrupted program 

4  During program execution in cycle operation, interrupt type II is used, regardless 

of the setting of bit 2 (MIN) of parameter No. 6003. Cycle operation has the 
following functions: 
<1>  Automatic reference position return 
<2>  Cutter or tool nose radius compensation (when multiple blocks are 

generated from one specified block as in a case where an acute turn is 
made on the outside) 

<3>  Canned cycle 
<4>  Automatic tool length measurement (M series) / Automatic tool offset (T 

series) 

<5>  Optional chamfering corner R 
<6>  Normal direction control 
<7>  Cutting point interpolation for cylindrical interpolation 

 

Reference item 

Manual name 

Item name 

OPERATOR’S MANUAL (B-64694EN) 

Interrupt-type custom macro 

 

12.6.4 

Embedded Macro 

Overview 

This function  protects a program created by a machine tool builder, by storing the program in a folder 
dedicated to embedded macros (hereinafter referred to as an MTB1 folder) and assigning an attribute to 
the folder. 
At the same time, the following functions are available: 
 
(1)  A dedicated program memory capacity of 100K bytes (corresponding to about 260 m) is provided in 

addition the ordinary program memory capacity. 
The number of registerable programs remains unchanged from the ordinary number of registerable 
programs. 

(2)  To the MTB1 folder, an attribute such as edit prohibition and edit/display prohibition can be 

assigned. Moreover, by using a dedicated password and keyword, a set value can be locked. 

(3)  A program stored in the MTB1 folder can be used by calling based on a code such as M/T codes, 

macro calling based on a G code, macro calling based on G65/G66, and subprogram calling based 
on an M code such as M98. 

(4)  Custom macro common variables (#200 to #499) are added. 

B-64693EN-1/01

 

 

12. PROGRAM COMMAND

 

- 2079 - 

 

 

Detailed explanation 

(1)  Program memory capacity 
 

A dedicated program memory capacity of 100K bytes (corresponding to about 260 m) is provided in 
addition the ordinary program memory capacity. 

 

The dedicated program memory capacity is managed separately from the ordinary program memory 
capacity. Program memory capacity information (used pages and free pages) is displayed as 
described below. 

When the MTB1 folder is displayed 
Embedded macro program memory capacity 

When another folder is displayed 
Ordinary program memory capacity 

 

 

Fig. 12.6.4 (a) Program memory capacity 

 
(2)  Number of registerable programs 

Ordinary programs and dedicated programs can be registered as long as the total number of those 
programs does not exceed the number of registerable programs. 
 

12. PROGRAM COMMAND

 

 

B-64693EN-1/01

 

- 2080 - 

(3)  Program protection function 
 

One of two attributes can be assigned to the MTB1 folder. 
1) 

Edit prohibition 
Editing of the programs in the folder is prohibited. 

The contents of programs cannot be edited. 

No program name and program attribute can be modified. 

No program can be deleted. 

 

No new program can be created in the folder. 

2) 

Edit/display prohibition 
The contents of programs in the folder cannot be edited. 
No new program can be created in the folder. 
The programs in the folder become invisible. 
No program in the folder can be output to an external device. 

 

By setting the edit prohibition attribute or edit/display prohibition attribute, the programs in the 
folder can be protected from modification and deletion due to an operation error. 

 

NOTE 

 

Subfolders cannot be created in the MTB1 folder. 

 
(4)    Password and keyword 
 

By setting a password in parameter No. 11311 and setting a keyword in parameter No. 11312, the 
attribute setting of the MTB1 folder can be locked. 
In the locked state, the attribute of the MTB1 folder cannot be changed. Thus, the protection of the 
programs in the MTB1 folder cannot be canceled without setting the correct keyword. 

Locked state 
The locked state means the state where the value of the password parameter No. 11311 and the 
value of the keyword parameter No. 11312 differ from each other. 

 

The values set in these parameters are not displayed. 

Unlocked state   
The unlocked state means the state where the value of the password parameter No. 11311 and 
the value of the keyword parameter No. 11312 match each other. 

 

The values set in these parameters are not displayed. 

State where no key is set 

 

When 0 is displayed in the password parameter No. 11311, no password is set yet. 

 

NOTE 

 

The attribute of the MTB1 folder can be changed only in the unlocked state. 

 
(5)  Calling   

A program stored in the MTB1 folder can be used by calling based on a code such as M/T codes, 
macro calling based on a G code, macro calling based on G65/G66, and subprogram calling based 
on an M code such as M98. 
For macro calling based on a G code, G codes used for calling are additionally set as indicated below. 
Parameters are used to set the relationship between a G code used for macro calling and the number 
of a called program. Up to ten sets can be set. 

 

Example) 
 

Suppose that the following (Table 12.6.4 (a)) are set by the parameters: 

Table 12.6.4 (a) 

 

First group 

Second group 

Third group 

G code 

No.12020=100 

No.12023=150 

No.12026=900 

Program number 

No.12021=8000 

No.12024=7500 

No.12027=8300 

Number of G codes/programs 

No.12022=10 

No.12025=5 

No.12028=30 

 

B-64693EN-1/01

 

 

12. PROGRAM COMMAND

 

- 2081 - 

 

Then the G codes call the programs in the Table 12.6.4 (b): 

Table 12.6.4 (b) 

G code 

Called program 

G100 to G109 

O8000 to O8009 

G150 to G154 

O7500 to O7504 

G900 to G929 

O8300 to O8329 

 

NOTE 

 

When this function is enabled, the MTB1 folder is added to the top of the search 
order as a program search folder for macro call and subprogram call. 

(1) If a program to be called is registered in the MTB1 folder, the program in the 

MTB1 folder is called. 

(2) If a program to be called is not registered in the MTB1 folder, the program is 

searched for according to parameter No. 3457. 

 
(6)  Macro variable 
 

Common variables #200 to #499 are added. 

 

These variables are independent variables on a path-by-path basis as with variables #100 to #199. 

 

When the power is turned off, the variables are initialized and the data becomes null. 

When bit 3 (PV5) of parameter No. 6001 is set to 1, the custom macro outputs common 
variables #100 to #199, #200 to #499, and #500 to #599. 

When bit 6 (CCV) of parameter No. 6001 is set to 0, common variables #100 to #199 and #200 
to #499 are cleared to null by a reset. When CCV is set to 1, these common variables are not 
cleared by a reset. 

 

NOTE 

 

By specifying parameter No. 6036, variables can be made common to all paths. 
If the option for the embedded macro function is specified but the addition of 
custom macro common variables is disabled (bit 6 (NCV) of parameter No.8135 
is 1), #150 to #199 are unusable. However, in this parameter, set a number 
including #150 to #199. 

 

Example of setting) 
 

When 200 is set in parameter No. 6036: 

 

#100 to #299: Common to all paths 

 

#300 to #449: Used independently on a path-by-path basis 

 

#150 to #199 can be used when the adding custom macro common variables 
is enabled (bit 6(NCV) of parameter No.8135 is 0). 

 

Operation explanation 

Procedure for creating programs in the MTB1 folder 

 
(1)  Creation 

<1>  Make the MTB1 folder empty. 

Delete all programs and folders from the MTB1 folder. 

<2>  Create a program in the MTB1 folder. 

A program can also be read through an external device. 

<3>  Set G code numbers for calling and program numbers to be called in parameters Nos. 12020 to 

12049 as needed. 

<4>  Determine a password then specify it in parameter No. 11311. 

Specify the same value as the password in parameter No. 11312 (keyword) to unlock the key. 

 

 

 

 

 

 

 

Content      ..     263      264      265      266     ..