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

 

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

 

Search            copyright infringement  

 

 

 

 

 

 

 

 

 

 

 

Content      ..     46      47      48      49     ..

 

 

 

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

 

 

13.PROGRAM CONFIGURATION

 PROGRAMMING 

B-63944EN/03

 

 

- 340 - 

Function 

Address 

Input in mm 

Input in inch

 

Increment system IS-A 

0 to 999999.99 sec 

0 to 999999.99 sec 

Increment system IS-B 

0 to 99999.999 sec 

0 to 99999.999 sec 

Increment system IS-C 

0 to 9999.9999 sec 

0 to 9999.9999 sec 

Increment system IS-D 

0 to 999.99999 sec 

0 to 999.99999 sec 

Dwell 

Increment system IS-E 

X,  
U (T series 
only) 

0 to 99.999999 sec 

0 to 99.999999 sec 

Dwell P 

1 to 99999999 

1 to 99999999 

Designation of a program number 

1 to 99999999 

1 to 99999999 

1 to 99999999 

1 to 99999999 

Number of subprogram repetitions 

0 to 9999 

0 to 9999 

 
*1  In ISO code, the colon ( : ) can also be used as the address of a 

program number. 

*2  When address I, J, K, or R is used to specify the radius for 

circular interpolation, the specifiable range is as follows: 

Increment system 

Input in mm 

Input in inch

 

IS-A 

±

999999999.99 mm

 

±

99999999.999 inch

 

IS-B 

±

999999999.999 mm

 

±

99999999.9999 inch

 

IS-C 

±

99999999.9999 mm

 

±

9999999.99999 inch

 

IS-D 

±

9999999.99999 mm

 

±

999999.999999 inch

 

IS-E 

±

999999.999999 mm

 

±

99999.9999999 inch

 

 

*3  For inch input/millimeter machines, the maximum specifiable 

range of dimension words is as follows: 

Increment system 

Maximum specifiable range 

IS-A 

±

39370.078 inch

 

IS-B 

±

39370.0787 inch

 

IS-C 

±

3937.00787 inch

 

IS-D 

±

393.700787 inch

 

IS-E 

±

39.3700787 inch

 

 

*4  The maximum value of addresses M, S, T, and B is 99999999. 

Note that, however, values longer than the permissible number of 
digits set in parameter No. 3030 to 3033 cannot be specified. The 
values and uses for some codes are limited by parameter setting. 
(For example, some M codes are not buffered.) For details, refer 
to the parameter manual. 

 

  - Optional block skip 

When a slash followed by a number (/n (n=1 to 9)) is specified at the 
head of a block, and optional block skip signals BDT1 to BDT9 are 
set to 1 during automatic operation, the information (/n to the end of 
the block (EOB)) contained in the block for which /n corresponding to 
signal BDTn is specified is ignored. 
 
Example 1) 
 

/2  N123  X100.0  Y200.0 ; 

 
Example 2) 
 

//3  N123  X100.0  Y200.0  ; 

  Incorrect 

 

/1  /3  N123  X100.0  Y200.0  ; 

  Correct 

 

B-63944EN/03

 PROGRAMMING 

13.PROGRAM CONFIGURATION

 

 

- 341 - 

Input signal and program code 

Input signal 

Start code to be ignored 

BDT1 

/ or /1

(NOTE)

 

BDT2 /2 
BDT3 /3 
BDT4 /4 
BDT5 /5 
BDT6 /6 
BDT7 /7 
BDT8 /8 
BDT9 /9 

 

NOTE 

1  Number 1 for /1 can be omitted.    However, when 

two or more optional block skips are specified for 
one block, number 1 for /1 cannot be omitted. 

2  Depending on the machine tool, all optional block 

skip signals (1 to 9) may not be usable. Refer to 
manuals of the machine tool builder to find which 
switches are usable. 

 
The following shows the relationship between the timing at which 
optional block skip signals BDT1 to BDT9 are set to 1 and the range 
of information to be ignored. 
 
1.  When the signal BDTn is set to 1 before the CNC starts reading a 

block that contains /n, the block is ignored. 

 

BDTn

"1"

"0"

Read by CNC 

  .  .  .  ; /n N123 X100. Y200. ;N234  .  .  .  .

This range of information is ignored.

 

 
2.  When the signal BDTn is set to 1 while the CNC is reading a 

block that contains /n, the block is not ignored. 

 

BDTn "1"

"0"

Read by CNC 

  .  .  .  ; /n N123 X100. Y200. ; N234 .  .  .  .

