Index Manuals FANUC Series Series 16i-TB, Series 18i-TB, Series 160i-TB, Series 180i-TB. OPERATOR’S MANUAL (B-63524EN/01)
|
|
|
B-63524EN/01
PROGRAMMING
10. TOOL FUNCTION (T FUNCTION)
Explanations
D Specification by duration
A tool life is specified either as the time of use (in minutes) or the
or number of times the
frequency of use, which depends on the parameter setting parameter No.
tool has been used
6800#2 (LTM) .
Up to 4300 minutes in time or 9999 times in frequency can be specified
for a tool life.
D Maximum number of
The number of groups to be registered and the number of tools registered
groups and tools
per group can be combined in three ways. One of the three combinations
is set by a parameter No. 6800#0, #1 (Each GS1 and GS2).
Table 10.2.1 (b) The max. number of groups and tools that can be registered
The Max. number of groups and tools
The Max. number of groups and tools
GS2
GS1
without optional function of 128 tool pairs
with optional function of 128 tool pairs
(No.6800#1)
(No.6800#0)
Number of group
Number of tool
Number of group
Number of tool
0
0
16
16
16
32
0
1
32
8
32
16
1
0
64
4
64
8
1
1
16
16
128
4
In each of the cases listed above, the maximum number of tools which can
be registered is 512 or 256 depending, respectively, on whether the option
for 128 tool life control groups is used or not. When the option is not used,
set the parameters as follows: For up to 16 groups, with up to 16 tools
in each group, set GS1 = 0 and GS2 = 0. For up to 32 groups, with up to
8 tools in each group, set GS1 = 0 and GS2 = 1. To change the
combination, change the parameter, then set program is executed with the
old tool group combination set in the NC. Whenever the parameter is
changed, be sure to reexecute the group setting program.
D A T code for registering
The same tool number may appear anywhere any times in the program of
tools
tool life data.
A T code for registering tools can usually consist of up to four digits.
When the option for 128 tool life control groups is used, however, it can
consist of up to six digits.
T ffff
ff
Tool offset number
Tool selection
When using the tool life control function, do not use tool position offset
parameters LD1 and LGN (bits 0 and 1 of parameter No. 5002).
129
10. TOOL FUNCTION (T FUNCTION)
PROGRAMMING
B-63524EN/01
Example
O0001 ;
G10L3 ;
P001L0150 ;
T0011 ;
Data of group 1
T0132 ;
T0068 ;
P002L1400 ;
T0061;
T0241 ;
Data of group 2
T0134;
T0074;
P003L0700 ;
T0012;
Data of group 3
T0202 ;
G11 ;
M02 ;
Explanations
The group numbers specified in P need not be serial. They need not be
assigned to all groups, either. When using two or more offset numbers
for the same tool in the same process, set as follows;
Tape format
Meaning
P004L0500;
The tools in group 4 are used from (1)
T0101;
to (2) to (3).
T0105;
(1)
Each tool is used 500 times (or for
T0108;
500 minutes).
T0206;
When this group is specified three
T0203;
times in one process, the offset num-
T0202;
(2)
bers are selected in the following or-
T0209;
ders:
T0304;
Tools (1): 01→05→08
T0309;
(3)
Tools (2): 06→03→02→09
P005L1200;
Tools (3): 04→09
T0405;
130
B-63524EN/01
PROGRAMMING
10. TOOL FUNCTION (T FUNCTION)
10.2.2
Counting a Tool Life
Explanation
D When a tool life is
Between T∆∆99(∆∆=Tool group number) and T∆∆88 in a machining
specified as the time of
program, the time for which the tool is used in the cutting mode is counted
use (in minutes)
at intervals of 4 seconds. The time taken for single-block stoppage, feed
hold, rapid traverse, dwelling, and FIN wait is ignored.
Up to 4300 minutes can be specified for a life.
D When a tool life is
Counting is performed for each process that is initiated by the cycle start
specified as the
of a machining program and ended when the NC is reset by the M02 or
frequency of use
M03 command. The counters for tool groups used in a process are
incremented by one. Even when the same group is specified more than
once in one process, the counter is incremented only by one. Up to 9999
can be set for a tool life.
Counting of a tool life is performed for each group. The life counter
contents are not erased even when the power of CNC is cut off.
When a life is specified as the frequency of use, apply an external reset
(ERS) signal to the CNC when M02 or M30 is executed.
131
10. TOOL FUNCTION (T FUNCTION)
PROGRAMMING
B-63524EN/01
10.2.3
In machining programs, T codes are used to specify tool groups as
follows:
Specifying a Tool
Group in a Machining
Tape format
Meaning
Program
Tnn99;
Ends the tool used by now, and starts to use the tool of
the ∆∆group. “99” distinguishes this specification
from ordinary specification.
Tnn88;
Cancels the offset of the tool of the group. “88” distin-
guishes this specification from ordinary specification.
M02(M300);
Ends the machining program.
Explanations
Tape format
Meaning
T0199;
Ends the previous tool, and starts to use the tool of
the 01 group.
T0188;
Cancels the offset of the tool of the 01 group.
T0508;
Ends the tool of the 01 group. Selects tool number
05 and offset number 08.
T0500;
Cancels the offset of tool number 05.
T0299;
Ends tool number 05, and starts to use the tool of
the 02 group.
T0199;
Ends the tool of the 02 group, and starts to use the
tool of the 01 group. If more than one offset number
is specified for the tool, the second offset number is
selected. Otherwise, the previous offset number is
used.
132
B-63524EN/01
PROGRAMMING
11. AUXILIARY FUNCTION
AUXILIARY FUNCTION
11
There are two types of auxiliary functions; miscellaneous function (M
code) for specifying spindle start, spindle stop program end, and so on,
and secondary auxiliary function (B code).
When a move command and miscellaneous function are specified in the
same block, the commands are executed in one of the following two ways:
i) Simultaneous execution of the move command and miscellaneous
function commands.
ii) Executing miscellaneous function commands upon completion of
move command execution.
The selection of either sequence depends on the machine tool builder’s
specification. Refer to the manual issued by the machine tool builder for
details.
133
11. AUXILIARY FUNCTION
PROGRAMMING
B-63524EN/01
When address M followed by a number is specified, a code signal and
11.1
strobe signal are transmitted. These signals are used for turning on/off the
AUXILIARY
power to the machine.
FUNCTION
In general, only one M code is valid in a block but up to three M codes
(M FUNCTION)
can be specified in a block (although some machines may not allow that).
The correspondence between M codes and functions is up to the machine
tool builder.
All M codes are processed in the machine except for M98, M99,M198,
M codes for calling a subprogram (parameters Nos. 6071 to 6079), and
M codes for calling a custom macro (parameters Nos. 6080 to 6089).
Refer to the appropriate manual issued by the machine tool builder.
Explanations
The following M codes have special meanings.
D M02,M03
This indicates the end of the main program
(End of program)
Automatic operation is stopped and the CNC unit is reset. This differs
with the machine tool builder. After a block specifying the end of the
program is executed,control returns to the start of the program. Bit 5 of
parameter No. 3404 (M02) or bit 4 of parameter No. 3404 (M03) can be
used to disable M02 or M03 from returning control to the start of the
program.
D M00
Automatic operation is stopped after a block containing M00 is executed.
(Program stop)
When the program is stopped, all existing modal information remains
unchanged. The automatic operation can be restarted by actuating the
cycle operation. This differs with the machine tool builder.
D M01
Similarly to M00, automatic operation is stopped after a block containing
(Optional stop)
M01 is executed. This code is only effective when the Optional Stop
switch on the machine operator’s panel has been pressed.
D M98
This code is used to call a subprogram. The code and strobe signals are
(Calling of subprogram)
not sent. See the subprogram section II-13.3 for details .
D M99
This code indicates the end of a subprogram.
(End of subprogram)
M99 execution returns control to the main program. No code or strobe
signal is sent. See the subprogram section II-13.3 for details.
D M198
This code is used to call a subprogram of a file in the external input/output
(Calling a subprogram)
function. See the description of the subprogram call function (III-4.5) for
details.
NOTE
A block immediately after an M00, M01, M02, or M03 block
is not buffered. Similarly, ten M codes which do not buffer
can be set by parameters (Nos. 3411 to 3421). Refer to the
machine tool builder’s instruction manual for these M codes.
134
B-63524EN/01
PROGRAMMING
11. AUXILIARY FUNCTION
So far, one block has been able to contain only one M code. Up to three
11.2
M codes can be specified in a single block when bit 7 (M3B) of parameter
MULTIPLE M
No. 3404 is set to 1.
COMMANDS IN A
Up to three M codes specified in a block are simultaneously output to the
SINGLE BLOCK
machine. This means that compared with the conventional method of a
single M command in a single block, a shorter cycle time can be realized
in machining.
Explanations
CNC allows up to three M codes to be specified in one block. However,
some M codes cannot be specified at the same time due to mechanical
operation restrictions. For detailed information about the mechanical
operation restrictions on simultaneous specification of multiple M codes
in one block, refer to the manual of each machine tool builder.
M00, M01, M02, M30, M98, M99, or M198 must not be specified
together with another M code.
Some M codes other than M00, M01, M02, M30, M98, M99, and M198
cannot be specified together with other M codes; each of those M codes
must be specified in a single block.
Such M codes include these which direct the CNC to perform internal
operations in addition to sending the M codes themselves to the machine.
To be specified, such M codes are M codes for calling program numbers
9001 to 9009 and M codes for disabling advance reading (buffering) of
subsequent blocks. Meanwhile, multiple of M codes that direct the CNC
only to send the M codes themselves (without performing internal
operations) can be specified in a single block.
Examples
Multiple M commands in a single
One M command in a single block
block
M40 ;
M40M50M60 ;
M50 ;
G28G91X0Z0 ;
M60 ;
:
G28G91X0Z0 ;
:
:
:
:
:
:
:
135
11. AUXILIARY FUNCTION
PROGRAMMING
B-63524EN/01
The M code group check function checks if a combination of multiple M
11.3
codes (up to three M codes) contained in a block is correct.
M CODE GROUP
This function has two purposes. One is to detect if any of the multiple M
CHECK FUNCTION
codes specified in a block include an M code that must be specified alone.
The other purpose is to detect if any of the multiple M codes specified in
a block include M codes that belong to the same group. In either of these
cases, P/S alarm No. 5016 is issued.
For details on group data setting, refer to the manual available from the
machine tool builder.
Explanations
D M code setting
Up to 500 M codes can be specified. In general, M0 to M99 are always
specified. M codes from M100 and up are optional.
D Group numbers
Group numbers can be set from 0 to 127. Note, however, that 0 and 1 have
special meanings. Group number 0 represents M codes that need not be
checked. Group number 1 represents M codes that must be specified
alone.
136
B-63524EN/01
PROGRAMMING
11. AUXILIARY FUNCTION
Indexing of the table is performed by address B and a following 8-digit
11.4
number. The relationship between B codes and the corresponding
THE SECOND
indexing differs between machine tool builders.
AUXILIARY
Refer to the manual issued by the machine tool builder for details.
FUNCTIONS
(B CODES)
Explanations
D Command range
0 to 99999999
D Command method
1. The decimal point can be used for input.
Command Output value
B10.
10000
B10
10
2. It is possible to change over the scale factor of B output, 1000 or 1
when the decimal point input is omitted, using the parameter DPI (No.
3401#0).
Command Output value
When DPI is 1: B1
1000
When DPI is 0: B1
1
3. It is possible to change over the scale factor of B output 1000 or 10000
when the decimal point input is omitted in the inch input system, using
the parameter AUX (No. 3405#0) When DPI=1.
Command Output value
When AUX is 1: B1
10000
When AUX is 0: B1
1000
Restrictions
When this functions is used, the B address specifying an axis movement
disabled.
137
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
PROGRAM CONFIGURATION
12
General
D Main program and
There are two program types, main program and subprogram. Normally,
subprogram
the CNC operates according to the main program. However, when a
command calling a subprogram is encountered in the main program,
control is passed to the subprogram. When a command specifying a
return to the main program is encountered in a subprogram, control is
returned to the main program.
Main program
Subprogram
Instruction 1
Instruction 1Ȁ
Instruction 2
Instruction 2Ȁ
Follow the direction of the
subprogram
Instruction n
Instruction n+1
Return to the main program
Fig. 12 (a) Main program and Subprogram
The CNC memory can hold up to 400 main programs and subprograms
(63 as standard). A main program can be selected from the stored main
programs to operate the machine. See III-10 and III-9.3 for the methods
of registering and selecting programs.
138
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
D Program components
A program consists of the following components:
Table 12 Program components
Components
Descriptions
Tape start
Symbol indicating the start of a program file
Leader section
Used for the title of a program file, etc.
Program start
Symbol indicating the start of a program
Program section
Commands for machining
Comment section
Comments or directions for the operator
Tape end
Symbol indicating the end of a program file
Leader section
Tape start
% TITLE ;
Program start
O0001 ;
(COMMENT)
Program section
Comment section
M30 ;
%
Tape end
Fig. 12 (b) Program configuration
D Program section
A program section consists of several blocks. A program section starts
configuration
with a program number and ends with a program end code.
Program section Program section
configuration
Program number O0001 ;
Block 1
N1 G91 G00 X120.0 Y80.0 ;
Block 2
N2 G43 Z-32.0 H01 ;
:
:
Block n
Nn Z0 ;
Program end
M30 ;
A block contains information necessary for machining, such as a move
command or coolant on/off command.Specifying a value following a
slash (/) at the start of a block disables the execution of some blocks (see
“optional block skip” in Section II-12.2).
139
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
This section describes program components other than program sections.
12.1
See Section II-12.2 for a program section.
PROGRAM
Leader section
COMPONENTS
OTHER THAN
Tape start
% TITLE ;
Program start
PROGRAM
O0001 ;
SECTIONS
(COMMENT)
Comment section
Program section
M30 ;
%
Tape end
Fig. 12.1 Program configuration
Explanations
D Tape start
The tape start indicates the start of a file that contains CNC programs.
The mark is not required when programs are entered using SYSTEM P
or ordinary personal computers. The mark is not displayed on the display
screen. However, if the file is output,the mark is automatically output at
the start of the file.
Table 12.1 (a) Code of a tape start
ISO
EIA
Name
Notation in this manual
code
code
Tape start
%
ER
%
D Leader section
Data entered before the programs in a file constitutes a leader section.
When machining is started, the label skip state is usually set by turning
on the power or resetting the system. In the label skip state, all
information is ignored until the first end-of-block code is read. When a
file is read into the CNC unit from an I/O device, leader sections are
skipped by the label skip function.
A leader section generally contains information such as a file header.
When a leader section is skipped, even a TV parity check is not made.
So a leader section can contain any codes except the EOB code.
D Program start
The program start code is to be entered immediately after a leader section,
that is, immediately before a program section. This code indicates the
start of a program, and is always required to disable the label skip
function.
With SYSTEM P or ordinary personal computers, this code can be entered
by pressing the return key.
Table 12.1 (b) Code of a program start
ISO
EIA
Name
Notation in this manual
code
code
Program start
LF
CR
;
140
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
NOTE
If one file contains multiple programs, the EOB code for
label skip operation must not appear before a second or
subsequent program number. However, an program start
is required at the start of a program if the preceding program
ends with %.
D Comment section
Any information enclosed by the control-out and control-in codes is
regarded as a comment and skipped by the CNC. The user can enter a
header, comments, directions to the operator, etc. There is no limit on the
length of a comment section.
Table 12.1 (c) Codes of a control-in and a control-out
ISO
EIA
Notation in this
Name
Meaning
code
code
manual
Control-out
(
2-4-5
(
Start of comment section
Control-in
)
2-4-7
)
End of comment section
When a program is read into memory for memory operation, comment
sections, if any, are not ignored but are also read into memory. Note,
however, that codes other than those listed in the code table in Appendix
F are ignored, and thus are not read into memory. When the program in
this memory is output to an external input/output device (see Section
III-8), any comments are also output.
When a program is displayed on the screen, its comment sections are also
displayed. However, those codes that were ignored when read into
memory are not outputted or displayed.
During memory operation or DNC operation, all comment sections are
ignored.
The TV check function can be used for a comment section by setting
parameter CTV (bit 1 of No. 0100).
CAUTION
If a long comment section appears in the middle of a
program section, a move along an axis may be suspended
for a long time because of such a comment section. So a
comment section should be placed where movement
suspension may occur or no movement is involved.
NOTE
1
If only a control-in code is read with no matching
control-out code, the read control-in code is ignored.
2
The EOB code cannot be used in a comment.
141
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
D Tape end
A tape end is to be placed at the end of a file containing NC programs.
If programs are entered using the automatic programming system, the
mark need not be entered. The mark is not displayed on the CRT display
screen. However, when a file is output, the mark is automatically output
at the end of the file.
If an attempt is made to execute % when M02 or M03 is not placed at the
end of the program, the P/S alarm (No. 5010) is occurred.
Table 12.1 (d) Code of a tape end
Name
ISO
EIA
Notation in this
code
code
manual
Tape end
%
ER
%
142
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
This section describes elements of a program section. See Section II-12.1
12.2
for program components other than program sections.
PROGRAM SECTION
CONFIGURATION
% TITLE ;
Program number
O0001 ;
N1 … ;
Sequence number
(COMMENT)
Program section
Program end
M30 ;
%
Fig. 12.2 (a) Program configuration
D Program number
A program number consisting of address O followed by a four-digit
number is assigned to each program at the beginning registered in
memory to identify the program.
When the 8-digit program number option is used, however, specify eight
digits for the program number (see Section II.12.4).
In ISO code, the colon ( : ) can be used instead of O.
When no program number is specified at the start of a program, the
sequence number (N
) at the start of the program is regarded as its
program number. If a five-digit sequence number is used, the lower four
digits are registered as a program number. If the lower four digits are all
0, the program number registered immediately before added to 1 is
registered as a program number. Note, however, that N0 cannot be used
for a program number.
If there is no program number or sequence number at the start of a
program, a program number must be specified using the MDI panel when
the program is stored in memory (See Section 8.4 or 10.1 in Part III.).
NOTE
Program numbers 8000 to 9999 may be used by machine
tool builders, and the user may not be able to use these
numbers.
143
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
D Sequence number and
A program consists of several commands. One command unit is called
block
a block. One block is separated from another with an EOB of end of block
code.
Table 12.2 (a) EOB code
Name
ISO
EIA
Notation in this
code
code
manual
End of block (EOB)
LF
CR
;
At the head of a block, a sequence number consisting of address N
followed by a number not longer than five digits (1 to 99999) can be
placed. Sequence numbers can be specified in a random order, and any
numbers can be skipped. Sequence numbers may be specified for all
blocks or only for desired blocks of the program. In general, however, it
is convenient to assign sequence numbers in ascending order in phase
with the machining steps (for example, when a new tool is used by tool
replacement, and machining proceeds to a new surface with table
indexing.)
N300 X200.0 Z300.0 ; A sequence number is underlined.
Fig. 12.2 (b) Sequence number and block (example)
NOTE
N0 must not be used for the reason of file compatibility with
other CNC systems.
Program number 0 cannot be used. So 0 must not be used
for a sequence number regarded as a program number.
D TV check (Vertical parity
A parity check is made for a block on input tape vertically. If the number
check along tape)
of characters in one block (starting with the code immediately after an
EOB and ending with the next EOB) is odd, an P/S alarm (No.002) is
output. No TV check is made only for those parts that are skipped by the
label skip function. Bit 1 (CTV) of parameter No. 0100 can be used to
specify whether the characters constituting comments, enclosed in “(” and
“)”, are counted when obtaining the number of characters for TV check.
The TV check function can be enabled or disabled by setting on the MDI
unit (See subsec. 11.4.7 in Part III.).
144
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
D Block configuration
A block consists of one or more words. A word consists of an address
(word and address)
followed by a number some digits long. (The plus sign (+) or minus sign
(-) may be prefixed to a number.)
Word = Address + number (Example : X-1000)
For an address, one of the letters (A to Z) is used ; an address defines the
meaning of a number that follows the address. Table 12.2 (b) indicates
the usable addresses and their meanings.
The same address may have different meanings, depending on the
preparatory function specification.
Table 12.2 (b) Major functions and addresses
Function
Address
Meaning
Program number
O (1)
Program number
Sequence number
N
Sequence number
Preparatory function
G
Specifies a motion mode (linear, arc,
etc.)
Dimension word
X, Y, Z, U, V,
Coordinate axis move command
W, A, B, C
I, J, K
Coordinate of the arc center
R
Arc radius
Feed function
F
Rate of feed per minute,
Rate of feed per revolution
Spindle speed function
S
Spindle speed
Tool function
T
Tool number
Auxiliary function
M
On/off control on the machine tool
B
Table indexing, etc.
Dwell
P, X, U
Dwell time
Program number
P
Subprogram number
designation
Number of
P
Number of subprogram repetitions
repetitions
Parameter
P, Q
Canned cycle parameter
NOTE
In ISO code, the colon ( : ) can also be used as the address
of a program number.
N_
G_
X_ Z_
F_
S_
T_
M_
;
Spindle
Se-
Preparatory
Dimension Feed-
Tool
Miscella-
speed
quence
function
word
function
func-
neous func-
function
number
tion
tion
Fig. 12.2 (c) 1 block (example)
145
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
D Major addresses and
Major addresses and the ranges of values specified for the addresses are
ranges of command
shown below. Note that these figures represent limits on the CNC side,
values
which are totally different from limits on the machine tool side. For
example, the CNC allows a tool to traverse up to about 100 m (in
millimeter input) along the X axis.
However, an actual stroke along the X axis may be limited to 2 m for a
specific machine tool.
Similarly, the CNC may be able to control a cutting federate of up to 240
m/min, but the machine tool may not allow more than 3 m/min. When
developing a program, the user should carefully read the manuals of the
machine tool as well as this manual to be familiar with the restrictions on
programming.
Table 12.2 (c) Major addresses and ranges of command values
Function
Address
Input in mm
Input in inch
Program number
O (1)
1-9999
1-9999
Sequence number
N
1-99999
1-99999
Preparatory function
G
0-99
0-99
Dimen-
Increment
X, Y, Z,
-99999.999 to
-9999.9999 to
sion
system IS-B
U, V, W,
+99999.999
+9999.9999
word
A, B, C, I,
Increment
-9999.9999 to
-999.99999 to
J, K, R,
system IS-C
+9999.9999
+999.99999
Feed
Increment
F
1 to 240000
0.01 to 9600.00
per
system IS-B
mm/min
inch/min
minute
Increment
1 to 100000
0.01 to 4000.00
system IS-C
mm/min
inch/min
Feed per revolution
F
0.0001 to
0.000001 to
500.0000
9.999999
mm/rev
inch/rev
Spindle speed function
S
0 to 20000
0 to 20000
Tool function
T
0 to 99999999
0 to 99999999
Auxiliary function
M
0 to 99999999
0 to 99999999
B
0 to 99999999
0 to 99999999
Dwell
Increment
P, X, U
0 to 99999.999s
0 to 99999.999s
system IS-B
Increment
0 to 9999.9999s
0 to 9999.9999s
system IS-C
Designation of a
P
1 to 9999
1 to 9999
program number
Number of repetitions
P
1 to 999
1 to 999
NOTE
In ISO code, the colon (:) can also be used as the address
of a program number.
146
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
D 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 switch n on the machine operator panel
is set to on, the information contained in the block for which
/n
corresponding to switch number n is specified is ignored in tape operation
or memory operation.
When optional block skip switch n is set to off, the information contained
in the block for which /n is specified is valid. This means that the operator
can determine whether to skip the block containing /n.
Number 1 for /1 can be omitted. However, when two or more optional
block skip switches are used for one block, number 1 for /1 cannot be
omitted.
Example)
(Incorrect)
(Correct)
//3 G00X10.0;
/1/3 G00X10.0;
This function is ignored when programs are loaded into memory. Blocks
containing /n are also stored in memory, regardless of how the optional
block skip switch is set.
Programs held in memory can be output, regardless of how the optional
block skip switches are set.
Optional block skip is effective even during sequence number search
operation.
Depending on the machine tool, all optional block skip switches (1 to 9)
may not be usable. Refer to manuals of the machine tool builder to find
which switches are usable.
WARNING
1
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.
2
Disabling an optional block skip switch
Optional block skip operation is processed when blocks are
read from memory or tape into a buffer. Even if a switch is
set to on after blocks are read into a buffer, the blocks
already read are not ignored.
NOTE
TV and TH check
When an optional block skip switch is on. TH and TV checks
are made for the skipped portions in the same way as when
the optional block skip switch is off.
147
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
D Program end
The end of a program is indicated by punching one of the following codes
at the end of the program:
Table 12.2 (d) Code of a program end
Code
Meaning usage
M02
For main program
M30
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.
WARNING
A block containing an optional block skip code such as /M02
; , /M30 ; , or /M99 ; is not regarded as the end of a program,
if the optional block skip switch on the machine operator’s
panel is set to on.
(See item “Optional block skip”.)
148
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
If a program contains a fixed sequence or frequently repeated pattern, such
12.3
a sequence or pattern can be stored as a subprogram in memory to simplify
SUBPROGRAM
the program.
(M98, M99)
A subprogram can be called from the main program.
A called subprogram can also call another subprogram.
Format
D Subprogram
configuration
One subprogram
O jjjj ;
Subprogram number
(or the colon (:) optionally in the case of ISO)
M99 ;
Program end
M99 need not constitute a separate block as indicated below.
Example) X100.0 Y100.0 M99 ;
D Subprogram call (M98)
M98 P ffff ffff ;
↑
↑
Number of times
Subprogram
the subprogram is
number
called repeatedly
When no repetition data is specified, the subprogram is called just once.
Explanations
When the main program calls a subprogram, it is regarded as a one-level
subprogram call. Thus, subprogram calls can be nested up to four levels
as shown below.
Main program
Subprogram
Subprogram
Subprogram
Subprogram
O0001
O1000
O2000
O3000
O4000
;
;
;
;
;
M98P1000
;
M98P2000
;
M98P3000
M98P4000
;
;
M30 ;
M99 ;
M99 ;
M99 ;
M99 ;
(One-level nesting)
(Two-level nesting)
(Three-level nesting)
(Four-level nesting)
A single call command can repeatedly call a subprogram up to 9999 times.
For compatibility with automatic programming systems, in the first
block, Nxxxx can be used instead of a subprogram number that follows
O (or :). A sequence number after N is registered as a subprogram number.
Reference item
See Chapter 10 in Part III for the method of registering a subprogram.
149
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
NOTE
1
The M98 and M99 signals are not output to the machine
tool.
2
If the subprogram number specified by address P cannot be
found, an alarm (No. 078) is output.
Examples
l M98 P51002 ;
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.
l X1000.0 M98 P1200 ;
This example calls the subprogram (number 1200) after an X movement.
l Execution sequence of subprograms called from a main program
Main program
Subprogram
1
2
3
N0010 ;
O1010 ;
N0020 ;
N1020 ;
N0030 M98 P21010 ;
N1030 ;
N0040 ;
N1040 ;
N0050 M98 P1010 ;
N1050 ;
N0060 ;
N1060 M99 ;
A subprogram can call another subprogram in the same way as a main
program calls a subprogram.
Special Usage
D Specifying the sequence
If P is used to specify a sequence number when a subprogram is
number for the return
terminated, control does not return to the block after the calling block, but
destination in the main
returns to the block with the sequence number specified by P. Note,
program
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.
Main program
Subprogram
N0010 … ;
O0010 … ;
N0020 … ;
N1020 … ;
N0030 M98 P1010 ;
N1030 … ;
N0040 … ;
N1040 … ;
N0050 … ;
N1050 … ;
N0060 … ;
N1060 M99 P0060 ;
150
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
D Using M99 in the main
If M99 is executed in a main program, control returns to the start of the
program
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 … ;
Optional block skip
N0050 … ;
/
N0060 M99 P0030 ;
Optional block
OFF
N0070 … ;
skip
N0080 M02 ;
ON
D Using a subprogram only
A subprogram can be executed just like a main program by searching for
the start of the subprogram with the MDI.
(See Section 9.4 in Part III for information about search operation.)
In this case, if a block containing M99 is executed, control returns to the
start of the subprogram for repeated execution. If a block containing
M99Pn is executed, control returns to the block with sequence number n
in the subprogram for repeated execution. To terminate this program, a
block containing /M02 ; or /M30 ; must be placed at an appropriate
location, and the optional block switch must be set to off ; this switch is
to be set to on first.
N1010 … ;
N1020 … ;
N1030 … ;
N1040 M02 ;
Optional block skip
/
N1050 M99 P1020 ;
ON
151
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
The 8-digit program number function enables specification of program
12.4
numbers with eight digits following address O
(O00000001 to
8-DIGIT PROGRAM
O99999999).
NUMBER
Explanations
D Inhibiting editing of
Editing of subprograms O00008000 to O00008999, O00009000 to
programs
O00009999, O80000000 to O89999999, and O90000000 to O99999999
can be inhibited.
Parameter
Program numbers for which editing is disabled
NE8(No.3202#0)
O00008000 to O00008999
NE9(No.3202#4)
O00009000 to O00009999
PRG8E(No.3204#3)
O80000000 to O89999999
PRG9E(No.3204#4)
O90000000 to O99999999
NOTE
When a wrong password has been specified for the
password function (see III-9.9), the settings of NE9 (bit 3 of
parameter No. 3202) and PQE (bit 4 of parameter No. 3204)
cannot be changed.
D File name
For program punch by specifying a range, files are named as follows:
When punching by specifying O00000001 and O00123456:
“O00000001-G”
When punching by specifying O12345678 and O45678900:
“O12345678-G”
When 2-path control is being applied, the file name for the first path is
suffixed with “-1” and that for the second path is suffixed with “-2.”
D Special programs
Special subprogram numbers can be changed by using bit 5 (SPR) of
parameter No. 3204.
1) Macro call using G code
Program number
Parameter used to
specify G code
When SPR = 0
When SPR = 1
No.6050
O00009010
O90009010
No.6051
O00009011
O90009011
No.6052
O00009012
O90009012
No.6053
O00009013
O90009013
No.6054
O00009014
O90009014
No.6055
O00009015
O90009015
No.6056
O00009016
O90009016
No.6057
O00009017
O90009017
No.6058
O00009018
O90009018
No.6059
O00009019
O90009019
152
B-63524EN/01
PROGRAMMING
12. PROGRAM CONFIGURATION
2) Macro call using M code
Program number
Parameter used to
specify M code
When SPR = 0
When SPR = 1
No.6080
O00009020
O90009020
No.6081
O00009021
O90009021
No.6082
O00009022
O90009022
No.6083
O00009023
O90009023
No.6084
O00009024
O90009024
No.6085
O00009025
O90009025
No.6086
O00009026
O90009026
No.6087
O00009027
O90009027
No.6088
O00009028
O90009028
No.6089
O00009029
O90009029
3) Subprogram call using M code
Program number
Parameter used to
specify M code
When SPR = 0
When SPR = 1
No.6071
O00009001
O90009001
No.6072
O00009002
O90009002
No.6073
O00009003
O90009003
No.6074
O00009004
O90009004
No.6075
O00009005
O90009005
No.6076
O00009006
O90009006
No.6077
O00009007
O90009007
No.6078
O00009008
O90009008
No.6079
O00009009
O90009009
4) Macro call using T code
Program number
Parameter used to
specify T code
When SPR = 0
When SPR = 1
TCS(No.6001#5)
O00009000
O90009000
5) Macro call using ASCII code
Program number
Parameter used to
specify ASCII code
When SPR = 0
When SPR = 1
No.6090
O00009004
O90009004
No.6091
O00009005
O90009005
153
12. PROGRAM CONFIGURATION
PROGRAMMING
B-63524EN/01
6) Pattern data function
Program numaber
When SPR = 0
When SPR = 1
O00009500
O90009500
O00009501
O90009501
O00009502
O90009502
O00009503
O90009503
O00009504
O90009504
O00009505
O90009505
O00009506
O90009506
O00009507
O90009507
O00009508
O90009508
O00009509
O90009509
O00009510
O90009510
D External program
External input signals can be used to search for a program number. A
number search
program stored in CNC memory can be selected by externally inputting
a program number, between 1 and 99999999, to the CNC. For details,
refer to the appropriate manual supplied from the machine tool builder.
Limitations
D Subprogram call
This function disables subprogram call unless FS15 tape format (see
II-19) is used. This restriction also applies to calling a program in
external I/O devices (M198).
(Example)
M98 P12345678 ;
Subprogram number only
The repetition count is not included.
D DNC
O8-digit program number can not be used in DNC1, DNC2, ethernet,
data server, OPEN CNC, CONVERSATIONAL AUTOMATIC
PROGRAMMING FUNCTION.
154
13. FUNCTIONS TO SIMPLIFY
B-63524EN/01
PROGRAMMING
PROGRAMMING
FUNCTIONS TO SIMPLIFY PROGRAMMING
13
General
This chapter explains the following items:
13.1
CANNED CYCLE (G90, G92, G94)
13.2
MULTIPLE REPETITIVE CYCLE (G70-G76)
13.3
CANNED CYCLE FOR DRILLING (G80-G89)
13.4
CANNED GRINDING CYCLE
(FOR GRINDING MACHINE)
13.5
CHAMFERING AND CORNER R
13.6
MIRROR IMAGE FOR DOUBLE TURRET (G68, G69)
13.7
DIRECT DRAWING DIMENSIONS PROGRAMMING
13.8
RIGID TAPPING
13.9
THREE-DIMENSIONAL COORDINATE CONVERSION
(G68.1, G69.1)
NOTE
Explanatory diagrams in this chapter uses diameter
programming in X axis.
In radius programming, changes U/2 with U and X/2 with X.
155
13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
PROGRAMMING
B-63524EN/01
There are three canned cycles : the outer diameter/internal diameter
13.1
cutting canned cycle (G90), the thread cutting canned cycle (G92), and the
CANNED CYCLE
end face turning canned cycle (G94).
(G90, G92, G94)
13.1.1
Outer Diameter /
Internal Diameter
Cutting Cycle (G90)
D Straight cutting cycle
G90X (U)__Z (W)__F__ ;
R……Rapid traverse
F……Specified by F code
X axis
Z
W
4(R)
3(F)
1(R)
U/2
2(F)
X/2
Z axis
Fig. 13.1.1 (a) Straight Cutting Cycle
In incremental programming, the sign of the numbers following address
U and W depends on the direction of paths 1 and 2. In the cycle of 14.
1 1 (a), the signs of U and W are negative.
In single block mode, operations 1, 2, 3 and 4 are performed by pressing
the cycle start button once.
156
13. FUNCTIONS TO SIMPLIFY
B-63524EN/01
PROGRAMMING
PROGRAMMING
D Taper cutting cycle
G90X(U)__ Z(W)__ R__ F__ ;
R…Rapid traverse
F…Specified by F code
X axis
4(R)
3(F)
1(R)
U/2
2(F)
R
X/2
W
Z
Z axis
Fig. 13.1.1 (b) Taper Cutting Cycle
D Signs of numbers
In incremental programming, the relationship between the signs of the
specified in the taper
numbers following address U, W, and R, and the tool paths are as follows:
cutting cycle
1. U < 0, W < 0, R < 0
2. U > 0, W < 0, R > 0
X
X
Z
Z
W
4(R)
2(F)
U/2
3(F)
1(R)
R
R
U/2
3(F)
1(R)
2(F)
W
4(R)
3. U < 0, W < 0, R > 0
4. U > 0, W < 0, R<0
U
U
at | R | x |
|
at | R | x |
|
2
2
X
X
Z
Z
W
4(R)
R
1(R)
2(F)
U/2
3(F)
U/2
3(F)
2(F)
1(R)
R
W
4(R)
157
13. FUNCTIONS TO SIMPLIFY
PROGRAMMING
PROGRAMMING
B-63524EN/01
13.1.2
Thread Cutting Cycle
(G92)
G92X(U)__ Z(W)__ F__ ; Lead (L) is specified.
X axis
Z
W
4(R)
3(R)
1(R)
2(F)
X/2
Z axis
R…… Rapid traverse
F…… Specified by
F code
L
(The chamfered angle in the left figure
is 45 degrees or less because of the
delay in the servo system.
Approx. 45°
r
Detailed chamfered thread
Fig. 13.1.2 (a) Straight Thread Cutting
In incremental programming, the sign of numbers following addresses U
and W depends on the direction of paths 1 and 2. That is , if the direction
of path 1 is the negative along the X axis, the value of U is negative.
The range of thread leads, limitation of spindle speed, etc. are the same
as in G32 (thread cutting). Thread chamfering can be performed in this
thread cutting cycle. A signal from the machine tool, initiates thread
chamfering. The chamfering distance is specified in a range from 0.1L
to 12.7L in 0.1L increments by parameter (No. 5130).
(In the above
expression, L is the thread lead.)
In the single block mode, operations 1, 2, 3, and 4 are performed by
pressing cycle start button once.
158
|
|