GFZ-63323EN201, 15i 150i-A - Programming - (Macro Compiler - Executor)
GFZ-63323EN201, 15i 150i-A - Programming - (Macro Compiler - Executor)
Series 15i/150i-Model A
Programming Manual
(Macro Compiler/Macro Executor)
GFZ-63323EN-2/01 November 2000
GFL-001
Warnings, Cautions, and Notes
as Used in this Publication
Warning
Warning notices are used in this publication to emphasize that hazardous voltages, currents,
temperatures, or other conditions that could cause personal injury exist in this equipment or
may be associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a
Warning notice is used.
Caution
Caution notices are used where equipment might be damaged if care is not taken.
Note
Notes merely call attention to information that is especially significant to understanding and
operating the equipment.
This document is based on information available at the time of its publication. While efforts
have been made to be accurate, the information contained herein does not purport to cover all
details or variations in hardware or software, nor to provide for every possible contingency in
connection with installation, operation, or maintenance. Features may be described herein
which are not present in all hardware and software systems. GE Fanuc Automation assumes
no obligation of notice to holders of this document with respect to changes subsequently made.
This manual includes safety precautions for protecting the user and preventing damage to the
machine. Precautions are classified into Warnings and Cautions according to their bearing on safety.
Also, supplementary information is described as Notes. Read the Warnings, Cautions, and Notes
thoroughly before attempting to use the machine.
WARNING
Applied when there is a danger of the user being injured or when there
is a danger of both the user being injured and the equipment being
damaged if the approved procedure is not observed.
CAUTION
Applied when there is a danger of the equipment being damaged, if the
approved procedure is not observed.
NOTE
Notes are used to indicate supplementary information other than
Warnings and Cautions.
CONTENTS
1 GENERAL ................................................................
................................................................................................
.........................................................................................
......................................................... 1
3.1 General................................
General ................................................................
................................................................................................
................................................................................................
....................................................................
.................................... 12
3.2 Calling an Execution Macro ................................................................
................................................................................................
...................................................................
................................... 13
3.2.1 Simple call (G65).............................................................................................................. 16
3.2.2 Modal call (G66 or G66.1)................................................................................................ 17
3.2.3 Macro call using a G code................................................................................................ 17
3.2.4 Macro calls with G codes (Specification of Multiple G codes) ....................................... 18
3.2.5 Macro call using an M code ............................................................................................. 20
3.2.6 Macro call using a T code ................................................................................................ 21
3.2.7 Macro call using an axis address .................................................................................... 23
3.2.8 Subprogram call (M98) .................................................................................................... 27
3.2.9 Subprogram call using an M code................................................................................... 27
3.2.10 Subprogram call using an M code in the specified range.............................................. 28
3.2.11 Subprogram call using an S code.................................................................................... 29
3.2.12 Subprogram call using a T code ...................................................................................... 30
3.2.13 Subprogram call using a second auxiliary function code .............................................. 31
3.2.14 Subprogram call using a specific code ............................................................................ 32
3.2.15 Subprogram call for a user program............................................................................... 33
3.2.16 P-CODE workpiece number search ................................................................................ 33
3.3 Limitations on Execution Macros
Macros................................
................................................................
...........................................................................................
........................................................... 35
3.3.1 Commands that cannot be used in execution macros.................................................... 35
3.3.2 Functions which cannot use execution macros .............................................................. 35
3.3.3 Optional block skip .......................................................................................................... 35
c-1
CONTENTS B-63323EN-2/01
4 CONVERSATIONAL MAC
MACRO
RO (TALK MACRO) FUNCTION AND
AUXILIARY MACRO FUNCTION ................................................................
.................................................................................
................................................. 39
5 MACRO VARIABLES
VARIABLES................................
................................................................
................................................................................................
......................................................................
...................................... 54
6 MACRO
MACRO EXECUTOR FUNCTIONS ................................................................
...............................................................................
............................................... 70
c-2
B-63323EN-2/01 CONTENTS
c-3
CONTENTS B-63323EN-2/01
7.1 General................................
General ................................................................
................................................................................................
................................................................................................
..................................................................
.................................. 213
7.2 Displaying and Setting on the Debugger Screen................................
Screen ................................................................
.................................................................
................................. 214
7.3 Direct Setting by Parameter and Key ................................................................
..................................................................................
.................................................. 219
8 OPERATION ................................................................
................................................................................................
..................................................................................
..................................................221
..................221
9 PARAMETERS................................................................
................................................................................................
...............................................................................
...............................................237
...............237
c-4
B-63323EN-2/01 CONTENTS
10 APPENDIX ................................................................
................................................................................................
.....................................................................................
.....................................................255
.....................255
c-5
B-63323EN-2/01 1.GENERAL
1 GENERAL
Some NC programs such as programs created using custom
macros need not be modified once created. Others such as
machining programs differ depending on the machining
target.
This function can convert a custom macro program created
by the machine tool builder to an executable macro program,
load the executable macro program (P-CODE macro) into F-
ROM (FLASH ROM module), and execute it.
The function which converts a custom macro program to an
executable macro program is called the macro compiler.
The function which reads and executes a P-CODE macro is
called the macro executor.
Features
• The execution speed is high because a custom macro
program is loaded after converted to an executable so that
the machining time can be reduced and the machining
precision can be improved.
• Any custom macro is not destroyed because it is loaded
into F-ROM so that reliability is improved.
• Because any program converted to an executable is not
displayed on the program screen, the know-how the
machine tool builder has can be protected.
• Because executable macro programs are loaded into F-
ROM, program editing memory can efficiently be used.
• The users can call each executable macro program using a
simple call procedure without considering the loaded
program.
• A conversational macro (talk macro) function is available.
This function allows the machine tool builder to create
original screens.
• An auxiliary macro function is available. This function
can execute each P-CODE macro regardless of which mode
or screen is selected.
• Programming errors in each P-CODE macro to be
executed using the conversational macro (talk macro)
function or auxiliary macro function can easily be detected
using a debugging function.
-1-
1.GENERAL B-63323EN-2/01
Definitions of terms
Terms which appear in this manual are defined as follows.
-2-
B-63323EN-2/01 2.MACRO COMPILER AND MACRO EXECUTOR
-3-
2.MACRO COMPILER AND MACRO EXECUTOR B-63323EN-2/01
-4-
B-63323EN-2/01 2.MACRO COMPILER AND MACRO EXECUTOR
P-CODE file
LOAD
Compile
parameters
SAVE Conversion to
the memory
P-CODE Memory card card format
macro
F-ROM
P-CODE file
Compile&Link
8500=00100000
O9000; 8501=00000001
#1=#2+#5; :
:
M99;
CAUTION
To use a P-CODE file whose size is 512K bytes or
larger, an option is required. If a P-CODE file
loaded into the CNC is larger than the size allowed
by the option, the CNC does not start up with error
USER FILE(P-CODE):SIZE OVER.
-5-
2.MACRO COMPILER AND MACRO EXECUTOR B-63323EN-2/01
-6-
B-63323EN-2/01 2.MACRO COMPILER AND MACRO EXECUTOR
-7-
2.MACRO COMPILER AND MACRO EXECUTOR B-63323EN-2/01
Program number
The program number range is from 1 to 99999999.
Sequence number
The sequence number range is from 1 to 99999999.
• Caution
CAUTION
No sequence number must be added to any block
with an O number.
(The sequence number is invalidated if added.)
NOTE
For each macro executor function, there may be
limitations other than listed below. See the
explanation of each macro executor function.
Custom macro
Custom macro commands can be used for P-CODE macros,
but some commands cannot be used and some commands can
be used with restrictions as listed below.
-8-
B-63323EN-2/01 2.MACRO COMPILER AND MACRO EXECUTOR
EXAMPLE
Original program Command to be executed when
skipped
/1 N1 X100.; N1;
N2 /2 Y200.; N2;
CAUTION
An optional-block skip command can be executed in
execution, auxiliary, and conversational (talk)
macros. Carefully execute the command so that
the same optional-block skip signal will not be used.
-9-
2.MACRO COMPILER AND MACRO EXECUTOR B-63323EN-2/01
- 10 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
- 11 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
3.1 General
Execution macro
An execution macro is a loaded P-CODE macro which is
operated as a machining program.
M, S, T, and other call codes are set for parameters in
advance. When a set code is specified, the corresponding
execution macro is called. For an execution macro, the same
items as for a custom macro can be specified.
User program/
custom macro
A user program means an NC program loaded into program
memory or an NC program to be executed as an execution
macro caller during DNC or MDI operation.
- 12 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Simple calls and modal calls are also included in macro calls.
A simple call (also called a macro call) calls an execution
macro only in the specified block. A modal call calls an
execution macro in each block until G67 is specified.
Types of calls
Call Program number Remarks
Simple call (G65) Specified at No execution macro can
address P. be called from any user
program using this
command.
Modal call (G66 or G66.1) Specified at No execution macro can
address P. be called from any user
program using this
command.
Macro call using a G code O901 to O9019 Only G codes with no
decimal point can be used.
Modal calls are allowed.
Macro calls with G codes Set for Only G codes with no
(Specification of Multiple G parameters. decimal point can be used.
codes) Modal calls are allowed.
Macro call using an M code O9020 to O9029
Macro call using a T code O9008
Macro call using an axis O9009 or O9031
address to O9054
Subprogram call (M98) Specified at No execution macro can
address P. be called from any user
program using this
command.
- 13 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
- 14 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Priority of calls
When a call code is set together with a custom macro or
another call code, they are executed according to the priority
listed in the following table.
Priority Call
Macro call/subprogram call which calls a custom macro
High Simple call (G65)
↑ Modal call (G66 or G66.1)
Macro call using a G code
Macro calls with G codes (Specification of Multiple G codes)
Macro call using an M code
Macro call using a T code
Macro call using an axis address
Subprogram call (M98)
External device subprogram call (M198)(*2)
Subprogram call for a user program
Subprogram call using an M code
Subprogram call using an S code
Subprogram call using a T code
↓ Subprogram call using a second auxiliary function code
Low Subprogram call using a specific code
Subprogram call using an M code in the specified range
EXAMPLE
When M100 is set in a macro call using an M code
and a subprogram call using an M code, it operates
as a macro call using an M code if actually
executed.
- 15 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Nesting
Execution macro calls can be nested to a depth of ten levels
including only subprogram calls, to a depth of five levels
including only macro calls, or to a depth of ten levels
including subprogram calls and macro calls (to a depth of five
levels for macro calls). This does not include custom
macros.
Format
G65 Pp Ll <argument> ;
G65 : Call command. Must be specified before any argument.
P : Program number of an execution macro to be called
L : Repetition count (1 by default)
Argument : Data to be passed to the execution macro. Argument
specifications I and II are available.
Limitation
No execution macro can be called from any user program
using this command. This command can be specified only
for calling an execution macro from another execution macro.
- 16 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Format
G66 Pp Ll <argument> ;
G66 : Call command. Must be specified before any argument.
p : Program number of an execution macro to be called
l : Repetition count (1 by default)
argument : Data to be passed to the execution macro. Argument
specifications I and II are available. Arguments only in G66
blocks are passed to local variables.
G66.1 Pp Ll <argument> ;
G66.1 : Call command. Must be specified before argument.
p : Program number of an execution macro to be called
l : Repetition count (1 by default)
Argument : Data to be passed to the execution macro. Argument
specifications I and II are available.
Limitation
No execution macro can be called from any user program
using this command. This command can be specified only
for calling an execution macro from another execution macro.
Format
Gg Ll <argument> ;
g : Call code. Must be specified before any argument.
l : Repetition count (1 by default)
argument : Data to be passed to the execution macro. Argument
specifications I and II are available.
- 17 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Limitations
1 No macro call using a G code can be performed from any
macro called using a G code including a custom macro.
If such a macro call using a G code is specified, the code
operates as an ordinary G code.
Format
Gg Ll <argument> ;
g : Call code. Must be specified before any argument.
l : Repetition count (1 by default)
argument : Data to be passed to the execution macro. Argument
specifications I and II are available.
- 18 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Parameter setting
Parameter No. 8551: Start G code number
Parameter No. 8552: Start execution macro number
Parameter No. 8546: Number of definitions
EXAMPLE
When 900 is set for parameter No. 8551, 8000 is
set for parameter No. 8552, and 100 is set for
parameter No. 8546, the macro calls for the
following combinations are defined. When -900 is
set for parameter No. 8551, the modal calls for the
same combinations are defined.
G900 →O8000
G901 →O8001
G902 →O8002
:
G999 →O8099
Limitations
1 This type of macro call using a G code cannot be
performed from any macro called using a G code
including a custom macro. If such a macro call using a
G code is specified, the code operates as an ordinary G
code.
4 G65, G66, G67, and G codes used for macro calls are not
used as call commands in this type of macro call even
when included in the setting range.
- 19 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Format
Mm Ll <argument> ;
m : Call code. Must be specified before any argument.
l : Repetition count (1 by default)
argument : Data to be passed to the execution macro. Argument
specifications I and II are available.
Limitations
1 No macro call using an M code can be performed from
any macro or subprogram including a custom macro
called by a macro or subprogram call using an M, S, T,
second auxiliary function, or specific code, or axis
address. If such a macro call using an M code is
specified, the code operates as an ordinary M code.
- 20 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Format
Tt <argument> ;
t : Call code
argument : Data to be passed to the execution macro
Parameters
When bit 6 of parameter No. 8502 (TMC) and bit 2 of
parameter No. 8508 (TEC) are set to 1, this type of macro call
is enabled. These parameters are initialized to the values
set for P-CODE at power-on.
Variable
Variable #8691 can be used to enable or disable this type of
call and check the setting. The value set for this variable is
reflected in bit 0 of parameter No. 8603 (TCM).
NOTES
1 A value other than 0 or 1 cannot be set for this
variable.
2 It may take time until the value set for the variable is
reflected in bit 0 of parameter No. 8603 (TCM),
depending on the CNC operation status. Whether
this type of macro call is enabled or disabled
depends on the value set for the parameter when the
macro call is issued.
3 This variable can be written and referenced using an
execution macro, conversational macro (talk macro),
or auxiliary macro.
Call code
In contrast to a macro call using a G or M code, a T code in a
block is used as a call command unless another call command
is specified before the T code.
- 21 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
EXAMPLE
When a macro call using a T code and a
subprogram call using M100 are enabled for the
machine
a) T123 M06; Calls a macro using T123.
b) G01 X100. T123; Calls a macro using T123.
c) T123 M100; Calls a macro using T123.
d) M100 T123; Processes T123 as a T
code, then calls a
subprogram using M100.
Arguments
1 All addresses other than addresses O and N, and the
address for a subprogram call using a specific code that
can be specified for the target machine are used as
arguments.
When an address is specified with no decimal point, the
value passed to the local variable differs depending on
the setting of bit 5 of parameter No. 8558 (ACA) as
follows:
ACA = 0: Always passes the value as an integer.
= 1: Adds a decimal point according to the setting
of bit 0 of parameter No. 2400 (DPI).
- 22 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
EXAMPLE
When G91 G28 X123.45678 T999; is specified for
an IS-B machine, values are passed as follows:
#24 →123.457
#27 →999.0
#28 → 28.0
#29 → 91.0
Limitations
1 No macro call using a T code can be performed from any
macro or subprogram including a custom macro called by
a macro or subprogram call using an M, S, T, second
auxiliary function, or specific code, or axis address. If
such a macro call using a T code is specified, the code
operates as an ordinary T code.
Format
Xx <argument> ;
x : Call code
argument : Data to be passed to the execution macro
- 23 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Selecting axes
Select the target controlled axes for a macro call using each
bit of parameters Nos. 8555 to 8557 for each axis. These
parameters are initialized to the values set for P-CODE at
power-on.
For the target axes for a macro call, a macro call can also be
disabled using each bit of parameters Nos. 8600 to 8602 for
each axis for which the macro call is to be disabled as
required. These parameters can be changed using MDI
because they are ordinary parameters.
EXAMPLE
When parameter No. 8555 is set to 00000111 for a
machine having five axes, X, Y, Z, A, and C, a
macro call is enabled for X, Y, and Z axes.
When parameter No. 8600 is set to 00000101, a
macro call is disabled for X and Z axes.
Variable
Variable #8690 can be used to set and check each axis for
which this type of macro call is disabled. The value set for
this variable is reflected in parameters Nos. 8600 to 8602.
The following shows the relationships between variable
settings and parameter settings:
#8690
= 1: Disables the macro call for the first axis.
(Bit 0 of parameter No. 8600 = 1)
= 2: Disables the macro call for the second axis.
(Bit 1 of parameter No. 8600 = 1)
= 4: Disables the macro call for the third axis.
(Bit 2 of parameter No. 8600 = 1)
•
•
= 8388608: Disables the macro call for the 24th axis.
(Bit 7 of parameter No. 8602 = 1)
To disable the macro call for multiple axes, set the algebraic
sum of the value set for each axis.
EXAMPLE
To disable a call for the first and third axes, set
variable #8690 to (1 + 4) = 5.
- 24 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
NOTES
1 It may take time until the value set for the variable is
reflected in parameters Nos. 8600 to 8602,
depending on the CNC operation status. Whether
a macro call is enabled or disabled depends on the
values set for the parameters when the macro call is
issued.
2 This variable can be written and referenced using an
execution macro, conversational macro (talk macro),
or auxiliary macro.
Call code
1 In contrast to a macro call using a G or M code, an axis
address specified as a call code in a block is used as a call
command unless another call code is specified before the
axis address.
EXAMPLE
When a macro call using X and Y and a
subprogram call using M100 are enabled for the
machine
a) X100. B10; Calls a macro using X100.
b) G91 G01 X100.; Calls a macro using X100.
c) Y200. X100.; Calls a macro using Y200.
d) X100. M100; Calls a macro using X100.
e) M100 X100.; Calls a subprogram using
M100 after the tool moves
along the X axis according to
X100.
- 25 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Arguments
1 All addresses other than addresses O and N, and the
address for a subprogram call using a specific code that
can be specified for the target machine are used as
arguments.
EXAMPLE
When G91 G28 X123.45678 T999; is specified for
an IS-B machine, values are passed as follows:
#20 →999.0
#27 →123.457
#28 → 28.0
#29 → 91.0
Limitations
1 No macro call using an axis address can be performed
from any macro or subprogram including a custom
macro called by a macro or subprogram call using an M,
S, T, second auxiliary function, or specific code, or axis
address. If such a macro call using an axis address is
- 26 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Format
M98 Pp Ll;
M98 : Call command
p : Program number of an execution macro to be called
L : Repetition count (1 by default)
Limitation
No execution macro can be called from any user program
using this command. This command can be specified only
for calling an execution macro from another execution macro.
Format
Mm Ll;
m : Call code
- 27 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Format
Mm Ll;
m: Call code
L: Repetition count (1 by default)
Argument
The specified M code is passed to variable #148.
Limitations
1 No subprogram call using an M code in the specified
range can be performed from any macro or subprogram
including a custom macro called by a macro or
subprogram call using an M, S, T, second auxiliary
function, or specific code, or axis address. If such a
subprogram call using an M code is specified, the code
operates as an ordinary M code.
- 28 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Format
Ss Ll;
s: Call code
L: Repetition count (1 by default)
Argument
The specified S code is passed to variable #147.
Limitations
1 No subprogram call using an S code can be performed
from any macro or subprogram including a custom
macro called by a macro or subprogram call using an M,
S, T, second auxiliary function, or specific code, or axis
address. If such a subprogram call using an S code is
specified, the code operates as an ordinary S code.
- 29 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Format
Tt Ll;
T: Call code
L: Repetition count (1 by default)
Parameters
Setting bit 6 of parameter No. 8502 (TMC) to 0 and bit 2 of
parameter No. 8508 (TEC) to 1 enables this type of
subprogram call. These parameters are initialized to the
values set for P-CODE at power-on.
Bit 0 of parameter No. 8603 (TCM) can be used to disable
this type of subprogram call as required. This parameter
can be changed from MDI because it is an ordinary
parameter.
Variable
Variable #8691 can be used to enable or disable this type of
subprogram call and check the setting. The value set for
this variable is reflected in bit 0 of parameter No. 8603
(TCM).
NOTES
1 A value other than 0 or 1 cannot be set for this
variable.
2 It may take time until the value set for the variable is
reflected in bit 0 of parameter No. 8603 (TCM),
depending on the CNC operation status. Whether
this type of call is enabled or disabled depends on
the value set for the parameter when the call is
issued.
3 This variable can be written and referenced using an
execution macro, conversational macro (talk macro),
or auxiliary macro.
Argument
The specified T code is passed to variable #149.
- 30 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Limitations
1 No subprogram call using a T code can be performed
from any macro or subprogram including a custom
macro called by a macro or subprogram call using an M,
S, T, second auxiliary function, or specific code, or axis
address. If such a subprogram call using a T code is
specified, the code operates as an ordinary T code.
Format
Bb Ll;
b : Call code
l : Repetition count (1 by default)
Argument
The specified second auxiliary function code is passed to
variable #146.
Limitations
1 No subprogram call using a second auxiliary function
code can be performed from any macro or subprogram
including a custom macro called by a macro or
subprogram call using an M, S, T, second auxiliary
function, or specific code, or axis address. If such a
subprogram call using a second auxiliary function code is
specified, the code operates as an ordinary second
auxiliary function code.
- 31 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Format
Aa Ll;
a : Call code
l : Repetition count (1 by default)
Call code
None of addresses O, N, P, L, and G and axis name addresses
can be used as the call command for a subprogram call using
a specific code.
Limitations
1 No subprogram call using a specific code can be
performed from any macro or subprogram including a
custom macro called by a macro or subprogram call
using an M, S, T, second auxiliary function, or specific
code, or axis address. If such a subprogram call using a
specific code is specified, the code operates as an
ordinary NC address.
- 32 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
Format
Mm Pp Ll;
m : Call code
p : Program number of a user program to be called
l : Repetition count (1 by default)
- 33 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
Warning
WARNING
When conditions a) to c) are satisfied, this function
calls an execution macro regardless of the user
program to be started. For this reason, take
countermeasures such as issuing a warning
message using an auxiliary macro or PMC and
setting interlock processing to prevent operator
errors when using this function.
- 34 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
• Playback
• Manual numeric command
• Background drawing
EXAMPLE
Original program Command to be executed when
skipped
/1 N1 X100.; N1;
N2 /2 Y200.; N2;
- 35 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
CAUTION
When such a block is skipped in an execution
macro, the block consists of only the sequence
number with no travel distance. For this reason, if
such a block is skipped in the cutter or another
compensation mode, the tool path may differ from
that in a user program.
- 36 -
B-63323EN-2/01 3.EXECUTION MACRO FUNCTION
- 37 -
3.EXECUTION MACRO FUNCTION B-63323EN-2/01
- 38 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
4
CONVERSATIONAL MACRO (TALK
MACRO) FUNCTION AND AUXILIARY
MACRO FUNCTION
The conversational macro (talk macro) function allows the
machine tool builder to create original screens. The
auxiliary macro function can be executed regardless of which
mode or screen is selected.
LCD/MDI
CUSTOM key
Program num ber specification
Conversational macro
Program num ber change Control variable #8500
F-ROM
(talk macro) function
Conversational
macro
(talk macro) At power-on
At power-on
- 39 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
Cautions
CAUTIONS
1 The conversational macro (talk macro) function is
executed at a level lower than that of CNC
operation processing. Therefore, execution of the
conversational macro (talk macro) function does
not affect the speed of CNC operation processing,
but the speed at which the conversational macro
(talk macro) function is executed may become low
during CNC operation. For this reason, the
conversational macro (talk macro) function is not
suitable to control the machine at a constant
processing speed.
2 The conversational macro (talk macro) function
cannot execute any CNC part program statement
for operation.
Execution
Execute the conversational macro (talk macro) function using
one of the following methods:
- 40 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
NOTES
1 An error may occur and execution may not be able
to be continued. Such an error includes the case
where no P-CODE macro is found as the
conversational macro (talk macro) with the value of
the control variable for executing a conversational
macro (talk macro) (#8500) as the program
number. In this case, a message indicating that a
fatal error occurs is displayed on the
conversational macro (talk macro) screen. (For
details, see Section 4.5, "Fatal Error.")
2 When the value of the control variable for
executing a conversational macro (talk macro)
(#8500) is 0, the conversational macro (talk macro)
function is executed and only the system display
section is displayed. The system display section
includes the O number, N number, and soft key
frames.
Termination
Terminate execution of the conversational macro (talk
macro) function using one of the following methods:
- 41 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
O1234 ; O1234 ;
NO NO
Key input? Key input?
YES YES
M99 ; M99 ;
- 42 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
• Forced termination
NOTE
With the 15i-MA, to recover from the hang-up
state, execution of the conversational macro (talk
macro) function can forcibly be terminated.
If the system enters the hang-up state,
simultaneously press SHIFT and RESET . However,
recovery from the hang-up state is not always
guaranteed. Carefully program a conversational
macro (talk macro).
4.1.2 Commands
NOTE
Carefully use system variables #3000, #3003,
#3004, and #3006 because they affect automatic
operation.
- 43 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
Cautions
CAUTIONS
1 The auxiliary macro function is executed at a level
lower than that of CNC operation processing.
Therefore, execution of the auxiliary macro
function does not affect the speed of CNC
operation processing, but the speed at which the
auxiliary macro function is executed may become
low during CNC operation. For this reason, the
auxiliary macro function is not suitable to control
the machine at a constant processing speed.
2 The auxiliary macro function cannot execute any
CNC part program statement for operation.
Execution
After power-on, the auxiliary macro function is always
executed.
After the auxiliary macro function enters the constant
execution state, it executes the auxiliary macro main
program with the value of the control variable for executing
an auxiliary macro (#8600) as the program number. When
the power is turned on, the value of compile parameter No.
8537 is set for the control variable for executing an auxiliary
macro (#8600).
- 44 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
NOTE
An error may occur and execution may not be able
to be continued. Such an error includes the case
where no P-CODE macro is found as the auxiliary
macro with the value of the control variable for
executing an auxiliary macro (#8600) as the
program number. In this case, a message
indicating that a fatal error occurs is displayed on
the conversational macro (talk macro) screen.
(For details, see Section 4.5, "Fatal Error.")
Termination
The auxiliary macro function does not terminate because it is
always executed. Setting the control variable for executing
an auxiliary macro (#8600) to 0 places the auxiliary macro
function in the wait state when a program end command
(execution control code M99 or M99Pp) in the main program
is executed. The function remains in the wait state until a
program number is set for the control variable for executing
an auxiliary macro (#8600) again.
Program an auxiliary macro as a cyclic program like a
conversational macro (talk macro).
4.2.2 Commands
NOTE
Carefully use system variables #3000, #3003,
#3004, and #3006 because they affect automatic
operation.
- 45 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
NOTE
When an auxiliary macro is executed, a
conversational macro (talk macro) is executed after
execution of a program end command (execution
control code M99 or M99Pp) in the auxiliary macro
main program. After a program end command
(execution control code M99 or M99Pp) in the
conversational macro (talk macro) main program is
executed, execution of the auxiliary macro starts
again.
NOTE
The conversational macro (talk macro) is not
synchronized with the auxiliary macro in the
parallel execution mode. When the same macro
variable or macro executor function is to be used,
program the conversational macro (talk macro) and
auxiliary macro so that no competition will occur.
- 46 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
NOTE
When the FS15i original specification is selected
using bit 3 of parameter No. 8558 (15I), some
specifications of the macro executor function
change. For details, see Section 9.1, "Compile
Parameters."
NOTE
When no conversational macro (talk macro) is
executed, the auxiliary macro function executes the
auxiliary macro at the specified intervals as many
blocks as the number specified for parameter No.
7045 at a time.
Execution of the auxiliary macro is affected by the
CNC operation processing time because the
auxiliary macro is executed at a level lower than
that of CNC operation processing. For this
reason, the specified intervals are not guaranteed.
If the number of execution blocks in the auxiliary
macro is increased and the processing time
becomes longer, the screen may be displayed
slowly.
NOTE
When the FS15i original specification is selected
using bit 3 of parameter No. 8558 (15I), some
specifications of the macro executor function
change. For details, see Section 9.1, "Compile
Parameters."
- 47 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
• Format
G65 Pp <Ll> <argument-specification> ;
p : Program number of a P-CODE macro to be called
l : Repetition count (1 by default)
argument : Data to be passed to the P-CODE macro. (Argument
specifications I and II are available.)
• Format
M98 Pp <Ll> ;
p : Program number of a P-CODE macro to be called
l : Repetition count (1 by default)
• Format
M99 <Pp> ;
p: Sequence number of the calling P-CODE macro
(By default, control is returned to the block following the call
command in the calling macro.)
- 48 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
- 49 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
- 50 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
- 51 -
4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION B-63323EN-2/01
a : 0: No error occurred.
1: An error occurred in a macro statement command.
2: An error occurred in an NC statement command.
bbbbbb : • Variable number for a macro statement
(0 is displayed for other than a variable.)
• G code for an NC statement
(0 is displayed for other than a G code.)
When no error occurred, 0 is displayed.
- 52 -
B-63323EN-2/01 4.CONVERSATIONAL MACRO (TALK MACRO) FUNCTION AND AUXILIARY MACRO FUNCTION
NOTE
If an error occurs during execution of an auxiliary
macro, the control variable for executing an
auxiliary macro (#8600) is preset to 0. To restart
execution of an auxiliary macro, set the program
number for the control variable for executing an
auxiliary macro (#8600).
- 53 -
5.MACRO VARIABLES B-63323EN-2/01
5 MACRO VARIABLES
- 54 -
B-63323EN-2/01 5.MACRO VARIABLES
Conversational
Variable Auxiliary Execution
Type Remarks macro (talk
number macro macro
macro)
#1 to 33 Local variable The local variables used in a ¡ ¡ ¡
conversational macro (talk macro) and
those used in an auxiliary macro are
independent of one another.
The local variables used in an execution
macro can also be used in a custom
macro.
If array variables are effective, no local
variables can be used in conversational
macros (talk macros) and auxiliary
macros.
#1 to 99 Array variable Array variables cannot be used if local ¡ ¡ ×
variables are effective.
(This applies to the array variables in
conversational macros (talk macros) and
auxiliary macros.)
#100 to 199 Volatile common The same volatile common variable can ¡ ¡ ¡
variable be used in any of conversational macros
(talk macros), auxiliary macros, and
execution macros. Using MV0 and MV1
(bits 0 and 1 of parameter No. 8503), it is
possible to specify whether volatile
common variables can also be used as
custom macro common variables or they
are to be used as independent P-CODE
macro common variables.
#200 to 999 Nonvolatile The same nonvolatile common variable ¡ ¡ ¡
common variable can be used in any of conversational
macros (talk macros), auxiliary macros,
and execution macros. Using MV2 to
MVA (bits 2 to 7 of parameter No. 8503
and bits 1 to 3 of parameter No. 8504), it
is possible to specify whether nonvolatile
common variables can also be used as
custom macro common variables or they
are to be used as independent P-CODE
macro common variables.
#1000 to System variable The variables used in custom macros ¡ ¡ ¡
can also be used as system variables.
#30000 to P-CODE variable The same P-CODE variable can be used ¡ ¡ ¡
39999 in any of conversational macros (talk
macros), auxiliary macros, and execution
macros. The upper limit on the variable
number is determined with EV2 (bit 1 of
parameter No. 8509) and parameter No.
8549.
- 55 -
5.MACRO VARIABLES B-63323EN-2/01
- 56 -
B-63323EN-2/01 5.MACRO VARIABLES
NOTE
If array variables are effective, local variables are
not effective in conversational macros (talk
macros) and auxiliary macros.
In execution macros, local variables are effective
regardless of whether array variables are effective
or not.
NOTE
Local variables are effective if array variables are
not effective.
- 57 -
5.MACRO VARIABLES B-63323EN-2/01
NOTE
If the parameters are set so that variables #200 to
#499 are used as custom macro common
variables, an option for additional 900 custom
macro common variables is required.
NOTE
Parameters Nos. 8574 to 8577 are for P-CODE
macro common variables.
Parameters Nos. 7036 to 7039 are for custom
macro common variables.
- 58 -
B-63323EN-2/01 5.MACRO VARIABLES
Caution
CAUTION
The same common variable can be used in any of
conversational macros (talk macros), auxiliary
macros, and execution macros, but caution is
necessary. If the common variable used in an
execution macro and a user program is the same
as the common variable used in a conversational
macro (talk macro) and an auxiliary macro, writing
may occur from the execution macro while writing
is performed from the conversational macro (talk
macro) or auxiliary macro because execution
macros have a higher processing level than
conversational macros (talk macros) and auxiliary
macros, with the result that the values written by
the execution macro may be overwritten by the
remaining processing of the conversational macro
(talk macro) or auxiliary macro. For this reason,
make sure that the variables used in execution
macros are different from those used in
conversational macros (talk macros) and auxiliary
macros.
- 59 -
5.MACRO VARIABLES B-63323EN-2/01
Setting
1. Set the variable type for EV2 (bit 1 of parameter No.
8509).
2. Set the number of variables for parameter No. 8549.
The number of variables that can be used is the value set
for this parameter times n, where n differs depending on
the variable type.
Floating-point data : 40
Integer data : 100
The maximum value that can be set for this parameter is
100.
If this parameter is 0, no P-CODE variables can be used.
EXAMPLE
[Setting example]
1. If EV2 (bit 1 of parameter No. 8509) is 0 (floating-
point data):
If parameter No. 8549 is set to 1: #30000 to 30039
If parameter No. 8549 is set to 2: #30000 to 30079
2. If EV2 (bit 1 of parameter No. 8509) is 1 (integer
data):
If parameter No. 8549 is set to 1: #30000 to 30099
If parameter No. 8549 is set to 2: #30000 to 30199
Caution
CAUTION
EV2 (bit 1 of parameter No. 8509) and parameter
No. 8549 cannot be set from the MDI.
The compile parameters set when a P-CODE macro
was created are copied to EV2 and the parameter
when the power is turned on.
- 60 -
B-63323EN-2/01 5.MACRO VARIABLES
• Caution on setting
The maximum value that can be set for parameter No. 8549
is 100. The actual maximum value that can be set, however,
depends on the free space of the backup memory.
The free space of the backup memory can be checked on the
main CPU board module screen on the system configuration
screen.
Caution
CAUTION
The free space of the backup memory must not be
exceeded.
Otherwise, "FILE ALLOCATION ERROR" is
displayed when the power is turned on, and the
system stops.
If "FILE ALLOCATION ERROR" is displayed, use
either of the following recovery methods:
<1> Register a P-CODE macro that does not cause
the free space to be exceeded.
<2> Delete the P-CODE macro.
- 61 -
5.MACRO VARIABLES B-63323EN-2/01
CAUTIONS
1 For integer data, a value in the range of -32768 to
+32767 can be set in a variable. If the value has a
fractional part, it is rounded off to the nearest integer
number. A <null> representation is not possible.
If a P-CODE variable of the integer data type
appears in an <expression>, it is converted to
floating-point data before the expression is
evaluated.
2 P-CODE variables retain their values even after the
power is disconnected.
3 When the values of EV2 (bit 1 of parameter No.
8509) and parameter No. 8549 are changed, the
power must be turned off and then on again for the
new values to take effect.
4 P-CODE variables are displayed on the P-CODE
macro variable screen. They can also be entered
from the MDI.
- 62 -
B-63323EN-2/01 5.MACRO VARIABLES
Setting
1. Set the variable type for EV1 (bit 0 of parameter No.
8509).
2. Set the number of variables for parameter No. 8550.
The number of variables that can be used is the value set
for this parameter times n, where n differs depending on
the variable type.
Floating-point data: 10
Integer data: 30
The maximum number that can be set for this
parameter is 1970.
If this parameter is 0, no extended P-CODE variables
can be used.
EXAMPLE
[Setting example]
1. If EV1 (bit 0 of parameter No. 8509) is 0 (floating-
point data):
If parameter No. 8550 is set to 1: #40000 to
#40009
If parameter No. 8550 is set to 2: #40000 to
#40019
2. If EV1 (bit 0 of parameter No. 8509) is 1 (integer
data):
If parameter No. 8550 is set to 1: #40000 to
#40029
If parameter No. 8550 is set to 2: #40000 to
#40059
Caution
CAUTION
EV1 (bit 0 of parameter No. 8509) and parameter
No. 8550 cannot be set from the MDI.
The compile parameters set when a P-CODE macro
was created are copied to EV1 and the parameter
when the power is turned on.
- 63 -
5.MACRO VARIABLES B-63323EN-2/01
• Caution on setting
The maximum value that can be set for parameter No. 8550
is 1970. The actual maximum value that can be set,
however, depends on the free space of the backup memory.
The free space of the backup memory can be checked on the
main CPU board module screen on the system configuration
screen. See "Displaying the free space of the backup
memory" in Section 5.4, "P-CODE Variables (#30000 and
Above)."
Caution
CAUTION
The free space of the backup memory must not be
exceeded.
Otherwise, "FILE ALLOCATION ERROR" is
displayed when the power is turned on, and the
system stops.
If "FILE ALLOCATION ERROR" is displayed, use
either of the following recovery methods:
<1> Register a P-CODE macro that does not cause
the free space to be exceeded.
<2> Delete the P-CODE macro.
- 64 -
B-63323EN-2/01 5.MACRO VARIABLES
CAUTIONS
1 For integer data, a value in the range of -32768 to
+32767 can be set in a variable. If the value has a
fractional part, it is rounded off to the nearest integer
number. A <null> representation is not possible.
If an extended P-CODE variable of the integer data
type appears in an <expression>, it is converted to
floating-point data before the expression is
evaluated.
2 Extended P-CODE variables retain their values even
after the power is turned off.
3 When the values of EV1 (bit 0 of parameter No.
8509) and parameter No. 8550 are changed, the
power must be turned off and on again for the new
values to take effect.
4 Extended P-CODE variables are displayed on the P-
CODE macro variable screen. They can also be
entered from the MDI.
- 65 -
5.MACRO VARIABLES B-63323EN-2/01
NOTE
If the option for additional 900 custom macro
common variables is not attached, it is possible to
write and read values from only variables #100 to
#199 and #500 to #999.
- 66 -
B-63323EN-2/01 5.MACRO VARIABLES
Caution
CAUTION
It is possible to specify system variables #3000,
#3003, #3004, and #3006 from conversational
macros (talk macros) and auxiliary macros. Use
great caution when specifying the variables
because they affect automatic operation.
• Caution
CAUTION
Specifying variable #3000 from a conversational
macro (talk macro) or auxiliary macro causes
automatic operation to stop due to an alarm.
• Caution
CAUTION
Specifying variable #3006 from a conversational
macro (talk macro) or auxiliary macro causes
automatic operation to stop.
- 67 -
5.MACRO VARIABLES B-63323EN-2/01
NOTE
Even if this function is used, the UI/UO signals in
user programs (other than P-CODE macros) are
ordinary interface signals.
Number of
Signal Variable Value correspondence
signals
EUI00 1 #1000
EUI01 1 #1001
EUI02 1 #1002
"0" corresponds to 0 and "1"
EUI03 1 #1003
to 1.
: : :
EUI14 1 #1014
EUI15 1 #1015
EUI00 to EUI15 16 #1032 16-bit binary code
- 68 -
B-63323EN-2/01 5.MACRO VARIABLES
Number of
Signal Variable Value correspondence
signals
EUO00 1 #1100
EUO01 1 #1101
EUO02 1 #1102
"0" corresponds to 0 and "1"
EUO03 1 #1103
to 1.
: : :
EUO14 1 #1114
EUO15 1 #1115
EUO00 to EUO15 16 #1132 16-bit binary code
These system variables can be used on both the right and left
sides of an assignment statement.
When a system variable is used on the right side of an
assignment statement, the value stored (sent) when the
variable was last used on the left side of an assignment
statement is assumed.
• Signal addresses
#7 #6 #5 #4 #3 #2 #1 #0
G144 EUI07 EUI06 EUI05 EUI04 EUI03 EUI02 EUI01 EUI00
#7 #6 #5 #4 #3 #2 #1 #0
F166 EUO07 EUO06 EUO05 EUO04 EUO03 EUO02 EUO01 EUO00
- 69 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 70 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
List of Macro Executor Functions, along with Related G Codes and Control Variables
Conversational
Execution
Auxiliary
Section Function Related G code Related control variable
6.8 Relative Coordinate Read and Preset Functions G360 8996 to 8999 ¡ ¡ ×
6.17 Function for Searching Data Tables for Control Variables G400 8650 to 8655 ¡ ¡ ×
- 71 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTES
1 The G codes described in Section 6.1 cannot be
executed with auxiliary macro functions.
2 G315, described in Section 6.9, is a G code that
cannot be executed with auxiliary macro functions.
3 The G codes described in Section 6.13 requires
the PMC axis control option.
Caution
CAUTION
Even those functions that are usable in multiple P-
CODE macros (conversational macros (talk
macros), auxiliary macros, and execution macros)
must not be used simultaneously.
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
- 72 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
- 73 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
- 74 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
NOTE
The variable types are as follows:
Floating: Floating-point type
Integer : Integer type
When an attempt is made to input a <null> value to
a variable of the integer type, the value is changed
to zero before being input.
- 75 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
When the FS15i original specifications are
selected with 15I (bit 3 of parameter No. 8558), the
specifications of several macro executor functions
are changed. See Section 9.1, "Compile
Parameters" for details.
- 76 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 77 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 78 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 79 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
If a character card is used as a display unit, G242,
G244, G301, G302, G303, G392, G311, G300,
G320, G204, and G321 cannot be used.
NOTE
Addresses X and Y are used as modal addresses
common to character display and graphic display.
- 80 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTE
During a macro call, none of the addresses is
processed; they are treated as arguments.
Format
G202 Pp ;
P = 1: Clears the graphic screen.
= 2: Clears the character screen.
= 3: Clears both the graphic and character screens.
- 81 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTES
1 When address P is omitted, P3 is assumed, so that
both the graphic and character screens are
cleared.
2 If the display unit is a character card, only P2 and
P3 are effective.
3 Clearing the character screen causes the following
items to be initialized:
Display position : Initialized to (0, 0).
Color : Initialized to white
(high luminance for a
monochrome LCD).
Blinking : Initialized to the off
state.
Display in reverse video : Initialized to the off
state.
Cursor : Initialized to the off
state.
Character size : Initialized to the
standard size.
4 Clearing the graphic screen causes the following
items to be initialized:
Display position: Initialized to (0, 0).
Color : Initialized to white (high
luminance for a monochrome
LCD).
Line type : Initialized to solid.
5 Clearing both the character and graphic screens
causes both the items listed in 3 and 4 above to be
initialized.
- 82 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
= 9 : Dark green
= 10 : Dark blue
= 11 : Dark purple
= 12 : Bright gray
= -1 : Red (reverse video)
= -2 : Green (reverse video)
= -3 : Yellow (reverse video)
= -4 : Blue (reverse video)
= -5 : Purple (reverse video)
= -6 : Light blue (reverse video)
= -7 : White (reverse video)
= -8 : Dark gray (reverse video)
= -9 : Dark green (reverse video)
= -10 : Dark blue (reverse video)
= -11 : Dark purple (reverse video)
= -12 : Bright gray (reverse video)
L1 : Blinking ON (blinking OFF when L1 is not
specified)
NOTES
1 P7 is assumed until G240 is issued for the first
time.
2 If the display unit is a character card, the luminance
cannot be changed.
Address P is classified into three types:
P = 1 to 12 : Display ON
P=0 : Display OFF
P = -1 to -12 : Display in reverse video ON
3 If the display unit is a monochrome LCD, the
luminance will be as described below:
In the descending order of luminance, the values of
address P are 7, 3, 12, 6, 2, 5, 1, 4, 8, 9, 11, 10,
and 0. (The luminance of 2 is equal to that of 5
and the luminance of 9 is equal to that of 11.)
Because, however, the differences in luminance
are hard to distinguish, it is recommended that only
7 and 2 be used.
- 83 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
Format
G243 Xx Yy Aa Bb Cc Kk Ff.e Dd Zz
Pp Qq
( __ ) ( ' __ ') (*__*) ;
• Addresses X and Y
Addresses X and Y are used to specify the display position of
the character string in the character coordinate system.
X: X coordinate of the display position of the character
string
Y: Y coordinate of the display position of the character
string
NOTES
1 When specifying both X and Y, specify them in
succession.
2 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
• Address A
Address A specifies the character size.
A = 1: Standard size
= 2: Double size
= 3: Triple size
- 84 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
• Address B
Address B specifies blinking control.
B = 0: Does not blink the character string.
= 1: Blinks the character string.
NOTE
Specifying B1 causes all the subsequent character
strings to blink.
• Address K
Address K specifies the number of spaces. The specified
number of spaces are displayed.
K: Specification of the number of spaces
When spaces are displayed, the affected coordinates are
updated.
• Address C
Address C is used to directly specify the character codes to be
displayed. The codes that can be specified are 32 to 95 (20
to 5F in hexadecimal) and 160 to 223 (A0 to DF in
hexadecimal).
Do not attempt to display codes other than those that can be
specified.
C: Direct specification of the character code to be
displayed
EXAMPLE
G243 C65 ;
"A" is displayed.
NOTE
Use ASCII codes.
- 85 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Address P
• Address Q
Address P specifies the number of the sequence containing a
character string.
Address Q specifies the number of the program containing a
character string.
When address Q is not specified, the character string in the
single block determined with the sequence number specified
for P in the program set in the character string registration
program control variable (#8509) is displayed.
If the value of variable #8509 is 0, the character string in the
single block determined with the sequence number specified
in the same program is displayed.
When address Q is specified, the character string in the
single block determined with the sequence number specified
for P in the program set for address Q is displayed.
P: Specification of the number of the sequence containing
a character string
Q: Specification of the number of the program containing
a character string
EXAMPLE
O9000 ; O8000 ;
M99 ; M99 ;
O9100 ; O8100 ;
M99 ; M99 ;
- 86 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
• Address D
Address D specifies the numeric value to be displayed:
D: Specification of the numeric value to be displayed
The number of significant digits of the value that can be
specified directly for address D is 9.
The number of display significant digits for address D is,
however, 12, so that values in the range of -999999999999 to
-0.000000001, 0, and 0.000000001 to 999999999999 can be
displayed. The number of decimal places can be up to 9.
• Address F
Address F specifies the format in which a numeric value is to
be displayed. To the left side of the decimal point, specify
the number of digits of the numeric value to be displayed; to
the right side, specify the number of decimal places.
F: Specification of the format in which a numeric value is
to be displayed
The valid range of address F is 1.0 to 40.9. The decimal
places to be specified to the right side of the decimal point
must be a single digit of 0 to 9. Note that the number of
display digits varies with the specified value and the value of
address Z.
• Address Z
Address Z specifies whether to suppress leading zeros when a
numeric value is displayed. When Z is equal to 0, the sign is
not displayed.
Z = 0: Does not suppress leading zeros.
= 1: Suppresses leading zeros.
EXAMPLES
1 G243 D-123.4567 F8.3 Z1;
"∆∆-123.457" is displayed. (10-character display)
2 G243 D-123.4567 F8.3 Z0;
"00123.457" is display. (9-character display)
3 G243 D-123.4567 F8.0 Z1;
"∆∆∆∆-123" is displayed. (9-character display)
4 G243 D-123.4567 F8.0 Z0;
"00000123" is displayed. (8-character display)
(∆ represents a space.)
- 87 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
The number of digits of the integer part, which is
equal to the number of display digits minus the
number of decimal places, both specified for
address F, must be equal to or greater than the
number of digits of the integer part of the numeric
value specified for address D. Otherwise, the
numeric value is not displayed correctly.
• ( __ )
( and ) are used to directly specify the character string to be
displayed. The characters that can be enclosed in ( and ) are
the alphabetic characters (uppercase only), digits, the minus
sign, the decimal point, and spaces.
EXAMPLE
G243(FANUC);
"FANUC" is displayed.
• ( '__' )
(' and ') are used to specify the character string (of single- and
double-byte characters) to be displayed. The characters
that can be enclosed in (' and ') are the characters given in
the Katakana Code Table and the Chinese and Hiragana
Code Table in Section 10.3 in Chapter 10.
Hiragana and Chinese characters each take a space twice
wider than a single-byte character.
EXAMPLE
G243('Fanuc NC ');;
"Fanuc NC " is displayed.
• (*__*)
(* and *) are used to specify the internal codes corresponding
to the character string to be displayed. The character codes
must be specified in hexadecimal.
The codes must be delimited by a space. Hiragana and
Kanji characters each take a space twice wider than a
single-byte character.
EXAMPLE
G243(*46 41 4E 55 43 20*);
G243(*4E 43 4175 4356*)
"Fanuc NC " is displayed.
- 88 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTE
Use the JIS codes (codes given in the Katakana
Code Table and the Chinese and Hiragana Code
Table in Section 10.3 in Chapter 10).
• Limitation
NOTES
1 Character strings are displayed in the order in
which they are specified.
2 The same address cannot be specified twice.
3 F, Z, and Z become effective first.
4 Up to five character strings enclosed in any of
( and ), (' and '), and (* and *) can be specified in a
single block, in total.
5 Up to 255 characters can be specified in a single
block, in total.
Format
G244 Pp ;
P = 0: Solid line
= 1: Broken line
= 2: Alternate long and short dash line
= 3: Alternate long and two short dashes line
= 4: Erasure
= 5: Dotted line
NOTES
1 This code is not effective if the display unit is a
character card.
2 Solid line is automatically assumed when the
graphic screen clear code (G202) is issued.
- 89 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Format
G280 Cc Kk Pp Qq ( __ ) ( '__' ) (*__*);
C : Character code. (See the explanation of G243.)
K : Number of spaces. (See the explanation of
G243.)
P : Number of the sequence containing a character
string. (See the explanation of G243.)
Q : Number of the program containing a character
string. (See the explanation of G243.)
( __ ) : Character string to be displayed. (See the
explanation of G243)
( '__' ) : Character string to be displayed. (See the
explanation of G243)
(*__*): Character string to be displayed. (See the
explanation of G243)
NOTES
1 G280 is a one-shot G code, which means that the
code is effective only in the block in which it is
specified.
2 If a prompt statement is displayed with multiple
addresses, a single space is automatically inserted
between the character string displayed with one
address and that displayed with another.
Format
G301 Xx Yy ;
X: X coordinate of the end point of linear drawing
Y: Y coordinate of the end point of linear drawing
- 90 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 This code is not effective if the display unit is a
character card.
2 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
Format
G302 Xx Yy Ii Jj ;
G303 Xx Yy Ii Jj ;
X : X coordinate of the end point of circular drawing
Y : Y coordinate of the end point of circular drawing
I : X component of the vector that is directed from the
start point of the arc to the center of the arc
J : Y component of the vector that is directed from the
start point of the arc to the center of the arc
NOTES
1 These codes are not effective if the display unit is a
character card.
2 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
- 91 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
G390 G242 X0 Y0 ;
G391 G301 X200 ;
G302 X-200 I-100 ;
G303 X-200 I-100 ;
G301 X200 ;
Format
G230 Xx Yy Ll ;
Addresses X and Y specify the display position of the cursor
in the character coordinate system.
X: X coordinate of the cursor display position
Y: Y coordinate of the cursor display position
Address L specifies the length of the cursor.
L: Specification of the cursor length
- 92 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 The cursor is erased when the cursor length is set
to 0.
2 The cursor can also be erased by the character
screen clear code (G202).
3 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
NOTE
These codes are effective to G204, G230, G242,
G243, G300, G301, G302, G303, G320, and G321.
Format
G392 Xx Yy ;
X: X coordinate
Y: Y coordinate
- 93 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
N01 G242 X100 Y100 ;
N02 G392 X60 Y60 ;
N03 G301 X100 ;
NOTES
1 The specified X and Y coordinates are always
assumed absolute.
2 This code is not effective if the display unit is a
character card.
Format
G311 Xx Yy ;
Specify the speed ratios assumed during rapid traverse
drawing.
X: Rapid traverse drawing speed ratio in the X axis
Y: Rapid traverse drawing speed ratio in the Y axis
NOTES
1 The rapid traverse drawing speed ratios must be
positive integer numbers in the range of 1 to
32767.
2 The specified X and Y values are always assumed
absolute.
3 This code is not effective if the display unit is a
character card.
- 94 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Format
G300 Xx Yy ;
X: X coordinate for rapid traverse drawing
Y: Y coordinate for rapid traverse drawing
NOTES
1 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
2 Non-linear drawing is always performed regardless
of the CNC parameters.
3 This code is not effective if the display unit is a
character card.
EXAMPLE
G311 X200 Y100 ;
G242 X-150 Y-150 ;
G300 X150 Y150 ;
- 95 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Format
G320 Xx Yy Pp ;
X: X coordinate of the position contained in the area to
be filled
Y: Y coordinate of the position contained in the area to
be filled
P: Color with which the area is to be filled
- 96 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 The filling color specified with G320 must be the
same as the boundary color (color of the boundary
of the closed area).
2 G240 Pp;
G320 Xx Yy Pp;
By setting the values of P to 0 with the above
codes, it is possible to fill graphics with "black"
(hide the graphics).
(Example)
G240 P4 ;
G242 X0 Y0 ;
G390 G301 X200 ;
Y100 ;
X0 ; Blue
Y0 ;
G320 X15 Y5 P4 ;
⇓
G240 P0 ;
G242 X0 Y0 ;
G390 G301 X200 ;
Y100 ; Black
X0 ;
Y0 ;
G320 X15 Y5 P0 ;
3 This code is not effective if the display unit is a
character card.
4 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
- 97 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Format
G204 Xx Yy Ii Jj Pp ;
X: X coordinate of the rectangular display start
position
Y: Y coordinate of the rectangular display start
position
I: X coordinate of the rectangular display end position
J: X coordinate of the rectangular display end position
P: Color with which the rectangle is to be filled
NOTES
1 The values specified for addresses X, Y, I, and J
are switched between absolute and incremental
values by using G390 and G391.
2 When P is omitted, the rectangle is not filled, and
the edge of the outer frame is filled with the color
specified with G240.
3 This code is not effective if the display unit is a
character card.
Format
G321 Xx Yy Mm Pp ;
X: X coordinate of the position at which a mark is to be
displayed
Y: Y coordinate of the position at which a mark is to be
displayed
M: Specification of the number of the mark to be
displayed
P: Specification of the color of the mark to be displayed
- 98 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Mark number 1 2 3 4
Arrow head Arrow head Arrow head
Mark Origin mark pointing pointing pointing to the
upward downward left
00000 0 0 0
0 0000 0 0 0
0 00000 * 0 0 0
0 00000 0 0 * *
0000**0000 0 0 0
0000 0 0 0 0
0000 0 0
000 0
00000
Mark number 5 6 7 8
Arrow head Arrow head Arrow head Arrow head
Mark pointing to the pointing to the pointing to the pointing to the
right upper left lower left upper right
0
0
0
* *OOO 0 OOO *
0 0 0 0
0 0 0 0
0 0 *OOO 0
Mark number 9 10
Arrow head
Black, round
Mark pointing to the
mark
lower right
000
00000
0 0000000
0 000*
*000
0 0000000
OOO * 00000
000
NOTES
1 The asterisk "*" indicates the position specified for
X and Y.
2 The values specified for addresses X and Y are
switched between absolute and incremental values
by using G390 and G391.
3 This code is not effective if the display unit is a
character card.
4 When address P is omitted, the mark is displayed
white.
5 When addresses X and Y are omitted, the mark is
displayed at the current position.
- 99 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
This function is not effective if the display unit is a
character card.
NOTE
If the display unit is a character card, the use of
graphics is not possible and, therefore, graphic
state reading variable #8800 is always 1 when it is
read.
- 100 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 101 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
The graphic screen requires an option.
- 102 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
PAGE
Page key 1 SOFT FUNCTION KEY 1 12
- 103 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
(0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11)
Function key 26
Caution
CAUTION
If extension is performed, pressing any of the
above command keys does not cause the system
to switch to the corresponding screen because the
conversational macro (talk macro) function does
not end. It is necessary to set the conversational
macro (talk macro) start control variable (#8510) to
0 in the conversational macro (talk macro) to be
created to terminate the conversational macro (talk
macro) function.
- 104 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
ALTER key 32
NOTE
When the FS15i original specifications are
selected with 15I (bit 3 of parameter No. 8558), the
specifications of several macro executor functions
are changed. See Section 9.1, "Compile
Parameters" for details.
- 106 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
Assume that the variables are set as follows:
#8502=3;
#8552=500;
and that the following is input:
0123456ABCD
When the <INPUT> key is pressed,
the following data is read from the variables:
#500=48
#501=49
#502=50
#503=51
#504=52
#505=53
#506=54
#507=65
#508=66
#509=67
#510=68
#511=<Null>
•
•
•
#531=<Null>
#8501=8
NOTES
1 The macro variables starting with the one having
the number set in variable #8552 retain their
previous values until the <INPUT> key is pressed.
It is after the <INPUT> key is pressed that the new
values are set in these variables.
2 The values of variables #8503 and #8504 are not
guaranteed.
3 If a non-zero macro variable number is set in
variable #8552, this function is executed
unconditionally when the <INPUT> key is pressed.
In this case, the input data cannot be read from
character string variable #8550.
- 107 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Page key ON
OFF
#8501 = Data
#8501 = 0
256 32 32 (MSEC)
EXAMPLE
When the SHIFT
and keys are pressed at the
same time on the standard MDI keyboard ("&" is
5
input), 32 (= 2 ) is set in variable #8542 and 64 (=
6
2 ) is set in variable #8544.
- 108 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE OF USE
To cause "PUSH" to blink while the PAGE
key is
pressed and held down on the standard MDI
keyboard, enter the following:
:
#100=#8501 ;
IF [#100 NE 2] GOTO 20 ;
N10 G243 X0 Y0 A1 B1 (PUSH);
#101 = #8544 AND 2 ;
IF [#101 EQ 0] GOTO 20 ;
M99 P10 ;
N20 G243 X0 Y0 A1 K4 ;
:
Cautions
CAUTIONS
1 This function is effective for the standard and full
keyboards for the 15i-MA.
2 The key image of each variable and bit differs from
that of the FS15-B.
- 109 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
#8547 Q Z Y X P G N O
? W V U C E ) (
#8548 L T S M R K J I
+ * = # _ @ A ,
#8549
NOTE
The key code shown by hatching is the one
assumed when the key is pressed in combination
with the SHIFT
key.
- 110 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
8547 Q Z Y X P G N O
> @ ) ( < * ?
8548 L T S M R K J I
; ¥ SP : '
8549 W V U E C A
] [ _ $ / !
NOTE
The key code shown by hatching is the one
assumed when the key is pressed in combination
with the SHIFT
key.
- 111 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Format
<address><address-number>
or
<address><address-number>.<bit-position>
NOTE
If a value exceeding the applicable valid range is
specified, the correct value cannot be read.
- 112 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLES
1 #100=G100.1
The value of bit 1 of PMC address G100 is set in
variable #100.
2 #100=T10
The contents of PMC address T10 is set in variable
#100.
3 #101=C22.2
The value of bit 2 of PMC address C22 is set in
variable #101. The PMC address that can be
used are G, F, X, Y, D, R, T, C, and K. The
notation must conform to the description in PMC
Ladder. Refer to the "FANUC PMC-MODEL
PA1/PA3/SA1/SA2/SA3/SA5/SB/SB2/SB3/SB4/SB
5/SB6/SC/SC3/SC4/NB/NB2 Programming Manual
(Ladder Language)" (B-61863E) Version 12 or later
for details.
Format
P<parameter-number>
or
P<parameter-number>.<servo-axis-number/spindle-
number>
EXAMPLES
1 #100=P1000
The value of CNC parameter No. 1000 is set in
macro variable #100.
2 #100=P1020.2
The value of the second axis of CNC parameter
No. 1020 is set in macro variable #100.
- 113 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
When the Series 15B-compatible specifications are
selected, a parameter value of the Series 15B can
be reference by entering the parameter number.
Note that only parameters of which input
specifications are completely compatible with those
of the Series 15i can be referenced. If an attempt
is made to reference another type of parameter,
empty(#0) is read as the value. If an execution
macro references that type of parameter, alarm
PS302 is issued.
- 114 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Format
G310 Dd Qq Ll ;
G310 Rr Qq Ll ;
G310 Cc Qq Ll ;
G310 Kk Qq Ll ;
G310 Tt Qq Ll ;
D: PMC address D
R: PMC address R
C: PMC address C
K: PMC address K
T: PMC address T
Q: Data to be written
L: Data size
EXAMPLE
#100 = -500.0 ;
G310 D300 Q#100 L4 ;
When the above program is executed, the following
data is written to the PMC data area (D300 to
D303).
Bit 7 6 5 4 3 2 1 0
D300 0 0 0 0 1 1 0 0
D301 1 1 1 1 1 1 1 0
D302 1 1 1 1 1 1 1 1
D303 1 1 1 1 1 1 1 1
The two's complement of the decimal number -500.0 is
FFFFFE0Ch.
- 115 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTES
1 Data cannot be specified in bit units.
2 If the specified data exceeds the byte length
specified for address L, only the specified byte
length of data is written and no error handling is
performed.
In the example shown on the previous page, if "L1"
is specified, the lowest byte (0CH) of -500.0 is
written in D300 only.
• Format
G310 Dd Pp Ll ;
G310 Rr Pp Ll ;
G310 Cc Pp Ll ;
G310 Kk Pp Ll ;
G310 Tt Pp Ll ;
D: PMC address D
R: PMC address R
C: PMC address C
K: PMC address K
T: PMC address T
P: Number of the variable in which data is to be set
L: Data size
EXAMPLE
Assume that the PMC data area (D400 and D401)
contains the following data:
D400 = 0Ch
D401 = Feh
and that the following is issued:
G310 D400 P101 L2;
then, "-500.0" is input to variable #101.
- 116 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 If the byte length of the data to be read is 1 byte,
the data can also be read with the PMC address
function. The function, however, converts the
data into signed data (two's complement
representation), so that different data may be
stored.
2 Whether writing or reading control is to be
performed is determined by which of addresses Q
and P is specified. If both addresses Q and P are
specified, writing control is executed.
3 The addresses other than D, R, C, K, and T (such
as X, Y, G, and F) cannot be used for specification.
4 Only one of 1, 2, and 4 bytes can be specified for
address L.
When a value other than 2 and 4 is specified or
when address L is omitted, reading/writing of 1-
byte data is performed.
5 The valid range of each PMC address is as shown
in the table below.
If a command exceeding any of the ranges is
executed, writing may not be performed correctly.
- 117 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.5.1 General
6.5.2 Functions
- 119 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTE
When the FANUC Handy File, FANUC Floppy
Cassette, FANUC FA Card, or FANUC Program File
Mate is used, specify S11/S12.
c = 0: ISO code
1: EIA code
• Explanation
This code opens a specified line according to the control
conditions to make it usable.
• Explanation
This code closes an open line.
When a line is closed, the completion code is always 0
(normal termination).
- 120 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
• Explanation
This code reads one byte of received data and stores it in a
specified macro variable.
• Explanation
This code sends data in a specified format.
The addresses to be specified are the same as those of screen
display control G243. See Section 6.1.2.4, "Character
display" for details.
When a line is opened in reception control mode, data
transmission cannot be executed. If an attempt is made to
execute it, a completion code of 20 is set.
• Explanation
This code sets the macro variable data received from a line
opened in reception control mode into the macro variable
having a specified number.
- 121 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
LF N P LF
NOTES
1 G337 is a one-shot code.
2 In a significant information section, any codes other
than "LF," tape end "%," addresses "N" and "P," and
subsequent numeric data are ignored.
- 122 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
Input of macro variable data
To read the following data in which macro variable
number address "N" is omitted, enter the following:
G330 Pp Bp ..... ;
G337 P15000 Q20 R99 ; The data for the next 20 variables is
IF [#8539 NE 0] GOTO 888 ; stored in variables #15000 to #15019.
- 123 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
NOTES
1 The value specified for address F is interpreted in
the same way as that specified with screen display
control G243, except F-9.8 and F-9.9. See Section
6.1.2.4, "Character display" for details.
F-9.8 and F-9.9 will be described in detail later.
2 The value specified for address Z is interpreted in
the same way as that specified with screen display
control G243. See Section 6.1.2.4, "Character
display" for details.
• Explanation
This code converts specified macro variable data to a
predetermined tape format and sends it from a line opened in
transmission control mode The output code depends on the
C specification when the line is opened.
The output data tape format is the same as the input format:
Address "N" for the first variable number and address "P" for
variable data are output to the first block, the specified
number of variable data items are output consecutively to the
subsequent blocks, with address "P," and finally, the tape
end ("%") code is output.
% LF N3000P1234 LF P5678 LF %
% LF CR CR N3000P1234 LF CR CR P5678 LF CR CR %
- 124 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 f is set to 9.3 when the power is turned on. When a
value is specified for address f, that value is stored.
When F is omitted, the previously specified value
takes effect.
2 z is set to 0 when the power is turned on. When a
value is specified for address Z, that value is stored.
When Z is omitted, the previously specified value
takes effect.
- 125 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
Macro variable output
NOTES
1 G338 is a one-shot G code.
2 If improper data is specified for the variable number,
output processing is interrupted and a completion
code of 115 is set.
- 126 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
Program in which cancellation is taken into
consideration
09000;
N1 G330 P101 B10 S12 C0; Line open
N2 IF [#8539 NE 0] GOTO 10;
N3 G335 P500; 1-byte reception
N4 IF [#8539 NE 0] GOTO 11;
N5 G331; Line close
N11 G331;
N12 G243 X0 Y1 (DATA INPUT ERROR);
NOTE
Cancellation by using parameters No. 8540 and
setting CAN (bit 1 of parameter No. 8507) to 1 is
also effective to the transmission/reception
commands executed by auxiliary macros. If
transmission/reception is to be performed by an
auxiliary macro, therefore, the possibility that the
cancel key may be pressed regardless of the state
of the auxiliary macro must be taken into
consideration during programming.
• Explanation
When a line is opened in reception control mode, with one of
address L, F, and A specified, it is possible to search for the
beginning of a specified file on the FANUC cassette tape.
(1) Searching for the beginning of a file using its file name
EXAMPLE
To search for the beginning of the file "ABCD," set
65 (A), 66 (B), 67 (C), 68 (D), 32, 32, ..., and 32
(space) in 17 macro variables #100 to #116.
NOTES
1 The file name must consist of 17 characters. If the
file name consists of less than 17 characters, fill the
remaining variables with a value of 32 (space) to
make the name consist of 17 characters.
2 The file name can use alphanumeric characters and
spaces. The file name cannot, however, start with
a space. If this occurs, a completion code of 20 is
set.
- 128 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
(2) Searching for the beginning of a file using its file number
EXAMPLE
To search for the beginning of a file with file number
3, enter the following:
EXAMPLE
To search for the beginning of the file following the
one the beginning of which has been searched for,
enter the following:
• Explanation
When a line is opened in transmission control mode, with
either address L and F specified, it is possible to create a new
file on the FANUC cassette tape.
- 129 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
To create a file "ABCD," set 65 (A), 66 (B), 67 (C),
68 (D), 32, 32, ..., and 32 (space) in 17 macro
variables #100 to #116.
NOTES
1 The file name must consist of 17 characters. If the
file name consists of less than 17 characters, fill the
remaining variables with a value of 32 (space) to
make the name consist of 17 characters.
2 The file name can use alphanumeric characters and
spaces. The file name cannot, however, start with
a space. If this occurs, a completion code of 20 is
set.
3 The created file is added at the end of the already
registered ones.
EXAMPLE
To create a file with file number 3, enter the
following:
- 130 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 When a file is created with a file number, the existing
file with that file number is deleted, as well as any
files with the subsequent file numbers.
For the FANUC Handy File in DOS format, however,
the files with the file numbers subsequent to the
specified number are not deleted.
2 This method of creating a file with a file number
allows only an existing file number to be specified.
To add a new file, create it with a file name.
• Explanation
G339 can be used to read file information, delete a file, and
rename a file.
- 131 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
Order in which commands are issued
1) Open the line in file information control mode.
2) File information reading
3) Line close
4) Open the line in file information control mode.
5) File deletion
6) Line close
G339 P1 Ff Ll Ss ;
G339 P2 (Ll/Ff) ;
NOTE
When a file is deleted, any subsequent files are
moved backward, with their file numbers changed.
Bear this in mind when issuing a command with a
file number after deleting a file.
- 132 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
G339 P3 Ll Ff ;
Specify the file number of the file to be renamed and the new
file name.
Value Description
0 Normal termination
1 An illegal command was issued.
3 No line function option.
10 Line error (DR signal off)
11 Line error (CD signal off)
12 Line error (overrun error)
13 Line error (framing error)
14 Line error (buffer over error)
15 The line is not open.
20 Invalid parameter
G336 or G338 was issued in reception control mode.
G335 or G337 was issued in transmission control mode.
G339 was specified in a mode other than file control mode.
- 133 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Value Description
21 Invalid data format
22 Invalid file number
23 A file with the number specified with the file information reading code
does not exist.
30 The line is busy.
99 With macro variable input function G337, the continuous reading of
macro variables is possible.
115 An undefined variable number is specified.
200 The specified time has elapsed since the system entered the data
transmission/reception waiting state.
The cancel key was pressed in the data transmission/reception
waiting state.
255 There is no receive data.
- 134 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
6.6.1 General
EXAMPLE
O0001; Block No. 1
G00 X10; Block No. 2
M03 S1000; Block No. 3
:
#100= 13 Address M
#101= 3 Value
#102= 19 Address S
#103= 1000 Value
#104= 27 Address EOB
- 135 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Control variables
#8520: Program number specification
#8521: Block number specification
#8522: Storage variable number specification
#8523: Variable number for specifying the number of
decimal places
#8526: Background editing status (read-only)
#8527: Number of registered programs (read-only)
#8528: Free-space capacity of CNC program memory (read-
only)
#8529: Completion code (read-only)
Control codes
G370: Newly registers a program.
G371: Deletes a program.
G375: Reads a specified block.
G376: Writes a block.
G377: Deletes a block.
G322: Condenses a program.
G328: Reads a specified character-type block.
G329: Writes a specified character-type block.
NOTE
When the power is switched on, #8520 to #8523 are
reset to 0.
• Explanation
To newly register a program, issue G370 by specifying a
program number for the program.
- 136 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
To register O0002:
#8520=2;
G370;
IF [#8529 NE 0] GOTO 900;
Registration completed
N900;
Error
EXAMPLE
O0002 %
• Explanation
To delete a program, issue G371 by specifying the program
number of the program.
EXAMPLE
To delete O0003:
#8520=3;
G371;
IF [#8529 NE 0] GOTO 900;
Deletion completed
N900;
Error
- 137 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Explanation
A block can be read into a specified variable area by
specifying its program number and block number. The
block number used here is relative to the O-number block,
which is counted as block No. 1. Therefore, it is different
from a sequence number (Nxxxx). A block number is used
also in G376, G377, G328, and G329.
EXAMPLE 1
O0004;
G92 X0. M08;
G90 G00 X10.5 M05;
Assuming the above steps, the variable area will be:
#8520=4;
#8521=3;
#8522=100;
G375;
IF [#8529 NE 0] GOTO 900;
Read completed
N900;
Error
#100= 7 Address G
#101= 90 Value
#102= 7 Address G
#103= 0 Value
#104= 24 Address X
#105=10.5 Value
#106= 13 Address M
#107= 5 Value
#108= 27 Address EOB
- 138 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE 2
O0004;
G92 X0. M08;
M02
%
Assuming the above steps, the variable area will be:
#100= 13 Address M
#101= 2 Value
#102=28 Address EOR
EXAMPLE 3
O0004;
G92 X0. M08;
%
Assuming the above steps, the variable area will be:
• Explanation
Program data created in a variable area can be written at the
end of a block specified using a program number and block
number. The maximum allowable number of variable data
items is specified using address P. If there is address EOB
within the specified variable data, the data up to the EOB is
written. If there is address EOR, the data that precedes the
EOR is written. If there is neither EOB nor EOR, a number
of data items specified using address P are written.
- 139 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
O0004;
G92 X0. M08;
G90 G00 X10.5 M05;
Assuming the above steps, the variable area will be:
#8520=4;
#8521=2;
#8522=100;
#100=7;
#101=1;
#102=24;
#103=20.5;
#104=6;
#105=1000;
#106=27;
G376 P7;
IF [#8529 NE 0] GOTO 900;
Write completed
N900;
Error
O0004;
G92 X0. M08;
G1 X20.5 F1000.;
G90 G0 X10.5 M05;
Specifying the location of a decimal point for each address when writing a
block
When writing a block, the number of decimal places can be
specified at each address. The number of decimal places at
address A is specified using a value assigned to a variable
number specified in #8523. The number of decimal places
for each address can be determined as follows:
- 140 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
#8523=501;
#501 is used to represent the number of decimal places at
address A.
#502 is used to represent the number of decimal places at
address B.
•
•
#525 is used to represent the number of decimal places at
address Y.
#526 is used to represent the number of decimal places at
address Z.
EXAMPLE
If address code = A and value = 1.2345678:
Decimal place
specification = <null> A1
=0 A1.
=1 A1.2
=2 A1.23
=3 A1.235 *
=4 A1.2346 *
=5 A1.23457 *
=6 A1.234568 *
=7 A1.2345678
EXAMPLE
If #8523 is 0, the least input increment at a specified
address is used.
Special example
Usually in G375 and G376, a block consisting of a word based
on a combination of address and value, and an EOB is used
as a unit of processing as stated above. Therefore, it is
impossible to use a macro variable to represent a block skip
command that is not accompanied by a value as shown below.
In this case, a <null> variable is used to represent it.
- 141 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
Block skip specification
/M00; → #100= 29 Address /
#101= <null> Value <null>
#102= 13 Address M
#103= 0 Value 0
#104= 27 Address EOB
• Explanation
G377 deletes a block specified using program and block
numbers.
EXAMPLE
#8520=4;
#8521=3;
G377;
IF [#8529 NE 0] GOTO 900;
Deletion completed
N900;
Error
• Explanation
G322 condenses program memory and sorts out free areas.
Using program number specification variable (#8520)
supports two program condense types (entire program
memory and specified programs). The result of condensing
is reported using a completion code (#8529).
If #8520 = 0
The entire program memory is subjected to condense
processing. First specify #8520 = 0, then issue condense
function control code (G322).
- 142 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE 1
#8520=0
G322
IF [#8529 NE 0] GOTO 900;
Entire memory condensed
N900;
Error
EXAMPLE 2
#8520=1234;
G322;
IF [#8529 NE 0] GOTO 900;
O1234 condensed
N900;
Error
• Explanation
If a specified CNC program block is not represented in word-
type format (format of address + value), this command can be
used to read the block into a specified variable area using
ASCII characters (in decimal notation). Control commands
(such as WHILE and IF) and functions (such as SIN, COS,
and FUP) are represented using special codes.
EXAMPLE 1
#8520=program number;
#8521=block number;
#8522=100; (read variable number)
G328;
IF [#8529 NE 0] GOTO 900; (error check)
- 143 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE 2
#8520=program number;
#8521=block number;
#8522=(read variable number)
G375; (reads a specified word-type block)
IF [#8529 EQ 253] GOTO 100;
••
N100 G328; (reads a specified character-type block)
• Explanation
If program data is not represented in word-type format, this
function can be used to write program data created in
character units. Program data is written to a specified
location by previously defining the program data using ASCII
code in a macro variable area and issuing this command.
The EOB and EOR are represented as ";" (59) and "%" (37),
respectively.
EXAMPLE
#8520=program number;
#8521=block number;
#8522=ASCII code string start number
G329P10;
IF [#8529 NE 0] GOTO 900; (error check)
- 144 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 145 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
#8529 Description
0 Normal end.
1 An attempt was made to open a program file that was already open.
2 An attempt to open a program file failed because it was being used by
another user.
3 An attempt to open a program file failed because it did not exist.
4 An attempt was made to edit a program that was running.
10 A specified program was not found (has not been registered).
11 An existing program number was specified (impossible to newly create).
12 There is no free space in part program storage.
13 There is no free space in the directory (too many programs to be registered).
15 An attempt was made to edit a word that could not be.
16 An attempt was made to edit a program that could not be.
100 A specified program is already being edited in background mode.
101 The data protection key is off.
102 An incorrect program number was specified.
103 An incorrect block number was specified.
104 An address not included in the address code table was encountered during
editing (not in "address + value" format).
105 A macro variable number for editing is incorrect.
253 A specified block is not in word-type (address + value) format.
255 Parameter PCR (bit 7 of parameter No. 8508) is 0.
A block number greater than that of a block containing an EOR was
specified.
6.6.3 Limitations
Foreground operation
This function basically runs in CNC background editing
mode. Running a created or edited program in foreground
mode requires that the program be selected. This function
does not output BGEDT<F043#3>, which is an output signal
indicating that CNC background editing is in progress.
- 146 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Hexadecimal
Hexadecimal
Hexadecimal
Instruction
Instruction
Instruction
Instruction
Decimal
Decimal
Decimal
Decimal
IF 258 102H THEN 271 10FH BIN 283 11BH SETVN 295 127h
WHILE 259 103H XOR 272 110H FIX 284 11CH ADP 296 128H
GOTO 260 104H OR 273 111H FUP 285 11DH POW 297 129H
DO 261 105H AND 274 112H ROUND 286 11EH FGEN 298 12AH
END 262 106H ACOS 287 11FH FDEL 299 12BH
GE 264 108H SIN 276 114H ASIN 288 120H FOPEN 300 12CH
GT 265 109H COS 277 115H LN 289 121H FCLOS 301 12DH
LE 266 10AH TAN 278 116H EXP 290 122H FPSET 302 12EH
LT 267 10BH ATAN 279 117H POPEN 291 123H FREAD 303 12FH
NE 268 10CH SQRT 280 118H PCLOS 292 124H FWRIT 304 130H
EQ 269 10DH ABS 281 119H DPRNT 293 125H
MOD 270 10EH BCD 282 11AH BPRNT 294 126H
- 147 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
#100=#8553 ; → The cutting time is read into #100.
#8553=0 ; → The cutting time is preset to 0; the
related parameters (parameter Nos.
103 and 104) are also preset to 0.
EXAMPLE
#100 = #8554 ; --- The cutting distance is read
into #100.
#8554 = 0 ; --- The cutting distance is preset
to 0.
- 148 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Cautions
CAUTIONS
1 Using the functions for reading and presetting a
cutting distance requires that:
Parameter PCR (bit 7 of parameter No. 8508) = 1
Parameter CLG (bit 6 of parameter No. 8508) = 1
2 The tool travel distance is added up into #8554 at
the start of a cutting block. Even if a cutting block
is stopped prematurely, for example, due to a
reset, therefore, the travel distance specified in the
block is included in the sum.
3 Switching on the power does not reset #8553 and
#8554 to 0. The user is responsible to manage
these variables.
- 149 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
If the relative coordinate of the first axis is -123.456,
executing the following steps sets #500 with -123456.
#8997 = 500;
#8998 = 1; (acquires the information about the
first axis)
#500 = #8999;
• Cautions
CAUTIONS
1 If a value that does not fall in a range between 1
and the maximum allowable number of controlled
axes is specified in #8998, #8999 is set with <null>.
2 When the power is switched on, #8999 is reset to
0.
3 The unit of a read value is the least input increment
for a specified axis.
• Format
G360 Aa Qq;
A: Controlled-axis number to be subjected to presetting
(1 to the maximum allowable number of controlled
axes)
Q: Coordinate to be preset
- 150 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
To preset the relative coordinate of the first axis to
-123.45, issue:
G360 A1 Q - 123450 ;
• Cautions
CAUTIONS
1 If address A is specified as a value that does no fall
in a range of 1 to the maximum allowable number
of controlled axes, or it is not specified, G360 is
ignored.
2 The unit of address Q is the least input increment
of the specified axis.
- 151 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Format
G315 P (processing code) K (number of data items to
be processed);
P001 (P1) : Stores data from #8511 to K consecutive
variables starting at the one specified in
#8514.
P002 (P2) : Transfers data from K consecutive
variables starting at the one specified in
#8512 to K consecutive variables starting at
the one specified in #8514 (transfer in
ascending order).
P003 (P3) : Transfers data from K consecutive
variables starting at the one specified in
#8512 to K consecutive variables starting at
the one specified in #8514 (transfer in
descending order).
P101 : Stores data from #8511 to K consecutive
array variables starting at array variable
#1 specified in #8514 and #8515.
- 152 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
If #8512 = 30000 and #8514 = 30010,
G315 P2 K3; is equivalent to the following steps:
#30010 = #30000
#30011 = #30001
#30012 = #30002, and
G315 P3 K3; is equivalent to the following steps:
#30012 = #30002
#30011 = #30001
#30010 = #30000
- 153 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
If #8516 = 10, #8517 = 5, and #8519 = 30100,
(1) #1 with #8512 = 1 and #8513 = 1 specified
corresponds to #30100.
(2) #10 with #8512 = 3 and #8513 = 2 specified
corresponds to #30179.
NOTE
1 When using variables #1 to #99 to reference P-
CODE variables as array-type, set #8518 = 1. If
#8518 = 0, an alarm is issued, because #1 to #33
are treated as local variables and #34 to #99 are
treated as unusable. When the power is switched
on, #8518 = 0.
Caution
CAUTION
1 No check is made on any variable and calculated
variable number for validity. Use a macro
program to make validity checks if necessary.
- 154 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Control
Set value Description
variable
8990 100 Writes a torque limit override value.
101 Reads a torque limit override value.
8991 1 to maximum allowable Control axis number
number of controlled axes
8992 0 to 255 Torque limit override value
8993 0 or -1 Completion code (0: Normal end, -1:
Abnormal end)
Cautions
CAUTIONS
1 When the power is switched on, the torque limit
override value for each axis is set to 100%.
2 If an attempt was made to assign a value out of a
range between 0 and 255 to #8992, the command is
ignored.
Parameter
#7 #6 #5 #4 #3 #2 #1 #0
1802 TQO
- 155 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 156 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTE
If a machine tool has both analog and serial
spindles, the first and second axes are permanently
set as serial spindle, and the third axis, as analog
spindle.
- 157 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 158 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTE
These variables cannot be write-accessed.
- 159 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.13.1 General
NOTES
1 If an integer out of a range between 1 and 24 is
specified in #8602, the control command is
ignored.
2 When the power is switched, #8602 = 0.
- 160 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
• Explanation
This command specifies rapid traverse for the PMC
controlled axis. Address X specifies a travel distance always
in incremental mode.
• Explanation
This command specifies cutting feed for the PMC controlled
axis. Address X specifies a travel distance always in
incremental mode. The feedrate is specified using address
F.
• Explanation
This command specifies dwell for the PMC controlled axis.
Address P or X specifies a dwell value.
• Explanation
This command specifies a reference position return for the
PMC controlled axis.
- 161 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Explanation
This command specifies an auxiliary function for the PMC
axis control interface. Address M specifies an auxiliary
function code.
• Explanation
This command reads the status signal for the PMC axis
control interface into the corresponding variable specified at
address P.
#7 #6 #5 #4 #3 #2 #1 #0
CNCAx DENx MFnX BUFx
x : PMC control axis number
n : Auxiliary function selection number ... this function
uses 1.
- 162 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
When MFnX = 1, G348 P100; results in the
following:
#100 = 8
• Explanation
This command writes a value specified at address P as a
command signal for the corresponding PMC axis control
interface.
#7 #6 #5 #4 #3 #2 #1 #0
RSTx STPx SBKx MSBKx
x : PMC control axis number
n : Auxiliary function selection number ... this function
uses 1.
EXAMPLE
When MFnX = 1, G348 P100; results in the
following:
#100 = 8
EXAMPLE
When RSTx = 1:
G349 P64; (64 = 01000000b)
- 163 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Explanation
This command performs machine coordinate system
positioning for the PMC controlled axis. Address X specifies
a travel distance using an absolute position in the machine
coordinate system.
• Explanation
This command specifies the override to be applied to the
cutting feed for the PMC controlled axis using a value at
address P. The override is represented in percent and can
be set to any value in a range between 0% and 255%. The
specified override value remains valid until another override
change command is executed. It is set to 100%, when the
power is switched on.
6.13.3 Limitations
Command buffering
PMC-based axis control is implemented by issuing more than
one commands sequentially. So, command blocks are
buffered on the CNC side. To put another way, when the
CNC is executing a block, another command can be issued as
long as the CNC's buffer has room to receive it. Note,
however, that if the buffer has no room to receive a new
command, the new command is kept waiting while the
previous command is being executed, that is, until the
previous command is finished to create room in the buffer.
Executing G3** causes buffering; so the PMCAx (axis control
command read strobe signal) is not needed.
- 164 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Unit of data
The travel distance (dwell value) specified at address X and
the feedrate specified at address F should be represented in
the least input increment of the specified axis.
6.13.4 Cautions
CAUTIONS
1 The PMC should use only the auxiliary function
completion signal FINnX for the PMC controlled
axis used with this function.
2 When this function is performing PMC axis control,
do not issue a control command from the PMC
side. To be specific, do not issue a PMC axis
control command, for example, by causing the
conversational macro (talk macro) to use the UO
signal to inform the PMC that PMC axis control is
under way and eventually allowing the PMC to
reference this signal. Be careful especially when
a ladder or macro program is updated to add or
change a PMC axis control sequence.
3 Once this function is used to perform PMC axis
control, before causing the PMC to perform PMC
axis control to the same axis, stop the macro
program (if it has been activated) and reset the
target axis on the PMC side (set the RSTx to 1).
- 165 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.14.1 General
File control first requires that a user file area be set up.
To set up the user file area, follow the steps below:
- 166 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
13. When the IPL screen appears again, press the 0 and
keys to select "0. END IPL."
14. The IPL screen is exited, and a usual screen appears.
- 167 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.14.3 Setting
The maximum value that can be set as a user file area varies
with the free space in the backup memory. The size of the
backup memory free space is displayed at SRAM FREE in
step 4 of the setup procedure.
Actually, the maximum value that can be set is as follows:
(Backup memory free space + current user file area size)
The current user file area size is displayed at USER FILE
AREA in step 4 of the setup procedure.
- 168 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
[Example of setup]
<1> • User file area = 10
• If the number of files that can be generated in
the user file area = 8, the size that can be
allotted is:
[{10 - (1 + 8/8)} × 240 ] = 1920 [bytes]
<2> • User file area = 100
• If the number of files that can be generated in
the user file area = 48, the size that can be
allotted is:
[{100 - (1 + 48/8)} × 240] = 22320 [bytes]
6.14.4 Error messages
Message Description
FILE AREA TOO LARGE A specified user file size is greater than the
maximum size that can be set up.
FILE AREA TOO SMALL The relationship between the user file area size and
the number of files that can be generated in the
user file area does not satisfy the condition stated in
item 2 above.
Generating a file
Function This command generates a file.
Format FGEN (file-number, file-size, status-variable-number)
Explanation The <file-number> parameter numbers a file to be generated.
The file is accessed using this number. See Table 6.14.6 (a)
for the values that can be used as file numbers.
The <file-size> parameter specifies the size of a file to be
generated. The unit of the size is bytes.
The <status-variable-number> parameter specifies the macro
variable number to which the execution result of the command
is returned. The user must check this value. See Table
6.14.6 (e) for the status values.
Sample FGEN (200,120,100)
statement This statement generates a file that is numbered 200 and is
120 bytes large. The result of executing the statement is
returned to macro variable #100.
Deleting a file
Function This command deletes a file.
Format FDEL (file-number, status-variable number)
- 169 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 170 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Opening a file
Function This command opens a file.
Format FOPEN (file-number, access-mode, status-variable-number)
Explanation The <file-number> parameter specifies a file to be opened. See
Table 6.14.6 (a) for the values that can be used as file numbers.
The <access-mode> parameter specifies a read or write mode.
See Table 6.14.6 (b) for the access mode values that can be
specified.
The <status-variable-number> parameter specifies the macro
variable number to which the execution result of the command is
returned. The user must check this value. See Table 6.14.6
(e) for the status values.
This status variable number is valid also for FCLOS, FREAD,
FWRIT, and FPSET.
Caution Up to 10 files can be open at the same time.
The file open command cannot be executed for a file that is
already open.
Sample FOPEN (200,1,100)
statement This statement opens file No. 200 in both write and read modes.
The result of executing the statement is returned to macro
variable #100.
Closing a file
Function This command closes a file.
Format FCLOS (file-number)
Explanation The <file-number> parameter specifies a file to be closed. See
Table 6.14.6 (a) for the values that can be used as file numbers.
The result of executing this command is returned to the macro
variable number specified in FOPEN. The user must check this
value. See Table 6.14.6 (e) for the status values.
Sample FCLOS (200)
statement This statement closes file No. 200. The result of executing this
statement is returned to the status variable number specified
when the file was opened.
- 171 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 172 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
6.14.6 Cautions
CAUTIONS
1 To read data from a file, specify the same conditions
as used when the data was written. (Satisfy the
following conditions.)
• The file pointer for reading points to the same
location as for writing.
• The data type for reading is the same as for
writing.
If the above conditions are not satisfied, the read
data may differ from the write data.
2 If the data type is binary form 1 or 2, writing <null>
data results in 0 being written.
Value Description
200 to File
999999999
Table 6.14.6 (a) File Numbers
Value Description
0 Read mode
1 Read and write mode
Table 6.14.6 (b) Access Mode Values
Value Description
0 Floating-point form (8 bytes)
2 Binary form 1 (word type: 2 bytes)
3 Binary form 2 (long type: 4 bytes)
Table 6.14.6 (c) Data Type Values
Value Description
0 Sets the pointer to the start point.
1 Sets the pointer relative to the start point.
2 Sets the pointer relative to the current location.
Table 6.14.6 (d) Pointer Type Values
- 173 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Value Description
0 Normal end
1 The specified file is missing.
2 The specified file is not open.
3 A maximum number of files that can be open at the same
time (10) are already open.
4 A maximum number of files that can be generated at the
same time (10) have already been generated.
5 The file area is already full.
6 The specified pointer is invalid.
7 The specified file size is invalid.
8 The attempt to open the file failed.
9 The specified file has not been closed.
10 The specified access mode is invalid.
11 An existing file was specified.
12 An I/O error has occurred.
13 The specified file number is invalid.
14 The specified data type is invalid.
Table 6.14.6 (e) Status Values
- 174 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
7 6 5 4 3 2 1 0
0BYTE AX4- AX4+ AX3- AX3+ AX2- AX2+ AX1- AX1+
- 175 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLES
1 If #8605 and #8606 have a binary number of
1000000000000001, they indicate the positive
direction of the first axis (AX1+) and the negative
direction of the eighth axis (AX8-). This binary
number is equivalent to 32769 in decimal.
2 If #8607 and #8608 have a binary number of
1000000000000001, they indicate the positive
direction of the seventeenth axis (AX17+) and the
negative direction of the twenty-fourth axis (AX24-).
This binary number is equivalent to 32769 in
decimal.
NOTE
Set data in #8607 and #8605 in the stated
sequence. Interlock begins when data is set in
#8605.
Consider the following example.
#8607=32769;....(Positive direction of the
seventeenth axis, negative
direction of the twenty-fourth axis)
#8605=1;............(Positive direction of the first axis)
At this point, interlock is applied
to the first, seventeenth, and
twenty-fourth axes.
- 176 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
Movement axis and direction variables for the rise time of the SKIP signal
(#8606 and #8608)
NOTE
Any value can be written to neither #8606 nor
#8608.
- 177 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.16.1 General
Method of using
Set #8997 with the ID No. of the system information to be
referenced.
If the system information depends on the controlled axis or
spindle, set #8998 with the number of the controlled axis or
spindle.
Now read-accessing #8999 enables you to view the
information about the system.
Then, #8996 indicates whether the window function was
executed normally (0 for normal end and -1 for abnormal
end).
- 178 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE 1
Alarm information
(1) PS alarm (foreground) monitoring
#8997=1 ; → The system information
ID for alarms is 1.
#500=#8999 ; → Acquires alarm
information.
#500=#500 AND 2 ; → Checks for a P/S alarm
condition.
IF[#500EQ0]GOTO 90 ;
#8997=30 ; → The system information
ID for P/S alarms is 30.
#500=#8999 ; → Acquires a P/S alarm
number.
#501=#8996 ; → Sets the result of
executing this function.
N90 M99 ;
When these steps are executed, #500 is set with a
PS alarm number, then #501 is set with information
about whether the window function was executed
normally.
(2) Axis-type OT alarm monitoring
(monitoring stored stroke limit 1 for the positive
direction of the first controlled axis)
#8997= 11 ; → The ID for axis-type OT
alarm flag 1 is 11.
#8998= 1 ; → Axis number (first axis)
#500=#8999 ; → Acquires the contents of
ID No. 11.
#500=#500 AND 1 ;
#501=#8996 ; → Sets the result of
executing this function.
N90 M99 ;
When these steps are executed, #500 is set with 1 if
the tool is in the forbidden area for stored stroke
limit 1. Then #501 is set with information about
whether the window function was executed
normally.
- 179 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE 2
Parts total
#8997=200 ; → The ID for the parts total
is 200.
#500= 8999 ;
#501= 8996 ; → Sets the result of
executing this function.
When these steps are executed, #500 is set with the
parts total. Then #501 is set with information
about whether the window function was executed
normally.
NOTE
#8996 is set with -1 (abnormal end) if:
• A value assigned to #8997 is invalid, or
• A value assigned to #8998 is greater than the
maximum allowable number of controlled axes or
spindles.
- 180 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 181 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Spindles
First spindle : 1
Second spindle : 2
Third spindle : 3
Fourth spindle : 4
The alarm basic flag (ID No. 1) and alarm basic flag 2 (ID No.
50) indicate the category of an alarm (if occurs).
For details, see "Detail information about each alarm." Bit
information is output as 1 byte (0 to 128), 2 byte (0 to 32768),
or 4 bytes (0 to 2147483648) to #8999 (see the example given
for the alarm basic flag).
- 182 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 Information about the alarms added in the FS15i
can be read only using ID Nos. 50 to 64 (new alarm
information).
2 Some spindle-related alarms were changed in the
FS15i (OT →SP). For details, see "Detail
information about each alarm."
3 The detail bit information about an alarm that exists
in both the FS15-B and FS15i and has the same
category and number for both systems can be read
using both ID Nos. 51 to 63 (4-byte data) and ID
Nos. 2 to 19 (1-byte data), because the
corresponding bit in both data becomes 1. (See
the example given in "Detail information about
each alarm.")
NOTE
The specifications of some macro executor
functions in parameter 15I (bit 3 of parameter No.
8558) original to the FS15i have been changed .
For details, see 9.1, "Compile Parameters."
- 183 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Background PS alarm:
When this bit is 1, it means that the P/S
alarm number (background) is set with
data.
Foreground PS alarm:
When this bit is 1, it means that the P/S
alarm number (foreground) is set with
data.
OH alarm : When this bit is 1, it means that the OH
alarm flag or axis-type OH alarm flag is
set with data.
SW alarm : When this bit is 1, it means that the SW
alarm flag is set with data.
OT alarm : When this bit is 1, it means that the OT
alarm flags (1 to 4), axis-type OT alarm
flags (1 to 3), or axis-type OT2 flags are set
with data.
External alarm : When this bit is 1, it means that the
external alarm flags (1 to 4) are set with
data.
SR alarm : When this bit is 1, it means that the SR
alarm flag is set with data.
SV alarm : When this bit is 1, it means that the SV
alarm flag, SV2 alarm flag, axis-type SV
alarm flags (1 to 5), or axis-type SV2 flags
(1 to 5) are set with data.
IO alarm : When this bit is 1, it means that the IO
alarm flag or IO2 alarm flag is set with
data.
PW alarm : When this bit is 1, it means that the PW
alarm flag is set with data.
- 184 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
If the foreground PS alarm and external alarm have
occurred, 258 (102h) is output to #8999.
EXAMPLE
The information about OT00007 can be read using
both ID No. 11 and ID No. 53.
When #8997 = 11 →#8999 = 64, and when #8997
= 53 →#8999 = 32.
- 185 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
• Bit information
OH alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
01h OH0001
02h OH0002
04h Undefined
08h Undefined
2
10h Undefined
20h Undefined
40h Undefined
80h Undefined
SW alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
01h SW0000
02h Undefined
04h Undefined
08h Undefined
3
10h Undefined
20h Undefined
40h Undefined
80h Undefined
PW alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
01h PW0000
02h PW0100
04h Undefined
08h Undefined
4
10h Undefined
20h PW0102
40h PW0103
80h Undefined
- 186 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
OT alarm flag 1
ID No. Bit information
Alarm number
(#8997) (#8999)
01h Undefined
02h Undefined
04h Undefined
08h Undefined
5
10h Undefined
20h Undefined
40h Undefined
80h Undefined
OT alarm flag 2
ID No. Bit information
Alarm number
(#8997) (#8999)
01h Undefined
02h Undefined
04h Undefined
08h Undefined
6
10h Undefined
20h Undefined
40h Undefined
80h Undefined
OT alarm flag 3
ID No. Bit information
Alarm number
(#8997) (#8999)
01h Undefined
02h OT0120
04h OT0121
08h OT0122
7
10h OT0123
20h OT0124
40h OT0125
80h OT0126
OT alarm flag 4
ID No. Bit information
Alarm number
(#8997) (#8999)
01h OT0127
02h OT0128
04h OT0129
08h OT0130
8
10h OT0150
20h Undefined
40h OT0131
80h Undefined
- 187 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
IO alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
01h Undefined
02h Undefined
04h Undefined
08h Undefined
9
10h Undefined
20h IO0032
40h IO0030
80h Undefined
SV alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
01h SV0030
02h Undefined
04h Undefined
08h SV0119
10
10h SV0120
20h Undefined
40h Undefined
80h Undefined
- 188 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 189 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 190 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 191 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 192 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 193 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 194 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 195 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 196 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 197 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 198 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
SP alarm flag
ID No. Bit information
Alarm number
(#8997) (#8999)
00000001h Undefined
00000002h SP0201
00000004h SP0202
00000008h SP0996
00000010h SP0997
00000020h SP0998
00000040h SP0999
00000080h Undefined
00000100h Undefined
00000200h Undefined
00000400h Undefined
00000800h Undefined
00001000h Undefined
00002000h Undefined
00004000h Undefined
00008000h Undefined
59
00010000h Undefined
00020000h Undefined
00040000h Undefined
00080000h Undefined
00100000h Undefined
00200000h Undefined
00400000h Undefined
00800000h Undefined
01000000h Undefined
02000000h Undefined
04000000h Undefined
08000000h Undefined
10000000h Undefined
20000000h Undefined
40000000h Undefined
80000000h Undefined
- 199 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 200 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 201 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 202 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
- 203 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
6.16.3 The number of controlled axes and the number of servo axes
EXAMPLE
If #8997 = 100, 6 read into #8999 indicates that the
number of CNC controlled axes is 6. In this case,
parameter No. 9000 is 6.
EXAMPLE
If #8997 = 202, 1 read into #8999 indicates a
cutting time of 1 hour. In this case, parameter
Nos. 0103 an 0104 are 0 and 60, respectively.
- 204 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
The states of diagnosis Nos. 1000 and 1001 are output using
ID Nos. 300 and 301, respectively.
The output data is one byte of bit information, that is, an
integer ranging from 0 to 128.
EXAMPLE
If #8997 = 300, 96 (60h) read into #8999 means
that the spindle one revolution signal is being
awaited during threading and the position coder is
being awaited to rotate during spindle feed per
revolution.
- 205 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
- 206 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
EXAMPLE
Assume the following for a system of series NW10
and edition 01:
#8997=8000 ;
#500=#8999 ; → Saves system series information
digit 4
#8997=8001 ;
#501=#8999 ; → Saves system series information
digit 3
#8997=8002 ;
#502=#8999 ; → Saves system series information
digit 2
#8997=8003 ;
#503=#8999 ; → Saves system series information
digit 1
#8997=8005 ;
#504=#8999 ; → Saves system edition information
digit 2
#8997=8006 ;
#505=#8999 ; → Saves system edition information
digit 1
#500, #501, #502, and #503 are set with 78, 87,
49, and 48, respectively. The hexadecimal
representations of these values are 4Eh, 57h, 31h,
and 30h, respectively; so it turns out that digit 4 =
N, digit 3 = W, digit 2 = 1, and digit 1 = 0.
Similarly, #504 and #505 are set with 48 and 49,
respectively. The hexadecimal representations of
these values are 30h and 31h, respectively; so it
turns out that digit 2 = 0 and digit 1 = 1.
- 207 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
Format
Input
#8530 : Start control variable number in the search target
data table (setting: 1 or greater)
#8651 : The number of macro variables that forms a set in
the data table (setting: 1 or greater)
#8652 : The number of search target data table sets
(setting: 1 or greater)
#8653 : Lower limit to the search value (sign and decimal
point can be entered)
#8654 : Upper limit to the search value (sign and decimal
point can be entered)
G400 : Search execution (searches for control variable X
that satisfies: #8653 ≤X ≤#8654)
Output
#8655 : The data table set number where a control variable
that satisfies the search condition is contained (0 or
greater), or
= -1: There is no control variable that satisfies the
condition.
= -2: The setting of any of #8650 to #8652 is
invalid (0 or less has been set).
= -3: #8653 ≤#8654 is not satisfied.
#8650 : Start control variable number in the set next to the
retrieved data table set number (#8655)
#8652 : Set value minus the number of sets that have
already been retrieved
- 208 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
1 If #8655 = -1:
#8650 = 1 (next control variable number in the
search target data table)
#8652 = 0
2 The set number begins with 0, but the minimum
value of #8652 (the number of search data table
sets) is 1.
3 If more than one control variable satisfies the
search condition, a search ends by returning the
data table set number that contains the first control
variable to be found.
4 Only #8655 is a read-only variable.
EXAMPLE
Data table
#40000
#8650=40000 ;
#8651=10 ;
#8652=400 ;
Set 0 #8653=10.5 ;
#8654=11.5 ;
#G400 ;
#40010 #100=#8655 ;
With the above steps, this function
searches the data table shown at the
left, in which the first control variable
begins with #40000 and ten control
variables form one set, for a control
Set 1
variable that satisfies the condition
10.5 ≤ X ≤ 11.5. If it finds such a
control variable, it returns the set
number where the control variable is
contained, using #8655. If no such
control variable is found, -1 is
returned.
If X = #40011 (set 1), for example, executing G400
results in:
#8655 = 1 : Set 1
#8650 = 40020 : Start control variable number
in set 2
#8652 = 398 : 400 - 2
- 209 -
6.MACRO EXECUTOR FUNCTIONS B-63323EN-2/01
EXAMPLE
If the previous sample program is combined with
array-type references:
#8513=1 ;
#8516=10 ; *1)
#8517=1 ;
#8518=1 ; *2)
#8519=40000 ; *3)
#8650=40000 ;
#8651=10 ;
#8652=400 ;
#8653=10.5 ;
#8654=11.5 ;
G400 ;
IF[#8655 LT 0] GOTO 999 ;
---------- Go to the remaining
search processing
#8512=#8655 + 1 ; *4)
:
The data table elements of a set that was retrieved
can be referenced using #1 to #99 provided that
#8512, #8518, and #8519 will not be changed.
#8519=#8650 ; *5)
G400 ;
IF [#8655 LT 0] GOTO 999 ;
---------- Go to the remaining
search processing
#8512=#8655 + 1 ;
- 210 -
B-63323EN-2/01 6.MACRO EXECUTOR FUNCTIONS
NOTES
*1) Specifies the number of elements of a data table
set (number of control variables). The array-
type references that can be used are only #1 to
#99; so the maximum allowable number of
elements is 99.
*2) Before starting to make array-type references, set
#8518 = 1. #1 to #99 function as array-type
reference variables while #8518 = 1.
*3) Sets the start macro variable number of an array.
*4) Sets an array number (set number + 1) to be
used for array-type references.
This associates #1 to #99 as follows:
#1: = #[0 + [#8519 + [#8512 -1] * #8516]]
#2: = #[1 + [#8519 + [#8512 -1] * #8516]]
#3: = #[2 + [#8519 + [#8512 -1] * #8516]]
As many definitions as the number of elements
set in #8516 follow.
*5) To continue the second or subsequent searches,
just change the start macro variable number of the
array; array-type references can be continued
accordingly.
Cautions
CAUTIONS
1 This function is valid only with the conversational
macro (talk macro) and auxiliary macro functions.
2 The macro variable numbers in the search target
data table must be consecutive. Otherwise, a
search cannot be performed correctly. In
addition, be careful not to specify a nonexisting
control variable number or system variable as a
search target.
3 A search target control variable can be either a
custom macro variable or macro compiler-only
variable.
- 211 -
7.DEBUGGING FUNCTION B-63323EN-2/01
7 DEBUGGING FUNCTION
- 212 -
B-63323EN-2/01 7.DEBUGGING FUNCTION
7.1 General
NOTES
1 When using the debugging function, set bit 3
(DBG) of parameter No. 8502 to 1.
2 When the debugging function is used, entering
data form the keyboard displays the data in the
data input line even if the content of the data input
control variable (#8502) is 0.
- 213 -
7.DEBUGGING FUNCTION B-63323EN-2/01
Debugger screen
- 214 -
B-63323EN-2/01 7.DEBUGGING FUNCTION
ERROR a-bbbbbb-ccccc
a : 0 No error
1 An error occurred in macro statement specification.
2 An error occurred in NC statement specification.
bbbbbb : • For a macro statement, a variable number is
indicated. (For other than variables, 0 is indicated.)
• For an NC statement, a G code is indicated. (For
other than G code, 0 is indicated.)
When there is no error, 0 is indicated.
ccccc : Error No.
When there is no error, 0 is indicated.
For details of errors, see Section 10.1, "Error No. List."
(7) Target
The currently selected target is indicated.
(8) Single-block execution status
For single-block execution, ON is indicated. For
continuous operation, OFF is indicated.
(9) Break function status
When the break function is enabled, ON is indicated.
When the break function is disabled, OFF is indicated.
(10) Break conditions
Program number by which a break is caused
Sequence number by which a break is caused
Number of blocks by which a break is caused
Iteration count by which a break is caused
(11) Macro variables (five variables)
The macro variables with set numbers are indicated.
When P-CODE macro execution is stopped by single-
block execution or the break function, the macro
variables are re-displayed automatically.
NOTES
1 The number of executed blocks is preset to 0 when
the program end command (M99<Pp>) has been
executed in the main program of the P-CODE
macro.
2 When no sequence number is assigned to a block
in the P-CODE macro, the sequence number of the
previously executed block is indicated.
- 215 -
7.DEBUGGING FUNCTION B-63323EN-2/01
NOTE
When a character card is mounted, the part hidden
by the debugger screen is not displayed even after
the debugger screen is erased.
NOTE
When a P-CODE macro is stopped by single-block
execution or the break function, the key input mode
switches to the debugger input automatically.
- 216 -
B-63323EN-2/01 7.DEBUGGING FUNCTION
Setting a target
Set a P-CODE macro to be debugged. The P-CODE macro
must be in the stopped state. If the P-CODE macro is not
stopped, set single-block execution to ON to stop the macro.
To set a target, move the cursor to the target, then
Press INPUT . Pressing INPUT selects the conversational
macro (talk macro) and auxiliary macro alternately.
NOTE
When switching between targets is performed,
execution of the P-CODE macro that has been set
as the target so far starts. For a new target P-
CODE macro, single-block execution and the break
function are enabled.
Single-block execution
Enable single-block execution (set to ON). Move the cursor
to OFF in the single-block execution field. Press INPUT to set
ON. To reset the setting to OFF, press INPUT again. When
the setting is changed to ON during P-CODE macro
execution, the execution stops. To re-execute the macro,
press SHIFT and 1 .
Break function
P-CODE macro execution must be in the stopped state.
Move the cursor to the break condition you want to set.
Type a value, then press INPUT . Next, move the cursor to
OFF in the break condition field. Press INPUT to change the
setting to ON. To reset the setting to OFF, press INPUT
- 217 -
7.DEBUGGING FUNCTION B-63323EN-2/01
Program No.
AND
Sequence No.
OR
AND
Stop
Number of blocks
Iteration count
NOTES
1 The number of executed blocks is preset to 0 when
the program end command (M99<Pp>) has been
executed in the main program of the P-CODE
macro.
2 When no sequence number is assigned to a block
in the P-CODE macro, the sequence number of the
previously executed block is used to make a
decision on a break.
NOTE
When the target is a conversational macro (talk
macro), an execution restart automatically causes
key input to switch from the debugger to
conversational macro (talk macro).
Move the cursor to a value, type a new value, and press INPUT .
NOTE
Input of EMPTY is not allowed.
- 218 -
B-63323EN-2/01 7.DEBUGGING FUNCTION
Single-block execution
by parameter
If bit 2 (SBK) of parameter No. 8502 is set to 1, single-block
execution is enabled (ON) when the conversational macro
(talk macro) function has been executed to start the
debugger.
Single-block execution
by key
If the debugger has been started by executing the
conversational macro (talk macro) function, single-block
execution is enabled (ON) and disabled (OFF) alternately by
pressing SHIFT and 4 .
- 219 -
7.DEBUGGING FUNCTION B-63323EN-2/01
Debugging an auxiliary
macro
The auxiliary macro function allows an auxiliary macro to be
executed immediately after the CNC is turned on if the
program number of the auxiliary macro is set in the auxiliary
macro control variable (#8600). To debug an auxiliary
macro starting with the first block, follow the steps explained
below.
(1) Set bit 4 (VAR) of parameter No. 8502 to 1 to display the
P-CODE macro variable screen.
(2) On the P-CODE macro variable screen, set 0 in #8600.
(3) Start the debugger, and enable single-block execution
(ON).
(4) Change the target to the auxiliary macro.
(5) In #8600, set the program number of the auxiliary macro
you want to execute. Then, the first block of the
auxiliary macro is executed then stopped.
- 220 -
B-63323EN-2/01 8.OPERATION
8 OPERATION
- 221 -
8.OPERATION B-63323EN-2/01
Variable
Type Remarks
No.
#1 to 33 Local variables for a Local variables for the current nest
conversational macro are displayed. (For conversational
(talk macro) macros (talk macros), the local
variables only for nest 0 are
#1 to 33 Local variables for an displayed.)
auxiliary macro Display of these variables and display
of array type variables are mutually
exclusive.
#1 to 99 Array type variables Display of these variables and display
of local variables are mutually
exclusive.
#100 to Volatile common Variables for the P-CODE macro or
199 variables custom macro is displayed according
to bits 0 and 1 (MV0 and MV1) of
parameter No. 8503.
#200 to Nonvolatile common Variables for the P-CODE macro or
999 variables custom macro is displayed according
to bits 2 to 7 of parameter No. 8503
and bits 1 to 3 of parameter No. 8504
(MV2 to MVA).
#8500 to Control variables
8999
#30000 to P-CODE variables P-CODE variables as many as the
39999 number of variables set in bit 1 (EV2)
of parameter No. 8509 and parameter
No. 8549 are displayed.
#40000 to Extended P-CODE Extended P-CODE variables as many
99099 variables as the number of variables set in bit 0
(EV1) of parameter No. 8509 and
parameter No. 8550.
#99100 to Volatile custom macro Also used as custom macro common
99199 common variables variables.
#99200 to Nonvolatile custom macro Also used as custom macro common
99999 common variables variables.
- 222 -
B-63323EN-2/01 8.OPERATION
Method 1
Press function key several times until the P-CODE
MACRO variable screen appears.
Method 2
(1) Press function key .
(2) Press the CHAPTER key repeatedly until soft key
[P-CODE MACRO] is displayed.
(3) Press soft key [P-CODE MACRO].
NOTE
This screen is displayed according to the setting of
bit 4 (VAR) of parameter No. 8502.
- 223 -
8.OPERATION B-63323EN-2/01
NOTE
For #500 to #549, variable names are displayed only
when bit 2 (MV3) of parameter No. 8503 indicates
that these variables are also used as custom macro
common variables. For #99500 to #99550,
variable names are always displayed.
- 224 -
B-63323EN-2/01 8.OPERATION
Values of variables
The values of variables are displayed depending on
conditions as follows:
NOTE
Even when write to a common variable is permitted,
the variable value is not displayed in reverse video in
yellow if the variable is protected with the following
parameters:
Parameter Nos. 7036 to 7039: For custom macro
common variables
Parameter Nos. 8574 to 8577: For P-CODE
macro common
variables
For parameters for custom macro common
variables, refer to "FANUC Series 15i/150i-MA
Parameter Manual" (B-63330EN).
- 225 -
8.OPERATION B-63323EN-2/01
Setting a mode
Set the MDI mode. Alternatively, press the emergency stop
button to place the system in the emergency stop state.
Method 2
(1) Press soft key [NUMBER SEARCH].
(2) Type the number of a macro variable.
(3) Press soft key [EXEC].
Method 3
(1) Type the number of a macro variable.
(2) Press soft key [NUMBER SEARCH].
Inputting a value
(absolute input)
Method 1
(1) Press soft key [INPUT].
(2) Type the value you want to set.
(3) Press soft key [EXEC].
Method 2
(1) Type the value you want to set.
(2) Press soft key [INPUT].
Method 3
(1) Type the value you want to set.
(2) Press the INPUT key.
Inputting a value
(incremental input)
Method 1
(1) Press soft key [+INPUT].
(2) Type the amount by which you want to increase or
decrease the current setting.
(3) Press soft key [EXEC].
- 226 -
B-63323EN-2/01 8.OPERATION
Method 2
(1) Type the amount by which you want to increase or
decrease the current setting.
(2) Press soft key [+INPUT].
Inputting EMPTY
Press soft key [INPUT EMPTY].
As the value of the variable, DATA EMPTY is indicated.
Clearing to zero
Common variables (#100 to #999), P-CODE variables
(#30000 and up), extended P-CODE variables (#40000 and
up) can be cleared to zero at a time.
NOTES
1 The common variables protected by the following
parameters are not cleared:
Parameter Nos. 7036 to 7039: For custom macro
common variables
Parameter Nos. 8574 to 8577: For P-CODE
macro common
variables
For parameters for custom macro common
variables, refer to "FANUC Series 15i/150i-MA
Parameter Manual" (B-63330EN).
2 Custom macro common variables (#99100 to
#99999) are also cleared if the custom macro is
selected by bits 0 to 7 of parameter No. 8503 and
bits 1 to 3 of parameter No. 8504 (MV0 to MVA).
- 227 -
8.OPERATION B-63323EN-2/01
Variable
Type Remarks
No.
#100 to Volatile common P-CODE macro or custom macro
199 variables variables are output according to bits
0 and 1 (MV0 and MV1) of parameter
No. 8503.
#200 to Nonvolatile common P-CODE macro or custom macro
999 variables variables are output according to bits
2 to 7 of parameter No. 8503 and bits
1 to 3 of parameter No. 8504 (MV2 to
MVA).
#30000 to P-CODE variables Variables as many as the number set
39999 by bit 1 (EV2) of parameter No. 8509
and parameter No. 8549 are output.
#40000 to Extended P-CODE Variables as many as the number set
99099 variables by bit 0 (EV1) of parameter No. 8509
and No. 8550 are output.
• Output procedure
Method 1 (when specifying neither output file nor file
number)
(1) Press soft key [PUNCH].
(2) Press soft key [ALL VARIA.].
- 228 -
B-63323EN-2/01 8.OPERATION
• Output format
The values of macro variables are output as the hexadecimal
bit images of double-precision floating-point data.
%
G10L85P200(0000000000000000) When value is 0
G10L85P201(0000000000000000)
G10L85P202(FFFFFFFFFFFFFFFF) When value is <empty>
•
G10L86P300(0000000000000000) When value is 0
G10L86P301(0000000000000000)
G10L86P302(FFFFFFFFFFFFFFFF) When value is <empty>
•
G10L85P500(4024000000000000) For normal value
G10L85P501(4021000000000000)
G10L85P502(0000000000000000)
•
SETVN500[P-CODE00] Variable name
SETVN501[P-CODE01]
SETVN502[P-CODE02]
•
M02
%
- 229 -
8.OPERATION B-63323EN-2/01
NOTE
The portion SETVN500[...] to 549[...] is output only
when custom macro common variables are set by bit
2 (MV3) of parameter No. 8503.
• Mode setting
Set the MDI mode.
• Input procedure
Method 1 (when specifying neither file name nor file number
of an input file)
(1) Press soft key [READ].
(2) Press soft key [ALL VARIA.].
- 230 -
B-63323EN-2/01 8.OPERATION
NOTES
1 When variables are output to FANUC Floppy
Cassette, FANUC FA Card, FANUC Handy File, or
the memory card by using output method 1 (when
specifying neither output file name nor file number),
file name PCODE.TXT is set.
2 When FANUC Floppy Cassette, FANUC FA Card,
or FANUC Handy File is used for input/output of
variables, an input/output file can be specified with
a file name or file number.
3 When the memory card is used for input/output, an
input/output file can be specified with a file name.
NOTE
When display of the P-CODE macro variable screen
is suppressed (bit 4 (VAR) of parameter No. 8502 is
0), input/output is disabled on the floppy list screen
and memory card screen.
- 231 -
8.OPERATION B-63323EN-2/01
Method 1
(1) Press function key several times until the
PROGRAM DIRECTORY screen is displayed.
PAGE
(2) Use page keys PAGE
or cursor keys
Method 2
(1) Press function key .
PAGE
(3) Use page keys PAGE
or cursor keys
NOTE
This screen is displayed according to the setting of
bit 0 (DIR) of parameter No. 8502.
- 232 -
B-63323EN-2/01 8.OPERATION
- 233 -
8.OPERATION B-63323EN-2/01
Method 1
(1) Press function key several times until the last
block or active block screen is displayed.
Method 2
(1) Press function key .
(2) Press soft key [LAST] or [ACTIVE].
- 234 -
B-63323EN-2/01 8.OPERATION
- 235 -
8.OPERATION B-63323EN-2/01
Comment Call
PCDSUB Subprogram call
PCDMCR Macro call
PCDG66 Modal call
PCDG66.1 Modal call
NOTE
Program names cannot be used.
- 236 -
B-63323EN-2/01 9.PARAMETERS
9 PARAMETERS
- 237 -
9.PARAMETERS B-63323EN-2/01
#7 #6 #5 #4 #3 #2 #1 #0
8500 LD6 R10 R05
#7 LD6
1: Always set this bit to 1.
#7 #6 #5 #4 #3 #2 #1 #0
8502 NPE TMC EUI VAR DBG SBK DIR
NOTE
For P-CODE macros, program names cannot be
displayed.
- 238 -
B-63323EN-2/01 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
8503 MV7 MV6 MV5 MV4 MV3 MV2 MV1 MV0
#7 #6 #5 #4 #3 #2 #1 #0
8504 MVA MV9 MV8 ECK
- 239 -
9.PARAMETERS B-63323EN-2/01
NOTE
When command keys are extended, pressing
these command keys does not terminate the
conversational macro (talk macro) function, so a
corresponding screen does not appear. In this
case, 0 must be set in the conversational macro
(talk macro) start control variable (#8510) to
terminate the conversational macro (talk macro)
function.
#7 #6 #5 #4 #3 #2 #1 #0
8507 PWS NTV CAN
#7 #6 #5 #4 #3 #2 #1 #0
8508 PCR CLG BSC SSC TEC AC2 AC1
- 240 -
B-63323EN-2/01 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
8509 GMP PTC MCT EV2 EV1
- 241 -
9.PARAMETERS B-63323EN-2/01
- 242 -
B-63323EN-2/01 9.PARAMETERS
- 243 -
9.PARAMETERS B-63323EN-2/01
NOTE
The program number set in this parameter is set in
the conversational macro (talk macro) execution
control variable at power-up.
NOTE
The program number set in this parameter is set in
the auxiliary macro execution control variable at
power-up.
8538 Call code of subprogram call by range specification M code (lower limit)
8539 Call code of subprogram call by range specification M code (upper limit)
NOTES
1 If a value beyond the range is set, or if the value set
in parameter No. 8538 is greater than the value set
in parameter No. 8539, a subprogram call by range
specification M code is disabled.
2 M30, M98, M99, and the M codes used for macro
and subprogram calls are not used as a call code
even if these codes are within the set range.
- 244 -
B-63323EN-2/01 9.PARAMETERS
- 245 -
9.PARAMETERS B-63323EN-2/01
NOTE
• Macro calls by G codes (multiple specifications) are
disabled when:
<1> A value beyond the range exists in one of
these parameters.
<2> The G code range exceeds 9999.
<3> The program number range exceeds
99999999.
• G65, G66, G67, and the G code used for macro
call are not used as a call code even if they are
included in the set range.
NOTE
When the conversational macro (talk macro)
function is executed, a break is enabled if a non-
zero value is set in this parameter or parameter No.
8548. The program number set in this parameter
and the sequence number set in parameter No.
8548 are set as the break conditions.
- 246 -
B-63323EN-2/01 9.PARAMETERS
NOTE
When the conversational macro (talk macro)
function is executed, a break is enabled if a non-
zero value is set in this parameter or parameter No.
8547. The sequence number set in this
parameter and the program number set in
parameter No. 8547 are set as the break
conditions.
- 247 -
9.PARAMETERS B-63323EN-2/01
#7 #6 #5 #4 #3 #2 #1 #0
8555 X08 X07 X06 X05 X04 X03 X02 X01
#7 #6 #5 #4 #3 #2 #1 #0
8556 X16 X15 X14 X13 X12 X10 X09 X08
#7 #6 #5 #4 #3 #2 #1 #0
8557 X24 X23 X22 X21 X20 X19 X18 X17
#7 #6 #5 #4 #3 #2 #1 #0
8558 ACA P98 15I PWT XDL ACS
- 248 -
B-63323EN-2/01 9.PARAMETERS
- 249 -
9.PARAMETERS B-63323EN-2/01
#7 #6 #5 #4 #3 #2 #1 #0
8559 AP1
NOTE
When the Series 15B-compatible specifications are
selected, a parameter value of the Series 15B can
be reference by entering the parameter number.
Note that only parameters of which input
specifications are completely compatible with those
of the Series 15i can be referenced. If an attempt
is made to reference another type of parameter, a
empty(#0) is read as the value. If an execution
macro references that type of parameter, alarm
PS302 is issued.
- 250 -
B-63323EN-2/01 9.PARAMETERS
NOTE
The axis interlock function is disabled when:
<1> The address is beyond the R area.
<2> The bit position is not correct.
NOTE
If a value beyond the range is set, or if the value set
in parameter No. 8574 is greater than the value in
parameter No. 8575, write protection is not
provided.
- 251 -
9.PARAMETERS B-63323EN-2/01
NOTE
If a value beyond the range is set, or if the value set
in parameter No. 8576 is greater than the value in
parameter No. 8577, write protection is not
provided.
- 252 -
B-63323EN-2/01 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
8000 NLP
#7 #6 #5 #4 #3 #2 #1 #0
8600 08M 07M 06M 05M 04M 03M 02M 01M
#7 #6 #5 #4 #3 #2 #1 #0
8601 16M 15M 14M 13M 12M 10M 09M 08M
#7 #6 #5 #4 #3 #2 #1 #0
8602 24M 23M 22M 21M 20M 19M 18M 17M
- 253 -
9.PARAMETERS B-63323EN-2/01
#7 #6 #5 #4 #3 #2 #1 #0
8603 TCM
- 254 -
B-63323EN-2/01 10.APPENDIX
10 APPENDIX
- 255 -
10.APPENDIX B-63323EN-2/01
The error No. list given below explains the meanings of the
error Nos. displayed as follows:
• Error Nos. displayed on the debugger screen of the
debugging function
• Error Nos. displayed on the TALK MACRO screen when a
fatal error (an error that prevents continuation of
execution) occurs during execution of a conversational
macro (talk macro) or auxiliary macro, stopping the
execution of the macro
Error Nos. are classified as follows:
(1) 1 to 9999 : Numbers that match the PS/SR
alarm numbers
(2) 10001 and up: Fatal error numbers
(3) 10101 and up: Numbers displayed only on the
debugger screen
(4) 99999999 : Error No. when a conversational
macro (talk macro) terminates
forcibly.
The error Nos. from 1 to 9999 indicate errors in commands
that can be used also in the execution macro. For the
execution macro, a PS/SR alarm is issued when an error
occurs, and automatic operation must be stopped.
Therefore, the error Nos. from 1 to 9999 match the error Nos.
of PS/SR alarms. If an error No. from 1 to 9999 that is not
indicated in the table shown below is displayed, refer to
APPENDIX A, "ALARM LIST" in "FANUC Series 15i/150i-
MA Operator's Manual (Programming)" (B-63324EN).
- 256 -
B-63323EN-2/01 10.APPENDIX
- 257 -
10.APPENDIX B-63323EN-2/01
- 258 -
B-63323EN-2/01 10.APPENDIX
- 259 -
10.APPENDIX B-63323EN-2/01
- 260 -
B-63323EN-2/01 10.APPENDIX
- 261 -
10.APPENDIX B-63323EN-2/01
P-CODE macros
Program No. Function
O0001 Main program menu display
O0010 Key input test
O0011 Soft key display
O0020 Cursor test
O0030 Display test
O0031 Blink test
O0032 Character string data
O0040 Address value test
O0050 Circle cutting main program
O0051 Cursor and data display
O0052 Display of character strings for circle cutting
O0053 Circle cutting graphic display
O9010 Macro program for executing circle cutting
00010 O1000 ;
00020 G100 ;
00030 M02 ;
- 262 -
B-63323EN-2/01 10.APPENDIX
Main program
00010 O0001 ;
00020 G390 ;
00030 G202 P3 ;
00040 G230 L0 ;
00050 #8502 = 0 ;
00060 G243 X0 Y0 A1 B0 (SAMPLE PROGRAM) ;
00070 X2 Y3 (1 -- KEY TEST) ;
00080 X2 Y5 (2 -- COUSOR TEST) ;
00090 X2 Y7 (3 -- DISPLAY TEST) ;
00100 X2 Y9 (4 -- ADDRESS VARIABLE) ;
00110 X2 Y11(5 -- CIRCLE) ;
00120 #8509 = 0033 ;
00130 #143 = 300 ;
00140 M98 P0011;
00150 N001 #142 = #8501 ;
00160 IF [ #142 EQ 0 ]GOTO 99 ;
00170 IF [ #142 LT 12 ]GOTO 99 ;
00180 IF [ #142 GT 16 ]GOTO 99 ;
00190 #8500 =[ #142 - 11 ]* 10 ;
00200 M99 ;
00210 N099 M99 P1 ;
00010 O0010 ;
00020 N10 G202 P3 ;
00030 N20 G243 X0 Y2 A1 B0 (KEY TEST -- HIT ANY
KEY --) ;
00040 N30 #143 = 100 ;
00050 M98 P0011 ;
00060 N100 #8502 = 2 ;
00070 N110 #142 = #8501 ;
00080 IF [ #142EQ0 ]GOTO 200 ;
00090 #101 = #142 ;
00100 #102 = #8503 ;
00110 #103 = #8504 ;
00120 G243 X0 Y4 A1 B0 (CONTROL ) F8.3 Z0 D#101 ;
00130 G243 X0 Y5 A1 B0 (ADDRESS ) F8.3 Z0 D#103 ;
00140 G243 X0 Y6 A1 B0 (DATA ) F8.3 Z0 D#102 ;
00150 N200 IF [ #142 NE 16 ]GOTO 220 ;
00160 N210 #8500 = 1 ;
00170 M99 ;
00180 N220 IF [ #142 EQ 0 ]GOTO 300 ;
00190 M99 P100 ;
00200 N300 M99 P110 ;
- 263 -
10.APPENDIX B-63323EN-2/01
00010 O0011 ;
00020 #100 = 0 ;
00030 WHILE [ #100 LT 5 ] DO 1 ;
00040 #1 = #143 + #100 ;
00050 G243 X[ #100 * 7 + 2 ]Y25 A1 B0 P [ #1 ];
00060 #100 = #100 + 1 ;
00070 END 1 ;
00080 M99 ;
00010 O0020 ;
00020 G202 P3 ;
00030 G230 L0 ;
00040 #8502 = 0 ;
00050 N008 G243 X0 Y1 (CURSOR TEST -- MOVE
CURSOR --) ;
00060 G243 X0 Y3 (A) ;
00070 G243 X0 Y4 (B) ;
00080 G243 X0 Y5 (C) ;
00090 G243 X0 Y6 (D) ;
00100 G243 X0 Y7 (E) ;
00110 G243 X0 Y8 (F) ;
00120 #143 = 100 ;
00130 M98 P0011 ;
00140 #100 = 0 ;
00150 #146 = 2 ;
00160 N001 #142 = #8501 ;
00170 IF [ #142 EQ 0 ] GOTO 20 ;
00180 IF [ #142 NE 4 ] GOTO 10 ;
00190 #100 = #100 + 1 ;
00200 N10 IF [ #142 NE 3 ]GOTO 20 ;
00210 #100 = #100 - 1 ;
00220 N20 #100 = #100 + 6 ;
00230 #100 = #100 - [ FIX[ #100 / 6 ]]* 6 ;
00240 #147 = #100 + 3 ;
00250 G230 X#146 Y#147 L1 ;
00260 IF [ #142 NE 16 ]GOTO 100 ;
00270 #8500 = 1 ;
00280 M99 ;
00290 N100 M99 P1 ;
- 264 -
B-63323EN-2/01 10.APPENDIX
00010 O0030 ;
00020 #8509 = 33 ;
00030 G202 P3 ;
00040 #8502 = 0 ;
00050 G230 L0 ;
00060 #143 = 100 ;
00070 M98 P0011 ;
00080 N1 #100 = 1234.567 ;
00090 X0 Y0 A1 (DISPLAY TEST) ;
00100 X0 Y1 (FANUC SERIES 15I MACRO COMPILER) ;
00110 X0 Y5 (--2 BYTE CHARACTER DISPLAY TEST--) ;
00120 X3 Y7 (*352D 3966 2F40 2F48 2F79 2F53*) ;
00130 M98 P0032 ;
00140 X0 Y13 (--DATA DISPLAY TEST 1234.567--) ;
00150 X3 Y15 (LEADING ZERO SUPPRESS) ;
00160 X6 Y16 Z1 F8.3 (F8.3 ) D#100 ;
00170 X6 Y17 Z1 F5.2 (F5.2 ) D#100 ;
00180 X3 Y18 (NOT LEADING ZERO SUPPRESS) ;
00190 X6 Y19 Z0 F8.3 (F8.3 ) D#100 ;
00200 X6 Y20 Z0 F5.2 (F5.2 ) D#100 ;
00210 X39 Y5 (--STRINGS DISPLAY TEST--) ;
00220 X41 Y7 P10 ;
00230 X41 Y8 P20 ;
00240 X41 Y9 P30 ;
00250 X39 Y11 (--TRIPLE CHARACTER--) ;
00260 X41 Y13 A3 B0 (TRIPLE) ;
00270 #142 = #8501 ;
00280 IF [ #142 NE 16 ]GOTO 100 ;
00290 #8500 = 1 ;
00300 M99 ;
00310 N100 M99 P1 ;
00010 O0032 ;
00020 G243 X0 Y9 A1 B0 (--BLINK TEST--) ;
00030 N001 G243 X3 Y11 A1 B1 (BLINK) ;
00040 G243 B0 ;
00050 M99 ;
- 265 -
10.APPENDIX B-63323EN-2/01
00010 O0033 ;
00020 N10 (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;
00030 N20 (0123456789) ;
00040 N30 (FANUC TECHNICAL TRAINING CENTER) ;
00050 N100 ( );
00060 N101 ( );
00070 N102 ( );
00080 N103 ( );
00090 N104 ( END ) ;
00100 N200 (RADIUS) ;
00110 N201 ( FEED ) ;
00120 N202 (OFS NO) ;
00130 N203 ( EXEC ) ;
00140 N204 ( END ) ;
00150 N300 (TEST-1) ;
00160 N301 (TEST-2) ;
00170 N302 (TEST-3) ;
00180 N303 (TEST-4) ;
00190 N304 (TEST-5) ;
00200 N500 (INPUT DEV NUM FOR FORGROUND) ;
00210 N504 (OUTPUT DEV NUM FOR FORGROUND) ;
00220 N508 (INPUT DEV NUM FOR BACKGROUND);
00230 N512 (OUTPUT DEV NUM FOR BACKGROUND);
00240 M99 ;
- 266 -
B-63323EN-2/01 10.APPENDIX
00010 O0040 ;
00020 #143 = 100 ;
00030 M98 P0011 ;
00040 N10 G243 X0 Y2 A1 B0 (ADDRESS VARIABLE TEST) ;
00050 #100 = 20 ;
00060 X0 Y4 (ADDRESS G READ TEST) ;
00070 N20 #101 = G00.4 ;
00080 IF [ #101 EQ 0 ]GOTO 30 ;
00090 X0 Y6 Z1 F1.0 (ESP STATUS -- ) D#101 ( PUSH
ESP ) ;
00100 #142 = #8501 ;
00110 IF [ #142 EQ 16 ]GOTO 100 ;
00120 M99 P20 ;
00130 N30 X0 Y6 Z1 F1.0 (ESP STATUS -- ) D#101
( RESET ESP) ;
00140 G243 X0 Y8 (PARAMETER READ) ;
00150 #102 = 0 ;
00160 #8509 = 0033 ;
00170 WHILE [ #102 LE 3 ]DO 1 ;
00180 #1 = #102 + 20 ;
00190 #103 = P#1 ;
00200 #2 = #102 + 10 ;
00210 #100 = #100 + 1 ;
00220 G243 X0 Y#2 (NUM ) Z1 F3.0 D#1 ;
00230 ( -- ) D#103 ;
00240 G243 ( ) P [ #102 * 4 + 500 ];
00250 #102 = #102 + 1 ;
00260 #3 = #3 + 1 ;
00270 END 1 ;
00280 #142 = #8501 ;
00290 IF [ #142 NE 16 ]GOTO 200 ;
00300 N100 #8500 = 1 ;
00310 N200 M99 ;
- 267 -
10.APPENDIX B-63323EN-2/01
00010 O0050 ;
00020 G202 P3 ;
00030 #146 = 13 ;
00040 #147 = 2 ;
00050 G230 X#146 Y#147 L6 ;
00060 #147 = 0 ;
00070 M98 P0052 ;
00080 M98 P0053 ;
00090 M98 P0051 ;
00100 N10 #8502 = 1 ;
00110 N20 #142 = #8501 ;
00120 #144 = #8503 ;
00130 IF [ #142 EQ 0 ]GOTO 110 ;
00140 IF [ #142 NE 12 ]GOTO 30 ;
00150 #147 = 0 ;
00160 GOTO 90 ;
00170 N30 IF [ #142 NE 13 ]GOTO 40 ;
00180 #147 = 1 ;
00190 GOTO 90 ;
00200 N40 IF [ #142 NE 14 ]GOTO 50 ;
00210 #147 = 2 ;
00220 GOTO 90 ;
00230 N50 IF [ #142 NE 3 ]GOTO 60 ;
00240 #147 = #147 - 1 ;
00250 GOTO 90 ;
00260 N60 IF [ #142 NE 4 ]GOTO 70 ;
00270 #147 = #147 + 1 ;
00280 GOTO 90 ;
00290 N70 IF [ #142 NE 15 ]GOTO 80 ;
00300 M98 P54 ;
00310 GOTO 100 ;
00320 N80 IF [ #142 NE 8 ]GOTO 100 ;
00330 N90 #147 = #147 + 3 ;
00340 #147 = #147 - FIX [ #147 / 3 ]* 3 ;
00350 IF [ #144 EQ #0 ]GOTO 100 ;
00360 # [ 500 + #147 ]= #144 ;
00370 #1 = #147 + 2 ;
00380 G243 X14 Y#1 Z1 F4.0 D# [ #147 + 500 ] ;
00390 N100 M98 P0051 ;
00400 N110 IF [ #142 NE 16 ]GOTO 200 ;
00410 #8500 = 1 ;
00420 M99 ;
00430 N200 IF [ #142 EQ 0 ]GOTO 210 ;
00440 M99 P10 ;
00450 N210 M99 P20 ;
- 268 -
B-63323EN-2/01 10.APPENDIX
00010 O0051 ;
00020 #1 = #147 + 2 ;
00030 N100 G230 Y#1 L6 ;
00040 #100 = 0 ;
00050 WHILE [ #100 LT 3 ]DO 1 ;
00060 G243 X14 Y[ #100 + 2 ]Z1 F4.0 D#[ 500 + #100 ];
00070 #100 = #100 + 1 ;
00080 END 1 ;
00090 M99 ;
00010 O0052 ;
00020 G243 X0 Y0 A1 B0 (CIRCULAR CUTTING) ;
00030 X1 Y2 (I) ;
00040 (*28*) ;
00050 (RADIUS) ;
00060 (*29 20 20 3D*) ;
00070 X1 Y3 (F) ;
00080 (*28*) ;
00090 (FEED) ;
00100 (*29 20 20 20 20 3D*) ;
00110 X1 Y4 (D) ;
00120 (*28*) ;
00130 (OFS NUM) ;
00140 (*29 20 3D*) ;
00150 #143 = 200 ;
00160 M98 P0011 ;
00170 M99 ;
- 269 -
10.APPENDIX B-63323EN-2/01
00010 O0053 ;
00020 G244 P0 ;
00030 G240 P2 ;
00040 G242 X80 Y20 ;
00050 G301 X125 Y65 ;
00060 G302 X170 Y20 I0 J-45 ;
00070 G302 X170 Y20 I-90 J0 ;
00080 G302 X125 Y-25 I-45 J0 ;
00090 G301 X80 Y20 ;
00100 G244 P2 ;
00110 G242 X80 Y20 ;
00120 G240 P7 ;
00130 G301 Y-100 ;
00140 G242 X-10 Y20 ;
00150 G301 Y-100 ;
00160 G244 P1 ;
00170 G242 X80 Y-95 ;
00180 G240 P6 ;
00190 G301 X-10 ;
00200 G240 P7 ;
00210 G243 X41 Y14 A1 B0 (I) ;
00220 M99 ;
- 270 -
B-63323EN-2/01 10.APPENDIX
00010 O0054 ;
00020 #1 = F03.5 ;
00030 IF [ #1 EQ 1 ]GOTO 10 ;
00040 G240 P7 ;
00050 G243 X0 Y16 K30 ;
00060 G243 X0 Y18 K30 ;
00070 G240 P-3 ;
00080 G243 X0 Y16 B1 ( WARNING ) ;
00090 G243 X0 Y18 B0 ( PLEASE CHANGE MEMORY
MODE ) ;
00100 GOTO 20 ;
00110 N10 IF [#4000 EQ 1000]GOTO 11 ;
00120 G240 P7 ;
00130 G243 X0 Y16 K30 ;
00140 G243 X0 Y18 K30 ;
00150 G240 P-3 ;
00160 G243 X0 Y16 B1 ( WARNING ) ;
00170 G243 X0 Y18 B0 ( PLEASE SELECT O1000 ) ;
00180 GOTO 20 ;
00190 N11 G240 P7 ;
00200 G243 X0 Y16 K30 ;
00210 G243 X0 Y18 K30 ;
00220 G240 P-5 ;
00230 G243 X0 Y18 B1 ( PUSH CYCLE START ) ;
00240 N20 G240 P7 ;
00250 G243 B0 ;
00260 M99 ;
00010 O9010 ;
00020 G40 G49 G80 ;
00030 #1 = #500 / 2 ;
00040 G91 G42 G01 X#1 Y#1 F#501 ;
00050 G02 G17 X#1 Y-#1 J-#1 ;
00060 I-#500 ;
00070 X-#1 Y-#1 I-#1 ;
00080 G40 G01 X-#1 Y#1 ;
00090 M99 ;
- 271 -
10.APPENDIX B-63323EN-2/01
10.2.4 Flowchart
START
Clear screen
Display menu
NO
Key input?
YES
YES
Soft key 1? Key input test
NO
YES
Soft key 2? Cursor display test
NO
YES
Soft key 3? Character display test
NO
M99
- 272 -
B-63323EN-2/01 10.APPENDIX
START START
Display title
NO
Counter < 5?
NO
Key input?
Increment counter by 1
YES
Display key input variable,
numeric data variable, and
address data variable
M99
M99
- 273 -
10.APPENDIX B-63323EN-2/01
START START
Counter = 0
Display characters
Cursor X coordinate = 2
Blink display
NO Display data
Key input?
YES
Display character string
Is key input NO
below cursor?
Display 3-time characters
YES
Increment counter by 1
YES
Is end key pressed?
Is key input NO NO
above cursor?
#8500=1
YES
Decrement counter by 1
M99
Display cursor
M99
- 274 -
B-63323EN-2/01 10.APPENDIX
START
Display title
Blink display
M99
START
Clear screen
Display title
NO
G000#4=0 ?
YES
Display "RESET ESP"
Display cursor
M99
M99
- 275 -
10.APPENDIX B-63323EN-2/01
START
NO
Clear screen Soft key 3?
YES
Cursor display X=13 Y=2
Cursor pointer = 2
Cursor display ON
NO
Above soft key?
Display character
string for data YES
Cursor pointer = -1
Graphic display
NO
Below soft key?
Display data
YES
Cursor pointer = +1
Read numeric data
NO
NO Soft key 4?
Key input?
YES
YES
Display execution
NO macro start message
Soft key 1?
YES
Display data
Cursor pointer = 0
M99
NO
Soft key 2?
YES
Cursor pointer = 1
- 276 -
B-63323EN-2/01 10.APPENDIX
Explanation of O0001
00030 G202 P3
Erases a screen. P1: Character screen
P2: Graphic screen
P3: Character and graphic screen
00040 G230 L0
Cursor control L0: Cursor OFF
L1: Cursor ON. The cursor length is 1.
NOTE
In NC programming, the control-in/out function
allows parentheses to be used to indicate
comments. In conversational macros (talk
macros), parentheses indicate data to be
displayed, so comments cannot be used.
- 277 -
10.APPENDIX B-63323EN-2/01
Explanation of O0011
00030 WHILE [conditional-expression] DO1
••••
••••
00070 END1
While the conditional expression holds, the WHILE
statement performs the processing between DO and END.
If the conditional expression does not hold, the block next to
the corresponding END statement and subsequent blocks are
executed.
Explanation of O0020
00220 N20 #100 = #100 + 6
00230 #100 = #100 + [FIX [#100/6]]
#100/6]]*
]]* 6
A calculation is performed to obtain the cursor position. At
line 220, 6 is added in advance to prevent the cursor position
from becoming negative. The value 6 means that there are
six positions to which the cursor moves.
FIX at line 230 is a function to discard the fractional
remainder from the quotient; the remainder of the division
by 6 is obtained.
Explanation of O0030
00020 #8509 = 33
The character string registration program variable (#8509) is
used to specify the program number including the sequence
number to be specified in G243P (sequence number). Here,
the character string of program number 0033 is used.
0017
00170 X6 Y17
Y17 Z1 F5.2 (F5.2) D#100
F5.2 specifies the number of numeric data digits when
numeric data is displayed. F5.2 indicates that 5-digit
numeric data including a two-digit fractional part is to be
displayed.
- 278 -
B-63323EN-2/01 10.APPENDIX
EXAMPLE
If 1234.567 is stored in #100, "234.57" is displayed.
Explanation of O0032
00030 N001 G243 X3 Y11 A1 B1 (BLINK)
G243 B1 sets the blink display mode. The characters to be
displayed after this command are all displayed in the blink
display mode. To cancel the blink display mode, specify
G243 B0.
Explanation of O0040
00070 N20 #100 = G00.4 |
The state of G00.4 (emergency stop) is read into common
variable #100.
00180 #1 = #102 + 20
00190 #103 = P#1
The content of the parameter specified by P# is read into
common variable #103. Here, the contents of parameter
Nos. 20, 21, 22, and 23 are read by changing the #102 content
from 0 to 3.
20 Interface number of the input device for the foreground
21 Interface number of the output device for the foreground
22 Interface number of the input device for the background
23 Interface number of the output device for the background
Explanation of O0054
00020 #1 = F03.5
The state of F03.5 (memory mode in progress) is read into
local variable #1.
0007
00070 G240 P-3
The color of lines and characters to be displayed is specified.
In this case, the lines and characters are displayed in reverse
video in yellow.
- 279 -
10.APPENDIX B-63323EN-2/01
B1 B2 B3 B4 B5
B6 B7 B8 B9 BA
BB BC BD BE BF
C0 C1 C2 C3 C4
C5 C6 C7 C8 C9
CA CB CC CD CE
CF D0 D1 D2 D3
D4 D5 D6
D7 D8 D9 DA DB
DC A6
DD
A7 A8 A9 AA AB
AF
AC AD AE
DE DF A1 A2 A3
A4 A5 A0 B0
- 280 -
B-63323EN-2/01 10.APPENDIX
- 281 -
10.APPENDIX B-63323EN-2/01
- 282 -
B-63323EN-2/01 10.APPENDIX
- 283 -
10.APPENDIX B-63323EN-2/01
- 284 -
B-63323EN-2/01 10.APPENDIX
- 285 -
10.APPENDIX B-63323EN-2/01
244C
- 286 -
B-63323EN-2/01 10.APPENDIX
- 287 -
10.APPENDIX B-63323EN-2/01
2472
2473
- 288 -
B-63323EN-2/01 INDEX
INDEX
Address Functions ................................112
................................ 112 Conversational Macro (Talk Macro)
Function................................
Function ..............................................
.............................................. 40
Alarm information and external alarm
information ........................................
........................................182
........ 182 CONVERSATIONAL MACRO (TALK
MACRO) FUNCTION AND AUXILIARY
APPENDIX ...........................................
...........................................255
........... 255
MACRO FUNCTION .......................... 39
Appendix tables ....................................
....................................147
.... 147
Cumulative operation time and parts
Array-Type Processing and Referencing of count ..................................................
..................................................204
..................204
P-CODE Variables .............................152
............................. 152
Custom Macro Common Variables (#99100
Auxiliary Macro Function
Function.......................
.......................44
.......................44 to #99999) ...........................................
........................................... 66
- 289 -
INDEX B-63323EN-2/01
Displaying Execution Macro Call General .... 12, 118, 135, 160, 166, 178, 213
Information................................
Information ........................................
........................................234
........ 234
GENERAL................................
GENERAL ................................................
................................................ 1
Displaying P-CODE Macro Program
Key Input and Data Input/Output .......103
.......103
Numbers ............................................
............................................232
............ 232
Limitations................................
Limitations....................................
.................................... 146, 164
Error messages .....................................
.....................................169
..... 169
Limitations on commands
commands........................
........................ 8
Error No. List .......................................
.......................................256
....... 256
Limitations on Execution Macros .......... 35
Execution and termination ...............40,
............... 40, 44
List of commands ..................................
..................................169
..169
Execution Control Codes
Codes.........................
.........................48
.........................48
Local Variables (#1 to #33)/Array
Execution Control Variables (#8500, #8510,
Variables (#1 to #99)
#99)...........................
........................... 57
and #8600) ...........................................
...........................................50
...........50
Macro call using a G code ...................... 17
Execution cycle .......................................
.......................................46
.......46
Macro call using a T code
code.......................
....................... 21
EXECUTION MACRO FUNCTION .......11
.......11
Macro call using an axis address ........... 23
Extended data input control variable
#8552 .................................................
.................................................106
................. 106 Macro call using an M code ................... 20
Extended P-CODE Variables (#40000 and Macro calls with G codes (Specification of
Above) ..................................................
..................................................63
..................63 Multiple G codes)
codes)................................
................................ 18
Functions ..............................................
..............................................119
.............. 119 Macro Variable List ............................... 55
- 290 -
B-63323EN-2/01 INDEX
OPERATION................................
OPERATION .........................................
.........................................221
......... 221 Setting................................
Setting ...................................................
...................................................168
...................168
PARAMETERS .....................................
.....................................237
..... 237 Simple call (G65)
(G65)................................
....................................
.................................... 16
P-CODE Variables (#30000 and Above) .60 Subprogram call using a second auxiliary
function code .......................................
....................................... 31
P-CODE workpiece number search ........33
........33
Subprogram call using a specific code ... 32
PMC Address Reading/Writing (G310).
(G310) . 115
Subprogram call using a T code
code.............
............. 30
PMC address reference .........................112
......................... 112
Subprogram call using an M code
code..........
.......... 27
PMC Axis Control .................................
................................. 160
Subprogram call using an M code in the
Program explanation ............................277
............................ 277
specified range ....................................
.................................... 28
Program functions ................................261
................................ 261
Subprogram call using an S code
code...........
........... 29
Reader/Puncher Interface .....................118
..................... 118
System, servo, and PMC series
Reading A/D Conversion Data ..............156
.............. 156 information ........................................
........................................206
........206
Reading the Distance to Go (#5181 to The number of controlled axes and the
#5200 and #100801 to 100824) ..........159
.......... 159 number of servo axes .........................204
.........................204
Referencing and Writing CNC Programs Torque Limit Override Control (#8990 to
...........................................................
...........................................................135
........................... 135 #8993) ................................................
................................................155
................155
Relative Coordinate Read and Preset Window Function (#8996 to #8999) ......178
......178
Functions (#8996 to #8999) ...............150
............... 150
- 291 -
Revision Record
01 Sep.,’99