This range of information is not ignored.

 

 

13.PROGRAM CONFIGURATION

 PROGRAMMING 

B-63944EN/03

 

 

- 342 - 

3.  When the signal BDTn is set to 0 while the CNC is reading a 

block that contains /n, the block is ignored. 

 

BDTn "1"

"0"

Read by CNC 

  .  .  .  ; /n N123 X100. Y200.;  N234 .  .  .  .

This range of information is ignored.

 

 
4.  Two or more optional block skips can be specified in one block.   

When the signal corresponding to any of the specified skips is set 
to 1, the block is ignored. 

 

BDT3 "1"

"0"

Read by CNC 

    .    .    . ; /1 /3 /5 N123 X100. Y200. ;    N234 .    .    .    .

This range of information is ignored.

 

 

NOTE 

1  This function is not used when a program is 

registered in memory.    A block containing / is 
registered in memory regardless of the statuses of 
optional block skip signals.    When a program in 
memory is also output regardless of the statuses of 
optional block skip signals. 

 

In addition, the optional block skip function is 
enabled during a search for a sequence number. 

2  Position of a slash 
 

A slash (/) must be specified at the head of a block. 
If a slash is placed elsewhere, the information from 
the slash to immediately before the EOB code is 
ignored. 

3  TV and TH check 
 

When the optional block skip signal is set to 1, TH 
and TV checks are made for the skipped portions 
in the same way as when the optional block skip 
signal is set to 0. 

 

B-63944EN/03

 PROGRAMMING 

13.PROGRAM CONFIGURATION

 

 

- 343 - 

 - Program end 

The end of a program is indicated by programming one of the 
following codes at the end of the program: 
 

Table 13.2 (d) Code of a program end 

Code Meaning 

usage 

M02 
M03 

For main program 

M99 For 

subprogram 

 
If one of the program end codes is executed in program execution, the 
CNC terminates the execution of the program, and the reset state is set. 
When the subprogram end code is executed, control returns to the 
program that called the subprogram. 
 

 CAUTION 

 

A block containing an optional block skip code such 
as /M02 ; , /M30 ; , or /M99 ; is not regarded as the 
end of a program.    (see "Optional block skip".) 

13.PROGRAM CONFIGURATION

 PROGRAMMING 

B-63944EN/03

 

 

- 344 - 

13.3 

SUBPROGRAM (M98, M99) 

 
If a program contains a fixed sequence or frequently repeated pattern, 
such a sequence or pattern can be stored as a subprogram in memory 
to simplify the program. 
A subprogram can be called from the main program.   
A called subprogram can also call another subprogram. 
 

Format 
 - Subprogram configuration 

One subprogram 

 

Subprogram number or subprogram file name (or 
the colon (:) optionally in the case of ISO) 
Program end 

 

 

M99 need not constitute a separate block as indicated below. 

 

Example) X100.0Y100.0M99; 

 

 - Subprogram call 

When a subprogram with a 4-digit or shorter 
program number is called 

M98 Pxxxx xxxx ; 

 

        Subprogram number 
Number of times the subprogram is called repeatedly 

 

or 

M98 Pxxxx Lxxxxxxxx ; 

 

Number of times the subprogram is called repeatedly 

Subprogram number 
 

When a subprogram with a 5-digit or longer 
program number is called 

M98 Pxxxxxxxx Lxxxxxxxx ; 

 
Subprogram number 
Number of times the subprogram is called repeatedly 

 

When a subprogram is called by file name 

M98 <xxxx> Lxxxxxxxx ; 

 
Subprogram file name 
Number of times the subprogram is called repeatedly 

 

Oxxxx ; 
    : 
M99; 

B-63944EN/03

 PROGRAMMING 

13.PROGRAM CONFIGURATION

 

 

- 345 - 

  - Called program and folders to be searched 

The order in which folders are searched depends on the method of 
calling a subprogram.  Folders are searched in sequence and the 
program found first is called.  For details, see the "Managing 
Programs" chapter. 
 

NOTE 

1  When calling a subprogram of a 4-digit or shorter 

subprogram number repeatedly (P8 digit), make 
the subprogram number 4 digits by prefixing it with 
“0” if the subprogram number is shorter than 4 
digits. 
Example) 
  P100100:  Call subprogram No. 100 ten times. 
  P50001:  Call subprogram No. 1 five times. 

2  If the number of times the subprogram is called 

repeatedly is omitted when a subprogram with a 
4-digit or shorter program number is called, the 
subprogram is called just once. 
In this case, it is not necessary to adjust the 
subprogram number length to 4 digits as described 
in Item 1 above. 

