B-63943en-2 Macro Executor Programming Manual
B-63943en-2 Macro Executor Programming Manual
Macro Executor
PROGRAMMING MANUAL
B-63943EN-2/07
• No part of this manual may be reproduced in any form.
• All specifications and designs are subject to change without notice.
The products in this manual are controlled based on Japan’s “Foreign Exchange and
Foreign Trade Law”. The export of Series 30i-A/B, Series 31i-A5/B5 from Japan is subject
to an export license by the government of Japan. Other models in this manual may also be
subject to export controls.
Further, re-export to another country may be subject to the license of the government of
the country from where the product is re-exported. Furthermore, the product may also be
controlled by re-export regulations of the United States government.
Should you wish to export or re-export these products, please contact FANUC for advice.
In this manual we have tried as much as possible to describe all the various matters.
However, we cannot describe all the matters which must not be done, or which cannot be
done, because there are so many possibilities.
Therefore, matters which are not especially described as possible in this manual should be
regarded as ”impossible”.
B-63943EN-2/07 SAFETY PRECAUTIONS
SAFETY PRECAUTIONS
DEFINITION OF WARNING, CAUTION, AND NOTE
This manual includes safety precautions for protecting the user and preventing damage to the machine.
Precautions are classified into Warning and Caution according to their bearing on safety. Also,
supplementary information is described as a Note. Read the Warning, Caution, and Note 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
The Note is used to indicate supplementary information other than Warning and
Caution.
s-1
SAFETY PRECAUTIONS B-63943EN-2/07
WARNING
2 Be careful enough that you must prevent PMC signals in the same byte from
being written by the following two or more applications including network
functions. While an application reads and writes one byte of PMC signals, other
applications may write the same byte.
4 Generally, when multi-byte data are read or written at once among the following
two or more applications including network functions, the coherency of the read
multi-byte data (in other words, reading all latest data at once) is not guaranteed.
To ensure the coherency of the multi-byte data, prepare flags to notify the
completion of reading or writing process that is separated from the entity of the
data and make the handshaking process to access the data by using the flags.
5 CNC has functions that read or write PMC signals in other than the G/F address.
Be careful enough if the above mentioned applications and network read or write
PMC signals used by these functions. When reading or writing the same PMC
signal, applications or CNC functions may work in an unexpected manner.
- s-2 -
B-63943EN-2/07 SAFETY PRECAUTIONS
2 Be careful enough if you write a PMC signal. There is a possibility that the NC
may work with a wrong PMC signal. In this case, it may cause an unexpected
machine behavior and also tools, machines or workpieces may be damaged.
You have to make it sure that the writing of the PMC signal is safe and proper,
when modifying the PMC signal.
s-3
B-63943EN-2/07 TABLE OF CONTENTS
TABLE OF CONTENTS
SAFETY PRECAUTIONS ............................................................................ s-1
DEFINITION OF WARNING, CAUTION, AND NOTE ............................................. s-1
GENERAL WARNINGS FOR CNC APPLICATION DEVELOPMENT ..................... s-1
GENERAL WARNINGS FOR MACRO EXECUTOR APPLICATION
DEVELOPMENT ..................................................................................................... s-3
1 GENERAL ............................................................................................... 1
2 MACRO COMPILER AND MACRO EXECUTOR ................................... 3
2.1 MACRO COMPILER...................................................................................... 3
2.1.1 P-CODE Macro and P-CODE File ........................................................................... 3
2.2 MACRO EXECUTOR .................................................................................... 5
2.3 P-CODE MACRO .......................................................................................... 6
2.3.1 Limitations on Commands ....................................................................................... 6
2.3.2 Differences from the Series 16i ................................................................................ 8
2.4 MODULE DIVISION FUNCTION ................................................................... 8
2.4.1 Method of Module Addition..................................................................................... 8
2.5 MULTI-PATH CONTROL FUNCTION ......................................................... 10
2.5.1 Independent Operating Environment for Each Path ............................................... 10
2.5.2 P-CODE Variables/Extended P-CODE Variables Common to Paths .................... 11
2.5.3 Multiple P-CODE Macros Independent of Paths ................................................... 11
2.5.4 Reading the Path Number Currently under Execution (#8531) ............................. 12
c-3
TABLE OF CONTENTS B-63943EN-2/07
APPENDIX
A ERROR NO. LIST ................................................................................ 333
B CODE TABLES ................................................................................... 338
C DIFFERENCES FROM THE Series 16i .............................................. 346
c-5
TABLE OF CONTENTS B-63943EN-2/07
c-6
B-63943EN-2/07 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 FLASH ROM (called F-ROM
in the following), 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 executable macro programs are loaded into F-ROM, program editing memory can
efficiently be used.
• The user can call the execution format macro program with an easy call procedure without being
conscious of the registered program. On the program edit memory, custom macros can be prepared
and executed in the standard manner.
• Since the converted program into execution format is not indicated on the program display, the
machine tool builder’s knowhow can be protected.
• A conversational 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 function
or auxiliary macro function can easily be detected using a debugging function.
Definition of terms
The words used in the explanation are defined as follows.
-1-
1.GENERAL B-63943EN-2/07
Example :
The Z-axis in the second path is referred to as
the second axis in the path or the second axis as the relative controlled axis number in the path, and
the system common fifth axis as the controlled axis number in the entire system.
-2-
B-63943EN-2/07 2.MACRO COMPILER AND MACRO EXECUTOR
P-CODE file
LOAD
Compile
parameter SAVE
P-CODE
Memory card
macro
P-CODE file
F-ROM
Compile&Link&
Conversion to the
memory card format
9001=00010000
O9000; 9002=10000011
#1=#2+#5; :
:
M99;
-3-
2.MACRO COMPILER AND MACRO EXECUTOR B-63943EN-2/07
CAUTION
To use a P-CODE file, 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.
-4-
B-63943EN-2/07 2.MACRO COMPILER AND MACRO EXECUTOR
Example
For a system that executes an execution macro and conversational macro, set
parameter No. 9050 for an auxiliary macro to 0.
Series 30i/31i/32i/35i/0i-F/PMi
F-ROM D -RAM
P-CODE_NUMBER=01 Execution macro
Parameter No.9048=1
P-CODE file for
execution/
conversational LOAD Conversational macro
macro Parameter No.9049=1
Auxiliary macro
P-CODE1 file Parameter No.9050=0
-5-
2.MACRO COMPILER AND MACRO EXECUTOR B-63943EN-2/07
Program number
The program number range is from 1 to 99999999.
NOTE
To use a 5-digit or longer program number, set the bit 3 (ON8) of parameter
No.11304 to 1.
Sequence number
The sequence number range is from 1 to 99999999.
- Note
NOTE
No sequence number must be added to any block with an O number.
(The sequence number is invalidated if added.)
-6-
B-63943EN-2/07 2.MACRO COMPILER AND MACRO EXECUTOR
NOTE
Bit symbols such as [#_M_SBK], [#_M_FIN], [#_M_FHD], [#_M_OV], and
[#_EST] cannot be defined.
*2 As subscript [n] for a name, only a constant can be specified. No variable and operation can be
specified.
[Example]
@[#_ABSMT[1]] #5021 : Allowed → When #101=[#_ABSMT[1]] is coded, it is replaced
with #101=#5021.
@[#_ABSMT[#100]] #5021 : Not allowed
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 macros. Carefully execute the command so that the same optional
block skip signal will not be used.
-7-
2.MACRO COMPILER AND MACRO EXECUTOR B-63943EN-2/07
-8-
B-63943EN-2/07 2.MACRO COMPILER AND MACRO EXECUTOR
Example of setting 1
To a system that has an execution macro, conversational macro, and auxiliary macro as the basic module,
an execution macro module is added as the second module and the third module.
* If a value other than 1 is set in any of parameters Nos. 9048 to 9050, the second and third modules
are disabled.
Example of setting 2
To a system that has an execution macro, conversational macro, and auxiliary macro as the basic module,
an execution macro and auxiliary macro are added.
Conversational macro
Parameter No.9049=0
Auxiliary macro
Parameter No.9050=1
NOTE
1 This function is disabled when modules with different execution/conversational/
auxiliary macros are used within the same path.
Set all of parameters Nos. 9048 to 9050 to the same P-CODE number or 0 (for
nonuse).
2 Whether to enable/disable an execution macro, conversational macro, and
auxiliary macro is set using parameters Nos. 9048 to 9050. This setting cannot
be made using parameters Nos. 9055 and 9056.
Compile parameter
As the compile parameter, priority is given to the nonzero value of an additional module. This means that
the compile parameter cannot be set to 0 by setting an additional module.
The order of priority from higher to lower is: third module to second module to basic module.
-9-
2.MACRO COMPILER AND MACRO EXECUTOR B-63943EN-2/07
Example
When basic module P-CODE number = 1, second module P-CODE number = 2,
and third module P-CODE number = 3:
1. Compile parameter No. 9010 of P-CODE number 1 = 100
Compile parameter No. 9010 of P-CODE number 2 = 200
Compile parameter No. 9010 of P-CODE number 3 = 300
→ Compile parameter No. 9010 = 300 is enabled.
2. Compile parameter No. 9038 of P-CODE number 1 = 0
Compile parameter No. 9038 of P-CODE number 2 = 3000
Compile parameter No. 9038 of P-CODE number 3 = 0
Compile parameter No. 9038 = 3000 is enabled.
3. Compile parameter No. 9100#0 of P-CODE number 1 = 1
Compile parameter No. 9100#0 of P-CODE number 2 = 0
Compile parameter No. 9100#0 of P-CODE number 3 = 0
→ Bit 0 of compile parameter No. 9100 = 1 is enabled.
P-CODE program
Higher priority is given to an additional module at P-CODE program call time.
The third module, second module, and basic module are searched in this order for a program to be called.
Example
When basic module P-CODE number = 1, second module P-CODE number = 2,
and third module P-CODE number = 3
Registered program
P-CODE file number actually executed
P-CODE1 P-CODE2 P-CODE3
O9010 O9010 of P-CODE1 is executed.
O9011 O9011 O9011 of P-CODE2 is executed.
O9012 O9012 O9012 O9012 of P-CODE3 is executed.
O9013 O9013 O9013 O9013 of P-CODE3 is executed.
- 10 -
B-63943EN-2/07 2.MACRO COMPILER AND MACRO EXECUTOR
So, executor parameters, local variables, common variables (#100 and up, #500 and up), and system
variables are provided separately for each path.
Example of setting
P-CODE variables (#10000 and up) are shared by all paths, and extended P-CODE variables (#20000 and
up) are used separately by each path.
Path 1 Path 2 Path 3
Set the number of variable areas and variable type (floating-point or integer) for each of variables 1, 2, 3,
and so on in the parameters Nos. 9053 and 9054, bit 3 of parameter No. 9033, and bit 4 of parameter No.
9033 for each of paths 1, 2, 3, and so on.
- 11 -
2.MACRO COMPILER AND MACRO EXECUTOR B-63943EN-2/07
Example of setting 1
- When conversational macros/auxiliary macros are shared
Different execution macros are used for each path, and the conversational macros/auxiliary macros of
P-CODE1 only are used. P-CODE2 and P-CODE3 include execution macros only, so that the F-ROM
can be saved.
Path 1 Path 2 Path 3
Example of setting 2
- When P-CODE macros are divided separately into execution
macros/conversational macros/auxiliary macros
Execution macros, conversational macros, and auxiliary macros are registered separately in each P-CODE.
Macro replacement is enabled on the basis of each P-CODE.
Path 1 Path 2 Path 3
- 12 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
3.2.1 Overview
3.2.1.1 Macro call and subprogram call
Execution macro calls can roughly be divided into two types: macro calls and subprogram calls. Macro
calls are further divided into two types: special macro calls, and other macro calls.
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.
Macro call
Subprogram call Macro call using
Special macro call(Note 2)
G65/G66/G66.1/G/M code
All addresses specified in the block
other than address N are passed as
arguments to #1 to #33. Argument
All specifications after a call
specification II cannot be used.
code are passed as arguments
Argument-specifi Up to five G codes are used as
Not allowed (#1 to #33). Two types are
cation arguments in the ascending order of
available: argument
G code group numbers. If multiple
specification I and II.
codes are specified in another
address, the last code specified is
used as an argument.
A command after a call code is
The NC statement is treated as an argument. For a
NC command Treated as an argument. (A call
first executed, then command before a call code,
specified in the code need not be placed at the start
the execution macro alarm PS0127 is issued. (A call
same block of the block.)(Note 3)
is called. code must be specified at the
start of the block.)
- 13 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Macro call
Subprogram call Macro call using
Special macro call(Note 2)
G65/G66/G66.1/G/M code
The level does not
Local variables The level changes.
change (Note 1).
NOTE
1 Usually, the level is not changed by a subprogram call.
When bit 3 (LCLLV) of compile parameter No. 9163 is set to 1, Series 16i
compatibility is provided. This means that the level changes only when an
execution macro is called as a subprogram from a user program (using an
M/S/T/second auxiliary function/specific code). (When an execution macro calls
another execution macro or calls a user program as a subprogram, the level
does not change as in the case where bit 3 (LCLLV) of compile parameter No.
9163 is set to 0.)
2 Special macro calls include calls using a G code / M code / D code / H code / S
code / T code / axis address.
3 The call code commanded in first is effective when two or more call codes are
commanded in the same block. In this case, codes except the call codes are
regarded as follows.
• When the first call code is subprogram call, the execution macro is called
after the words except call codes are executed as NC sentence .
• When the first call code is macro call, except the call codes are regarded as
arguments.
Types of calls
Common
Program number variable for
Call code Parameters to be set Remarks
called storing a
specified code
No execution macro
Specified at can be called from
Simple call (G65) None None
address P. any user program
using this command.
No execution macro
Specified at can be called from
Modal call (G66,G66.1) None None
address P. any user program
using this command.
- By setting bit 5
(GMACC) of
compile parameter
No. 9104 to 1, a
special macro call
is made.
- By setting bit 1
Compile parameters
Macro call using G code O9010 to O9019 None (PRDGCAL) of
Nos. 9013 to 9022
compile parameter
No. 9103 to 1, use
of a G code with a
decimal point is
enabled.
- Modal calls are
allowed.
- 14 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Common
Program number variable for
Call code Parameters to be set Remarks
called storing a
specified code
- By setting bit 5
(GMACC) of
compile parameter
No. 9104 to 1, a
special macro call
Macro call using G code Compile parameters
Parameter setting None is made.
(specification of 1 set) Nos. 9045 to 9047
- Only G codes with
no decimal point
can be used.
- Modal calls are
allowed.
Compile parameters - By setting bit 5
Nos. 9129 to 9131 (GMACC) of
Compile parameters compile parameter
Nos. 9132 to 9134 No. 9104 to 1, a
special macro call
Macro call using G code
Parameter setting None is made.
(specification of 3 sets)
- Only G codes with
Compile parameters
no decimal point
Nos. 9135 to 9137
can be used.
- Modal calls are
allowed.
Possible only when a
macro modal call
Macro call using a Bit 4 (MDLP) of compile
using G code is made
cancel G code for a parameter No.9008 and
O9006 None with the Series 16i
macro modal call using Compile parameter
method (bit 0 (GMC)
G code No.9034)
of compile parameter
No. 9163 = 1)
Compile parameters
Macro call using M code O9020 to O9029 None
Nos. 9023 to 9032
Compile parameters By setting bit 4
Nos. 9120 to 9122 (EXMSCL) of compile
Macro call using M code Compile parameters parameter No. 9103
Parameter setting None
(specification of 3 sets) Nos. 9123 to 9125 to 1, a special macro
Compile parameters call is made.
Nos. 9126 to 9128
Compile parameters A call can be masked
AxnCL with bits 0 to 7 (OnM)
O9009 or O9031 (No. 9005#0 to #3, of parameter No. 9010
Special macro call using
to O9030+n (n : #27 No. 9008#0 to #3, and bits 0 to 7 (OnM)
axis address
number of axes) No. 9164#0 to #7 of parameter No. 9020
No. 9165#0 to #7) to No. 9021.
and AXCLS (No.9005#4)
Bit 7 (TMACC ) of A call can be masked
Special macro call using
O9008 #27 compile parameter No. with bit 0 (MTC) of
T code
9005 parameter No. 9011.
Bit 0 (DMACC) of A call can be masked
Special macro call using
O9040 #27 compile parameter with bit 0 (MDC) of
D code
No.9104 parameter No. 9012.
Bit 1 (HMACC) of A call can be masked
Special macro call using
O9041 #27 compile parameter with bit 1 (MHC) of
H code
No.9104 parameter No. 9012.
- 15 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Common
Program number variable for
Call code Parameters to be set Remarks
called storing a
specified code
Bit 2 (SMACC) of A call can be masked
Special macro call using
O9042 #27 compile parameter with bit 2 (MSC) of
S code
No.9104 parameter No. 9012.
No execution macro
Specified at can be called from
Subprogram call (M98) None None
address P. any user program
using this command.
Subprogram call using Compile parameters
O9001 to O9003 None
M code Nos. 9010 to 9012
By setting bit 3 (MSCL)
Subprogram call using of compile parameter
Compile parameters
M code in the specified O9009 #148 No. 9009 to 1, a
Nos. 9042 and 9043
range special macro call is
made.
Compile parameters By setting bit 4
Nos. 9111 to 9113 (EXMSCL) of compile
Subprogram call using
Compile parameters parameter No. 9103 to
M code (specification of Parameter setting None
Nos. 9114 to 9116 1, a special macro call
3 sets)
Compile parameters is made.
Nos. 9117 to 9119
Subprogram call using S Bit 0 (SSC) of compile
O9029 #147
code parameter No. 9105
Subprogram call using T Bit 0 (TCAL) of compile
O9000 #149
code parameter No. 9002
Subprogram call using
Bit 1 (BSC) of compile
second auxiliary function O9028 #146
parameter No. 9105
code
Bit 1 (ACL1) and Bit 2
(ACL2) of compile
Subprogram call using #146
O9004, O9005 parameter No.9002
specific code #147
Parameters Nos.6090
and 6091
A user program in
Subprogram call for user Specified at Compile parameter No. program memory is
None
program (*2) address P. 9033 called from an
execution macro.
An execution macro
is called preceding
P-CODE workpiece Set for a control Bit 6 (PWSR) of compile
None the main program at
number search variable. parameter No. 9002
the start of automatic
operation.
*2 Function specific to execution macros. This function calls no execution macro.
NOTE
1 The correspondence between codes used for macro and subprogram calls and
the numbers of called programs, and whether to call a subprogram/macro are
determined by compile parameters. The compile parameters are registered in
the F-ROM at compile time. Be sure to specify the compile parameters at
compile time.
2 Set a code for a subprogram call using a specific code in parameters Nos. 6090
and 6091 at execution time.
- 16 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Limitations on calls
The limitations described below are applied when an execution macro is called from a user program or
another execution macro and when an execution macro is called after a user program is called as a
subprogram. Furthermore, three major methods are available for calling an execution macro. One method
uses G65/G66 (G66.1)/M98, the second method uses G codes, and the third method uses other codes
(M/S/T/D/H/second auxiliary function code/special code/axis address). The limitations depend on these
methods.
(Example) From a user program called using a G code in a custom macro, an execution macro call using
G code can be made.
Within user program Within execution macro
: O9010
Gxx :
: M99
O9010
:
Gxx
:
M99
O90xx
:
M99
* In the description, the G/M/S/T/D/H/second auxiliary function codes/special codes are generically
referred to as each code.
Bit 2 (PCDC) of Compile parameter No. 9163
0 1
Calls using G65, M98, G66, and G66.1 are
0 allowed.
Other types of calls are disabled.
- Calls using G65, M98, G66, and G66.1
are allowed.
- From an execution macro called using a
G code, another execution macro can be
Bit 6 (GMP) of
Calls using G65 and M98 only are allowed. called using a code other than G codes
parameter No.
Other types of calls are disabled. (or using an axis address).
6008
1 - From an execution macro called using a
code other than G codes (or using an
axis address), another execution macro
can be called using a G code.
- Other types of calls (G code to G code,
code other than G codes to code other
than G codes) are disabled.
- 18 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
: O90xx
Gxx :
: MxxPpp1
:
M99
Opp1
Mxx (b)
:
M99 O90xx
(a) :
MxxPpp2
(c) :
Oxxxx M99
:
M99
O pp2
:
M99
- 19 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
* In the description, the G/M/S/T/D/H/second auxiliary function codes/special codes are generically
referred to as each code.
Bit 2 (PCDC) of Compile parameter No. 9163
0 1
NOTE
1 If an attempt is made to execute a call command not allowed, the command is
treated as an ordinary G/M/S/T/D/H/second auxiliary function/axis address code.
2 If bit 0 (GMC) of compile parameter No. 9163 is set to 1, the same processing as
performed when bit 6 (GMP) of parameter No. 6008 is set to 0 and bit 2 (PCDC)
of compile parameter No. 9163 is set to 0 is performed.
- 20 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Priority of calls
If a call code is set doubly with a custom macro or another call code in a parameter or compile parameter,
the priority indicated in the Table 3.2 (a) governs:
Table 3.2 (a)
Priority Call
High Simple call of execution macro (G65)
↑ Modal call of execution macro (G66,G66.1)
| Macro call using G code
| Macro call using G code (specification of 1 set)
| Macro call using G code (specification of 3 sets)
| Macro call using M code
| Macro call using M code (specification of 3 sets)
| Special macro call using M code
| Special macro call using axis address
| Special macro call using T code
| Special macro call using D code
| Special macro call using H code
| Special macro call using S code
| Subprogram call of execution macro (M98)
| External device subprogram call (M198) (*1)
| Subprogram call for user program
| Subprogram call using specific code
| Subprogram call using M code
| Subprogram call using M code in the specified range
| Subprogram call using M code (specification of 3 sets)
| Subprogram call using S code
| Subprogram call using T code
↓ Subprogram call using second auxiliary function code
Low Macro call/subprogram call which calls custom macro (*2)
*1 This priority is applied when an external device subprogram call is executed from an execution
macro.
*2 By setting bit 1 (MCA) of parameter No. 9013 to 1, priority can be given to a custom macro call
rather than to all execution macro calls. (If the code for an execution macro call set in a compile
parameter is the same as the code for a custom macro call set in a parameter, priority is given to the
custom macro call.)
Example
1 If 100 is set in both of compile parameter No. 9023 and compile parameter No.
9010, and M100 is set to enable both of a macro call using M code and a
subprogram call using M code, a macro call using M code is made when M100
is specified actually.
2 If 100 is set in both of parameter No. 6050 and compile parameter No. 9013 as
a G code for calling O9010:
• The execution macro O9010 is called when bit 1 (MCA) of parameter No.
9013 is set to 0.
• The user program O9010 is called when bit 1 (MCA) of parameter No. 9013
is set to 1.
Nesting
Execution macro calls can be nested to a depth of fifteen levels including only subprogram calls, to a
depth of five levels including only macro calls, or to a depth of fifteen levels including subprogram calls
and macro calls (to a depth of five levels for macro calls). This does not include custom macros.
- 21 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Subprogram calls for user programs and external device subprogram calls from execution macros are
included in the custom macro nesting levels.
- Argument specification I
Address Variable number Address Variable number Address Variable number
(*1)
A #1 J #5 R #18
B #2 K(*1) #6 S #19
C #3 L(*2) #12 T #20
D #7 M1(*3) #13 U #21
E #8 N(*4) #14 V #22
F #9 M2(*3) #14 W #23
G(*2) #10 M3(*3) #15 X #24
H #11 P(*2) #16 Y #25
I(*1) #4 Q #17 Z #26
Example
1 When bit 7 (IJK) of parameter No. 6008 is set to 0:
If I_J_K_ is specified, I=#4, J=#5, and K=#6 are set. However, if K_J_I_ is
specified, argument specification II is applied, and K=#6, J=#8, and I=#10 are
set.
2 When bit 7 (IJK) of parameter No. 6008 is set to 1:
Even if K_J_I_ is specified, argument specification I is applied. This means that
I=#4, J=#5, and K=#6 are set as in the case where I_J_K_ is specified.
- 22 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
NOTE
1 An NC command input format limitation is applied to address G. If G1000 is
specified, for example, alarm PS0010 is issued.
2 If multiple G codes are specified, the last G code specified is used as an
argument.
A G code not belonging to group 00 is passed as modal information to the
subsequent blocks.
Example 1
Suppose that a block for a macro call using M code specifies multiple M codes
(M300 = Calling M code).
• When five M codes are specified in one block:
M300 M1 M2 M3 M4 M5 → #13=1, #14=2, #15=5
• When an N code is specified after the second M code:
M300 M1 M2 N10 M3 → #13=1, #14=10, #15=3
• When an N code is specified before the second M code:
M300 M1 N10 M2 M3 → #13=1, #14=2, #15=3
Example 2
Suppose that a block for a special macro call using T code specifies multiple M
codes (T300= Call code).
• When the bit 7 (M3B) of parameter No.3404 is set to 0;
M1 N10 M2 T300 M3 M4 M5 → #27=300, #13=5, #14=<null>, #15=<null>
• When the bit 7 (M3B) of parameter No.3404 is set to 1;
M1 N10 M2 T300 M3 M4 M5 → #27=300, #13=1, #14=2, #15=5
* In a special macro call using T code, address N is not used as an argument.
Example 3
Suppose that a special macro call using M code is made (M300 = Call code).
M1 M2 M300 M3 M4 M5 → #27=300, #13=5, #14=<null>, #15=<null>
* The argument is the same when bit 7(M3B) of parameter No.3404 is set to 1.
*4 Address N is used as an argument when address N is specified after an address other than O and N in
a macro call using G code or M code.
Address N is used as an argument in a special macro call using M code, regardless of where address
N is specified.
Address N is not used as an argument in a special macro call using axis address/G/T/D/H/S code.
- 23 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
- Argument specification II
Address Variable number Address Variable number Address Variable number
A #1 K3 #12 J7 #23
B #2 I4 #13 K7 #24
C #3 J4 #14 I8 #25
I1 #4 K4 #15 J8 #26
J1 #5 I5 #16 K8 #27
K1 #6 J5 #17 I9 #28
I2 #7 K5 #18 J9 #29
J2 #8 I6 #19 K9 #30
K2 #9 J6 #20 I10 #31
I3 #10 K6 #21 J10 #32
J3 #11 I7 #22 K10 #33
• Argument specification II uses A, B, and C once each and uses I, J, and K up to ten times.
• Subscripts of I, J, and K for indicating the order of argument specification are not written in the
actual program.
NOTE
1 In a special macro call, argument specification II cannot be used.
2 When bit 7 (IJK) of parameter No. 6008 is set to 1, argument specification I is
applied, regardless of the specification order of I, J, and K. So, argument
specification II cannot be used.
- 24 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
- Limitation
Format
Specify a macro call code (G65/G66/G66.1/Gg/Mm) for other than special macro calls before all
arguments.
Example
G65 A1.0 B2.0 I-3.0 I4.0 D5.0 P1000 ;
(Variables)
#1:1.0
#2:2.0
#3:
#4:-3.0
#5:
#6:
#7:4.0 5.0
When both the I4.0 and D5.0 arguments are commanded for variable #7
in this example, the latter, D5.0, is valid.
CAUTION
The value of an argument passed without a decimal point may vary according to
the system configuration of the machine. It is good practice to use decimal points
in macro call arguments to maintain program compatibility.
- 25 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
M code for calling O9001 as a subprogram is M200.
- 26 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Format
G65 : Call command.
Must be specified before any argument.
G65 P p L l P : Program number of an execution macro to
<argument-specification> ; be called
l : Repetition count (1 by default)
1 to 99999999
argument : Data to be passed to the execution
macro. Argument specifications I and II
are available.
O9010 ; O0100 ;
: #3=#1+#2 ;
G65 P100 L2 A1.0 B2.0 ; IF [#3 GT 360] GOTO 9 ;
: G00 G91 X#3 ;
M99 ; N9 M99 ;
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
G66 : Call command.
Must be specified before any argument.
P : Program number of an execution macro to
G66 P p L l
be called
<argument-specification> ;
l : Repetition count (1 by default)
1 to 99999999
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.
- 27 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
O9010 ; O0100 ;
: :
G66.1 P100 L2 A1.0 B2.0 F100; G00 Z-#1 ;
A10.0 B20.0 F300 ; G01 Z-#2 F#9 ;
A0 B-30.0 ; :
F1000 ; :
G67 ; :
M99 ; M99 ;
Limitation
1 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.
2 This command can be specified only when bit 2 (PCDC) of compile parameter No. 9163 is set to 1.
3 In the modal call mode by G66.1, G10 cannot be specified.
Format
g : Call G code.
Gg L l <argument-specification> ; Must be specified before any argument.
(*2)
l : Repetition count (1 by default)
1 to 99999999
argument : Data to be passed to the execution
macro. Argument specifications I and II
are available.
(*1)
User program Execution macro
O0001 ; O9010 ;
: :
G81 X10.0 Y20.0 Z-10.0 ; :
: :
M30 ; N 9 M99 ;
Compile parameter N o.9013=81
- 28 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
*2 When bit 5 (MCARG) of compile parameter No. 9008 is set to 1, address L is also used as an
argument, so that the number of repeats cannot be specified.
Argument specification
• Argument specification I or II is automatically determined according to the address used.
• When bit 5 (MCARG) of compile parameter No. 9008 is set to 1, address G/L/P is also used as an
argument. So, the number of repeats cannot be specified.
• Address N, when specified before a call G code, is used not as an argument but as a sequence
number.
• Up to three M codes specified in address M are used as arguments. Of the fourth and subsequent M
codes, the last M code specified is passed to #15. If address N is specified, however, the second
specified M code or the N code, whichever specified later, is used as an argument.
[Example] Ggg: Call code
(1) When an N code is specified after the second M code:
Ggg M1 M2 N100 M3 M4 M5 → #13=1,#14=100,#15=5
(2) When an N code is specified before the second M code:
Ggg M1 N100 M2 M3 M4 M5 → #13=1,#14=2,#15=5
Limitation
1 If a G code exceeding 9999 is set, the macro call is invalidated.
2 Usually, when an execution macro is called from a program called using a G code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available. Moreover, when bit 2 (PCDC) of compile parameter No. 9163 is set to
1, a call using an M/S/T/D/H/second auxiliary function/specific code/axis address can be made from
a program called using a G code by setting bit 6 (GMP) of parameter No. 6008 to 1. Parameter GMP
is an ordinary parameter, so that this parameter can be modified, for example, through the MDI
panel.
• By setting 9999 in compile parameter No. 9013 to No. 9022, O9010 to O9019 can be called using
"G0.0" in addition to "G9.999", "G99.99", "G999.9", and "G999.9". In this case, the call code may
also be "G0.", "G.0", or "G0.00".
- 29 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
When bit 1 (PRDGCAL) of compile parameter No. 9103 is set to 1 and compile
parameter No. 9013 is set to 123, O9010 can be called by specifying any of
G1.23, G12.3, and G123.
Parameter setting
Compile parameter No. 9045 : Start G code number
Compile parameter No. 9046 : Number of definitions
Compile parameter No. 9047 : Start execution macro number
Example
When 900 is set for parameter No. 9045, 100 is set for parameter No. 9046, and
8000 is set for parameter No. 9047, the macro calls for the following
combinations are defined. When -900 is set for parameter No. 9045, the modal
calls for the same combinations are defined.
G900 → O8000
G901 → O8001
G902 → O8002
:
G999 → O8099
Limitation
1 This type of macro call is invalidated in the following cases:
<1> A value outside the valid range is set for a compile parameter.
<2> The defined G code range exceeds 9999.
<3> The defined program number range exceeds 99999999.
NOTE
To use a program number with an O number of five or more digits, set bit 3
(ON8) of parameter No. 11304 to 1.
2 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.
- 30 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Parameter setting
Table 3.2.7 indicates the compile parameters to be set for each set.
Table 3.2.7
1st set 2nd set 3rd set
Start G code number 9129 9132 9135
Number of execution macros to be defined 9130 9133 9136
Start execution macro number 9131 9134 9137
Example
Setting of the 1st set: No. 9129=900 No. 9131=8000 No. 9130=10
Setting of the 2nd set: No. 9132=950 No. 9134=8100 No. 9133=30
Setting of the 3rd set: No. 9135=1000 No. 9137=8900 No. 9136=5
The settings above define the following sets of macro calls:
1st set 2nd set 3rd set
G900 → O8000 G950 → O8100 G1000 → O8900
G901 → O8001 G951 → O8101 G1001 → O8901
G902 → O8002 G952 → O8102 G1002 → O8902
: : : : G1003 → O8903
G909 → O8009 G979 → O8129 G1004 → O8904
When No. 9129 = -900 is set, the same set of modal calls as the 1st set is
defined. Similarly, when No. 9132 = -950 and No. 9135 = -1000 are set, the
same sets of modal calls as the 2nd and 3rd sets are defined, respectively.
Limitation
1 This type of macro call is invalidated in the following cases:
<1> A value outside the valid range is set for a compile parameter.
<2> The defined G code range exceeds 9999.
<3> The defined program number range exceeds 99999999.
NOTE
To use a program number with an O number of five or more digits, set bit 3
(ON8) of parameter No. 11304 to 1.
2 Three types of macro calling based on G codes are available as indicated below. If the range of G
codes set in <1> duplicates the ranges of G codes set in <2> or <3>, the G code priority order is,
from high to low, <1> to <2> to <3>.
<1> Individual specification :
Compile parameters Nos. 9013 to 9022
- 31 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
(1) Standard method (when bit 0 (GMC) of compile parameter No. 9163 is set
to 0)
Until the modal call cancel G code (G67) is specified, the execution macro is called with the specified G
code in the modal mode equivalent to G66/G66.1 for custom macros.
The functions such as move command call (G66) operation, block-by-block call (G66.1) operation, and
multi-level modal calls are exactly the same as for custom macros. See the specifications of custom
macros as well.
Cancel G code
When G67 is specified, no macro modal call is made in the subsequent blocks. (See the custom macro
specifications.)
Passing of arguments
The same operation as for custom macro move command call (G66) operation and block-by-block call
(G66.1) operation is performed. (See the custom macro specifications.)
G10 command
In the modal call mode by the block-by-block call (G66.1), G10 cannot be specified.
- 32 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example
Bit 1 (MCT) of compile parameter No.9163=0: Modal call equivalent to G66.1
Compile parameter No. 9013= 42: With G42, O9010 is called as a macro.
Compile parameter No. 9014=-110: With G110, O9011 is called as a macro
in the modal mode.
Compile parameter No. 9010= 100: With M100, O9001 is called as a sub
program.
O4000
N2G110X10Y10 N2 Modal
N3 Modal
Modal call mode
N3X20Y20
N4M100X30Y30 N4 Modal
N30M99
N6X60Y60 N6 Modal
N7G42X100Y100 N7 Modal
N8X110Y110 N8 Modal
N9G67
N10M30
• M100 in N4 is an M code for a subprogram call, but because the mode is the
modal call mode, M100 becomes an argument together with other codes (X30
and Y30 in the example) and O9011 is called in the modal mode.
• With G65 in N5, no modal call is made but O1000 is called in the simple mode,
and a modal call is made in the called user program O1000.
• G42 in N7 is a G code for a macro call, but because the mode is the modal call
mode equivalent to G66.1, G42 becomes an argument together with other codes
(X100 and Y100 in the example) and O9011 is called in the modal mode.
Limitation
Same as those on the move command calling (G66) and each-block calling (G66.1) of custom macros.
(See the custom macro specifications.)
(2) Series16i method (when bit 0 (GMC) of compile parameter No. 9163 is set
to 1)
If bit 0 (GMC) of compile parameter No. 9163 is set to 1, modal calls of the Series 16i method can be
made by setting bit 1 (MCT) of compile parameter No. 9163 to 0. The specifications of such modal calls
are different from those of the each-block calling (G66.1) of custom macros, and have several features.
An execution macro (O9010 to O9019) is called in the modal mode with a specified G code until a cancel
G code (G167 or the G code specified in compile parameter No. 9034) is specified.
- 33 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
When a modal call G code is specified and each NC command block is specified subsequently, a specified
macro is called unconditionally (equivalent to G66.1). In this case, those addresses other than O and N are
not executed but are used as arguments.
Moreover, the execution macro program O9006 can be called with a cancel G code for a macro modal
call using G code. For details, see Subsection 3.2.8.1 "Macro call using a cancel G code for a macro
modal call using G code".
Cancel G code
When G167 is specified, no macro modal call is made in the subsequent blocks.
(When G67 is specified, a modal call is not canceled but results in alarm PS1100.)
Instead of G167, the G code specified with compile parameter No. 9034 can be used as a cancel G code.
Passing of arguments
G, L, and P are newly used as arguments. Their correspondence to variables is: G: #10, L: #12, and P:
#16. If N is specified after an address other than O and N, N is also used as an argument. In this case, the
variable corresponding to N is #14. However, an NC command input format limitation is applied to
address G. If G1000 is specified, for example, alarm PS0010 is issued.
G10 command
In the modal call mode, G10 cannot be specified. However, G10 can be specified in the program called by
Macro Call Using G/M Code of an execution macro even in the modal call mode.
- 34 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example
Bit 1 (MCT) of compile parameter No.9163=0: Modal call equivalent to G66.1
Compile parameter No. 9013= 42: With G42, O9010 is called as a macro.
Compile parameter No. 9014=-110: With G110, O9011 is called as a macro
in the modal mode.
Compile parameter No. 9010= 100: With M100, O9001 is called as a sub
program.
O4000
N2G110X10Y10 N2 Modal
N3 Modal
Modal call mode
N3X20Y20
N4M100X30Y30 N4 Modal
N30M99
N6X60Y60 N6 Modal
N8X110Y110 N8 Modal
N9G167
N10M30
• M100 in N4 is an M code for a subprogram call, but because the mode is the
modal call mode, M100 becomes an argument together with other codes (X30
and Y30 in the example) and O9011 is called in the modal mode.
• With G65 in N5, no modal call is made but O1000 is called in the simple mode,
and a modal call is made in the called user program O1000.
• With G42 in N7, no modal call is made but a macro call using a specified G code
is made, and no modal call is made in the called execution macro O9010.
Limitation
1 This method is useful only when an execution macro is called from a user program.
This method performs the same operation as performed when bit 6 (GMP) of parameter No. 6008 is
set to 0 and bit 2 (PCDC) of compile parameter No. 9163 is set to 0.
2 Address L is also used as an argument, so that no repetition count can be specified.
3 No modal calls can be nested. No modal call can be nested with G66/G66.1.
4 In a modal call, no custom macro call using G/M/T/second auxiliary function code/special code can
be made; modal calls of execution macro programs will be made.
- 35 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
3.2.8.1 Macro call using a cancel G code for a macro modal call
using G code
By setting bit 4 (MDLP) of compile parameter No. 9008 to 1, the execution macro program O9006 can be
called when a cancel G code (G167 or the G code specified in compile parameter No. 9034) for a macro
modal call using G code is specified. Thus, a macro program for performing processing after a modal call
can be coded.
NOTE
This function is enabled only when bit 0 (GMC) of compile parameter No. 9163 is
set to 1.
Example
Compile parameter No.9013= -100: With G100, O9010 is called as a macro in
the modal mode.
User program Execution macro
O4000
G01F500
G100X10Y10
G167X0Y0Z0 O9006
X#24Z#26
M30 M99
Format
g : Call G code.
Gg <argument-specification> ; argument : Data to be passed to the execution macro.
Argument specifications I is available.
(*1)
User program Execution macro
O0001 ; O9010 ;
: :
G01G91X10.Y20.G100 ; :
: :
M30 ; M99 ;
Compile parameter No.9013=100
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Call code
In contrast to a macro call using a G code, a G code in a block is used as a call command unless another
call command is specified before the G code. When multiple call commands are specified, the first call
code specified is selected. A subsequent call code is used as an argument if the first call code specified is
for a macro call. A subsequent call code is executed as an ordinary NC statement if the first call code
specified is for a subprogram call.
Example
When a special macro call using G100 and a subprogram call using M100 are
enabled for the machine
a) G100 M06; Calls a macro using G100.
b) G01 X100. G100; Calls a macro using G100.
c) G100 M100; Calls a macro using G100. (M100 is an argument.)
d) M100 G100; A call is made with M100 before G100, so that G100 is
treated as an ordinary G code, resulting in alarm PS0010.
* If a special macro call is made with a G code (in cases of a to c), the specified
addresses including the call code G100 are used as arguments.
Argument
1. All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
Example
When a setting is made so that O9010 is called as a special macro with G100
O0001 O9010;
N1G90G00X50.0; X#24;
N2G91G01X100.0G100; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9010 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
2. When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
- 37 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
3. There are the following relationships between addresses and local variables:
In the case of address G, the specified call G code is passed to #27, and up to five of other G codes
in the ascending order of G code group numbers are used as arguments and passed to #28 to #32.
Address Variable number Address Variable number Address Variable number
A #1 J #5 S #19
B #2 K #6 T #20
C #3 L #12 U #21
D #7 M #13 V #22
E #8 M2(*1) #14 W #23
F #9 M3(*1) #15 X #24
G #27 to #32 P #16 Y #25
H #11 Q #17 Z #26
I #4 R #18
*1 : When bit 7 (M3B) of parameter No. 3404 is set to 1, up to three M codes specified in address M are
used as arguments. Of the fourth and subsequent M codes, the last M code specified is passed to
#15.
[Example] M1 M2 N100 G300 M3 M4 ; (G300 : Call code)
(1) Bit 7 (M3B) of parameter No.3404 is set to 0:
#27=300, #13=4, #14 =<null>, #15 =<null>
(2) Bit 7 (M3B) of parameter No.3404 is set to 1:
#27=300, #13=1, #14=2, #15=4
Example
If "G91 G28 X123.45678 G100;" is specified on an IS-B machine that enables a
special macro call to be made using G100, the arguments are passed as follows:
#24 →123.457
#27 → 100
#28 →28.0
#29 →91.0
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of G100 M1.23; results in alarm PS0007.
Limitation
1 Address L is also used as an argument, so that no repetition count can be specified.
2 No specified address is evaluated. So, an execution macro is called by a specified address without
making a modal change.
3 The other limitations are the same as for a macro call using a respective G code.
- 38 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Format
m : Call M code. Must be specified before any
Mm Ll <argument-specification> ; argument.
l (*2) : Repetition count (1 by default)
1 to 99999999
argument : Data to be passed to the execution
macro. Argument specifications I and II
are available.
(*1)
User program Execution macro
O0001 ; O9020 ;
: :
M200 X10.0 Y20.0 Z-10.0 ; :
: :
M30 ; N9 M99 ;
Compile parameter No.9023=200
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
*2 When bit 5 (MCARG) of compile parameter No. 9008 is set to 1, address L is also used as an
argument, so that the number of repeats cannot be specified.
Argument specification
• Argument specification I or II is automatically determined according to the address used.
• When bit 5 (MCARG) of compile parameter No. 9008 is set to 1, address G/L/P is also used as an
argument. So, no repetition count can be specified.
• Address N, when specified before a call M code, is used not as an argument but as a sequence
number.
• Up to three M codes specified in address M are used as arguments. Of the fourth and subsequent M
codes, the last M code specified is passed to #15. Address N is specified, however, the second
specified M code or the N code, whichever specified later, is used as an argument.
[Example] Mmm: Call code
(1) When an N code is specified after the second M code:
Mmm M1 M2 N100 M3 M4 M5 → #13=1,#14=100,#15=5
(2) When an N code is specified before the second M code:
Mmm M1 N100 M2 M3 M4 M5 → #13=1,#14=2,#15=5
- 39 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Limitation
1 If an M code exceeding 99999999 is set, the macro call is invalidated. (The M code is output as an
ordinary M code.)
2 Usually, when an execution macro is called from a program called using an M code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available. Moreover, when bit 2 (PCDC) of compile parameter No. 9163 is set to
1, a call using a G code can be made from a program called using an M code by setting bit 6 (GMP)
of parameter No. 6008 to 1. Parameter GMP is an ordinary parameter, so that this parameter can be
modified, for example, through the MDI panel.
Parameter setting
The table below indicates the compile parameters to be set for each set.
1st set 2nd set 3rd set
Start M code number 9120 9123 9126
Number of execution macros to be defined 9121 9124 9127
Start execution macro number 9122 9125 9128
Example
Setting of the 1st set: No. 9120=100 No. 9122=8000 No. 9121=10
Setting of the 2nd set: No. 9123=150 No. 9125=8100 No. 9124=30
Setting of the 3rd set: No. 9126=200 No. 9128=8900 No. 9127=5
The settings above define the following sets of macro calls:
1st set 2nd set 3rd set
M100 → O8000 M150 → O8100 M200 → O8900
M101 → O8001 M151 → O8101 M201 → O8901
M102 → O8002 M152 → O8102 M202 → O8902
: : : : M203 → O8903
M109 → O8009 M179 → O8129 M204 → O8904
Limitation
1 This type of macro call is invalidated in the following cases:
<1> A value outside the valid range is set for a compile parameter.
<2> The defined M code range exceeds 99999999.
<3> The defined program number range exceeds 99999999.
NOTE
To use a program number with an O number of five or more digits, set bit 3
(ON8) of parameter No. 11304 to 1.
2 M codes used for macro calls are not used as call commands in this type of macro call even when
included in the setting range.
- 40 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
3 If the M code range of a call based on specification of 3 sets duplicates the M code of a call based on
compile parameter Nos. 9023 to 9032, the call based on compile parameter Nos. 9023 to 9032 has
higher priority.
Format
Mm <argument-specification> ; m : Call M code.
argument : Data to be passed to the execution
macro. Argument specifications I is
available.
(*1)
User program Execution macro
O0001 ; Oxxxx ;
: :
G01G91X10.Y20.M100 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter setting
- Special macro call using a range specification M code
When bit 3 (MSCL) of compile parameter No. 9009 is set to 1, a subprogram call using the range
specification M codes set in the compile parameter No. 9042 and No. 9043 is treated as a special macro
call. The called program number is O9009 at all times.
1st set 2nd set 3rd set 4th set 5th set 6th set
Start M code number 9111 9114 9117 9120 9123 9126
Number of execution macros to be defined 9112 9115 9118 9121 9124 9127
Start execution macro number 9113 9116 9119 9122 9125 9128
- 41 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
Setting of the 1st set: No.9111=100 No.9113=8000 No.9112=10
Setting of the 2nd set: No.9114=150 No.9116=8100 No.9115=30
Setting of the 3rd set: No.9117=200 No.9119=8900 No.9118=5
When the settings above are made, the following three sets of special macro
calls are defined:
1st set 2nd set 3rd set
M100 → O8000 M150 → O8100 M200 → O8900
M101 → O8001 M151 → O8101 M201 → O8901
M102 → O8002 M152 → O8102 M202 → O8902
: : : : M203 → O8903
M109 → O8009 M179 → O8129 M204 → O8904
Call code
In contrast to a macro call using an M code, an M code in a block is used as a call command unless
another call command is specified before the M code. When multiple call codes are specified, the first call
code specified is selected. A subsequent call code is used as an argument if the first call code specified is
for a macro call. A subsequent call code is executed as an ordinary NC statement if the first call code
specified is for a subprogram call.
Example
When a special macro call using M100 and a subprogram call using M10 are
enabled for the machine
a) M100 S1000; Calls a macro using M100.
b) G01 X100. M100; Calls a macro using M100.
c) M100 M10; Calls a macro using M100. (M10 is an argument.)
d) M10 M100; Processes M100 as an usual M code, then calls a
subprogram using M10.
* If a special macro call is made with M100 (in cases of a to c), all specified
addresses including the call code M100 are used as arguments.
Argument
1 All addresses specifiable on the machine are treated as arguments. Those addresses that are used as
arguments are just specified addresses, and no modal change is made. (However, address N is used
as an argument, and a modal change is made.)
Example
When a setting is made so that O9020 is called as a special macro with M100
O0001 O9020;
N1G90G00X50.0; X#24;
N2G91G01X100.0M100; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9020 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
- 42 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
2. When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3. There are the following relationships between addresses and local variables:
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
Example
If "G91 G28 X123.45678 M100;" is specified on an IS-B machine that enables a
special macro call to be made using M100, the arguments are passed as
follows:
#24 →123.457
#27 → 100
#28 →28.0
#29 →91.0
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address L does not allow the decimal
point to be used. So, the specification of M100 L1.23; results in alarm PS0007.
Limitation
1 Address L is also used as an argument, so that no repetition count can be specified.
2 The other limitations are the same as for a subprogram call using a range specification M code, a
macro call (specification of 3 sets) using M code, or a subprogram call (specification of 3 sets) using
M code.
- 43 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Format
xx <argument-specification> ; xx : Call code.
argument : Data to be passed to the execution
macro. Argument specifications I is
available.
(*1)
User program Execution macro
O0001 ; O9009 ;
: :
G91G01X100.0 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Selecting axes
Select the target controlled axes for a macro call using each bits 0 to 3 of compile parameter No. 9005,
bits 0 to 3 of compile parameter No. 9008, and bits 0 to 7 of compile parameters Nos. 9164 and 9165 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.
9010 and 9020 to 9021 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. 9005 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. 9010 is set to 00000101, a macro call is disabled for X and
Z axes.
Variables
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. 9010 and 9020 to 9021. The following shows the
relationships between variable settings and parameter settings:
#31 ...................... #23 ................................................. #0
#8690
#0 to #7 : Corresponds to parameter No. 9010 and used to control the 1st to 8th axes in the path.
#8 to #15 : Corresponds to parameter No. 9020 and used to control the 9th to 16th axes in the path.
#16 to #23 : Corresponds to parameter No. 9021 and used to control the 17th to 24th axes in the
path.
=1 : Disables the macro call for the 1st axis. (Bit 0 of parameter No. 9010=1)
=2 : Disables the macro call for the 2nd axis. (Bit 1 of parameter No. 9010=1)
=4 : Disables the macro call for the 3rd axis. (Bit 2 of parameter No. 9010=1)
:
:
=8388608 : Disables the macro call for the 24th axis. (Bit 7 of parameter No. 9021=1)
- 44 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
To disable the macro call for multiple axes, set the algebraic sum of the value set for each axis.
Example
To invalidate the call of the 1st and 3rd axes, #8690 = (1+4) = 5 can be set. To
invalidate the call of the 1st, 16th, and 24th axes, the following can also be
specified:
#100=2
#1=1-1
#16=16-1
#24=24-1
#101=POW[#100,#1] ; 1st axis
#116=POW[#100,#16] ; 16th axes
#124=POW[#100,#24] ; 24th axes
#8690=#101+#116+#124
NOTE
1 It may take time until the value set for the variable is reflected in parameters Nos.
9010 and 9020 to 9021, 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, 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. When multiple
call commands are specified, the first call code specified is selected. A subsequent call code is used
as an argument if the first call code specified is for a macro call. A subsequent call code is executed
as an ordinary NC statement if the first call code specified is for a subprogram call.
2 When multiple axis addresses for macro calls are specified in the same block, the axis address which
appears first in the block is used as a call command.
- 45 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
When a special 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. (M100 is an argument.)
e) M100 X100.; Calls a subprogram using M100 after the tool moves along
the X axis according to X100.
* If a special macro call is made with X and Y (in cases of a to d), all specified
addresses including the call codes X100. and Y200. are used as arguments.
Argument
1 All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
Example
For a machine that enables macro calls using X and Z
O0001; O9009;
N1G90G00Y-50.0F500; X#27Z#26;
N2G91G01X100.0Z120.0; M99;
N3Y50.0.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. So, O9009 and N3 causes a rapid traverse to X100.0, Z120.0 and
Y50.0 respectively.
2 When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3 There are the following relationships between addresses and local variables:
The axis address used as a call code is passed to variable #27.
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
NOTE
When G code system A is used on a lathe system, whether the call address is
specified as an absolute command or incremental command is posted to #33
(<null> for an absolute command or 1.0 for an incremental command).
Example
When the X-axis is a call axis
1 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
Others are set to <null>.
2 On a lathe system for which G code system A is used
When X100.0; is specified: #27 = 100.0, and #33 = <null>
When U100.0; is specified: #27 = 100.0 and #33 = 1.0
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of X123.456 M1.23; results in alarm
PS0007.
Limitation
1 Usually, when an execution macro is called from a program called using an axis address, only a G65
or M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1,
G66 and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using an axis address by setting bit 6 (GMP) of parameter No. 6008 to 1. This
parameter is an ordinary parameter, so that parameter GMP can be modified, for example, through
the MDI panel.
3 Address L is also used as an argument, so that no repetition count can be specified.
Format
Tt <argument-specification> ; t: Call T code.
argument : Data to be passed to the execution
macro. Argument specifications I is
available.
(*1)
User program Execution macro
O0001 ; O9008;
: :
T20A2B3M06 ; :
: :
M30 ; M99 ;
- 47 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter
When bit 7 (TMACC) of compile parameter No. 9005 is set to 1, this type of macro call is enabled. This
parameter is initialized to the values set for P-CODE at power-on.
Bit 0 (MTC) of parameter No. 9011 can be used to disable this type of macro call as required. This
parameter is an ordinary parameter, so that parameter MTC can be modified, for example, through the
MDI panel.
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 (MTC) of parameter No. 9011.
#8691 = 0: Enables a call using a T code. (MTC = 0)
= 1: Disables a call using a T code. (MTC = 1)
Example
User program Execution macro
O0001 ; O9008 ;
: G00 X#1Z#2;
T20A20.0B30.0M06 ; :
G00X20.Z30.; #8691=1;
: :
T12; ← Functions as M99;
: ordinary T code
M02; command.
NOTE
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 (MTC) of
parameter No. 9011, 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 , 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. When multiple call commands are specified, the
first call code specified is selected. A subsequent call code is used as an argument if the first call code
specified is for a macro call. A subsequent call code is executed as an ordinary NC statement if the first
call code specified is for a subprogram call.
- 48 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
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.
* When a special macro call using a T code is performed (a to c), all specified
addresses including the T code are treated as arguments.
Argument
1 All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
Example
O0001 O9008;
N1G90G00X50.0; X#24;
N2 G91G01X100.0T123; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9008 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
2 When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3 There are the following relationships between addresses and local variables:
Address T is passed to variable #27.
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
- 49 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
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
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of T123 M1.23; results in alarm PS0007.
Limitation
1 Usually, when an execution macro is called from a program called using a T code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using a T code by setting bit 6 (GMP) of parameter No. 6008 to 1. This
parameter is an ordinary parameter, so that parameter GMP can be modified, for example, through
the MDI panel.
3 Address L is also used as an argument, so that no repetition count can be specified.
Format
d : Call D code.
Dd <argument-specification> ;
argument : Data to be passed to the execution macro.
Argument specifications I is available.
(*1)
User program Execution macro
O0001; O9040;
: :
G42X100.D12; :
: :
M30; M99;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter
When bit 0 (DMACC) of compile parameter No. 9104 is set to 1, this type of macro call is enabled. This
parameter is initialized to the values set for P-CODE at power-on.
Bit 0 (MDC) of parameter No. 9012 can be used to disable this type of macro call as required. This
parameter is an ordinary parameter, so that parameter MDC can be modified, for example, through the
MDI panel.
- 50 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Call code
In contrast to a macro call using a G or M code, a D code in a block is used as a call command unless
another call command is specified before the D code. When multiple call commands are specified, the
first call code specified is selected. A subsequent call code is used as an argument if the first call code
specified is for a macro call. A subsequent call code is executed as an ordinary NC statement if the first
call code specified is for a subprogram call.
Example
When a macro call using a D code and a subprogram call using M100 are
enabled for the machine
a) D123 M06; Calls a macro using D123.
b) G41 X100. D123; Calls a macro using D123.
c) D123 M100; Calls a macro using D123. (M100 is an argument.)
d) M100 D123; Processes D123 as an ordinary D code, then calls a
subprogram using M100.
* When a special macro call using a D code is performed (a to c), all specified
addresses including the D code are treated as arguments.
Argument
1. All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
Example
O0001 O9040;
N1G90G00X50.0; X#24;
N2 G91G01X100.0D123; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9040 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
2 When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3 There are the following relationships between addresses and local variables:
Address D is passed to variable #27.
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
Address Variable number Address Variable number Address Variable number
A #1 J #5 S #19
B #2 K #6 T #20
C #3 L #12 U #21
D #27 M #13 V #22
E #8 M2 (*1) #14 W #23
F #9 M3 (*1) #15 X #24
G #28 to 32 P #16 Y #25
H #11 Q #17 Z #26
I #4 R #18
*1: When bit 7 (M3B) of parameter No. 3404 is set to 1, up to three M codes specified in address M are
used as arguments. Of the fourth and subsequent M codes, the last M code specified is passed to
#15.
- 51 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
When G91 G28 X123.45678 D56; is specified for an IS-B machine, values are
passed as follows:
#24 →123.457
#27 → 56.0
#28 → 28.0
#29 → 91.0
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of D123 M1.23; results in alarm PS0007.
Limitation
1 Usually, when an execution macro is called from a program called using a D code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using a D code by setting bit 6 (GMP) of parameter No. 6008 to 1. This
parameter is an ordinary parameter, so that parameter GMP can be modified, for example, through
the MDI panel.
3 Address L is also used as an argument, so that no repetition count can be specified.
Format
Hh argument-specification> ; h : Call H code.
argument : Data to be passed to the execution macro.
Argument specifications I is available.
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter
When bit 1 (HMACC) of compile parameter No. 9104 is set to 1, this type of macro call is enabled. This
parameter is initialized to the values set for P-CODE at power-on.
- 52 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Bit 1 (MHC) of parameter No. 9012 can be used to disable this type of macro call as required. This
parameter is an ordinary parameter, so that parameter MHC can be modified, for example, through the
MDI panel.
Call code
In contrast to a macro call using a G or M code, an H code in a block is used as a call command unless
another call command is specified before the H code. When multiple call commands are specified, the
first call code specified is selected. A subsequent call code is used as an argument if the first call code
specified is for a macro call. A subsequent call code is executed as an ordinary NC statement if the first
call code specified is for a subprogram call.
Example
When a macro call using an H code and a subprogram call using M100 are
enabled for the machine
a) H123 M06; Calls a macro using H123.
b) G43 Z100. H123; Calls a macro using H123.
c) H123 M100; Calls a macro using H123. (M100 is an argument.)
d) M100 H123; Processes H123 as an ordinary H code, then calls a
subprogram using M100.
* When a special macro call using an H code is performed (a to c), all specified
addresses including the H code are treated as arguments.
Argument
1. All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
Example
O0001; O9041;
N1G90G00X50.0; X#24;
N2 G91G01Z100.0H123; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9041 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
2 When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3 There are the following relationships between addresses and local variables:
Address H is passed to variable #27.
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
- 53 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
When G91 G28 Z123.45678 H56; is specified for an IS-B machine, values are
passed as follows:
#26 →123.457
#27 → 56.0
#28 → 28.0
#29 → 91.0
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of H123 M1.23; results in alarm PS0007.
Limitation
1 Usually, when an execution macro is called from a program called using an H code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using an H code by setting bit 6 (GMP) of parameter No. 6008 to 1. This
parameter is an ordinary parameter, so that parameter GMP can be modified, for example, through
the MDI panel.
3 Address L is also used as an argument, so that no repetition count can be specified.
4 If the C-axis is used on a lathe system, H is used for an incremental command, so that no call
command using an H code can be specified.
- 54 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Format
s : Call S code.
Ss <argument-specification> ;
argument : Data to be passed to the execution macro.
Argument specifications I is available.
(*1)
User program Execution macro
O0001 ; O9042;
: :
M03S1000 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter
When bit 2 (SMACC) of compile parameter No. 9104 is set to 1, this type of macro call is enabled. This
parameter is initialized to the values set for P-CODE at power-on.
Bit 2 (MSC) of parameter No. 9012 can be used to disable this type of macro call as required. This
parameter is an ordinary parameter, so that parameter MSC can be modified, for example, through the
MDI panel.
Call code
In contrast to a macro call using a G or M code, an S code in a block is used as a call command unless
another call command is specified before the S code. When multiple call commands are specified, the first
call code specified is selected. A subsequent call code is used as an argument if the first call code
specified is for a macro call. A subsequent call code is executed as an ordinary NC statement if the first
call code specified is for a subprogram call.
Example
When a macro call using an S code and a subprogram call using M100 are
enabled for the machine
a) S123 M03; Calls a macro using S123.
b) G00 Z100. S123; Calls a macro using S123.
c) S123 M100; Calls a macro using S123.(M100 is an argument.)
d) M100 S123; Processes S123 as an ordinary S code, then calls a
subprogram using M100.
* When a special macro call using an S code is performed (a to c), all specified
addresses including the S code are treated as arguments.
Argument
1. All addresses specifiable with a machine except address N are used as arguments. Those addresses
that are used as arguments are just specified addresses, and no modal change is made.
- 55 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
O0001 O9042;
N1G90G00X50.0; X#24;
N2 G91G01Z100.0S123; M99;
N3 X150.;
:
G91G01 of N2 are just treated as arguments, and the modal state remains to be
G90 G00. For this reason, O9042 and N3 causes a rapid traverse to X100.0 and
X150.0 respectively.
2 When an address is specified with no decimal point, a decimal point is added to the value passed to a
local variable according to bit 0 (DPI) of parameter No. 3401.
3 There are the following relationships between addresses and local variables:
Address S is passed to variable #27.
The first five addresses G in ascending order of G code groups are used as arguments and passed to
variables #28 to #32.
Example
When G91 G28 X123.45678 S5600; is specified for an IS-B machine, values are
passed as follows:
#24 →123.457
#27 →5600.0
#28 → 28.0
#29 → 91.0
Others are set to <null>.
NOTE
The specifiable addresses and specification range conform to the specification
address range of the CNC. For example, address M does not allow the decimal
point to be used. So, the specification of S123 M1.23; results in alarm PS0007.
- 56 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Limitation
1 Usually, when an execution macro is called from a program called using an S code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using an S code by setting bit 6 (GMP) of parameter No. 6008 to 1. This
parameter is an ordinary parameter, so that parameter GMP can be modified, for example, through
the MDI panel.
3 Address L is also used as an argument, so that no repetition count can be specified.
Format
M98 : Call command
M98 P p L l ; P : Program number of an execution macro to be called
l : Repetition count (1 by default)
1 to 99999999
O9010 ; O0100 ;
: :
M98 P100 L2 ; :
: :
M30 ; M99 ;
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 M code
l : Repetition count (1 by default)
1 to 99999999
(*1)
User program Execution macro
O0001 ; O9001 ;
: :
M200 L2 ; :
: :
M30 ; M99 ;
Compile parameter No.9010=200
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
- 57 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Limitation
1 If an M code exceeding 99999999 is set, the subprogram call is invalidated. (The M code is output
as an ordinary M code.)
2 Usually, when an execution macro is called from a program called using an M code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available. Moreover, when bit 2 (PCDC) of compile parameter No. 9163 is set to
1, a call using a G code can be made from a program called using an M code by setting bit 6 (GMP)
of parameter No. 6008 to 1. Parameter GMP is an ordinary parameter, so that this parameter can be
modified, for example, through the MDI panel.
Format
m : C all M code
Mm L l ;
l : R epetition count (1 by default)
1 to 99999999
(1)
User program Execution macro
O0001 ; O9009 ;
: :
M200 L2 ; :
: :
M30 ; M99 ;
Compile parameter No.9042=200, No.9043=210
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Argument
The specified M code is passed to variable #148.
- 58 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Limitation
1 Usually, when an execution macro is called from a program called using an M code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available. Moreover, when bit 2 (PCDC) of compile parameter No. 9163 is set to
1, a call using a G code can be made from a program called using an M code by setting bit 6 (GMP)
of parameter No. 6008 to 1. Parameter GMP is an ordinary parameter, so that this parameter can be
modified, for example, through the MDI panel.
2 This type of subprogram call is invalidated in the following cases:
<1> A value outside the valid range is set for a compile parameter No.9042 or 9043.
<2> The value set for compile parameter No. 9042 is greater than the value set for parameter No.
9043.
3 M codes used for macro and subprogram calls are not used as call codes in this type of subprogram
call even when included in the setting range. If duplicate M codes are set, the following priority
order is applied:
<1> Macro call using M code
(compile parameters Nos. 9023 to 9032 and 9120 to 9128)
<2> Subprogram call using M code
(compile parameters Nos. 9010 to 9012)
<3> Subprogram call using an M code in the specified range
(compile parameters Nos. 9042 and 9043)
Parameter setting
The table below indicates the compile parameters to be set for each set.
1st set 2nd set 3rd set
Start M code number 9111 9114 9117
Number of execution macros to be defined 9112 9115 9118
Start execution macro number 9113 9116 9119
- 59 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
Setting of the 1st set: No. 9111=100 No. 9113=8000 No. 9112=10
Setting of the 2nd set: No. 9114=150 No. 9116=8100 No. 9115=30
Setting of the 3rd set: No. 9117=200 No. 9119=8900 No. 9118=5
The settings above define the following sets of subprogram calls:
1st set 2nd set 3rd set
M100 → O8000 M150 → O8100 M200 → O8900
M101 → O8001 M151 → O8101 M201 → O8901
M102 → O8002 M152 → O8102 M202 → O8902
: : : : M203 → O8903
M109 → O8009 M179 → O8129 M204 → O8904
Limitation
1 Usually, when an execution macro is called from a program called using an M code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available. Moreover, when bit 2 (PCDC) of compile parameter No. 9163 is set to
1, a call using a G code can be made from a program called using an M code by setting bit 6 (GMP)
of parameter No. 6008 to 1. Parameter GMP is an ordinary parameter, so that this parameter can be
modified, for example, through the MDI panel.
3 M codes used for macro and subprogram calls are not used as call codes in this type of subprogram
call even when included in the setting range. If duplicate M codes are set, the following priority
order is applied:
<1> Macro call using M code
(compile parameters Nos. 9023 to 9032 and 9120 to 9128)
<2> Subprogram call using M code
(compile parameters Nos. 9010 to 9012)
<3> Subprogram call using an M code in the specified range
(compile parameters Nos. 9042 and 9043)
<4> Subprogram call using M code (specification of 3 sets)
(compile parameters Nos. 9111 to 9113, 9114 to 9116, and 9117 to 9119)
- 60 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Format
s : Call S code
Ss L l ;
l : Repetition count (1 by default)
1 to 99999999
(*1)
User program Execution macro
O0001 ; O9029 ;
: :
S200 L2 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Argument
The specified S code is passed to variable #147.
Limitation
1 Usually, when an execution macro is called from a program called using an S code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using an S code by setting bit 6 (GMP) of parameter No. 6008 to 1. Parameter
GMP is an ordinary parameter, so that this parameter can be modified, for example, through the
MDI panel.
- 61 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Format
t : Call T code
Tt L l ;
l : Repetition count (1 by default)
1 to 99999999
(*1)
User program Execution macro
O0001 ; O9000 ;
: :
T200 L2 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Parameter
Setting bit 7 (TMACC) of compile parameter No. 9005 to 0 and bit 0 (TCAL) of compile parameter No.
9002 to 1 enables this type of subprogram call. These parameters are initialized to the values set for
P-CODE at power-on.
Bit 0 (MTC) of parameter No. 9011 can be used to disable this type of subprogram call as required. This
parameter is an ordinary parameter, so that parameter MTC can be modified, for example, through the
MDI panel.
Variables
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 (MTC) of parameter No. 9011.
#8691 =0 : Enables a call using a T code. (MTC=0)
=1 : Disables a call using a T code. (MTC=1)
Example
User program Execution macro
O0001 ; O9000 ;
: G00 X…;
T11; :
G00X20.0Z30.0; #8691=1;
: :
T12;← Functions as M99;
: ordinary T code
M02; command.
NOTE
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 (MTC) of
parameter No. 9011, 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, or auxiliary macro.
- 62 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Argument
The specified T code is passed to variable #149.
Limitation
1 Usually, when an execution macro is called from a program called using a T code, only a G65 or
M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, G66
and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using a T code by setting bit 6 (GMP) of parameter No. 6008 to 1. Parameter
GMP is an ordinary parameter, so that this parameter can be modified, for example, through the
MDI panel.
Format
b : Call second auxiliary function code
Bb L l ;
l : Repetition count (1 by default)
1 to 99999999
(*1)
User program Execution macro
O0001 ; O9028 ;
: :
B100 L2 ; :
: :
M30 ; M99 ;
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
Argument
The specified second auxiliary function code is passed to variable #146.
- 63 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Limitation
1 Usually, when an execution macro is called from a program called using a second auxiliary function
code, only a G65 or M98 command can be specified. When bit 2 (PCDC) of compile parameter No.
9163 is set to 1, G66 and G66.1 are also available.
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call using a G code can be made
from a program called using a second auxiliary function code by setting bit 6 (GMP) of parameter
No. 6008 to 1. Parameter GMP is an ordinary parameter, so that this parameter can be modified, for
example, through the MDI panel.
Format
a : Call specific code
Aa L l ;
l : Repetition count (1 by default)
1 to 99999999
(*1)
User program Execution macro
O0001 ; O9004 ;
: :
E100 L2 ; :
: :
M30 ; M99 ;
Parameter No.6090=69(E)
*1 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a call can be made from an execution
macro.
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.
Limitation
1 Usually, when an execution macro is called from a program called using a specific code, only a G65
or M98 command can be specified. When bit 2 (PCDC) of compile parameter No. 9163 is set to 1,
G66 and G66.1 are also available.
- 64 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
2 When bit 2 (PCDC) of compile parameter No. 9163 is set to 1, a G code can be made from a
program called using a specific code by setting bit 6 (GMP) of parameter No. 6008 to 1. Parameter
GMP is an ordinary parameter, so that this parameter can be modified, for example, through the
MDI panel.
Format
m : Call M code
Mm P p L l ; P : Program number of a execution program to be called
l : Repetition count (1 by default)
1 to 99999999
O0001 ; O9010 ;
: :
G81 X10.0 Z-10.0 ; M300 P100 L2 ;
: :
M30 ; M99 ;
- 65 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Limitation
1 If an M code exceeding 99999999 is set, the call is invalidated. (The M code is output as an ordinary
M code.)
2 From a user program called as a subprogram from an execution macro, another program can be
called. In this case, three types of calls can be made as described below. The limitations depend on
the settings of bit 6 (GMP) of parameter No. 6008, bit 2 (PCDC) of compile parameter No. 9163,
and bit 6 (C16) of compile parameter No. 9163.
(a) Calling another user program in program memory
(b) Calling an execution macro
(c) Calling a subprogram of the user program after an execution macro is called
- 66 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
: O90xx
Gxx :
: MxxPpp1
:
M99
Opp1
Mxx (b)
:
M99 O90xx
(a) :
MxxPpp2
(c) :
Oxxxx M99
:
M99
O pp2
:
M99
- 67 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
NOTE
1 If a disabled type of call is attempted, the command is treated as an ordinary
G/M/S/T/D/H/second auxiliary function/axis address code.
2 The same behavior as for bit 6 (GMP) of parameter No. 6008 = 0 and bit 2
(PCDC) of compile parameter No. 9163 = 0 occurs if bit 0 (GMC) of compile
parameter No. 9163 = 1.
Example 1
When bit 6 (GMP) of parameter No. 6008 and bit 2 (PCDC) of compile
parameter No. 9163 are set to 0 and bit 6 (C16) of compile parameter No. 9163
is set to 1
O1000 ; O9011 ;
: :
G200.0; MmmP1001;
: :
M99; M99;
O1001 ;
: An execution macro call using
M99; G code can be made from a
program called using G code.
O1000 ;
:
M100 ;
:
M99; Calls other than user
program calls using
O9020 ; G65, M98, G66, and
: G66.1 are not
M99; allowed.
- 68 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example 2
When both of bit 6 (GMP) of parameter No. 6008 and bit 2 (PCDC) of compile
parameter No. 9163 are set to 1
O1000 ; O9011 ;
: :
G200.0; MmmP1001;
: :
M99; M99;
O1000 ; O9020 ;
: :
M100 ; MmmP1001;
: :
M99; M99;
O1001 ;
: An additional user program
: can be called.
M99;
O1000 ;
:
M100 ;
:
M99;
- 69 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example 3
When bit 6 (GMP) of parameter No. 6008, bit 2 (PCDC) of compile parameter
No. 9163, and bit 6 (C16) of compile parameter No. 9163 are set to 1
O1000 ; O9011 ;
: :
G110.; MmmP1001;
: :
M99; M99;
O1002 ; O9021 ;
: :
M200; T123 M06;
: :
×
M99; M99;
O9008 ;
:
M99;
- 70 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
(c) The program number of an execution macro is set for variable #8610 using a conversational macro
or auxiliary macro before the start of automatic operation.
(d) The main program is selected.
When the above four conditions are satisfied, starting automatic operation:
(1) The execution macro specified by #8610 is called. When bit 4 (P98) of compile parameter No. 9163
is set to 0, the call is equivalent to a simple call (G65). When bit 4 (P98) of compile parameter No.
9163 is set to 1, the call is equivalent to a subprogram call.
(2) Executes the main program after termination of the execution macro.
NOTE
No execution macro is called if the main program is not selected. In this case,
alarm (PS1079)” PROGRAM FILE NOT FOUND” can be issued by setting bit 5
(NPA) of parameter No. 9035 to 1.
Warning
WARNING
When conditions a) to d) 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.
In the simple call (G65) mode, the execution macro is executed using a local variable level different from
the level the main program uses. In other words, the local variables used by the execution macro are not
passed to the main program.
In the subprogram call (M98) mode, the execution macro uses the same local variable level as the main
program. In other words, the local variables used by the execution macro are passed to the main program.
- 71 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
In case of the following axis configuration, if all arguments are specified, the
relationship between the parameter (No.11647) and local variable number is as
follows.
Parameter
Axis name Local variable
(No.11647)
XA1 (*1) 1 Argument is set to #1
XA2 (*1) 2 Argument is set to #2
Y 0 Argument is set to #25
Z 21 Argument is set to #21
C 0 Argument is set to #3
C2 (*1) 22 Argument is set to #22
(*1) Axis name expansion
G65 XA1=10.0 XA2=20.0 Y30.0 Z40.0 C50.0 C2=60.0
P1000;
(Variable)
#1: 10.0
#2: 20.0
#25: 30.0
#21: 40.0
#3: 50.0
Example
When 2 arguments of XA1=10.0 and D20.0 are commanded to local variable #7,
the later argument D20.0 becomes effective.
Parameter
Axis name Local variable
(No.11647)
XA1 (*1) 7 Argument is set to #7
(*1) Axis name expansion
G65 XA1=10.0 D20.0 P1000;
(Variable)
#7: 10.0 20.0
- 72 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example
When using the same axis name and using the axis name expansion, the
relationship between the parameter (No.11647) and local variable number is as
follows.
Parameter
Axis name Local variable
(No.11647)
XA1 (*1) 0 The argument for XA1 is invalid
XA1 (*1) 2 Invalid setting
YA2 (*1) 3 Argument is set to #3
YA2 (*1) 4 Invalid setting
C 5 Argument is set to #5
C 6 Invalid setting
(*1) Axis name expansion
(Variable)
#3: 20.0
#5: 30.0
- 73 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example
Original program Command to be executed when skipped
/1 N1 X100.; N1;
N2 /2 Y200.; N2;
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.
- 74 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
NOTE
If parameter No. 1020 that correspond to the axis number specified with a
symbol name with an incremental command in G code system A for a lathe
system is other than X, Z, C, and Y, alarm PS0009 is issued at execution time.
Example
If the same P-CODE macro is to be executed on a machine with an axis
configuration of X, Y, Z, and B and another machine with an axis configuration of
X, Y, Z, and C
For example, if the 1st axis is to be specified with &B and the 2nd axis with &A, make the following
settings in parameter No. 9076.
NOTE
If 2 or more axes are specified for the same axis number, alarm PW1106 will be
issued at power on.
[Example]
If parameter No.9076 is set as listed below, alarm PW1106 will be issued at
power on.
Axis number Parameter No.9076 Remarks
1st axis 2 The 1st axis corresponds to &B (YB).
2nd axis 1 The 2nd axis corresponds to &A (YA).
3rd axis 2 The same setting as that for the 1st axis is invalid.
- 76 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example
For the machine in a lathe system in which the 4th axis is ZA2 (parameters No.
1020 = 90, No. 1025 = 65, and No. 1026 = 50),
@ZA2 &D /*Axis name definition for an absolute command
@WA2 YD /*Axis name definition for an incremental command
by defining the symbols above, a macro program can be coded with the same
extended axis name as that in a custom macro, as shown below.
Example 1
To use P-CODE macros created in a 5-axis (X, Y, Z, B1 (&D), B2 (&E))
configuration on a machine in a 4-axis configuration (1st axis = X, 2nd axis = Y,
3rd axis = Z, and 4th axis = B2), set parameter No. 9076 as follows:
[P-CODE macro]
Symbol definition
@B1 &D /* Defines an axis name for the 4th axis.
@B2 &E /* Defines an axis name for the 5th axis.
- 77 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
Example 2
To use P-CODE macros created in a 3-axis (XA(&A), Y, ZA2(&C)) configuration
on a machine in a 3-axis configuration (1st axis = XA, 2nd axis = ZA2, and 3rd
axis = Y), set parameter No. 9076 as follows:
[P-CODE macro]
Symbol definition
@XA &A /* Defines an axis name for the 1st axis.
@ZA2 &C /* Defines an axis name for the 3rd axis.
NOTE
If 2 or more axes are specified for the same axis number, alarm PW1106 will be
issued at power on.
[Example]
If parameter No. 9076 is set as listed below, alarm PW1106 will be issued at
power on.
Axis number Parameter No.9076 Remarks
1st axis 2 The 1st axis is &B (YB).
2nd axis 1 The 2nd axis is &A(YA).
3rd axis Invalid because the parameter setting is the same as for the
2
1st axis
- 78 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
Example
To set the value 4 in parameter No. 0022 by using the programmable parameter
input function
P-CODE macro
O0010;
:
#100=22;
#101=4;
G10 L52;
NN#100 R#101; → Executed as N#100 R#101, resulting in N22R4
G11 ;
:
M99 ;
Limitation
Address NN used with this function can be used only to substitute for address N used in data input based
on the G10 command. Address NN cannot be used as a jump destination sequence number for a command
such as the GOTO command.
Example
O9011;
#100=10;
NG
GOTO #100; PS alarm (NN#100 is not regarded as the jump destination N10.)
:
NN#100;
M99;
NOTE
This function can be used in the following series and edition of the macro
compiler.
A08B-9010-J600#EN07 : V01.4 or later
A08B-9010-J604#EN11 : V01.0 or later
Thus, the G codes in the P-CODE program are executed after being automatically converted to the G
codes of the G code system set in bit 6 (GSB) and bit 7 (GSC) of parameter No. 3401.
However, if a P-CODE file created to G code system B or C is executed on a machine set to G code
system A, nonexistent G code groups such as groups 03 and 11 are not converted. (For example, G90 is
treated as an outer surface/inner surface turning cycle command.)
- 79 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
If a P-CODE program created to G code system A (with both of bit 0 (SP_G_B) and bit 1 (SP_G_C) of
compile parameter No. 9004 set to 0) is executed on a machine set to G code system B or C, an operation
based on an incremental command is performed on the axes specified with U_, V_, W_, and H_.
However, no modal change is made.
Check the G code system set in bit 6 (GSB) and bit 7 (GSC) of parameter No. 3401 and create a P-CODE
program according to a desired G code system.
Example
1 When a P-CODE macro created to G code system A (SP_G_B = 0, SP_G_C = 0)
is executed on a machine set to G code system B (GSB = 1, GSC = 0)
P-CODE Operation on NC
G50X0; → Converted to G92X0;
G00X100.; → Positioned at X100. in absolute mode
U100.; → A movement is made by 100.0 on X-axis in incremental mode.
(The modal code G90/G91 is not changed.)
2 Example of P-CODE macro created to G code system B (SP_G_B = 1, SP_G_C
= 0) (On a machine set to G code system A, G90 is treated as an outer
surface/inner surface turning cycle command, and G91 results in alarm PS0010.
So, G90 and G91 are not to be specified.)
#100=P3401;
#100=#100 AND 192; → Bits 6 and 7 of parameter No. 3401
IF [#100 EQ 0] On a machine set to G code system A
THEN
G94; → Converted to G98
G92 Z0.; → Converted to G50Z0
G00Z100. → Makes a movement to 100 on Z-axis in ABS mode.
U100. → Makes a movement by +100 on X-axis in INC mode.
: (Note: Bit 4 (UVW) of parameter No. 3400 must be
: set to 1.)
ELSE On a machine set to G code system B or C
G94; → Leaves G94 unchanged.
G92 Z0.; → Leaves G92Z0 unchanged.
G90G00 Z100.; → Makes a movement to 100 on Z-axis in ABS mode.
G91X100.; → Makes a movement by +100 on X-axis in INC mode.
: The modal code is G91.
ENDIF
NOTE
1 To execute a P-CODE program created to G code system B or C, bit 0 (SP_G_B)
and bit 1 (SP_G_C) of compile parameter No. 9004 must be set at all times.
2 Only G codes are converted. For example, the U_V_W_H_ command created to
G code system A is not converted to G91X_Y_Z_C_.
3 G code groups 03 and 11 do not exist in G code system A. So, when a P-CODE
program created to G code system B or C is executed on a machine set to G
code system A, G90/G91 and G98/G99 are not converted. For example, G90 is
treated not as an absolute command but as an outer surface/inner surface
turning cycle command.
- 80 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
- 81 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
- 82 -
B-63943EN-2/07 3.EXECUTION MACRO FUNCTION
- 83 -
3.EXECUTION MACRO FUNCTION B-63943EN-2/07
- 84 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
Compile parameter
No.9038
A lways Program number
executed
specification
F-ROM
Auxiliary macro Control variable
Auxiliary Program number
function #8530
macro modification
At power-on
Compile parameter
No.9039
Caution
CAUTION
1 The execution of the conversational macro function is processed at a lower level
than that of the CNC operation internally. Therefore, the execution of the
conversational macro function will not affect the processing speed of the CNC
operation, but the processing speed of the conversational macro function may
become slow while the CNC operation is ON. So, the conversational macro
function is not suitable for machine control that requires cyclic operation or
speedy processing.
2 The conversational macro function cannot execute any NC statements for the
CNC operation. If any are specified, the function ignores them.
3 NC statements in the conversational macro function differ from NC statements in
the meaning of addresses and in usage.
- 85 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
NOTE
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 with the value of the control variable for executing a conversational macro
(#8500) as the program number. In this case, a message indicating that a fatal
error occurs is displayed on the conversational macro screen. (For details, see
Section 4.6, "FATAL ERROR.")
2 If the conversational macro screen is displayed when the value of the
conversational macro execution control variable (#8500) is 0, only O numbers, N
numbers, status information, and soft keys are displayed.
Termination
Terminate execution of the conversational macro function using one of the following methods:
(1) Press a function key (such as or ) on the MDI panel.
(2) Set the control variable for executing a conversational macro (#8500) to 0.
(3) Screen switching request based on the screen control variable (#8510)
(4) Screen switching request from the system due to an alarm or another event
The timing for determining whether a cause for ending the execution of the conversational macro function
has occurred depends on the setting of bit 3 (TM99) of compile parameter No. 9160 as described below.
• When bit 3 (TM99) of compile parameter No. 9160 is set to 0
When the block being executed ends, whether a cause for ending the execution of the conversational
macro function has occurred is determined.
In this case, execution of the main program is not continued until the program end instruction
(execution control code M99/M99Pp) but the screen is switched immediately.
- 86 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
O1234 ; O1234 ;
NO NO
Key input? Key input?
YES YES
M99 ; M99 ;
When programming a conversational macro, always specify M99 in the same way as for a PMC ladder
program to create a program which returns to the beginning of the main program. Alternatively, specify
M99Pp to create a cyclic program which returns to the sequence number specified for M99Pp.
For the above reasons, do not program a conversational macro in which the GOTO command causes a
branch in the backward direction.
NOTE
If a main program such as those described below must be executed until the end
of the program (M99/M99Pp), set bit 3 (TM99) of compile parameter No. 9160 to
1.
• Program that must always close a reader/puncher interface, memory card,
and so on.
• Program in which the variable value set in a conversational macro is
expected by an auxiliary macro.
- Forced termination
To recover from the hang-up state, execution of the conversational macro function can forcibly be
terminated.
By setting bit 2 (AFT) of parameter No. 9036 to 1, the execution of the auxiliary macro function can be
terminated forcibly together with the conversational macro function. For details, see Section 4.2,
"AUXILIARY MACRO FUNCTION".
- Procedure
If the system enters the hang-up state, simultaneously press and .
NOTE
Recovery from the hang-up state is not always guaranteed. Carefully program a
conversational macro.
- 87 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
4.1.2 Command
Commands that can be used
Macro statements and NC statements (special G code commands) can be written in conversational macros
as in the case of CNC part programs.
Macro statements can have commands and macro variables similar to those for custom macros. Macro
variables include local variables, common variables, and P-CODE variables. In addition, the macro
executor function is available. This function can read keys, display screens, and perform other processing.
NC statements in conversational macros cannot execute NC statements for the CNC operation. If any are
specified, they are ignored. NC statements in conversational macros differ from NC statements in the
meaning of addresses and in usage.
For details, see Chapter 5, "Macro Variables," and Chapter 6, "MACRO EXECUTOR FUNCTION."
CAUTION
Carefully use system variables #3000, #3003, #3004, and #3006 because they
affect automatic operation.
Caution
CAUTION
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. So,
the auxiliary macro function is not suitable for machine control that requires
cyclic operation or speedy processing.
- 88 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
- Example
There is no guarantee that modal information of all blocks can be read surely
even if the following commands of reading modal information is programmed
in auxliary macro.
#101=#4314; Modal information on the block currently being executed
(sequence number)
#102=#4201; Modal information on the block currently being executed
(G code group 1)
#103=#4203; Modal information on the block currently being executed
(G code group 3)
2 The auxiliary macro function cannot execute any NC statement for CNC
operation.
NOTE
During reader/punch interface control using an auxiliary macro, the screen may
not be switched to another screen.
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 (#8530) as
the program number. In this case, a message indicating that a fatal error occurs
is displayed on the conversational macro screen. (For details, see Section 4.6,
"Fatal Error.")
Termination
The auxiliary macro function does not terminate because it is always executed. Setting the control
variable for executing an auxiliary macro (#8530) 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 (#8530) again.
A program must be created to be cyclic just like a conversational macro.
- Forced termination
By setting bit 2 (AFT) of parameter No. 9036 to 1, the execution of the auxiliary macro function can be
terminated forcibly together with the conversational macro function. At this time, the auxiliary macro
function of all paths is terminated forcibly and the auxiliary macro execution control variable (#8530) is
set to 0. For reexecution of the auxiliary macro function, set the auxiliary macro main program number in
#8530 on a screen such as the P code variable screen.
- Procedure
Simultaneously press and .
- 89 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
NOTE
Recovery from the hang-up state is not always guaranteed. Carefully program a
auxiliary macro.
CAUTION
Usually, set bit 2 (AFT) of parameter No. 9036 to 0 to prevent the auxiliary
macro function from being terminated by an erroneous forced termination
operation.
4.2.2 Command
Commands that can be used
A main difference between the conversational macro function and auxiliary macro function is that the
control codes for the macro executor function that are related to key reading and screen display are not
available for the auxiliary macro function.
NC statements in auxiliary macros cannot execute NC statements for the CNC operation. If any are
specified, they are ignored. NC statements in auxiliary macros differ from NC statements for the CNC
operation in the meaning of addresses and in usage.
For details, see Chapter 5, "Macro Variables," and Chapter 6, "Macro Executor Functions."
CAUTION
Carefully use system variables #3000, #3003, #3004, and #3006 because they
affect automatic operation.
NOTE
The execution times of an auxiliary macro and conversational macro affect each
other. For example, if the size of the auxiliary macro (the number of blocks to be
executed) increases, the conversational macro cannot be executed until the M99
block of the auxiliary macro is executed. Until that time, the display of the
conversational macro stops.
Auxiliary macro blocks as many as set in parameter No. 9066 are executed each time. A conversational
macro is continuous executed, regardless of the state of the auxiliary macro. So, the execution times of an
auxiliary macro and conversational macro affect each other less in parallel execution than in sequential
execution.
CAUTION
The conversational 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 and auxiliary macro so
that no competition will occur.
Diagnosis data
Diagnosis 1494 Number of blocks in executed by an auxiliary macro
[Data type] 2-word
[Unit of data] Block
Displays the number of blocks executed by an auxiliary macro per 1024 ms.
It provides an indication of the actual processing speed of auxiliary macros.
Caution
CAUTION
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.
- 91 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
Subprogram calls can be nested to a depth of fifteen levels including only subprogram calls or to a depth
of fifteen levels including subprogram calls and macro calls.
1 Checks whether the value of the control variable for executing an auxiliary macro (#8530) is 0.
When the value is 0, places the auxiliary macro function in the wait state.
- 92 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
When the program number of an auxiliary macro is set for the control variable for executing an
auxiliary macro (#8530) again, executes the specified auxiliary macro from the beginning regardless
of the <Pp> specification.
2 When the value of the control variable for executing an auxiliary macro (#8530) is changed,
executes the new auxiliary macro. When the value is not changed, repeatedly executes the same
auxiliary macro. When <Pp> is specified, starts execution from the block with the sequence number
specified by p.
3 Initializes the local variables to <null>.
Each time the function key is pressed, screen display sequentially switches from one screen to
another. A conversational macro program to be executed is selected according to the value of the
conversational macro execution control variable corresponding to a selected screen.
The conversational macro control variables are initialized to the values set in compile parameter Nos.
9038, 9040, and 9041 when the power is turned on.
A conversational macro program to be executed can be changed by rewriting the conversational macro
execution control variable. If a conversational macro execution control variable is rewritten, the character
display and graphic display are erased and initialized after execution of the program end instruction (M99
block) of the main program of the conversational macro program being executed then a new
conversational macro program is executed.
If 0 is set in a conversational macro execution control variable, the screen display returns to the screen
displayed before selection of the conversational macro screen.
If the value of a conversational macro execution control variable remains unchanged, the same
conversational macro program is executed repeatedly. In this case, character display and graphic display
are not erased and initialized.
- 93 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
NOTE
The setting of bit 0 (TTDSP) of compile parameter No. 9007 contained in the
P-CODE file that is set in parameter No. 9049 of the path selected by the path
selection signal is valid.
- 94 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
Example
When parameter No. 9049 is set for each path as described below in a 4-path
system where two P-CODE files are loaded
P-CODE1 file P-CODE2 file
P-CODE_NUMBER=01 P-CODE_NUMBER=02
P9007=xxxxxxx0 P9007=xxxxxxx1
: :
: :
- 95 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
a-bbbbbb-ccccc
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
ccccc : Error number
When no error occurred, 0 is displayed.
For details of the error, see Appendix A, "ERROR NO. LIST."
• Number of the program in which the error occurred
• Sequence number for which the error occurred
NOTE
If an error occurs during execution of an auxiliary macro, the control variable for
executing an auxiliary macro (#8530) is preset to 0. To restart execution of an
auxiliary macro, set the program number for the control variable for executing an
auxiliary macro (#8530).
- 96 -
B-63943EN-2/07 4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
- 97 -
4.CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION B-63943EN-2/07
- 98 -
B-63943EN-2/07 5.MACRO VARIABLES
5 MACRO VARIABLES
5.1 MACRO VARIABLE LIST
The following variables can be used in P-CODE macros.
- 99 -
5.MACRO VARIABLES B-63943EN-2/07
- 100 -
B-63943EN-2/07 5.MACRO VARIABLES
NOTE
If array-type variables are effective, local variables are not effective in
conversational macros and auxiliary macros.
In execution macros, local variables are effective regardless of whether
array-type variables are effective or not.
NOTE
To make a parameter setting that use a custom macro common variable, an
option for custom macro is required. If the parameters are set so that variables
#150 to #199 and #550 to #999 are used as custom macro common variables,
an option for additional custom macro common variables is required.
Variable protection
By setting variable numbers for the appropriate parameters in the same way as in custom macros, multiple
common variables (#500 to #999) can be protected. The parameters used for the protection differ
depending on whether P-CODE macro common variables are used or custom macro common variables
are used.
NOTE
Parameters Nos. 9067 to 9068 are for P-CODE macro common variables.
Parameters Nos. 6031 to 6032 are for custom macro common variables.
Reset
P-CODE macro common variables are not cleared by a reset. By setting bit 4 (RSC) of parameter No.
9000 to 1, however, the P-CODE macro common variables #100 to #199 can be cleared to <null> by a
reset.
- 101 -
5.MACRO VARIABLES B-63943EN-2/07
NOTE
Bit 4 (RSC) of parameter No. 9000 is used for P-CODE macro common
variables. The custom macro common variables #100 to #199 are not affected,
regardless of the states of bits 0 (MV0) and 1 (MV1) of parameter No. 9034.
The custom macro common variables #100 to #199 depend on bit 6 (CCV) of
parameter No. 6001.
Caution
CAUTION
The same common variable can be used in any of conversational 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 and an auxiliary macro, writing
may occur from the execution macro while writing is performed from the
conversational macro or auxiliary macro because execution macros have a
higher processing level than conversational 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 or auxiliary macro. For this
reason, make sure that the variables used in execution macros are different from
those used in conversational macros and auxiliary macros.
Example
Bit 0 of #100 is used as the execution macro flag, and bit 1 of #100 is used as the
auxiliary macro flag.
To set bit 0 to ON: #100=#100 OR 1
To set bit 1 to ON: #100=#100 OR 2
Execution macro Auxiliary macro
: :
Auxiliary macro
Execution macro
The value of #100 read at the start of auxiliary macro processing is written to #100
after auxiliary macro processing, so a value written during execution macro
processing may be lost.
WARNING
Take care that you do not write the same variable (custom macro common
variable or P-CODE macro common variable) with several applications like C
language executor. If there is data duplication writing in the system, the data not
intended is input, and the machine may behave in an unexpected manner and
tool, workpiece, and the machine may also be damaged.
- 102 -
B-63943EN-2/07 5.MACRO VARIABLES
Setting
1. Set the variable type for bit 3 (EV2) of parameter No. 9033.
2. Set the number of variables for parameter No. 9053.
When 1 is set in the parameter, one variable can be used.
The maximum value that can be set for this parameter is 10000.
If this parameter is 0, no P-CODE variables can be used.
- Caution on setting
The maximum value that can be set for parameter No. 9053 is 10000. The actual maximum value that can
be set, however, depends on the free space of the backup memory.
To determine the free space of the backup memory, select "7.MACRO COMPILER UTILITY" →
"1.USER FILE INFORMATION" from the menu on the IPL monitor screen to display the following,
referring to Appendix, "STARTING OF THE IPL MONITOR," in the Maintenance Manual
(B-64485EN). (For details, see Subsection 6.15.2, "Setup Procedure".)
CURRENT DATA :
USER FILE AREA SIZE = xx
NUMBER OF USER FILE = xx
DATA AREA SIZE (BYTE) = xx
SRAM FREE = xx
The value displayed next to "SRAM FREE" × 512 bytes is the free space of the backup memory. From
the free space of the backup memory and the size to be used, decide on the setting of parameter No. 9053.
The relationship between the setting of parameter No. 9053 and the size used is as follows:
For floating-point data (bit 3 (EV2) of parameter No.9033 is set to 0):
Parameter No.9053 × 8 bytes
For integer data (bit 3 (EV2) of parameter No.9033 is set to 1):
Parameter No.9053 × 2 bytes
NOTE
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 turned off.
3 The free space of the backup memory must not be exceeded.
If a setting is made that exceeds the free space of the backup memory, "FILE
ALLOCATION ERROR” appears at power-on and the system stops at the IPL
monitor screen.
If this occurs, select "0.END IPL" to terminate the IPL monitor, and set
parameter No. 9053 to a value that does not exceeds the free space of the
backup memory.
- 103 -
5.MACRO VARIABLES B-63943EN-2/07
WARNING
Take care that you do not write the same P-CODE variable with several
applications like C language executor. If there is data duplication writing in the
system, the data not intended is input, and the machine may behave in an
unexpected manner and tool, workpiece, and the machine may also be
damaged.
Setting
1. Set the variable type for bit 4 (EVF) of parameter No. 9033.
2. Set the number of variables for parameter No. 9054.
When 1 is set in the parameter, one variable can be used.
The maximum number that can be set for this parameter is 70000.
If this parameter is 0, no extended P-CODE variables can be used.
- Caution on setting
The maximum value that can be set for parameter No. 9054 is 70000. The actual maximum value that can
be set, however, depends on the free space of the backup memory.
To determine the free space of the backup memory, select "7.MACRO COMPILER UTILITY" →
"1.USER FILE INFORMATION" from the menu on the IPL monitor screen to display the following,
referring to Appendix, "STARTING OF THE IPL MONITOR," in the Maintenance Manual
(B-64485EN). (For details, see Subsection 6.15.2, "Setup Procedure".)
CURRENT DATA :
USER FILE AREA SIZE = xx
NUMBER OF USER FILE = xx
DATA AREA SIZE (BYTE) = xx
SRAM FREE = xx
The value displayed next to "SRAM FREE" × 512 bytes is the free space of the backup memory. From
the free space of the backup memory and the size to be used, decide on the setting of parameter No. 9054.
The relationship between the setting of parameter No. 9054 and the size used is as follows:
For floating-point data (bit 4 (EVF) of parameter No.9033 is set to 0): Parameter No. 9054 × 8 bytes
For integer data (bit 4 (EVF) of parameter No.9033 is set to 1): Parameter No. 9054 × 2 bytes
NOTE
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.
- 104 -
B-63943EN-2/07 5.MACRO VARIABLES
NOTE
3 The free space of the backup memory must not be exceeded.
If a setting is made that exceeds the free space of the backup memory, "FILE
ALLOCATION ERROR" appears at power-on and the system stops at the IPL
monitor screen.
If this occurs, select "0.END IPL" to terminate the IPL monitor, and set
parameter No. 9054 to a value that does not exceeds the free space of the
backup memory.
WARNING
Take care that you do not write the same extended P-CODE variable with
several applications like C language executor. If there is data duplication writing
in the system, the data not intended is input, and the machine may behave in an
unexpected manner and tool, workpiece, and the machine may also be
damaged.
Setting
Parameter No. 9051
=0 : The P-CODE variables (#10000 and up) of each path are used.
=1 to 10 : The P-CODE variables (#10000 and up) of a specified path are used.
Parameter No. 9052
=0 : The extended P-CODE variables (#20000 and up) of each path are used.
=1 to 10 : The extended P-CODE variables (#20000 and up) of a specified path are used.
Read
- Format
G316 Pp Dd Ll;
P : Variable number of the local path
D : Variable number of the remote path
(P-CODE variable #10000 to #19999 or extended P-CODE variable #20000 to #89999)
L : Remote path number (1 to 10) *Omissible
* When L is omitted, the remote path is determined as follows:
Local path = 1: The remote path is fixed at 2.
Local path = Other than 1: The remote path is fixed at 1.
The value of variable number #d of remote path number #l is read into variable number #p of the local
path.
- 105 -
5.MACRO VARIABLES B-63943EN-2/07
Example
G316 P10000 D20000 L3;
The data of variable number #20000 of path number 3 is read into variable
number #10000 of the local path.
Write
- Format
G316 Dd Qq Ll;
Q : Variable number of the local path
D : Variable number of the remote path
L : Remote path number (1 to 10) *Omissible
* When L is omitted, the remote path is determined as follows:
Local path = 1: The remote path is fixed at 2.
Local path = Other than 1: The remote path is fixed at 1.
The value of variable number #q of the local path is written into variable number #d of remote path
number 1.
Example
G316 Q10000 D20000 L3;
The value of variable number #10000 of the local path is written into variable
number #20000 of remote path number 3.
NOTE
If the option for additional custom macro common variables is not attached, it is
possible to write and read values from only variables #100 to #149 and #500 to
#549.
WARNING
Take care that you do not write the same custom macro common variable with
several applications like C language executor. If there is data duplication writing
in the system, the data not intended is input, and the machine may behave in an
unexpected manner and tool, workpiece, and the machine may also be
damaged.
- 106 -
B-63943EN-2/07 5.MACRO VARIABLES
Example
#8572=0 → Variable #100000 and up correspond to system variable numbers
minus 100000.
#100=#10001 → P-CODE variable #10001 is assigned to #100.
#101=#110001 → The tool offset value of No. 1 is assigned to #101 (equivalent
to custom macro system variable #10001).
#8572=1 → Variables #100000 and up correspond directly to system variables.
#100=#10001 → P-CODE variable #10001 is assigned to #100.
#101=#100001 → The end point position of the previous block (workpiece
coordinate system) is assigned to #101.
- 107 -
5.MACRO VARIABLES B-63943EN-2/07
Format
#ppxxxxxxx
pp : Path number
(*) If the path number is omitted, the result is the same as with the normal system variable command
(e.g., #5021 to #5040 or #100051 to #100100).
NOTE
If wishing to write and read system variable #100000 and up, set variable #8572
to 1.
#8572
=0: Variables #110000 to #120000 are treated as custom macro system
variables #10000 to #20000.
(Specify them with custom macro system variable numbers + 100000.)
=1: They are treated directly as variable numbers #100000 and up.
(Specify them with custom macro system variable numbers.)
Example
1st path machine coordinate value 2nd path machine coordinate value
X1123.456 X2-123.456
Y145.670 Z278.900
Z1345.789 C245.000
In this case, if #100=#5023 is executed for the first path, the machine coordinate
value 345.789 of the third axis of the local path is read in #100.
If #100=#20005023 is executed, the machine coordinate value 45.0 of the third
axis of the second path is read in #100.
M
System variable number Attribute Description
#5081 to #5100 R Tool length offset value in the currently executed block
#100201 to #100250 Note) #100201 to #100250 are used when #8572 is set to 1.
T
System variable number Attribute Description
#5081 to #5083 R Tool offset value in the currently executed block
#5121 to #5123
NOTE
1 If a path number out of the range is specified, one of the following occurs:
Execution macro : Alarm PS0115 is generated.
Conversational/Auxiliary macro : The command is ignored.
2 A variable cannot be specified by its name.
3 If wishing to write and read system variable #100000 and up, set variable #8572
to 1.
4 To write and read data on the 10th path, set bit 0 (F16) of parameter No. 6008 to
0. If bit 0 (F16) of parameter No. 6008 is set to 1, operation precision is up to
eight digits. Thus, if an operation command such as #100=#[100005000+#1] is
issued to write and read the data on the 10th path, operation may not be
performed correctly.
NOTE
If this function is used, the UI/UO signals in user programs (other than P-CODE
macros) are ordinary interface signals.
- 109 -
5.MACRO VARIABLES B-63943EN-2/07
These custom macro system variables cannot be used on the left side of an assignment statement.
These custom macro 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
G082 EUI07 EUI06 EUI05 EUI04 EUI03 EUI02 EUI01 EUI00
- 110 -
B-63943EN-2/07 5.MACRO VARIABLES
#7 #6 #5 #4 #3 #2 #1 #0
F084 EUO07 EUO06 EUO05 EUO04 EUO03 EUO02 EUO01 EUO00
5.8.3 Caution
CAUTION
It is possible to specify custom macro system variables #3000, #3003, #3004,
and #3006 from conversational 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 or auxiliary macro
causes automatic operation to stop due to an alarm.
- NOTE
NOTE
Specifying variable #3006 from a conversational macro or auxiliary macro
causes automatic operation to stop.
- 111 -
5.MACRO VARIABLES B-63943EN-2/07
<Expression>
The expression to the right of the arithmetic and logic operation contains constants and/or variables
combined by a function or operator. Variables #j and #k below can be replaced with a constant. If a
constant used in an expression has no decimal point, it is assumed to end with a decimal point.
- 112 -
B-63943EN-2/07 5.MACRO VARIABLES
- 113 -
5.MACRO VARIABLES B-63943EN-2/07
- 114 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Conversational
Execution
Auxiliary
Related control
Section Function Outline of function Related G code
variable
- 115 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Conversational
Execution
Auxiliary
Related control
Section Function Outline of function Related G code
variable
FGEN, FDEL,
Creates and deletes files, and FOPEN, FCLOS,
6.15 File control ____
reads and writes data. FREAD, FWRIT,
FPSET
Enables interlock in each axis
Axis-direction-by-axis-direction direction, and enables a move #8600, #8607,
6.16 ____
interlock function axis and move direction on the #8601, #8608
rising edge of the SKIP signal.
Enables alarm information,
relative coordinates, run time,
parts count, and system
6.17 Window Function ____ #8996 to #8999
information such as system
series and edition information
to be referenced.
Searches a data table
consisting of sets made up by
multiple successive control
variables according to a
Function for Searching Data
6.18 specified condition. If a target G400 #8650 to #8655
Tables for Control Variables
control variable is found, the
set number of the data table
including that variable is
returned.
: Usable, : Usable in some cases, : Not usable
NOTE
1 The G codes described in Section 6.1 cannot be executed with auxiliary macro
functions.
2 G315, described in Section 6.12, is a G code that cannot be executed with
auxiliary macro functions.
3 The G codes described in Section 6.14 requires the PMC axis control option.
Caution
CAUTION
Even those functions that are usable in multiple P-CODE macros (conversational
macros, auxiliary macros, and execution macros) must not be used
simultaneously.
G code list
Conversational
Execution
Auxiliary
Modal / Reference
G code Function
One-shot item
Conversational
Execution
Auxiliary
Modal / Reference
G code Function
One-shot item
- 117 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
- 118 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
- 119 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Conversational
Execution
Auxiliary
Variable No. Function Type R/W
#8711,#8721
PMC control command variable Integer R/W { { X
#8731,#8741
#8712,#8722
PMC cutting feed variable Integer R/W { { X
#8732,#8742
#8713,#8723
PMC control travel distance variable Integer R/W { { X
#8733,#8743
#8715,#8725
Variables for reading PMC status signals Integer R/W { { X
#8735,#8745
Axis-direction-by-axis-direction interlock function
#8600 (1 to 16 axes)
#8607 (17 to 24 Axis-direction-by-axis-direction interlock control variables Integer R/W { { X
axes)
#8601 (1 to 16 axes)
Movement axis and direction variables for the rise time of
#8608 (17 to 24 Integer R/ { { X
the SKIP signal
axes)
Window function
#8996 Completion code Integer R/ { { X
#8997 Axis number Integer R/W { { X
#8998 System information ID Integer R/W { { X
#8999 System information Floating R/ { { X
Function for searching data tables for control variables
Start macro variable number in the search target data
table (for READ)
#8650 Integer R/W { { X
Start macro variable number in the set next to the
retrieved data table set number (#8655) (for WRITE)
The number of macro variables forming a set in the data
#8651 Integer R/W { { X
table
The number of search target data table sets (for READ)
#8652 Set value minus the number of sets that have already Integer R/W { { X
been retrieved (for WRITE)
#8653 Lower limit to the search value Floating R/W { { X
#8654 Upper limit to the search value Floating R/W { { X
The data table set number where a control variable that
#8655 Integer R/ { { X
satisfies the search condition is contained
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.
[Note]
A command for display beyond this range is ignored.
- 121 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
0123456789012345678
1
0000000000111111111122222222223333333333
0123456789012345678901234567890123456789
Fig. 6.1.1 (a) Character coordinate (type of 7 soft keys, with background color)
0123456789012345678
1
0000000000111111111122222222223333333333
0123456789012345678901234567890123456789
Fig. 6.1.1 (b) Character coordinate (type of 7 soft keys, without background color)
- 122 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
0123456789012345
1
0000000000111111111122222222223333333333
0123456789012345678901234567890123456789
Fig. 6.1.1 (c) Character coordinate (type of 7 soft keys, without background color)
[Note]
A command for display beyond this range is ignored.
- 123 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
012345678901234567890123456789
1 2
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Fig. 6.1.1 (d) Character coordinate (type of 12 soft keys, with background color)
012345678901234567890123456789
1 2
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Fig. 6.1.1 (e) Character coordinate (type of 12 soft keys, without background color)
- 124 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
0123456789012345678901234
1 2
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Fig. 6.1.1 (f) Character coordinate (type of 12 soft keys, without background color)
NOTE
For 15"/19" LCD units, on the conversational macro screen, the character
coordinate is the same as that of 10.4" LCD units. Vertical soft keys are not
displayed.
Graphic coordinate
One unit is one dot.
The screen center (X,Y)=(0,0).
Along the X-axis, display at -320 to 319 (from left to right) can be specified. Along the Y-axis, display at
-232 to 247 (from bottom to top) can be specified. A command for display beyond this range is ignored.
NOTE
For 8.4" LCD unit (type of 7 soft keys), be sure to set bit 2 (HRGR) of compile
parameter No. 9003 to 1.
- 125 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
(0,247)
(0,0)
(-320,0) (319,0)
(0,-232)
Fig. 6.1.1 (g) Graphic coordinate (type of 7 soft keys)
(0,247)
(0,0)
(319,0)
(-320,0)
(0,-232)
Fig. 6.1.1 (h) Graphic coordinate (type of 12 soft keys)
NOTE
For 15"/19" LCD units, on the conversational macro screen, the graphic
coordinate is the same as that of 10.4" LCD units. Vertical soft keys are not
displayed.
- 126 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
For 15"/19" LCD units, on the conversational macro screen, the character
coordinates and graphic coordinates are the same as that of 10.4" LCD units.
Therefore, when changing coordinates depending on the display unit, handle the
values read by this variable for 1 and 2 as identical values.
G202, G240, G249, G250, G244, G280, G230, G311, G206, G204, and G317 are one-shot G codes.
G243, G01, G02, G03, G242, and G300 are modal G codes, and are treated as those belong to the same G
code group.
G390 and G391 are also modal G code, but belong to a different G code group from the above modal G
code group.
- 127 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
When bit 4 (NVGA) of compile parameter No. 9167 is set to 1, G242, G244,
G249, G250, G01, G02, G03, G392, G311, G300, G206, G204, and G317
cannot be used.
NOTE
Addresses X and Y are used as modal addresses common to character display
and graphic display.
NOTE
For macro calls, all addresses are treated as arguments.
Format
G202 Xx Yy Ii Jj Pp ;
X : X coordinate start point in the character coordinate system
Y : Y coordinate start point in the character coordinate system
I : Number of characters to be partially cleared (X coordinate)
J : Number of characters to be partially cleared (Y coordinate)
P=1 : Clears the graphic screen.
=2 : Clears the character screen.
=3 : Clears both the graphic and character screens.
- 128 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
When bit 4 (NVGA) of compile parameter No. 9167 is set to 1, P2 and P3 only
are valid. (P3, even when specified, has the same effect as P2.)
Format
G240 Pp Cc Ll ;
P: Specification of color for character display/graphic display
When a minus (-) value is specified, characters are displayed in reverse video.
P=0 : Color of color palette 0 Standard color: Black (base color)
=1 : Color of color palette 1 Standard color: Red
=2 : Color of color palette 2 Standard color: Green
=3 : Color of color palette 3 Standard color: Yellow
=4 : Color of color palette 4 Standard color: Blue
=5 : Color of color palette 5 Standard color: Purple
=6 : Color of color palette 6 Standard color: Light blue
=7 : Color of color palette 7 Standard color: White
=8 : Color of color palette 8 Standard color: Dark gray
=9 : Color of color palette 9 Standard color: Dark red
=10 : Color of color palette 10 Standard color: Dark green
=11 : Color of color palette 11 Standard color: Dark yellow
=12 : Color of color palette 12 Standard color: Dark blue
=13 : Color of color palette 13 Standard color: Dark purple
=14 : Color of color palette 14 Standard color: Dark aqua green
=15 : Color of color palette 15 Standard color: Light gray
- 129 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
L: Specification of blinking
L=0 : Without blinking
=1 : With blinking
NOTE
For the standard color in the case of display with background color (when bit 0
(VGAR) of compile parameter No. 9100 is set to 1), see "Standard color
palettes" in Subsection 6.1.3.4, "Command for display with background color
(G250)".
Example
G240 P1 C2 ;
G243 X0 Y0 (ABC) ;
G240 P0 C7 ; A B C - X Y Z
G243 (-) ;
G240 P5 C4 ; Green background Blue background
G243(XYZ) ; /Red character /Purple character
White background
/Black character
When addresses P and C only are specified, the specification is handled in the same way as 0 is specified
in address L.
G240 P1 ; Character color ...................................................................... Color of color palette 1
Background color ........................................................................... (No change)
Blinking ....................................................................................... Without blinking
G240 C1 ; Character color...................................................................... (No change)
Background color ........................................................................... Color of color palette 1
Blinking ....................................................................................... Without blinking
NOTE
1 If G240 is not specified even once, color palette 7 is used for character
display/graphic display, and color palette 0 is used for background color for
character display without blinking.
2 When bit 4 (NVGA) of compile parameter No. 9167 is set to 1, the function of
address C cannot be used.
3 When a monochrome LCD unit is used as a display device, brightness is to be
used as described below (for the standard color).
The values of address P can be arranged in the order of higher to lower
brightness as follows: 7, 3, 12, 6, 2, 5, 1, 4, 8, 9, 11, 10, 0 (where 2 = 5 and 9 =
11). Actually, one brightness value cannot be easily distinguished from another.
So, the use of 7 and 2 only is recommended for creation.
4 The color palette settings made on the CNC are used.
Format
G242 Xx Yy ;
X : X coordinate of the drawing start point
Y : Y coordinate of the drawing start point
- 130 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 This code is disabled when bit 2 (VRM) of parameter No. 9011 is set to 1.
3 If a graphic command is specified at the same position, display with background
color is overwritten. Similarly, display with background color overwrites display
based on a graphic command.
4 When character display or graphic display is cleared using the screen clear
command (G202), the background display of display with background color can
disappear, or a coordinate change can occur. A coordinate change occurs when
the window frame mode is used.
5 When the screen clear command (G202) is executed, graphic display is cleared
by the color of color palette 15.
6 When the standard color is specified, the value of the color palette for character
display differs from that for graphic display. The display color specified with the
display color specification command (G240) differs between character display
and graphic display.
- 131 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
012345678901234567890123456789
1
Data display
area
2
00000000001111111111222222222233333333334444444444555555555566666666667777777777
01234567890123456789012345678901234567890123456789012345678901234567890123456789
Format
G250 P_ <parameter> ;
P_ : Item number specification
<parameter> : Parameter specification of each item
List of items
Item (P_) Description Parameter
000 Clears screen display with background color. None
001 Clears the data display area only. None
002 Clears the background of screen display with background color. None
003 Clears only the background of the data display area. None
010 Displays a convex group frame. X_ Y_ I_ J_
011 Displays a concave group frame. X_ Y_ I_ J_
012 Displays an input frame. X_ Y_ C_
015 Displays a key input line frame. X_ Y_
(*1)
018 Displays a selection window frame. X_ Y_
(*1)
019 Displays a nonselection window frame. X_ Y_
(*1)
020 Registers a window frame mode. X_ Y_ R_
(*1)
021 Selects a window fame mode. R_
(*1)
022 Performs mode display of a selection window frame. R_
(*1)
023 Performs mode display of a nonselection window frame. R_
(*1)
024 Performs mode display of a selection window frame background. R_
(*1)
025 Performs mode display of a nonselection window frame background. R_
030 Displays the soft key unselected state. None
031 Displays the soft key pressed state. R_ (B_)
040 Sets a graphic color palette (1 palette). R_ A_ B_ C_
041 Sets a character color palette (1 palette). R_ A_ B_ C_
042 Sets a graphic/character color palette. R_
*1 Item that can be specified with 10.4", 15", and 19" LCD units.
- The background of screen display with background color means the graphic display plane. On the
screen, a graphic display plane and character display plane are placed one over the other for display.
- 132 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- For display with background color, a graphic display plane is used.
- The window frame mode is a mode using the selection/nonselection window frame as the reference.
This means that in character display, the top-left point of each window frame represents coordinates
(0,0). However, graphic display coordinates are not affected.
Details of items
- P000
- P001
Clears display with background color and character display.
- P002
- P003
Clears only display with background color.
Plane to be cleared
Item number Range to be cleared
Character Graphic
P000 Entire screen To be cleared. To be cleared.
P001 Data display area only To be cleared. To be cleared.
P002 Entire screen Not to be cleared. To be cleared.
P003 Data display area only Not to be cleared. To be cleared.
- P010 X_ Y_ I_ J_
- P011 X_ Y_ I_ J_
P10 displays a convex group frame, and P11 displays a concave group frame.
X : Top-left point (X coordinate) of the frame
Y : Top-left point (Y coordinate) of the frame
I : Bottom-right point (X coordinate) of the frame
J : Bottom-right point (Y coordinate) of the frame
The points X, Y, I, and J represent coordinates in character display.
(X, Y)
(I, J)
NOTE
The commands specified in addresses X, Y, I, and J become absolute
commands at all times.
- 133 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- P012 X_ Y_ C_
Displays an input frame.
X : Frame start point (X coordinate)
Y : Frame start point (Y coordinate)
C : Frame length
The points X and Y represent coordinates in character display.
The length C represents a character width.
The size of a frame is fixed at 1 line along the Y-axis. If a specified frame of this size is larger than the
display area of the screen, the specification is ignored.
Only display with background color is provided.
NOTE
The commands specified in addresses X and Y become absolute commands at
all times.
- 134 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- P015 X_ Y_
Displays a key input line frame.
X : Frame start point (X coordinate)
Y : Frame start point (Y coordinate)
The points X and Y represent coordinates in character display.
The size of a frame is fixed at 40 characters along the X-axis and at 1 line along the Y-axis. If a specified
frame of this size is larger than the display area of the screen, the specification is ignored.
Only display with background color is provided.
NOTE
The commands specified in addresses X and Y become absolute commands at
all times.
- P018 X_ Y_
- P019 X_ Y_
P018 displays a selection window frame, and P019 displays a nonselection window frame.
X : Frame start point (X coordinate)
Y : Frame start point (Y coordinate)
The points X and Y represent coordinates in character display.
The size of a frame is fixed at 41 characters along the X-axis and at 14 lines along the Y-axis. If a
specified frame of this size is larger than the display area of the screen, the specification is ignored.
- 135 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
1 These commands are valid with 10.4”, 15”, and 19” LCD units only.
2 The commands specified in addresses X and Y become absolute commands at
all times.
- P020 X_ Y_ R_
Registers a window frame mode.
R : Frame number (1 to 3)
X : Frame start point (X coordinate)
Y : Frame start point (Y coordinate)
The points X and Y represent coordinates in character display.
The size of a frame is fixed at 41 characters along the X-axis and at 14 lines along the Y-axis. If a
specified frame of this size is larger than the display area of the screen, the specification is ignored.
NOTE
1 These commands are valid with 10.4”, 15”, and 19” LCD units only.
2 The commands specified in addresses X and Y become absolute commands at
all times.
- P021 R_
Selects a frame registered with P020.
This command does not display a frame but only selects a frame.
R : Selection number of a frame registered with P20
NOTE
1 These commands are valid with 10.4”, 15”, and 19” LCD units only.
2 When bit 3 (INCD) of compile parameter No. 9167 is set to 1, the current
coordinates for incremental specification are preset.
- 136 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- P022 R_
- P024 R_
Displays a frame registered with P020, as a selection window frame.
P022 clears the character display in a range.
R : Selection number of a frame registered with P20
NOTE
1 These commands are valid with 10.4”, 15”, and 19” LCD units only.
2 When bit 3 (INCD) of compile parameter No. 9167 is set to 1, the current
coordinates for incremental specification are preset.
- P023 R_
- P025 R_
Displays a frame registered with P020, as a non-selection window frame.
P023 clears the character display in a range.
R : Selection number of a frame registered with P20
NOTE
1 These commands are valid with 10.4”, 15”, and 19” LCD units only.
2 When bit 3 (INCD) of compile parameter No. 9167 is set to 1, the current
coordinates for incremental specification are preset.
- P030
Displays the soft key unselected state.
- P031 R_ B_
Displays the soft key pressed state.
R : Soft key number
(For the type of 7 soft keys: Soft keys 1 to 5)
(For the type of 12 soft keys: Soft keys 1 to 10)
B : Soft key number
(For the type of 7 soft keys: Soft keys 1 to 5)
(For the type of 12 soft keys: Soft keys 1 to 10)
- For the type of 7 soft keys
1 = Selects soft key 1.
2 = Selects soft key 2.
3 = Selects soft key 3.
4 = Selects soft key 4.
5 = Selects soft key 5.
- For the type of 12 soft keys
1 = Selects soft key 1.
2 = Selects soft key 2.
3 = Selects soft key 3.
4 = Selects soft key 4.
5 = Selects soft key 5.
6 = Selects soft key 6.
7 = Selects soft key 7.
8 = Selects soft key 8.
9 = Selects soft key 9.
10 = Selects soft key 10.
When two soft keys are to be selected, one soft key is selected using address R, and the other using
address B.
- 137 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
When G250 P31 R2 B8 ; is specified, soft key 2 and soft key 8 are selected.
NOTE
The specification of 0 for R has the effect of the specification of P30.
- P040 R_ A_ B_ C_
- P041 R_ A_ B_ C_
Sets a specified color palette. P040 sets a graphic color palette. P041 sets a character color palette.
R : Color palette number (0 to 15)
A : R value of R/G/B
B : G value of R/G/B
C : B value of R/G/B
- P042 R_
Sets all graphic and character color palettes as standard colors.
R : =0 : Standard color for screen display with background color
=1 : Standard color for screen display without background color
- The RGB values of the individual color palettes are set as standard colors for display with
background color when R = 0 is set, and are set as standard colors for display without background
color when R = 1 is set. For the setting of each color palette, see the item of Standard color palettes.
Character color
R value G value B value Color
Color palette 0 0 0 0 Black (base color)
Color palette 1 8 0 0 Dark red
Color palette 2 0 8 0 Dark green
Color palette 3 8 8 0 Ocher
Color palette 4 15 15 0 Yellow
Color palette 5 15 0 15 Purple
Color palette 6 0 8 8 Peacock blue
Color palette 7 3 1 1 Light black
Color palette 8 15 15 15 White
- 138 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Character color
R value G value B value Color
Color palette 0 0 0 0 Black (base color)
Color palette 1 15 0 0 Red
Color palette 2 0 15 0 Green
Color palette 3 15 15 0 Yellow
Color palette 4 0 0 15 Blue
Color palette 5 15 0 15 Purple
Color palette 6 0 15 15 Light blue
Color palette 7 15 15 15 White
Color palette 8 14 14 14 Light gray (light)
Color palette 9 13 13 13 ↓
Color palette 10 12 12 12 ↓
Color palette 11 11 11 11 Gray
Color palette 12 10 10 10 ↓
Color palette 13 9 9 9 ↓
Color palette 14 8 8 8 ↓
Color palette 15 7 7 7 Light black (dark)
- 139 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Format
G243 Xx Yy Aa Bb Cc Kk Ff.e Dd Zz Pp
(_) ( ' _ ' ) (*_*) (&?'_') Note ;
NOTE
For a direct specification of Simplified Chinese characters and European
languages, use (&1’_ ’) for Simplified Chinese characters and with (&2’_ ’) for
Russian Cyrillic characters. For details, see Subsection 6.1.3.6, "Direct language
specification function".
- 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
NOTE
1 When specifying both X and Y, specify them in succession.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
- (_)
( 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 Appendix B.
Hiragana and Chinese characters each take a space twice wider than a single-byte character.
Example
G243(' ');;
" " 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.
- 140 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
G243(*46 41 4E 55 43 2D*) ;
G243(*4E 43 20 4175 4356*) ;
" " is displayed.
NOTE
Use the JIS codes (codes given in the Katakana Code Table and the Chinese
and Hiragana Code Table in Appendix B).
- Address A
Address A specifies the character size.
A=1 : Standard size
=2 : Double size (two times wider and one time higher)
=3 : Triple size (three times wider and two times higher)
• Double-size characters can be used to display standard-size characters (codes in the katakana code
table, alphanumeric code table (excluding lowercase alphabetic characters), and symbol table in
Appendix B, "Code Tables") in the same size as for kanji characters. Kanji and hiragana codes
cannot be displayed. However, in coding with (_), usable codes are limited. In coding with ('_'), the
single quotation mark (') (27) cannot be displayed as a double-size character.
• The triple size is three times wider and two times higher than the standard size. The characters that
can be displayed with the triple size are the alphabetic characters, digits, the minus sign, the decimal
point, and the space. No other characters can be displayed with the triple size.
Example
- Standard size G243 Xx Yy A1 (8)
- Address B
Address B specifies blinking control.
B=0 : Does not blink the character string.
=1 : Blinks the character string less frequently according to the software timer (ON for about 1/2 second and
OFF for about 1/4 second).
=2 : Blinks the character string frequently according to the software timer (ON for about 1/4 second and OFF
for about 1/8 second).
NOTE
When B1 or B2 is specified for blinking, the character string may be displayed or
erased according to the state of the timer. So, unless displayed repeatedly, the
character string continues to be displayed or erased.
Specifying B1 or B2 causes all the subsequent character strings to blink.
- 141 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
If the initial setting of #100 is 1 and O1000 is called repeatedly in the processing
below, ABC blinks. However, XYZ, which is called only once, continues to be
displayed or erased.
O1000
G243X10Y10B1(ABC)
IF[#100 EQ 1] THEN
G243X10Y12B1(XYZ)
#100=0
ENDIF
- 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.
- Address P
Address P specifies the number of the sequence containing a character string.
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.
By using the 5th digit of address P, up to nine character string registration programs can be freely selected.
Define the character string registration program control variable (#8509) as the start program number of
character string registration programs. The number (0 to 8) specified in the 5th digit of address P added to
the start program number functions as the number of the program where an actual character string is
registered.
Ponnnn
o : Selects a program (0 to 8) from character string registration programs.
* The value 0 represents the program being executed.
nnnn : Sequence number (0001 to 9999)
Example
#8509=1000 ;
G243 P10;
→ Displays the character string of sequence number N10 in O1000.
G243 P80010;
→ Displays the character string of sequence number N10 in O1008.
- 142 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
O9000 ; O8000 ;
: :
#8509=8000 ; N10 (IJK) ;
G243 (ABC) P20 ; N20 (XYZ) ;
: :
M99 ; M99 ;
O9100 ;
:
#8509=8000 ;
G243 P20 (ABC) ;
:
M99 ;
When O9000 is executed, the character string in the single block with the
sequence number 20 of program No. 8000 is displayed. Thus, "ABCXYZ" is
displayed.
Even when O9100 is executed, "ABCXYZ" is displayed.
NOTE
When #8509 is set to 0, the block of a sequence number specified in the
program being executed is executed.
- 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 12.6. 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.
- 143 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 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.
Example
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.)
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.
- Limitation
NOTE
1 Character strings are displayed in the order in which they are specified.
2 The same address cannot be specified twice.
3 F and Z become effective first.
4 Up to five character strings enclosed in any of (_), ('_'), and (*_*) can be
specified in a single block, in total.
5 Up to 255 characters can be specified in a single block, in total.
The direct language specification using the macro executor is supported for the character display
conversational macro (G243), macro alarm (#3000), and macro message (#3006).
- 144 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
1 The function is not supported for prompt statement display (G280).
2 Russian Cyrillic characters can be used only for the character display
conversational macro (G243). The relationship between the usable functions and
languages is shown below.
Language G243 #3000 #3006
Simplified Chinese characters Usable Usable Usable
Russian Cyrillic characters Usable Not usable Not usable
The direct language specification function allows one-byte ASCII code characters to be specified as well.
The specifiable ASCII codes are 20H to 5FH one-byte character codes.
If this command is executed, the characters are displayed at the character coordinate system position (0,3)
as shown Fig. 6.1.3 (a).
- 145 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 146 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
If this command is executed, the characters are displayed as shown Fig. 6.1.3 (d).
NOTE
Simplified Chinese character strings are not output correctly to the operation
history punch.
- 147 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
If this command is executed, the characters are displayed as shown Fig. 6.1.3 (e).
NOTE
1 Simplified Chinese character strings are not output to the operation history
punch.
2 Simplified Chinese character strings are not displayed in alarm history display.
If this command is executed, the characters are displayed at the character coordinate system position (0,3)
as shown Fig. 6.1.3 (f).
- 148 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
This command specifies Russian Cyrillic characters " ", a one-byte space character, Russian
Cyrillic characters " ", one-byte alphanumeric characters "012AB", two one-byte space characters, a
one-byte alphanumeric character "C", and a one-byte mark "?".
If this command is executed, the characters are displayed at the character coordinate system position (0,3)
as shown Fig. 6.1.3 (g).
- 149 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
O1000;
:
N10(&2' ') ;
:
M99;
If this command is executed, the characters are displayed at the character coordinate system position (0,3)
as shown Fig. 6.1.3 (h).
For information about address P of G243, see the section describing address P of character display
(G243) in Subsection 6.1.3.5.
Registration method
Format
G319 Pp Qq ;
- Address P
P : Number of the variable at the top that defines the character pattern
- Address Q
Q : Number of the user-defined character to be registered (decimal)
256 to 326 (for the type of 7 soft keys)
256 to 511 (for the type of 12 soft keys)
- 150 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
A user-defined character consists of the following number of dots:
• Type of 7 soft keys: horizontal 16 dots × vertical 25 dots = 400 dots
• Type of 12 soft keys: horizontal 8 dots × vertical 16 dots = 128 dots
Each row of the character pattern data is stored in a variable array in binary coded decimal format. The
G319 command registers the character pattern in this variable array to the user-defined character memory.
NOTE
1 Make sure that the user-defined character number is in the range of 256 to 326
(for the type of 7 soft keys) or 256 to 511 (for the type of 12 soft keys). If an
out-of-range number is specified, the G319 command is ignored.
2 The user-defined character memory may also be used by other applications
developed by machine tool builders (e.g., C Language Executor). Take care to
avoid contention for user-defined character numbers.
3 Character patterns need to be registered in the user-defined character memory
after each power-on. (Turning off the power deletes the registered character
patterns.)
4 Make sure that the character pattern definition value is in the range of 0 to 255
(for the type of 7 soft keys) or 0 to 65535 (for the type of 12 soft keys).
●: On (blinking)
- 151 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Display method
To display a registered user-defined character, specify the character display command (G243) as follows.
Format
G243 Xx Yy Aa Qq ;
or
G243 Xx Yy Aa (”8qqqq”) ;
- Addresses X and Y
In addresses X and Y, specify the display position of the character string using 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
- Address A
In address A, specify the character size.
A=1 : Standard-size character
A=2 : Double-size character (two times horizontally and one time vertically)
A=3 : Triple-size character (three times horizontally and two times vertically)
As for double-size and triple-size characters, the user-defined characters of the specified user-defined
character numbers, as well as those of the specified user-defined character numbers + α, are displayed
collectively. The display method is described below.
Example
- Standard size G243 Xx Yy A1 Q256 ; /* or (“8100”)
256
- 152 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- Address Q
Q : Number of the user-defined character to be displayed (decimal)
Address Q is equivalent to address Q of the user-defined character registration command (G319).
NOTE
Do not specify two or more identical addresses in the same one block.
If two or more identical addresses are specified, the later specified address value
takes effect.
- (”8qqq”)
"8" is a fixed value indicating user-defined character display.
qqq : Number of the user-defined character to be displayed (hexadecimal)
In qqq, specify address Q of the user-defined character registration command (G319) in
hexadecimal notation.
100h to 146h (for the type of 7 soft keys)
100h to 1FFh (for the type of 12 soft keys)
Example
An example of registering and displaying user-defined characters for the type of
12 soft keys is shown below.
/* 12345678
#110 = 1 ; /* 1 ○○○○○○○●
#111 = 3 ; /* 2 ○○○○○○●●
#112 = 7 ; /* 3 ○○○○○●●●
#113 = 15 ; /* 4 ○○○○●●●●
#114 = 255 ; /* 5 ●●●●●●●●
#115 = 96 ; /* 6 ○●●○○○○○
#116 = 51 ; /* 7 ○○●●○○●●
#117 = 25 ; /* 8 ○○○●●○○●
#118 = 12 ; /* 9 ○○○○●●○○
#119 = 14 ; /* 10 ○○○○●●●○
#120 = 31 ; /* 11 ○○○●●●●●
#121 = 31 ; /* 12 ○○○●●●●●
#122 = 63 ; /* 13 ○○●●●●●●
#123 = 60 ; /* 14 ○○●●●●○○
#124 = 112 ; /* 15 ○●●●○○○○
#125 = 192 ; /* 16 ●●○○○○○○
G319 P110 Q256 ; /* Registered to user-defined character number 256
- 153 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
/* 12345678
#110 = 128 ; /* 1●○○○○○○○
#111 = 192 ; /* 2●●○○○○○○
#112 = 224 ; /* 3●●●○○○○○
#113 = 240 ; /* 4●●●●○○○○
#114 = 255 ; /* 5●●●●●●●●
#115 = 6 ; /* 6○○○○○●●○
#116 = 204 ; /* 7●●○○●●○○
#117 = 152 ; /* 8●○○●●○○○
#118 = 48 ; /* 9○○●●○○○○
#119 = 112 ; /* 10○●●●○○○○
#120 = 248 ; /* 11●●●●●○○○
#121 = 248 ; /* 12●●●●●○○○
#122 = 252 ; /* 13●●●●●●○○
#123 = 60 ; /* 14○○●●●●○○
#124 = 14 ; /* 15○○○○●●●○
#125 = 3 ; /* 16○○○○○○●●
G319 P110 Q257 ; /* Registered to user-defined character number 257
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
=17 : Broken line where broken parts are not drawn
=18 : Alternate long and short dash line where broken parts are not drawn
=19 : Alternate long and two short dashes line where broken parts are not drawn
=21 : Dotted line where broken parts are not drawn
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 Solid line is automatically assumed when the graphic screen clear code (G202)
is issued.
3 For each of the lines where broken parts are not drawn (P = 17, 18, 19, and 21),
parts where the line is broken are not drawn. For a screen without background
color, specify with P of 1, 2, 3, or 5 and for a screen with background color,
specify with P of 17, 18, 19, or 21.
- 154 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Format
G280 Cc Kk Pp ( _ ) ;
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.)
(_) : Character string to be displayed. (See the explanation of G243)
NOTE
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.
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
- 155 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Start point
Center
I
G02 draws an arc clockwise.
G03 draws an arc counterclockwise.
Format
G02 Xx Yy Ii Jj ;
G03 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 coordinate of the center of circular drawing
(Component of the X-direction vector from the start point of the arc to the center of the arc when bit 3
(INCD) of compile parameter No. 9167 is set to 1)
J : Y coordinate of the center of circular drawing
(Component of the Y-direction vector from the start point of the arc to the center of the arc when bit 3
(INCD) of compile parameter No. 9167 is set to 1)
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- When bit 3 (INCD) of compile parameter No. 9167 is set to 1, the commands of
addresses X and Y are switched between absolute and incremental commands
by G390/G391.
3 The command values of addresses I and J are based on the vector from the
start point of an arc to the center of the arc.
- 156 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
When the program above is executed, the following is drawn in the graphic coordinate system:
150
-50
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
NOTE
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 commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
Format
G249 Pp Xx Yy ;
P : Control command
=0 : Display ON (turned on)
=1 : Display ON (low-speed blink display)
=2 : Display ON (high-speed blink display)
=3 : Display OFF
- 157 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
3 Addresses X and Y may be omitted. For an omitted address, the value
previously specified with G249 is used.
4 Moving the graphic cursor does not affect the current position in the graphic
coordinate system.
5 If the graphic screen is cleared with “G202 P1 ;” or “G202 P3 ;”, the graphic
cursor is erased. Moreover, the position of the graphic cursor is initialized to
(0,0).
NOTE
1 The cursor drawn is displayed as an underscore (_). This function is different
from cursor control (rectangular cursor) based on G230, and can be used
together with the rectangular cursor.
2 Even when the screen clear function (G202) is specified, the control variables
#8505, #8506, and #8507 are not affected. So, the cursor displayed is not
moved or erased.
3 Even if an attempt is made for character coordinate system compensation on a
8.4" LCD unit, compensation is not performed.
4 The cursor is colored according to the color at the position where the cursor is
placed.
- 158 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
1 When bit 3 (INCD) of compile parameter No. 9167 is set to 0, an absolute mode
command is specified at all times.
2 These codes are effective to G204, G230, G242, G243, G300, G249, G01, G02,
G03, G206, and G317.
Format
G392 Xx Yy ;
X : X coordinate
Y : Y coordinate
Example
N01 G242 X100.0 Y100.0 ;
N02 G392 X60.0 Y60.0 ; N01(100,100)
N02(60,60) N03(100,60)
N03 G01 X100.0 ;
100 60
NOTE
1 The specified X and Y coordinates are always assumed absolute.
2 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
Format
G311 Xx Yy ;
Specify a speed ratio when performing rapid traverse drawing.
X : Rapid traverse drawing speed ratio in the X axis
Y : Rapid traverse drawing speed ratio in the Y axis
- 159 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
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 disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
Format
G300 Xx Yy ;
X : X coordinate for rapid traverse drawing
Y : Y coordinate for rapid traverse drawing
NOTE
1 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
2 Non-linear drawing is always performed regardless of the CNC parameters.
3 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
150
-150
-150 150
- 160 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Format
G206 Xx Yy Pp ;
X : Arbitrary point in an area to be filled (X coordinate)
Y : Arbitrary point in an area to be filled (Y coordinate)
P : Boundary color for filling
Example
1 When P8 (color other than the color palette with 0 set for all of R, G, and B) is
specified as the boundary color:
G240P1; ..... Red line
G244P0; ..... Solid line Blue line
G242X0.0Y0.0;
G01X100.0; (110,110)
Y100.0; Red line
X0.0;
Y0.0;
G240P4; ..... Blue line
G242X50.0Y50.0;
G01X150.0; Filled in
Y150.0; blue
X50.0;
Y50.0;
G206P8X110.0Y110.0; → The innermost area is filled.
- 161 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
2 When P0 (same as the color for filling) is specified as the boundary color:
G240P1; ..... Red line
G244P0; ..... Solid line Blue line
G242X0.0Y0.0;
G01X100.0; (110,110)
Y100.0; Red line
X0.0;
Y0.0;
G240P4; ..... Blue line
G242X50.0Y50.0;
G01X150.0; Filled in
Y150.0; blue
X50.0;
Y50.0;
G206P0X110.0Y110.0; → The red lines in the area to be filled are filled.
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
3 When bit 3 (GPNT) of compile parameter No. 9003 is set to 1, the color of color
palette 8 can be used. In this case, P16 is used to specify a boundary color other
than black (with 0 set for all of R, G, and B).
4 A fill area must be defined by a closed line.
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 : Y coordinate of the rectangular display end position
P : Color with which the rectangle is to be filled
The setting of color is the same as for P of G240. So, see Subsection 6.1.3.2, "Color specification (G240)".
No minus (-) value can be specified.
- 162 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
[ ] may be omitted.
Example
(Xx,Yy)
(Ii,Jj)
The points specified by addresses X and Y and addresses I and J may be at any positions that can form a
rectangle.
Example
(Ii,Jj) (Xx,Yy)
(Xx,Yy)
(Ii,Jj)
• When P is not specified, filling is not performed, but the outer frame only is drawn using the color
specified by G240.
• The line type of a rectangle is specified using the line type command (G244P_).
Example
1 When P is not specified:
Red frame line
G244P1; ........ Dashed line
G240P1; ........ Red line
G204 X-200. Y150.0 I0.0 J10.0 ;
Light blue within frame
2 When P is specified:
G244P0; ........ Solid line Red frame line
G240P1; ........ Red line
G204 X-200. Y150.0 I0.0 J10.0 P6 ;
NOTE
1 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
3 When specifying fill processing, be sure to specify a solid line.
4 Fill processing starts at the point defined by the midpoint between addresses X
and I and the midpoint between addresses Y and J.
5 The boundary color of fill processing is handled as a frame line color (specified
by G240P_).
6 After execution with address P specified, the color specification (G240P_) is
updated to the color of address P to change the color of the subsequent line
segments and character strings.
- 163 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Format
G317 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
The available marks are shown below as dot patterns, together with the mark numbers.
Mark number 1 2 3 4
Arrow head pointing Arrow head pointing Arrow head pointing to
Mark Origin mark
upward downward the left
00000
0 0000 0
0 00000 * 0 0 0
0 00000 0 0 0 0 0
0000*0000 0 0 0 0 *
0000 0 0 0 * 0
0000 0 0
000 0 0
00000
Mark number 5 6 7 8
Arrow head pointing to Arrow head pointing to Arrow head pointing to Arrow head pointing to
Mark
the right the upper left the lower left the upper right
0
0
0
* *0 0 0 0 000*
0 0 0 0
0 0 0 0
0 0 *0 0 0 0
Mark number 9 10
Arrow head pointing to
Mark Black, round mark
the lower right
000
00000
0000000
0 000*000
0 0000000
0 00000
000* 000
- 164 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
1 The asterisk "*" indicates the position specified for X and Y.
2 The commands of addresses X and Y are:
- Absolute commands at all times when bit 3 (INCD) of compile parameter No.
9167 is set to 0.
- Switched between absolute and incremental commands by G390/G391 when
bit 3 (INCD) of compile parameter No. 9167 is set to 1.
3 This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
4 When address P is omitted, the mark is displayed by the color palette 7.
5 When addresses X and Y are omitted, the mark is displayed at the current
position.
NOTE
This code is disabled when bit 4 (NVGA) of compile parameter No. 9167 is set to
1.
NOTE
When bit 4 (NVGA) of compile parameter No. 9167 is set to 1, graphic display
cannot be used. So, 1 is read from the graphic state read variable #8800 at all
times.
NOTE
The monochrome LCD is for the Series 30i /31i /32i -A.
- 165 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 166 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
: POSITION screen 0
: PROGRAM screen 1
: OFFSET/SETTING screen 2
: ALARM/MESSAGE screen 4
: GRAPHIC screen 5
USER screen
: 6
(conversational macro screen, C Language Executor screen)
: C Language Executor screen 7
NOTE
With the small keyboard, both the GRAPHIC and USER screens are controlled
using the key. The value of #8510 is 5 when displaying the GRAPHIC
screen and 6 when displaying USER screen.
NOTE
1 An option may be required depending on the screen.
2 Screens other than those listed Table 6.1.5.1 (b) are not supported.
- 169 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
: POSITION screen 0
: PROGRAM screen 1
: OFFSET/SETTING screen 2
: ALARM/MESSAGE screen 4
: GRAPHIC screen 5
USER screen
: 6
(conversational macro screen, C Language Executor screen)
: C Language Executor screen 7
- 170 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Sub menu screen Value of #8510
: Alarm screen 41
: Message screen 42
: Alarm history screen 43
: Message history screen 44
: Graphic parameter screen 51
: Graphic screen 52
: Conversational macro screen (user screen 1) 61
: Conversational macro screen (user screen 2) 62
: Conversational macro screen (user screen 3) 63
: C Language Executor screen (user screen 1) 64
: C Language Executor screen (user screen 2) 65
: C Language Executor screen (user screen 3) 66
: C Language Executor screen (user screen 4) 67
: C Language Executor screen (user screen 5) 68
: C Language Executor screen (user screen 1) 70
: C Language Executor screen (user screen 2) 71
: C Language Executor screen (user screen 3) 72
: C Language Executor screen (user screen 4) 73
: C Language Executor screen (user screen 5) 74
NOTE
1 An option may be required depending on the screen.
2 Screens other than those listed Table 6.1.5.2 (b) are not supported.
(Screen image)
NOTE
1 This function is enabled if a 10.4” LCD is used.
2 This function is not available for other conversational macro screens (user
screens 2 and 3). In these screens, a macro screen fills the whole screen space.
3 In the overall position indication, the location information of up to five axes is
displayed.
4 Extended axis name (parameter Nos.1025,1026), axis display order (parameter
No.3130) are invalid for this screen.
- 172 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
When the compile parameter US19WK(No.9007#3) set to 0, and the setting with
background color is enabled, the position for displaying the key input line is
changed under G-code group display area. (The position of (5) on the screen
image)
- 173 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
This example adds "USER HELP SCREEN" as the fourth item and displays
"USER.H" inside the frame of soft key [F1].
Compile parameter
P9050=3000
/*Program to be added
O3000 ;
G240 Pp ; ← Color specification (optional)
G243 ('USER HELP SCREEN'); ← Character string to be added
G240 Pp ; ← Color specification (optional)
G243 ('USER.H'); ← Soft key character string
M99 ;
Pressing the key displays the Help (Initial Menu) screen with the added
item in it. Pressing soft key [USER.H] or selecting '4. USER HELP SCREEN' by
moving the cursor or by some other means displays the user help screen.
NOTE
1 The display position of the character string of the added item in the Help (Initial
Menu) screen, as well as that of the character string in the soft key frame are
fixed. The display position coordinates cannot be specified using addresses X
and Y of G243. If addresses X and Y are specified, they are ignored.
2 The color specification of the character string must be based on the color palette
of the CNC system.
- 174 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
Compile parameter
P9051=3001
NOTE
Each time the Help (Initial Menu) screen is changed to the user help screen, the
value of #8555 is rewritten by the program number set in compile parameter No.
9051) and executed as the main program of the user help screen.
Compile parameter
P9051=3001
- 175 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
O3001 ;
:
#8556 = 1 ;
M99 ;
When the screen prior to the help screen is the current position screen, you will
return to the current position screen.
[Current position screen]
↓
[Help (Initial Menu) screen]
↓
[User help screen] #8556=1;
Page key
2 SOFT FUNCTION KEY 1 12
- 176 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Cursor key
3 SOFT FUNCTION KEY 2 13
Cursor key
4 SOFT FUNCTION KEY 3 14
ALTER key
5 SOFT FUNCTION KEY 4 15
INSRT key
6 SOFT FUNCTION KEY 5 16
DELETE key
7 SOFT FUNCTION KEY RIGHT 17
INPUT key
8
RESET key
10
Cursor key
18
Cursor key
19
The arrangement and names of the soft function keys are as follows:
[ ][ ][ ][ ][ ]
Page key
2 SOFT FUNCTION KEY 1 21
Cursor key
3 SOFT FUNCTION KEY 2 22
Cursor key
4 SOFT FUNCTION KEY 3 23
ALTER key
5 SOFT FUNCTION KEY 4 24
INSRT key
6 SOFT FUNCTION KEY 5 25
DELETE key
7 SOFT FUNCTION KEY 6 26
INPUT key
8 SOFT FUNCTION KEY 7 27
RESET key
10 SOFT FUNCTION KEY 8 28
Cursor key
18 SOFT FUNCTION KEY 9 29
Cursor key
19 SOFT FUNCTION KEY 10 30
- 177 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
The arrangement and names of the soft function keys are as follows:
(0) (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) (11)
The arrangement and names of the vertical soft keys are as follows:
(8)
(7)
(6)
(5)
(4)
(3)
(2)
(1)
(0)
NOTE
Do not use VERTICAL SOFT KEY 0 because it is used on the CNC system.
- 178 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example of use
When bit 1 (KY100) of compile parameter No. 9160 is set to 1.
If <1> is keyed, #8503=1.0 and #8501=8 results.
If <1.> is keyed, #8503=1.0 and #8501=108 results.
In this way, whether a decimal point is input can be checked.
- 179 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
The key input line returns to the initial state due to the input of a command key that causes the value of
command key input variable #8501 to change from 0 to a non-0 value. Then, the input numeric data,
address data, and character data can be read from the numeric data variable, address data variable, and
character string variable, respectively. When neither numeric data or address data is input, the values of
variables #8503 and #8504 are <null>. The numeric data variable and the address data variable retain
their values until input is made again.
Example
Assume that the variables are set as follows:
#8502=3;
#8552=500;
and that the following is input:
0123456ABCD
When the 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
NOTE
1 The macro variables starting with the one having the number set in variable
#8552 retain their previous values until the key is pressed. It is after the
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 key is pressed.
In this case, the input data cannot be read from character string variable #8508.
- 180 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Page key ON
OFF
#8501 = Data
#8501 = 0
256 32 32 (MSEC)
If you switch to the conversational macro screen from another screen, the variable values are reset to their
initial values shown below. Whenever you have switched screens, therefore, you need to set these control
variables again.
Initial values
• Screen with background color (when 1 is set in bit 0 (VGAR) of compile parameter No. 9100 and 0
is set in bit 2 (VRM) of parameter No. 9011)
Type of 7 soft keys Type of 12 soft keys
X coordinates 0 0
Y coordinates 13 22
Allowable number of key
32 32
input characters
• Screen without background color (when 0 is set in bit 0 (VGAR) of compile parameter No. 9100 or
1 is set in bit 2 (VRM) of parameter No. 9011)
Type of 7 soft keys Type of 12 soft keys
Bit 2 (CM30) of compile parameter No. Bit 2 (CM30) of compile parameter No.
9009 9009
1 0 1 0
X coordinates 0 0 0 0
Y coordinates 15 13 23 20
Allowable number of key
32 32 32 32
input characters
- 181 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
#8561, #8562 (X and Y coordinates of the key input line display position)
Specify the display position of the key input line.
#8561: X coordinates
#8562: Y coordinates
NOTE
The display position is changed as soon as you write a value in #8562.
Therefore, be sure to set #8561 first and then #8562.
Example
When the key is pressed, the key code is 90H. In #8549, 144 is set.
Example of use
To cause "PUSH" to blink while the 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 = #8549 ;
IF [#101 NE 143] GOTO 20 ;
M99 P10 ;
N20 G243 X0 Y0 A1 K4 ;
:
- 182 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
[ ][ ][ ][ ][ ]
“FL” “F9” “F8” “F7” “F6” “F5” “F4” “F3” “F2” “F1” “F0” “FR”
“VF9”
“VF8”
“VF7”
”VF6”
“VF5”
“VF4”
“VF3”
“VF2”
“VF1”
NOTE
Do not use VF1 because it is used on the CNC system.
"BACK SPACE", "SPCL", "MENU", and "KEY ON/OFF" in the key code table are the original key
codes of virtual MDI key.
When virtual MDI key is valid and bit 2 (VGET) of compile parameter No.9168 is set to 1, the value 0
can be read in #8533 regardless of the kind of the connected MDI keyboard.
- 183 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
(80H to FFH)
8 9 A B C D E F
0 RESET VF1 F0
1 VF2 F1
2 VF3 F2
3 VF4 F3
4 SHIFT INSERT VF5 AUX F4
5 DELETE VF6 F5
CAN/
6 BACK ALTER VF7 F6
SPACE
7 ALT VF8 F7
8 → INPUT VF9 POS F8
9 ← PROG F9
A ↓ HELP OFS/SET
B ↑ CTRL SYSTEM
C ABC/abc SPCL MESSAGE
GRAPH
D MENU
(Note)
KEY CUSTOM1
E PAGE↓ FR
ON/OFF (Note)
F PAGE↑ CUSTOM2 FL
NOTE
For the small keyboard, 0EDH corresponds to the key.
For the standard keyboard, 0EDH and 0EEH correspond to and
keys, respectively.
- 184 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
If, for the CNC in a 2-path system, the first path is to be accessed for the first
PMC, and the second path is to be accessed for the second PMC:
(1st path) (2nd path)
#8603=1; #8603=2;
G310R_Q_; G310R_Q_;
NOTE
Control variable #8603 is common to conversational macros, auxiliary macros,
and execution macros like other control variables. Thus, caution is required so
that it is not accessed by these macros at the same time.
The valid range of each PMC address is as shown in Table 6.4.1 (a).
- 185 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
If a value exceeding the applicable valid range is specified, the correct value
cannot be read. Refer to PMC PROGRAMMING MANUAL for details.
<Address>, <address number>, or <bit position> is to be coded directly using numeric values or coded
using a variable, #[<expression>], or [<expression>].
- 186 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
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.
4 Instead of coding directly using a numeric value as described above,
G#[#100+1] or G[#100+1].[[#100-1]/2] can be coded.
5 The PMC address that can be used are G, F, X, Y, E, R, D, T, K, and C. The
notation must conform to the description in PMC Ladder. Refer to PMC
PROGRAMMING MANUAL for details.
Example
1 #100 = P1000
The value of CNC parameter No. 1000 is set in macro variable #100.
2 #100 = P1020.2
The value of the 2nd axis of CNC parameter No. 1020 is set in macro variable
#100.
3 Instead of coding directly using a numeric value as described above, P#100 or
P#100.#101 can be coded.
NOTE
If a nonexistent parameter number is specified, 0 is read.
- 187 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- Format
G310 Dd Qq Ll ;
G310 Rr Qq Ll ;
G310 Cc Qq Ll ;
G310 Kk Qq Ll ;
G310 Tt Qq Ll ;
G310 Ee Qq Ll ;
G310 Yy Qq Ll ;
D : PMC address D
R : PMC address R
C : PMC address C
K : PMC address K
T : PMC address T
E : PMC address E
Y : PMC address Y
Q : Data to be written
L : Data size
Specifiable data lengths are 1, 2, and 4 bytes only. If none is specified, or if the data length is
not correct, 1 byte is assumed.
The data specified for address Q is written to PMC addresses D, R, C, K, T, E, and Y with the size
specified for address L. The data specified for address Q is rounded off to the nearest integer value, as
required, and converted into binary format before being written.
If the data is a negative numeric value, it is converted to a two's complement.
If the data to be written is more than a word, the lowest byte is written to the lowest address, the second
lowest byte to the second lowest address, and so on.
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).
- 188 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
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.
NOTE
1 Data cannot be specified in bit units.
2 If the specified data exceeds the byte length specified for address L, the
specified byte length of data is written and no error handling is performed.
In the example, 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 ;
G310 Ee Pp Ll ;
G310 Xx Pp Ll ;
G310 Yy Pp Ll ;
D : PMC address D
R : PMC address R
C : PMC address C
K : PMC address K
T : PMC address T
E : PMC address E
X : PMC address X
Y : PMC address Y
P : Number of the variable in which data is to be set
L : Data size
Specifiable data lengths are 1, 2, and 4 bytes only. If none is specified, or if the data
length is not correct, 1 byte is assumed.
By specifying a variable number for address P with the control code (G310) command, data can be read
from PMC addresses D, R, C, K, T, E, X, and Y. By using address L, 2/4-byte data can be read as a batch.
The data that has been read is regarded to be binary format data with the specified byte length, converted,
and stored in the variable specified for address P.
If the data to be read is more than a word, the data from the lowest address is written to the lowest byte,
the data from the second lowest address to the second lowest byte, and so on.
- 189 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
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.
WARNING
When you develop these applications, take care of the following notes.
If the following notes are ignored, the machine may behave in an unexpected
manner and tool, workpiece, and the machine may also be damaged.
As for details, refer to “SAFETY PRECAUTIONS”.
NOTE
As for kinds of applications like macro executor and networks, refer to “SAFETY
PRECAUTIONS”.
- 190 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
(3) Note on multiple-byte data
Generally, when multiple-byte data is input or output via an application like macro executor or
network, concurrence of the data (a condition free from data splitting) is not guaranteed. To ensure
multiple-byte data concurrence, please make use of handshaking process that uses signals to notify
reading/writing completion.
- 191 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
In variable number + 4 and later, set parameter data correctly. If writing data for
multiple control axes (spindles), be sure to set the data for all the specified
control axe (spindles).
Otherwise, the normality of the written data will not be guaranteed.
After setting the above data, start the parameter writing command from a conversational or auxiliary
macro program in the format shown below.
Format
G314 Pp [ Ll ] [ Tt ] [ Ss ] ; [ ] is optional.
p : First variable number of the variables storing data
l = 0 (or omitted) : The local path is assumed.
= 1 to maximum number of paths : Specify the path number to be written.
t = 0 (or omitted) : The local machine group number is assumed.
= 1 to maximum number of tool groups : Specify the machine group number to be written.
s = 0 (or omitted) : Data is written to a CNC parameter. (Bit 0 (PWE) of parameter No.
8900 must be set to 1.)
=1 : Data is written to a setting parameter.
When 0 is set in bit 0 (PWE) of parameter No. 8900, specifying S1 allows data to be written only in
setting parameters. When 1 is set in bit 0 (MPE) of parameter No. 9036, data can be written in all writable
parameters. (See Table 6.6.1 (a).)
Note that parameter No. 9036 can be written using this function, regardless of the state of bit 0 (PWE) of
parameter No. 8900.
Table 6.6.1 (a)
Bit 0 (PWE) of parameter No. 8900
0 1
Bit 0 (MPE) of parameter No. 9036 Bit 0 (MPE) of parameter No. 9036
0 1 0 1
S=1 Allowed
Setting parameter
S=0 Not allowed Allowed Allowed
Parameter Not allowed
- 192 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
1 For an axis type parameter
This example shows how to change parameter No. 1320 for the 2nd and 3rd axes
of 2nd path (local path) in a system where 1st path consists of three control axes
and 2nd path consists of four control axes.
<1> When specifying intra-path control axis numbers
(#10000 not required) . . . Setting not required (completion code)
#10001=1320; . . . Parameter No.1320
#10002=2 ; . . . Specification of the 2nd axis in a path
#10003=2; . . . Number of data items to be written = 2
#10004=1000; . . . Data to be written (1st)
#10005=2000; . . . Data to be written (2nd)
G314 P10000 ; → Write the parameter.
<2> When specifying system common control axis numbers
(#11000 not required) . . . Setting not required (completion code)
#11001=1320; . . . Parameter No.1320
#11002=105 ; . . . Specification of the system common 5th axis
#11003=2; . . . Number of data items to be written = 2
#11004=1000; . . . Data to be written (1st)
#11005=2000; . . . Data to be written (2nd)
G314 P11000 ; → Write the parameter.
2 For a system common parameter
Parameter No.0020: Change the communication equipment settings.
(#12000 not required) . . . Does not need to be set in the completion code.
#12001=20 ; . . . Parameter No.0020
#12002=0 ; . . . Set 0.
#12003=0 ; . . . Set 0.
#12004=4 ; . . . Data to be written
G314 P12000 ; → Write the parameter.
IF[#12000 NE 0]GOTO 900; → Check the completion code to confirm normal
Writing is completed. end.
N900;
Error processing
3 Bit 2 (INI) of bit type parameter No. 0000: Set 1 only for the switch between mm
and inch.
(#13000 not required) . . . Does not need to be set in the completion code.
#13001=0 ; . . . Parameter No.0000
#13002=0 ; . . . Set 0.
#13003=0 ; . . . Set 0.
#13004= [ P0 ] OR 4; . . . Using the parameter reading function, read
parameter No. 0000. Mask the read value, and
set only bit 2. (Specify the value in decimal.)
G314 P13000 ; → Write the parameter.
IF[#13000 NE 0]GOTO 900; → Check the completion code to confirm normal
Writing is completed. end.
N900;
Error processing
- 193 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
4 Set setting parameter No. 3123 of the 3rd path to 10 (if bit 0 (PWE) of parameter
No. 8900 is set to 0)
(#14000 not required) . . . Setting not required (completion code)
#14001=3123 ; . . . Setting parameter number
#14002=0 ; . . . Set 0.
#14003=0 ; . . . Set 0.
#14004=10; . . . Data to be written
G314 P14000 L3 S1; → Specify a path number for L3 and setting
parameter writing for S1, and execute.
IF[#14000 NE 0]GOTO 900; → Check the completion code to confirm normal
Writing is completed. end.
N900;
Error processing
NOTE
1 The command cannot be executed during axis movement. The completion code
-1 is returned.
2 Depending on the parameter, P/W alarm No. 0000 may occur. In that case, it is
necessary to turn off the power.
CAUTION
Before changing any parameter during automatic operation, consider thoroughly
whether it is OK to change the data in question.
WARNING
Take care that you do not write the same parameter with several applications
like C language executor. If there is data duplication writing in the system, the
data not intended is input, and the machine may behave in an unexpected
manner and tool, workpiece, and the machine may also be damaged.
Value Description
0 Normal end
-1 The axis is moving or is not ready for data writing.
3 The specified number of the parameter to be written is invalid.
4 Invalid data is set for axis specification.
5 The setting data is invalid.
7 The data of the parameter corresponding to the specified parameter number is protected.
8 An invalid value is specified in the G314 block data (P, L, T, or S).
- 194 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Format
G314 K2 Ww Pp Ss Ee
K2 : Causes the function to become a pitch error compensation write/read function.
w=1 : Causes the function to become a write command.
=0 : Causes the function to become a read command.
p : Specify the top variable number of the variable group to store read data or write data.
s : Specify the compensation point number of the pitch error compensation data at which to
start writing or reading.
e : Specify the compensation point number of the pitch error compensation data at which to
end writing or reading.
NOTE
If K2 is omitted, parameter writing is performed.
Example
1 Writing the values set in variables #10000 to #10010 to pitch error compensation
data items No. 100 to No. 110
<1> In the 11 P-CODE variables #10000 to #10010, set the data to be written.
#10000=1 ... Data to be written (1st)
#10001=2 ... Data to be written (2nd)
:
#10010=11 ... Data to be written (11th)
<2> Specify the writing of pitch error compensation data.
G314 K2 W1 P10000 S100 E110
<3> Check the completion code (#8579).
2 Reading pitch error compensation data items No. 200 to No. 210 into variables
#10000 and up
<1> Specify the reading of pitch error compensation data.
G314 K2 W0 P10000 S200 E210
<2> Check the completion code (#8579).
<3> If the reading terminates normally, the data items have been read into
P-CODE variables #10000 to #10010.
- 195 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
If the variable group to store data contains invalid variable, the completion code
(#8579) is set to 115.
Value Description
0 Normal end
3 The specified data contains an error, or the necessary data is not specified.
5 The write data contains an error.
6 The pitch error compensation option is not set.
7 Writing is not possible because of the 8-level data protection function.
115 An unusable variable number is specified.
- 196 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
6.7.1 General
The communication line can be controlled with the conversational macro function/auxiliary macro
function when the communication line is not used for other purposes, for example, by the CNC.
Line control is performed using the following seven control codes.
Line control functions are effective when bit 7 (EXT1) of compile parameter No. 9002 is 1.
G330: Line open
G331: Line close
G335: 1-byte reception
G336: Data transmission
G337: Macro variable input
G338: Macro variable output
G339: File information reading/file deletion
One of the following four line control methods can be selected when a line is opened.
Completion codes are available for checking whether input/output processing has been executed correctly.
Check the completion code after executing a control code.
All completion codes are for read only.
- 197 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
6.7.2 Function
Line open G330
- Format
G330 Pp Bb Ss Cc ;
P : Interface number and control method of the input/output device for the foreground
=1 : Hard flow control with RS-232-C1
=2 : Hard flow control with RS-232-C2
= 11 : Reception control with RS-232-C1
= 12 : Reception control with RS-232-C2
= 21 : Transmission control with RS-232-C1
= 22 : Transmission control with RS-232-C2
= 31 : File control with RS-232-C1
= 32 : File control with RS-232-C2
NOTE
1 When the FANUC Handy File, FANUC Floppy Cassette, FANUC FA Card, or
FANUC Program File Mate is used, specify C2.
2 If address C is not specified, ASCII code is used.
- Explanation
One character
a b1 b2 b3 b4 b5 b6 b7 b8 c d1 d2
a : Start bit (1 bit)
b : Information bit (8 bits)
c : Parity bit (0 or 1 bit)
d : Stop bit (1 or 2 bits)
- Explanation
This code closes an open line.
When a line is closed, the completion code is always 0 (normal termination).
- 198 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- Explanation
This code reads one byte of received data and stores it in a specified macro variable.
Received data is once stored in the receive buffer (592 bytes) then is read one byte at a time by this
control code.
If the receive buffer is about to overflow due to a delay in reading the buffer relative to the reception of
data, one of the following operations is performed according to the control method specified when the
line is opened.
(1) When hard flow control is used
When a receive buffer overflow is detected (when the size of free space is 25 bytes or less), the
control signal RS is set to OFF to send a request to the remote device to stop transmission. When the
receive buffer becomes available (when the size of free space exceeds 567 bytes) as read processing
proceeds, the signal (RS) is set to ON to request the remote device to resume transmission.
About the behavior if there is no receiving data, refer to “6.7.4 Data Transmission/ Reception Waiting”.
Example
G330 P11 Bb Ss Cc; → Open a line by RS-232-C 1 reception control.
#100=10000;
N100 G335 P#100 ; → Read data in #10000 and later.
IF[#[#100] EQ 37] GOTO999; → Check the end of data by ‘%’(ASCII code is
37).
IF [#8539 NE 0] GOTO900 ; → Check for any error.
Processing of the read data
#100=#100+1; → Next byte
(#10000~:Received data)
GOTO 100 → Repeat until there is no more data.
N900 Error processing
N999 G331; → Close the line.
- 199 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- Explanation
• Data is transmitted in a specified format.
• Before being transmitted, a specified character string is converted to ASCII or ISO code according
to the specification at line open time.
• 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 8 is set.
• Data is not transmitted character by character but is stored in the transmit buffer and transmitted
collectively on a per-block basis (when the EOB command is found).
• If R100 is specified in a block, data is not transmitted in that block, allowing the data to be
transmitted at the same time as a data transmission block (G336) in which R100 is not specified.
This enables you to delay the transmission of blocks until a desired block by specifying R100 in
each of those blocks, when, for example, one-character command is specified in two or more blocks
using address C, thereby allowing the whole bunch of data to be transmitted at once and speeding up
the execution of a macro program.
Example
G330 P21 Bb Ss Cc; → Open a line by RS-232-C 1 transmission control.
G336 C18 K20 (FANUC) R100; C18 : DC2(12h)
K20 C20 ; K20 : 20 null codes (Feed)
IF [#8539 NE 0] GOTO900 ; FANUC (ASCII / ISO / EIA code)
Transmission processing * Since R100 is specified, the data is not
completed transmitted in this block.
N900 Error processing;
G331; K20 : 20 null codes (Feed)
C20 : DC4(14h)
* Since R100 is not specified, the whole bunch
of data is transmitted at once in this block.
• Also, when only data transmission (G336/G338) is performed between line opening and closing, you
can delay transmission until after the 255-byte transmit buffer is full, by setting 1 in bit 4 (CWB) of
parameter No. 9035. The specification of R100 is irrelevant to this function.
NOTE
1 When only one byte, such as a control code, is transmitted, or when output and
input are performed alternately between line opening and closing, set 0 in bit 4
(CWB) of parameter No. 9035. If 1 is set, data is transmitted in units of 255 bytes,
hindering the normal exchange of data.
2 The size of the transmit buffer is 255 bytes.
If the transmit buffer size is exceeded, 255 bytes of data are transmitted. Also,
when line close (G331) is executed, the data stored in the transmit buffer is
transmitted as well.
- 200 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
• By specifying bit 0 (NTV) of compile parameter No. 9167, it is possible to prevent the TV check
space from being output when "LF" is output.
• About the behavior if the data transmission has been stopped, refer to “6.7.4 Data Transmission/
Reception Waiting”.
P : Read variable number (valid when variable number "N" is not specified in the macro variable data to
be read)
Q : Number of read variables (optional)
R : Continuous reading specification (optional)
- 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.
Address "P" on the data indicates the value of the variable, and cannot be omitted. If the value is null (#0),
"P" must be followed by "LF" without specifying the numeric value, as shown below.
LF N ⎯⎯⎯ P LF
NOTE
1 G337 is a one-shot code.
2 In a significant information section, any codes other than "LF," data end "%,"
addresses "N" and "P," and subsequent numeric data are ignored.
- 201 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
By using address Q, the number of variables to be read can be specified. When the specified number of
variables have been read, a completion code (#8539) of 99 is set, notifying that continuous reading is
possible. If the data end "%" is read before the specified number of variables are read, a completion code
(#8539) of 0 is set. When address Q is omitted, an infinite number of variables is assumed.
When the number of variables to be read is specified and a completion code (#8539) of 99 is set, the
subsequent macro variable data can be read by specifying R99.
When continuous reading R99 is not specified, the data for the next variable will be lost because of the
significant information check (discarding of the data up to the first ":(LF).")
EXAMPLE
Input of macro variable data
To read the following data in which macro variable number address "N" is
omitted, enter the following:
% LF P____ LF .... P____ LF P____ LF .... P____ LF P____ LF .... P____ LF %
Data for 10 Data for 20 Data for the
variables variables remaining variables
G330 Pp Bp ..... ;
G337 P100 Q10 ; The data for the first 10 variables is stored in variables #100 to #109.
IF [#8539 NE 99] GOTO 888 ; (#8539=99 for normal processing)
:
G337 P15000 Q20 R99 ; The data for the next 20 variables is stored in variables #15000 to #15019.
IF [#8539 NE 99] GOTO 888 ; (#8539=99 for normal processing)
:
G337 P16000 R99 ; The data for the remaining variables is stored in variable #16000 and above.
IF [#8539 NE 0] GOTO 888 ; (#8539=0 for normal processing)
:
N888 Error processing
G331 ;
About the behavior if there is no receiving data, refer to “6.7.4 Data Transmission/ Reception Waiting”.
NOTE
1 The value specified for address F is treated in the same way as that specified
with screen display control G243, except F-9.8 and F-9.9. See Section 6.1.3.5,
"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 treated in the same way as that specified
with screen display control G243. See Section 6.1.3.5, "Character display" for
details.
3 If improper data is specified for the variable number, output processing is
interrupted and a completion code of 115 is set.
4 G338 is a one-shot G code.
- Explanation
This code converts specified macro variable data to a predetermined data 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 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 data end ("%") code is
output.
Using bit 6 (PTCH) of compile parameter No. 9003, it is possible to output a "CR" code to each block. It
can be used to start a new line on a printing device.
When -9.9 is specified for f, the significant digits of macro variable data is automatically identified and
output. The maximum number of digits that can be output is 12. The output data format is the same as
that described above.
If, however, the variable data is outside the following range:
-999999999999. to-0.00000000001
999999999999. to0.00000000001
"LF" is output following "P" in the same way as when the data is null.
When -9.8 is specified for f, data is output in floating-point format. The output data format is the same as
that described above, except that address "Q" is output instead of address "P" and the variable data is
fixed to 16 characters.
The macro variable data that has been output in this data format can be read by using G337; the data is
stored in the appropriate variables in floating-point format.
- 203 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
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.
- When variable numbers are not output, the output variable data can be stored in any desired
variables using address P with macro variable input function G337.
- By exercising control on output of "%" (EOR) with address R, multiple variable groups can be
output in one-data format.
- Data is not transmitted character by character but is stored in the transmit buffer and transmitted
collectively on a per-block basis (when the EOB command is found).
- Moreover, when only data transmission (G336/G338) is performed between line opening and
closing, you can delay transmission until after the 255-byte transmit buffer is full, by setting 1 in bit
4 (CWB) of parameter No. 9035. The specification of R1xx is irrelevant to this function.
- Feeding control is not performed at the time of output. To use a paper tape puncher or some other
tool for feeding, use data transmission G336.
- About the behavior if the data transmission has been stopped, refer to “6.7.4 Data Transmission/
Reception Waiting”.
NOTE
1 When output and input are performed alternately between line opening and
closing, set 0 in bit 4 (CWB) of parameter No. 9035. If 1 is set, data is transmitted
in units of 255 bytes, hindering the normal exchange of data.
2 The size of the transmit buffer is 255 bytes.
If the transmit buffer size is exceeded, 255 bytes of data are transmitted. Also,
when line close (G331) is executed, the data stored in the transmit buffer is
transmitted as well.
- 204 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
G338 P10000 Q10 F8.3 Z1 R111 ; → Stores 10 data items from #10000 after % (EOR)
IF[#8539 NE 0]GOTO999; at the start in the transmit buffer without variable
: numbers. Does not append % (EOR) at the end.
G338 P11000 Q20 F8.3 Z1 R131 ; → Stores 20 data items from #11000 after the above
IF[#8539 NE 0]GOTO999; data in the transmit buffer without appending %
: (EOR) at the start or end and variable numbers.
G338 P12000 Q10 F8.3 Z1 R121; → Stores 10 data items from #12000 after the above
IF [#8539 NE 0] GOTO 999 ; data and % (EOR) at the end in the transmit buffer
: without appending % (EOR) at the start and
N999 Error processing variable numbers.
G331 ; → Closes the line after transmitting all the codes in
the transmit buffer.
- 205 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 206 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
Program in which cancellation is taken into consideration
09000;
N1 G330 Pp Bp … ; 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);
:
If, in block N3, the reception waiting state continues even after the time set for
compile parameter No.9056, block N3 is terminated and control jumps from
block N4 to the error handling block N11. At this time, completion code variable
#8539 is set to 255.
Setting bit 1 (RCN) of parameter No. 9035 enables block N3 to end at a reset
when the block is waiting for reception. At this time, completion code variable
#8539 is set to 12.
NOTE
A reset caused by compile parameter No.9056 or by setting bit 1 (RCN) of
executor parameter No.9035 to 1 is also valid for a transmit/receive instruction
used with an auxiliary macro. If transmission/reception is to be performed by an
auxiliary macro, therefore, the possibility that the RESET key may be pressed
regardless of the state of the auxiliary macro must be taken into consideration
during programming.
NOTE
For addresses B, S, and C, see the section handling line open (G330).
However, set ISO(2) in address C.
- 207 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 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.
For an explanation of specifying addresses P, B, S, and C, see the explanation of line open G330. Address
P must be reading control (p = 11/12 ....).
(1) Searching for the beginning of a file using its file name
By specifying address L, it is possible to search for the beginning of a file using its file name.
Set the ASCII codes (decimal) of the file name in macro variables having consecutive 17 numbers and
specify the number of the first macro variable for address L.
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.
The above command searches for the beginning of the file "ABCD."
NOTE
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 8 is set.
(2) Searching for the beginning of a file using its file number
By specifying address F, it is possible to search for the beginning of a file using its file number.
Specify the number of the file to search for (1 to 9999).
Example
To search for the beginning of a file with file number 3.
G330 P11 B10 S12 C2 F3;
Example
To search for the beginning of the file following the one the beginning of which
has been searched for.
- 208 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- Explanation
When a line is opened in transmission control mode, with either address L or F specified, it is possible to
create a new file on the FANUC cassette.
For an explanation of specifying addresses P, B, S, and C, see the explanation of line open G330. Address
P must be writing control (p = 21/22 ....).
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.
G330 P21 B10 S12 C2 L100 ;
The above command crates a file with the file name "ABCD."
NOTE
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 8 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:
G330 P21 B10 S12 C2 F3 ;
NOTE
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.
- 209 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
For an explanation of addresses B and S, see the explanation of line open G330.
- Explanation
G339 can be used to read file information, delete a file, and rename a file.
To enable of the use of this function, the control mode must be file information control mode when the
line is opened (G330). To specify file information control mode, specify 31/32 ... for address P when
opening the line.
NOTE
When the line is opened in file information control mode, two or more successive
operations such as a file information read operation followed by a file deletion
operation cannot be specified in one line open period. If, for example, file
information is to be read and checked and then the file is to be deleted, the line
must be opened and closed for each operation, as in the example below.
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 ;
- 210 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
S : Number of the macro variable used to store the file size to be read
By reading file information by specifying a file number for address F and then issuing G339 P1 with a
file number omitted, the file information for the next file number can be read. If a file with the specified
file number does not exist, a completion code of 11 is set.
L : Number of the first one of the consecutive 17 macro variables used to store the 17-character file
name of the file to be deleted. The file name must be set with ASCII codes (decimal).
F : File number specification (1 to 9999)
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.
G339 P3 Ll Ff ;
Specify the file number of the file to be renamed and the new file name.
When the command specified in an auxiliary macro program is completed, a completion code is set in
both variables #8537 and #8539. If the command specified in a conversational macro program is
completed, a completion code is set in both variables #8538 and #8539.
#8539 Description
0 Normal termination
1 The line is not open.
2 Line error (DR signal off)
3 Line error (overrun error)
4 Line error (buffer over error)
5 Line error (framing error, parity error)
6 No line function option.
- 211 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
#8539 Description
7 The line is busy.
8 (1) Data (P, Q, R, and so forth) specified in a block of G330 to G339 is incorrect, or necessary
data is not specified.
(2) G336 or G338 was issued in reception control mode.
(3) G335 or G337 was issued in transmission control mode.
(4) G339 was specified in a mode other than file control mode.
9 Invalid data format
10 Invalid file number
11 A file with the number specified with the file information reading code does not exist.
12 Operation was stopped by an NC reset in the data transmission/reception waiting state.
99 With macro variable input function G337, the continuous reading of macro variables is possible.
115 An undefined variable number is specified.
211 Line error (CD signal off)
255 The specified time has elapsed since the system entered the data transmission/reception waiting
state.
- 212 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
6.8.1 General
Memory card control can be executed using the same commands that are used for the reader/puncher
interface.
Memory card control is enabled when bit 7 (EXT1) of compile parameter No. 9002 is set to 1.
- 213 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
6.8.2 Functions
Memory card open G330
- Format
G330 Pp (Ll / Ff) ;
P
= 14 : Memory card read control (Specify a file name.)
= 24 : Memory card write control (Specify a file name.)
= 34 : File control based on memory card
L : Specify the start variable number of the variable string storing the file name.
In read mode, a search for the beginning of the file is made based on this file name.
In write mode, a new file is created using this file name.
- Explanation
By setting the lower one digit specified for P to "4", the memory card is opened and made usable
according to the control method and control conditions.
Example
G330 P24 L100 ;
IF [#8539 NE 0] GOTO900 ;
Open processing completed
N900 Error processing
- 214 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
To search for the beginning of the file ”ABC.DAT”, set 65 (A), 66 (B), 67 (C), 46
(.), 68 (D), 65 (A), 84 (T), 32, ..., 32 (space) in 12 common variables #100 to
#111.
G330 P14 L100 ;
NOTE
1 A file name must consist of 12 characters. If a file name is shorter than 12
characters, pad 32 (space) at the following unused character position(s) to make
a 12-character file name.
2 Specify a file name + extension by using alphanumeric characters. If a file name
starts with code 32 (space), however, completion code 114 is returned.
Example
To search for the file number 3.
NOTE
If the specified file doesn't exist, completion code variable #8539 is set to 114.
Example
To create a file named ”ABC.DAT”, set 65 (A), 66 (B), 67 (C), 46 (.), 68 (D), 65
(A), 84 (T), 32, ..., 32 (space) in 12 common variables #100 to #111.
G330 P24 L100 ;
NOTE
1 A file name must consist of 12 characters. If a file name is shorter than 12
characters, pad 32 (space) at the following unused character position(s) to make
a 12-character file name.
2 Specify a file name + extension by using alphanumeric characters. If a file name
starts with code 32 (space), however, completion code 122 is returned.
- Explanation
This code ends memory card control.
Memory card close processing is terminated normally at all times. (Completion code=0)
- Explanation
The file on the memory card is read from the beginning, one byte at a time, and the read data is assigned
to the specified macro variable. When there is no more data to read, completion code 121 is set.
For a byte read, open memory card control in the read control mode (P=14).
Example
G330 P14 L500 ; → Open in read control mode
#100=10000;
N100 G335 P#100 ; → Read into #10000 and up.
IF [#8539 EQ 121] GOTO999 ; → Check the end of data.
IF [#8539 NE 0] GOTO900 ; → Check for any error.
Processing of the read data
#100=#100+1; → Next byte
(#10000~ : Read data)
GOTO100 → Repeat until there is no more data.
N900 Error processing
→
N999 G331 Close memory card
Next processing
The other addresses are the same as for screen display control (G243). So, see Subsection 6.1.3.5,
"Character display (G243)".
- Explanation
Data is output in a specified format.
A specified character string is converted to ASCII codes for output.
Open memory card control in the write control mode (P=24).
- 216 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
G330 P24 L500 ; Open in write control mode
G336 C9 K20 (FANUC) ; C9 : Horizontal tab
K30; K20 : 20 space characters (20h).
IF [#8539 NE 0] GOTO900 ; FANUC (ASCII code)
Write processing completed
G331; 30 space characters (20h)
GOTO1000;
N900 Error processing
N1000 Next processing
- Explanation
Macro variable data is read from the memory card opened in the read control mode, and is assigned to
specified macro variable.
This processing is the same as macro variable data input (G337) described in Section 6.7,
"READER/PUNCHER INTERFACE", except that data is input from the memory card.
- Explanation
In the write control mode, the data of a specified macro variable is converted to a specified format for
output.
This processing is the same as macro variable data output (G338) described in Section 6.7,
"READER/PUNCHER INTERFACE", except that data is output to the memory card.
- Explanation
By specifying G339, file information on the memory card can be read and a file on the memory card can
be deleted.
Before this function can be used, the file information control mode must be set when the line is opened
(G330). To set the file information control mode, specify p = 34 in address P when opening the line. At
this time, the specification of a file (L) is not necessary. (G330 P34 ;)
G339 P1 Ff Ll Ss ;
- 217 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
If there is no directory corresponding to the specified file number, completion code 114 is returned.
Example
G330 P34 ; → Open in file information control mode
G339 P1 F1 L101 S100 ; → Read file information
IF [#8539 NE 0] GOTO100 ;
Read processing completed
→ Close memory card
G331 ;
GOTO200 ;
N100 Error processing
N200 Next processing
Example
To delete a file named ”ABC.DAT”, set 65 (A), 66 (B), 67 (C), 46 (.), 68 (D), 65
(A), 84 (T), 32, ..., 32 (space) in 12 common variables #100 to #111.
When the command specified in an auxiliary macro program is completed, a completion code is set in
both variables #8537 and #8539. If the command specified in a conversational macro program is
completed, a completion code is set in both variables #8538 and #8539.
- 218 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
#8539 Description
0 Normal termination
1 The memory card is not opened.
6 A necessary option is not specified.
7 The memory card cannot be opened because it is used with another function.
Or, it is write-protected.
8 Data (P, Q, R, and so forth) specified in a block of G330 to G339 is incorrect, or necessary data is
not specified.
9 Invalid data format
10 The file number is invalid.
12 (1) The specified time has elapsed since the system entered the data transmission/reception
waiting state.
(2) The command has been interrupted by an NC reset while waiting for data input or output when
1 is set in bit 1 (RCN) of parameter No. 9035.
30 Memory card not inserted yet
32 The battery power of the memory card is low.
99 With macro variable input function G337, the continuous reading of macro variables is possible.
102 Insufficient free space on memory card
114 Specify file not found
115 The specified file is protected.
An undefined variable number was specified.
117 The file is not opened in a correct mode.
121 End of file
122 Illegal file name specified
130 A file with the same name already exists on memory card.
141 Close the file.
150 (1) Memory card cannot be recognized.
(2) An error occurred on memory card.
- 219 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
6.9.1 General
Using the conversational macro function and auxiliary macro function enables CNC part programs to be
registered, deleted, and modified.
Program and block numbers are used to manage CNC programs. The block number begins with the
address "O" block of the program and then increments by 1 for each EOB.
A macro-based CNC program is comprised of blocks that are a repetition of two variables (address code
and value) representing data at one word.
Using this function requires that bit 7 (EXT1) of compile parameter No. 9002 to be set 1.
Example
O0001; Block No. 1
G00 X10; Block No. 2
M03 S1000; Block No. 3
:
Program No. 0001, block No. 3, storage variable No. 100
#100= 13 ..........Address M
#101= 3 ..........Value
#102= 19 ..........Address S
#103=1000 .........Value
#104= 27 ..........Address EOB
Control commands are issued by specifying G codes (G320 to G329) with macros. Completion code
(#8529) is available which can be used to check whether specified functions have been executed normally.
Completion code (#8529) should be checked after G320 to G329 are executed.
The completion code is 0 in the case of normal termination. When the completion code is other than 0, an
alarm code for this function is issued.
- 220 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Target folder
Target folders in which NC programs are to be registered, deleted, and changed are
If parameter No. 3467 is set to 0
The default folder in the background.
If parameter No. 3467 is set to a value other than 0
Folder specified for parameter No. 3467 from the initial folder.
NOTE
If "6. path-by-path folder" is selected for parameter No. 3467, the target folder is
the folder of the displayed path if the command is from a conversational macro;
and if the command is from an auxiliary macro, it is the folder of the path in
which the auxiliary macro is being executed.
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
#8527 : Number of registered programs (read-only)
#8528 : Free-space capacity of CNC program memory (read-only)
#8529 : Completion code (read-only)
Control codes
G320 : Newly registers a program.
G321 : Deletes a program.
G325 : Reads a specified word-type block.
G326 : Writes a specified word-type block.
G327 : Deletes a block.
G322 : Condenses a program.
G328 : Reads a specified character-type block.
G329 : Writes a specified character-type block.
- Explanation
To newly register a program, issue G320 by specifying a program number (#8520) for the program.
Example
To register O0002:
#8520=2;
G320;
IF [#8529 NE 0] GOTO 900;
Registration completed
N900;
Error
- 221 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Newly registering a program involves the same processing as for "Oxxxx"+"INSERT" (editing); no EOB
is inserted.
Example
O0002 %
- Explanation
To delete a program, issue G321 by specifying the program number (#8520) of the program.
Example
To delete O0003:
#8520=3;
G321;
IF [#8529 NE 0] GOTO 900;
Deletion completed
N900;
Error
- 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 G326, G327,
G328, and G329.
By using address P, specify the maximum number of readable variables. If a block to be read is so large
that the variables more than the specified maximum number of readable variables are required, the read
processing is stopped, and completion code 210 is set in #8529.
When a value specified without the decimal point is read, the position of the decimal point is determined
by bit 0 (DPI) of parameter No. 3401. By setting 1 in bit 2 (PRDPI) of compile parameter No. 9160, it is
also possible to keep calculator type decimal point input.
- 222 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example 1
* The minimum setting unit is that of the IS-B (0.001) machine.
[NC program]
O0004;
G92 X0. M08;
G90 G00 X10.5 Z15 M05;
[Macro program]
#8520=4;
#8521=3;
#8522=100;
G325 P11;
IF [#8529 NE 0] GOTO 900;
Read completed
N900;
Error
Executing the above macro programs causes program data to be stored in an area starting at #100
specified using storage variable number #8522, as follows:
#100= 7 ........Address G
#101= 90 ........Value
#102= 7 ........Address G
#103= 0 ........Value
#104= 24 ........Address X
#105= 10.5 ........Value
#106= 26 ........Address Z
#107= 0.015 ........Value
........15.0 when 1 is set in bit 2 (PRDPI) of compile parameter No.
9160
#108= 13 ........Address M
#109= 5 ........Value
#110= 27 ........Address EOB
If a program does not end with an EOB, or the location of an EOR is specified with a block number, the
EOR (28) is stored as an address. If any block number after the EOR block is specified, completion code
"211" is set and the block is not read.
Example 2
O0004;
G92 X0. M08;
M02%
Assuming the above steps, the variable area will be:
- 223 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example 3
O0004;
G92 X0. M08;
%
Assuming the above steps, the variable area will be:
Example
[NC program]
O0011 N10 G00X0 ;
N20 M05;
[Macro program]
#8520=11;
#8521=1;
#8522=100;
G325 P9;
IF [#8529 NE 0] GOTO 900;
Read completed
N900;
Error
If this macro program is executed, the program data is stored, beginning with
#100, as follows.
Bit 6 (PG1O) of compile parameter No. 9160
Variable read
0 1
#100 15: Address O 14: Address N
#101 11: Value 10: Value
#102 14: Address N 7 : Address G
#103 10: Value 0 : Value
#104 7 : Address G 24: Address X
#105 0 : Value 0 : Value
#106 24: Address X 27: Address EOB
#107 0 : Value
#108 27: Address EOB
- 224 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example 2
#8520 = Program number ;
#8521 = Block number;
#8522 = Read variable number;
G325 ; (Reading a specified word-type block)
IF [#8529 EQ 253] GOTO 100;
:
N100 G328 ; (Reading a specified character-type block)
NOTE
This command cannot read an extended address (extended axis name or
extended spindle name). Use the function for reading a specified character-type
block (G328).
- Explanation
Even if a block specified in a CNC program is not represented as a word-type block (in the format
"address + number"), this command enables the block to be read to a specified variable area by converting
each character to an ASCII code (decimal). At this time, the control commands (WHILE/IF/...) and the
functions (SIN/COS/FUP/..) are represented as special codes.
By using address P, specify the maximum number of readable variables. If a block to be read is so large
that the variables more than the specified maximum number of readable variables are required, the read
processing is stopped, and completion code 210 is set in #8529.
Example 1
#8520 = Program number ;
#8521 = Block number;
#8522=100;(Read variable number)
G328 P9 ;
IF [#8529 NE 0] GOTO 900; (Error check)
#100 : 35 "#"
#101 : 49 "1"
#102 : 61 "="
#103 : 276 "SIN"
#104 : 91 "["
#105 : 35 "#"
#106 : 50 "2"
#107 : 93 "]"
#108 : 59 ";"
- 225 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
When the O-number block is read by setting 1 in block number variable #8521,
the length of the read O-number block is always 8 digits.
Example
[NC program]
O0011(ABC) ;
N20 M05;
[Macro program]
#8520=11;
#8521=1;
#8522=100;
G328 P15;
IF [#8529 NE 0] GOTO 900;
Read completed
N900;
Error
If this macro program is executed, the program data is stored, beginning with
#100, as follows.
Bit 6 (PG1O) of compile parameter No. 9160
Variable read
0 1
#100 79: ”O” 40: ”(“
#101 48: ”0” 65: ”A“
#102 48: ”0” 66: ”B“
#103 48: ”0” 67: ”C“
#104 48: ”0” 41: ”)“
#105 48: ”0” 59: ”;“
#106 48: ”0”
#107 49: ”1”
#108 49: ”1”
#109 40: ”(“
#110 65: ”A“
#111 66: ”B“
#112 67: ”C“
#113 41: ”)“
#114 59: ”;“
CAUTION
Do not edit the program during high-speed block reading.
Doing so hinders proper data reading.
NOTE
If the read operation is performed again after the end block (EOR block) of the
program is read, the completion code (#8529) is 251 instead of 211.
Example 1
[NC program]
O0004 N1 G90 G01 X100 Y100 F10000 ;
N2 X101 Y101 ;
N3 X102 Y102 ;
N4 X103 Y103 ;
:
N10 X109 Y109 ;
- 227 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
[Macro program]
#8520 = 4 /* Program number specification */
#8521 = 1 /* Block number specification */
#8522 = 100 /* Storing variable number specification */
G325 /* Specified word-type block reading */
IF [ #8529 NE 0 ] /* Error check */
GOTO 70
/****** Processing of the read data ********/
#8521 = -1 /* High-speed data reading specification */
#500 =0
WHILE [ #500 LT 10 ] DO1
G325 /* Specified word-type block reading */
IF [ #8529 NE 0 ] /* Error check */
GOTO 70
/****** Processing of the read data ********/
#500 = #500 + 1
END1
:
N70 /****** Error processing ********/
:
If the command shown above is executed, program data N1 to N10 are stored sequentially, with 15
stored in #100 specified by storing variable number #8522, 4 stored in #101, 14 stored in #102, and
so on.
- 228 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example 2
[NC program]
O0004 N1 G90 G01 X100 Y100 F10000 ;
N2 X101 Y101 ;
N3 X102 Y102 ;
N4 X103 Y103 ;
:
N10 X109 Y109 ;
[Macro program]
#8520 = 4 /* Program number specification */
#8521 = 1 /* Block number specification */
#8522 = 100 /* Storing variable number specification */
WHILE [ #8521 LE 10 ] DO1
G325 /* Specified word-type block reading */
IF [ #8529 NE 0 ] /* Error check */
GOTO 70
/****** Processing of the read data ********/
#8521=#8521+1 /* Next block number specification
END1
:
N70 /****** Error processing ********/
:
- 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 up to the data immediately before the EOR is written. If there is neither
EOB nor EOR, a number of data items specified using address P are written.
Example
[NC program]
O0004;
G92 X0. M08;
G90 G00 X10.5 M05;
- 229 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
[Macro program]
#8520=4;
#8521=2;
#8522=100;
#100=7;
#101=1;
#102=24;
#103=20.5;
#104=6;
#105=1000;
#106=27;
G326 P7;
IF [#8529 NE 0] GOTO 900;
Write completed
N900;
Error
Executing the above macro program causes the following blocks to be inserted in the program.
O0004;
G92 X0. M08;
G1 X20.5 F1000.;
G90 G0 X10.5 M05;
If a block number is specified only in EOR or a later number is specified, the completion code is "211"
and the write operation is not performed. Specifying 1 as a block number enables a program to be written
to a program that has only a program number, however.
NOTE
1 This command cannot register a program.
If an attempt is made to register a program (with "O" placed at the start of write
data), the error code (#8529=202) is posted.
2 This command cannot write an extended address (extended axis name or
extended spindle name). Use the function for writing a specified character-type
block (G329).
- Explanation
Even when program data is not represented in the word-type format, program data created on a
character-by-character basis can be written using this function. First, define program data by using ASCII
code in a macro variable area beforehand. Then, use this command to write the program data after the
block specified by program number and block number. An EOB is specified using ";" (59), and an EOR is
specified using "%" (37).
- 230 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
By using address P, specify the maximum number of variable data items. If specified variable data
includes address EOB, the data up to EOB is written. If specified variable data includes address EOR, the
data up to the data immediately before the EOR is written. If specified variable data includes neither EOB
nor EOR, the number of data items specified by address P are written.
Example
#8520 = Program number ;
#8521 = Block number;
#8522 = ASCII code string start number
G329P10;
IF [#8529 NE 0] GOTO 900; (Error check)
The command P for specifying the maximum number of write data items is the same as for the function
for writing a specified word-type block (G326).
NOTE
This command cannot register a program.
If an attempt is made to register a program (with "O" placed at the start of write
data), the error code (#8529=202) is posted.
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:
#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.
Specify <null> or integer 0 to 7 as the number of decimal places. If <null> is specified, an address with
no decimal place is assumed.
Example
If address code = A and value = 1.2345678:
- 231 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
If #8523 is 0, the least input increment at a specified address is used.
Special example
Usually in G325 and G326, 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.
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
G327 deletes a block specified using program and block numbers.
Example
#8520=4;
#8521=3;
G327;
IF [#8529 NE 0] GOTO 900;
Deletion completed
N900;
Error
Executing the above commands deletes block No. 3 from program O0004.
- 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).
- 232 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
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
The number of programs registered in the program memory of the CNC can be read using this variable.
NOTE
1 Variable #8527 cannot be written to.
2 The number of folders is also counted in the number of programs.
The free space of the CNC program memory can be read using this variable.
NOTE
Variable #8528 cannot be written to.
#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 already being edited.
10 A specified program has not been registered.
- 233 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
#8529 Description
11 An existing program number was specified .
12 The program file area has no free space.
13 Too many programs are registered (registration of an excessive number of programs).
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.
18 The setting of parameter No.3467 exceeds the valid range.
74 An incorrect program number was specified.
110 An attempt was made to write an out-of-range value (12 digits). (G326)
115 A macro variable number for editing is incorrect.
200 A specified character code cannot be found. (G329)
202 An attempt is made to write ”O” at the start. (G329)
The free space of the program is below the number of pages (500 bytes per page) specified for
203
compile parameter No. 9054. (G320, G326, G329)
In reading specified blocks, an attempt was made to read blocks the number of which exceeds the
210
maximum number of blocks that can be read.
A block number beyond the EOR block was specified. (The completion code is 251 if high-speed
211
reading is performed with -1 specified in block number variable #8521.)
251 An incorrect block number was specified.
An attempt was made to edit an address not found in the address code table. Or, the address is not
252
of the word type (address + value).
253 A specified block is not in word-type (address + value) format.
Program editing is disabled by the memory protection signal (KEY3) or the 8-level data protection
254
function. (When bit 1 (KEYC) of compile parameter No. 9006 is set to 0)
- An attempt was made to edit the main program or the running program.
255 - An attempt was made to edit a program being edited in the background.
- Bit 7 (EXT1) of compile parameter No. 9002 is set to 0.
6.9.5 Limitations
Foreground operation
Target folders in which NC programs are to be registered, deleted, and changed are
If parameter No. 3467 is set to 0
The default folder in the background.
If parameter No. 3467 is set to a value other than 0
Folder specified for parameter No. 3467 from the initial folder.
Thus, to run a created or edited program in the foreground, the program must be selected.
- 234 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- 235 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 236 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
When a preset operation is performed, a value less than one minute is discarded, and the values of the
parameters Nos. 6753 and 6754 are also preset.
Example 1
#100=#8553 ; → The cutting time is read into #100.
(When #100=5.755, the cutting time is 5 hours, 45 minutes,
and 18 seconds.)
#8553=0 ; → However, cutting time is preset to 0; the related parameters
(parameter Nos. 6753 and 6754) are also preset to 0.
Example 2
#8553=5.755 ; → A time period less than 1 minute is set to 0. So, 5.75 is set in
#8553. In this case, 0 is set in parameter No. 6753, and 345 is
set in parameter No. 6754.
NOTE
Switching on the power does not reset #8553 to 0.
Example
When, on a machine with 1st axis = X and 2nd axis = Y, bit 0 (NDTx) of
parameter No. 9026 for the 1st axis is set to 1:
1 G01 X_ Y_ F_;
#100 = #8554 ; → The cutting distance of the axis other than the 1st axis can
be read.
2 G17;
G02 X_ Y_ I_ J_ F_;
#100 = #8554 ; → The cutting distance of all axes including the 1st axis can
be read.
- 237 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
1 To use the cutting distance read and preset functions, the following settings are
required:
Bit 7 (EXT1) of compile parameter No.9002 = 1
Bit 7 (CUTLG) of compile parameter No.9004 = 1
2 Even if cutting is stopped by a reset, the travel distance of the block is added
because a tool move distance is added to #8554 at the start of cutting block
execution.
3 When the power is turned on, #8554 is not set to 0. The cumulative value is
clamped to 2147483648. Management by the user is requested.
#8998 Information ID 110 : Reading of the relative coordinates of the 1st controlled axis in the path
111 : Reading of the relative coordinates of the 2nd controlled axis in the path
112 : Reading of the relative coordinates of the 3rd controlled axis in the path
113 : Reading of the relative coordinates of the 4th controlled axis in the path
114 : Reading of the relative coordinates of the 5th controlled axis in the path
115 : Reading of the relative coordinates of the 6th controlled axis in the path
116 : Reading of the relative coordinates of the 7th controlled axis in the path
117 : Reading of the relative coordinates of the 8th controlled axis in the path
118 : Reading of the relative coordinates of the 1st to 24th controlled axes in
the path
#8997 Axis number : 1 to the maximum number of controlled axes in the path
(Usable only when #8998=118)
#8999 Relative coordinate
#8996 Completion code 0: Normal end.
-1: Abnormal end.
- 238 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
If the relative coordinate of the 1st axis is -123.456, executing the following steps
sets #500 with -123456.
#8998 = 118;
#8997 = 1; (acquires the information about the 1st axis)
#500 = #8999;
- Note
NOTE
1 If a value other than 1 to the maximum number of controlled axes in the path is
specified in #8997, the value read from #8999 is <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.
Example
To preset the relative coordinate of the 1st axis to -123.45, issue:
G310 A1 Q-123450 ;
or
G310 A110 Q-123450 ;
- Note
NOTE
1 If a value other than 1 to the maximum number of controlled axes in the path or
axis ID Nos. 110 to 117 in address A, or address A is not specified, the
specification of G310 is ignored.
2 The unit of address Q is the least input increment of the specified axis.
3 In an execution macro, the G310 block is executed as an NC statement.
However, by setting 1 in bit 4 (NOB) of parameter No. 9036, it is also possible to
execute it as a macro statement.
- 239 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
1) Clearing array-type variables and a sequence of variables (continuous writing of specified data)
2) Transferring from array-type variables or a sequence of variable to a sequence of variables
Each type of processing is performed by first defining an array, a sequence of variables, or data in each of
the following control variables, then issuing control code G315.
#8511 :
Source data
#8512 :
Source two-dimensional array number or the start variable number of a sequence of variables
#8513 :
Source three-dimensional array number
#8514 :
Destination two-dimensional array number or the start variable number of a sequence of
variables
#8515 : Destination three-dimensional array number
- Format
G315 P (processing code) K (number of data items to be processed);
P001 : Stores data from #8511 to K consecutive variables starting at the one specified in #8514.
(P1)
P002 : Transfers data from K consecutive variables starting at the one specified in #8512 to K consecutive
(P2) variables starting at the one specified in #8514 (transfer in ascending order).
P003 : Transfers data from K consecutive variables starting at the one specified in #8512 to K consecutive
(P3) variables starting at the one specified in #8514 (transfer in descending order).
P101 : Stores data from #8511 to K consecutive array-type variables starting at array-type variable #1
specified in #8514 and #8515.
P102 : Transfers data from K consecutive array-type variables starting at array-type variable #1 specified in
#8512 and #8513 to K consecutive array-type variables starting at array-type variable #1 specified in
#8514 and #8515 (ascending order).
P103 : Transfers data from K consecutive array-type variables starting at array-type variable #1 specified in
#8512 and #8513 to K consecutive array-type variables starting at array-type variable #1 specified in
#8514 and #8515 (descending order).
Each process code consists of three digits and specifies the type of processing to be performed. Leading
zeros are omissible.
A difference between P2 and P3 and between P102 and P103 is whether a transfer progresses from a
small variable number to a large or from a large to a small.
Example
If #8512 = 10000 and #8514 = 10010,
G315 P2 K3; is equivalent to the following steps:
#10010 = #10000
#10011 = #10001
#10012 = #10002, and
G315 P3 K3; is equivalent to the following steps:
#10012 = #10002
#10011 = #10001
#10010 = #10000
- 240 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Variables #1 to #99 are used to reference the P-CODE variables by previously specifying array types
using array control variables #8516 to #8519, then specifying the target array numbers using #8512 and
#8513.
The P-CODE variables are associated with the array elements as shown below.
Example
If #8516 = 10, #8517 = 5, and #8519 = 10100,
(1) #1 with #8512 = 1 and #8513 = 1 specified corresponds to #10100.
(2) #10 with #8512 = 3 and #8513 = 2 specified corresponds to #10179.
When the power is turned on, each array control variable is set up as follows:
#8512 to #8517 = 1 and #8519 = 10000
So, when using P-CODE variables as two-dimensional arrays, you need not beware of #8513 and #8517.
NOTE
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
turned on, #8518 is set to 0.
Caution
CAUTION
No check is made on any variable and calculated variable number for validity.
Use a macro program to make validity checks if necessary.
- 241 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
To set the torque limit override value of the 3rd axis to 50%, set the variables in
the order shown below.
#8990 = 100 .......Write operation specification
#8991 = 3 ...........3rd axis specification
#8992 = 127 .......Override value specification
Caution
CAUTION
1 When the power is turned on, the torque limit override value for each axis is set
to 100%.
2 In the case of an execution macro, if an attempt is made to specify a value
outside the range of 1 to the maximum number of intra-path controlled axes in
#8991 or a value outside the range of 0 to 255 in #8992, alarm PS110 occurs.
- 242 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Parameter
#7 #6 #5 #4 #3 #2 #1 #0
6286 TQO
#0 TQO Specifies whether to enable the torque limit override function, as follows:
0: Disable (100% override)
1: Enable
WARNING
1 PMC axis control must be executed while the PMC controlled-axis selection
variable(#8700) or controlled axis selection signals EAX1 to EAX8 are "1".
If PMC controlled-axis selection variable(#8700) and controlled axis selection
signals EAX1 to EAX8 are "0", the command cannot be accepted.
Therefore, the machine may behave in an unexpected manner.
2 PMC axis control is able to command by PMC ladder and macro executor.
In case of use PMC axis control, “controlled axis selection” and “PMC axis
control command”, use the same command method. If you use the different
command method to “controlled axis selection” and “PMC axis control
command”, “PMC axis control command” may be ignored, or the command may
execute incorrect axis motion. Therefore, the machine may behave in an
unexpected manner.
6.14.1.1 General
A PMC axis control interface can be used to control the PMC controlled axis. The following eight
different control codes are available. Which PMC controlled axis to control is to be specified using the
PMC controlled group selection variable (#8602) and the PMC controlled-axis selection variable (#8700).
- 243 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
NOTE
1 If an integer out of a range between 0 and 39 is specified in #8602, the control
command is ignored.
2 When the power is turned on, #8602 = 0.
#31………………………………………………………#1#0
#8700
1st axis
2nd axis
:
32nd axis
- 244 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
1 In a 2-path system with 3-axis machines for both paths, to select the 1st axis of
the 2nd path from the 2nd path, specify the following:
• If bit 7 (PMX16) of compile parameter No. 9160 is set to 0, specify the system
common 4th axis.
#8700 = 16
• If bit 7 (PMX16) of compile parameter No. 9160 is set to 1, specify the 1st
axis in the path.
#8700 = 1
2 To set the 1st or 3rd axis as a target axis, variable #8700 can be set to 5 (= 1 +
4). To set the 1st, 16th, or 24th axis as a target axis, the following can also be
specified.
#100=2
#1=1-1
#16=16-1
#24=24-1
#101=POW[#100,#1] ; 1st axis
#116=POW[#100,#16] ; 16th axis
#124=POW[#100,#24] ; 24th axis
#8700=#101+#116+#124
NOTE
1 If specifying an axis number with variable #8700, set controlled axis selection
signals EAX1 to EAX8 <G136> to 0. Otherwise, the logical sum of controlled axis
selection signals EAX1 to EAX8 <G136> and #8700 is assumed.
<Example>
If EAX1 is set to 1, and #8700 is set to 2, the 1st and 2nd axes are target
controlled axes.
2 If parameter No. 8010 does not relate the group and axis specified by #8602 and
#8700, the control command is ignored. When 0 is specified in #8700, however,
only the axis specified by controlled axis selection signals EAX1 to EAX8
<G136> is controlled.
3 When the power is turned on, #8700 = 0.
- Explanation
This command specifies rapid traverse for the PMC controlled axis. Address X specifies a travel distance
always in incremental mode.
This command performs the same operation as "G00" of CNC.
- 245 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 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.
This command performs the same operation as "G94 G01" (in T series G code system A, "G98 G01") of
CNC.
- Explanation
This command specifies dwell for the PMC controlled axis. Address P or X specifies a dwell value.
This command performs the same operation as "G04" of CNC.
- Explanation
This command specifies a reference position return for the PMC controlled axis.
After moving by rapid traverse in the reference position return direction set by bit 5 (ZMIx) of parameter
No. 1006, this command performs the same operation as the manual reference position return function of
the CNC.
- Explanation
This command specifies an auxiliary function for the PMC axis control interface. Address M specifies an
auxiliary function code.
This command performs the same operation as an auxiliary function of the CNC.
- Explanation
This command reads into the variable the variable number of which is specified at address P the states of
the output signals <F130, F133, F136, F139> of the corresponding PMC axis control interface.
#7 #6 #5 #4 #3 #2 #1 #0
EBSYg#p EOTNg#p EOTPg#p EGENg#p EDENg#p EIALg#p ECKZg#p EINPg#p
A group number is represented by a combination of g and p.
Range of g: 1 to 4
Range of p: 1 to 10
Group number = g + (p-1) × 4
- 246 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
<1> EBSYg#p (Axis control command read completion signal)
This signal indicates that the CNC has read PMC axis control command data for one block and
stored it in a buffer.
Example
When EDENg#p = 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.
The states of the input signals <G142, G154, G166, G178> of the PMC do not change.
#7 #6 #5 #4 #3 #2 #1 #0
EBUFg#p ECLRg#p ESTPg#p ESOFg#p ESBKg#p EMBUFg#p ECKZg#p EFINg#p
A group number is represented by a combination of g and p.
Range of g: 1 to 4
Range of p: 1 to 10
Group number = g + (p-1) × 4
- 247 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
When ECLRg#p = 1:
G349 P64; (64 = 01000000b)
NOTE
EBUFg#p (Axis control command read signal), ESOFg#p (Servo off signal),
ECKZg#p (Following zero check signal), and EFINg#p (Auxiliary function
completion signal) in the input signals <G142, G154, G166, G178> cannot be
written.
- 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.
6.14.1.3 Limitations
Command buffering
PMC 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 G3xx
causes buffering; so the EBSYg#p (axis control command read completion signal) is not needed.
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.
Up to four groups can be controlled per path, and the relationships between control variables and groups
are as given in Table 6.14.2.1 (a). To specify an axis number, use variable #8700, PMC controlled-axis
selection variable, as in PMC axis control using G code.
- 248 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
As four groups (4p-3) to (4p), it can be selected with the setting of bit 7 (PMX16) of compile parameter
No. 9160 whether to use groups 1 to 4 universally regardless of the path or to use groups 1 to 40
depending on the path.
Bit 7 (PMX16) compile (4p-3) group (4p-2) group (4p-1) group (4p) group
Path
parameter No.9160 #8710~#8715 #8720~#8725 #8730~8735 #8740~#8745
Path 1
Path 2
=0 Group 1 Group 2 Group 3 Group 4
:
Path 10
Path 1 Group 1 Group 2 Group 3 Group 4
Path 2 Group 5 Group 6 Group 7 Group 8
=1
: : : : :
Path 10 Group 37 Group 38 Group 39 Group 40
#31………………………………………………………#1#0
#8700
1st axis
2nd axis
:
32nd axis
- 249 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example
1 In a 2-path system with 3-axis machines for both paths, to select the 1st axis of
the 2nd path from the 2nd path, specify the following:
• If bit 7 (PMX16) of compile parameter No. 9160 is set to 0, specify the system
common 4th axis.
#8700 = 16
• If bit 7 (PMX16) of compile parameter No. 9160 is set to 1, specify the 1st
axis in the path.
#8700 = 1
2 To set the 1st or 3rd axis as a target axis, variable #8700 can be set to 5 (= 1 +
4). To set the 1st, 16th, or 24th axis as a target axis, the following can also be
specified.
#100=2
#1=1-1
#16=16-1
#24=24-1
#101=POW[#100,#1] ; 1st axis
#116=POW[#100,#16] ; 16th axis
#124=POW[#100,#24] ; 24th axis
#8700=#101+#116+#124
NOTE
1 For selection of a controlled axis, #8700 (PMC controlled-axis selection variable)
is to be set.
2 If specifying an axis number with variable #8700, set controlled axis selection
signals EAX1 to EAX8 <G136> to 0. Otherwise, the logical sum of controlled axis
selection signals EAX1 to EAX8 <G136> and #8700 is assumed.
<Example>
If EAX1 is set to 1, and #8700 is set to 2, the 1st and 2nd axes are target
controlled axes.
3 If parameter No. 8010 does not relate the group and axis specified by #8602 and
#8700, the control command is ignored. When 0 is specified in #8700, however,
only the axis specified by controlled axis selection signals EAX1 to EAX8
<G136> is controlled.
4 When the power is turned on, #8700 = 0.
- 250 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
#7 #6 #5 #4 #3 #2 #1 #0
EC6x EC5x EC4x EC3x EC2x EC1x EC0x
x represents a group number from 1 to 4.
#7 #6 #5 #4 #3 #2 #1 #0
EIF7x EIF6x EIF5x EIF4x EIF3x EIF2x EIF1x EIF0x
EIF15x EIF14x EIF13x EIF12x EIF11x EIF10x EIF9x EIF8x
x represents a group number from 1 to 4.
#7 #6 #5 #4 #3 #2 #1 #0
EID7x EID6x EID5x EID4x EID3x EID2x EID1x EID0x
EID15x EID14x EID13x EID12x EID11x EID10x EID9x EID8x
EID23x EID22x EID21x EID20x EID19x EID18x EID17x EID16x
EID31x EID30x EID29x EID28x EID27x EID26x EID25x EID24x
x represents a group number from 1 to 4.
Travel distance units depend on bit 5 (TDVDPI) of compile parameter No. 9160:
=0 : Calculator type decimal point input
=1 : Least input increment
PMC state signal read variables (#8715, #8725, #8735, and #8745)
To a PMC state signal read variable (#8715, #8725, #8735, and #8745), the corresponding state signal
<F130, F133, F136, and F139> of the PMC axis control interface is written.
To a variable, one-byte signal interface data is assigned in decimal format.
#7 #6 #5 #4 #3 #2 #1 #0
EBSYx EOTNx EOTPx EGENx EDENx EIALx ECKZx EINPx
x represents a group number from 1 to 4.
- 251 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
6.14.3 Caution
CAUTION
1 An auxiliary function can be specified using "G346". However, the auxiliary
function strobe signal "EMFg#p" cannot be controlled with a conversational
macro. Control the signal from the PMC.
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 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 ECLRg#p to
1).
- 252 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
#100 : State variable
#100<>1 : Regular state
A trigger event is monitored. Upon detection of a trigger event, a move
command is output, setting 1 in #100.
#100=1 : Axis moving
The program waits for the move to complete. Upon completion, an error
check is made and the value of #100 is returned to 0.
Example
IF[ [#87x0 AND 128] NE [#87x5 AND 128] ] GOTO 999
IF[ [#87x5 AND 18] NE 0 ] GOTO 999 → Moving
IF[ [#87x5 AND 1] NE 1] GOTO 999
Move completed
Sample program
• Moving the axis by 100 mm when the state of the signal (R100.0) changes from OFF to ON
#100 : State variable
#101 : R100.0 OFF→ON Monitoring variable
#102 : Target position arrival check variable
In both of following (1) and (2) conditions, alarm is detected by PMC axis control command.
State of PMC controlled-axis selection variable (#8700) or Controlled axis selection signals EAX1 to
EAX8 <Gn136> of the other group does not affect.
(1) Controlled axis selection signals EAX1 to EAX8 <Gn136> of commanded group is set to 0.
(2) PMC controlled-axis selection variable (#8700) of commanded group is set to 0.
Alarm DS1451 is detected in the path that belongs to group of PMC axis control. Automatic operation of
the path is stopped, operation of PMC axis control of the group is stopped. Further, in the alarm signal
AL<Fn001.0> and alarm signal EIALg <F130.2, F133.2, F136.2, F139.2> is set to 1. If PMC axis control
command from the different path, stop the automatic operation by setting the bit 1 (IAL) of parameter
No.8100 to 0.
6.15.1 General
The following types of file control can be performed with the conversational macro and execution macro.
1. Generating a file
2. Deleting a file
3. Reading data
4. Writing data
NOTE
The file control can not be performed with the auxiliary macro.
,
1. While holding down the and . MDI keys, switch on the power.
2. When the IPL monitor screen, below, appears, press the 7 and keys, and select "7.
MACRO COMPILER UTILITY".
- 254 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
IPL MENU
0. END IPL
1. DUMP MEMORY
3. CLEAR FILE
4. MEMORY CARD UTILITY
5. SYSTEM ALARM UTILITY
6. FILE SRAM CHECK UTILITY
7. MACRO COMPILER UTILITY
?
When the macro compiler utility screen, below, appears, press the 2 and keys, and
select "2. USER FILE SETTING".
MACRO COMPILER UTILITY MENU
0. END
1. USER FILE INFORMATION
2. USER FILE SETTING
3. USER FILE FORMAT
?
4. According to the displays, specify the size of the user file area and the number of files that can be
generated in the user file area.
MODIFY DATA :
USER FILE AREA SIZE = ?
NUMBER OF USER FILE = ?
If you want to change the data, enter the desired value, and press the key. If you do not want
to change the data, enter nothing and press the key. If you want to cancel the setting, press
the key.
5. When setting ends, the following message is displayed.
• If the setting has not been changed:
"DATA NOT CHANGED" is displayed.
• If setting has been completed normally:
The new setting is displayed in the same manner as at step 4, and "DATA SETTING END" is
displayed.
• If an invalid value has been specified:
"SETTING ERROR" is displayed and followed by a description of the cause of the error.
6. Pressing the key displays the macro compiler utility screen again.
7. After user file area setup is completed normally, perform formatting.
In the macro compiler utility screen, press the 3 and keys, and select "3. USER FILE
FORMAT".
8. When "USER FILE FORMAT OK? [Y/N]" is displayed, press the key.
9. When formatting ends normally, "USER FILE FORMAT: END" is displayed.
- 255 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
10. Pressing the key displays the macro compiler utility screen again.
12. When you return to the IPL monitor screen, press the 0 and keys, and select "0. END
IPL".
13. The IPL monitor screen is exited, and a usual screen appears.
If you want to check only the present settings of the user file, press the 1 and keys on
the macro compiler utility screen, and select "1. USER FILE INFORMATION".
6.15.3 Setting
The relationships among the user file area, the number of files that can be generated in the user file area,
and the size actually assigned to data areas are as described below:
1. The number of files that can be generated in the user file area must be a multiple of 16. If a specified
value is not a multiple of 16, it is rounded up to the nearest multiple of 16.
2. The size of the user file area must satisfy the following condition.
User file area size ≥ (1 + the number of files that can be generated in the user file area + the number
of files that can be generated in the user file area/16)
3. The size actually allotted to data areas (in bytes) is calculated by the following expression.
Allotted size = [{user file area size - (1 + the number of files that can be generated in the user file
area/16)} × 496] [bytes]
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.
Example
[Example of setup]
<1> • User file area = 18
• If the number of files that can be generated in the user file area = 16, the
size that can be allotted is:
[{18 - (1 + 16/16)} × 496 ] = 7936 [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/16)} × 496] = 47616 [bytes]
- 256 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Deleting a file
Function This command deletes a file.
Format FDEL (file-number, status-variable number)
Explanation The <file-number> parameter specifies a file to be deleted. See Table 6.15.6 (a) for the
values that can be used as file numbers.
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.15.6 (e) for the status values.
Only the macro variable and the numerical value can be described in the specification of
the <file-number> and the <status-variable-number>.
The common variable and the P-CODE variable can be used as the macro variable.
Caution A file that is open cannot be deleted.
Sample statement FDEL (200,100)
This statement deletes file No. 200. The result of executing the statement is returned to
macro variable #100.
FDEL (#600,100)
This statement deletes file No. #600. The result of executing the statement is returned to
macro variable #100.
- 257 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
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.15.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.15.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.15.6 (e) for the status values.
This status variable number is valid also for FCLOS, FREAD, FWRIT, and FPSET.
Only the macro variable and the numerical value can be described in the specification of the
<file-number>, the <access-mode>, and the <status-variable-number>.
The common variable and the P-CODE variable can be used as the macro variable.
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 statement FOPEN (200,1,100)
This statement opens file No. 200 in both write and read modes. The result of executing the
statement is returned to macro variable #100.
FOPEN (#600,1,100)
This statement opens file No. #600 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.15.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.15.6 (e) for the status values.
Only the macro variable and the numerical value can be described in the specification of the
<file-number>.
The common variable and the P-CODE variable can be used as the macro variable.
Sample statement FCLOS (200)
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.
FCLOS (#600)
This statement closes file No. #600. The result of executing this statement is returned to the
status variable number specified when the file was opened.
- 258 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- 259 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
6.15.6 Caution
CAUTION
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.
NOTE
In the file control command, the following descriptions cannot be used.
• Use of space (Example: FGEN(400,4800, 13000)
• Use of symbol definition (Example: FGEN(400,4800,_RET_CODE)
- 260 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Value Description
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.
Each digit of the binary numbers assigned to #8600, #8601, #8607, and #8608 corresponds to the
movement axis and its direction. In addition, #8600 and #8601 support the 1st to 16th axes, and #8607
and #8608, the 17th to 24th axes.
Example
1 If #8600 and #8601 have a binary number of 1000000000000001, they indicate
the positive direction of the 1st axis (AX1+) and the negative direction of the 8th
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 17th axis (AX17+) and the negative direction of the
24th axis (AX24-). This binary number is equivalent to 32769 in decimal.
Even if this function is not used for the 17th axis and those assigned a higher axis number, not only #8600
but also #8607 must be 0. #8601 and #8608 reflect the axes that are caused to stop when the skip signal
becomes on and the direction in which the axes were moving just before they stopped. These control
variables retain the information until the skip signal is turned off and on again. Interlock is kept applied to
the axes and directions that correspond to the values of the control variables. To release interlock, turn off
the PMC internal relay (R area).
If either #8600 or #8607 is not 0, interlock is applied to the axes and directions indicated by #8600 or
#8607.
#8600 corresponds to the 1st to 16th controlled axes in a path, and #8607 corresponds to the 17th to 24th
controlled axes in a path.
NOTE
Set data in #8607 and #8600 in the stated sequence. Interlock begins when data
is set in #8600.
Consider the following example.
#8607=32769; ....(Positive direction of the 17th axis, negative direction of the 24th
axis)
#8600=1; ............(Positive direction of the 1st axis) → At this point, interlock is
applied to the 1st, 17th,
and 24th axes.
To release interlock, reset #8600 and #8607 to 0, or turn off the PMC internal relay (R area) to reset these
control variables to 0. Immediately after the power is switched on, or when the axis-direction-by-
axis-direction interlock function is disabled (parameter bit 0 (XIT) of parameter No. 9035 = 0 or the PMC
internal relay (R area) is off), #8600 and #8607 are 0.
Movement axis and direction variables for the rise time of the skip signal
(#8601 and #8608)
When the state of the skip signal is changed from off to on, #8601 and #8608 indicate the axis that moved
most recently and the direction of its movement.
The skip signal is one of the signals shown below, depending on bit 6 (SKX) of parameter No. 9035.
When bit 6 (SKX) of parameter No.9035 is set to 0;
SKIPP<Gn006.6>
When bit 6 (SKX) of parameter No.9035 is set to 1;
• SKIP<X004.7> (when the 1st PMC is used)
SKIP<X013.7> (when the 2nd PMC is used)
SKIP<X011.7> (when the 3rd PMC is used)
• By setting bit 2 (XSG) of parameter No. 3008 and parameter No. 3012, it is possible to map the skip
signal to an arbitrary X address.
#8601 corresponds to the 1st to 16th controlled axes in a path, and #8608 corresponds to the 17th to 24th
controlled axes in a path.
#8601 and #8608 retains their values until the state of the skip signal changes from off to on again. When
the PMC internal relay (R area) is turned off, both #8601 and #8608 are reset to 0, thereby disabling this
function.
- 262 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
NOTE
Any value can be written to neither #8601 nor #8608.
6.17.1 General
The window function enables referencing of the following system information:
1. Alarm information and external alarm information
2. Relative coordinates, servo motor load current value, positional deviation value
3. Run hour and parts count
4. Diagnosis information
5. System series information, servo series information, and PMC series information
Method of using
Set #8998 with the ID No. of the system information to be referenced.
If the system information depends on the controlled axis or spindle, set #8997 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).
- 263 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Example 1
Alarm information
(1) PS alarm monitoring
#8998=1 ; → The system information ID for alarms is 1.
#500=#8999 ; → Acquires alarm information.
#500=#500 AND 8 ; → Checks for a PS alarm condition.
IF[#500EQ0]GOTO 90 ;
#8998=11 ; → The system information ID for PS alarms is 11.
#500=#8999 ; → Acquires a PS 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) OT alarm monitoring
(Monitoring of + direction stored stroke limit 1 on the 1st axis in the path)
#8998= 28 ; → The ID for axis-type OT alarm flag 1 is 28.
#8997= 1 ; → Axis number (1st axis)
#500=#8999 ; → Acquires the contents of ID No. 28.
#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.
Example 2
Parts total
#8998=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 #8998 is invalid, or
• The value entered in #8997 exceeds the maximum number of controlled axes
in the path or the maximum number of spindles in the path.
- 264 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- 265 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 266 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
ID No. Axis ID No. Information
(#8998) (#8997)
10043 - Diagnosis data No.43
10308 1 to maximum number of controlled axes in the path Diagnosis data No.308
10309 1 to maximum number of controlled axes in the path Diagnosis data No.309
10361 1 to maximum number of controlled axes in the path Diagnosis data No.361
10379 - Diagnosis data No.379
10403 1 to maximum number of spindles in the path Diagnosis data No.403
10410 1 to maximum number of spindles in the path Diagnosis data No.410
10411 1 to maximum number of spindles in the path Diagnosis data No.411
10445 1 to maximum number of spindles in the path Diagnosis data No.445
10552 1 to maximum number of controlled axes in the path Diagnosis data No.552
10710 1 to maximum number of spindles in the path Diagnosis data No.710
10712 1 to maximum number of spindles in the path Diagnosis data No.712
10750 1 to maximum number of controlled axes in the path Diagnosis data No.750
10752 1 to maximum number of controlled axes in the path Diagnosis data No.752
10764 1 to maximum number of controlled axes in the path Diagnosis data No.764
11110 to - Option information items Nos. 1110 to 1115 on
11115 the diagnosis screen
(Non-bit-type option information items)
11120 to - Option information items Nos. 1120 to 1294 on
11294 the diagnosis screen
(Bit-type option information items)
11701 1 to maximum number of controlled axes in the path Diagnosis data No.1701
11703 1 to maximum number of spindles in the path Diagnosis data No.1703
13500 1 to maximum number of controlled axes in the path Diagnosis data No.3500
13570 - Diagnosis data No.3570
13700 1 to maximum number of controlled axes in the path Diagnosis data No.3700
13701 1 to maximum number of controlled axes in the path Diagnosis data No.3701
14001 1 to maximum number of controlled axes in the path Diagnosis data No.4001
16507 - Diagnosis data No.6507
SW alarm : When this bit is 1, it means that the SW alarm flag is set with data.
PW alarm : When this bit is 1, it means that the PW alarm flag is set with data.
IO alarm : When this bit is 1, it means that the IO alarm flag is set with data.
PS/SR/MC alarm : When this bit is 1, it means that the PS, SR, or MC alarm flag is set with data.
OT alarm : When this bit is 1, it means that the OT alarm flag is set with data.
OH alarm : When this bit is 1, it means that the OH alarm flag is set with data.
SV alarm : When this bit is 1, it means that the SV alarm flag is set with data.
SP alarm : When this bit is 1, it means that the SP alarm flag is set with data.
External alarm : When this bit is 1, it means that the external alarm flags (1 to 4) are set with data.
Example
If the PS alarm and external alarm have occurred, 32776 (8008h) is output to
#8999.
- 268 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
- Bit information
Overheat alarm
ID No. 5 provides details of an overheat alarm by outputting a number from 0 to 255 as one-byte bit
information.
OH alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OH700
02h ----------
04h ----------
08h ----------
5
10h OH701
20h ----------
40h ----------
80h ----------
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT500 (1st axis)
02h OT500 (2nd axis)
04h OT500 (3rd axis)
08h OT500 (4th axis)
20
10h OT500 (5th axis)
20h OT500 (6th axis)
40h OT500 (7th axis)
80h OT500 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT501 (1st axis)
02h OT501 (2nd axis)
04h OT501 (3rd axis)
08h OT501 (4th axis)
21
10h OT501 (5th axis)
20h OT501 (6th axis)
40h OT501 (7th axis)
80h OT501 (8th axis)
- 269 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT502 (1st axis)
02h OT502 (2nd axis)
04h OT502 (3rd axis)
08h OT502 (4th axis)
22
10h OT502 (5th axis)
20h OT502 (6th axis)
40h OT502 (7th axis)
80h OT502 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT503 (1st axis)
02h OT503 (2nd axis)
04h OT503 (3rd axis)
08h OT503 (4th axis)
23
10h OT503 (5th axis)
20h OT503 (6th axis)
40h OT503 (7th axis)
80h OT503 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT504 (1st axis)
02h OT504 (2nd axis)
04h OT504 (3rd axis)
08h OT504 (4th axis)
24
10h OT504 (5th axis)
20h OT504 (6th axis)
40h OT504 (7th axis)
80h OT504 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT505 (1st axis)
02h OT505 (2nd axis)
04h OT505 (3rd axis)
08h OT505 (4th axis)
25
10h OT505 (5th axis)
20h OT505 (6th axis)
40h OT505 (7th axis)
80h OT505 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT506 (1st axis)
02h OT506 (2nd axis)
04h OT506 (3rd axis)
08h OT506 (4th axis)
26
10h OT506 (5th axis)
20h OT506 (6th axis)
40h OT506 (7th axis)
80h OT506 (8th axis)
- 270 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT507 (1st axis)
02h OT507 (2nd axis)
04h OT507 (3rd axis)
08h OT507 (4th axis)
27
10h OT507 (5th axis)
20h OT507 (6th axis)
40h OT507 (7th axis)
80h OT507 (8th axis)
OT alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h OT500
02h OT501
04h OT502
08h OT503
28
10h OT504
20h OT505
40h OT506
80h OT507
SV alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h ----------
02h SV401
04h ----------
08h ----------
30
10h SV404
20h ----------
40h ----------
80h ----------
- 271 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
SV alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h ----------
02h SV401
04h ----------
08h ----------
37
10h SV404
20h ----------
40h ----------
80h ----------
SV alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h SV411
02h SV413
04h SV415
08h ----------
41 to 48
10h ----------
20h SV410
40h ----------
80h SV417
SV alarm flag
ID No. (#8998) Bit information (#8999) Alarm number
01h SV411
02h SV413
04h SV415
08h ----------
49
10h ----------
20h SV410
40h ----------
80h SV417
- 272 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
The load current value determined with the above calculation formula is the one for the maximum current
value of the motor. Thus, it is lower than the continuous rated current value of the motor that is displayed
on the servo adjustment screen, etc.
NOTE
If the motor used is not found in this table, refer to the maximum current of the
applicable servo amplifier contained in the specifications of the motor used.
- 274 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Diagnosis Information
ID No. (#8998) Bit information (#8999) Meaning
01h ---------------------------------------------
02h ---------------------------------------------
04h ---------------------------------------------
08h Inposition check
700
10h Feedrate override 0%.
20h Inter/Start Lock on
40h Speed Arrival on
80h ---------------------------------------------
Diagnosis Information
ID No. (#8998) Bit information (#8999) Meaning
01h ---------------------------------------------
02h ---------------------------------------------
04h ---------------------------------------------
08h ---------------------------------------------
701
10h Jog Feed Override 0%
20h ---------------------------------------------
40h ---------------------------------------------
80h ---------------------------------------------
Following diagnosis data can be read. The read data follow the specification of each diagnosis data.
ID No.
Diagnosis data No. Meaning
(#8998)
10043 43 Number of the current display language of the CNC screen
10308 308 Servo motor temperature
10309 309 Pulsecoder temperature
10361 361 Compensation pulses (NC)
10379 379 Test number of an MCC off Test
10403 403 Spindle motor temperature
10410 410 Spindle load meter indication
10411 411 Spindle motor speed indication
10445 445 Position data of position coder
10552 552 Error between semi-closed and closed loops
10710 710 Spindle error state
10712 712 Spindle warning state
10750 750 OVC level
10752 752 DC link voltage information
10764 764 Inertia estimation value
11701 1701 Servo leakage resistance data
11703 1703 Spindle leakage resistance data
13500 3500 Synchronization error amount
13570 3570 Wrong operation prevention function
13700 3700 Sequence number of a brake test
13701 3701 Cause of the interruption of a brake test
14001 4001 Belonging path of axis in flexible path axis assignment
16507 6507 Active machine configuration set No.
- 275 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
- 276 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
Assume the following for a system of series G003 and edition 0001:
#8998=8000 ;
#500=#8999 ; → Saves system series information digit 4
#8998=8001 ;
#501=#8999 ; → Saves system series information digit 3
#8998=8002 ;
#502=#8999 ; → Saves system series information digit 2
#8998=8003 ;
#503=#8999 ; → Saves system series information digit 1
#8998=8005 ;
#504=#8999 ; → Saves system edition information digit 4
#8998=8006 ;
#505=#8999 ; → Saves system edition information digit 3
#8998=8007 ;
#506=#8999 ; → Saves system edition information digit 2
#8998=8008 ;
#507=#8999 ; → Saves system edition information digit 1
Assume the following for a system of series G003 and edition 0001:
#500 = 71 ‘G’ 4th digit of system series information
#501 = 48 ‘0’ 3rd digit of system series information
#502 = 48 ‘0’ 2nd digit of system series information
#503 = 51 ‘3’ 1st digit of system series information
#504 = 48 ‘0’ 4th digit of system edition information
#505 = 48 ‘0’ 3rd digit of system edition information
#506 = 48 ‘0’ 2nd digit of system edition information
#507 = 49 ‘1’ 1st digit of system edition information
- 277 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Format
Input
#8650 : 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
NOTE
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
#20000
#8650=20000 ;
#8651=10 ;
#8652=400 ;
Set 0 #8653=10.5 ;
#8654=11.5 ;
G400 ;
#20010 #100=#8655 ;
With the above steps, this function searches the data table shown at the
left, in which the first control variable begins with #20000 and ten control
variables form one set, for a control 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
Set 1 control variable is found, -1 is returned.
- 278 -
B-63943EN-2/07 6.MACRO EXECUTOR FUNCTION
Example
If the previous sample program is combined with array-type references:
#8513=1 ;
#8516=10 ; *1)
#8517=1 ;
#8518=1 ; *2)
#8519=20000 ; *3)
#8650=20000 ;
#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 ;
NOTE
*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.
- 279 -
6.MACRO EXECUTOR FUNCTION B-63943EN-2/07
Note
NOTE
1 This function is valid only with the conversational 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
P-CODE macro variable.
- 280 -
B-63943EN-2/07 7.DEBUGGING FUNCTION
7 DEBUGGING FUNCTION
7.1 GENERAL
The debugging function allows debugging of conversational macros and auxiliary macros. When the
conversational macro function is executed, the debugger starts, displaying a debugger screen on the
conversational macro screen. The debugger has the following functions:
Single-block execution and break conditions can also be set directly by pressing an appropriate key
instead of setting from the debugger screen.
NOTE
1 When using the debugging function, set bit 0 (DBG) of parameter No. 9033 to 1.
2 When the debugging function is used, entering data from the keyboard displays
the data in the data input line even if the content of the data input control
variable (#8502) is 0.
3 With a machine whose MDI keyboard is a small one, the debugging function
cannot be used.
(From a small keyboard, it is not possible to enter the input mode of the
debugger screen.)
- 281 -
7.DEBUGGING FUNCTION B-63943EN-2/07
Debugger screen
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.
ccccc : Error No.
When there is no error, 0 is indicated. For details of errors, refer to Appendix A, "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
- 282 -
B-63943EN-2/07 7.DEBUGGING FUNCTION
Sequence number by which a break is caused
Number of blocks by which a break is caused
Repeat 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.
NOTE
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.
computer function, press and soft key [F3]. For details of soft key [F3], see Section 6.2, "Key
Input and Data Input Control".)
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.
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 . Pressing selects the conversational
macro and auxiliary macro alternately.
- 283 -
7.DEBUGGING FUNCTION B-63943EN-2/07
Immediately after power is turned on, the conversational macro is initially selected. Later, the target set
with the debugger is selected.
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 to set ON. To reset the setting to OFF, press again. When the setting is changed to
ON during P-CODE macro execution, the execution stops. To re-execute the macro, press and
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 . Next, move the cursor to OFF in the break condition field. Press
to change the setting to ON. To reset the setting to OFF, press again. To re-execute the P-CODE
The relationship among break conditions is shown in the figure below. When the status of the P-CODE
macro being executed matches the break conditions, the execution of the P-CODE macro is stopped.
When 0 is set in a break condition, that condition is excluded from the break conditions.
Program No.
AND
Sequence No.
OR
AND
Stop
Number of blocks
Repeat count
NOTE
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.
- 284 -
B-63943EN-2/07 7.DEBUGGING FUNCTION
NOTE
When the target is a conversational macro, an execution restart automatically
causes key input to switch from the debugger to conversational macro.
NOTE
Input of EMPTY is not allowed.
(3) When and are pressed without inputting any break condition, the break function is
disabled (OFF).
(With personal computer function, press and soft key [F5].)
- 286 -
B-63943EN-2/07 8.OPERATION
8 OPERATION
8.1 DISPLAYING AND SETTING MACRO VARIABLE VALUES
In addition to the custom macro variable screen, an execution macro variable screen, conversational
macro variable screen, and auxiliary macro variable screen (hereinafter collectively called the P-CODE
macro variable screen) are provided.
This screen is used to display and set the values of the variables listed below.
For details of the individual variables, see Chapter 5, "MACRO VARIABLES".
NOTE
The display of local variables of custom macro and execution macro on the
macro variable screen can be switched as follows according to bit3 (LVD) of
parameter No.24306.
- In case of bit3 (LVD) of parameter No.24306 is 0.
Local variables of custom macro and execution macro display common value.
- In case of bit3 (LVD) of parameter No.24306 is 1.
Local variables of custom macro and execution macro display separate
value. (FS16i compatible specification)
- 287 -
8.OPERATION B-63943EN-2/07
- 288 -
B-63943EN-2/07 8.OPERATION
- 289 -
8.OPERATION B-63943EN-2/07
NOTE
Variable names are displayed only when bit 2 (MV2) of parameter No. 9034 is set
to use custom common variables as P-CODE macro common variables as well
and bit 5 (VRN) of parameter No. 3207 is set to display variable names.
Variable values
Depending on the condition, variable values are displayed as follows.
Condition Variable value display
When the macro variable value is empty "DATA EMPTY" is displayed.
When the macro variable is write enabled The field is displayed in yellow reverse video.
When the macro variable is read protected or unusable The field is blank.
If the operation results in a variable value that cannot be displayed, the following is displayed.
Variable value range Variable value display
0 < Variable value < +0.00000000001 + Underflow
-0.00000000001 < Variable value < 0 - Underflow
999999999999 < Variable value + Overflow
Variable value < -999999999999 - Overflow
Mode setting
Set the MDI mode.
NOTE
The mode restriction can be disabled by using bit 6 (MCM) of parameter No.
3290.
Cursor movement
Move the cursor to the macro variable whose value is to be set.
Method 1
- 290 -
B-63943EN-2/07 8.OPERATION
Move the cursor by pressing page keys and/or and cursor keys , , ,
and/or .
Method 2
(1) Enter the number of the macro variable.
(2) Press soft key [NO.SRH].
"EMPTY" input
(1) Move the cursor to the macro variable for which "DATA EMPTY" is to be displayed.
(2) Press soft key [INPUT].
- Mode setting
Set the EDIT mode.
NOTE
During an emergency stop, the macro variables can be output regardless of the
mode.
- Output procedure
Press soft key [(OPRT)].
Press the continuous menu key several times until soft key [PUNCH] is displayed.
- 291 -
8.OPERATION B-63943EN-2/07
NOTE
When the output file name is not specified, the default file name "PCODE.TXT"
is assumed.
Pressing soft key [EXEC] outputs the macro variable data, during which the word "OUTPUT" blinks at
the lower right corner of the screen. When the punch operation is complete, the word "OUTPUT"
disappears.
- Output format
Variable value output format
A macro variable value is output in hexadecimal notation using a bit image of double-precision
floating-point data.
Therefore, the values of the data cannot be checked directly.
- 292 -
B-63943EN-2/07 8.OPERATION
Output example
Example if bit 2 (MV2) of parameter No. 9034 is set to 1 (variables #500 to
#549 are also used as custom macro common variables)
%
P-CODE macro variable (L86)
G10L86P100(0000000000000000) ……… When the value is 0
G10L86P101(FFFFFFFFFFFFFFFF) …… When the value is <null>
G10L86P102(C18FCA0555555555) …… When the value is normal
:
Custom macro variable (L85)
G10L85P501(41CDCD6500000000)
G10L85P502(0000000000000000)
:
P-CODE macro variable /
G10L86P550(0000000000000000) P-CODEvariable(L86)
:
G10L86P999(0000000000000000)
G10L86P10000(0000000000000000)
:
G10L86P89999(40F5F8F000000000)
SETVN500[P-CODE00] …………………………… Variable name
SETVN501[P-CODE01]
SETVN502[P-CODE02]
:
M02
% ………………………………………………… End of the data section
Comment
--------------------
P100(0.0)
P101(EMPTY)
P102(-66666666.6666667)
:
P501(+OVER FLOW)
P502(0.0)
:
P550(0.0)
:
P999(0.0)
P10000(0.0)
:
P89999(89999.0)
%
NOTE
1 Variable names (SETVN500[.......] to 549[.......]) are output only when the
variables are also used as custom macro common variables by using bit 2 (MV2)
of parameter No. 9034.
2 The comment section after M02% is output only when 1 is set in bit 0 (MCO) of
parameter No. 6019.
- 293 -
8.OPERATION B-63943EN-2/07
- Mode setting
Set the EDIT mode.
NOTE
During an emergency stop, the macro variables can be input regardless of the
mode.
- Input procedure
Press soft key [(OPRT)].
Press the continuous menu key several times until soft key [READ] is displayed.
NOTE
When the input file name is not specified, the default file name "PCODE.TXT" is
assumed.
Pressing soft key [EXEC] inputs the macro variable data, during which the word "INPUT" blinks at the
lower right corner of the screen. When the read operation is complete, the word "INPUT" disappears.
- Input format
The input format is the same as the output format. (For details, see the output format.)
- 294 -
B-63943EN-2/07 8.OPERATION
NOTE
1 If the input format is invalid, an SR alarm occurs and the data input is
interrupted.
2 A different alarm is issued depending on the content of the input data.
- If a G code other than G10 or an L code other than L85 or L86 is specified
SR0114 “ILLEGAL EXPRESSION FORMAT”
- If an address other than the G, L, or P code is specified
SR1300 “ILLEGAL ADDRESS”
- If the line begins with a character other than an address character
SR1301 “MISSING ADDRESS”
- If the specified P code is P200 to P499 or P1000 to P9999
SR1302 “ILLEGAL DATA NUMBER”
- If the setting of bits 0 to 7 (MV0 to MV7) of parameter No. 9034 does not
match the L code specification
SR2050 “#200-#999ILLEGAL P-CODE MACRO COMMON INPUT (NO
OPTION)“
- If more variable numbers than the number determined by parameter No.
9053 are specified when the specified P code is P10000 to P19999
SR2053 “P-CODE VARIABLE NUMBER IS OUTSIDE OF RANGE”
- If more variable numbers than the number determined by parameter No.
9054 are specified when the specified P code is P20000 to P89999
SR2054 “EXTENDED P-CODE VARIABLE NUMBER IS OUTSIDE OF
RANGE”
- 295 -
9.PARAMETERS B-63943EN-2/07
9 PARAMETERS
9.1 COMPILE PARAMETERS
When the power is turned on, the compile parameters are initialized to the values set in P-CODE variables.
So, these parameters cannot be modified, for example, from the MDI panel and so on.
#7 #6 #5 #4 #3 #2 #1 #0
9000 M3MB M2MB M1MB M512 M256 M128
9001 M4MB
No.9000 # 1 M128
#2 M256
#3 M512
#4 M1MB
#5 M2MB
#6 M3MB
No.9001 # 2 M4MB
M4MB M3MB M2MB M1MB M512 M256 M128 P-CODE file size
0 0 0 0 0 0 1 128Kbyte
0 0 0 0 0 1 0 256Kbyte
0 0 0 0 0 1 1 384Kbyte
0 0 0 0 1 0 0 512Kbyte
0 0 0 0 1 0 1 640Kbyte
0 0 0 0 1 1 0 768Kbyte
0 0 0 0 1 1 1 896Kbyte
0 0 0 1 0 0 0 1Mbyte
0 0 0 1 1 0 0 1.5Mbyte
0 0 1 0 0 0 0 2Mbyte
0 1 0 0 0 0 0 3Mbyte
1 0 0 0 0 0 0 4Mbyte
#7 #6 #5 #4 #3 #2 #1 #0
9002 EXT1 PWSR DAUX ACL2 ACL1 TCAL
- 296 -
B-63943EN-2/07 9.PARAMETERS
#2 ACL2 Subprogram call using a specific code (O9005/#147) is:
0: Disabled.
1: Enabled.
#5 DAUX When the power is turned on, the conversational macro function is:
0: Not executed.
1: Executed.
NOTE
When the display demands other than the conversational macro
screen have been generated when the power is turned on, the
conversational macro function might not be executed.
Example:
It is given priority to display alarm screen when the alarm is
generated when the power is turned on. As a result, the
conversational macro function might not be executed.
#7 EXT1 The extended functions (CNC program reference/write, cutting distance accumulation/
preset, and reader/puncher interface control) are:
0: Disabled.
1: Enabled.
#7 #6 #5 #4 #3 #2 #1 #0
9003 PTCH KY20 GPNT * ONMSK
#2 *
NOTE
For 7.2" and 8.4" LCD units, be sure to set this parameter to 1.
#3 GPNT When a color other than black is to be specified as boundary color with the graphic filling
function (G206):
0: P8 is used for specification.
1: P16 is used for specification.
NOTE
When this parameter is set to 0, color palette 8 is used as
boundary color, and cannot be used for filling. When using color
palette 8 for filling, set this parameter to 1.
#5 KY20 For a key-input variable allowing decimal point input, #8501 is:
0: Not incremented by α.
1: Incremented by α.
α: +20 for a display unit with 7 soft keys
- 297 -
9.PARAMETERS B-63943EN-2/07
Example
Example where this parameter is set to 1 for an indicator with 7 soft
keys:
For <1> and , #8503=1.0, #8501=8
For <1.> and , #8503=1.0, #8501=28
Thus, whether the decimal point is entered can be identified.
NOTE
When using a system with vertical soft keys, use bit 1 (KY100) of
compile parameter No. 9160.
#7 #6 #5 #4 #3 #2 #1 #0
9004 CUTLG SP_G_C SP_G_B
#0 SP_G_B
#1 SP_G_C For lathe systems, specify the G code system, A, B, or C, used to create the P-CODE
programs.
#7 #6 #5 #4 #3 #2 #1 #0
9005 AX4CL AX3CL AX2CL AX1CL
- 298 -
B-63943EN-2/07 9.PARAMETERS
Select a control axis number within the path, using a bit:
No. 9005 #0 AX1CL 1st axis
#1 AX2CL 2nd axis
#2 AX3CL 3rd axis
#3 AX4CL 4th axis
#7 #6 #5 #4 #3 #2 #1 #0
9005 TMACC AXCLS
#7 #6 #5 #4 #3 #2 #1 #0
9006 NNUM US19W STDM KEYC
#1 KEYC With the CNC program reference/write function, the memory protection signal (KEY3)
and 8-level data protection function are:
0: Checked.
(When protection is provided, completion code #8529=254.)
1: Not checked.
#2 STDM On the conversational macro screen, state display (mode and status display) is:
0: Not masked.
1: Masked.
- 299 -
9.PARAMETERS B-63943EN-2/07
#5 US19W For the 12-soft key type, conversational macro user screen 1 is:
0: Not displayed as the 7-soft key type.
1: Displayed as the 7-soft key type.
#6 NNUM When data input control is enabled on the conversational macro screen, the "NUM"
prompt is:
0: Displayed.
1: Not displayed.
#7 #6 #5 #4 #3 #2 #1 #0
9007 US19WK TTDSP
#3 US19WK When the 7-soft key type display is specified for the 12-soft key type bit 5 (US19W) of
compile parameter No. 9006 = 1), the position for displaying the key input line is:
0: Not changed.
1: Changed to within the display area for the 7-soft key type.
#7 #6 #5 #4 #3 #2 #1 #0
9008 MCARG MDLP
#4 MDLP A cancel G code (G167 or a G code specified using compile parameter No. 9034) for G
code-based modal calls calls:
0: Nothing (only a modal call is canceled).
1: O9006 (a modal call is canceled and O9006 is called).
NOTE
This parameter is valid only when the Series 16i method (bit 0
(GMC) of compile parameter No. 9163 = 1) is used for modal calls.
(If bit 0 (GMC) of compile parameter No. 9163 = 0, G67 cancels
modal calls but does not call O9006 regardless of what the setting of
this compile parameter is.)
- 300 -
B-63943EN-2/07 9.PARAMETERS
NOTE
Input format restrictions regarding NC commands are placed on
address G. For example, specifying G1000 results in alarm
PS0010 being issued. If there are two or more G codes, only the
last G code will be an argument. O, N, and non-00 group G codes
are passed as modal information to the next block.
#7 #6 #5 #4 #3 #2 #1 #0
9009 MSCL CM30
#3 MSCL A subprogram call based on a range-specified M code specified using compile parameters
Nos. 9042 and 9043 is regarded as:
0: An ordinary subprogram call
1: A special macro call
NOTE
This parameter is valid only when the Series 16i method (bit 0
(GMC) of compile parameter No. 9163 = 1) is used for modal calls.
(If bit 0 (GMC) of compile parameter No. 9163 = 0, G67 cancels
modal calls regardless of what the setting of this compile parameter
is.)
- 302 -
B-63943EN-2/07 9.PARAMETERS
9038 Conversational macro main program number (for user screen 1)
NOTE
The program number specified in each parameter is set in the
corresponding conversational macro execution control variable
when the power is turned on.
NOTE
The program number specified in this parameter is set in the
auxiliary macro execution control variable when the power is turned
on.
9042 Code for subprogram call using a range specification M code (lower limit)
9043 Code for subprogram call using a range specification M code (upper limit)
NOTE
1 If a value not within the specifiable range is set, or a specified
range is such that No. 9042 > No. 9043, subprogram call using a
range specification M code is disabled.
2 An M code used for macro call/subprogram call is not used as a
calling code even when the M code is within the setting range.
9111 Start M code of subprogram call using an M code (specification of 3 sets) (1st set)
9112 Count of subprogram call using an M code (specification of 3 sets) (1st set)
9113 Start program number of subprogram call using an M code (specification of 3 sets) (1st set)
9114 Start M code of subprogram call using an M code (specification of 3 sets) (2nd set)
9115 Count of subprogram call using an M code (specification of 3 sets) (2nd set)
- 303 -
9.PARAMETERS B-63943EN-2/07
9116 Start program number of subprogram call using an M code (specification of 3 sets) (2nd set)
9117 Start M code of subprogram call using an M code (specification of 3 sets) (3rd set)
9118 Count of subprogram call using an M code (specification of 3 sets) (3rd set)
9119 Start program number of subprogram call using an M code (specification of 3 sets) (3rd set)
9120 Start M code of macro call using an M code (specification of 3 sets) (1st set)
9121 Count of macro call using an M code (specification of 3 sets) (1st set)
9122 Start program number of macro call using an M code (specification of 3 sets) (1st set)
9123 Start M code of macro call using an M code (specification of 3 sets) (2nd set)
9124 Count of macro call using an M code (specification of 3 sets) (2nd set)
9125 Start program number of macro call using an M code (specification of 3 sets) (2nd set)
9126 Start M code of macro call using an M code (specification of 3 sets) (3rd set)
9127 Count of macro call using an M code (specification of 3 sets) (3rd set)
9128 Start program number of macro call using an M code (specification of 3 sets) (3rd set)
Count
(Nos. 9112, 9115, 9118, 9121, 9124, and 9127) : 1 and up
The upper limit depends on the start M code and start program number.
NOTE
1 In the following cases, this call is disabled:
(1) In a compile parameter, a value not within the range is set.
(2) A defined M code range (start M code number + count) exceeds
99999999.
(3) A defined program number range (start program number +
count) exceeds 99999999.
2 An M code used for macro/subprogram call, even when included in
the setting range, is not used as an instruction for this subprogram
call.
- 304 -
B-63943EN-2/07 9.PARAMETERS
NOTE
3 If duplicate M codes are set, the M codes are valid according to the
priority order below.
(1) Macro call using an M code
(Compile parameters Nos. 9023 to 9032)
(2) Subprogram call using an M code
(Compile parameters Nos. 9010 to 9012)
(3) Subprogram call using a range specification M code
(Compile parameters Nos. 9042 and 9043)
(4) Subprogram call using an M code (specification of 3 sets)
(Compile parameters Nos. 9111 to 9113, 9114 to 9116, and
9117 to 9119)
9047 Start program number of macro call using an G code (specification of 1 set)
9129 Start G code of macro call using an G code (specification of 3 sets) (1st set)
9130 Count of macro call using an G code (specification of 3 sets) (1st set)
9131 Start program number of macro call using an G code (specification of 3 sets) (1st set)
9132 Start G code of macro call using an G code (specification of 3 sets) (2nd set)
9133 Count of macro call using an G code (specification of 3 sets) (2nd set)
9134 Start program number of macro call using an G code (specification of 3 sets) (2nd set)
9135 Start G code of macro call using an G code (specification of 3 sets) (3rd set)
9136 Count of macro call using an G code (specification of 3 sets) (3rd set)
9137 Start program number of macro call using an G code (specification of 3 sets) (3rd set)
Start program number (parameters Nos. 9047, 9131, 9134, and 9137) :
1 to 99999999
If a negative value is set as a start G code number (parameters Nos. 9045, 9129, 9132,
and 9135), modal call results. Use bit 1 (MCT) of parameter No. 9163 for setting of move
command call (G66)/call of each block (G66.1).
- 305 -
9.PARAMETERS B-63943EN-2/07
NOTE
1 In the following cases, this call is disabled:
(1) In a compile parameter, a value not within the range is set.
(2) A defined G code range (start G code number + count) exceeds
9999.
(3) A defined program number range (start program number +
count) exceeds 99999999.
2 A G code used for macro call, even when included in the setting
range, is not used as an instruction for this macro call.
3 If duplicate G codes are set, the G codes are valid according to the
priority order below.
Three types of macro call using G codes are available as indicated
below. If the range of G codes set in <1> duplicates the ranges of
G codes set in <2> or <3>, the G code priority order is, from high to
low, <1> to <2> to <3>.
(1) Individual specification :
Compile parameters Nos. 9013 to 9022
(2) Specification of 1 sets :
Compile parameters Nos. 9045 to 9047
(3) Specification of 3 sets :
Compile parameters Nos. 9129 to 9131, 9132 to 9134, and
9135 to 9137
9050 Program number to add the item to the help (initial menu) screen
NOTE
Each time switching occurs from the help (initial menu) screen or
NC screen to the user help screen, #8555 is initialized with a
program number specified with the compile parameter No. 9051
and executed as the main program for the user help screen.
- 306 -
B-63943EN-2/07 9.PARAMETERS
9054 Free space when the program write/delete function is executed
#7 #6 #5 #4 #3 #2 #1 #0
9100 MSFT C9WN DLMT VKLN VGAR
#0 VGAR When the display command with background color (G250) is specified:
0: Display with background color is disabled.
1: Display with background color is enabled.
#4 VKLN In background color display, background display for the key input line is:
0: Not provided.
1: Provided.
NOTE
1 Please set 0 usually.
2 The setting DLMT=1 is effective for 10.4" display device. The range
of the display is as follows.
DLMT=0: X is 0 to 79 and Y is 0 to 29
DLMT=1: X is 0 to 79 and Y is 2 to 24 (Upper 2 rows and Lower 5
rows are ignored)
#6 C9WN When the 7-soft key type display is selected for the 12-soft key type (bit 5 (US19W) of
compile parameter No. 9006 = 1), the character display coordinates are:
0: Not adjusted as the 7-soft key window display (the same coordinates as for the
12-soft key type display).
1: Adjusted as the 7-soft key window display.
NOTE
This parameter is valid only for screens with a background (bit 0
(VAGR) of compile parameter No. 9100 = 1).
- 307 -
9.PARAMETERS B-63943EN-2/07
#7 MSFT When no background color is specified (bit 0 (VGAR) of compile parameter No.9100 =
0), the conversational macro screen:
0: Displays a soft key frame.
1: Does not display a soft key frame.
#7 #6 #5 #4 #3 #2 #1 #0
9103 EXMSCL PRDGCAL
#4 EXMSCL Up to 3 macro calls based on M codes specified with compile parameters Nos. 9120 to
9128 and up to 3 subprogram calls based on M codes specified with compile parameters
Nos. 9111 to 9119 are made as:
0: Ordinary macro or subprogram calls.
1: Special macro calls.
#7 #6 #5 #4 #3 #2 #1 #0
9104 GMACC SMACC HMACC DMACC
#7 #6 #5 #4 #3 #2 #1 #0
9105 BSC SSC
- 308 -
B-63943EN-2/07 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
9160 PMX16 PG1O TDVDPI EXST TM99 PRDPI KY100 CUNIT
NOTE
The cutting distance 1.0 mm on a machine with the reference axis
based on IS-B/metric input depends on the setting of this
parameter as follows:
0: #8554=1000
1: #8554=1.0
#1 KY100 For a key-input variable allowing decimal point input, #8501 is:
0: Not incremented by 100.
1: Incremented by 100.
NOTE
Example where this parameter is set to 1 for an indicator with 7 soft
keys:
For <1> and , #8503=1.0, #8501=8
For <1.> and , #8503=1.0, #8501=108
Thus, whether the decimal point is entered can be identified.
#2 PRDPI For the word-type specified-block read (G325) of the CNC program reference function,
the decimal places of the value read:
0: Follow the setting of bit 0 (DPI) of parameter No. 3401.
1: Are always of a calculator type decimal point input.
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
#3 TM99 A check to see if a cause to end conversational macro function execution has occurred is
made when:
0: The execution of the current block ends.
If the cause is found, screen switching occurs immediately, before the program end
instruction (execution control code M99/M99Pp) in the main program is executed.
1: The program end instruction (execution control code M99/M99Pp) in the
conversational macro main program is executed.
If the cause is found, screen switching occurs after the program end instruction
(execution control code M99/M99Pp) in the main program is executed.
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
- 309 -
9.PARAMETERS B-63943EN-2/07
#4 EXST In the status display of the conversational macro screen, three-dimensional interference
check in progress or program coordinate system switching is:
0: Not indicated.
1: Indicated.
#5 TDVDPI In variable-based PMC axis control, the distance to move specified with control travel
distance variables (#8713, #8723, #8733, and #8743) is regarded as of:
0: Calculator type decimal point input.
1: Least input increment.
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
#7 PMX16 In PMC axis control, the controlled-axis number selected using the axis select variable
(#8700) and the relationships between control variables and groups in variable-based
PMC axis control are specified as listed below:
Example
In a 2-path system with each path containing a 3-axis machine,
path 2 can select the 1st axis in the path by specifying the:
• System-common 4th axis if bit 7 (PMX16) of compile parameter
No. 9160 = 0.
#8700 = 16
• 1st axis in the path if bit 7 (PMX16) of compile parameter No.
9160 = 1.
#8700 = 1
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
- 310 -
B-63943EN-2/07 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
9163 C16 P98 LCLLV PCDC MCT GMC
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
NOTE
This parameter is valid only for modal calls of the standard method
(bit 0 (GMC) of compile parameter No. 9163 = 0).
For modal calls of the Series 16i method (bit 0 (GMC) of compile
parameter No. 9163 = 1), set this parameter to 0.
#2 PCDC How to make calls from an execution macro that was called from a user program, using a
code like G/M/T…, varies depending on the combination of this parameter and bit 6
(GMP) of parameter No. 6008. For details, see the following table.
- 311 -
9.PARAMETERS B-63943EN-2/07
NOTE
This parameter is valid only for modal calls of the standard method
(bit 0 (GMC) of compile parameter No. 9163 = 0).
For modal calls of the Series 16i method (bit 0 (GMC) of compile
parameter No. 9163 = 1), this parameter is regarded as 0.
O90xx
:
M99
- 312 -
B-63943EN-2/07 9.PARAMETERS
(2) How to make a call after a user program is called
(a) Calling another user program in program memory
(b) Calling an execution macro
(c) Calling a subprogram of the user program after an execution macro is called
Within user program Within execution macro
: O90xx
Gxx :
: MxxPpp1
:
M99
Opp1
Mxx (b)
:
M99 O90xx
(a) :
MxxPpp2
(c) :
Oxxxx M99
:
M99
O pp2
:
M99
- 313 -
9.PARAMETERS B-63943EN-2/07
NOTE
1 If a disabled type of call is attempted, the command is treated as
an ordinary G/M/S/T/D/H/second auxiliary function/axis address
code.
2 The same behavior as for bit 6 (GMP) of parameter No. 6008 = 0
and bit 2 (PCDC) of compile parameter No. 9163 = 0 occurs if bit 0
(GMC) of compile parameter No. 9163 = 1.
#3 LCLLV If an execution macro is called as a subprogram from a user program (subprogram call
using an M/S/T/second auxiliary function/specific code), the local variable level:
0: Does not change.
(The local variable at the calling source is used.)
1: Changes.
(The local variable at the called destination is used. (Equivalent to that of the Series
16i.))
#4 P98 The execution macro for P-CODE workpiece number search is:
0: Called as a macro.
The local variable used with the execution macro cannot be used with the main
program.
1: Called as a subprogram.
The local variable used with the execution macro is passed to the main program.
#6 C16 When an execution macro program is called from a program called as a subprogram from
a user program:
0: Each non-G code, such as M/T/S/…, or an axis code cannot use each non-G code,
such as M/T/S/…, or an axis code to call an execution macro. In addition, a program
called using a G code cannot use a G code to call an execution macro (no call can be
made at all if bit 6 (GMP) of parameter No. 6008 = 0).
1: Regardless of the setting of bit 6 (GMP) of parameter No. 6008, each code, such as
G/M/T/S/…, and axis address can be used to call an execution macro in the same
manner as when an execution macro is called from a user program. (Equivalent to
the behavior of the Series 16i.)
#7 #6 #5 #4 #3 #2 #1 #0
9167 PL30 NVGA INCD NTV
#0 NTV When an "LF" is output with G336 (data transmission), a space for a TV check is:
0: Output.
1: Not output.
- 314 -
B-63943EN-2/07 9.PARAMETERS
#3 INCD The coordinates (X,Y,I,J) in the character coordinate system or graphic coordinate system
are:
0: Specified in the absolute specification mode at all times.
1: Switchable between the absolute specification mode and incremental specification
mode with G390/G391. (Valid for G204, G230, G242, G243, G300, G249, G250,
G01, G02, G03, G206, and G317)
#4 NVGA This parameter is used with applications created for character cards of the old type, and is
usually set to 0.
0: Normal mode
1: Equivalent to character cards (All graphic commands are ignored.)
#7 PL30 For screens with a background, the coloration of the color palette is set to the standard
colors of the:
0: Conversational macro screen of the Series 16i.
1: Series 30i.
#7 #6 #5 #4 #3 #2 #1 #0
9168 VGET PAN US19WG
#0 US19WG When the 7-soft key type display is specified for the 12-soft key type (the compile
parameter US19W(No.9006#5)=1), the number of display groups of G-code modal
information is:
0: 18 groups.
1: 24 groups.
#1 PAN In the parameter writing command (G314), when two or more parameter writings are
executed by specifying the intra-path control axis (spindle) number, Next parameter
writing of the intra-path control axis (spindle) number is :
0: Order of the system common control axis (spindle) number.
1: Order of the intra-path control axis (spindle) number.
Example : 2path-6axes, parameter No.981=1, 2, 1, 2, 1, 2 (X1, X2, Y1, Y2, Z1, Z2)
#2 VGET For virtual MDI key, the control variables of MDI keyboard type reading(#8533) and
MDI key image reading(#8549) are :
0: Disabled.
1: Enabled.
When this compile parameter is set to 1, the following value can be read.
- In #8533, the value 0 can be read as the kind of virtual MDI key regardless of the
kind of the connected MDI keyboard.
- In #8549, the key images of virtual MDI key can be read.
- 315 -
9.PARAMETERS B-63943EN-2/07
#7 #6 #5 #4 #3 #2 #1 #0
3109 HPU
#7 #6 #5 #4 #3 #2 #1 #0
9000 RSC STP NDP SQN
#0 SQN During execution macro execution, the program number and sequence number are:
0: Not displayed.
The program and sequence numbers of a calling user program are kept displayed
until program control is returned to the calling user macro after the end of the
execution macro.
1: Displayed.
#1 NDP On the macro variable screen, the P-CODE variable screen is:
0: Not displayed.
1: Displayed.
#2 STP When a conversational macro/auxiliary macro is executed using the debug function:
0: The macro is executed in the continuous mode.
1: The macro is executed in the single block mode.
This parameter is valid when bit 0 (DBG) of parameter No. 9033 is set to 1.
NOTE
When this parameter is set, the power must be turned off before
operation is continued.
#4 RSC Upon reset, the P-CODE macro common variables (#100 to #199) are:
0: Not cleared to <null>.
1: Cleared to <Null>.
NOTE
This parameter does not affect the custom macro common
variables #100 to #199, regardless of the states of bits 0 (MV0) and
1 (MV1) of parameter No. 9034.
The custom macro common variables #100 to #199 depend on bit
6 (CCV) of parameter No. 6001.
- 316 -
B-63943EN-2/07 9.PARAMETERS
9002 Conversational macro/auxiliary macro program number subject to breaking
NOTE
If either this parameter or parameter No. 9003 is set to a value
other than 0 when the conversational macro function is executed,
the break function is enabled, and the program number set in this
parameter and the sequence number set in parameter No. 9003
are set as break conditions.
NOTE
If either this parameter or parameter No. 9002 is set to a value
other than 0 when the conversational macro function is executed,
the break function is enabled, and the sequence number set in this
parameter and the program number set in parameter No. 9002 are
set as break conditions.
#7 #6 #5 #4 #3 #2 #1 #0
9010 08M 07M 06M 05M 04M 03M 02M 01M
The axes for which special macro call using an axis address is enabled are:
0: Enabled.
1: Disabled.
With these parameters, special macro call using an axis address enabled with the compile
parameters Nos. 9005, 9008, 9164, and 9165 can be disabled.
Select a control axis number within the path, using a bit.
- 317 -
9.PARAMETERS B-63943EN-2/07
#7 #6 #5 #4 #3 #2 #1 #0
9011 VRM MTC
#7 #6 #5 #4 #3 #2 #1 #0
9012 MSC MHC MDC
- 318 -
B-63943EN-2/07 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
9013 MCA
#1 MCA If an execution macro call code specified using a compile parameter has the same setting
as for a custom macro call code specified using a parameter:
0: The execution macro call is enabled.
1: The custom macro call is enabled.
Example
If both parameter No. 6050 and compile parameter No. 9013
specify 100 as a G code for calling O9010:
• O9010 specified in the execution macro is called if bit 1 (MCA)
of parameter No. 9013 = 0.
• O9010 specified in the user program is called if bit 1 (MCA) of
parameter No. 9013 = 1.
#7 #6 #5 #4 #3 #2 #1 #0
9026 NDTx
NOTE
This parameter is valid only during linear interpolation as with the
G01 command. (During circular interpolation as with the G02 or
G03 command, an axis for which this parameter is set to 1 is also
included in a cumulative cutting distance calculation.)
#7 #6 #5 #4 #3 #2 #1 #0
9032 BGW
NOTE
When this parameter is set, the power must be turned off before
operation is continued.
NOTE
The monochrome LCD is for the Series 30i /31i /32i -A.
- 319 -
9.PARAMETERS B-63943EN-2/07
#7 #6 #5 #4 #3 #2 #1 #0
9033 SHS EVF EV2 MVD SEP DBG
NOTE
When at least one of these parameters is set, the power must be
turned off before operation is continued.
NOTE
The monochrome LCD is for the Series 30i /31i /32i -A.
NOTE
Re-setting this parameter clears all data assigned to the P-CODE
variables (#10000 and up) and extended P-CODE variables
(#20000 and up) for all paths to 0.
NOTE
Re-setting this parameter clears all data assigned to the extended
P-CODE variables (#20000 and up) and P-CODE variables
(#10000 and up) for all paths to 0.
#5 SHS When the high-speed cycle machining function is enabled, variables #20000 and up are
used as:
0: High-speed cycle machining data variables.
1: Expansion P code variables.
- 320 -
B-63943EN-2/07 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
9034 MV7 MV6 MV5 MV4 MV3 MV2 MV1 MV0
NOTE
When at least one of these parameters is set, the power must be
turned off before operation is continued.
#0 MV0 The common variables #100 to #149 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#1 MV1 The common variables #150 to #199 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#2 MV2 The common variables #500 to #549 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#3 MV3 The common variables #550 to #599 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#4 MV4 The common variables #600 to #699 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#5 MV5 The common variables #700 to #799 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#6 MV6 The common variables #800 to #899 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
#7 MV7 The common variables #900 to #999 used by a P-CODE macro are:
0: P-CODE macro common variables independent of the custom macro common
variables.
1: Shared as custom macro common variables.
- 321 -
9.PARAMETERS B-63943EN-2/07
#7 #6 #5 #4 #3 #2 #1 #0
9035 SKX NPA CWB EUI RCN XIT
#4 CWB When the data transmission (G336) command in reader/puncher control or the macro
variable data output (G338) command is executed, actual data transmission is carried out:
0: In units of blocks.
1: When the send buffer (255 bytes) becomes full or the line close (G331) command is
executed.
NOTE
1 Even when this parameter is 0 (data is sent in units of blocks), no
data is sent with a block which contains the R1xx command.
2 When only 1 byte (for example control code) is to be sent or when
output and input are to be performed alternately since the line is
opened until the line is closed, set this parameter to 0. If it is set to
1, data transmission cannot be performed normally because data is
transmitted 255 bytes at a time.
#5 NPA When a P-CODE work number search is enabled, an attempt to start automatic operation
with no main program selected results in:
0: Nothing being performed.
1: Alarm PS1079 being issued.
#6 SKX The skip signal to be referenced by a linear or rotation axis move direction variable
(#8601/#8608) when the skip signal rises is the:
0: SKIPP signal (Gn006.6).
1: SKIP signal (X004.7).
If this parameter is 1:
1. X013.7 for the 2nd PMC and X011.7 for the 3rd PMC.
2. X address assigned by parameter No. 3012 if bit 2 (XSG) of parameter No.
3008 = 1.
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
- 322 -
B-63943EN-2/07 9.PARAMETERS
#7 #6 #5 #4 #3 #2 #1 #0
9036 PRS NOB AMP AFT MPE
#0 MPE When bit 0 (PWE) of parameter No. 8900 = 0, the parameter write (G314) function can
write to:
0: The parameters whose input type is setting input and parameter No. 9036.
1: All writable parameters.
If bit 0 (PWE) of parameter No. 8900 = 1, however, the parameter write function can
write to all writable parameters regardless of the setting of this parameter.
NOTE
Usually, set this parameter to 0 in order to keep auxiliary macro
function execution from stopping accidentally.
#4 NOB With execution macros, the G310 (relative coordinate preset and PMC data read/write
functions) block is executed as:
0: NC statement.
1: Macro statement.
NOTE
If this parameter is 1, the behavior is equivalent to that of the
Series 16i.
NOTE
When this parameter is 1, do not edit programs during high-speed
read; no correct data may be read.
NOTE
1 With a path for which this parameter is set to 0, the execution
macro is not executed.
2 When this parameter is set, the power must be turned off before
operation is continued.
NOTE
1 With a path for which this parameter is set to 0, the conversational
macro is not executed.
2 When this parameter is set, the power must be turned off before
operation is continued.
NOTE
1 With a path for which this parameter is set to 0, the auxiliary macro
is not executed.
2 When this parameter is set, the power must be turned off before
operation is continued.
NOTE
When this parameter is set, the power must be turned off before
operation is continued.
NOTE
When this parameter is set, the power must be turned off before
operation is continued.
NOTE
1 When this parameter is set, the power must be turned off before
operation is continued.
2 Re-setting this parameter clears all data assigned to the P-CODE
variables (#10000 and up) and extended P-CODE variables (#20000
and up) for all paths to 0.
NOTE
1 When this parameter is set, the power must be turned off before
operation is continued.
2 Re-setting this parameter clears all data assigned to the extended
P-CODE variables (#20000 and up) and P-CODE variables (#10000
and up) for all paths to 0.
- 325 -
9.PARAMETERS B-63943EN-2/07
NOTE
1 When this parameter is set, the power must be turned off before
operation is continued.
2 The 2nd module is invalid in a path for which this parameter is 0.
3 This parameter is valid only when the P-CODE numbers specified
in parameters Nos. 9048 to 9050 are 0 or the same number as
specified in this parameter.
Example:
When No. 9048=1, No. 9049=0, and No. 9050=1:
This parameter is valid.
When No. 9048=2, No. 9049=0, and No. 9050=1:
This parameter is invalid.
NOTE
1 When this parameter is set, the power must be turned off before
operation is continued.
2 The 3rd module is invalid in a path for which this parameter is 0.
3 This parameter is valid only when the P-CODE numbers specified
in parameter Nos. 9048 to 9050 are 0 or the same number as
specified in this parameter.
Example:
When No. 9048=1, No. 9049=0, and No. 9050=1:
This parameter is valid.
When No. 9048=2, No. 9049=0, and No. 9050=1:
This parameter is invalid.
- 326 -
B-63943EN-2/07 9.PARAMETERS
NOTE
During conversational macro execution (while the conversational
macro screen is being displayed), sequential execution (bit 1 (SEP)
of parameter No. 9033 = 0) continues till the program end
instruction (execution control code M99/M99Pp) in the main
program regardless of the setting of this parameter.
9067 Protection range of P-CODE macro common variables (#500 to #999) (start)
9068 Protection range of P-CODE macro common variables (#500 to #999) (end)
NOTE
If a value not within the specifiable range is set, or a specified
range is such that No. 9067 > No. 9068, the P-CODE macro
common variables are not protected from writing.
9069 PMC internal relay (R area) address of an interlock mode signal for each axis direction
9070 PMC internal relay (R area) bit position of an interlock mode signal for each axis direction
NOTE
1 In the following cases, the interlock function for each axis direction
is disabled:
(1) An address not in the R area is specified.
(2) An incorrect bit position is specified.
(3) Bit 0 (XIT) of parameter No. 9035 is set to 0.
2 When specifying the R area for the 2nd- or 3rd-path PMC, specify
the path for the PMC, using control variable #8603 in advance.
- 327 -
9.PARAMETERS B-63943EN-2/07
Number of blocks for which macro statements in the execution macro program are executed in
9072
succession
NOTE
This parameter is valid only for macro statements in the execution
macro program. It affects no macro statement in the custom macro
program.
The setting of this parameter takes effect only when a specified
number of macro statement blocks continue.
- 328 -
B-63943EN-2/07 9.PARAMETERS
Example 1
To use P-CODE macros created in a 5-axis (X, Y, Z, B1 (&D), B2
(&E)) configuration on a machine in a 4-axis configuration (1st axis =
X, 2nd axis = Y, 3rd axis = Z, and 4th axis = B2), set parameter No.
9076 as follows:
[P-CODE macro]
Symbol definition
@B1 &D /* Defines an axis name for the 4th axis.
@B2 &E /* Defines an axis name for the 5th axis.
Axis name to be
Axis number Remark
specified
Axis with no expansion axis name is specified with
1st axis X
no modification.
Axis with no expansion axis name is specified with
2nd axis Y
no modification.
Axis with no expansion axis name is specified with
3rd axis Z
no modification.
4th axis B1 &D (4th axis) is specified.
5th axis B2 &E (5th axis) is specified.
- 329 -
9.PARAMETERS B-63943EN-2/07
Example 2
To use P-CODE macros created in a 3-axis (XA(&A), Y, ZA2(&C))
configuration on a machine in a 3-axis configuration (1st axis = XA,
2nd axis = ZA2, and 3rd axis = Y), set parameter No. 9076 as
follows:
[P-CODE macro]
Symbol definition
@XA &A /* Defines an axis name for the 1st axis.
@ZA2 &C /* Defines an axis name for the 3rd axis.
Axis name to be
Axis number Remark
specified
1st axis XA &A (1st axis) is specified.
Axis with no expansion axis name is specified with no
2nd axis Y
modification.
3rd axis ZA2 &C (3rd axis) is specified.
NOTE
1 If 2 or more axes are specified for the same axis number, alarm
PW1106 will be issued at power on.
[Example]
If parameter No. 9076 is set as listed below, alarm PW1106 will be
issued at power on.
Parameter
Axis number Remark
No.9076
1st axis 2 The 1st axis is &B (YB).
2nd axis 1 The 2nd axis is &A(YA).
Invalid because the parameter setting is the same
3rd axis 2
as for the 1st axis.
2 When this parameter is set, the power must be turned off before
operation is continued.
- 330 -
APPENDIX
B-63943EN-2/07 APPENDIX A.ERROR NO. LIST
- 333 -
A.ERROR NO. LIST APPENDIX B-63943EN-2/07
- 334 -
B-63943EN-2/07 APPENDIX A.ERROR NO. LIST
- 335 -
A.ERROR NO. LIST APPENDIX B-63943EN-2/07
- 337 -
B.CODE TABLES APPENDIX B-63943EN-2/07
B CODE TABLES
Code table of Japanese 'Katakana'
ア 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
- 338 -
B-63943EN-2/07 APPENDIX B.CODE TABLES
音 323B
願 346A
- 339 -
B.CODE TABLES APPENDIX B-63943EN-2/07
郡 3734
- 340 -
B-63943EN-2/07 APPENDIX B.CODE TABLES
酸 3B40 残 3B44
- 341 -
B.CODE TABLES APPENDIX B-63943EN-2/07
- 342 -
B-63943EN-2/07 APPENDIX B.CODE TABLES
難 4671
任 4724 認 4727
ヌ ぬ 244C
貧 494F 敏 4952
- 343 -
B.CODE TABLES APPENDIX B-63943EN-2/07
弁 4A5B
隣 4E59
- 344 -
B-63943EN-2/07 APPENDIX B.CODE TABLES
練 4E7D 連 4F22
録 4F3F 論 4F40
ヲ を 2472
ン ん 2473
- 345 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 346 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 347 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 348 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 349 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 350 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 351 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 352 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 353 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 354 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 355 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 356 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 357 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 358 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 359 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 360 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
C.7 PARAMETERS
In migrating from the Series 16i to the Series 30i, it is necessary to consider those parameters that have
been changed to compile parameters to executor parameters and those parameters that must newly be set.
Select the P-CODE number (number specified by "P-CODE_NUMBER=" in the link control file) of the
execution macro program to be executed in each path.
* The execution macro is not executed in any path for which 0 is set.
Select the P-CODE number (number specified by "P-CODE_NUMBER=" in the link control file) of the
conversational macro program to be executed in each path.
* The conversational macro is not executed in any path for which 0 is set.
Select the P-CODE number (number specified by "P-CODE_NUMBER=" in the link control file) of the
auxiliary macro program to be executed in each path.
* The auxiliary macro is not executed in any path for which 0 is set.
- 362 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 363 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 364 -
B-63943EN-2/07 APPENDIX C.DIFFERENCES FROM THE Series 16i
- 365 -
C.DIFFERENCES FROM THE Series 16i APPENDIX B-63943EN-2/07
- 366 -
B-63943EN-2/07 INDEX
INDEX
CONVERSATIONAL MACRO FUNCTIONS AND
<A> AUXILIARY MACRO FUNCTIONS ..................... 351
Absolute mode (G390)/incremental mode (G391) Cursor control (#8505, #8506, and #8507) .................. 158
specification ............................................................. 158 Cursor display (rectangular cursor) (G230) ................. 157
ADDRESS FUNCTIONS ............................................ 185 CUSTOM MACRO COMMON VARIABLES (#99100
Alarm Information and External Alarm Information ... 267 TO #99999) .............................................................. 106
Appendix tables............................................................ 235 CUSTOM MACRO SYSTEM VARIABLES (#1000
ARITHMETIC AND LOGIC OPERATION ............... 112 AND UP, #10000 AND UP, #100000 AND UP) .... 107
ARRAY-TYPE PROCESSING AND REFERENCING CUTTING TIME, DISTANCE READ AND PRESET
OF P-CODE VARIABLES ...................................... 240 FUNCTIONS ........................................................... 236
AUXILIARY MACRO FUNCTION ............................. 88
Axis Specification and Extended Axis Name <D>
Specification Using an Axis Number ........................ 74 Data Input Control Variable (#8502) ........................... 179
Axis specification using an axis number ........................ 74 Data Transmission/Reception Waiting ......................... 205
Axis, Relative Coordinate, Servo Motor Load Current DEBUG FUNCTION ................................................... 360
Value, and Positional Deviation value...................... 272 DEBUGGING FUNCTION ......................................... 281
AXIS-DIRECTION-BY-AXIS-DIRECTION DEFINITION OF WARNING, CAUTION, AND
INTERLOCK FUNCTION (#8600, #8601, #8607, NOTE ........................................................................ s-1
AND #8608) ............................................................. 261 Details of control codes................................................ 245
Details of control variables .......................................... 250
<B> DIAGNOSIS DATA ...................................................... 73
Brightness modulation mode display on the Diagnosis Information.................................................. 275
monochrome LCD and base color ........................... 165 Direct language specification function ......................... 144
DIRECT SETTING BY PARAMETER AND KEY.... 285
<C> Display 7 Soft Keys Data on the 12 Soft Keys Type ... 171
CALLING AN EXECUTION MACRO ........................ 13 DISPLAYING AND SETTING MACRO VARIABLE
Caution ........................................................... 111,252,260 VALUES .................................................................. 287
Character display (G243) ............................................. 140 DISPLAYING AND SETTING ON THE DEBUGGER
Character String Registration Program Number SCREEN .................................................................. 281
Specification (#8509) ............................................... 167 Drawing line type specification (G244) ....................... 154
Circular drawing (clockwise) (G02)............................. 155 Drawing start point setting (G242)............................... 130
Circular drawing (counterclockwise) (G03) ................. 155
CNC DATA READING/WRITING ............................ 191 <E>
CNC Parameter Reference ........................................... 187 Error Messages............................................................. 256
CNC PROGRAM REFERENCING AND WRITING, ERROR NO. LIST ....................................................... 333
AND PROGRAM INFORMATION READING ..... 220 Execution and Termination ....................................... 86,89
CODE TABLES ........................................................... 338 EXECUTION CONTROL CODE ................................. 91
Color specification (G240) ........................................... 129 EXECUTION CONTROL VARIABLES (#8500,
Command .................................................................. 88,90 #8550, #8551, AND #8530) ...................................... 93
Command for display with background color (G250) .. 131 Execution Cycle ............................................................. 90
Command Key Input Variable (#8501) ........................ 176 EXECUTION MACRO FUNCTION ............................ 13
Commands which cannot Use Execution Macros .......... 73 EXECUTION MACRO FUNCTIONS ........................ 346
COMMON CONVERSATIONAL MACRO EXECUTOR PARAMETERS .............................. 316,364
FUNCTION ................................................................ 94 Extended Data Input Control Variable (#8552) ........... 180
COMMON VARIABLES (#100 TO #199 AND #500 EXTENDED P-CODE VARIABLES (#20000 TO
TO #999) .................................................................. 101 #89999) .................................................................... 104
COMPILE PARAMETERS .................................. 296,361
Completion code ................................................... 194,196 <F>
Completion code (#8529) ............................................. 233 FANUC Cassette Control ............................................. 207
Completion Codes (#8539) ................................... 211,218 FATAL ERROR ............................................................ 95
Consecutive Input of Cursor and Page Keys ................ 181 FILE CONTROL ......................................................... 254
Control Examples ......................................................... 252 Function ....................................................................... 198
CONVERSATIONAL MACRO FUNCTION ............... 85 FUNCTION FOR SEARCHING DATA TABLES FOR
CONVERSATIONAL MACRO FUNCTION AND CONTROL VARIABLES ....................................... 277
AUXILIARY MACRO FUNCTION ......................... 85 Functions ...................................................................... 214
i-1
INDEX B-63943EN-2/07
Functions which cannot Use Execution Macros............. 74 MODULE DIVISION FUNCTION ................................. 8
MULTI-PATH CONTROL FUNCTION....................... 10
<G> Multiple P-CODE Macros Independent of Paths ........... 11
G Code System Conversion (for a Lathe System) .......... 79
GENERAL .......... 1,13,197,213,220,243,248,254,263,281 <N>
GENERAL WARNINGS FOR CNC APPLICATION Notes on I/O Signals Updated by Other Than PMC .... 190
DEVELOPMENT...................................................... s-1
GENERAL WARNINGS FOR MACRO EXECUTOR <O>
APPLICATION DEVELOPMENT .......................... s-3 O and N Number Display Mask Function .................... 171
Graphic coordinate system setting (G392) ................... 159 OPERATION ............................................................... 287
Graphic cursor function (G249) ................................... 157 Optional Block Skip ....................................................... 74
Graphic filling function (G206) ................................... 161 Overview ........................................................................ 13
<I> <P>
Independent Operating Environment for Each Path ....... 10 PARAMETERS .................................................... 296,361
Interruption Type Custom Macro ................................... 74 Parameters That Have Been Added, Changed, and
Abolished ................................................................. 361
<K> Parameters That Must Always Be Set .......................... 361
KEY INPUT AND DATA INPUT CONTROL ........... 176 Passing of arguments ..................................................... 22
Key Input Line Control (#8561 to #8563) .................... 181 P-CODE MACRO............................................................ 6
P-CODE Macro and P-CODE File................................... 3
<L> P-CODE Macro UI/UO Separation Function ............... 109
Limitations ............................................................ 234,248 P-CODE VARIABLES (#10000 TO #19999) ............. 103
Limitations on Commands ............................................... 6 P-CODE Variables/Extended P-CODE Variables
LIMITATIONS ON EXECUTION MACROS .............. 73 Common to Paths ....................................................... 11
Linear drawing (G01) ................................................... 155 P-CODE VARIABLES/EXTENDED P-CODE
List of Commands ........................................................ 257 VARIABLES IN THE MULTI-PATH CONTROL
Local variable levels ...................................................... 25 SYSTEM .................................................................. 105
LOCAL VARIABLES (#1 TO #33) / ARRAY-TYPE P-CODE Workpiece Number Search ............................. 70
VARIABLES (#1 TO #99) ...................................... 101 PMC ADDRESS READING/WRITING (G310) ......... 188
PMC Address Reference .............................................. 185
<M> PMC AXIS CONTROL ............................................... 243
Macro call and subprogram call ..................................... 13 PMC Axis Control Using G Code ................................ 243
Macro Call Argument for Axis Name Expansion .......... 71 PMC Axis Control Using Variables ............................. 248
Macro call using a cancel G code for a macro modal call Prompt statement display (G280) ................................. 155
using G code ............................................................... 36
Macro Call Using G Code .............................................. 28 <R>
Macro Call Using G Code (Specification of 1 Set) ........ 30 Rapid traverse drawing (G300) .................................... 160
Macro Call Using G Code (Specification of 3 Sets)....... 31 Rapid traverse rate specification (G311) ...................... 159
Macro Call Using G Code with Decimal Point .............. 29 READER/PUNCHER INTERFACE ........................... 197
Macro Call Using M Code ............................................. 39 Reading of the graphic state (#8800) ........................... 165
Macro Call Using M Code (Specification of 3 Sets) ...... 40 Reading Program Information (#8527, #8528) ............ 233
MACRO COMPILER ............................................... 3,346 Reading the Path Number Currently under Execution
MACRO COMPILER AND MACRO EXECUTOR ....... 3 (#8531) ....................................................................... 12
MACRO EXECUTOR ..................................................... 5 Rectangular display (G204) ......................................... 162
MACRO EXECUTOR FUNCTION ............................ 115 Referencing and Writing CNC Programs ..................... 221
MACRO EXECUTOR FUNCTIONS .......................... 354 RELATIVE COORDINATE READ AND PRESET
Macro Modal Call Using G Code................................... 32 FUNCTIONS (#8996 TO #8999) ............................ 238
Macro Variable Input/Output Functions ...................... 201 Run Time and Parts Count ........................................... 274
MACRO VARIABLE LIST ........................................... 99
MACRO VARIABLES ........................................... 99,352 <S>
Marking (G321) ........................................................... 164 SAFETY PRECAUTIONS ........................................... s-1
MDI Key Image Reading Function (#8549)................. 182 Screen clear (G202) ..................................................... 128
MEMORY CARD CONTROL .................................... 213 Screen Control Function (#8510, #8571) ..................... 167
Method of Module Addition ............................................ 8 Screen Coordinate System ........................................... 121
Method of Variable Specification for Address N in the Screen Display Control Codes ..................................... 127
Programmable Data Input Mode ............................... 78 SCREEN DISPLAY FUNCTIONS ............................. 120
Modal Call (G66/G66.1) ................................................ 27
i-2
B-63943EN-2/07 INDEX
Screen Display Identification Variables (#8681 and
#8682)....................................................................... 127
Screen reading .............................................................. 167
Screen switching .......................................................... 170
Setting .......................................................................... 256
Setup Procedure ........................................................... 254
Shift function for graphic screen adjustment................ 165
Simple Call (G65) .......................................................... 27
Soft Key Frame Display Mask Function ...................... 171
Special Macro Call Using Axis Address ........................ 43
Special Macro Call Using D Code ................................. 50
Special Macro Call Using G Code ................................. 36
Special Macro Call Using H Code ................................. 52
Special Macro Call Using M Code................................. 41
Special Macro Call Using S Code .................................. 55
Special Macro Call Using T Code .................................. 47
Specification of a PMC Path in Multi-Path PMCs
(#8603) ..................................................................... 185
Specification of an extended axis name ......................... 76
State Display Mask Function on the Conversational
Macro Screen............................................................ 171
Subprogram Call (M98) ................................................. 57
Subprogram Call for User Program ................................ 65
Subprogram Call Using M Code .................................... 57
Subprogram Call Using M Code (Specification of 3
Sets) ............................................................................ 59
Subprogram Call Using M Code in the Specified Range
.................................................................................... 58
Subprogram Call Using S Code ..................................... 61
Subprogram Call Using Second Auxiliary Function
Code ........................................................................... 63
Subprogram Call Using Specific Code........................... 64
Subprogram Call Using T Code ..................................... 62
System, Servo, and PMC Series Information ............... 276
<T>
To detect an alarm for unselected PMC axis control.... 254
TORQUE LIMIT OVERRIDE CONTROL (#8990 TO
#8993 AND #8621 TO #8628) ................................ 242
<U>
User Help Screen Control Function ............................. 173
User-defined character registration and display function
(G319) ...................................................................... 150
<V>
Variable for checking whether a modal call is in
progress ...................................................................... 36
<W>
WINDOW FUNCTION (#8996 TO #8999)................. 263
Writing and Reading P-CODE Variables/Extended
P-CODE Variables between Paths........................... 105
Writing and Reading Pitch Error Compensation Data . 195
Writing and Reading the System Variables of Other
Paths ......................................................................... 108
Writing Setting Parameters and Parameters ................. 191
i-3
B-63943EN-2/07 REVISION RECORD
REVISION RECORD
Edition Date Contents
07 Dec., 2014 Addition of Series 0i-MODEL F
• Addition of following items
06 Mar., 2014 - General warnings for CNC application development
• Correction of errors
05 Sep., 2012 Addition of Series 35i-MODEL B, Power Motion i -MODEL A
• Addition of following items
- Macro Call Argument for Axis Name Expansion
04 Aug., 2011
• Addition and correction of parameters
• Correction of errors
03 Jul., 2010 Addition of Series 30i/31i/32i-MODEL B
02 Jul., 2009 Total revision
01 Jun., 2003
r-1
FANUC Series 30i/ 31i/ 32i-MODEL B
FANUC Series 0i-MODEL F
USB memory control in Macro executor
2. Summary of change
New, Add,
Applicable
Group Name / Outline Correct,
Date
Delete
Basic Function
Descriptions about USB memory control in
Optional Function Macro executor are added. Add Immediately
This function is included in Macro executor.
Unit
Maintenance
parts
This function is available in the following CNC control software.
FS30i-B :G301,G311,G321,G331,G351 / 66.0 or later
FS31i-B5 :G421,G431 / 66.0 or later
Notice
FS31i-B :G401,G411 / 66.0 or later
FS32i-B :G501,G511 / 66.0 or later
FS0i-F :D4G1,D6G1 / 05.0 or later
Correction
Another
Draw
B-63943EN-2/07-01 page 1/10
No.
Conversational
Execution
Auxiliary
Modal / Reference
G code Function
One-shot item
Draw
B-63943EN-2/07-01 page 2/10
No.
6.9.1 General
USB memory control can be executed using the same commands that are used for the reader/puncher interface
and Memory card control. USB memory control is enabled when bit 7 (EXT1) of compile parameter No. 9002
is set to 1.
Completion codes are also used, as with the reader/puncher interface and Memory card control.
See following section "Completion codes" for details of completion codes.
NOTE
This function is available in the following models.
- FANUC Series 30i/31i/32i-MODEL B
- FANUC Series 0i-MODEL F
6.9.2 Functions
USB memory open G330
- Format
G330 Pp Ll ;
P
= 18 : USB memory read control (Specify a file name.)
= 28 : USB memory write control (Specify a file name.)
= 38 : File control based on USB memory
L : Specify the start variable number of the variable string storing the file name.
In read mode, a search for the beginning of the file is made based on this file name.
In write mode, a new file is created using this file name.
- Explanation
By setting the lower one digit specified for P to "8", the USB memory is opened and made usable according to
the control method and control conditions.
Draw
B-63943EN-2/07-01 page 3/10
No.
NOTE
1 If bit 1 (SFU) of parameter No.11506 is set to 0, number of maximum characters
of file name is 32. Set 32 (space) to the next position of the file name.
2 If bit 1 (SFU) of parameter No.11506 is set to 1, number of maximum characters
of file name is 12. If a file name is shorter than 12 characters, set 32 (space) to
the next position of the file name.
3 Specify a file name + extension by using alphanumeric characters.
4 If head 8 characters of the file name is "FORFANUC", completion code 122 is
returned.
5 Only the files in the USB memory root directory can be found.
Example
G330 P18 L100 ;
If set following values in common variables #100 to #107, the file "ABC.DAT" is
found by above command.
Draw
B-63943EN-2/07-01 page 4/10
No.
NOTE
1 If bit 1 (SFU) of parameter No.11506 is set to 0, number of maximum characters
of file name is 32. Set 32 (space) to the next position of the file name.
2 If bit 1 (SFU) of parameter No.11506 is set to 1, number of maximum characters
of file name is 12. If a file name is shorter than 12 characters, set 32 (space) to
the next position of the file name.
3 Specify a file name + extension by using alphanumeric characters.
4 If head 8 characters of the file name is "FORFANUC", completion code 122 is
returned.
5 Files can be created only in the USB memory root directory.
Example
G330 P28 L100 ;
If set following values in common variables #100 to #107, the file "ABC.DAT" can
be created by above command.
- Explanation
This code ends USB memory control.
USB memory close processing is terminated normally at all times. (Completion code=0)
Draw
B-63943EN-2/07-01 page 5/10
No.
- Explanation
The file on USB memory is read from the beginning, one byte at a time, and the read data is assigned to the
specified macro variable. When there is no more data to read, completion code 121 is set.
For a byte read, open USB memory control in the read control mode (P=18).
The other addresses are the same as for screen display control (G243).
- Explanation
Data is output in a specified format. A specified character string is converted to ASCII codes for output.
Open USB memory control in the write control mode (P=28).
- Explanation
Macro variable data is read from USB memory opened in the read control mode, and is assigned to specified
macro variable.
This processing is the same as macro variable data input (G337) in the reader/puncher interface and Memory
card control, except that data is input from USB memory.
- Explanation
In the write control mode, the data of a specified macro variable is converted to a specified format for output.
This processing is the same as macro variable data output (G338) in the reader/puncher interface and Memory
card control, except that data is output to USB memory.
Draw
B-63943EN-2/07-01 page 6/10
No.
- Explanation
By specifying G339, file information on USB memory can be read and a file on USB memory can be deleted.
Before this function, the file information control mode must be set when the USB memory is opened (G330). To
set the file information control mode, specify p = 38 in address P when opening the USB memory. At this time,
the specification of a file (L) is not necessary. (G330 P38 ;)
G339 P1 Ff Ll Ss ;
NOTE
1 If bit 1 (SFU) of parameter No.11506 is set to 0, number of maximum characters
of file name is 32. Unused character positions for getting file name are set 32
(space) to make a 33-character file name.
2 If bit 1 (SFU) of parameter No.11506 is set to 1, number of maximum characters
of file name is 12. If a file name is shorter than 12 characters, Unused character
positions for getting file name are set 32 (space) to make a 12-character file
name.
3 Only file information of files in the USB memory root directory can be read.
4 If there is no file corresponding to the specified file number, completion code 114
is returned.
5 If USB memory is accessed by methods other than USB memory control, file
information read by G339 P1 command might be illegal. In this case, close USB
memory control once by G331.
Draw
B-63943EN-2/07-01 page 7/10
No.
G339 P2 Ll ;
L : Start number of the variable string where the name (ASCII code) of a file to be deleted is stored.
NOTE
1 If bit 1 (SFU) of parameter No.11506 is set to 0, number of maximum characters
of file name is 32. Set 32 (space) to the next position of the file name.
2 If bit 1 (SFU) of parameter No.11506 is set to 1, number of maximum characters
of file name is 12. If a file name is shorter than 12 characters, set 32 (space) to
the next position of the file name.
3 Specify a file name + extension by using alphanumeric characters.
4 If head 8 characters of the file name is "FORFANUC", completion code 122 is
returned.
5 Only the files in the USB memory root directory can be deleted.
Draw
B-63943EN-2/07-01 page 8/10
No.
When the command specified in an auxiliary macro program is completed, a completion code is set in both
variables #8537 and #8539. If the command specified in a conversational macro program is completed, a
completion code is set in both variables #8538 and #8539.
#8539 Description
0 Normal termination
1 USB memory is not opened.
6 A necessary option is not specified.
7 USB memory cannot be opened because it is used with another function.
Or, it is write-protected.
8 Data (P, Q, R, and so forth) specified in a block of G330 to G339 is incorrect, or necessary data is
not specified.
9 Invalid data format
10 The file number is invalid.
12 (1) The specified time has elapsed since the system entered the data transmission/reception
waiting state.
(2) The command has been interrupted by an NC reset while waiting for data input or output
when 1 is set in bit 1 (RCN) of parameter No. 9035.
30 USB memory not inserted yet
34 Initialization process of USB memory has not been completed yet.
99 With macro variable input function G337, the continuous reading of macro variables is possible.
102 Insufficient free space on USB memory
114 Specify file not found
115 The specified file is protected.
An undefined variable number was specified.
117 The file is not opened in a correct mode.
121 End of file
Draw
B-63943EN-2/07-01 page 9/10
No.
Draw
B-63943EN-2/07-01 page 10/10
No.