3  When calling a subprogram of a 4-digit or shorter 

program number repeatedly (P8 digit), do not 
specify address L in the same block. 

4  When calling a subprogram with a 5-digit or longer 

program number, do not omit the specification of 
the number of repeats. 

5  When calling a subprogram by file name, be sure 

to specify the file name immediately after M98. 

 

13.PROGRAM CONFIGURATION

 PROGRAMMING 

B-63944EN/03

 

 

- 346 - 

Explanation 

When the main program calls a subprogram, it is regarded as a 
one-level subprogram call. Thus, subprogram calls can be nested up to 
ten levels as shown below. 

O0001 ; 

M98P0010 ; 

M30 ; 

Main program 

O0090 ;

M99 ;

O0010 ; 

M98P0020 ; 

M99 ; 

O0020 ;

M98P0030 ; 

M99 ;

Subprogram 

(One-level 
nesting) 

(Two-level 
nesting) 

(Nine-level 
nesting) 

Subprogram

Subprogram

O0100 ; 

M99 ; 

(Ten-level 
nesting) 

Subprogram 

M98P0100 ; 

 

A single call command can repeatedly call a subprogram up to 
99999999 times. For compatibility with automatic programming 
systems, in the first block, Nxxxxxxxx can be used instead of a 
subprogram number that follows O (or :). A sequence number after N 
is registered as a subprogram number.   
 

NOTE 

1  The M98 and M99 code signal and strobe signal 

are not output to the machine tool. 

2  If the subprogram number specified by address P 

cannot be found, an alarm PS0078 is output. 

3  When an attempt is made to call a subprogram by 

file name, but the specified file cannot be found, 
alarm PS0310 is issued. 

 

Example 

 

-   M98 P51002 ;  

-      X1000.0 M98 P1200 ; 

-      Execution sequence of subprograms called from a main program 

A subprogram can call another subprogram in the same way as a main 
program calls a subprogram. 

This command specifies "Call the subprogram (number 1002) five times in 
succession." A subprogram call command (M98P_) can be specified in the 
same block as a move command. 

      This example calls the subprogram (number 1200) after an X movement.

1 2 3

Main program

N0010 . . . ;
N0020 . . . ;
N0030 M98 P21010 ; 
N0040 . . . ;
N0050 M98 P1010 ; 
N0060 . . . ;

Subprogram 

O1010 . . . ; 
N1020 . . . ; 
N1030 . . . ; 
N1040 . . . ; 
N1050 . . . ; 
N1060 . . . M99 ; 

 

 

B-63944EN/03

 PROGRAMMING 

13.PROGRAM CONFIGURATION

 

 

- 347 - 

Special usage 
  - Specifying the sequence number for the return destination in the main program 

If P is used to specify a sequence number when a subprogram is 
terminated, control does not return to the block after the calling block, 
but returns to the block with the sequence number specified by P.  
Note, however, that P is ignored if the main program is operating in a 
mode other than memory operation mode. 
This method consumes a much longer time than the normal return 
method to return to the main program. 
 

Subprogram 

O0010 . . . ; 

N1020 . . . ; 

N1030 . . . ; 

N1040 . . . ; 

N1050 . . . ; 

N1060 . . . M99 P0060 ; 

Main program 

N0010 . . . ;

N0020 . . . ;

N0030 M98 P1010 ;

N0040 . . . ;

N0050 . . . ;

N0060 . . . ;

 

 

  - Using M99 in the main program 

If M99 is executed in a main program, control returns to the start of 
the main program. For example, M99 can be executed by placing 
/M99 ; at an appropriate location of the main program and setting the 
optional block skip function to off when executing the main program.   
When M99 is executed, control returns to the start of the main 
program, then execution is repeated starting at the head of the main 
program. 
Execution is repeated while the optional block skip function is set to 
off.  
If the optional block skip function is set to on, the /M99 ; block is 
skipped ; control is passed to the next block for continued execution. 
If/M99Pn ; is specified, control returns not to the start of the main 
program, but to sequence number n. In this case, a longer time is 
required to return to sequence number n. 

 

N0010 . . . ; 

N0020 . . . ; 

N0030 . . . ; 

N0040 . . . ; 

N0050 . . . ; 

N0060 . . . M99 P0030 ; 

N0070 . . . ; 

N0080 M02 ;

/

Optional block skip 
ON 

Optional block skip 
OFF

 

 

 

 

 

 

 

 

 

Content      ..     46      47      48      49     ..