You are on page 1of 233

FANUC Series 0 / 0-Mate

Macro Compiler / Macro Executer

PROGRAMMING MANUAL

B-61393E-1/02
• No part of this manual may be reproduced in any form.
• All specifications and designs are subject to change without notice.

The export of this product is subject to the authorization of the government of the country
from where the product is exported.

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”.

This manual contains the program names or device names of other companies, some of
which are registered trademarks of respective owners. However, these names are not
followed by  or  in the main body.
CONTENTS

PROGRAMMING

l.OUTLlNE ........................................................... 1

2. MACRO COMPILER AND MACRO EXECUTER ................................ 3


2.1 Macro Compiler ................................................ 3
2.1.1 Equipment needed for compile ............................... 4
2.1.2 Equipment Connection ..................................... 5
2.1.3 Compiling Procedure (Main flow) .............................. 6
2.1.4 Compiling Procedure Using System P-G (details) .................. 7
\
2.15 Compiling Procedure by Series 0
(details) (Preparation of Source by System P-G) .................. 9
2.1.6 Table for editing by P-G Mate .............. A. \. 1. ..... / ....... 13
2.2 Macro Executor Controls ......................................... 14

3. EXECUTION MACRO .................................................. 15


3.1 Call Cod e and Program No. ....................................... 16
3.1 .l Calling subprogram 09000 by T code ......................... 17
3.1.2 Calling subprograms 09001 . 9003 by M code ................... 17
3.1.3 Calling a subprogram using specified codes ..................... 17
3.1.4 Calling macros 09010 . 9019 by G code ....................... 18
3.15 Modal call using G code ................................... 18
3.1.6 Calling macros 09020 . 9029 by M code ....................... 19
3.1.7 Calling a macro using a T code ............................. 19
3.1.8 Calling macros with a G code by specifying the range .............. 19
3.1.9 Function for calling macros with an axis address ................. 20
3.2 Argument Designation ........................................... 21
3.3 Limitation for Execution Macro ..................................... 22

4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION ........ 24


4.1 Conversational Macro ........................................... 24
4.2 Auxiliary Macro Function ......................................... 26
4.3 Execution Control Code .......................................... 27
4.4 Conversational Macro Execution Control Variable #8500, #8550, #8551 ........ 28
4.5 Notes ...................................................... 28

5. MACRO VARIABLES .................................................. 29


5.1 Macro Variables ............................................... 29
5.2 Local Variables
(#l to #33 or for referencing the P-CODE variables of array type, #l to #99) .... 29
5.3 Common Variables (HO0 to #149 and #500 to #531) ..................... 29
5.4 P-CODE Variables #lOOOO- ....................................... 29
5.5 Variables of Expanded P-CODE (#20000 ... ..) .......................... 30
5.6 Displaying Variables .. .. . .. . . ... ... .. . . .. . . .. . .. .. .. . .. .. . .. . . .. 32

6. FUNCTIONS OF THE MACRO EXECUTOR .................................. 33


6.1 Screen Control ................................................ 36
6.1.1 Coordinates system of screen .............................. 36
6.1.2 Screen display control code ................................ 39
6.1.3 Graphic painting function .................................. 45
6.1.4 Function screen control function ............................. 46
6.2 Address Functions ............................................. 47
6.3 Reading and Writing a PMC Address ................................ 48
6.4 Reader Puncher Interface Control by Conversational Macro ................ 49
6.4.1 Outline ............................................... 49
6.4.2 Function details ......................................... 50
6.4.3 Inputting and outputting macro variables ....................... 53
6.4.4 Extending the function for inputting and outputting a macro variable .... 55
6.4.5 FANUC floppy cassette control .............................. 57
6.4.6 End code (#8539) ....................................... 61
6.5 Referencing and Reading NC Program with Conversational Macro ........... 61
6.5.1 Outline ............................................... 61
6.5.2 Recording of a new program ............................... 62
6.5.3 Deleting a program ...................................... 63
6.5.4 Reading a specified block ................................. 63
6.5.5 Block writing ........................................... 64
6.5.6 Block deletion .......................................... 66
6.5.7 End code (88529) ....................................... 67
6.5.8 Notes ................................................ 67
6.5.9 Address code table ...................................... 67
6.6 Continuous Input by Cursor and Page Key ............................ 68
6.7 Masking of 0, N Number Appearance ................................ 68
6.8 Reading and Presetting Cutting Time
and Cutting Distance by Conversational Macro ......................... 68
6.8.1 Reading and presetting cutting time (#8553) .................... 68
6.8.2 Reading and presetting cutting distance (#8554) .................. 68
6.9 Reading and Presetting Relative Coordinates by Conversational Macro ........ 69
6.9.1 Reading relative coordinates ................................ 69
6.9.2 Presetting relative coordinates .............................. 69
6.10 Key-Input and Data-Input Control ................................... 70
6.11 Cursor Control ................................................ 72
6.12 Processing Array Type P-CODE Variables ............................. 72
6.13 Torque Limit Control ............................................ 74
6.14 Data Reading of A/D Converter .................................... 75
6.15 PMC Axis Control .............................................. 75
6.15.1 PMC axis control by the G code ............................. 75
6.15.2 PMC axis control by variables ............................... 78
6.16 Interlock Function for Axis Direction ................................. 80
6.17 Function for Separating Ul from UO of the P-CODE Program ............... 81
6.18 Referencing Common Variables of Custom Macros ...................... 82
6.19 Function for Finding a P-CODE Work Number .......................... 82
6.20 Function for Calling a User Program by an Execution Macro ................ 83
6.20.1 Function .............................................. 83
6.20.2 Calling format .......................................... 83
6.20.3 Notes ................................................ 83
6.21 Operation Functions (Logarithm, Exponent, Arcsine, Arccosine) ............. 84
6.21 .l Overview ............................................. 84
6.21.2 Operation ............................................. 84
6.22 Function for Identifying the Pressed MDI Key Using a Conversational Macro . l .. 85
6.22.1 Overview ............................................. 85
6.22.2 Function .............................................. 85
6.22.3 Example .............................................. 85
6.22.4 Key image correspondence ................................ 85
6.23 Wtndow Function .............................................. 88
6.23.1 Overview .............................................. 88
6.23.2 Referenced system information .............................. 89
6.23.3 Detailed description of reference system information ............... 91
6.24 Internal Code ................................................ 102
6.25 Internal Code (Hangwr) ......................................... 107

7. FUNCTIONS FOR STOPPING A CONVERSATIONAL MACRO ................... 108

APPENDIX

APPENDIX 1. MACRO PROGRAM EXAMPLE .. ... .. . . .. .. .. . .. . ... . . .. . .. . .. Al-l


APPENDIX 2. MACRO COMPLIER OPERATION . .. .. . .. . ... . .. .. . .. . .. . . .. . .. A2-1
APPENDIX 3. DATA ON MACRO COMPILER . ... .. .. . .. . .. .. .. . .. .. . . .. . . ... A3-1
APPENDIX 4. SERIES 0 MACRO COMPILER/MACRO EXECUTER WITH GRAPHIC
CONVERSATION . . .. .. . ... ... .. .. .. . .. . .. ... . .. . .. . .. . . .. . A4-1
APPENDIX 5. FANUC Series 0-TTC MACRO COMPILER/MACRO EXECUTER .. . .. . .. A5-1
APPENDIX 6. MACRO VARIABLES USED IN THE MACRO EXECUTOR FUNCTIONS . .. A6-1
APPENDlX 7. G CODES THAT CAN BE USED BY THE CONVERSATIONAL
AND AUXILIARY MACROS . .... ... .. . . .. .. . .. .. . ... . .. . . . .. .. A7-1
PROGRAMMING
1. GENERAL

1. OUTLINE
NC programs include those which are prepared by custom macro and very seldom altered and
those which may differ from one another according to relevant machining such as part programs.
A batch handling of these programs of different characters may cause t quicker battery
consumption, or spoil the custom macro in case of misoperation.
To solve a problem, this function will convert the custom macro prepared by a machine tool
builders into an execution format, register it to the ROM cassette, and enables it to be executed.

(1) Since the custom macro is converted into an execution format and registered, the execution
speed is high. This will shorten the machining time and improve the machining accuracy.

(2) The registration to the ROM eliminates battery consumption and prevents custom macro
damage through misoperation. This will improve the reliability.

(3) Since the registered program is not indicated on the program display, the machine tool
builder’s knowhow can be protected.

(4) Since the custom macro is registered in the ROM, the program edit memory can effectively be
used.

(5) The user can call the macro 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.

(6) The Series 0 can compile custom macro programs and register them to the ROM.

(7) Conversational macro function can compile machine tool builders original screen.
1. GENERAL

The models covered by this manual, and their abbreviations are :

Model name Abbreviation

FANUC Series 0 - TC 0-TC Series 0

FANUC Series O-MC O-MC

FANUC Series 0 - TF 0- TF

FANUC Series 0 - MF 0-MF

FANUC Series 0 - GC o-GC

FANUC Series 0 -TTC o- TTC


- -~~
FANUC Series 0 - Mate TC 0 - Mate TC Series O-Mate
I

FANUC Series 0 - Mate MC 0 - Mate MC


.
FANUC Series 0 - Mate MF 0 - Mate MF

Page keys can be used to display the screens for other variables.
The words used in the explanation are defined as follows.

” P-CODE program” -----


Execution type macro program prepared by a machine tool builder, being compiled and
registered to ROM.
” Execution macro” ---
Program to operate machine in P-CODE program.
“Auxiliary macro” ---
Program to make an auxiliary operation for the execution macro and the conversational macro
in P-CODE program.
“Conversational macro” ---
Program to operate screen in P-CODE program
” User program” -----
Program prepared by end-user for program edit memory.
2. MACRO COMPILER

2 0 MACRO COMPILER AND MACRO EXECUTER


. Macro Compiler
21
The NC program is converted into an execution form (P-CODE program), output to the ROM
cassette, and registered into a ROM. Mount the prepared ROM cassette on the Series 0 to
execute the registered P-CODE program to be called from the user program by means of G, M and
T codes or specified code set by parameter.

Custom macto

(Note) FAPT MACRO Compiler/Executor can be used to compile macro programs, created with
the macro language, on a PC (personal computer). For details, refer to the FAPT MACRO
COMPILER (for PC) Programming Manual (B-661 02E).
2. MACRO COMPILER

21.1 Equipment needed for compile

Micro cassette
l 64 Kbyte + AOZB-009 I -C 11 I

;ce,
Macro compiler cassette
l 0-TC 4 AOZB-0091-3551 #OA46
l O-MC + AOZB-0091-3551 ROA45
Series 0
Main Unit

NC main unit built-in additional option (MACRO executer)


.O-TC + AOZB-0098-3920
. O-MC 4 A02B-0099-3920

P-G ..
P-G Mate
both allowed .

Note) The macro compiler having the conversational


program input function does not support compilation using
the Series 0.

(Preparation and edit of source program)


2. MACRO COMPILER

Series MACRO Compiler Developing Equipment (When P-G is used)

P-G Mate 0 P-G Mate


l MACRO compiler AOBB-0036-J540/
/%I Version 03.1 or later
l MACRO library AOBB-0036-3541/
Version 03.1 or later
U

cl
0

7
disk
(prepared at
cutomer’s end)
/
MACRO cassette
064 Kbyte + AOZB-009LClll
l 128 Kbyte -) AOZB-009LC113
0256 Kbyte + AOZB-0091-Cl15 P-G Mark II
0512 Kbyte 4 A02B-0091C117 *MACRO compiler A08B-003LJ540
l l Mbyte + A02B-0098C118 *MACRO library AOBB-0036-3541

Note) See Appendix 4 for macro compiler with graphic


conversion function.

2.1.2 Equipment Connection

(1) When system P-G used:


Connect PMC WRITER to CN2 or CN3 for P-G.

I n
PMC
WRITER
MODEL D

(Note) Use CNl normally for PPR.


2. MACRO COMPILER

(2) When compiling with Series 0:


Connect PMC writer to Series 0 reader/punch interface.

cl Series0

Reader punch
interface

PMC
WRITER
MODEL 0

2.1.3 Compiling Procedure (Main flow)

(1) When System P-G is used:

(START)

I
Source
program
preparation
,
I
Compile * If a compiling error
parameter occurs, correct a
source program and
re-start compiling.
I I
.

Test compile
b *
I
2. MACRO COMPILER

(2) When compiling with Series 0:

(START)

Compile *Compiling may cause


parameter damage;therefore,
setting check.

Source *Not required when a


program source program is
transfer
1 created with MDI of
I , Series 0.
Test Compile *Load a macro
4
compiler ROM
cassette to Series 0.
ROM write

1performance 1

2.1.4 Compiling Procedure Using System P-G (details)

Equipment connection
Connect PMC writer to CN2 or CN3 of P-G.
Generally, connect FANUC PPR to CNl.

P-G power On
Turn P-G power ON.

System loading
Load the FAPT MACRO compiler system disk to either drive unit.
Keep pressing the “LOAD” key on the left upper side of the keyboard for a few seconds.
When the menu is displayed, loading operation is completed.

Source program input and correction


For detailed operation method, refer to APPENDIX.
Require loading the executer.
“R2” (Display and edit)
No. = “1” (Custom MACRO program display and edit) [NL]

Input from keyboard


” [FO] = OFF, [Fl] = OFF, [ FZ] = OFF”
PROGRAM = “IN” [NL]
INPUT = “Oxxxx” [NL],”
Date [NL] ’ ’ ’ ’
only “[NL]” at the last
2. MACRO COMPILER

(b Read from floppy disk


l “[FO] = OFF, [Fl] = OFF, [F2] = OFF”
l PROGRAM = “IN” [NL]
l FD = “OK-@File Name [NL]
or “OK -: File NO. [NL]
mm mm.
- l Space

(c) Progran correction within memory


. “[FO] = OFF, [Fl] = OFF, [F2] = OFF”
. PROGRAM = “Oxxxx” [NL]
l Correct a program, using a screen editor.

Compile parameter setting


Not required when the compile parameter is already set.
For no initial screen, press [NL] a few times.
“RI” (setting)
NO. = ” I” (Parameter) [ NL]
No. = ” 1” (parameter setting) [NL]
Set the parameter, using the screen editor with “CHG”.
“RO” (End) when the setting of all parameters is completed
Only [NL] (End of program)

Test compile
For no initial screen, press [NL] a few times.
“RO” (Start)
“IF31 = ON ” : Displays a source program during compile.
“[ F3) = OFF” : Displays only program No. during compile.
No. = “1” (Test compile) [NL]
If an error occurs during, compile by correcting a program.

PMC writer Channel Setting


“Rl” (setting)
No. = “2 ” (ROM writer) [ NL]
The current ROM writer channel setting conditions are displayed on the CRT screen.
CNl = : ” ON” (NC] : The channel is used.
. “OFF” [NL] : The channel is not used.
l

: only [NL] : No setting is changed.


CN2 = : Same as above. a
CN3 = : Same as above.
BUILT-IN ROM WRITER =
: Same as above (only P-G Mate)
No . = [NL] (End)

Preparations for PMC writer


Install the erased ROM cassette to the PMC writer.
Turn the PMC writer power ON.
2. MACRO COMPILER

Check that PMC writer “RDY” (qreen) is ON.

ROM writing
For no initial screen, press [NL] a few times.
“ RO” (start)
“[F7] = OFF, F9 = ON” : (PMC writer selection)
“tF3] = ON ” : Displays a source program during compiling.
” [F3] = OFF” : Displays only program No. during compiling.
No. = : ‘*2” : (ROM writing) [NC]
PMC writer PC CASSETTE ROM MODULE lamp flickers, starting data writing to ROM.
Writing is completed within a few minutes to 10 minutes or so.
If compile parameter “9000.0 = 0” is selected, no comparison after ROM writing is made, thus
making it possible to reduce the writing time.

(10) Performance Check


Install ROM cassette after writing to “PAS” socket on the master PCB of Series 0 to check the
operation.
PWE = 1 in the setting screen :
When power is ON while pressing “DELET” key, the 10, 000 level variables for conversational
MACRO and program within RAM are cleared

2.1.5 Compiling Procedure by Series 0 (details) (Preparation of Source by System P-G)

(1) ROM cassette loading


Install MACRO compiler ROM cassette to “PAS” socket on the master PCB of Series 0.

(2) Equipment connection


Connect Series 0 reader punch interface and SYSTEM P-G or PPR.
(This is not required when a source program is prepared from MDI of Series 0.)

(3) Power ON.


Turn Series 0 and SYSTEM P-G power ON.

(4 Series 0 Port SETTING


Set Series 0 baud rate, etc.
(This is not required when a program is prepared with Series 0.)
0 Select “MDI” mode.
0 Select “PARAM” (parameter) screen.
0 “No. “, ‘IO”, “INPUT”,
l/O = “0”) “INPUT” (Select Device No.0)
CD “Page 1”
PWE = ” I”, “INPUT” (Parameters can be written)

Parameter
L%!lEI
2. MACRO COMPILER

“No. “, “2”) “INPUT”


“1-0*1”, “lNPUT”(Set the stop bit to 2 bits) (Select RS232C)

(No feed output is performed before or after data.)


% * parts should be made equal to the original value.

q:
4

Parameter 002 1 * * * * 0 * 1

“No. ‘)) X52”, ” INPUT”


” 10") “INPUT” (Set the baud rate to 4800)

Parameter PI)11

Since alarm 100 is lighting, press “CAN” and “RESET” keys at the same time to reset the

Series 0 additional parameter:

7 6 5432 10

Parameter 019 *+ NEOP ++ ++ ++


cl:

NEOP When M02,M30 and M99 is registered in MEMORY.


0: Assumed as end of program.
1: Not assumed as end of program.

P-G Side Port Setting


% This not required when a program is prepared with Series 0.
Turn SYSTEM P-G power ON, and load “FAPT MACRO COMPILER”as an example here.
” R3” (Request) [ NL]
REQUEST = “IO,NC, CN2, F11, F12” [NL]
CN2 : Connector No.connected with Series 0
F11 : F key setting for input with Series 0
F12 : F key setting for output with Series 0
REQUEST = [NL] only (Return to Initial Screen)

COMPILE Parameter Setting


Set the parameter required for compiling.
The compiling parameter may be affected by the compiling operation.
Be sure to check it.
Select the “MDI” mode.
Select the “PARAM” (parameter) screen.
” No. “, “9000”) ” INPUT”
” Setting Data”, “INPUT” (Change all required parts)
% When reading A F6 format program:

-lO-
2. MACRO COMPILER

,
Parameter 9000 1 t******
.
0:
If the MACRO compiler ROM cassette is not installed, the 9,000 level parameters are not
displayed.

Preparations for Series 0 side reading


Place Series 0 side in read waiting conditions.
% This is not required when a program is prepared with Series 0.
Select “EDIT” mode
“Program Protect = OFF“ (Program can be edited)
All program deleted
(a) “PROGRAM” screen selection
(b) “0 “, “-9999”, “DELET”
Directory display of registered program
(a) “PROGRAM ” screen selection
(b) After checking that all program have been deleted with “P” and “INPUT”, press the
“RESET” key.
“INPUT” (start reading)
LSK flashes, at the lower right corner of the screen.

P-G Side Transfer Start


% This is not required when a program is prepared with Series 0.
When the display is not the initial screen, press [NL] a few times.
“R2” (Display and edit)
NO. = “1” (Custom MACRO program display and correction)
“F12 = ON” “F7 = OFF”
PROGRAM = “OUT, ALL” [NL]
Executinq flashes at the lower right corner of the P-G screen.
LSK at the lower right corner of the Series 0 program screen stops flashing, and Program No.at
the upper right corner of the screen displays the Program No.being read.
lf an F6 format program is read with Series O-Model A, there is no correct display, but data
is input correctly in the memory.
x Except for the FAPT MACRO COMPILER for example “FAPT TRACER”, the output code
on the “Setting” screen should be “ISO”.
When the transfer of all program is completed, check the Program No. directory with “P”and
“INPUT”on the Series 0 side “PROGRAM” screen, and press “RESET”.

Connect PMC Writer


Power turn off, and connect the PMC WRITER to the Series 0 reader punch interface.

(10) Compiler Start


While pressing the “CAN” and “PROGRAM” keys, turn Series 0 power ON.
Do not release the key until the compiler screen appears.

-1l-
2. MACRO COMPILER

(11) lest Compiier


0 Press *’1” (Test Compiler)
MDI *@START”.
@ When “NO. INPUT AND START” is displayed in the center of the screen, the compiling ends.
If an error occurs during compiling, the program can be corrected.

(12) PMC Writer Preparations


0 install the erased ROM cassette on the PMC writer.
@ Turn the power of PMC writer ON.
@ Check that PMC writer RDY (GREEN) is ON.

(13) ROM Writing


@ Press “2” (COMPILE & ROM WRITE), MDI “START”.
@ PMC writer PC CASSETTE. ROM MODULE lamp flashes, starting writing to ROM.
@I Writing ends in less than 10 minutes.
% If compile parameter “9000.0 = 0" is selected, no comparison after ROM writing is made,
thus making it possible to reduce the writing time.

(14) Performance Check


With the ROM cassette installed after writing in the “PAS” socket on Series 0 master PCB,
check the performance.
PWE = 1 of parameter No.0:
While pressing the “DELET” key, turn the power ON: the 10, 000 level variables for
conversational MACRO and program within RAM are cleared.

7 6 543210

Parameter 038 RSCM NEOQ


cl

0 1 0 1 Bubble cassette

-12-
2. MACRO COMPILER

21.6 Table for editing by P-G Mate

Job Keyboard input


M jor ’ Command (entedK1 at end of Notes
classiPication Minor classification command)
Data input Paper tape, keyboard, INPUT IN[. @string] Input terminated by the

/ floppy disk string specified

Addition from keyboard KEYIN K-OLD, line number, Data added several line at a
increment time
I
Data display Display filenames for FDLIST FDL
files on floppy disk
Any line LIST L (-line number] Display from the specified
line number
Lines containing the LIST L _ @string @
specified string
Data output Punch space SPACE SP-n Punch n spaces

I Punch feed FEED FE-n Punch n feeds


Output to paper tape, OUTPUT OUT[- @string]
floppy disk
Replacement Alter a whole line ALTER Line number -1 line of data
Alter part of a line ALTER L1, @string l @I Replace ALL or n strings
I, @string2 @I, { i,L ) with string 1
Replace address REPLACE Replace character 1with
character character2
Reverse order of 2 CHANGE R, characteWcharacter2 Change the order in one
address data characters t. characterl/characterZ block
Insertion Insert 1 line of data INSERT Line number.1 line of
data
I
Insert string INSERT [-@string l@ Insert string2 after string 1

, I, @string2@11, { GL )
Copy and add a MOVE MOV [line number 1, line Copy and add the data
specified block num ber2] from line number1 to line
number2
Deletion Deletion n whole lines DELETE Line number1 [, line Delet the data from line
number21 number1 to line number2
,
Delete string DELETE D-@character@,
n
{ ALL 1
Delete address data ADELETE AD. address character
Delete lines containing a BDELETE BD,atring The string can be an
particular string address character
Scaling to Multiple of a specific SCALE S-address character/n n is the stalling factor
require values address
Multiple of incremental ASCALE AS-address character/n n is the stalling factor
NC data
Adding and sorting sequence numbers SEQNO SEQJntial value If n is given, add a sequence
[,increment [,n J] number every n blocks
Copy paper tape COPY COPY Copies any sort of data on
paper tape.
Modification Renumber lines RENUMBER REN [,intial value
support I,increment)j
Change character used EOB EOB-Character

, to display EOB
Display list of commands HELP H
NC data TH, TV check THTV THTV Read in NC data from tape
reader, and check TH, TV’

-13-
2. MACRO COMPILER

Job Keyboard input


Command (enteax] at end of Notes
Mpior . Minor classification command)
classi rcatron
Modification Advance pointer FIND Advance pointer by n lines
F- C &string@ I[nnI
support Advance to a line contain-
ing a particular string
I
Move pointer back RACK Bn Move pointer back n lines.
If n is omitted, move
pointer back to preceding
line
Comment * *comment string insert any comment after *
Processcontrol Start editing EDIT
ED. ( ‘;ET 1 [, ( ::o” } 1
Change data type and MODE
M-IF$F) L (;;)I
code syatem
End editing END E
Special Change from integer POINT
PO-Xl /nl[ ,Xi/ni ] Fwz
conversion NVC data to floating
point NC data
Change from floating INTEGER INT-Xl In1 [ ,Xi/ni] Fs2
point NC data to integer

LNC data
ADD a specified amount ADD ADD-Xl In1 [,Xi/ni J Fz2

2.2 Macro Executor Controls

The macro executor controls the execution of the P-CODE program created by the macro compiler.

The P-CODE program (execution macro) stored in the ROM can be called and executed by
specifying G, M, T or original code set by parameter during compilation in the user program. .

Custom macros can be created and executed in the user program, independently of P-CODE
program.

-14-
3. EXECUTION MACRO

3. EXECUTION MACRO
Only a registered P-CODE program cannot be executed. It is called from the user program by G,
M, T code, or specified code by parameter setting, and executed. In case of macro call, argument
designation is possible, and it is compared as a local variable at the P-CODE (execution macro)
side.
Moreover, if a minus value is set to a parameter for macro call by G code, modal call of P-CODE
program can be done by corresponding G code. Refer to 3.1.5 for details.

User program Q-CODE program


(Program edit memory) (ROM registration)

00001; I 09010; I

G92X0.0Y0.0; G code call #1=#2+#4;


COO X 100.0 Y20.0; I 001;
.
M code call
GlOl ;fUDl;
<Argument .r code callI ..
designation > .
3ipecial code c:all
M99;

J---
MO2;
d
:---
I Compile
-1

i parameter
! 9013[yicq
L ------- -1

(Note) Execution macros can be called in MDI mode, but only when the MDI-B function is
provided. Execution macros cannot be called in ordinary MDI mode.

-15-
3. EXECUTION MACRO

3.1 Call Code and Program No.


To call a P-CODE program from the user program, the codes shown in Table 3.1 are used.

Table 3.1 Codes for Calling P-CODE program


m
Program Common variables in
codes for call Type of call numbers which a specified Parameters to be set
Called code is stored
.

T Subprogram call 9000 #I49 Compile parameter TCAL(No.9002W)

M Subprogram call 9ooo9oO3 None Compile parameters No.90 1O-90 12

Compile parameter AC11 ,ACL2


9004
Specified code Subprogram call #146,#14? (No.9002#1 ,n2)
9005 NC parameters (No. 0244, 0245)
Macro call, - Compile parameters No.901 3-9022,
G 90tO-9019 None
Modal call No.9034

M Macro call 9020-9029 None Compile parameters No.9023-9032

Compile parameter ,.
T Macro call 9008 #27
TMACC(No.9005#7)
.
M (range
Sbprogram call 9009 #148 Compile parameters No.9042,9043 .
specification)
G (range
Macro call Parameter None Compile parameters No.90459047
specification)
.

Compile parameter
Address for axis Macro call 9009 #27
A>CCL(No.9005#0-#3, No.9008#0-#3)

(Note) These codes cannot be used in combination. For example, a macro call by a T code
cannot be executed together with a subprogram call by an M code.

Correspondence between codes that call macro programs or subprograms and program numbers
of called programs, and whether or not to call a subprogram or a macro , are determined by
compile parameters. Since these parameters are registered to the ROM at compilation, be sure to
designate them at compilation. Exclusive codes that call subprograms shall be set to CNC
parameter (No, 0244, 0245) in executing.

(1) The return sequence number definition for returning to the user’s program
When operational control is returned to the user’s program from the P-CODE program,
control passes to the sequence number of the user’s program defined by address P.

User’s program P-CODE program


00001;

ClOOX123Y456; ) 09010;
(300x789; #100=#24+#25;
.
N 1OOCOOY
999; M99PlOO;

M02;

-169
3. EXECUTION MACRO

(2) Difference between Subprogram Call (T, M) and Macro Call (G, M)

(a) Argument designation can be made in macro call. In subprogram call, however, argument
designation is not possible without T code, special code and call code.

(w In subprogram call, after execution of another command than T- or M-code, it will branch to
a subprogram. In macro call, however, it will branch off without doing anything.

(c) In subprogram call, single block stop is made when another command than T- or M-code is
commanded. In macro call, however, no stop is made.

3.1.1 Calling subprogram 09000 by T code

The P-CODE program 09000 registered to the ROM can be called by a T code.
The commanded T code is stored as an argument in the common variable #149.
All the local variables will become <Vacant > .

N-- G-- x w- Y -- T< tttt >;

3.1.2 Calling subprograms 09001 - 9003 by M code

By commanding M codes which is designated by compilation parameter, the programs 09001,


09002, 09003” registered to the ROM can be called for subprograms. All the local variables are a
Blank ).
N-- G -- X -- Y -- M<mm> 9
l

3.1.3 Calling I ia subprogram using specified codes

By setting character codes (decimal notation of ASCII codes) to the parameters (No. 0244, 0245)
of CNC, the P-CODE program (09004, 09005) corresponding to the address can be called as a
subprogram. The defined integer will be stored as a parameter to the macro variable (#146, #l47).
The actual use of this function is decided by specifying the appropiate compilation parameter
(No. 9002#1, 9002#2, ACLl, ACL2).

Example) Compiler parameter (No. 9002#1, ACL = 1)


When parameter No. 0244 = 66 at execution

User’s program P-CODE program


00001;
.

cooxl*3Y456B1oo; 09004;(#146 = 100.)


..

M02; t

Definable addresses for O-T/O-G: A, B, D, F, H, 1, J, K M Q, R S T


Definable addresses for O-M: A, B, F, H, f, K M, Q, R S, T

(Note 1) A decimal point can be specified for those addresses for which it is valid.
(Note 2) When B is used as the address for calling a subprogram:
For the O-M, a decimal point can be specified in an argument.
For the O-T/O-G, a decimal point cannot be specified in an argument.

-17-
3. EXECUTION MACRO

When the NC axes include the B-axis:


For the O-M, axis movement takes precedence.
For the O-T, subprogram call takes precedence.

3.1.4 Calling macros 09010 - 9019 by G code

By commanding G codes which is designated by compilation parameter (No. 9013 to 9022), the
macro programs “09010-09019” registered to the ROM can be called.
Local variables without argument designation are < Vacant > .

N-- G < gg> c Argument designation > ;

(Note 1) GO0 cannot be specified as the calling G code.

3.1.5 Modal call using G code

A modal call can be used to call a macro when using G code.


When calling a G code is specified with a compilation parameter, continuous-state calling can be
specified using a negative number.
Continuous-state calling is canceled with G167 or the G code specified by compilation parameter
9034.
During continuous-state calling, the values of address of each block for the user program are all
arguments.

Example) When compilation parameter 9013 = - 100

User’s program P-CODE program


0000 1;
..

GlOOX123Y456; * 09010
X709 2678; w for each block the defined address is called
.. * as a parameter of “09010” and executed.
..
C167;
(Modal call cancelled or code set to
compile parameter No. 9034.)

Multiple modal calls is not permitted.

(Note 1) GO0 cannot be specified Ias the calling G code.

480
3. EXECUTION MACRO

3.1.6 Calling macros 09020 - 9029 by M code

By commanding M codes which is designated by compilation parameter (No. 9023 to 9032). the
programs “09020 - 09029” registered to the ROM can be called.

Local variables without argument designation will become <Vacant ) .

N_D M <mm > < Argument designation > ;

3.1.7 Calling a macro using a T code

By setting compile parameter TMACC(No.9005#7) to 1, program of 09008 registered to ROM can


be called macros by specifying a T code in a user program.
All addresses specified in this block are used as arguments except that the T code is transferred to
#27, values for address P and L are transferred to #16 and #12, respectively. Also G codes are
transferred to variables #28 to #32 for each group.
Be sure that addresses shall be those availabe for CNC and the significant digits are those
specified by the CNC.

Variable Data to be transferred


I
#1 dt26 I Address data for each variable
#27 T code
#28 -1 G code
#29 G code
#30 G code
#31 G code
#32 7 G code

Example) G91 G28X123.45678T5678:


#24 = 123.456
#27 = 5678.0
#28 = 28.0
#29 = 91 .o
Other variables = < vacant )

3.1.8 Calling macros with a G code by specifying the range


The code specified by compilation parameters 9045 to 9047 can be used to call the programs
registered in ROM.
Specifying call arguments is the same as calling macros with G code (3.1.4).

Specify the following for parameters 9045 to 9047:


Parameter 9045 : G code to start calling
Parameter 9046 : Number of P-CODE programs
Parameter 9047 : Number of the program to be called first

-19-
3. EXECUTION MACRO

For example, suppose programs are compiled with 200 specified for parameter 9045, 100 specified
for parameter 9046, and 1000 specified for parameter 9047. When G2OOto G299 are specified,
100 programs from 01000 to 01099 compiled on the ROM can be called.

(Note 1) Specifying call arguments is the same as calling macros with the G code specified by
compilation parameters 9013 to 9022.

(Note 2) Continuous-state calling cannot be specified.

(Note 3) When the G code specified with compilation parameters 9013 to 9022 is specified, the
specified parameters 9013 to 9022 are effective.
Parameter 9013 = 250
Parameter 9045 = 200
Parameter 9046 = 100
Parameter 9047 = 1000
When G250 is issued with the settings above, program 09010 is called.

(Note 4) (3167 cannot be used as the calling G code (modal call cancel G code).

3.1.9 Function for calling macros with an axis address

Axis address commands enable calling macros.


When AXlCL to AC4CL of compilation parameter 9005#0 to #3 are set to 1, the programs
registered to ROM can be called by the axis address command.
Always program 09009 is called irrespective of specified axes.
In this case, ail the addresses in the block specified axis address are passed for use as arguments.
However, the specified axis address is passed to variable 27. Addresses P and L are passed to
variable 16 and 12, respectively, for use as arguments. Up to five G codes in each G code group
are passed to variables 28 to 32 starting from the group with the lowest number. When a G code
of G code group 01 exists, G80 may be generated and assigned to #28 to #32.

\
Variable No. Address
I
#l to #26 Usual argument address

#27 Specified axis address (1st to 8th)

#28 Specified G code

#29 Specified G code


.
#30 Specified G code

#31 Specified G code


b
#32 Specified G code
P

If the following are specified when a 4th.axis address is B, for example:


G91 G2861.234567X123.4567;

-200
3. EXECUTION MACRO

The settings are passed to variables as follows:


123.456 to variable #24
1.234 to variable #27
28.0 to variable #28
91 .O to variable #29
Other variables: Null

(Note) The addresses those can be used and the range of the values specified to those
addresses are the same as those allowed to each CNC model concerned.

The addresses transferred as arguments specified in a block used to call a macro make changes
modal information of the CNC when calling the macro. In the above example, the CNC model of
absolute/incremental command changes to G91 (incremental command) when a macro is called.

3.2 Argument Designation


Argument designation is possible when calling a call. It can be referred to as a local variable at the
P-CODE program side. Argument specification I and argument specification II are possible.
For arguments designation, negative symbol and decimal point can be used irrespective of the
address.

Table 3.2 (a) Argument specification I at P-CODE program call


Address of argument Local variable Address of argument Local variable
specification I No. specification I No.
A I ~~ #1 p-II N I #14

B I #2 II P I #16
C I #3 II Q I #17
I I #4 II R I #18
J I #5 II S I #I9
K I #6 II T I #20
D I #7 II U I ~- #21
E I #8 II V I #22
F I #9 II W I #23
G I #lo II X I #24
H I #ll II Y I #25
L I n12 II -~ z -1 #26
M I n13 II I

Table 3.2 (b) Argument specification II at P-CODE program call


Address of argument Localvariable Address of argument Local variable
specification 11 I No. specification II I No.
A I #l Kl I ~~ #6
B #2 .
. .
I
C I n3
I1 I #4 JlO I #32
31 I #5 KlO I #33

-21-
3. EXECUTION MACRO

3.3 Limitation for Execution Macro


Source program of execution macro should be programmed in the same way as for custom macro
8. But, there are some limits for execution.

(1) Macro call


Macro call from an execution macro is executed with *‘G65” as the custom macro B. In the
execution macro , since it is a macro program itself to be called from the user program with G
(M, T) code or specified code, it is impossible to use a G CODE call, etc. from execution
macro.

G65 P (Program No.) L (Number of repetition) <Argument specification ) ;

(2) Argument specification


Argument specification is the same as the custom macro B.

(3) Variable
Expression, argument, etc. of variables are the same as those of the Custom macro B.

(Note) Common variables referred by a P-CODE program and Common variables referred by
user program are completely different.
Refer to “5.3 Common variable”.
(a) P-CODE variable (#lOOOO - )
Any number of 100 unit of P-CODE exclusive variables starting from #lOOOO can be used.
Since it can be used from execution, it is considered as extension of common variable
#500.
However, execution macro cannot refer to P-CODE variable in arrangement type.
For details, refer to “5.4 P-CODE exclusive variable”.

Operation command
Operation commands can be used as with the custom macro 8.

Control command
Both divergence and repetition commands can be used.

IF < Conditional expression > GOT0 n;


WHILE < Conditional expression ) DO m;
END m;(m = 1,2,3)

Modal call from execution macro


Modal call cannot be made.

Macro and subprogram multiplexity in execution macro.


Separately from the user program multiplexity, 4-stack nesting of macro program, and 4-stack
nesting of subprogram are possible on the execution macro.

-220
3. EXECUTION MACRO

(8) Cautions

a) Separate registration of a program cannot be made. Max. 200 programs can be registered
to the ROM.

W In one program, limit the sequence number used for branch destination (GOTO) to 99. In
one program, the same sequence No. cannot be designated for others.

Cl One block can accept designation of only one sequence number. Except the program No.
“0” and the optional block skip “I”, designate a sequence No. at the block head.
(Example)
00901ONlOX100.0; .. .. .. . . OK
/N20Y200.0; . .. .... .. .. .. . OK
N30#1=#5; ... .... .. .. . .. OK

GOOX 00.0N40Y200.0; . .. .. . ERROR


#3=#5+#6N50; .... .. . .. .. ERROR
N60N702300.0; .... .. .. .. . ERROR

d) The end of program must end with EOB (‘I;“) or EOR (‘I%“).
(Example)
09010;
.

i’J1 OOM99; .. .. ... ... . .. .. OK


%

09011;
.

NIOOM99;
NllO . . . . . . . . . . . . . . . . . . . ERROR
%

In 0-TC/GCmTC multiple repetitive canned cycle cannot be executed in the P-CODE


program. In case a program including a multiple repetitive canned cycle is registered and
executed, the function cannot be guaranteed.

In O-TC/GCATC programming through direct drawing dimensions programming cannot be


made in the P-CODE program.
In case a program made through direct drawing dimension input is registered and executed
the function cannot be guaranteed.

-230
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION

4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY


MACRO FUNCTION
4.1 Conversational Macro
The conversational macro function executes a program compiled by the macro compiler
independently of the normal NC part program. This function basically is not affected by operation
modes of NC . Accordingly, it works concurrently with the NC part program under execution
independently even during the memory operation.

(Note) 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.

1
- Part program storage memory ROM
M code call
. , 1 code call r P-CODE e-1
r
Main program
G code call
Execution macro program
Special code call I

I
Memory operation execution level (high

r CRT / MDI
I

IEl ClIt--=-
Conversation macro and auxiliary macro execution levei (lower eve0

Initial setting on power n


f

r P-CODE I
I
Program number specification
l ) Control variable #8500 + Conversation macro program
I I
I
Program number modification I

1 / f,“,“,:‘i;;z;;;o execution

Execution (always)

Compiling Program number specification


.
Parameter 9039
,

Fig. 4.1 Conversational macro function conceptional diagram

-240
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION

The conversational macro function is executed only when the conversational screen is selected
with the function key AUX.

The conversational macro function executes its macro program whose program No. is the value of
the conversational macro execution control variable #8500. The value of the conversational macro
execution control variable #8500 is to be set with the parameter No. 9038 at compiling. The
conversational macro function will not be executed when there is not a conversational macro
program compiled whose program No. is the value of the conversational ma ro execution control
variable #8500.

The conversational macro program, as well as NC part program, consists of macro sentences and
NC sentences (specific G code commands).
The conversational macro program can describe all the macro statements used for the custom
macro. And all the system variables and common variables which can be referred to in the P-
CODE program can be read and written. But the conversational macro program has no local
variables except for #l to #99. They are used to refer an array type P-CODE variables #lOOOO ‘s.
Also, P-CODE variables are prepared for the conversational macro control.

It is impossible to execute the NC part program statement with the NC statement of the
conversational macro program. They will be ignored though commnded. It is impossible to use
any codes except the screen display codes and the execution control codes described in the
following sections. And be sure that the NC statement of the conversational macro program have
the addresses whose meanings and usage are different from those of the NC part program
statement.

The AUX screen started by the conversational macro program is under the same control as the
other screens (POS screen, etc.). Therefore, finishing of the AUX screen is necessary for
changing over from one screen to another. Decide the timing to finish when executing M99 of the
main program. Be careful about the condition of the conversational macro program, because if it is
of a bad program example as shown below, it will be impossible to change the screen to another
and HANGUP STATE will be held. When another function key is pressed mistake, press AUX
again.

Bad example Good example

01234; 01234;

YES YES

Key input process Key input process

I
M99 ; M99 ;

-25-
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION

Program the conversational program so that it will be a cyclic like the PMC ladder program. That
is, execute M99 without fail and it will return to the head of the main program or to the sequence
No. specified with M99Pp.
Thus, avoid the programming that the divergence destination by GOT0 will reverse direction.

(Note) To select a conversational macro screen, press function key AUX.


To change the screen from the conversational macro screen to another screen such ‘as current
position screen or program screen, press the correspondence function key such as POS and
PROG.

4.2 Auxiliary Macro Function


The auxiliary macro is always executed regardless of the selection screen while the conversational
macro function is executed only when the conversational macro screen is selected in the function
AUX.
The auxiliary macro function executes the auxiliary macro program with the program number
I. set by
parameter 9030 on compiling.
If parameter 9039 is equal to 0 or the auxiliary macro with a set program number has not been
compiled, no auxiliary macro function is executed.
Major differences between the conversation macro and auxiliary macro functions are as in the
following:
1) Auxiliary macro function is always executed regardless of the screen being displayed.
2) No screen display control code can be used in the auxiliary macro function. G202, G240,
G242, G243, Gol, G02, GO3
3) No variables for controlling and cursor can be used in the auxiliary macro function.
#8501-#8509
4) The conversational macro function can control the program number executed by conversational
macro execution control variable #8500.
On the other hand, the auxiliary macro function always executes the program of the program
number set by parameter 9039 on compiling.

The conversation macro function and auxiliary macro function are executed at the same
execution level (lower level).
The execution processing is as shown in the following when both the conversation macro
function and auxiliary macro function are specified.

1) AUX screen selected


The auxiliary macro execution and conversation macro executed are repeated in this order.
2) Screen other than AUX screen
A compilation parameter makes it possible to display AUX screen at power on.
In this case also, the conversational macro is executed after execution of the auxiliary macro.

(Note 1) The screen is locked while the reader/punch interface is being controlled using an
auxiliary macro.
(Note 2) The execution of a large auxiliary macro requires a long time, thus reducing the screen
drawing speed.

-260
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION

4.3 Execution Control Code


The following control codes are prepared for execution control.
M98 : Subprogram call
M99 : Subprogram end

(1) Subprogram call (M98)


M98 Pp ;

A macro subprogram specified by address P is called. Frequency of calling the macro subprogram
shall be up to quadruple.
(2) Subprogram end (M99)

M99 Pp ;

When command is done in the c lled subprogram, the calling program will be restored. When the
address P is specified, the block of the sequence No. specified at P of the calling program will be
restored.
Command M99 without fail at the end of the main program. The command of M99 in the main
program is explained below. -

When M99 is commanded in the main program, execution of the conversational macro function is
finished once.
Once execution of the conversational macro function is started, the screen will not change over to
another though the function key is depressed until execution of the conversational macro function
ends at M99. Accordingly, it is necessary to command M99 at the end of the main program.

When the function key is depressed during the execution of the conversational macro program,
both character display and graphic display will be erased after the conversational macro program
ends, and a corresponding screen will take place. When the function key AUX is depressed again,
the execution of the conversational macro program will be started according to the value of the
conversational macro execution control variable #8500. At this time, the program will be executed
from the beginning regardless of the command of the address P in block of M99.

When M99 is executed, the value of the conversational macro execution control variable #8500 will
be checked. When the value of #8500 is rewritten, both character display and graphic display will
be erased and the control will be transferred to a new conversational macro program. If not,
neither the character display nor the graphic display will be erased, and execution of the same
conversational macro program will be repeated. In this case, when the address P is commanded,
execution will be started at the block of the sequence No. specified at P.

Once M99 is executed, the graphic display will not be output on th screen until the graphic screen
is erased next. Consequently, when the same conversational macro program is still executed, the
second and the following graphic displays will not be output on the screen When you want to
redisplay the graphic display in 1 conversational macro program, command the graphic screen to
be erased once.

-270
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION

4.4 Conversational Macro Execution Control Variable #8500, #8550, #8551


Three screens are available for execution of the conversational macro. These screens are selected
by pressing the function key AUX’MENUMACRO.
Screen Conversational macro execution control variable
AUX #8500
MENU #8550
MACRO #8551

When the function key AUX’MENUMACRO is pressed, a conversational macro whose program
number is specified by a value of the conversational macro execution control variale is executed.
Compile parameters (No.9038,No.9040,No.9041) set values of the conversational macro execution
control variable effected at power on. When the value of the conversational macro execution
control variable is re-written, another conversational macro is controlled. When the value is re-
written, characters and graphics are erased after completion of M99 of the currently executed
conversational macro program(main) and the new conversational macro is controlled.
If the value of the conversational macro execution control variable is not re-written, the same
conversational macros are repeatedly executed. In this case, no characters and graphics are
erased.

4.5 Notes

The conversational macro and auxiliary macro must be programmed so that M99 of the main
program is executed.
The conversational macro, auxiliary macro and standard CNC display (POS screen, etc.) are
executed on the same level. If a wait is programmed in any macro not having M99, the following
occurs:
. If the wait is executed by the conversational macro, the auxiliary macro is not executed.
. If the wait is executed by the auxiliary macro. the conversational macro is not executed.
The CNC display (POS screen, etc.) is not updated.

-280
5. MACRO VARIABLES

5. MACRO VARIABLES
5.1 Macro Variables

Conversational Auxiliary Executable


Variable No. User program
macro macro macro

Local variable #1 to #33 (#99) 0 A 0


(Note I)

Common variable MOO and up 0 0


#500 and up (Common variable)

P-CODE variable #lOOOO and up X 0


Extended P- #20000 and up (Common variable)
CODE variable
I .
Control variable #8500 and up X 0 A X
(Note 2)

0 : Usable A : Partially usable X : Unusable

(Note 1) To be used when the P-CODE variables of array type are referenced.
(Note 2) The variables for controlling screen display and key input cannot be used.

5.2 Local Variables (#l to #33 or for referencing the P-CODE variables of
array type, #l to 899)
The local variables can be used for executable macros.
These local variables are different from those used for the user programs.
The local variables can be used for auxiliary and conversational macros to reference the P-CODE
variables of array type.

5.3 Common Variables (MOO to #149 and #500 to #531)


The common variables can be used for conversational macros, auxiliary macros, and executable
macros.
The common variables are common to the conversational, auxiliary, and executable macros.
However, they are different from those used for the user programs.

5.4 P-CODE Variables #l OOOO-


It is possible to use optional quantity of the P-CODE variables starting with #lOOOO on lOO-pc.
basis.
A 100 times as many as the numerical value preset on the compiling parameter No. 9037 will be
the usable quantity of P-CODE variables. When the value on the parameter No. 9037 is 0, P-
CODE exclusive variables are not usable.

The upper limit of the P-CODE variables is as follows.


10000 + (Value of Compiling Parameter No. 9037) x100-1

-29-
5. MACRO VARIABLES

The lower limit of the P-CODE variables is 10000. For example, the P-CODE variables can be
used as follows:

#lOOOO to #lo099 when the value of parameter No. 9037 is 1

#IO000 to #lo199 when the value of Parameter No. 9037 is 2

(Note 1) For P-CODE variables, about 1.27 meter of part program memory is consumed per 100
pieces of variables when part program storage is 10 to 80m. The more P-CODE are used, the
more part program memory decreases. The maximum no. of the usable P-CODE variables
depends on the capacity of the part program memory.

Part program storage memory 10 m: Parameter on compiling No. 9037 = 8


Part program storage memory 20 m: Parameter on compiling No. 9037 = 16
Part program storage memory 40 m: Parameter on compiling No. 9037 = 32
Part program storage memory 80 m: Parameter on compiling No. 9037 = 57 .
Part program storage memory 120 m - 320 m: Parameter on compiling No. 9037 = 57
* When the part program storage memory size is 120 to 320 m, the amount of memory does not
decrease.

(Note 2) The P-CODE variables still maintain their values after the power is turned off.
(Note 3) Before executing the conversational macro with the complied ROM cassette loaded,
erase all the programs in the part program storage memory once.
(Turn on the power while pushing DELETE key with the setting (PWE = I).)
With this operation all the conversational macro functions will be initialized to be “blank”.
Array type variables for P-CODE in conversational macro #IO000 - can be refered to in 2 to 3
dimentional array type. (See 6.12 (1) )

5.5 Variables of Expanded P-CODE (#20000 - . ...)


The variables of the expanded P-CODE which start from #20000 can be used for the optional
number, if the capacity of tape memory is l20m to 320m. This variable can be selected for
numbers with floating decimal points, the same as the usual common variable or for numbers with
the integer type by parameter (parameter No. 9002#3 EVF) specification.

Parameter No. 9002#3


EVF = 0: floating decimal point type
EVF = 1: the integer type

N times the number set paramater No.9044 is the number of the usuable variables for the P-
CODE the same as the exclusive variables for the P-CODE (#lOOOO ---). The P-CODE variables
cannnot be used, if parameter No. 9044 is 0.
The number of n is 12 with the floating decimal point type, and is 30 with the integer type.

-3o-
5. MACRO VARIABLES

EVF= 0: in the case of the floating decimal point type


#ZOO00 to #20011 if parameter No. 9044 equals 1
#20000 to #20023 if parameter No. 9044 equals 2

EVF = 1: in the case of the integer type


#ZOO00 to #20029 if parameter No.9044 equals 1
#20000 to #20059 if parameter No.9044 equals 2

In the case of the integer type, one of -32768 to 32767 can be set. Digits under the decimal point
are rounded off when a value is substituted to the left side of the substitution statement.
Furthermore, this variables is evaluated after converted into the floatingdecimal point type, if this
varables occurs in expression.

About a 0.15 meter of part program memory is used per set (number of parameter No. 9044) of
the variables of the expanded P-CODE.
The part program memory being used is displayed on the program library screen. The maximum
number of P-CODE variables depends on the capacity of the part program memory.
Part program memory 120m: Parameter No. 9044 = 831
Part program memory 320m: Parameter No. 9044 = 2111

-3l-
5. MACRO VARIABLES

5.6 Displaying Variables


The variables used for P-CODE programs, such as local variables, common variables, P-CODE
variables, and extended P-CODE variables, can be displayed by pressing the function key
[OFFSET] several times.
MDI keys can be used to specify the values of variables other than local variables.

P-CODE VARIABLE

No. DATA No. DATA

0 123.45678 10 123.45678
1 123.45678 11 123.45678
2 123.45678 12 123.45678
3 123.45678 13 123.45678
4 123.45678 14 123.45678
5 123.45678 15 123.45678
6 123.45678 16 123.45678
7 123.45678 17 123.45678
8 123.45678 18 123.45678
9 123.45678 19 123.45678

NW. ---

[ 1 I 1 1 I I ] [NO-SEL]

Page keys can be used to display the screens for other variables.
(1) #lOO--Ml9
(2) #120-#139
(3) #140-#149
(4) #500-#519
(5) #520-#531
(6) #l-#20
(7) #21-#33
The desired value can be entered for the variable at the cursor position using the numeric keys and
the [INPUT] key. However, no values can be entered in local variables or write-inhibited system
variables.

(Note 1) The setting of NDP, bit 1 in parameter 9000, for the executor depends on whether
variables to be used for P-CODE programs are displayed. To display the variables, set bit 1 of
parameter 9000 to 1.
Up to 20 P-CODE variables can be displayed starting from an arbitrary number. Specify the
number of the P-CODE variable from which display is to be started, using parameter No. 9001.
(Note 2) To change the screen from the P-CODE VARIABLE screen to another screen such as
current position screen or conversational macro screen, press the correspondence function key
such as POS and AUX.
(Note 3) The PCODE variable display screen can display macro variables having an integer
part of up to seven digits (up to eight digits with a decimal place). A blank is displayed for a
variable having an integer part exceeding seven digits.

-320
6. FUNCTIONS OF THE MACRO EXECUTOR

6. FUNCTIONS OF THE MACRO EXECUTOR

Table 6 (a) Functions (l/2)

COnverSa- Executa-
No. Function Outline
tional Auxiliary b+e

6.1 Screen display function Controls the display of the conversational


@ Screen display control macro screen. 0 X X
@ Function screen control 0 0 X
@ Masking conversational macro 0 X X
screen status display
@ Shift for adjusting the graphic 0 X X

6.2 Address function Reads data at PMC addresses. 0 0 0


6.3 Writing at PMC addresses Writes data at PMC addresses. 0 0 0
6.4 Reader/punch interface control Controls the RS-232C interface. 0 ,0 X

6.5 Reading and writing an NC program Reads NC programs from and writes 0 0 X
them onto the CNC tape.

6.6 Continuous input with the cursor and Continuoustyinputs data with the cursor 0 X X
Page keys and page keys.

6.7 Masking the display of 0 and N Clears the display of 0 and N numbers 0 X X
numbers on the conversational macro screen.

6.8 Reading and presetting the cutting time Reads and presets the cutting time and 0 0 X
and cutting distance the cutting distance.

6.9 Reading and presetting the relative Reads and presets the relative 0 0 X
coordinates coordinates.

3.10 Key/data input control Reads the states of MDI keys and the 0 X X
values of entered data.

5.11 Cursor control Displays the cursor at any position on the 0 0 X


conversational macro display screen.

3.12 Processing of P-CODE variables of References P-CODE variables of two- or 0 0 X


array type three-dimensional array type.

5.13 Torque limit control Specifies the override values of the 0 0 0


torque limits for each servo axis.

5.14 Reading A/D converter data Reads A/D converter data. 0 0 X

5.15 PMC axis control Controls the PMC control axes. 0 0 X

5.16 Interlock along each axis Applies interlocks along each axis and 0 0 X
reads the travel axis and the direction of
movement along the axis when the skip
signal goes high.
l

5.17 Separation of P-CODE program UVUO Separates the system variables for macro 0 0 0
DVDO into the signals for user programs
and those for P-CODE programs.

-330
6. FUNCTIONS OF THE MACRO EXECUTOR

Table 6 (a) Functions (212)


Conversa- Executa-
No. Function Outline Auxiliary
tional Me

6.18 Referencing the common variables for Reads the common variables for the user 0 0 0
custom
macros program from and writes them to the P-
CODE program.
_ _~~ _ - ~- ~ .~
6.19 Searching for a P-CODE workpiece Directly executes the P-CODE program X X 0
number registered in an executable macro
variable.

6.20 Function for calling a user program Catls a user program from the P-CODE X X 0
withan executable macro programs for executable macros.

6.21 Arithmetic function Logarithmic function, Exponential function 0 0 0


Arc sine function and Arc cosine function (Note)
can be used.

6.22 MDI key image read function by MDI key image that reflects MDI key 0 x X
conversational macro status (pressed/or released) can be read
from the conversational macro.

6.23 Window function Various CNC system information can be 0 0 X


referred to through window.

0 .. Usable A .
. Partially usable x: Unusable

(Note)To use the arithmetic function in the execution macro, custom macro B option must be
combined in the CNC.

-349
6. FUNCTIONS OF THE MACRO EXECUTOR

Table 6 (b) Functions of the Macro E :ecutor and the Associated G Codes
and Macro Variables (112:

~ Associated macro COnVerSa- Executa-


Function Associated G code Auxiliw
I variable I timal I ble

6.1 Screen display function GO1, G02, G03, X


G202, G204, G206,
G240,G242, G243,
G244, G249

6.2 Address function 0


Writing at PMC addresses X
6.3
I G310
6.4 Reader/punch interface control G330, G331, G335, #8539 X
G336, G337, G338,
G339

6.5 Reading and writing of an NC G320, G321, G325, #8520, #8521, #8522, 0 0 X
PcoW~ G326, G327, G328, #8523, #8529
G329

6.6 Continuous input with the rY8501 X


I_ o~-I~x.
cursor and page keys
I
6.7

6.8
Masking the display of 0 and
N numbers

Reading and presetting the #8553, #8554


I I 0

0
X

0
X

X
cutting time and cutting
distance I I

6.9 Reading and presetting the


relative coordinates
#8998, #8999
I 0
I 0 X

3.10 Key/data input control #8501, #8502, #8503, 0 X X


#8504, #8552
I I
5.11 Cursor control #8505, #8506, #8507 lo IO X

Processing of P-CODE G315 #8511, #8512, #8513, 0 X


variables of array type #8514, #8515, #8516,
#8517, Rr8519

6.13

5.14
Torque limit control

Reading of A/D converter data


#8621, #8622, #8623,
#8624

#8631, #8632, #8633,


I 0

0
I 0

0
0

X
#8634

5.15 PMC axis control GMo, Gwl, G344, #8602, #8700 0 0


G345, G346, G348, #8710 to #8713, X8715, (Note 4) (Note 4)
G349 #8720 to #8723, rY8725
#8730 to #8733, #8735
#8740 to #8743, #8745

5.16 Interlock along each axis #8600, #8601 0 0

0 : Usable A .
. Partially usable X: Unusable

-35
6. FUNCTIONS OF THE MACRO EXECUTOR

Table 6 (b) Functions of the Macro Executor and the Associated G Codes
and Macro Variables (212)

Separation of P-CODE
program WlJO

Referencing the common


variables for custom macros

Searching for a P-CODE X X 0


wcwkpiece
number

G function for calling a user X X 0


program
withan executable
macro

6.21 Arithmetic function 0 0 0


(Note)

MDI key image read function #8549


by conversational macro I I O I x I x
I
6.23
Window function I #8998, #8999 IOlOlX

0 : Usable A : PartMy usable X : Unusable

(Note) To use the arithmetic function in the execution macro, custom macro B option must be
combined in the CNC.

6.1 Screen Control


6.1.1 Coordinates system of screen

The coordinates system used for character display and cursor display in the conversational macro
program is called the character coordinates system.
The coordinate system used for graphic display in the conversational macro program is called the
graphic coordinate system.

(1) 9 inch CRT


The graphic coordinate system can be selected from the standard mode and the high resolution
. mode. Select one of these by the parameter HRGR (No.9003#2) in compiling. Select high-
resolution mode.

As for the character coordinates system, the horizontal direction is X coordinate and the vertical
direction is Y coordinate. Specify the X coordinates from 0 to 39 from left to right and the Y
coordinates from 0 to 15 from top to bottom for 9” CRT. Any command of display exceeding the
above range will be ignored. 1 unit is 1 character.

Since the 13th is used for the input section and the 14th is used for the state display section, they
cannot be specified. Furthermore, the soft key frame section cannot be specified either.

-360
6. FUNCTIONS OF THE MACRO EXECUTOR

1 2 3
0123456789012345678901234567890123456789
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
0123456789012345678901234567890123456789
1 2 3

Fig. 6.1.1 (a) Character coordinate system (In case of 9” CRT)

The coordinates system used for graphic display in the conversational macro function is called the
graphic coordinates system.

As for the graphic coordinates system, too, the horizontal direction is the X coordinate and the
vertical direction is the Y coordinate. Specify the X coordinates from -160 to 159(-320 to 319)
from left to right and the Y coordinates from -112 to 112(-200 to 199) from bottom to top.(Vakm in
parenthesis is for high resolution mode.) Any command of display outreaching the above range
will be ignored. 1 unit is 1 dot.
The center of the screen will be (X, Y) = (0, 0).

Y
c
4
I
Screen
+112(199) Value in parenthes is is for high
resolu tion mode.

-160(-3
l20) +159(319)

.
-112(-200)
I
Fig. 6.1.1 (b) Graphic coordinate system

(a ) Standard mode
Use the same coordinate system as that of the series 0 standard 9 inch CRT.

Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = ( - 160 - 159)

-370
6. FUNCTIONS OF THE MACRO EXECUTOR

Top and bottom of screen


(Y coordinates) = ( - 112 - 112)

(b) High resolution mode


Use the high resolution coordinate system.

Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = ( - 320 - 319)
Top and bottom of screen
(Y coordinates) = ( - 200 - 199)

Graphic display macro prepared in the series 0 standard 9 inche CRT can almost be used
unchanged in standard mode. The high resolution graphic mode allows highly accurate display that
was not possible in standard mode.

(2) 14 inch CRT

(a) Character coordinates line, graphic coordinates line

Character coodinate system instructs in the range of O-79 for the left and righ directions (X
coodinates), and O-24 for the up and down directions (Y coordinates). The 20th line is used for
input and the 21st line is used by the system for status display and can not be satisfied. The
space for the software key also cannot be satisfied.

1 6 7

0123456789012-
,,78901234567890123456789,

i, , /##, , , ,‘I
0123456789012- 678901234567890123456789

Fig. 6.1.1 (c) 14 inch/lOinch CRT character coordinate system

-380
6. FUNCTIONS OF THE MACRO EXECUTOR

Instruct the following graphic coordinates of the graphic coordinates system.

Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = (-320-319)
Up and down of screen
(Y coordinates) = (-200 - 199)

6.1.2 Screen display control code

It is possible to make the screen freely by commanding the contents of the screen display with the
conversational macro program. The following control codes are prepared for the screen display.

@ G243 Character display


@ G202 Screen erase
@ G240 Color specification
@ G244 Graphic line specification
@ G242 Setting of graph start point
@ GO1 Straight line graph
a GO2 Circular graph (Clockwise)
@ GO3 Circular graph (Counterclockwise)

G202, G242 and G244 are the one-shot G codes. All the other G codes are the modal G codes
and they are considered as belonging to the same G code group.

Also the following are the modal addresses.


x : X coordinate of the character coordinates system,
X coordinate of the graphic coordinates system
Y : Y coordinate of the character coordinates system, Y coordinate of the graphic coordinates
system
I X coordinate at the center of the circular graph of the graphic coordinates system
.. Y coordinate at the center of the circular graphic of the graphic coordinates system
J
A : Character size (Character display)
B .. Flash specification (Character display)
F : Format of numeric display (Character display)
z : Zero supress specification of numeric display (Character display)
.. Circular graph (Graphic display), PC address write data
Q

(Note 1) Addresses X and Y are used as common modal addresses for both character display
and graphic display. Absolute values must be specified for coordinates (X, Y, I, and J). The
following values are set for the addresses upon the start of a conversational macro program:
G= 0
X=O,Y =o
I = 0,J = 0
A=l,B=O
F = 8.3

-390
6. FUNCTIONS OF THE MACRO EXECUTOR

Z=l
Q= 0

If a sequence number is specified at the end of the main program (M99Ppppp), the program is
continuously executed.
(Note 2) For all addresses, variables as well as numeric values can be specified.
[ < expression ) ] .can also be specified.
(Note 3) Optional block skip cannot be specified.
(Note 4) The meanings of the control codes and addresses differ from those of the addresses
used for NC statements. NC statements cannot be used in a conversational macro.
Conversational macro control statements cannot be executed as an NC part program.

(1) Character display (G243)

G243 Xx Yy Aa Bb Cc (c..) (hhhh..‘) Kk Ff.e Zz Dd Pp ;

There are 2 ways of commanding the character string to display.


a) Command to display a character string by enclosing it with parentheses:
G243 (FANUC O-SERIES) ; “FANUC O-SERIES” will be displayed.

Those which you can command by enclosing with parentheses are the alphabet, numbers, minus
marks, and decimal points only.

b) Commandto display a character string by bounding with “(*I’ and “7” by internal codes:
G243 (*46 41 4E 55 43’) ; “FANUC” will be displayed.
G243 (*4E 43 4175 4356’) ; ” NC system” will be displayed.

Command with hexadecimal number. Divide the internal codes with blanks. Take a space for 2
characters aside for hiragana and kanji. The coordinates will be renewed when a character string
is displayed.
For the character string, it is possible to specify up to maximum total 255 characters in 1 block.
Count hiragana and kanji as 2 characters respectively.
Also, it is possible to command the character code to display directly at the address C by decimal
number. The commandable codes are 32 - 95 (20 - 5F with hexadecimal number) or 160 - 223 (A0
- DF with hexadecimal number).
C42 +* CSl -+ =

Command the display of the character strings at the addresses X and Y with the
character coordinates.

Command character size at the address A.


Al = Normal size
A3 = Triple size (3 x 2 size)

The triple size is 3 times as wide as and 2 times as long as the normal size. The characters which
can be displayed with the triple size characters are the alphabet, numbers, minus marks, decimal
points and blanks. No other characters can be displayed with the triple size.

-4o-
6. FUNCTIONS OF THE MACRO EXECUTOR

@ Standard character @ Full-size character


G243 Xx Yy Al (8) G243 Xx Yy A2 (8)

q
8
@ Triple-size character (3.by-2 character)
G243 Xx Yy A3 (8)

Bink control is commanded by the address B.


BO = Does not blonk.
81 = Blinks slowly. (Energized for about l/2 sec. and deenergized for about l/4 sec..)
B2 = Blinks quickly. (Energized for about l/4 sec. and deenergized for about l/8 sec..)

(Note) When a blink is specified, the display is energized or deenergized according to the timer
condition when the display is commanded. Therefore, when the display is not repeated, it will be
kept energized or deenergized.

Command the number of blanks at the address K. The blanks as many as commanded at K will be
displayed. When the blanks are displayed, the coordinates will be renewed.

Command the format to display the numeric values at the address F. Command the number of
display figures on the left of the point and the number of figures under the point on the right of the
point.

Command at the address 2 whether you do “leading zero suppress” or not when displaying the
numeric values.
Z = 0 .. leading zero suppress will take place.
- 1 .. leading zero suppress will not take place.
(Standard value is “I”.)

(Note 1) When 1 is set for address Z, a minus sign (-) is displayed if the value is negative.
When 0 is set, a minus sign is not displayed
(Note 2) Z can be used to specify whether OS or spaces will be used for padding when the value
to be displayed is shorter than the number of digits specified with F.

Command the numeric values to display at the address D.

Command the sequence No. that the character string is cataloged at the address P. The character
displayed will be the character string in one block of the sequence No. commanded with P in the
program set at the character string registered program control variable #8509. The variable for

-41-
6. FUNCTIONS OF THE MACRO EXECUTOR

controlling character-string registration programs (#8509) is defined as the number of the first
program in the character-string registration program group. Use the five digits for address P to
select the desired character-string registration program in the group.

G243 Xxx Yyy Ponnnn;

o : A number from 0 to 8 to select a program in the character-string registration program


group
nnnn : Sequence number 0001 to 9999

Example 1) #8509 = 1000 ;


G243 PlO ; = = ) Displays the character string with sequence number NW in
program 01000
G243 P80010 ; = = ) Displays the character string with sequence number NlO in
program 01008.
Up to nine character-string registration programs can be selected as desired in the above way.

Example 2)

09000; 08000;
. I :
#85;9 = 8000; i NlO(IJK);
XOYO; I
G243(ABC)P20; i N20(XYZ);
.. .

M99

In this case, one block of the sequence No. 20 in the program No. 8000 will be executed.
In the above example, “ABCXYZ” will be executed.
And address P executes the specified block after the process of the corresponding block is
finished. Consequently, “ABCXYZ” will be displayed though command is done as follows with the
above example.
G243 P20 (ABC) ;
Nothing but the character string will be described at the block specified by P.
When #8509 is 0, the block of the sequence No. specified in the current program will be executed.

(Note) Process sequence of modal address


Program is processed by block in the normal NC program, but it is processed in sequence of
address command in the conversation macro program.
(Example)
@ F8.3 ;
G243 F5.1 D#lOO ;
Ci!i) F8.3 ;
G243 D#lOO F5.1 ;

-420
6. FUNCTIONS OF THE MACRO EXECUTOR

In @ #lOO is displayed with F5.1, but in a it is displayed with F8.3.

(2) Screen erase (G202)

G202 XxYyli JjPp;


X = Start point of X coordinate in character coordinate
Y= Start point of Y coordinate in character coordinate
I = Number of characters to be erased from the start point(X coordinate) for partial erasing.
J = Number of characters to be erased from the start point(Y coordinate) for partial erasing.
P = 1 .. . Erasing graphic screen
= 2 . .. Erasing character screen
= 3 .. . Erasing graphic and character screens
Also to make partial erasing, all X, Y, I and J addresses must be specified. If any address is
omitted, all the screen is erased.

(3) Displayed color specification (G240)

G240 Pp Lt ;
When color CRT is used, colors of segments and character strings specified by conversational
program can be designated.
If no designation is made, a segment and a character string are white without blink.
P = 0 .. Black
= 1 . . Red
= 2 .. Green
= 3 .. Yellow
= 4 .. Blue
= 5 .. Purple
= 6 .. Blueish green
= 7 .. White

Graphic line specification (G244)

G244 Pp ;
P = 0 .. Full line
= 1 .. Broken line
= 2 .. l-dot line
= 3 . . 2-dot line
= 4 .. Erase
The graphic line is full line at power ON.

(5) Setting of graph start point (G242)

G242 Xx Yy ;
Command the display start point with the absolute coordinates at the addresses X and Y.
Next display will start at this point.

(6) Straight line graph (GOl)

GO1 Xx Yy :

-430
6. FUNCTIONS OF THE MACRO EXECUTOR

Command the coordinate of the end of the straight line with the absolute coordinate at the
addresses X and Y.

A straight line will be made with the line commanded with G244 from the current position to the
commanded coordinate. The coordinates will be renewed.

(7) Circular display (GO2, G03)

GO2 Xx Yy Ii Jj Qq ;
GO3 Xx Yy Ii Jj Qq ;
GO2 display the arc clockwise and GO3 counter-clockwise.
Command the end of the arc with the absolute coordinate at the adresses X and Y.

[No. of quadrants]

Command the center coordinate of the arc with the absolute coordinate at the address 1 and J.
Command the number of quadrant (0 - 4) of the arc at the address Q. The arc will be graphed with
the line commanded with G244 from the current position to the coordinate of the commanded end.
The coordinate will be renewed.

-440
6. FUNCTIONS OF THE MACRO EXECUTOR

6.1.3 Graphic painting function

When high-resolution CRT is used, the graphic function for conversational macros enables painting
the specified field.

(1) Description
The field to be painted is drawn using a solid line with the graphic function. Then the paint
command is used together with control code G206 to specify any point inside the field and the
boundary color. The field is filled with the color which is used as standard when G206 is issued.
G206PpXxYy;

Painting boundary color (P)


P = 0: Same as the fill color
P = 1: Red
P = 2: Green
P = 3: Yellow
P = 4: Blue
P = 5: Purple
P = 6: Blue-green
P = 7: White
P = 8: Specified two or more colors other than black
Arbitrary point inside the field to be painted (X, Y)

(Note 1) The field to be painted must have a closed boundary.

Correct Incorrect

(Note 2) To use the painting command on the high-resolution 9” monochrome CRT, set HRGC
of compilation parameter 9004 to 1 to make the CRT enter the intensity modulation mode.

-45-
6. FUNCTIONS OF THE MACRO EXECUTOR

(2) Examples

(a) When p = 8 is specified


The innermost field is painted.

G24OPl;
G244PO; b ........................... .......
.
............ -1
Blue ...................................................
..........................................................................
................
............
.........................................................................................................
........................................................................................................
...........................................................................
G242XOYO; .........................................................................................................
.........................................................................................................
.........................................................................................................
............................................................................
.........................................................................................................
GolXlOo;
...........................................................................
.........................................................................................................
.........................................................................................................
Red .........................................................................................................
.............................................................
:~~~~~~~~~~~~~ 81ue ~~~~~i”
.............................
YlOO; :.‘.~.~.~.~.~.‘.~.-.~.~.-.~.~.~.~.~.~:.~.~.~.~.~.~.-.-:.~.~.~:
............................................................
x0; ............................................................................................
............................................................................................
YO; ............................................................................................
............................................................................................
............................................................................................
‘.‘.~.~.~.~.‘:.-.-.~.‘.~.~.~.~.~.~.-.~.~.~.~.~.-.~.~.~.~.~.~.~.~.~
G240P4;
G242X50Y50;
G01X150;
Y150;
X50:
Y50;
G206P8Xll OYl10:

(b) When the same color is specified for the fill and the boundary (p = 0)
A line with another color in the field to be painted is painted.

G240Pl;
Blue
G244PO;
G242XOYO;
GOlXloo;
YlOO;
x0;
YO;
G240P4;
G242X50Y50;
GOlX150;
Y150;
x50;
Y50;
G206POXllOY110;

6.1.4 Function screen control function

Writing a desired value in parameter 8510 enables displaying any function screen. Reading the
value of parameter 8510 enables checking which function screen is currently displayed.
The following table shows the correspondence between function screens and the values of
parameter 8510.

-460
6. FUNCTIONS OF THE MACRO EXECUTOR

Function screen Value of parameter 8510


i
POS : Current value display screen 0
1
PROG : Program display screen 1

OFFSET : Offset screen 2

PARAM : Parameter/diagnosis and suchlike 3

DGNOS : Diagnosis screen 4


A
ALARM : Alarm screen 5

GRAPH : Graphic screen 6

AUX : Auxiliary screen 7

62. Address Functions


The address functions are the functions to return the address of PMC or the contents of the
parameter as the function values. However, as the address functions cannot be written, it is
impossible to describe them on the left side of an operation. Control code G310 is prepared for
PMC address writing.
The format of the address functions is as follows.

< Address ) < Address No. > or < Address ) < Address No. ). < Bit position ) (parameter cannot
be used)
Address P indicates the parameter and the other addresses indicate PMC addresses.
For example, P5.3 returns the contents of bit 3 of parameter No. 005.

PlOO returns the contents of the parameter No. 100 as function values respectively.
Since the bit position cannot be specified for parameters, if it is required, take the bit data using
AND instruction.

Also, G100.1 returns the contents of the bit 1 of PMC address Gl 00 ,and GlO5 returns the
contents of PMC address G105 as function values respectively.

It is possible to describe <Address No. > and < Bit position ) with variables or # [ < Expression > ]
or [ < Expression ) 1, instead of numbering them with numerical values directly.

For example, it is possible to describe as follows.


P#lOO
P#100.#101
G# [#lOO+l]
G [#lOO+l] .[[#lOO-1]/2]

-47
6. FUNCTIONS OF THE MACRO EXECUTOR

The usable addresses are “P” for parameter and X, Y, F, G, R and D of PMC addresses.
Format conforms to that used for ladder diagram.
Refer to the operator’s manual for the detail of parameters and to the PMC programming manual
for details of the PMC addresses.

(Note) Refer to the section titled “PMC Address Write Control Code (G310)” for writing data to
the PMC addresses R and D.

6.3 Reading and Writing a PMC Address


(1) PMC address write control
Data of one, two, or four bytes can be written when address L is specified with control code G310.

G310 Dd Qq Lx;
G310 Rr Qq Lx;
These commands write the data indicated by address Q at the PMC address indicated by address
D or R a number of bytes at a time as indicated by address L. The data cannot be specified in
.
bits
The write data indicated by address Q is rounded as follows: Decimal places of 0.5 and over are
counted as a whole number and the rest are discarded. Then the data is expressed in binary form
and written. When the data is a negative value, it is handled and converted as two’s complement.

When the following is specified, the data is written in the PMC data area (D300 to D303) as shown
in the table below:
#lOO = -500.0;
G310 0300 Q#lOO L4;

.
Bit 7 6 5 4 3 2 1 0
In two’s complement, the
0300 0 0 0 0 1 1 0 0 decimal number - 500
0301 1 1 1 1 1 1 1 0 becomes FFFFFEOCH in
0302 1 1 1 1 1 1 1 1 hexadecimal.
0303 1 1 1 1 1 1 1 1

When the specified data contains more bytes than that indicated by address L, only the data of the
length specified by address L is written. This will not cause an error. (If Ll is specified in the
example above, the identical data is written only in 0300.)

(2) PMC address read control


When a variable is indicated by address P with control code G310, the PMC data can be read.
Address L indicates that the data of one, two, or four bytes is read at a time.

G310 Dd Pp Lx;
G310 Rr Pp Lx;
G310 Cr Pp Lx;
G310 Kr Pp Lx;

-480
6. FUNCTIONS OF THE MACRO EXECUTOR

These commands read the data which starts from the PMC address indicated by address 0, R, C,
K or A and whose length is indicated in bytes by address L into the variable indicated by address
P. The read data is handled as binary data consisting of the specified number of bytes, converted,
“.-9
and assigned to the variable.
If (3310 0400 PlOl L2; is specified when the PMC data area (0400 to 0401) has the data shown
below, - 500.0 is input in #lOl.

0
.
Btt 7 6 5 4 3 2 1 0
L A
0400 0 0 0 0 1 1 0 0
0401 1 1 1 1 1 1 1 0
\

The address function can read data the specified number of bytes at a time. However, the
following must be noted: As the address function handles and converts the read data as a signed
value (in two’s complement), the read data may be changed.

If the following is specified with the example shown above, - 2.0 and 254.0 are read into #102 and
#103 respectively.

G310 0401 P102 Ll;


HO3 = 0401;

(Note 1) When address Q is specified, write control is executed. When address P is specified,
read control is executed. If both addresses Q and P are specified, write control is executed.
(Note 2) Addresses other than 0, R, C, K (X, Y, G, F...) cannot be specified.
(Note 3) With address L, 1, 2, or 4 can be specified. If another value is specified, or if address
L is omitted, the data is written or read the specified number of bytes at a time.
(Note 4) For details of the PMC address, refer to the PMC programming handbook.

6.4 Reader Puncher Interface Control by Conversational Macro


6.4.1 Outline

The conversation macro function allows the reader/puncher interface to be controlled.


The control is performed by combining the following four control codes.
When this function is used, always set the expansion function validity (No. 9002.7, EXTl) to 1 in
the parameter on compiling.

(Note) For the Series 21, or other models with the available tape length of less than 80 meters,
setting EXTl to 1 reduces this by 1.22 meters.

G330 reader puncher interface open


G331 reader puncher interface close
G335 1 byte read
G336 Data transmit
G337 input of macro variable

-49-
6. FUNCTIONS OF THE MACRO EXECUTOR

G338 output of macro variable

Select either channel 1 or channel 2 as a circuit to be used by specification on opening.


Channels 1 and 2 cannot be controlled simultaneously.
In addition, when the normal l/O function is commanded on the channel which is being used in this
function, operation is not proper if the channel, where the input of NC program is being executed
by the l/O function, is opened.
Select one control method out of the three methods shown in the following by specification on
opening a circuit.

(1) User macro control


The reader puncher interface is opened in the bidirectional mode and no output control of
control codes (DC1 to DC4) can be carried out by the macro executor.
Use the macro executer when creating your own protocol.
When overflow of the reception buffer is detected, send the transmission stop/restart message
,’
to the target device by switching ON/OFF the control signal “RS”.

(2) Read control (DC1 ./DC3 automatic control)


The “DCI” code is automatically sent on opening, thus requesting the target device to
transmit data.
The “DC3” code is transmitted on closing.
In addition, when overflow of the reception buffer is detected, the output of “DC3” and “DCl”
is automatically controlled.
No control of data transmission (G336) can be performed when the reader/puncher interface
circuit is opened in the read control mode.
(End code = 8)

(3) Transmission control (DC2/DC4 automatic control)


The “DC2” code is automatically on opening, thus requesting the target device to transmit
data.
The “DCS” code is transmitted on closing.
The interruption and restart processing of transmission by the target device using the “DC3”
and “DCI” are also automatically carried out.

No control of 1 byte reading (G335) can be carried out when the reader/puncher interface
circuit is opened in the transmission control mode (End code = 8). There is an end code to
check to see if the commanded control code has been properly executed or not.
Check the end code after executing G330 to G338.
#8539 : End code (only for reading)
However, the circuit closing processing always ends normally.

6.4.2 Function details

(1) Circuit open (G330)


G330 Pp Bb Ss Cc ;
The reader puncher interface of the specified channel is opened according to the control method
and control conditions to enable it to be used.

-so-
6. FUNCTIONS OF THE MACRO EXECUTOR

Select the channel and control method used by the specification of address “P@‘.
1 : Channel 1 User macro control
2 : Channel 2 User macro control
11 : Channel 1 Reading control (DCliDC3 automatic control)
12 : Channel 2 Reading control (DC1/DC3 automatic control)
21 : Channel 1 Transmission control (DC2/DC4 automatic control)
22 : Channel 2 Transmission control (DC2/DC4 automatic control)
Specify the baud rate by the specification of address “B”.
1 : 50bk 2 : 1OOb/s 3 : 11Oh/s
4 : 150bk 5 : 200bk 6 : 3OObk
7 : 600bk 8 : 1200b/s 9 : 2400b/s
10 : 48OObk 11 : 9600bls
Specify the stop bit and parity by the specification of address I’S”.
1 : 1 stop bit, No parity
2 : 2 stop bits, No parity
11 : 1 stop bit, Odd parity
12 : 2 stop bits, Odd parity
21 : 1 stop bit, Even parity
22 : 2 stop bits, Even parity
Specify the output code on transmitting data by the specification of address “C”.
1 : Output code (ASCCI)
2 : Output code (ISO)

Example) Device and transmission control of channel 2 (DC2/DC4 automatic control)


Baud rate = 4800 b/s, Stop bit = 2, Even parity, IS0 code output
G330 P22 BlO S22 C2 ;
IF [#8539 NE 0] GOT0 900 ;
Open processing end
lJl900 error processing :

(2) Circuit closing (G331)

G331 ;
The circuit, which is currently open, is closed.
There is no end code for the circuit closing processing.
It always ends normally.

(3) 1 byte reading (G335)

G335 Pp ; p : Reading variable number


Data 1 byte received through circuit is read into the variable area specified. I
The received data is stored in the reception buffer (80 bytes) temporarily and is read one byte at a
time by this control code.
When there is no reception data, end code 255 is sent.
If the reception buffer is nearly overflowing due to delay of reading processing for the reception
data, either of the following processing is carried out according to the opening specification of
control method.

-51-
6. FUNCTIONS OF THE MACRO EXECUTOR

(a) In the case of user macro control


When overflow of the reception buffer is detected, the transmission stop is requested to the
target by the turning OFF of control signal “RS”.
Then, when there is an empty reception buffer area by reading, the signal (RS) is turned ON,
thus requesting the target device to continue transmission.

(b) in the case of reading control (DClIDC3 automatic control)


When overflow of the reception buffer is detected, the “DC3” code is output automatically,
thus requesting the target device to stop transmission.
Then, when there is an empty reception buffer area by reading, the DC1 ” code is output, thus
requesting the target device to continue transmission.

(c) in the case of transmission control (DC2/DC4 automatic control)


When the circuit is opened in the transmission control mode, no control of 1 byte reading is
carried out (end code = 8).

Example)
NlOO G335 PlOO;
IF [#8539 EQ 2551 GOTOlOO;
IF [#8539 NE 0] GOT0900;
Reading processing ended
(#loo: Received data)
N900 error processing

(4) Data transmission (G336


G336 transmission data;
The following commands of transmission data are available:
(c...) + String command 1
(*hh..*) *String command 2
Ff + Data format command
ZZ --) Zero suppress command
Dd + Data command
PP + Block number command
Kk + Null code command
cc + 1-character command

See screen display control code G243 (character display) for string commands 1 and 2 and
address F, Z, D, P, and K commands since they are similar.
The commanded string is converted into either ASCII or IS0 code and is transmitted by the
specification on opening.
However, the code output by address K is not the space but the null code (no punching).
in the one-character command by address C, no code conversion processing is carried out.
Use it when the code is output other than the control code (DC1 - DC4) or ASCII/IS0 code.
Example)
G336 Cl8 K20 (FANUC) K20 C20;
IF [#8539 NE 0] GOT0900;

-52-
6. FUNCTIONS OF THE MACRO EXECUTOR

Transmission processing ended


N900 error processing;

The following data is transmitted in the circuit by this command:


Cl8 DC2 (12hex)
K20 Null code 20 (Feed)
(FANUC) + ” FANUC” (ASCMSO)
K20 Null code 20 (Feed)
c20 DC4 (14hex)
When the circuit is opened in the reading control mode, no control of data transmission is carried
out (End code = 8).

6.4.3 Inputting and outputting macro variables

Macro variable data input and output can be conducted simply by an instruction via reader puncher
interface. Instruct the control with the following G code.

G337 --) macro variable data input


G338 + macro variable data output

An end code #8539 is provided to check that input and output processing runs correctly or not.
Check the end code #8539 after running G337, G338.

#8539 --) end code (read only)

(1) Macro Variable Data Input (G337)

G337 Pp ;
p : the head variable number which mounts the macro variable (omissible)
A macro variable data, which is input from reader puncher interface that opened with the read
control mode, is read and set it to the correspondenting variable.

The tape format of macro variable data is as follows;


1
LFN P LF P LF %

c3

@ : Leader part
C3 : Start to input
0 : Variable number
@ : Variable data
@ : Tape end

Information before “LF” which appears on the tape at first is all disregarded.
The tape to the end (“EOR”) from the first “LF” is analyzed as significant information.
A section which is spaced with “LF” and “LF” into significant information segments called a block,
and one block shows one macro variable data.

-53-
6. FUNCTIONS OF THE MACRO EXECUTOR

Address @IN”can be omitted. In this case, the variable number is interpreted to be (the variable
number of the preceding block) + 1. If “N” is omitted at the head block, the variable number is
assumed to be the one specified by address “P” with instruction G337. Therefore, a tape without
“N” is made out, and arbitrary variables are read by the instruction of “337” ” Pp”.

Address “P” on the tape indicates the value of the variable and cannot be omitted. “LF” is
specified after “P” for value zero (#0) without specifying the value.

“LSK” or “EDIT” goes on and off under the right of the screen if the data is being read. If the data
is being read, the screen cannot be changed.

(Note 1) G337 is a one shot G code.


(Note 2) Address “0” data and every “CR”, space, “DEL” code is disregarded within the
significant information section.
(Note 3) Only IS0 or ASCII code can be used for input code.
(Note 4) TV, TH check does not run.

(2) Outputting Macro Variable Values( G338)

G338 Pp Qq Ff Zz ;

A specified macro variable is changed into a prescribed tape format and output from reader
puncher interface which opened with the transmit control mode.
Output code is selected between IS0 and ASCII code by the open command.

p : Specify the head of output macro variable


q : Specidy the number of output macro variable data
f : Specify the output format of macro variable data(modal value when omitted)

(Note 1) f-9.9: Displays data by automatically determining the format.

z : Specify the zero-suppress of macro variable data(modal value when omitted)

For output tape format, same as the input format, the head variable number address “N” and
variable values with address “P” at the head block, then variable values are continuously output
with P in the following blocks and finally, the tape end (“EOR”) code is output.

“CR” code of every block can be output by the compile parameter PTCR(No.9003#6) . Use this
.
code to make carriage return of a printer, etc.

PTCR = 0: “CR” is not output after “LF”, when outputting macro variable values.
\
% LF NlOOOOPl234 LF P5678 LF %

-54-
6. FUNCTIONS OF THE MACRO EXECUTOR

PTCR = 1: ‘CR” is output twice after ” LF”, when outputting macro variable values.

. 4
% LF CR CR NtOOOOP1234 LF CR CR P1234 LF CR CR %
L

Control of the feed part does not act at output. Conduct with “G336Kk” data transmission to feed
with a paper tape puncher, etc.

“EDIT” goes on and off at the lower right of the screen if a data is outputting. Screen cannot
change if data is outputting.
(Note 1) G338 is a one-shot G code.
(Note 2) Only IS0 code or ASCII code can be used for output.
(Note 3) An end code is communicated by 115 when an invalid data is specified to a variable
number, and the outputting stops.

6.4.4 Extending the function for inputting and outputting a macro variable

The conversational macro can input and output a macro variable via the reader/punch interface.
This function can be extended so that two or more variable groups can be output at a time and the
output data can be read into another variable.

(1) Outputting macro variables


By adding address R to G338 described in (2) of Section 6.4.3, the tape format of the variable data
to be output can be controlled.

(Command format)
G338 Pp Qq Ff Zz Rr;

RO : Standard format (Same as when R is not specified)


Rl : Variable numbers are not output.
R10 : At the end of the tape, % (EOR) is not output.
Rll : Variable numbers are not output. At the end of the tape, % (EOR) is not output.
R20 : At the beginning of the tape, O/O (EOR) is not output.
R21 : Variable numbers are not output. At the beginning of the tape, % (EOR) is not output.
R30 : At the beginning and end of the tape, % (EOR) is not output.
R31 : Variable numbers are not output. At the beginning and end of the tape, % (EOR) is not
output.

(a) When variable numbers are not output, the function for inputting a macro variable (G337) can
read the output variable data into a variable indicated by address P.

(b) When % (EOR) is not output at the beginning and/or end of a tape, two or more variable
groups can be output to form a single tape format.

-55-
6. FUNCTIONS OF THE MACRO EXECUTOR

(Example)
G330 Pp Bb . .. ;

G338 PlOOOO Q10 F8.3 21 Rll; = > At the beginning, % (EOR) is output. Then the data of
iF[#8539NEOJGOT0999; #lOOOO to #lo009 is output without variable numbers.
At the end, % (EOR) is not output.

G338 PllOOO Q20 F8.3 Zl R31; = > At the beginning and end, % (EOR) is not output. The
lF[#8539NEO]GOT0999; data follows the data output above to form a single tape
format.

G338 PI2000 QlO F8.3 21 R21; = ) At the end, % (EOR) is output. The tape format is
IF[#8539NEO]GOT0999; closed.
G331;

%;P ;P ; .a :P ;P ;P ; a** :P :P tP t l *o tP :%

I_ #10000-#10009 -+I+ #llOOO-#11019 _I+= #12000-#12009 _I


"Rll" "R31" "R21"

(2) Function for inputting macro variables


By adding address Q to G337 described in (1) of Section 6.4.3, the number of variables to be input
can be specified. When address R is also specified, data reading can be continued.

(Command format)
G337 Pp Qq R99;
-~---~-~-

P : Number of the variable to be read (Valid when variable number N is not specified on the
input tape)
Q : Number of variables to be read (Can be omitted)
R99 : Reading to be continued (Can be omitted)

(a) When address Q is specified, the number of variables to be read can be specified. After the
specified number of variables are input, completion code #8539 is set to 99 to indicate that
data reading can be continued. If % (EOR) is read before reading the specified number of
variables, completion code #8539 is set to 0. If address Q is omitted, the system assumes that
an infinite number is specified.

(b) When R99 is specified, the remaining variable data can be read after the specified number of
variables are read and completion code #8539 is set to 99. If data reading is continued without
R99, the data of a variable is lost in the middle of reading because of a significant information
check. (The data up to the first “;(LF)” is skipped.)
-3
_ 3

-56-
6. FUNCTIONS OF THE MACRO EXECUTOR

(Example) Reading the tape output according to the example described above
G330 Pp Bb .. . ;

G337 P100 Q10 ; => The data of the first ten variables is read into #lOO to #109.
lF[#8539 NE 99)GOT0888; (After the data is normally read, #8539 is set to 99.)

G337 PI5000 Q20 R99 ; = ) The data of twenty variables is read into #I5000 to #I501 9.
lF[#8539 NE 99JGOT0888: (After the data is normally read, #8539 is set to 99.)

G337 PI6000 R99 ; => The remaining variable data is read into #16000 to #16009.
lF[#8539 NE OlGOT0888; (After the data is normally read, #8539 is set to 0.)

G331 ;

6.4.5 FANUC floppy cassette control

File data on the FANUC FLOPPY CASSETTE, FA CARD or FANUC PROGRAM FILE Mate can be
read, prepared and deleted, by an opening command and the instruction of control code “G339”.

Read file data (G330)


Make file and write data (G330)
Read directory information (G330iG339 Pl)
Delete file (G330/G339 P2)
Change file data (G330iG339 P3)

(1) Reading File Data (G330)

G330 Pp Bb Ss Cc LI;Ff!Aa ;

Specify one of the address “L!F/A” at the time when the line is open by read control mode. At the
result of this action, the head of specified file and file data reading is conducted. Refer to Section
6.4.2( 1) “Circuit open” about address “P/BSC”. However, specify reading control (11112) for
address “P” and ISO(2) for address (C).
Select one of addresses L,F, or A depending on the process.

(a) Head call by file name


Head call by file name is possible if the head variable number of the variable string which is
housed in the file name is specified by address”L”.
Set the file name by decimalized ASCII code to the variable string of 17 variables, and specify
the head variable number by address “L”.

(Example)
When calling the file name “ABCD”, set 65(A), 66(B), 67(C), 68(D), 32...32(space) to 17
variables of common variables #I 00-l 16.

G330 P11 BlO S2 C2 L100 ; 5


_ :

(Note 1) A file name is fixed to 17 characters. Be sure to use 17 characters.


(Note 2) Specify the file name with alphanumerics and space. Alarm 8 will be generated if code
32(space) is specified at the head of file name.

-s7-
6. FUNCTIONS OF THE MACRO EXECUTOR

(b) Head call by the file number


Head carI can be conducted with a file number, if the file number (l-9999) is specified with
address “ F” .

(Example)
When making a head call of file number 3
G330 Pll B10 S2 C2 F3 ;

(c) Head call of next file


Next file’s head call, which already exists can be conducted by the specification of address
“A”. Use this function to read files continuously. Be sure to specify “Al” for address A”. End
code ( = 8) is the other specification.

(Example)
When making a head call of the next file which is being called now

G330 Pll BlO S2 C2 Al ;

(2) Making Files and Writing Data (G330)

G330 PpBb Ss Cc (LVFf) ;

New files are made and data can be written on a FANUC cassette by specifying one of address L
or F when the communication line is opened with transmission control mode.

Refer to 6.4.2(l) “Circuit open” for the specification of address “P/B/S/C”. Be sure to specify
transmission control (21122) for address “P”, and IS0 (2) for address “C”.
Select one of address L or F by processing.

(a) Making files by file name


A new file can be made and data can be written on a FANUC cassette with a specified file
name, if you specify the head variable number of a variable string describing a file name by
address ” L" .
Set the file name by decimalized ASCII code to a variable string of 17 variables. Set the head
variable number with address “LO’.

(Example)
If you make a file of file name “ABCD”;
65(A), 66(B), 67(C), 68(D), 32...32(space) shall be set to the 17 common variables of #loo-
116

G330 P21 BlO S2 C2 LlOO ;


_

(Note 1) A file name is fixed to 17 characters. Be sure to fill spaces(code 32), if the file name is
less than 17 characters.

-580
6. FUNCTIONS OF THE MACRO EXECUTOR

(Note 2) Specify a file name with alphanumeric and spaces. Alarm 8 will be generated if the
32(space) code is specifyed at the head of the file name.
(Note 3) A new file is added to the end of recorded files.

(b) Making files by file number


A new file can be made and data can be written to a specified file number by specifying the file
number (1-9999) after address “F”.

(Example)
To make file No.3, specify as follows:
G330 P21 BlO S2 C2 F3 ;

(Note 1) If you make a file with the file number, be careful that every file which was previously
input in the specifyed file number, and all subsequent file numbers are deleted.
(Note 2) Preparation of files by file number can only be conducted for the existing files. Files
I .
can be added only by file name specification.

(3) Control of Directory Information (G330IG339)


The control of directory information is possible with control code “G339”.

Read directory information (G339 PI)


Delete file (G339 P2)
Change file name (G339 P3)

The control mode at line opening shall be of directory information to use this function. Instruct
P = 31132 at the opening time for specification of directory information.

G330 Pp Bb Ss Cc ;

P31 : Channel 1 Directory information control


P32 : Channel 2 Directory information control

Refer to the section on line opening for address “B/S/C”. Be sure to specify IS0 (2) for address
0 @I

C .

Do not instruct several functions continuously in one opening time for every function of directory
reading, file deleting, file name changing if you open with the control mode of directory information.

For instance, close the line once to delete the file after reading and checking directory information,
as follows;

@ Open with the control mode of directory information


0 Read directory information
@ Close the line
@ Open with the control mode of directory information
@ Delete a file

-59-
6. FUNCTIONS OF THE MACRO EXECUTOR

@I Close the line

The same function can be instructed several times in one openning.

(a) Reading directory information

G339 PI Ff Ll Ss ;

File directory information can be read to a specified variable by specifying “G339 Pl”.

Specify the file number( l-9999) for which the directory information is to be read by address “F”.

Address @‘L” specifies the head variable number of a continuous 17 variables which houses the
read file name. The file name is read with decimalized ASCII code every character.
Address “S” specifies the variable number which houses the read file size.
If you have specified (F specification) the file number once, the next directory information can be
read by instructing “G339 Pl” without F specification.

End code = 11 reports that the directory of the specified file number does not exist.

(b) Deleting a file (G339 P2)

G339 P2 LI!Ff

The relevant file can be deleted by the specification of “G339 P2”.

Specify the head variable number of the variable string which houses the file name (ASCII code)
you wish to delete by address “L”, or specify the file number of the file you want to delete by
address ” F” .

Be carefull when deleting with the file number because subsequent file numbers will change after
deletion.

(c) Changing the file name (G339 P3)

G339 P3 Ff LI ;

The recorded file name can be changed by the specification of “G339 P3”.

Specify the file number (I-9999) of the file name you wish to change, by address “F”.

Specify the head variable number of the variable string that houses the file name (ASCII code) to
‘2
_ i
be changed, with address @‘L”.

-6O-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.4.6 End code (#8539)

Check the end code when G330-G339, has been instructed. There is no end code for line closing
processing. It is always a normal end.

~
#8539
__
1 Contents

0 INormal end
1
ILine doesn’t open

2 Line trouble ,DSF? signal OFF

3 Line trouble, Over run

4 ~~ I Line trouble, Receive buffer over flow


5 ILine trouble, Framing error, parity error
6
I NO option for line function (Reader/puncher interface or No. 9002 #7 = 0)

7 I Line use
8 Error in parameter
G335 instructed with transmit control mode
G336 instructed with read control mode

9 I Data format error

10
I Error on file number
11 File of file number specified to read directory information does not exist
I
115 I Undefined variable number specified

255 I Receive data does not exist

6.5 Referencing and Reading NC Program with Conversational Macro


6.5.1 Outline

Recording, deleting and changing of NC part program is possible by the conversational macro
function. Control the NC program with program number and block number. The block numbers are
counted on each EOB regarding the block with address “0” being the No.1 block. For NC
programs in the converational macro , one word is expressed by 2 variables of an address code
and a number, and several words construct a block.

Set extension function valid (Parameter EXTl (No. 9002#7)) to ” 1” at compiling when using this
function.

(Note) For the Series 21, or other models with the available tape length of less than 80 meters,
setting EXTl to 1 reduces this by 1.22 meters.

Make the control instruction using G codes (G320-G327) in the conversational macro.
There is an end code #8529 to check that the instructed function run correcctly or not. Check end ’
code after running G320-G327.
The end is normal when the end code #8529 is 0, and in the cases other than 0, the same number
as the P/S alarm in the usual editing process will be notified.

-61-
6. FUNCTIONS OF THE MACRO EXECUTOR

Control variable
#8520 . .. Specification of program number
#8521 .. . Specification of block number
#8522 .. . Specification of housed variable number
#8523 .. . Variable number of a variable that specifies the number of digits under a decimal
point.
#8529 .. . End code(for reading only)

Control codes
G320 .. . Record a new block
G32l . .. Delete block
G322 . .. Condensation of program
G325 .. . Read specified block
G326 . .. Write block
G327 . .. Delete block

Background editing function as NC function is necessary for this function.


To use the standard MDI, editing operation B must be selected by setting NC parameter No. 018.7
to 1.

6.5.2 Recording of a new program

G320 ;

Specify the program number to #8520 and instruct G320 to record a new program.

(Example)
To record 00002,
#8520 = 2 ;
G320 ;
lF(#8529 NE 0] GOT0 900 ;
Recording end
N900 ;
Error

Conduct similar processing as the edit “Oxxxx” +“INSERT” when recording a new program. EOB
is not inserted.

00002
%

-62-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.5.3 Deleting a program

G321 ;

Specify the program number and instruct G321 to delete a program.

(Example)
To delete 00003
#8520=3 ;
G321 ;
IF[#8529 NE 0] GOT0900 ;
End of deletion
N900 ;
Error

6.54 Reading a specified block

(1) Reading a specified block coded in words (G325)

When issuing this command, specify a program number, block number, and the number of the
variable into which the block is to be read. From the corresponding NC program coded in words,
the corresponding block is read into the specified variable area. Each word contains two variables:
an address code and numerical value.

(Example)
00004 ;
G92 X0. MO8 ;
G90 GO0 X10.5 MO5 ;

#8520 = 4 ;
#8521=3 ;
#8522 = 100 ;
G325 ;
lF[#8529 NE 0] GOT0900 ;
End of reading

N900 ;
Error

The following program data is loaded from HO0 which is specified by variable number #8522, when
the above instruction is executed.;

#I 00 = 7 .......... Address “G”


#101=90 ......... Number
#102 = 7 .......... Address “G”
#103=0 .......... Number
#104 = 24 ......... Address @‘X”

-63-
6. FUNCTIONS OF THE MACRO EXECUTOR

#105= 10.5 ....... Number


#106 = 13 ......... Address “M”
#107=5 .......... Numbew
#108 = 27 ......... Address “EOB”

EOF? (28) is housed as an address, if EOB is not at the end block of the program or EOR position
is specified with block number.
Reading is not conducted as the end code becomes “255”, if a block No. exceeding the block of
EOR is specified.

(Example)
00004 ;
G92 X0. MO8 ;
MO2
%

#lOO= 13 . . ... Address “M”


#101=2 .. . .. . Number
#lo2 = 28 . . . .. Address “EOR”

(Example)
If .
00004 ;
G92 X0. MO8 ;
%

#lo0 = 28 . .. .. Address “EOR”

If the function for reading a specified block coded in words (G325) reads a block which is not
coded in words, completion code #8529 is set to 253 to indicate the fact.

(Note 1) When reading a specified block, a decimal point is added to any data specified without
a decimal point, at the position specified with the parameter for calculator type decimal point input
(No. 015.7).

6.5.5 Block writing

(a) Writing a block coded in words (G326Pp)

Prepared program data can be written in the variable area after the block specified by the program
number and block number. Specify the maximum number of variable data by address P. If
address “EOB” is present within the specified data, program is written up to “EOB”; if “EOR” is
present, program is written up to the EOR; and if neither “EOB” nor “EOR” is present, program-3is :
_
written by the number of data specified by address “PC’. *

(Example)
00004;

-640
6. FUNCTIONS OF THE MACRO EXECUTOR

G92 x0. MO8 ;


G90 GO0 X10.5 MO5 ;

#8520=4 ;
#8521=2 ;
#8522 = 100 ;
#100=7 ;
#lOl = 1 ;
#102=24 ;
#103 = 20.5 ;
#104=6 ;
#105= 1000 ;
#106 = 20.7 ;
G326 P7 ;
lF[#8529 NE 0] GOT0900 ;
End of writing

N900 ;
Error

If the above instruction is executed, a block is input as follows;

00004 ;
G92 X0. MO8 ;
Gl X20.5 FlOOO. ;
G90 GO X10.5 MO5 ;

End code becomes “255” and it is impossible to conduct writing, if the specification of block
number is EOF? block only or higher numbers.

(1) Decimal point specification of every address in block writing

The number of digits after the decimal point of every address can be specified. With this
specification, the contents of the variable number which was specified to #8523 becomes the
number of digits after the decimal point of address A, and it is possible to determine the number of
digits after the decimal point of every address, as shown below.

#8523 = 501 ;
#501 is the number of digits after the decimal point of address A
#502 is the number of digits after the decimal point of address B

#525 is the number of digits after the decimal point of address Y


#526 is the number of digits after the decimal point of address 2

-650
6. FUNCTIONS OF THE MACRO EXECUTOR

Specify <vacant) or 0 - 7 for the number of digits after the decimal point. In the case of
< vacant ), it is considered that no decimal point exists in the address.

(Example)
If address code = A, number = 1.2345678

Decimai point specification


= <blank) Al
= 0 Al.
= 1 Al .2
= 2 Al .23
*
= 3 Al .235
*
= 4 Al .2346
*
= 5 Al .23457
*
= 6 Al .234568
= 7 Al .2345678
The data less than the specified digits is rounded off.

When #8523 is 0, auto setting is conducted by the system conditions (mm input/inch input, 0.1 pm
instruction) and specified address. #8520 - #8523 is set to 0 when the power is turned on.

6.5.6 Block deletion

G327 ;

A block specified by a program number and a block number can be deleted.


#8520 = 4 ;
#8521=3 ;
G327 ;
lF(#8529 NE 0) GOT0900 ;
End of deletion
N900 ;
Error
The block of block No.3 of program 00004 is deleted by the above instruction.

-660
6. FUNCTIONS OF THE MACRO EXECUTOR

6.5.7 End code (#8529)

Check the end code after running every processing.


The end is normal when the end code is 0, and when the end code is a number other than 0, the
same number as with the P/S alarm in the usual edition processing and the following codes are
informed.

44529 Contents

140 Processing of the program being selected in the foreground cannot be


conducted.

200 The specified character code is not found. (G329)

202 The data to be written begins with 0. (G329)

253 The specified block is not coded in words.

254 Program editing is prohibited by setting the memory protection key [when
compilation parameter bit 1 of No. 9006 (KEYC) is set to 01.

255 Need the option for background editing function.


It is impossible to instruct the statement during background editing.
Parameter for the extension function effective (No.9002#7 EXTl) must be
set to “1” at compiling.

6.5.8 Notes

Selection processing by work number search etc. is required when foreground operation IS
executed for a program which has been prepared and edited under background.

6.5.9 Address code table

\
Address Code Address Code Address Code
r
A 1 K 11 U 21

B 2 L 12 V 22

C 3 M 13 W 23

D 4 N 14 X 24

E 5 0 15 Y 25
I
F 6 P 16 Z 26

G 7 Q 17

H 8 ‘R 18 EOB 27

I 9 S 19 EOR 28

J 10 T 20 / 29

-670
6. FUNCTIONS OF THE MACRO EXECUTOR

6.6 Continuous Input by Cursor and Page Key


Continuous input by cursor and page key is possible with the conversational macro key input
control (#8501).

#8501 can be read with the following timing if the cursor and page key, are continuously pressed.

Page key ON

OFF
#8501= data

#**oMJuLnJL
l+wG4P4
(MSEC)

6.7 Masking of 0, N Number Appearance


0, N number appearance can be erased on the CUSTOM screen.
0, N numbers does not appear when compile parameter “ONMSK = I” (No.9003#0).

6.8 Reading and Presetting Cutting Time and Cutting Distance by


Conversational Macro
Cutting distance and cutting time can be read and preset with the macro variable of the
conversational macro.
Use it for the control of a tool life.
#8553, #8554 does not become 0 at power on.

6.8.1 Reading and presetting cutting time (#8553)

The time only for instruction of GO1 (linear interpolation) and G02,G03 (circular interpolation) can
be counted by #8553.
The unit is the same as the macro variable (#3002).

6.8.2 Reading and presetting cutting distance (#8554)

The distance only for instruction of GOl(linear interpolation), and G02, GO3 (circular interpolation)
can be counted by #8554.
It is valid also for helical instruction.

Parameters (No.9002#7 / EXTI ) and (No.9004#7 / CUTLG) have to be on at compiling to use this
function.

The unit is
... O.OOl(mm) for the mm input system.
... O.OOOl(inch) for the inch input system. -3
Y z

As the tool movement distance is added to #8554 at the time of starting the cutting block, the
distance of block movement is added even when cutting stops during a block due to resetting, etc.

-68-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.9 Reading and Presetting Relative Coordinates by Conversational Macro


Relative coordinates can be read and preset with the conversational macro.

6.9.1 Reading relative coordinates

Reading of relative coordinates can be informed by the window function.


Set 10 No.1 1O-1 15 to #8993, and relative coordinates can be read by #8999.
ID No. 110 1st axis coordinates
111 2nd axis coordinates
112 3rd axis coordinates
113 4th axis coordinates

(Example)
If the relative coordinates value of the 1st axis is - 123.456
#8998 = 110; ((Include the contents of ID No.1 10)
#500 = #8999;
Contents of #500 is -123456.

6.9.2 Presetting relative coordinates

Relative coordinate values can be freely preset by G3lOAaQq.


Set the ID No. shown above to address A.
All0 - 115
Set the coordinates values to be preset to address Q.
Q - 99999999 to 99999999
Relative coordinate values can be preset freely by execution of this control.
(Example)
To preset the relative coordinates value of 1st axis to -123.45;
G310 A110 Q-123450
Be sure that this function does not change the increment system.

-69-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.10 Key-Input and Data-Input Control


(1) Key-input control variable #8501
You can read out the key input with #8501. The following is the correspondence of the key
input and #8501.

(a) 9 “CRT”

Key input Value Key input Value


I I
PAGE.DOWN I 1 ~SOFT FUNCTION KEY LEFr I 11

PAGE UP I 2 SOR FUNCTION KEY 1 12


I --
CURSOR DOWN I 3 SOFT FUNCTION KEY 2 I 13

CURSOR UP SOFT FUNCTION KEY 3 I 14

ALTER I 5 SOFT FUNCTION KEY 4 Ir 15


-~~-
INSERT I 6 SOFT FUNCTION KEY 5 . I 16
DELETE I 7 SOFT FUNCTION KEY RIGHT 1 17

INPUT I 8

RESET I 10

CURSOR RIGHT I 18

CURSOR LEFT I 19

(b) 14 “CRT”
The soft function keys for 14” CRT follows:
The other keys are the same as 9” CRT. .

Key input Value Key input Value


I II I
SOFT FUNCTION KEY LEFT 1 20 11SOFT FUNCTION KEY 1 I 21

SOFT FUNCTION KEY 2 I 22 II SOFT FUNCTION KEY 3 I 23

SOFT FUNCTION KEY 4 I 24 SOFT FUNCTION KEY 5 I 25

SOFT FUNCTION KEY 6 I 26 SOFT FUNCTION KEY 7 I 27

SOFT FUNCTION KEY 8 I 28 SOFT FUNCTION KEY 9 I 29

SOFT FUNCTION KEY 10 I 30 SOFT FUNCTION KEY RIGHT 1 31

When there is no key input, the #8501 value is 0.

-709
6. FUNCTIONS OF THE MACRO EXECUTOR

Once there is a key input, #8501 holds its value till it is input with the macro statement, and the
following key inputs will be ignored. When #8501 is input, the status gets ready to accept the key
input and #8501 will be 0.
It is impossible to write a value into #8501.

(2) Data input control variable #8502, numerical data variable #8503, address data variable #8504
Control the input of numeric data and address data by setting the following values to #8502.

#8502 = O... No data input


= 1. .. Input of numeric data
= 2 .. . Input of address data and numeric data
= 3 ... Expanded data input control

When #8502 is 0, nothing will be displayed on the data input line and it will be impossible to input
data, either.
When #8502 is 1, NUM will be displayed on the data input line and input of numeric data will be
possible. When #8502 is 2, ADRS will be displayed on the data input line. After address data is
input, NUM is displayed and it is possible to input the numeric data. #8502 value is 0 at switching
on the power.
When the key-input control variable #8501 is key-input to the value other than 0, the data input line
will return to the initial state. It is possible to read out the input numeric value and address with the
numeric data variable #8503 and the address data variable #8504 respectively. The following is the
correspondence of the input address and #8504.

A ...l B . ..2 c ...3 D ...4 E ...5


F ...6 G . ..7 H ...8 I ...9 J ..lO
K ..I 1 L . ..l M ..13 N ..14 0 ..I5
P ..16 Q ..17 R . . 18 S ..19 T .- 20
U ..21 V ..22 W . . 23 X .. 24 Y l 9 25
Z ..26

#8503 and #8504 values will be held till the input control variable #8501 is key-input to the value
other than 0.
When numerical data and address data are not input, #8503 and #8504 will be “vacant“
respectively.
It is impossible to write any values to #8503 and #8504.

Conversational Macro Extented Data Input Control Function (Full key specification onlv)
If you set 3 to #8502, and a variable number to #8552, the character string input mode is entered,
and < apears on the input line, and it is possible to input addresses and number data.
The data input line changes to the initial state when key input status variable #8501 changes to
other than 0. 32 variables from a variable number which is set to variable #8552 can read the input
-2
T ;
numbers and addressesfor as ASCII codes.
<blank) input a 32 number series if there is no input data.

-71-
6. FUNCTIONS OF THE MACRO EXECUTOR

(Example)
Set for
#8502=3 ;
#8552 = 500 ;
and input
0123456ABCD <
and press return key, then the following values are set to 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= <blank ) to #531= <blank ), #8501= 8
The values of #8503, #8504 are not guaranteed.

6.11 Cursor Control


It will be possible to display the cursor by setting the value at the cursor control variable #8505.

#8505 = 0 .. Cursor erase


= 1 . . Cursor display

#8505 value is 0 at power ON.

It will be possible to display the cursor at any optional position by setting the values for the cursor
X position control variable #8506 and the cursor Y position control variable #8507. Specify the
cursor position with the character coordinates system.

6.12 Processing Array Type P-CODE Variables


(1) Reference of array type P-CODE variables for conversational macro
In conversational macro, two or three-dimensional array type P-CODE variables (#lOOOO...) can be
referred. Set a proper value to the following array control variables beforehand and an array
element of P-CODE variables is referred to corresponding to the variable number (#l - #99).

(Note) Variables #l to #99 for convesational macro are different from local variables #l to #33
for execution macro.
Array control variable:
#8512 Two-dimensional array number
#8513 Three-dimensional array number
#8516 Maximum value of one-dimensional array number
#8517 Maximum value of two-dimensional array number
#8519 Array top variable number
Specify an array type by the array control variables #8516 to #8519 and specify the
array number referred to by the #8512 and #8513. Variables #l to #99 are used to
refer the values.

The correspondence between the P-CODE variables and array elements is as shown below: ?-- -
P-CODE variable number r
= #8519 + ((#8516 x#8517) x (#8513 - 1)) + (#8516X (#8512 - l)(Specified variable number - 1)

-720
6. FUNCTIONS OF THE MACRO EXECUTOR

Example)
M(hen the #8516, #8517, and #8519 are set to 10, 5, and 10100, respectively:
1) When both of #8512 and #8513 are set to 1, the value for #l corresponds to that for
#Ho1 00.
2) When the #8512 and #8513 are set to 3 and 2, respectively, the value for #lO corresponds
to that for #lo1 79.
Each variable of #8512 to #8517 and #8519 are set to 1 and 10000, respectively when the power is
turned on.
Thus, the #8513 and #8517 can be used in the case of use as the two-dimensional array. No
check is carried out on minimum value of each variable P-CODE variable number after calculation.
use the macro program when needed.

(Note 1) This function can be used in the conversation macro program and auxiliary macro
program.
In the execution macro, the #l to #33 are local variables and the #34 to #99 are variables which
cannot be used and would result in an alarm.

(2) Processing array type P-CODE variables


This is a function which controls processing of array type variable or of variable string when P-
CODE variables are used in the conversational macro.

1) clearing array type number, variable string (continuous writing of specified data)
2) transferring to variable string from array type variables or variable string
r
tvery processing commands control code “G315” after defining an array or variable string or data
to the following control numbers.

#8511 : data to be transferred


#8512 : 2 dimensional array number or the head variable of a variables string to be
transferred
#8513 : 3 dimensional array number to be transferred
#8514 : transferred 2 dimensional array number or the head variable of a variable
string
#8515 : transferred 3 dimensional array number

Control code
G315 P (Processing code) K (a number of processing data) ;

Processing code specifies the type of processing with a 3-digit number. High-order “OS” can be
supressed.

PO01 (Pl) : Loads data of #8511 to K continuous numbers from the number which was
specified at #8514.
PO02 (P2) : Transfers K continuous data which was specified at #8512 to K continuotrs -
variables from the variable which was specified at #8514 (ascending order). -

-730
6. FUNCTIONS OF THE MACRO EXECUTOR

PO03 (P3) : Transfers K continuous data which was specified at #8512 to K continuous
numbers from the number which was specified at #8514 (descending
order).
PlOl : Loads data of #8511 to K continuous array numbers of array number #1
which was specified at #8514, #8515.
P102 : Transfers K continuous array variables starting with variable #l which was
specified at #8512 and #8513, to the continuous array variable which was
specified at #8514 and #8515 (ascending order).
P103 : Transfers K continuous array ariables starting with variable #1 which was
specified at #8512 and #8513, to the continuous array variable which was
specified at #8514 and #8515 (dscending order).

The difference of P2 and P3, or P102 and P103 results from whether transfer processing is
conducted from a small number or from a large number.

(Example)
If #8512= 10000, #8514= 10010,

G315 P2 K3 ; has the following disposition.


#lOOlO = #10000 ;
#lOOll =#lOOOl ;
#10012=#10002 ;

G315 P3 K3 ; has the following disposition


#10012=#10002 ;
#lOOl 1 = #lOOOl ;
#10010=#10000 ;

6.13 Torque Limit Control


The torque limit override can be modified to the specified value by setting values to the #8621 to
#8624.
#8621 1st axis
#8622 2nd axis
#8623 3rd axis
#8624 4th axis
The relation of setting value and torque limit override are shown as below:
Setting Torque override
0 O/OO
. .
.

128 500/o
255 100%
The values on power on are 100%. z -

(Note 1) #8621 to #8624 can be used even at the memory operation execution level.
6. FUNCTIONS OF THE MACRO EXECUTOR

(Note 2) When a value other 0 to 255 is set:


In an execution---P/S alarm 110
In conversational/auxiliary macro---Ignored

6.14 Data Reading of A/D Converter


Data from the ND converter can be read by the conversational macro.
The AID converted data from channels 1 to 4 corresponds to macro variables #8631 to #8634.

When reading operation is performed in the conversational macro program, the ND converted data
of each channel at that timing is input.
#8631 A/D converted data of channel 1
#8632 A/D converted data of channel 2
#8633 ND converted data of channel 3
#8634 A/D converted data of channel 4

(Note 1) The ND converted data variables #8631 to #8634 can be used for read only.No data
can be written in them.
Correct #lOO = #8631
IF [HI631 GT 1000) GOT0 100 ;
#lOl = #8634/200 ;
Incorrect #8631 = 2000 ;
(Note 2) The Al board (analog interface board) is required when this function is used.

6.15 PMC Axis Control


6.15.1 PMC axis control by the G code

The conversational macro can control the PMC control axis through the PMC axis control interface.
The seven control codes listed below are used for this purpose. The PMC control axis to be
controlled is specified by the PMC control axis selection variable, #8602.

G340 -+ Rapid traverse command


G341 + Cutting feed command
G344 + Dwell command
G345 + Reference position return command
G346 + Miscellaneous function command
G348 + Status signal read command
G349 + Command signal write command

#8602 --) PMC control axis selection variable

-75
6. FUNCTIONS OF THE MACRO EXECUTOR

The controlled axes to be selected vary with whether specification A or B is selected. Parameter
No. 032.6 (EBCSB) is used to select either specification A or B.

Specification *A Specification B
#8602
OT OM OT OM

0 3rd axis 1st to 4th axis 1st to 4th axis(2) 1st to 4th axis(?)
* 1st to 4th axis(?)
1 4th axis -(1) 1st to 4th axis(?)

2 5th axis 5th axis 5th axis 5th axis

3 6th axis 6th axis 6th axis 6th axis

*1) For the O-M of specification A, the X-, Y-, Z-, or 4th axis is selected according to parameter No.
30 (EACl and EACO). Specifying #8602 = 1 causes control commands to be ignored.

‘2) For specification B, an axis is selected according to the bit setting of signal G144,’ or the PMC
controlled axis selection variable (#8700). Set the Gl44 bits using the PMC. For details, refer. to
the Connection Manual (B-61 393E). .

If a value other than 0 to 3 is specified in #8602, the control command is ignored.

Control codes

Rapid traverse command (G340)


G340 Xxxx;

The rapid traverse command is issued to the PMC control axis. Specify the incremental traveling
distance after address X.

(b) Cutting feed command (G341)

G341 Xxxx Ffff;

The cutting feed command is issued to the PMC control axis. Specify the incremental traveling
distance after address X. Specify the feedrate after address F.

(c) Dwell command (G344)

G344 Pxxx:

The dwell command is issued to the PMC control axis. Specify the dwell time after address P.

(d) Reference position return command (G345)


J -
G345;

The reference position return command is issued to the PMC control axis.

-760
6. FUNCTIONS OF THE MACRO EXECUTOR

(e) Miscellaneous function command (G346)

G346 Mmm;

The miscellaneous function command is issued to the PC control interface. Specify the
miscellaneous function code after address M.

(f) Status signal read command (G348)

G348 Pppp;

The status signals (F270, F273, F1470, F1473) of the corresponding PMC axis control interface are
read into the variable indicated by address P. A one-byte signal is expressed in decimal and input
to the variable. The EBSY signal is always input as 0.

7 6 5 4 3 2 1 0
.
EBSY EOTN EOTP EGEN EDEN EIAL ECKZ EINP

For details of the signals, refer to the CONNECTION MANUAL (B-61393E) for each Series.

(Example) When both EOTN and EIAL are 1

G348 Pl 00;

This G code causes #IO0 to be set to 68.

(g) Command signal write command (G349)

G349 Pppp;

A numeric value indicated by address P is written into the command signals (G210, G218, Gl410,
G1418) of the corresponding PMC axis control interface. The EBUF and EFIN signals cannot be
written.
7 6 5 4 3 2 1 0

EBUF ECLR ESTP ESOP ESBK EFIN

For details of the signals, refer to the CONNECTION MANUAL (B-61393E) for each Series.

(Example) ECLR can be set to 1 by the following G code:

G349 P64; (64 = O1OOOOOOb)

-770
6. FUNCTIONS OF THE MACRO EXECUTOR

(2) Notes

(a ) Buffering a command
The PMC axis control function buffers command blocks in the CNC unit so that it can execute
two or more commands sequentially. While a block is being executed, the next block can be
specified if the CNC buffer has sufficient free space. If the CNC buffer has no free space, the
next command is in the wait state until the previous command block is executed and space in
the buffer becomes free. Meanwhile, the display level is locked.

(b) Miscellaneous function command


A miscellaneous function command can be issued by G346. The conversational macro,
however, cannot control the miscellaneous function completion signal, EFIN. Use the PMC to
control it.

(c) Contention for the PMC axis control function


The situation in which both the PMC and this function issue commands to an identical PMC
control axis must be avoided. When this function is used for a ‘PMC control axis, the PMC can
control only the following two signals for the same control axis: Miscellaneous function
completion signal (EFIN) and axis selection signal (Gl44).

For details, refer to the CONNECTION MANUAL (B-61393E) for each Series.

6.152 PMC axis control by variables

The conversational macro can control the PMC control axis with variables through the PMC axis
control interface.
The macro uses the following variables for PMC axis control:

#8700 + PMC control axis selection variable

Variable area
Name of variable I
Area A Area B
I 1
PMC command signal variable #8710 #8720
1
PMC control command variable #8711 #8721
I
PMC cutting feedrate variable #8712 #8722

PMC controlled travelling distance variable #8713 #8723


I
PMC status signal read variable #8715 #8725

-789
6. FUNCTIONS OF THE MACRO EXECUTOR

The controlled axes to be selected vary with whether specification A or B is selected. Parameter
No. 032.6 (EBCSB) is used to select either specification A or B.

Specification A (EBCSB = 0) Specification B (EBCSB = 1)


Variable
OT OM OT OM
I

Area A 3rd axis 1st to 4th 1st to 4th 1st to 4th


7th to 8th axis 7th to 8th axis(?) 7th to 8th axis(?)
.

*
Area B 4th axis -( 1) 1st to 4th 1st to 4th
7th to 8th axis(‘2) 7th to 8th axis(‘2)
L

*1) For the O-M of specification A, the X-, Y-, 21, or 4th axis is selected according to parameter
No. 30 (EACl and EACO). Specifying #8602 = 1 causes control commands to be ignored.
“2) For specification B? an axis is selected according to the PMC controlled axis selection variable
(#8700).

For details, refer to the CONNECTION MANUAL (B-61393E) for each Series.

(1) Variables

(a1 PMC command signal variable (#8710 and #8720)


When a numeric value is specified in #8710 or #8720, data is written into the command signals
(G210, G218) of the corresponding PMC axis control interface. G2l0, G218 cannot be read
from the PMC. The EFIN signal cannot be written.

7 6 5 4 3 2 1 0
I
EBUF ECLR ESTP ESOP ESBK EFIN

(b) Control command variable (#8711 and #872l)


When a control command is specified in #8711 or #8721, the axis control command is written
into the corresponding axis control command signal (G211, G219). (G211, G2l9 cannot be
read from the PMC). The command can also be read.

7 6 5 4 3 2 1 0
I

EC7 EC6 EC5 EC4 EC3 EC2 EC1 EC0


P

(C) Cutting feedrate control variable (#8712 and #8722)


When a numeric value is specified in #8712 or #8722, the cutting feedrate is written into the
corresponding command data signal (G212, G213, G220, G221). The feedrate can also be
read. (G212, G213, G220, G221 cannot be read from the PMC).

~2 ;
7 6 5 4 3 2 1 0
EIF7 EIF6 EIFS ElF4 EIF3 EIF2 ElFl EIFO

EIFl5 ElFl4 EIF13 EIF12 ElFl 1 ElFlO EIF9 EIF8


l
6. FUNCTIONS OF THE MACRO EXECUTOR

(d) Controlled traveling distance variable (#8713 and #8723)


When a numeric value is specified in #8713 or #8723, the axis traveling distance, dwell time, or
miscellaneous function code is written into the corresponding command data signal (G214 to
G217, G222 to G225). The data can also be read. (G214 to G217, G222 to G225 cannot be
read from the PMC).

7 6 5 4 3 2 1 0
EID7 EID6 EID5 ElD4 EID3 El02 ElDl EIDO

EIFl5 EID14 EID13 EIDl2 ElDll ElDlO El09 EID8

EID23 EID22 EID21 EID20 EID19 ElDl8 ElDl7 El016

ElF31 I EID30 1 ElD29 1 ElD28 1 EID27 1 EID26 1 ElD25 I ElD24

(e) PMC status signal read variable (#8715, #8725)


The status signals (F270, F273) of the corresponding PMC axis control interface are written
into the variable specified after address P. A one-byte signal is expressed in decimal and input
into the variable.

7 6 5 4 3 2 1 0
EBSY EOTN EOTP EGEN EDEN EIAL ECKZ EINP
4

For details of the signals, refer to the CONNECTION MANUAL (B-61393E) for each Series.

6.16 Interlock Function for Axis Direction


The interlock control variable for a single axis direction, #8600, determines the direction for which
interlocks are provided. Variable #8601 indicates the axis and direction of a movement when the
SKIP signal is set on.
This function is validated when compilation parameter XDIL (No. 9002, #4) is set to 1.

The interlock function for a single axis direction is validated only when the following two conditions
are satisfied: The system is in the mode in which an interlock is provided for a single axis
direction, that is, the JOG or HNDL mode. The signal of the internal PMC relay (R area) which
was specified by compilation parameters (No. 9035 [Address] and No. 9036 [Bit] is set on.

When the values of variables #8600 and #8601 are expressed in binary, each digit corresponds to
a single axis direction as shown below:

7 6 5 4 3 2 1 0
M Series 4- 4+ Z- Z+ Y- Y+ X- X+

T Series 4- 4+ 3- 3+ Z- Z+ X- X+

-8O-
6. FUNCTIONS OF THE MACRO EXECUTOR

When the values of #8600 and #8601 are 00000001 in binary, for example, they indicate the
positive direction along the X-axis. When they are 00000010 in binary, they indicate the negative
direction along the X-axis.

(1) Interlock control variable for a single axis direction, #8600

When the value of variable #8600 is 0, interlocks are provided for all axes whenever the SKIP
signal is set on.
When the value of variable #8600 is other than 0, interlocks are provided for the axis direction
indicated by the value.
When the power is turned on, the value of #8600 is set to 0.

(2) Variable indicating the axis and direction of movement when the SKIP signal is set on, #8601

When the state of the SKIP signal changes from off to on, variable #8601 indicates the axis along
.
which the last movement was made and the direction of movement.
The value of #8601 is retained until the state of the SKIP signal changes from off to on next time.
No value can be written in variable #8601.

6.17 Function for Separating UI from UO of the P-CODE Program


This function allows the signals of the system variables of the P-CODE program (UI: HO00 to
#lo1 5, #1032, UO: #l 100 to #1115, #1132) to be different from those of the user program.
When the program is compiled with parameter DIOC (No. 9006, #O) set to 1, Ul and UO of the P-
CODE program (execution, conversational, or auxiliary macro) correspond to the following interface
signals. Even when this function is used, Ul and UO of a user-created custom macro program
correspond to ordinary interface signals.

Input signal Output signal


#lo00 : EUIOO #1 100 : EUOOO
#lOOl : EUIOl #llOl : EU001
#lo02 : EU102 #1102 : EU002
. .

#lo15 :‘EUl15 #1115 :‘EUC15

#lo32 : EUIOO-EUll5 #1132 : EUOOO-EU015

PMC interface

Input signal
7 6 5 4 3 2 1 0
G135 EU107 EU106 EUlO5 EU104 EU103 EU102 EUlOl EUIOO

G136 EUl15 EUl14 EUl13 EUl12 EUH 1 EUIlO EUlO9 EU108 1


.

l
-81-
6. FUNCTIONS OF THE MACRO EXECUTOR

Output signal
7 6 5 4 3 2 1 0
F182 EU007 EU006 EUOOS EU004 EU003 EU002 EUOOl EUOOO
r
Fl83 EU015 EU014 EU013 EU012 EUOll EUOlO EU009 EU008

6.18 Referencing Common Variables of Custom Macros


An execution, conversational, or auxiliary P-CODE program can reference and write common
variables (#lOO to #199, #500 to #999) used by a user program for custom macro 6. With
variables #99100 to #99199 and #99500 to #99999, the P-CODE program can reference and write
common variables #lOO to #199 and #500 to #999 of the user program.

#99100 = ) Corresponds to #lOO.


.
#99149 = ; Corresponds to #149.

#99500 = ; Corresponds to #500.

#99531 = ) Corresponds to #531.

6.19 Function for Finding a P-CODE Work Number


When compilation parameter PWSR (No. 9002, #6) is set to 1, the function for finding a P-CODE
work number can be used.

When an operation program created in the program editing memory makes a G-, M-, or T-code
call, generally an execution macro (program) is called and executed as a subprogram or a macro
program. If automatic operation is started with this function, an execution macro program
cataloged in the ROM can be directly activated.

A conversational or auxiliary macro is used to write the number of the P-CODE program to be
started in the P-CODE work number control variable (#8610).

If the value of #8610 is not null or 0 when the automatic operation is started in the automatic
operation mode while the CNC unit is in the reset state, the P-CODE program having the number
indicated by the value of #8610 is found and executed from the beginning.

If the value of #86lO is null or zero, the user program currently selected by the CNC unit is
executed as usual.

If the program started by this function ends with M99, the currently selected program is executed
after M99.

-820
6. FUNCTIONS OF THE MACRO EXECUTOR

When power is turned on, the value of #8610 is set to 0.

(Note) When #8610 is a value other than zero, this function starts a P-CODE program regardless
of the program currently selected by the CNC unit (the user program displayed on the CNC
screen). When this function is used, measures to prevent an operator error must be taken. For
example, an alarm lamp activated by an auxiliary macro or the PMC and interlock processing are
helpful.

6.20 Function for Calling a User Program by an Execution Macro


6.20. I Function

Using the M code specified at compilation, a P-code program (execution macro program) called by
a G, M, or T code from a user program can call another user program as a subprogram.

(User program) (P-code program) ,.

00001;
GlOO x10. 220.; I * OgolOt
0
.
MO2 . :
Mmm PlOOO;
:
:
01000; -e I M99;
.l

0
H99;

6.20.2 Calling format

Mmm Ppppp;

mm: M code specified with compilation parameter No. 9033


pppp: Number of the user program to be called (A variable or expression can also be specified.)

6.20.3 Notes

A user program called from an execution macro cannot call another user program or execution
macro program.
The macro executor cannot check whether the called user program contains the following
commands:

M98, G65, or G66


Macro/subprogram call with a G, M, or T code
Macro/subprogram call with a G, M, or T code (P-code)

If any of the above commands is specified, a malfunction occurs but no error message is output.

-830
6. FUNCTIONS OF THE MACRO EXECUTOR

It is impossible to specify the sequence number to will be returned from the called
user program.

6.21 Operation Functions (Logarithm, Exponent, Arcsine, Arccosine)


6.21.1 Overview

The following operation functions can be used:


Logarithm (LN)
Exponent (EXP)
Arcsine (ASIN) (Unit: Degrees)
Arccosine (ACOS) (Unit: Degrees)
The functions above have the same effect as the operation instructions of custom macro B. For
the precision, data format, operation precision, and so forth of the functions, refer to the
OPERATOR’S MANUAL of each Series.
The functions can be used only with a conversational macro.

6.21.2 Operation

To find the value assumed by a function for a given value, enter the given value in #lOI, then
execute the corresponding instruction indicated below. Then, the result is substituted into #lOl.

Logarithmic function (LN)

#lOO = LN[#lOl] ;

Exponential function (EXP)

#lOO = EXP[#l ol] ;

Arcsine function (ASIN)

#lOO = ASIN[#lOl] ;

Arccosine function (ACOS)

#lOO = ACOS[#lOl] ;

-84-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.22 Function for Identifying the Pressed MDI Key Using a Conversational
Macro
6.22 1 Overview

A control variable has been added to enable reading of the MDI key image signal corresponding to
the pressed MDI key using a conversational macro. The control variable allows a conversational
macro to identify the pressed MDI key.

6.22.2 Function

By reading the values of control variables #8540 to #8548, the pressed MDI key can be identified.
These variables are MDI key image signals. Each variable can be read as an 8-bit binary value.
Key images corresponding to the bits of the variables vary with the series and MDI key type.
There are six key image patterns, as follows:
1. OM/9” CRT/standard keyboard
2. OM/9”CRT/fulI keyboard
3. OM/14”CRT/full keyboard
4. OT/9”CRT/standard keyboard
5. OT/9”CRT/full keyboard
6. OT/I 4”CRT/full keyboard

6.223 Example

The following program causes “PUSH” to blink while the “START” key is pressed:
#lOO = #8501 ;
IF [#lo0 NE 9) GOT020 ;
NlO G243 X0 YO Al 82 (PUSH) ;
#101=#8542 AND 16 ;
IF [#lo1 EQ 0) GOT020 ;
M99 PlO ;
N20 G243 X0 YO Al K4 ;

6.22.4 Key image correspondence

(1) OMI9” CRT/standard keyboard

r
Number 7
I 6
I
5
I
4
I
3
I 2
I 1
I 0
II
#8540 7 0 6 2 5 Y 4 X 3 R 2 F 1 H 0 S
1 #8541 1 /#: 1 KJI I4thB 1 Q P 1 . T 1 - M 1 9 G 1 8 N 1

1 #8542 l I l out/St I input I delet I insrt I alter 1

1 #8543 l l op/alm I aux/gr I dgn/pr I mnu/of I progm I pos

I #8544 I can l l page t I page 1 1 curt I cur 1


I #8545 1 reset I

1 #8546 1 sft RT 1 sft 5 1 sft 4 1 sft 3 1 sft 2 1 sft 1 1 sft LF 1 1 -


1 #8547 1

-85-
6. FUNCTIONS OF THE MACRO EXECUTOR

(2) OM!9” CRT4UII keyboard

Number 7 6 5 4 3 2 1 0
I I I I I I
#8540 7 61 51
#8541 can
.
9
I 91 8
#8542 1 shift 1 out&t 1 input 1 delet 1 insrt 1 alter
~~ _
#8543 macro menu 1 opialm 1 aux/gr I dgnjpr 1 offset I progm 1 POS

#8544 B sP D H 1Q 1 1P 1 1paget 1page 1 1 curt 1 cur 5_


#8545 reset
#8546 sft RT sft 5 1 sft 4 1 sft 3 1 sft 2 1 sft 1 1 sft LF 1
#8547 4th
#8548 L +

(3) OMU4” CRT/full keyboard

Number 1 7 1 6 5 4 3 I 2 1 I 0

#8540 71 6 5 4 II 0

91
I
#854l / 8
#8542 shift outkt input I delet insrt -1 alter
#8543 macro 1 menu op/alm aux/gr dgn/pr I offset progm I Pas
#8544 B sp 1 D H Q 1 p [ pager I page1 curt 1 cur 1
#8545 reset 1 sft 31 sft 2 sft 1 1 sft LF
#8546 sft RT 1 sft 10 sft 9 sft 8 sft 7 1 sft 6 sft 5 I sft 4
#8547 4th 1 2 W Y v x u
#8548 L+IT* s = M #

(4) OT/9” CRT/standard keyboard

Number 7 6 I
1
5 4 3 2 1
I 0

#8540 7 0 6 F 1 5 2 4 x 3 R 2 w 1uIos

#8541 / #; KIH 1 A C JQP . T -M 9Gl8N


#8542 ouvst input delet
I
#8543 1 op/alm aux/gr dgn/pr mnu/of
#8544 can page t page 1 curt I cur 1
#8545 reset
#8546 sft RT sft 5 1 sft 4 sft 3 sft 2 sft 1
#8547
IV8548 I

-860
6. FUNCTIONS OF THE MACRO EXECUTOR

(5) OT/9” CRT/full keyboard


Number
~~
7 6 I 5 I 4 I 3 2 1
I 0

#8540 7 6 /I 51 41 3 2 ‘I 0
#8541 can .
9
I / . -
91 a
#8542 l shift out&t input delet ~ insrt 1 alter

#8543 macro menu op/alm 1 aux/gr 1 dgn/pr offset progm 1 POS


#8544 A sP D Q I 1p I 1page t Page 4 cur f I cur 1
#8545 reset
#a546 sft RT sft 5 sft 4 I sft 3 1 sft 2 sft 1 sft LF 1
#8547 W H u v ZJIXYIRC G B
-~~
#8548 L + T * S = b-1 F E

(6) OT/14” CRT/full keyboard .

Number 7 6 5 4 3 I 2 1 0

#a540 7 6 5 4 1 I 0
#a541 can . I # 9 8
9

#8542 shift outfst input 1 delet insrt ! alter


#8543 macro menu op/alm aux/gr dgn/pr I offset progm ! pos
#a544 A SP D Q 1 paget I page1 cur t
#a545 reset sft 3 sft 2 ~ sft LF

#a546 sft RT sft 10 sft 9 sft 8 sft 7 sft 6 sft 5


#8547 W H u v Z J x Y RCIG B N ) 0 (
#a548 L + T * S = M # FI E K @ 1 9
6. FUNCTIONS OF THE MACRO EXECUTOR

6.23 Window Function


6.23.1 Overview

The windowfunction can now reference following system information.


m Alarm information
l External alarm information
l Total number of machined parts
l Diagnosis information
l Conversational macro variable
No. 8998: System information ID number
No. 8999: System information

Method of using the function


By setting a desired value in the system information ID number variable (#8998), system
information can be read into the system information variable (# 8999).
.
(Example)
l Monitoring P/S alarms
#8998 = 1 ; (Get the contents of ID No. 1)
#500 = #8999 ;

#500 = #500 AND 8 ;


IF [#500EQO] GOT090 ; (Monitor the PS flag bit of ID No. 1)
#8998 = 2 ; (Get the contents of ID No. 2)
#501=#8999 ;
N90M99 ;
The P/S alarm is set in #501.

l Obtaining the total number of machined parts


#8998 = 200 ;
#500 = #8999 ;
The total number of machined parts, stored in ID No. 200, is set in #500.

-880
6. FUNCTIONS OF THE MACRO EXECUTOR

6.23.2 Referenced system information

Referenced System Information and ID No. List (l/3)

Contents of Information
ID No. Information r
OM OT

1 Alarm check flag Alarm check flag


2 P/S alarm number P/S alarm number
3 Overheat alarm Overheat alarm
4 Overtravel alarm Overtravel alarm
5 2nd overtravel alarm 2nd overtravel alarm

6 Servo alarm Servo alarm


7 (66) Servo alarm : X axis Servo alarm : X axis
.. .. Z axis
8 (61) Y axis
.. .. 3rd axis
9 (62) Z axis
.. .
IO (63) 4th axis . 4th axis
64 .. .. 7th axis
7th axis
65 . .. 8th axis
. 8th axis

11 APC alarm flag APC alarm flag


12 (30) APC condition : X axis APC condition : X axis
.. .. Z axis
13 (31) Y axis
. .. 3rd axis
14 (32) . Z axis
15 (33) .. 4th axis .. 4th axis
.. .. 7th axis
34 Alarm 7th axis
.. .. 8th axis
35 8th axis
Information APC alarm : X axis
I6 (40) APC alarm : X axis
17(41) . .. Z axis
. Y axis
.. .. 3rd axis
I8 (42) Z axis
I9 (43) .. 4th axis .. 4th axis
44 .. .. 7th axis
7th axis
.. .. 8th axis
45 8th axis

21 External alarm flag External alarm flag


22 External alarm 1 External alarm 1
23 2 2
24 3 3
25 4 4
29 Custom macro alarm number Custom macro alarm number

50 SPC alarm : X axis SPC alarm : X axis


51 .. .. Z axis
Y axis
.. .. 3rd axis
52 Z axis
..
53 .. 4th axis 4th axis
.. ..
54 7th axis 7th axis
..
55 .. 8th axis 8th axis

-89-
6. FUNCTIONS OF THE MACRO EXECUTOR

Referenced System Information and ID No. List (2/3)

Contents of Information
ID No. lnformation r
OM OT

100 No. of CNC controlled axes No. of CNC controlled axes


101 No. of PMC controlled axes No. of PMC controlled axes
Axis,
’ lo Coordinate and Relative coordinate value : X axis Relative coordinate value : X axis
111 Relative coordinate value : Y axis Relative coordinate value : 2 axis
112 Positional Relative coordinate value : 2 axis Relative coordinate value : 3rd axis
113 Information Relative coordinate value : 4th axis Relative coordinate value : 4th axis
114 Relative coordinate value : 7th axis Relative coordinate value : 7th axis
115 Relative coordinate value : 8th axis Relative coordinate value : 8th axis
200 No. of No. of machined parts No. of machined parts
201 machined Run hour Run hour
202 parts, etc. Cycle time Cycle time
700 Diagnosis No. 700 Diagnosis No. 700
701 No. 701 No. 701
710 No. 710 No. 710
711 No. 711 No. 711
712 No. 712 ’ No. 712
720 No. 720 No. 720
721 No. 721 No. 721
722 No. 722 No. 722
723 No. 723 No. 723
724 No. 724 No. 724
725 No. 725 No. 725
760 No. 760 No. 760
761 No. 761 No. 761
762 No. 762 No. 762
763 Diagnosis No. 763 No. 763
764 Information No. 764 No. 764
765 No. 765 No. 765
770 No. 770 No. 770
771 No. 771 No. 771
772 No. 772 No. 772
773 No. 773 No. 773
774 No. 774 No. 774
775 No. 775 No. 775

800 Position error amount : X axis Position error amount : X axis


801 : Y axis : Z axis
802 : Z axis : 3rd axis
803 . 4th axis
l : 4th axis
804 : 5th axis : 5th axis
805 : 6th axis : 6th axis
6. FUNCTIONS OF THE MACRO EXECUTOR

Referenced System information and ID No. List (3/3)

Contents of Information
ID No. Information L
OM OT
9901 Alarm check flag Alarm check flag
9902 P/S alarm number P/S alarm number
9903 Overheat alarm Overheat alarm
9904 Overtravel Overtravel
9906 Saw0 alarm Saw0 alarm
9911 APC alarm check flag APC alarm check flag
9934 APC condition : 5th axis APC condition : 5th axis
9935 : 6th axis : 6th axis
9944 APC alarm : 5th axis APC alarm : 5th axis
9945 5th and 6 th : 6th axis : 6th axis
9954 Axes Control Spc alarm : 5th axis
: 5th axis SPC alarm
Information
9955 : 6th axis : 6th axis
9964 Servo alarm : 5th axis Servo alarm : 5th axis
9965 : 6th axis : 6th axis
9991 Machine coordinate : 5th axis Machine coordinate : 5th axis
9992 : 6th axis : 6th axis
9993 . Absolute coordinate : 5th axis Absolute coordinate : 5th axis
9994 : 6th axis : 6th axis
9995 Relative coordinate : 5th axis Relative coordinate : 5th axis
9996 : 6th axis : 6th axis

6.23.3 Detailed description of reference system information

Alarm information
Axis/coordinate position information
Miscellaneous information including the total number of machined parts
Diagnosis information
5th/6th axis information

(1) Alarm information

( a ) Alarm check flag ID No. 1


(b) Overheat alarms ID No. 3
( C 1 P/S alarms ID No. 2
w Overtravel alarms ID Nos. 4 to 5
0 Servo alarms ID Nos. 6, 60 to 65
V) External alarms ID Nos. 21 to 25
(9) Absolute pulse coder (APC) alarms IDNos. 11,30to35

First check the information of ID No. 1, then proceed to the processing of each alarm.

(a) Alarm check flag


The alarm check flag ID No. 1, is a one-word data representing a number from 0 to 255.

-91-
6. FUNCTIONS OF THE MACRO EXECUTOR

This flag indicates which alarm was issued.

Example: When bit 3 is 1 (on), 8 is output.


When bit 5 is 1 (on), 32 is output.
When bit 4 and bit 6 are 1 (on), 80 is output.

#7 #6 #5 #4 #3 #2 #l #o output
information
Bit (0001 h) 0 0 0 0 0 0 0 1 1
Bit (0002h) 0 0 0 0 0 0 1 0 2
Bit (0004h) 0 0 0 0 0 1 0 0 4
Bit (OOOSh) 0 0 0 0 1 0 0 0 8
Bit (001 Oh) 0 0 0 1 0 0 0 0 16
Bit (0020h) 0 0 1 0 0 0 0 0 32
Bit (0040h) 0 1 0 0 0 0 0 0 64
Bit (008Oh) 1 0 0 0 0 0 0 0 128

For the meaning of each bit, see the alarm check flag table.

Alarm Check Flag

ID No. Bit Information Meaning

Bit (0001 h) PS alarm No.1 00. Parameter is write enable.


Bit (0002h) P/S alarm No.000. Turn on the power again.
Bit (0004h) P/S aiarm No. 101. Power was turned off during programing
editing.
Clear the program.
1 Bit (OOOSh) P/S alarm
.
Bit (001 Oh) Over-travel alarm
Bit (0020h) Overheat alarm
I
Bit (0040h) Servo alarm
I
Bit (0080h) Memory alarm

(b) P/S alarm number


ID No. 2 contains the P/S alarm number.

Details of alarm information (P/S alarms)

ID No. Meaning
I
2 P/S alarm number

-92-
6. FUNCTIONS OF THE MACRO EXECUTOR

(c) Overheat alarms


A one-byte data, ID No. 5, representing a number from 0 to 255 indicates which overheat alarm
was issued.
Example: When bit 3 is 1 (on), 8 is output.
When bit 5 is 1 (on), 32 is output.
When bit 3 and bit 5 are 1 (on), 40 is output.

#7 #6 #5 #4 #3 #2 #l #O output
information
Bit (Olh) 0 0 0 0 0 0 0 1 1
Bit (02h) 0 0 0 0 0 0 1 0 2
Bit (04h) 0 0 0 0 0 1 0 0 4
Bit (08h) 0 0 0 0 1 0 0 0 8
Bit (10h) 0 0 0 1 0 0 0 0 16
Bit (20h) 0 0 1 0 0 0 0 0 32
Bit (40h) 0 1 0 0 0 0 0 0 64
Bit (80h) 1 0 0 0 0 0 0 0 128

For the meaning of each bit, see the overheat alarms table.

Overheat Alarm Table

ID No. Bit information Alarm No. Meaning

Bit (Olh)
Bit (02h)
Bit (04h)
Bit (08h)
3 Bit (10h) FAN MOTER
Bit (2dh) 700 Overheat of master PCB
Bit (40h)
L
Bit (80h) 704 Spindle overheat by spindle speed fluctuation
detection

-93-
6. FUNCTIONS OF THE MACRO EXECUTOR

(d) Overtravel
ID No. 4 and 5 indicate details of overtravel using one-byte bit information between 0 and 255.
Read each byte in the same way as for an overheat alarm, as described in (c), above.

Details of alarm information (overtravel alarms)

Meaning
ID No. Bit information
(Descriptions enclosed in parentheses apply to the OT.)

Bit (Olh) The X-axis stroke limit in the positive direction has been
I exceeded.
Bit (02h) 520 The Y(Z)-axis stroke limit in the positive direction has
been exceeded.
Bit (04h) 530 The Z(3)-axis stroke limit in the positive direction has
been exceeded.
Bit (08h) 540 The 4-axis stroke limit in the positive direction has been
exceeded.
Bit (IOh) 511 The X-axis stroke limit in the negative direction has
been exceeded.
Bit (20h) 521 The Y(Z)-axis stroke limit in the negative direction has
been exceeded.
Bit (40h) 531 The Z(3)-axis stroke limit in the negative direction has
been exceeded.
Bit (80h) The 4-axis stroke limit in the negative direction has been
exceeded.

Meaning
(Descriptions enclosed in parentheses apply to the OT.)

I Bit (Olh)
I
512 The X-axis stroke limit in the positive direction has been
I exceeded.
The Y(Z)-axis stroke limit in the positive direction has
Bit (02h) 522
I been exceeded.
Bit (04h) 532 The Z(3)-axis stroke limit in the positive direction has
been exceeded.
Bit (08h) 542 The 4-axis stroke limit in the positive direction has been
r I exceeded.
5
Bit (10h) 513 The X-axis stroke limit in the negative direction has
been exceeded.
Bit (20h) 523 The Y(Z)-axis stroke limit in the negative direction has
been exceeded.
Bit (40h) 533 The Z(3)-axis stroke limit in the negative direction has’
been exceeded.

I Bit (80h)
I
543 The 4-axis stroke limit in the negative direction has been
I exceeded.
6. FUNCTIONS OF THE MACRO EXECUTOR

Each ID is one-byte bit information. For details of one-byte bit information, see the description
of overheat alarms. The following tables list the meanings of all bits.

Details of alarm information (APC alarms)

IfDNo.] Brt -’information


-= --( Meaning
_ ~_~~
Bit (Olh) APC alarm flag
11
Bit (02h) APC transfer error flag

Details of alarm information (APC alarms)

FTYit informi Meaning


I I
)- 12-15
Bit (20h) 300 Perform manual reference position return.
, 30-35

Details of alarm information (APC alarms)

ID No. I Bit information I Alarm No. Meaning

I Bit (Olh) I xl1 APC communication error (data transfer error)

I Bit (02h) I 33 APC overtime error (data transfer error)

I Bit (04h) I 303 APC framing error (data transfer error)

I Bit (08h) I a4 APC parity error (data transfer error)


APC mispulse alarm (APC alarm)
The battery voltage for the APC has fallen to a level at
which data cannot be held. (APC alarm)
Bit (40h) The current voltage of the battery for the APC has fallen
to a level where the battery must be replaced. (APC
alarm)

I Bit (80h)
I
308 The battery voltage for the APC has fallen to a level
where the battery must be replaced. (APC alarm)

(9) External alarms


ID No. 21 indicates the type of the external alarm which has been turned on, using one-byte bit
information between 0 and 255. ID No. 22 to 25 indicate the alarm number. For details of one-
byte bit information, see the description of overheat alarms. The following table lists the
meanings of all bits.

-960
6. FUNCTIONS OF THE MACRO EXECUTOR

Details of alarm information (external alarms)

ID No. I Bit information I Meaning

I Bit (Olh) 1 External alarm 1

I Bit (02h) I External alarm 2


I- Bit (04h) I External alarm 3
Bit (08h)
21
Bit (IOh)
Bit (20h) I
I Bit (40h) I
I Bit (80h) 1

Details of alarm information (external alarms)

10 No. Meaning
22 Alarm number of external alarm 1
23 Alarm number of external alarm 2
24 Alarm number of external alarm 3
25 Alarm number of external afarm 4

(h) Custom macro alarm number


ID No. 29 indicates the custom macro alarm number.

Details of alarm information (custom macro alarms)

ID No. Meaning
I
29 I Custom macro alarm number I

i) Serial pulse coder alarms

Details of alarm information (AK alarms)

ID No. Bit information Alarm No. Meaning


I I I
Bit (Olh) 309 Serial pulse coder alarm
50-55 Bit (02h) 309 Serial puke coder communication error (data transfer
error)

-97-
6. FUNCTIONS OF THE MACRO EXECUTOR

(j) Details of axis and coordinate information

Details of axis and coordinate information

ID No. 1 Meaning

I 100 Number of CNC controlled axes


, 101 Number of PMC controlled axes

, 110 Relative coordinate value along the 1st axis


~ 111 Relative coordinate value along the 2nd axis
/ 112 Relative coordinate value along the 3rd axis
, 113 Relative coordinate value along the 4th axis
~ 114 Relative coordinate value along the 7th axis
’ 115 Relative coordinate value along the 8th axis

(k) Details of the total number of machined parts, etc.

Details of the total number of machined parts, etc.

Meaning

I 200
201
202
Total number of machined parts
Run hour
Cycle time

(Note) The optional run hour/parts display function is required.

-98-
6. FUNCTIONS OF THE MACRO EXECUTOR

(I) Details of diagnosis information

ID No. 700, 701, and 712 indicate one-byte bit information between 0 and 255.

Details of diagnosis information

ID No. Bit information / Meaning


I
I Bit (Olh) ~An M, S, or T function is being executed.
1A move command is being executed by automatic operation.
Dwell is being performed.
In-position check is being performed.
700 I-++
The cutting feed override is 0%.

I Bit (20h) Interlock is turned on.

I Bit (40h) The system is waiting for the spindle speed reached signal to be
turned on.

I Bit (80h)

I Bit (Olh) Data is being output via the reader/punch interface.

I Bit (02h) Data is being input via the reader/punch interface.

I Bit (04h) The system is waiting for the index table to be clamped/unclamped
before/after B-axis index table indexing.

701

Emergency stop, external reset, reset & rewind, or the reset key on
the MDi panel is turned on.

I Bit (40h) A search for an external program number is being performed.

I Bit (80h)

Details of diagnosis information

I ID No.
I System
information I
Meaning

I 710
I O-255 Upon the occurrence of a TH alarm, indicates the position of the
character at which the TH alarm occurred.

I 711
I O-255 Indicates the read code for the character at which the TH alarm
occurred.

-99-
6. FUNCTIONS OF THE MACRO EXECUTOR

For diagnosis information ID No. 720 to 775, the unit digit of each number corresponds to an
axis number.

Details of diagnosis information

ID No. Bit information Meaning

Bit (0th) Emergency stop has been turned on or a servo alarm has occurred.
Bit (02h)
Bit (04h)
Bit (08h) The reset key has been turned on.
Bit (10h) Reset & rewind has been turned on.
_
Bit (20h) External reset, emergency stop, reset & rewind, or the reset key on
the MDI panel has been turned on.
712
Bit (40h) The system is waiting for the spindle speed reached signal to be
turned on.
Bit (80h) This flag causes pulse distribution to stop in the following cases:
(1) External reset has been turned on.
(2) Reset & rewind has been turned on.
(3) Emergency stop has been turned on.
(4) Feed hold has been turned on.
(5) The reset key on the MD1 panel has been turned on.
(6) Manual mode has been selected.
(7) An alarm other than the above has occurred.

Details of diagnosis information

ID No. Bit information I Meaning

Bit (Olh) An overflow alarm has been detected.


Bit (02h) A disconnection alarm has been detected.
Bit (04h) 1 A regenerative discharge circuit alarm has been detected.
720 Bit (08h) 1 An overvoltage alarm has been detected.
rcI
725 Bit (10h) I An abnormal current alarm has been detected.
Bit (20h) 1 An overcurrent alarm has been detected.
Bit (40h) A low voltage alarm has been detected.
Bit (80h) An overload alarm has been detected.

-1 oo-
6. FUNCTIONS OF THE MACRO EXECUTOR

Details of diagnosis information


t
ID No. Bit information Meaning

Bit (Olh) A software phase data error alarm has been detected.
Bit (02h) A clock alarm has been detected.
I
Bit (04h) A zero battery alarm has been detected.
760 Bit (08h) A rotation speed count error alarm has been detected.

765 Bit (10h) A phase data error alarm has been detected.
Bit (20h) A low battery atarm has been detected.
Bit (40h) _~ A check sum alarm has been detected.
I
Bit (80h) A serial pulse coder is connected.

Details of diagnosis information

ID No. I Bit information I Meaning

I Bit (Olh) I-
I Bit (02h) 1
Bit (04h)
Bit (08h)

775 I Bit (10h) I


I Bit (20h) I A stop bit error has occurred.
i Bit (40h) --r A CRC error has occurred.

I Bit (80h) I A data error has occurred.


Details of diagnosis information

ID No. Meaning

800 Position error along 1st axis


801 Position error along 2nd axis
802 Position error along 3rd axis
803 Position error along 4th axis
804 Position error along 5th axis
805 Position error along 6th axis

(m) 5thI6th axis control information


ID No. 9900 to 9996 contain 5thI6th axis control (multiaxis) information.

z :
3 c

-lOl-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.24 Internal Code


0020 0021 0022 0023 0024 ooc4 ooc5 OOC6 ooc7 OOCB
! m # $ b 3- = 3 *
0025 0026 0027 0028 0029 ooc9 OOCA OOCB oocc OOCD
% & t ( ) J I\ ti 7 6

002A 002B ooze OOZD OOZE OOCE OOCF OODO OODl OODZ
+ + 9 m . rf; 7 Nz Is f
OOZF 0030 0031 0032 0033 OOD3 OOD4 OOD5 OOD6 OOD7
/ 0 1 2 3 * v J 3 3

0034 0035 0036 0037 0038 OODB OOD9 OODA OODB OODC
4 5 6 7 8 'I II, t 13 T7
0039 003A 003B 003c 003D OODD OODE OODF 2137 2421
9 .. C =
.
; 2 . 4 15
003E 003F 0040 0041 0042 2422 2423 2424 2425 2426
> ? e A B 2bj c\ b' 3 3
0043 0044 0045 0046 0047 2427 2428. 2429 242A 242B
C D E F G It ji ss fj 79%
0048 0049 004A 004B 004c 242C 242D 2423 242F 2430
H I J K L d' s F < c
004D 004E 004F 0050 0051 2431 2432 2433 2434 2435
M N 0 P Q 1s v t &,- 3
0052 0053 0054 0055 0056 2436 2437 2438 2439 243A
R S T U V 5 L c -f T
0057 0058 0059 005A 005B 243B 243C 243D 243E 243F
W X Y z I * e -? ? k
005c 005D 005E 005F OOAO 2440 2441 2442 2443 2444
4 1 A - - t: r; s;z 3 7

OOAl OOAZ OOA3 OOA4 OOA5 2445 2446 2447 2448 2449
0 r J - . 3 7 T L t-
OOA6 OOA7 OOAB OOA9 OOAA 244A 2448 244C 244D 2443
7 7 4 9 1. tr tt h ta a)
OOAB OOAC OOAD OOAE OOAF 244F 2450 2451 2452 2453
f t a 3 Y I;t rf lb 0 v
OOBO OOBl OOBZ OOB3 OOB4 2454 2455 2456 2457 2458
Y 4 It r v & s s -
OOB5 OOB6 OOB7 OOBB OOB9 2459 245A 245B 245C 245D
d- ?l * 3 9 ^; 4 ci cr 1%
OOBA OOBB OOBC OOBD OOBE 2453 245F 2460 2461 2462<
f7 sf -> x + zt t& t br3 G -
OOBF ooco OOCl ooc2 ooc3 2463 2464 2465 2466 2467
'1 9 3- y F 9 + 9 N 8

-102-
6. FUNCTIONS OF THE MACRO EXECUTOR

2468 2469 246A 2468 246C 323E 323F 3241 3243 3244
L /j 0 a tt f/z f?J efi m iiT

246D 246E 246F 2472 2473 3248 324A 324C 3254 3255
3 b ;h e XI at Tt* #k -f% fa

2641 2642 2F40 2F41 2F42 3259 325D 3261 3268 3271

u B f t i;;i II% ’
a ii!ii e

2F43 2F44 2F45 2F46 2F47 3272 3273 327E 3323 3326

\ r( 1 L M q at hk *

2F48 2F49 2F4A 2F4B 2F4C 3328 3328 332C 3330 3335

(3 I) - 0 m & A I?# fi lrgt

2F50 2F51 2F52 2F53 2F60 333A 3346 3348 334A 334B
V w w v w w a a at ts t.%
2F61 2F62 2F63 2F64 2F65 334E 3351 3354 3356 3358

Fe * fb MI *
2F66 2F67 2F68 2F69 2F6A 3358 335D 3364 3368 342C
a #!I# a i% e
2F6B 2F6C 2F6D 2F6E 2F6F 3430 3439 3441 3446 3449

% #t iR g- w
2F70 2F71 2F72 2F73 2F74 344A 3451 3453 3466 3458

I!!5 1EB n lrd Ia


2F75 2F76 2F77 2F78 2F79 345D 345E 346A 346F 3470
A. * l#i # zi
2F7A 2F7B 3471 3473 3474 347B 347c

s * ti e& RI!

302E 3035 3037 3042 3045 3521 3522 3524 352C 352D

a! & @k a; a# ta dfI % % iz
304A 304c 304F 3055 305B 352F 3530 353B 353F 3541
1% @ Ia I!! Je %s #L a R a

305c 3063 3068 306C 3075 3551 3552 3555 3559 355E
.
fs j& fB - EfJ @ 1$ & w ifb
l

307A 3122 3123 3126 313F 3561 3565 3566 3569 356B

31 I% I?. . * z * 3E3t R #k I@

3146 3154 315B 315F 3168 356C 356E 3576 3577 3621
#j acd a!! PI iB 18 * 8+ Jr! #
316F 3173 317A 317B 317c 3626 362D 362F 3635 3648
#% a IY 9\ a # ?IE !a 4ik #.

317D 317E 3221 3223 322B 364A 3651 3652 3658 365Az
a Kc # # ?@ I e m # fi?i -

322F 3230 3239 323C 323D 3661 3662 3668 366B 366E
fs R! ia T 4t: i!f & _ Izc . s , @

-103-
6. FUNCTIONS OF THE MACRO EXECUTOR

3671 3675 3676 3679 3721 3B45 3B48 3B4D 3B4F 3B51

R zz & bA #If ff: te es #e 3*

372B 3732 3738 3739 373F 3B52 3B57 3B58 3B5F 3B65

)f bi s’ f!a t!z! T *vi tia k +’


3741 3742 374F 3750 3751 3B67 3B69 3B6B 3B6E 3B71

fs %! s. e )Br % m *WI R s
3757 375A 3765 3767 3768 3B75 3B76 3B77 3B7D 3B7E

lit es #f7 A 8? Ia s !a )4 w

376A 3768 376F 3821 3822 3C21 3623 3628 3C2A 3C2B

R #it f$ Hk # Yc ti % T B

3826 382A 382B 3833 3835 3c30 3c34 3C3A 3c3c 3C4I

m M RJ # z s @II !k s z

3836 3839 383A 3838 383D 3C42 3c4c 3C4D 3c50 3c54
M s& * is 42 % w # #t *
3840 3842 3844 3846 3847 3C56 3C5A 3C61 3C65 3667

I3 I!!! m . •B s
e % fit R bil
384A 384C 385F 3865 3866 3C68 3C69 3C6A 3C6C 3C6F

2, a E t4t fiD mt 9 + * a
386C 386D 3863 3872 387A 3c75 3c77 3c79 3C7D 3C7E

a# I!!! ar 2 Rh 8 * #t a RiJ

387C 387D 387E 3926 3929 3024 3D2A 3D38 3D3D 3D3E

Q a m 71 I t5 P. % + fit

392A 3921) 3933 3935 3939 3D44 3D45 3D50 3D51 3D52

rg 6; tz is! ‘iFf t&f I!& ai +tv i!Ii

393B 393D 3942 3945 3953 3D60 3D63 3D67 3D68 3D69
et # t# isi R * Hi M & #I

3954 395D 395F 3960 3962 3D6A 3D71 3D75 3D78 3D7C

fi fw #f& ?a i@i ai e m elf: I!&


3966 3967 396F 3970 3975 3E21 3E26 3E2E 3E2F 3E30

9 fit N * !?i Is Ia /1\ 9 iBs


397E 3A2C 3A2E 3A38 3A39 3E3A 3343 3E44 3E48 3E4A
a +Jt s R
ai s ?t #I i!b K iii
3A3F 3A42 3A46 3A47 3A4E 3E4E 3E4F 3E5A 3E5C 3E5D

sff s ?!f i!k #% ffr * tiE re *a


3A51 3A59 3A5F 3A60 3A62 3E65 3E6A 3E6C 3E6F 3E72
.
7s #I d w H k 99 # #t &
3A6E 3A6F 3A76 3B28 3B32 3E75 3E7E 3F22 3F27 3F28 5

e til 31e # e JI% @ I@ es R!h -


3B33 3B36 3B3A 3B3B 3B44 3F29 3F2D 3F2E 3F2F 3F34
L
111 I& #if # at 3k f$ fs M &
6. FUNCTIONS OF THE MACRO EXECUTOR

3F36 3F37 3F3B 3F3c 3F3F 434D 434E 434F 4356 4357
a #i *
l t% PF fiik 9En a!! t zk

3F47 3F48 3F4A 3F4D 3F4F 4359 4365 4366 436C 436D

# !# &. A 31 a * rp e &

3F5E 3F62 3F64 3F65 3F6D 4372 437A 4425 4427 4434

Ia ai ak * ai # T a @Sk c19

3F74 3F78 4023 4029 402D 4436 4439 443A 443B 443E

R t@I d- tklJ i!k iz! E n db


l is
402E 4030 4035 4038 403A 4449 444c 4463 4464 446A

a sit iE kk m la . Ia . f&i # e
I

403D 4044 404A 4050 4051 446C 4478 4479 4478 452A
I

& * Jft ;6 fff & a! tiff ET m


I

4053 4056 405A 405c 405E 452C 4534 453A 453E 4540
I

#R * a )gi )Fi a fR Is . . ez l f!? . . .


I

405F 4061 4062 4064 4068 4541 4545 4550 4553 4559
.
&k m m #a se iz x s & Is
I

4069 406C 4075 407B 407E 456A 4576 4579 4628 4626
.
+ * a & s St &i * a BJI
412A 4130 4133 4134 4146 4630 4631 4633 463B 4640
I

iir m )h
.... St t!R #I m 8 i# ?#

4147 414F 4150 415B 415c 4643 4648 4649 464C 464D

* @J z el
l&* I!!! e @ 1% r!Il %
.

415E 4160 4161 416A 4160 465F 4662 4679 467C 467E

m t# 9 tiii ae @ii PI m E3 A
.

4175 4176 4177 417D 4226 4724 4727 472E 472F 473B
.

z 2 is e iRl fz a #k * t#

4227 4228 422C 422D 422E 473c 473D 474B 474F 4753
RI WJ M a i!k M #z f& s #
3

4230 4233 4238 423B 423E 4754 4755 4758 475B 475c

R a! Iv #R a Wk e w az te
423F 4240 4247 424E 4250 4772 4776 4822 482F 4834
.

* k IT # 34 B I!! @ s tk
4254 4256 4258 4260 4265 4836 483D 483E 483F 4842
I+ 5 . .
,‘b 8 d! ft # I?J * E a?
.

4266 4267 4268 426A 4263 4844 4846 484C 484F 4856
l9 A 3R WT * #i iR at ati #
4272 4323 432B 4331 4335 4866 4869 486F 4873 487%
R is 8 * #z ft: Ai vi # ml
433A 433B 433c 4347 434A 4879 487E 492c 4934 4938
.

2 #z a I% R s!b $5 . & . I?i * #.

-1 OS-
6. FUNCTIONS OF THE MACRO EXECUTOR

493D 4941 4943 494A 4954 4E61 4E63 4E64 4E69 4373
J?e ei f!tb ii ?r; + m e *1 91
4955 495B 4961 4969 4974 4374 4E7D 4F22 4F29 4F3F
ti e * 9. IRS s i#r is I% i%
497A 497B 497c 497D 4A23 4F40 IF42 IF43 4F44 4F48
R NJ fR M a ah al II
% E I#4
4A2A 4A2C 4A34 4A38 4A39

% 53 Ia * w
4A3B 4A3F 4A42 4A44 4A47

f# T I& IY!l F4
4A4C 4A51 4A52 4A54 4A55
511 Tic rt #ii z
4A56 41959 4A5B 4A5D 4A62
iIt &h SF f% 26
4A64 4A6F 4A71 4A73 4A7C
I@ #it a t% I&
4A7D 4821 4B3A 4B40 4B5C
z iik ,I?l t& *
4860 4B67 4B68 4B76 4B7C
@ ac s * 7j:

4C24 4c29 4635 4C3E 4C3F

* l * 8 #!e % te
4c40 4c47 4c4c 4c57 4C5A

!Y iHi Kl R *
4c5c 4C61 4C64 4C67 4c73
R R H r9 $9
4675 4C7D 4D2D 4D33 4D3D

‘di *hIi * Eh T
4D3E 4D3F 4D46 4D49 4D4D

&. 9 Is a t#
4D4F 4D51 ID57 4D5E 4D6D

i8 m E RJ #a
4D6E 4D70 4D77 4D78 4D7D
Ri a R *u a
4E22 4E25 4E28 4E29 4E2C
s s * 2 a
4E3B 4E3E 4E41 4E49 4E4C =I
_

7 i@ !f+ & *
4E4E 4E4F 4E50 4E58 4E60
%I a ta ak m

-106-
6. FUNCTIONS OF THE MACRO EXECUTOR

6.25 Internal Code (Hangwr)

.. ..A
7. FUNCTIONS FOR STOPPING A CONVERSATIONAL MACRO

7. FUNCTIONS FOR STOPPING A CONVERSATIONAL MACRO


The macro executor can stop the execution of a conversational macro program at a particular
program and sequence specified by parameters.

Parameters of the macro executor


1) No. 9000, bit 2 (TSTP)
TSTP=l : The execution of the conversational macro program is stopped.
0 : The conversational macro program is executed.
2) No. 9002 : Number of the program at which execution of the conversational macro program is
stopped
3) No. 9003 : Number of the sequence at which execution of the conversational macro program
is stopped

Specify the numbers of the program and sequence at which the conversational macro program is
to be stopped and execute the conversational macro program on the CUSTOM screen. When an
attempt is made to execute the block corresponding to the specified program and sequence, TSTP
is automatically turned on. The execution of the conversational macro is stopped. If parameter No.
9002 is set to 0, this function is invalidated. In usual operation, it must be set to 0.

When this function is used, compilation parameter SEQ must be set to 1 to output sequence
numbers to the P-CODE program.

-108-
APPENDIX 1 MACRO PROGRAM EXAMPLE

APPENDIX 1 MACRO PROGRAM EXAMPLE


1. EXAMPLE-l : CIRCULAR CUTTING INPUT AND EXECUTION
X - axis

CIRCURAR CUTTING I 000 10 NO790 I

I (RADIUS) =
F (FEED) =
D (OFS NUM) =

Y = axis

I NUM

NOT READY BUF AUTO I

RADIUS FEED OFS NO EXEC END

Circular Cutting Display Layout:


The cursor is moved, using the cursor key ” f “, or soft keies “RADIUS”, “FEED” or “OFSNUM”.
Key in data from MDI at the cursor position and press “INPUT” to write data. Or after keying has
been in data, press the soft key for direct input.
After all data has been input, press the soft key “EXEC”: the axis will move.
By pushing the soft key “END”, the display returns to the menu screen.

1.1 Source Program for Main Program


00010 09999 r'
00020 NO01 (00001 -- MAIN PROG -MENU- ) t
00030 NO02 (00010 -- KEY TEST ) t
00040 NO03 (00011 -- SUB SOFT KEY DISP ) ;
00050 NO04 (00020 -- CURSOR TEST ) t
00060 NO05 (00030 -- DISPLAY TEST ) t
00070 NO06 (00031 -- SUB TIMER ) r'
00080 NO07 (00032 -- SUB BLINK TEST ) t
00090 NO08 (00033 -- SUB STRING DATA ) ;
00100 NO09 (00040 -- ADDRESS VARIABLE TEST ) :
00110 NO10 (00041 -- SUB DATA TABLE ) :
00120 NO11 (00050 -- CIRCLE TEST ) t
00130 NO12 (00051 -- SUB DATA DISP ) r'
00140 NO13 (00052 -- SUB STRING DISP ) ;
00150 NO14 (00053 -- SUB GRAPHIC DISP ) r'
00160 NO15 (00054 -- SUB PMC WINDOW ) t
00170 NO16 (09010 -- EXEC MACRO PROGRAM -GlOO- ) ;
00180 ;
00190 NlOl (V140 --- PROGRAM NUMBER ) ;
00200 N102 (V141 --- TIMER ) r'

Al-l
APPENDIX 1 MACRO PROGRAM EXAMPLE

00210 N103 (V142 --- KEY CONTROL DATA -V8501- ) r'


00220 NlO4 (V143 --- STRINGS DATA OFFSET ) t
00230 N105 (V144 --- KEY INPUT DATA -V8503- ) ;
00240 N105 (V145 --- ADDRESS INPUT DATA -V8504- ) ;
00250 N107 (V146 --- CURSOR X POINTER ) r'
00260 N108 (V147 --- CURSOR Y POINTER ) r'
00270 N109 (V148 --- ) t
00280 NllO (V149 --- ) ;
00290 t
00300 :
00310 t
00320 r’
00330 t
00340 ;

-
00010 00001 ;
00020 NO00 6202 P3 ;
00030 #8505--O ;
00040 G243 X0 YO Al BO (SAMPLE PROGRAM) I'
00050 x2 Y3 (1 -- KEY TEST) ;
00060 x2 Y5 (2 -- CURSOR TEST) ;
00070 x2 Y7 (3 -- DISPLAY TEST) ;
00080 x2 Y9 (4 -- ADDRESS VARIABLE) ;
00090 x2 Yll (5 -- CIRCLE) r'
00100 #8509=0033 ;
00110 #143=300 ;
00120 M98 PO011 r'
00130 NO01 #142=#8501 ;
00140 IF [#142 EQ 0] GOT0 99 ;
00150 IF [#142 LT 121 GOT0 99 ;
00160 IF (1142 GT 161 GOT0 99 ;
00170 #8500=[#142-111 "10 ;
00180 M99
00190 NO99 M99 Pl ;
00200 ;
00210
00220
00230 ;
00240 :

Al-2
APPENDIX 1 MACRO PROGRAM EXAMPLE

1.2 Source Program for Input Control


00010 00010 ;
00020 G202 P3 ;
00030 G243 X0 Y2 Al BO (KEY TEST -- HIT ANY KEY -0) ;
00040 #143=100 r'
00050 M98 PO011 I'
00060 NO01 #8502=2 ;
00070 #142=#8501 ;
00080 IF I#142 EQ 0] GOT0 99 ;
00090 #101=#142 ;
00100 #102=#8503 ;
00110 #103=#8504 ;
00120 G243 X0 Y4 Al BO (CONTROL ) F8.3 20 D#lOl ;
00130 C243 X0 YS Al BO (ADDRESS ) F8.3 20 D#103 ;
00140 G243 X0 Y6 Al BO (DATA ) F8.3 20 D#lO2 r'
00150 NO99 IF [I142 NE 161 GOT0 97 ;
00160 NO98 #8500--l ;
00170 M99 ;
00180 NO97 M99 Pl ;
00190 I'
00200 :
00210 ;
00220 :
00230 :

00010 00011 ;
00020 #lOO=O ;
00030 WHILE [#lo0 LT 51 DO 1 I'
00040 G243 X[#lOO*8+1] Y16 Al BO P[#143+#100] I'
00050 #100=#100+1 ;
00060 END 1 ;
00070 M99;
00080 ;
00090 ;
00100 r'
00110 ;
00120 ;

1.3 Soruce Program for Cursor Control

00010 00020 ;
00020 6202 P3 ;
00030 #8505=0 r'
00040 #8502=0 ;

Al-3
00050 NO08 C243 X0 Yl (CURSOR TEST -- MOVE CURSOR -0) ;
00060 6243 X0 93 (A) ;
00070 6243 X0 Y4 (B) ;
00080 G243 X0 Y5 (C) ;
00090 G243 X0 Y6 (D) ;
00100 6243 X0 Y7 (E) ;
00110 6243 X0 Y8 (F) ;
00120 #143=100 ;
00130 M98 PO011 I'
00140 #lOO=O ;
00150 18506~2 ;
00160 NO01 #142=#8501 r'
00170 IF [#142 EQ 0] GOT0 3 ;
00180 IF [#142 NE 31 GOT0 2 r'
00190 #100=#100+1 ;
00200 NO02 IF [/142 NE 41 GOT0 3 ;
00210 #100=#100-1 ;
00220 NO03 #100=#100+6 r'
00230 #lOO=#lOO-[FIx[#100/6]]*6 ;
00240 #8507=#100+3 ;
00250 #8505--l ;
00260 NO99 IF [#142 NE 161 GOT0 97 r'
00270 NO98 #8500=1 ;
00280 M99 ;
00290 NO97 M99 Pl ;
00300 :
00310 :
00320 t
00330 r’
00340 ;

1.4 Source Program for Character Display


00010 00030 ;
00020 6202 P3 ;
00030 #8502=0 ;
00040 #8505=0 r'
00050 #143=100 ;
00060 M98 PO011 ;
00070 NO01 6243 X0 Y2 Al BO K200 ;
00080 X0 Y2 (DISPLAY TEST) I'
00090 G243 X0 Y4 Al BO K200 ;
00100 #141=100 ;
00110 M98 PO031 ;
00120 X0 Y4 (FANUC 0 SERIES MACRO COMPILER) ;
00130 #141=300 ;
00140 M98 PO031 r'

Al-4
OOlSO G243 X0 Y4 Al BO K200 ;
00160 #141=100 ;
00170 M98 PO031 ;
00180 G243 X0 Y4 Al BO K200 r'
00190 X0 Y4 (*3441 2438 4932) 3C28 OOC3 OOBD OOC4*) ;
00200 #141=300 ;
00210 M98 PO031 ;
00220 6243 X0 Y4 Al BO K200 r'
00230 #141=100 r'
00240 M98 PO031 ;
00250 G243 X0 Y4 Al BO K200 ;
00260 X0 Y4 (INT. CODE ) (*2F40 2F48 2F79 2F53*) ;
00270 #141=300 ;
00280 M98 PO031 ;
00290 G243 X0 Y4 Al BO K200 ;
00300 #141=100 ;
00310 M98 PO031 ;
00320 X0 Y4 A3 BO (3 MULTI) r'
00330 #141=300 ;
00340 M98 PO031 r'
00350 G243 X0 Y4 Al BO K200 ;
00360 #141=100 ;
00370 M98 PO031 ;
00380 M98 PO032 I'
00390 #141=100 ;
00400 M98 PO031 ;
00410 G243 X0 Y4 Al BO K200 r'
00420 X0 Y4 (DATA DISPLAY TEST 1234.567) ;
00430 #100=1234.567 ;
00440 G243 X0 Y6 F8.3 20 K200 ;
00450 X0 Y6 (F8.3 ) DflOO ;
00460 #141=300 ;
00470 M98 PO031 I'
00480 G243 X0 Y6 F8.3 21 K200 ;
00490 #141=100 ;
00500 M98 PO031 ;
00510 X0 Y6 (F8.3 ) D#lOO ( LEADING ZERO NEG.) r'
00520 #141=300 ;
00530 M98 PO031 ;
00540 6243 X0 Y6 F5.2 K200 ;
00550 #141=100 ;
00560 M98 PO031 ;
. 00570 X0 Y6 (F5.2 ) D#lOO ;
00580 #141=300 ;
00590 M98 PO031 ;
00600 #8509=0033 ;

Al-5
APPENDIX 1 MACRO PROGRAM EXAMPLE

00610 6243 X0 Y4 Al 80 K200 ;


00620 #141=100 ;
00630 M98 PO031 ;
00640 X0 Y4 (STRINGS DISPLAY TEST) r’
00650 G243 X0 Y6 K200 ;
00660 X0 Y6 PlO ;
00670 #141=300 ;
00680 M98 PO031 ;
00690 6243 X0 Y6 K200 ;
00700 #141=100 I'
00710 M98 PO031 ;
00720 X0 Y6 P20 ;
00730 #141=300 ;
00740 M98 PO031 ;
00750 #i42=#8501 ;
00760 NO99 IF [#142 NE 161 GOT0 97 ;
00770 NOi #8500=1 ;
00780 M99 ;
00790 M99 Pl ;
00800
00810 :
00820 :
00830 t
00840 :

00010 00031 ;
00020 NO01 SF [#la1 LT 0] GOT0 99 I’
00030 #141=g141-1 ;
00040 GOT0 1 ;
00050 NO99 #142=#8501 ;
00060 IF [#142 EQ 161 GOT0 97 ;
00070 M99 r'
00080 NO97 M99 P98 ;
00090 ;
00100 r'
00110 r’
00120 ;
00130 ;

00010 00032 ;
00020 G243 X0 Y4 Al BO (BLINK TEST) r’
00030 #100=200 ;

Al-6
APPENDIX 1 MACRO PROGRAM EXAMPLE

00040 WHILE [#lo0 GT O] DO 1 ;


00050 #100=#100-1 ;
00060 NO01 G243 X0 Y6 Al 81 (BLINK SLOW) ;
00070 END 1 ;
00080 6243 X0 Y6 Al BO K20 ;
00090 #141=100 ;
00100 M98 PO031 ;
00110 #100=200 ;
00120 WHILE [#lOO GT O] DO 2 ;
00130 #100=~100-1 ;
00140 NO02 G243 X0 Y6 Al B2 (BLINK FAST) ;
00150 END 2 r'
00160 6243 X0 Y4 Al 80 K200 ;
00170 M99 ;
00180 ;
00190 ;
00200 r'
00210 r'
00220 ;

00010 00033 r'


00020 NO10 (ABCDEFGHIJKLMNOPQRSTUVWXYZO123456789) ;
00030 NO20 (FANUC TECHNICAL TRAINING CENTER) ;
00040 NlOO ( ) t
00050 NlOl ( ) I'
00060 N102 ( ) t
00070 N103 ( ) :
00080 N104 ( END ) ;
00090 N200 (RADIUS) ;
00100 N201 ( FEED ) I'
00110 N202 (OFS NO) r'
00120 N203 ( EXEC ) r'
00130 N204 ( END ) ;
00140 N300 (TEST-l) r'
00150 N301 (TEST-2) r'
00160 N302 (TEST-3) r'
00170 N303 (TEST-4) ;
00180 N304 (TEST-S) ;
00190 N500 (INPOSITION WIDTH ) ;
00200 N504 (SERVO ERROR LIMIT ) r'
00210 N508 (GRID SHIFT VALUE ) ;
00220 N512 (LOOP GAIN MULTIPLY ) r'
00230 M99 r'
00240 ;

Al-7
APPENDIX 1 MACRO PROGRAM EXAMPLE

00250 r’
00260 r’
00270 ;
00280 ;

1.5 Source Program for Address Variables


00010 00040 ;
00020 6202 P3 ;
00030 #143=100 ;
00040 M98 PO011 ;
00050 NO08 G243 X0 Y2 Al BO KS20 I'
00060 G243 X0 Y2 Al BO (ADDRESS VARIABLE TEST) ;
00070 #141 =lOO f
00080 M98 PO031 ;
00090 X0 Y4 (ADDRESS G READ TEST) ;
00100 NO01 #lOl=G121.4 ;
00110 IF [#lo1 EQ 0] GOT0 2 ;
00120 X0 Y6 21 F1.0 (ESP STATUS -- ) D#lOl ( PUSH ESP) r'
00130 /142=#8501 r'
00140 IF [j/l42 EQ 161 GOT0 98 ;
00150 M99 Pl r'
00160 NO02 X0 Y6 21 F1.0 (ESP STATUS -- ) D#lOl ( RESET ESP) ;
00170 $141=100 ;
00180 M98 PO031 ;
00190 x0 Y4 K200 ;
00200 #141=100 ;
00210 M98 PO031 ;
00220 X0 Y4 (ADDRESS D WRITE TEST) ;
00230 M98 PO041 ;
00240 6243 X0 Y4 Al BO K200 ;
00250 #141=100 ;
00260 M98 PO031 ;
00270 G243 X0 Y4 (PARAMETER READ) r'
00280 #102=0 ;
00290 #8509=0033 ;
00300 WHILE [#lo2 LE 31 DO 1 ;
00310 #103=P[f102*4+500] ;
00320 G243 X0 Y[#102+6] (NUM ) 21 F3.0 D[#102*4+500] ;
00330 ( -- ) D#103 ;
00340 6243 ( ) P[#102*4+500] ;
00350 #102=#102+1 ;
00360 END 1 ;
00370 #141=500 ;
00380 M98 PO031 ;
00390 #142=#8501 ;
00400 NO99 IF [#142 NE 161 GOT0 97 ;

Al-8
APPENDIX 1 MACRO PROGRAM EXAMPLE

00410 NO98 #8500=1 r'


00420 M99 ;
00430 NO97 M99 P8 ;
00440 ;
00450 r'
00460 r'
00470 ;
00480 r'

00010 00041 ;
00020 #lOO=O I'
00030 WHITE [#lo0 LT 51 DO 1 r'
00040 G310 D699 Q#lOO ;
00050 $141=10 ;
00060 M98 PO031 r'
00070 #100=#100+1 ;
00080 END 1 ;
00090 #lOO=D699 ;
00100 G243 X0 Y6 (DATA TABLE -- ) F3.0 D#lOO ;
00110 #141=300 ;
00120 M98 PO031 I'
00130 M99 ;
00140 t
00150 :
00160 r'
00170 r'
00180 t

1.6 Source Program for Graphic Display

00010 00050 ;
00020 G202 P3 ;
00030 #8506=13 ;
00040 #8507=2 r'
00050 #8505=1 ;
00060 #147=0 ;
00070 G202 P3 ;
00080 M98 PO052 ;
00090 M98 PO053 ;
00100 M98 PO051 ;
00110 NO01 #8502=1 ;
00120 #142=)18501 ;
00130 #144=#8503 ;
00140 IF [#142 EQ 0] GOT0 99 ;
00150 IF [#142 NE 121 GOT0 3 I’

Al-9
APPENDIX 1 MACRO PROGRAM EXAMPLE

00160 #147=0 ;
00170 COT0 9 r'
00180 NO03 IF [#142 NE 131 GOT0 4 ;
00190 #147=1 ;
00200 GOT0 9 r'
00210 NO04 IF [#142 NE 141 COT0 5 r'
00220 #147=2 ;
00230 GOT0 9 I'
00240 NO05 IF [#142 NE 41 GOT0 6 ;
00250 #147=/147-l ; -
00260 GOT0 9 r'
00270 NO06 IF [#142 NE 31 GOT0 7 ;
00280 #147=#147+1 ;
00290 GOT0 9 ;
00300 NO07 IF [#142 NE 151 GOT0 8 ;
00310 #140=1 ;
00320 M98 PO054 ;
00330 GOT0 10 r'
00340 NO08 IF [#142 NE 81 GOT0 10 r'
00350 NO09 #147=/147+3 I'
00360 #147=X147-FIX[#l47/3]" 3 r'
00370 IF [#144 EQ #O] GOT0 10 ;
00380 #[500+#147]=#144 I'
00390 G243 Xl4 Y[#147+2] 21 F4.0 D#[#147+500] ;
00400 NO10 M98 PO051 ;
00410 NO99 IF [#142 NE 161 GOT0 97 ;
00420 NO98 $8500=1 I'
00430 M99 ;
00440 NO97 M99 Pl ;
00450 ;
00460 ;
00470 ;
00480 ;
00490 ;

00010 00051 r'


00020 #8507=#147+2 ;
00030 #lOO=O r'
00040 WHILE [#loo LT 31 DO 1 ;
00050 G243 X14 Y[#100+2] 21 F4.0 D#[500+#100] r'
00060 #100=~100+1 ;
00070 END 1 ;
00080 M99 ;
00090 r'

Al-10
APPENDIX 1 MACRO PROGRAM EXAMPLE

00100 ;
00110 f
00120 ;
00130 ;

00010 00052 I'


00020 6243 X0 YO Al BO (CIRCULAR CUTTING) r'
00030 Xl Y2 (I) ;
00040 C40 (PADIUS) C41 C61 ;
00050 Xl Y3 (F) ;
00060 C40 ( FEED ) C41 C61 ;
00070 Xl Y4 (D) ;
00080 C40 (OFS NO) C41 C61 ;
00090 #143=200 r'
00100 M98 PO011 r'
00110 M99 ;
00120 ;
00130 ;
00140 ;
00150 ;
00160 ;

00010 00053 ;
00020 6244 PO ;
00030 G242 X80 Y20 ;
00040 GO1 Xl10 Y50 ;
00050 GO2 Xl40 Y20 1110 520 QO ;
00060 GO2 X140 Y20 I80 520 44 ;
00070 GO2 Xl10 Y-10 1110 520 QO r'
00080 GO1 x80 Y20 ;
00090 G244 P2 ;
00100 G242 X80 Y20 ;
00110 GO1 Y-70 ;
00120 G242 X20 Y20 ;
00130 GO1 Y-70 ;
00140 G244 Pl ;
00150 G242 X80 Y-65 r'
00160 GO1 X20 r'
00170 G243 X25 Y12 Al BO (I) ;
00180 M99 ;
00190
00200

Al-l 1
APPENDIX 1 MACRO PROGRAM EXAMPLE

00210 ;
00220 ;
00230 ;

00010 00054 ;
00020 G310 D699 Q[#140+16] ;
00030 #141=5 ;
00040 M98 PO031 ;
00050 G310 D699 Q[f140+48] ;
00060 x141=5 r'
00070 x98 PO031 r'
00080 6310 D699 Q[#140+16] ;
00090 #141=5 ;
00100 M98 PO031 r'
00110 G310 D699 QO r'
00120 M99 ;
00130 t
00140 t
00150 t
00160 ;
00170 r’

1.7 Execution Macro


00010 09010 ;
00020 G40 (349 G80 ;
00030 #1=#500/2 ;
00040 G91 G42 GO1 X#l Y#l I)#502 F#501 ;
00050 GO2 X#l Y-#1 3-#l ;
00060 I-#500 ;
00070 X-$1 Y-#I I-#1 ;
00080 (340 GO1 X-#l Yfl ;
00090 M99 I'
00100 ;
00110 ;
00120 r’
00130 :
00140 r’

Al-12
APPENDIX 1 MACRO PROGRAM EXAMPLE

1.8 Flow Chart


00010 (Key input test)
00001 (Main program)
(START)
(START)

1 1

I Screen clearing

- +
I

I Title display
I

Menu display I
I Soft key display I

Key input variable, numerical


data variable and address data
variable display
I

00011 (Soft key display)


(START)

I
Counter = 0
Soft key 3? Yes

1 Soft key iy ispla yed. 1

I
Counter + 1 RET
.

Al-13
APPENDIX 1 MACRO PROGRAM EXAMPLE

00020 (Cursor test) 00030 (Display test)


(START) (START)

I
1

I- Screen clear
I

Cursor OFF I Cursor display OFF


I

Soft key display

. d / M99

Counter = 0

1 CursorX-cootvnate = 2 jl

I Oata display test I

Character string display test

-I Mgg1

Al-14
APPENDIX 1 MACRO PROGRAM EXAMPLE

00032 (Blink test) 00040 (Address variable test)


(START) (START)

1
I Title display I ,ti,

I Counter = 200
I I Titie display
I

PMC data read (G 12 1.4


emergency stop signal) I

I
Character display by
Bl (Blink) I

h Counter -1
Counter > O?

Character display by
1 1 B2 (Blink high-speed) 1
“Press Emergency
Stop Button “display I “Reset Emergency
Stop Button “display

I Counter -1

Parameter read test

I RET
I

Al-15
APPENDIX 1 MACRO PROGRAM EXAMPLE

00041 (Data table write test) 00050 (Circular cutting)


(START) (START)
+
1
I Counter = 0
I

Write counter value


I Cursor pointer initial
in data table No. 699 setting
X=l7,Y=2

Counter + 1

Character string
c display for data I,
Yes

Graphic display

L3 RET ,
Data display

I Numerical data read I

No

No

Cursor pointer = 0

l \

Al-16
APPENDIX 1 MACRO PROGRAM EXAMPLE

.
2
.

Cursor pointer t 1

Cursor pointer f 2
I Data display

Q-l
1

Cursor pointer -1
I

-=

Al-17
APPENDIX 1 MACRO PROGRAM EXAMPLE

00054 (Execution macro start up)


(START) Use external program No.
search function.
When AUTO mode is selected
from the macro, prepare PMC

I
Program No. and AUTO
so that the external program
mode selecting signal
No. from machine side
OW@
becomes invalid.

Time chart
c 1
L-
8
Further, start signal is
‘MC-A 1-L
OlJwt
\
MC. S r-l

I Timer

Only start signal OFF

Timer
\
.
Program No. and AUTO Unless the AUTO mode signal
, ;n seiecti; signal , isturned OFF finally, and
selection from the operator’s
panel is invalid.

1
0699

MC. 5 MC. A PN8M PN4M PNZM PNlM

7 6 5 4
I I 3H

AUTO mode selecting

Macro start signal

1.9 Explanation of Program

(1) 00001
0020 NO00 G202 P3
Screen erase
PI : Character screen
P2: Graphic screen
P3: Character and graphics
0030 #8505 = 0
Cursor control

Al-18
APPENDIX 1 MACRO PROGRAM EXAMPLE

#8505= 0 I Cursor OFF


#8505 = 1 : Cursor ON
0040 G243 X0 YO A1 BO
(SAMPLE PROGRAM)
x2 Y3 (-•-•-)
Display the characters on the screen
G243 : Character display
x0 : Position to start X-axis display
YO : Position to start Y-axis display
Al : Size of the letter
(Al : 1 time, A3 : 3 times)
(SAMPLE PROGRAM)
.

090 39,0

Character coordinate -

0,16 39,16

The character string in parenthesis is displayed on the screen.


% In NC programming, a set of parentheses ( ) is a control IN/OUT function, which can be used
as a comment, but in conversation macro, it means the display data, which cannot be used as
a comment.
0100 #8509=0033
#143=300
M98 PO011 -
#8509 is a character string registration control variable.
The character string corresponding to Sequence No. can be displayed, using G243 XYP
sequence No.
Set Program No. including Sequence No., using #8509.
#143 is a common variable, which is used as offset of Sequence No. here.
The menu corresponding to the soft key is displayed, using subprogram 00011.
0130 NO01 #142=#8501
#85Ol is a key input variable, which accepts the cursor key, page key, soft key, edit key and
input key.
Once it is read, it is cleared to “O”;then, save the data in #142.

(2) 00011
0030 WHILE [Conditional Expression] DO1
I
END1

Al-19
. APPENDIX 1 MACRO PROGRAM EXAMPLE

In a WHILE statement, while the conditional expression is established, processing between DO


and END is carried out, and when it is not established, execution is started from the next block
of the corresponding END statement.

0040 G243X[ ]Y[ ]P[#143+#100]


#I43 is a common variable, which is used for Sequence No. offset.
#lOO is used as a counter, which counts 0 to 4.
Here set the head Sequence No. of the character string written in Program No. 00033, using
#143, and loop it with #lOO to make it correspond to soft key 1 to 5.

00020
0220 NO03 #100=#100+6
#100=#100-[FIX[#100/6]]*6
This calculation is made to find the cursor position.
Add 6 in advance so that cursor position does not become negative on the 220th line. “6”
means that the cursor moves at 6 places.
*‘FIX” on the 230th line is a function which omits the figure below the decimal place of the
answer for the quotient. Find the remainder divided by 6.

00030
0090 G243 X0 Y2 Al BO K200
Write 200 blanks, using K200.
If a triple character is specified with A3, the blank of a triple character is written by the
specified number.

0190 XOY4('34412438493D......*)
When internal codes, such as Chinese characters are used for the screen display, enclose
them with “(*‘and “7”.
For Chinese characters, space for 2 letters are used.

0480 G243X Y F8.3


F8.3specifithedigits when numerical data is displayed: total 8 digits and 3 digits below the
decimal place.

0570 X6Y6(5.2)
#100=1234.567
When the display is made in 2 digits below the decimal place, using F5.2 format, the figure is
half-adjusted to ” 1234.57”.

0600 #8509 = 0033


Use the character string registration program variable #8509 designate program No. including
sequence No.specified by G243 top (Seuuence No.).
-= _
Here, use Program No. 0033 character string.

00032
G243---B1(-)

Al-20
APPENDIX 1 MACRO PROGRAM EXAMPLE

For blink display, display instructions are given only once but repeated.
00040
0100 #lOO=Gl21.4
Gl21.4 (emergency stop) condition is read to common variable #lOO.

0310 #lOl =P[#102+4+500]


The contents of parameter specified by P [ ] is read to common variable #103.
Here, vary #102 up to 0 - 3 and read parameters 500, 504, 508, 512.
500 X-axis in-position width
504 X-axis moving error excessive
508 X-axis grid shift amount
512 X-axis loop gain multipier

(3) 00054
Use data table No. 699 for data transfer with PMC, and write Program No., AUTO mode
selection and cycle start signal.

0699
•?
MC. s MC. A PN8M PN4M PN2M PNlM

7 6 5 4 3 2 1 0

Macro AUTO mode selecting

Macro start signal

In the PMC sequence program, the external Program No. from the machine side was made
invalid and Program No. from the macro valid when the AUTO mode from the macro (MC.A) is
received.
When MC.A signal is input, the mode on the operator’s panel is changed to “AUTO” automatically.
When the timer preset time elapses after the mode selection, turn the cycle start signal ON.
Within PMC, this signal is “OR” with the cycle start signal on the operator’ s panel.

PNl-8M -

MC. A -L

MC-S 1

Al-21
APPENDIX 1 MACRO PROGRAM EXAMPLE

1.10 Program Example for PMC Sequence

PNlN MC.A

AUTO.
k M MDX. M JOG. M HOME. M HND. M

41
t-
MC. A

d
t-
~ AUTO. L

MC. A : AUTO mode selecting signal from MACRO


MC. S : Cycle start signal from MACRO
PNlM : External program No. from MACRO
PNlN : External program No. from the machine
PNl : External program No. search output signal to NC
AUTO. M : AUTO mode selecting signal from the operator’s panel
MDI. M : MDI mode selecting signal from the operator’s panel
JOG. M : JOG mode selecting signal from the operator’s panel
HOME. M : ZRN mode selecting signal from the operator’s panel
HND. M : HND mode selecting signal from the operator’s panel
AUTO. L : AUTO mode selecting signal(hold)
ST .. Cycle start signal to NC
ST. M : Cycle start signal from the operator’s panel

Al-22
APPENDlX 1 MACRO PROGRAM EXAMPLE

00010 00001 ; Main


00020 NO00 G202 P3 ; Screenclear
00030 /8505=0 ; Cursor OFF
00040 6243 X0 YO Al BO (SAMPLE PROGRAM)
00050 x2 Y3 (1 -- KEY TEST) ;
1
00060 X2 Y5 (2 -- COUSOR TEST) ;
00070
00080
X2 Y7 (3 -- DISPLAY TEST) r'
x2 Y9 (4 -- ADDRESS VARIABLE) r'
1 Menu display

00090 X2 Yll (5 -- CIRCLE) ; I

00100 #8509=0033 ; Character string registration program No.


00110 #143=300 ;
Softkey display
00120 M98 PO011 ; >
00130 NO01 #142=f8501 ; Input variable read
00140 IF [#142 EQ 0] COT0 99 ; Loop for which no key is depressed
00150 IF [#142 LT 121 GOT0 99 ; (including M99)

4
00160 IF [#142 GT 161 GOT0 99 ;
00170 #8500=[#142-111 *lO ;
Separate to program
00180 M99
per softkeys
00190 NO99 M99 Pl ;
00200 ;
00210 ;
00220 ;
00230 r'
00240 r'

Al-23
APPENOIX 1 MACRO PROGRAM EXAMPLE

00010 00010 ; Keytest


00020 G202 P3 ; Screen clear
00030 G243 X0 Y2 Al 80 (KEYTEST -- HIT ANY KEY -0) ; Titiedisplay
00040 #143=100 r' Soft key display: #I43 is displayed at the head of
00050 M98 PO011 ;> character sequence No.
00060 NO01 #8502=2 Input an address and numeral
00070 #142=#8501 r'SAVE a key input variable
00080 IF [#142 EQ O] GOT0 99 ;
Key input presence or absence
00090 #101=#142 ; judgement, loop for which key
00100 #102=#8503 ; > input is none.
00110 #103=#8504 ; Key input data read
00120 G243 X0 Y4 Al BO (CONTROL ) F8.3 20 D#lOl r'
00130 6243 X0 Y5 Al BO (ADDRESS ) F8.3 20 Df103 r' Key input
data display
00140 6243 X0 Y6 Al BO (DATA ) F8.3 20 D#lO2 ;>
00150 NO99 IF [#142 NE 161 GOT0 97 ; Shifttothemenuafterapush
00160 NO98 #8500=1 ; on the END key.
00170 M99 ;
00180 NO98 M99 Pl ;
00190 r'
00200 ;
00210 ;
00220 ;
00230 ;

00010 00011 ; Top sequence No. of


00020 #lOO=O f Clear the counter character for soft key
00030 WHILE [#lo0 LT 51 DO 1 ; f I Counter
00040 G243 X[#100*8+1] Y16 Al BO P[#143+#100] ;
00050 #100=#100+1 ; Counter +l
00060 END 1 ;
00070 M99 ;
00080 ;
00090 ;
00100 ;
00110 r’
00120 ;

.= _

Al-24
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 00020 ; Cursor test


00020 c202 P3 I'
00030 #8505=0 ; Cursor display none
00040 #8502=0 ; key input none
00050 NO08 G243 X0 Yl (CURSOR TEST -- MOVE CURSOR -0) ; Titledisplay
00060 G243 X0 Y3 (A) ;
00070 G243 X0 Y4 (B) r'
00080 6243 X0 Y5 (C) ;
The menu for cursor is displayed
00090 G243 X0 Y6 (D) r'
t
00100 G243 X0 Y7 (E) ;
00110 G243 X0 Y8 (F) ; I
00120 #143=100
Soft key display
00130 M98 PO011
; >
00140 #lOO=O ; Pointer for cursor display posotion
00150 #8506=2 ; Cursor position in X-axis direction
00160 NO01 #142=#8501 ; SAVE key input control variable.
00170 IF [#142 EQ 0] GOT0 3 ; Key input presence or absence judgment
00180 IF [#142 NE 3] GOT0 2 ; Pointer + 1 for cursor 1
00190 #100=#100+1 r'
00200 NO02 IF [#142 NE 41 GOT0 3 ; Pointer - 1 forcursor t
00210 #100=#100-1 ;
00220 NO03 #100=#100+6 ;
Pointer posotion calculation
00230 #lOO=#lOO-[FIX [#100/6]]*6 ;>
00240 #8507=#100+3 ; Actual Y-axis cusor posotion
00250 #8505=1 ; Cursor display ON
00260 NO99 IF [#142 NE 161 GOT0 97 ; Return tothe menu aftera push
00270 NO98 #8500=1 ; on the END key.
00280 M99 ;

00290 NO97 M99 Pl r'


00300 :
00310 t
00320 :
00330 t
00340 ;

Al-25
APPENDIX1 MACROPROGRAMEXAMPLE

00010 00030 ; Character display test


00020 G202 P3 ; Screencleat
00030 #8502=0 ; Datainputinvalid
00040 #SSOS=O ; Cursor display OFF
00050 #143=100 f
Soft key display
00060 M98 PO011 ; >
00070 NO01 G243 X0 Y2 Al BO K200 ; Paftidscreenerase
00080 X0 Y2 (DISPLAY TEST) ;
00090 G243 X0 Y4 Al BO K200 ;
00100 #141=100 ;
Timer
00110 M98 PO031 ; > l

00120 X0 Y4 (FANUC 0 SERIES MACRO COMPILER) ;


00130 #141=300 ; Enclose the characters to be displayed with a
parenthesis.
00140 M98 PO031 ;
00150 G243 X0 Y4 Al BO K200 r'
00160 #141=100 ;
00170 M98 PO031 ;
00180 G243 X0 Y4 Al BO K200 ;
00190 X0 Y4 (*3441 2438 493D 3C28 OOC3 OOBD OOC4") r'
00200 #141=300 ; Enclose the internal code with “(*” and “*)“.
00210 M98 PO031 ;
00220 G243 X0 Y4 Al BO K200 ;
00230 #141=100 ;
00240 M98 PO031 ;
00250 G243 X0 Y4 Al BO K200 ;
00260 X0 Y4 (INT ..CODE,)(*2F40,2F48,2F79 2F53*) ;
00270 #141=300 ;
00280 M98 PO031 ;
00290 G243 X0 Y4 Al BO K200 I'
00300 #141=100 ;
00310 M98 PO031 ;
00320 X0 Y4 A3 BO (3 MULTI) ;
00330 #141=300 ;
00340 M98 POO31;
00350 C243 X0 Y4 Al BO K200 r'
00360 #141=100 ;
00370 M98 PO031 ;
00380 M98 PO032 ; Blink test sub program
00390 #141=100 r'
00400 M98 PO031 ;
00410 G243 X0 Y4 Al BO K200 ;
00420 X0 Y4 (DATA DISPLAY TEST 1234.567) ;
00430 #100=1234.567 ;
00440 G243 X0 Y6 F8.3 20 K200 ;
00450 X0 Y6 (F8.3 ) D#lOO ;
00460 #141=300 ;

Al-26
APPENDIX 1 MACRO PROGRAM EXAMPLE

00470 M98 PO031 r'


00480 6243 X0 Y6 F8.3 21 K200 ;
00490 ~141=100 r'
00500 M98 PO031 I'
00510 X0 Y6 (F8.3 ) D#lOO ( LEADING ZERO NEG.) ;
00520 #141=300 ;
00530 M98 PO031 ;
00540 G243 X0 Y6 F5.2 K200 :
00550 #141=100 ;
00560 M98 PO031 ;
00570 X0 Y6 (F5.2 ) D#lO0 ;
00580 #141=300 ;
Timer
00590 M98 PO031 r' >
00600 #8509=0033 ; The character string is 00033.
00610 6243 X0 Y4 Al BO K200 ; Par&I screenerase
00620 #141=100 r'
Timer
00630 M98 PO031 ; >
00640 X0 Y4 (STRINGS DISPLAY TEST) ; Display
00650 G243 X0 Y6 K200 ; Screen partially erased
00660 X0 Y6 PlO ; The character string of sequence No. 10 is displayed.
00670 #141=300 r'
Timer
00680 M98 PO031 ; >
00690 G243 X0 Y6 K200 ; Screen partially erased
00700 #141=100 ;
Timer
00710 M98 PO031 ; >
00720 X0 Y6 P20 ; The character string of sequence No. 20 is displayed.
00730 #141=300 I'
Timer
00740 M98 PO031 ; J
00750 #142=X8501 ; Key input variable is SAVED.
00760 NO99 IF [#142 NE 16) GOT0 97 ; Return to the menu when the soft
00770 NO98 X8500=1 ; key is “END”.

00780 M99 ;
00790 NO97 M99 Pl ;
00800 ;
00810 ;
00820 r'
00830 I'
00840. ;

Al-27
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 00031 ; Timer


00020 NO01 IF [#141 LT 0] GOT0 99 ;
End when timer value is smaller than - 10;
00030 #141=/141-l ; >
00040 GOT0 1 ;
00050 NO99 #142=#8501 ;
00060 IF [#142 EQ 161 GOT0 97 r' Return to the menu when
00070 M99 ; the END key is depressed during
timer operation
00080 NO97 M99 P98 ; >
00090 ;
00100 ;
00110 ;
00120 ;
00130 ;

00010 00032 ; Brink test


00020 6243 x0 ~4 ~1 BO (BLINK TEST) ; Titledisplay
00030 ~100=200 ; Loop counter setting
00040 WHILE [#lo0 GT 0] DO 1 r'
00050 ~100=~100-1 I'
00060 NO01 G243 X0 Y6 Al Bl (BLINK SLOW) r' Loop for blinkig

00070 END 1 ;
00080 G243 X0 Y6 Al BO K20 ; screen partially erased
00090 #141=100 I'
Timer
00100 M98 PO031 ; >
00110 #100=200 ; Loop counter setting
00120 WHILE [tlOO GT 0] DO 2 ;
00130 ~100=/100-1 ;
00140 NO02 G243 X0 Y6 Al B2 (BLINK FAST) ; Loop for blinking

00150 END 2 ;
00160 G243 X0 Y4 Al BO K200 ; screen partially erased
00170 M99 ;

00180 t
00190 :
00200 t
00210
00220 r’

Al-28
APPENDIX 1 MACRO PROGRAM EXAMPLE

2 _

00010 00033 ; Displaycharacterstringdata.


00020 NO10 (ABCDEFGHIJKLMNOPQRSTUVWXYZO123456789) ;
00030 NO20 (FANUC TECHNICAL TRAINING CENTER) ;
00040 NlOO ( ) r' Enclose the display character string
00050 NlOl ( ) ; with parentheses.
00060 N102 ( ) t
00070 N103 (
00080 N104 ( END
00090 N200 (RADIUS
00100 N201 ( FEED
Enclose the internal code with “(*” and “*)“.
00110 N202 (OFS NO
00120 N203 ( EXEC t
00130 N204 ( END r’
00140 N300 (TEST-1 t
00150 N301 (TEST-2 t
00160 N302 (TEST-3) r'
00170 N303 (TEST-4) r'
00180 N304 (TEST-S) r'
00190 N500 (INPOSITION WIDTH ) I'
00200 N504 (SERVO ERROR LIMIT ) ;
00210 N508 (GRID SHIFT VALUE ) ;
00220 N512 (LOOP GAIN MULTPLY ) r'
00230 M99 ;
00240 t
00250 ;
00260 ;
00270
00280

Al-29
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 00040 r'Addreess variable test


00020 6202 93 ; Screen erease
00030 #143=100 ;
Soft key display
00040 M98 PO011 r'>
00050 NO08 G243 X0 Y2 Al BO K520 ; Screen partiallyerased
00060 G243 X0 Y2 Al BO (ADDRESS VARIABLE TEST) ; Titledisplay
00070 #141=100 ;
Timer
00080 M98 PO031 t
00090 X0 Y4 (ADDRESS G READ TEST) ; Display ; PMC+NCrnput.
t
00100 NO01 #lOl=G121.4 ; Emergency stop signal read Emergency stop
00110 IF [#lo1 EQ 0] GOT0 2 ; signal status display
00120 X0 Y6 21 F1.0 ESP STATUS -- ) D#lOl ( PUSH ESP) ;

00130 #142=#8501 ; Looped until the emergent stop signal


is input, but a push on the YND key
00140 IF [#142 EQ 16 GOT0 98 ; returns the display to the menu.
00150 M99 Pl I'
00160 NO02 X0 Y6 21 F1.0 (ESP STATUS -- ) D#lOl ( RESET ESP) ;
00170 #141=100 ; Status display
Timer
00180 M98 PO031 ; >
00190 X0 Y4 K200 ; Screen partialloy cleared
00200 #141=100 r’
Timer
00210 M98 PO031 ; >
00220 X0 Y4 (ADDRESS D WRITE TEST) ;
00230 M98 PO041 ; Subroutine of data table teat
00240 6243 X0 Y4 Al BO K200 ; Screen partially erased
00250 #141=100 r’
Timer
00260 M98 PO031 ;>
00270 G243 X0 Y4 (PARAMETER READ) ;
00280 #102=0 ; Counter
00290 #8509=0033 : The character string for display is 00033
00300 WHILE [#lo2 LE 31 DO 1 ;
00310 #103=P[$102*4+500] ; Calculate parameter No. (P: parameter)
00320 G243 X0 Y[#102+6] (NUM ) 21 F3.0 D[#lO2*4+500]
00330 ( -- ) D#103 ;
00340
00350
00360 END 1 ;
00370 #141=500 :
00380 M98 PO031 ; I Timer

00390 #142=#8501 ; A push on the END key returns the


1
00400 NO99 IF [#la2 NE 161 GOT0 97 ;J displaytothemenu.
00410 NO98 #8500=1 ;
00420 M99 ;
00430 NO97 M99 P8 ;
00440 :
00450 :
00460

Al-30
APPENDIX 1 MACROPROGRAMEXAMPLE

00470 :
00480 :
00010 00041 r'
00020 #lOO=O ; Counter
00030 WHILE [#lo0 LT 51 DO 1 ;
00040 G310 D699 Q#lOO ; Write Q data on the data
00050 x141=10 r' table specified by D.
00060 M98 PO031 ; > Timer
00070 #lOO=#lOO+l ; Counter +1
00080 END1 r’

00090 #lOO=D699 ;
00100 G243 X0 Y6 (DATA TABLE -- ) F3.0 D#lOO r'> Answer display
00110 #141=300 ;
Timer
00120 M98 PO031 ; >
00130 M99 ;

00140 t
00150 ;
00160 ;
00170 r’
00180 r’

Al-31
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 00050 ; Circular cutting


00020 G202 P3 I' Screen erased
00030 #8506=13 r'Cursor display X position
00040 #8507=2 ; Cursor display Y position
00050 #8505=1 ; Cursor display ON
00060 #147=0 r' Cursor pointer
00070 G202 P3 ;
00080 M98 PO052 ; Character string display subroutine for data
00090 M98 PO053 ; Graphic display subroutine
00100 M98 PO051 ; Data display subroutine
00110 NO01 #8502=1 ; Data is input with numerals
00120 $142=#8501 ; SAVE key input variable.
00130 #144=#8503 ; Numeral data variable read
00140 IF [#142 EQ 0] GOT0 99 ; In the absence of ke input,
the IOORI M99 shoul J be included.
00150 IF [#142 NE 12 ] GOT0 3 r'
When soft key 1 is depressed,
00160 #147=0 ;
the cusor pointer is 0.
00170 GOT0 9 ;
00180 NO03 IF [#la2 NE 13 ] GOT0 4 ;
When soft key 2 is depressed,
00190 #147=1 ;
the cursor pointer is 1.
00200 GOT0 9 r'
00210 NO04 IF I#142 NE 141 GOT0 5 I'3
00220 #147=2 ; When the soft key 3 is depressed,
the cursor pointeris 2.
00230 GOT0 9 ;

00240 NO05 IF [#142


_ NE 41_ GOT0 6 ; 7
When the cursor is ” T “,
00250 #147=1147-l ;
the pointer is - 1.
00260 GOT0 9 ;
00270 NO06 IF [#142 NE 31 COT0 7 ; -)
When the cursor is ” J, “,
00280 #147=#147+1 ;
the Dointer
I is + 1.
00290 GOT0 9 ; J
00300 NO07 IF [#142 NE 151 GOT0 8 ; To N8ifsoftkey4isnot “EXEC”.
00310 #140=1 ; Select 00001 external program seach No. + Select 00001
of NC memory.
00320 M98 PO054 ; Start NC via PMC.
00330 GOT0 10 r'
00340 NO08 IF [#142 NE 81 GOT0 10 ; To N 10 if “INPUT” is not depressed.
00350 NO09 #147=#147+3
00360 #147=#147-FIX [#147/3]* 3 ; Cursor position calculation
00370 IF [#144 EQ #O] GOT0 10 ; To NlO if any numeric was kayed in.
00380 #[500+#147]=#144 ; Data written to common variable 500 -
00390 6243 X14 Y[/147+2] 21 F4.0 D#[#147+500] ;
Data display
00400 NO10 M98 PO051 r' 3
00410 NO99 IF [#142 NE 161 GOT0 97 ; To the menu when the END key
00420 NO98 #8500=1 I' 3 is depressed.
00430 M99 ;

Al-32
APPENDIX 1 MACRO PROGRAM EXAMPLE

00450 ;
00460 ;
00470 ;
00480 ;
00490 ;

00010 00051 f Cursorand data display


00020 #8507=f147+2 ; Cusror and position
00030 #lOO=O f Counter
00040 WHILE (#lo0 LT 31 DO ! ;
00050 6243 Xl4 Y[f100+2] 21 F4.0 D#[500+#100]
4 ;
00060 #100=#100+1 r'
00070 END 1 ;
00080 M99 r' . Data is displayed, changing display
00090 ;
position.
00100 ;
t

00130 ;

00010 00052 ; Character string display for data


00020 G243 X0 YO Al BO (CIRCULAR CUTTING) ;
00030 Xl Y2 (I) ;
00040 C40 (RADIUS) C41 C61 ;
00050 Xl Y3 (F) ;
00060 C40 ( FEED ) C41 C61 ;
00070 Xl Y4 (D) I'
00080 C40 (OFS NW) C41 C61 ;
00090 #143=200 ;
00100 M98 PO011 ;
00110 M99 f
00120 t
00130 t
00140 t
00150 r’
00160 :

Al-33
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 00053 f Graphic display


00020 G244 PO r'Type of line (solid line)
00030 6242 X80 Y20 ; Drawing start posotion
00040 GO1 Xl10 Y50 ;
00050 GO2 X140 Y20 1110 320 QO ;
00060 GO2 X140 Y20 180 520 94 r'
00070 GO2 xl10 Y-10 1110 520 QO ;
\
00080 CO1 X80 Y20 ; Specify the number of quadrants.
00090 G244 P2 ;
00100 G242 X80 Y20 ;
00110 GO1 Y-70 ;
00120 G242 X20 Y20 ;
00130 GO1 Y-70 ;
00140 G244 Pl ;
00150 G242 X80 Y-65 ;
00160 GO1 X20 ;
00170 G243 X25 Y12 Al BO (I) ;
00180 M99 r'
00190 t
00200 t
00210 t
00220 t
00230 ;

00010 00054 I'Data output to PMC


00020 G310 D699 Q[#140+16 1 ; Select Program No. for #140 and
#141=5 ; AUTO mode with + 16.
00030
Timer
00040 M98 PO031 ; 3
00050 G310 D699 Q[#140+48 J ;AUTO mode and cycle start are ON with + 48
00060 #141=5 ;
00070 M98 PO031 ;
00080 G310 D699 Q[#140+16] ;Only AUTO mode is ON with + 16.Cycle start is OFF.
00090 #141=5 r'
00100 M98 PO031 ; All data including program No. is OFF.
00110 G310 D699 QO ;
00120 M99 ;
00130 t
00140 t
00150 :
00160 t
00170 r’

Al-34
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 09010 ; Execution macro forcircular cutting


00020 G40 G49 G80 I'
00030 #1=#500/2 ;
00040 G91 G42 GO1 X#l Y#l D#502 Ff501 ;
00050 GO2 X#l Y-f1 J-#l ;
00060 I-X500 r'
00070 x-#l Y-f1 I-#1 ;
00080 C40 GO1 X-#l Y#l ;
00090 M99 ;
00100 t
00110 t
00120 t
00130 t
00140 r'

Set 100 to compile parameter 9013, and call this program


from p&am 00001 in NC memory, using GlOO. program 00001 is
selected via PMC with external program No. search, from
conversational macro 000054.

Al-35
APPENDIX 1 MACRO PROGRAM EXAMPLE

2. EXAMPLE-2 EXAMPLE FOR KEY INPUT AND CURSOR CONTROL

2.1 Source program List


00010 08000 ;
00020 Nl M98 P8011 ;
00030 N9 M98 P9503 ;
00040 IF #lo2 EQ 121 COT0 100 ;
00050 IF #lo2 EQ 131 GOT0 200 ;
00060 M99 P9 ;
00070 NlOO M98 P8012 ;
00080 N19 M98 P9503 ;
00090 IF #lo2 EQ 161 GOT0 199 ;
00100 IF [#lo2 NE 81 GOT0 190 ;
00110 IF [#lo4 EQ l] GOT0 110 ;
00120 ~10050 = 11103 ;
00130 #lSO = 4.0 r'
00140 fl41 = 1 ;
00150 M98 P9501 ;
00160 M99 P19 ;
00170 NllO #[lo051 + #105] = #103 ;
00180 #lSO =5.2 ;
00190 #lSl = 1 ;
00200 M98 P9501 ;
00210 N190 M99 P19 ;
00220 N199 M99 Pl ;
00230 N200 M98 P8013 ;
00240 N29 M98 P9503 ;
00250 IF [#lo2 EQ 161 GOT0 299 r'
00260 IF [#lo2 NE 81 GOT0 290 ;
00270 IF [#lo4 EQ l] GOT0 210 I'
00280 #lo060 = #103 ;
00290 1140 = 4.0 ;
00300 #141 = 0 ;
00310 M98 P9501 ;
00320 M99 P29 ;
00330 N210 #[lo061 + X105] = 11103 ;
00340 #140 = 4.0 ;
00350 #141 = 0 ;
00360 M98 P9501 ;
00370 N290 M99 P29 ;
00380 N299 M99 Pl ;
00390 :
00400 :
00410 :
00420 :
00430 t

Al-36
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 08001
00020 #10000 = 10010 r'
00030 #lOOOl = 2 ;
00040 #10002 = 10026 ;
00050 #10003 = 2 r'
00060 #lOOlO = 13 ;
00070 #lOOll = 2 ;
00080 #10012 = 0 ;
00090 #10013 = 0 ;
00100 110014 = 1 r'
00110 #lOOlS = 1 ;
00120 X10016 = 1 ;
00130 #10017 = 0 ;
00140 #lo018 = 10 I'
OOlSO #10019 = 4 r'
00160 110020 = 0 ;
00170 #10021 = 1 r'
00180 #10022 = 1 r'
00190 #lo023 = 7 r'
00200 #lo024 = 1 r'
00210 #lo025 = 1 ;
00220 110026 = 13 ;
00230 (cl0027 = 2 ;
00240 #lo028 = 0 r'
00250 #10029 = 0 ;
00260 (110030 = 1 ;
00270 #10031 = 1 ;
00280 X10032 = 1 ;
00290 1110033 = 0 ;
00300 #10034 = 11 ;
00310 #10035 = 4 ;
00320 X10036 = 6 ;
00330 #10037 = 1 ;
00340 #lo038 = 4 ;
00350 x10039 = 5 ;
00360 #10040 = 1 ;
00370 #10041 = 0 ;
00380 #8500 = 8000 :
00390 M99 I'
00400 ;
00410 ;
00420 t
00430 t
00440 :

Al-37
APPENDIX 1 MACRO PROGRAM EXAMPLE

00010 08011 ;
00020 M98 P9506 r'
00030 G243 X0 Yl Al (MACRO EXAMPLE) ;
00040 X2 Y4 Al (SOFTKEY SELECT) ;
00050 X3 Y6 (1 - EXAMPLE A) ;
00060 x3 Y7 (2 - EXAMPLE B) ;
00070 X3 Y8 (3 - EXAMPLE C) r'
00080 x3 Y9 (4 - EXAMPLE D) ;
00090 x3 YlO(5 - EXAMPLE E) ;
00100 X2 YlG(EX.A) ;
00110 XlO(EX.B) ;
00120 Xl8(EX.C) r'
00130 X26(EX.D) ;
00140 X34(EX.E) ;
00150 #loo = 0 ;
00160 M99 r'
00170 r’
00180 r’
00190 r’
00200 r’
00210 t

00010 08012 ;
00020 M98 P9506 ;
00030 G243 Xl YO Al (EXAMPLE A) ;
00040 X3 Y2 ( PROG NO ) C61 ;
00050 x0 Y4 ( DATA 1 ) C61 r'
00060 x0 Y5 DATA 2 ) C61 ;
00070 X0 Y6 DATA 3 ) C61 ;
00080 x0 Y7 DATA 4 ) C61 ;
00090 X0 Y8 DATA 5 ) C61 ;
00100 x0 Y9 DATA 6 ) C61 ;
00110 x0 YlO( DATA 7 ) C61 ;
00120 X34 Y16 (END) ;
00130 G243 Xl4 Y2 F4.0 20 D#10050 ;
00140 #lSO = 5.2 ;
00150 #141 = 1 ;
00160 #142 = 11 r'
00170 #143 = 4 ;
00180 #144 = 10051 ;
00190 #la5 = 7 ;
00200 (1146 = -9999 ;
00210 #147 = 1 ;
00220 M98 P9505 ;
00230 #loo = 1 ;
00240 ilO4 = 0 I'

Al-38
APPENDIX 1 MACRO PROGRAM EXAMPLE

00250 #105 = 0 ;
00260 #140 = 0 ;
00270 M98 P9502
00280 M99 ;
00290 ;
00300 t
00310 t
00320 r’
00330 t

00010 08013 ;
00020 M98 P9506
00030 6243 Xl YO Al (EXAMPLE B) I'
00040 x3 Y2 PROG NO 1 * 3D *) :
00050 x0 Y4 DATA SET1 t
00060 x0 Y5 DATA SET2
00070 X0 Y6 DATA SET3
00080 x0 Y7 DATA SET4
00090 X0 Y8 (DATA SETS) ;
00100 X34 Y16 (END) ;
00110 G243 Xl4 Y2 F4.0 20 D#10060 ;
00120 #llO = 0 r'
00130 WHILE [$llO LE 41 DO 1 I'
00140 #140 = 4.0 ;
00150 #141 = 0 ;
00160 #142 = 12 ;
00170 #143 = #llO + 4 r'
00180 f144 = 10061 + #llO * 4 ;
00190 1145 = 4 ;
00200 #146 = -9999 ;
00210 #147 = 6 ;
00220 M98 P9504 ;
00230 ill0 = #llO + 1 r'
00240 END 1 ;
00250 ilO0 = 2 ;
00260 #104 = 0 ;
00270 #lo5 = 0 I'
00280 #lSO = 0 r'
00290 M98 P9502 ;
00300 M99 ;
00310 t
00320 t
00330 :
00340 ;
00350 ;
00360 t

Al-39
APPENDEX 1 MACRO PROGRAM EXAMPLE

2.2 Specification
2.2.1 Type of screen

(1) Initial screen

X-axis
9

0
1 MACRO EXAMPLE
y 2
3
- 4 SOFTKEY SELECT
a
X 1 - EXAMPLE A
i 2- EXAMPLE B
S 3- EXAMPLE C
9 4- EXAMPLE D
S- EXAMPLE E

14
EX.A 1 EX.B 1 EX.C 1 EX.D 1 EX.E
I

Press AUX key: this screen will be displayed. On this screen, select a menu.
However, in this example, EX.C, EX.D, and EX.E menu screens are not prepared.

(2) Menu-l (EX.A)

X-axis
0 EXAMPLE A
1
2 PROG NO = -9999
3
y 4 DATA 1 = -999.99 _
DATA 2 = -999.99
a DATA 3 = -999.99
X DATA 4 = -999.99
i DATA S = -999.99
s 9 DATA 6 = -999.99
DATA 7 = -999.99

14
END

Press soft key END : the display will return to the initial screen.

” indicates the cursor position. Actually, the cursor is displayed always at one place.

(3) Menu-2 (EX.B)

X-axis
0 EXAMPLE A
1
PROC NO = -9999
Y 2
-3
DATA SET1 -9999 -9999 -9999 -9999
a 4 DATA SET2 9999 9999 9999 9999
X
DATA SET3 19999 29999 19999 I9999
i DATA SET4 -9999 -9999 -9999 -9999
S
DATA SETS -9999 -9999 -9999 -9999
9
I
14 ’
END

Press soft key END : the display will return to the initial screen.
81
” indicates the cursor position. Acutally, the cursor is displayed always at one place.

Al-40
APPENDEX 1 MACRO PROGRAM EXAMPLE

2.2.2 Variable data (3) Variables used in menu


(1) Cursor control data
#lo050 IPROG.NOI #10060 II
P-CODE variable
(EX. 1) (EX. 2)
Cursor control No.

#lOOSl DATA 1 #lo061

Key input control data 2 4


2 2
2 KCONT OATA SET 1
I I (#8501 value) 3 4 3 3
3 1 KDATA Key input numerical data 4 4 4 4
(#8503 value)
5 4
5 5
Cursor1 pointer
6 4
6 6
Cursol subpointer 7 7

(2) Cursor data 9

70
#10000 1 10010 #lOOlO
1
I 2 1
2 2
1 10026
I 2 3 3

4 4
5 5
6
6
7

8
a 7

8
9
20 9

1 80

2
3
4 2.3 Program Structure
5

#lo026
a ~1 INIT;AL SCREEN DISPLAY ICSNO = 1

7
8
CSNO = 2 CSNO = 3
9 t ,
EX. A EX. B EX. C EX. D EX. E
30 4
\ /
1 v
2 I 1 1 These are not
3 program
END key (Soft key)
a
4
5
6
7
8
9
40

Al-41
APPENDEX 1 MACRO PROGRAM EXAMPLE

2.4 Flow Chart

08000

4 EX. B Screen display


lntiai screen display
DRI
I , (08011)

L 1
KEYIN
KEYIN

Yes
Yes
KCONT = 16?
KCoNT
=‘*? I No

I
No

Yes
I
KCONT = 8 ?
KCONT = 13?
Yes
No
2 I
a Data Setting

W9)
(NIOO)

Parameter 9038 ISOOlI

After poweer on,


EX. A Screen display
Cursor data execute only once.
(08012) preparation

u7-u KEVIN
#8500 + 8000

KCONT

KCONT
I
= 16?

= 8 ?
No
Yes

No
M99
23 M99

-7
Yes
I

Data Settinq

(M99)

Al-42
APPENDEX 1 MACRO PROGRAM EXAMPLE

2.5 Coding _

(1) Main program


00010 08000 ;
00020 Nl M98 P8011 ; Initial screen display
00030 N9 M98 P9503 ; KEY IN
00040 IF [#lo2 EQ 121 GOT0 100 ;
-L Soft key # 1, #2?
00050 IF If102 EQ 131 GOT0 200 I'J
00060 M99 P9 ;
00070 NlOO M98 P8012 ; Screen (EX. A) display
00080 N19 M98 P9503 r'
00090 IF [#lo2 EQ 161 GOT0 199 ; Soft key #5 (END) ?
00100 IF [#lo2 NE 81 GOT0 190 r' Input key judgment
00110 IF [#lo4 EQ l] GOT0 110 ; Cursor position ?
00120 #10050 = x103 ;
00130 #140 = 4.0 ;
00140 f141 = 0 ; PROG NO. setting

00150 M98 P9501 ;


00160 M99 P19 ; J Processing on EX. A screen
00170 NllO #[lo051 + 11051 = 1103 ;
00180 #140 =5.2 ;
00190 #141 = 1 ; Data setting
00200 M98 P9501 ;
00210 N190 M99 P19 ;
00220 N199 M99 Pl ;
00230 N200 M98 P8013 ; Screen (EX. B) display
00240 N29 M98 P9503 ; Key IN
00250 IF [#lo2 EQ 161 GOT0 299 ; Soft ke ‘y (END) ’.
00260 IF [#lo2 NE 81 GOT0 290 ; input key judgment
00270 IF If104 EQ l] GOT0 210 ; Cursor position ?
00280 #lo060 = #103 ;
'I
00290 #140
00300 #141 =
= 4eo
0 ; ' i-----c PROG.NO.setting

00310 M98 P9501 ;


00320 M99 P29 ; J Processing on FX. B screen
00330 N210 #[IO061 + #lo51 = ilO :
00340 #lSO = 4.0 f
00350 #141 = 0 ; - Data setting

00360 M98 P9501 r'


1
00370 N290 M99 P29 ;
00380 N299 M99 Pl ;
00390 t
00400 :
00410 ;
00420 :
00430 t

Al-43
APPENDEX 1 MACRO PROGRAM EXAMPLE

(2) Initial screen display (Subprogram)


00010 08011 ;
00020 M98 P9506 ;
00030 6243 X0 Yl A3 (MACRO EXAMPLE) ;
00040 X2 Y4 Al (SOFTKEY SELECT) ;
00050 X3 Y6 (1 - EXAMPLE A) ;
00060 X3 Y7 (2 - EXAMPLE B) ;
00070 X3 Y8 (3 - EXAMPLE C) r'
00080 X3 Y9 (4 - EXAMPLE D) ;
00090 X3 YlO(5 - EXAMPLE E) ;
00100 X2 YlCj(EX.A) r'
00110 XlO(EX.B) r'
00120 X18(EX.C) ;
00130 X26(EX.D) ;
00140 X34(EX.E) ;
00150 #loo= 0 ;
00160 M99 ;
00170 ;
00180 ;
00190 ;
00200 I'
00210 ;

(3) EX. A Screen display (Subprogram)


00010 08012 ;
00020 M98 P9506 ;
00030 G243 Xl YO Al (EXAMPLE A) ;
00040 x3 Y2 (PROG NO ) C61 ;
00050 x0 Y4 ( DATA 1 ) C61 ;
00060 X0 Y5 ( DATA 2 ) C61 ;
00070 X0 Y6 ( DATA 3 ) C61 ;
00080 X0 Y7 ( DATA 4 ) C61 ;
00090 X0 Y8 ( DATA 5 ) C61 ;
00100 x0 Y9 ( DATA 6 ) C61 ;
00110 x0 YlO( DATA 7 ) C61 I'
00120 X34 Y16 (END) ;
00130 G243 Xl4 Y2 F4.0 20 D#10050 r'
00140 #lSO = 5.2 I'
00150 1141 = 1 I'
00160 #142 = 11 ;
00170 1143 = 4 ;
00180 #144 = 10051 ;
00190 #145 = 7 ;
00200 #146 = -9999 ;

Al-44
APPENDEX 1 MACRO PROGRAM EXAMPLE

00210 #147 = 1 r'


00220 M98 P9505 ;
00230 (cl00 = 1 ;
00240 #104 = 0 ;
00250 #lo5 = 0 ;
00260 #lSO = 0 ;
00270 M98 P9502 r'
00280 M99 :
00290 r'
00300 ;
00310 ;
00320 ;
00330 ;

(4) FX.B Screen program (Subprogram)


00010 08013 r'
00020 M98 P9506 ;
00030 G243 Xl YO Al (EXAMPLE B) :
00040 X3 Y2 (PROG N0)(*3D*) ;
00050 X0 Y4 (DATA SETl) ;
00060 X0 Y5 (DATA SET2) ;
00070 X0 Y6 (DATA SET3) ;
00080 X0 Y7 (DATA SETI) ;
00090 X0 Y8 (DATA SETS) ;
00100 X34 Y16 (END) ;
00110 G243 Xl4 Y2 F4.0 20 D#10060 ;
00120 ((110 = 0 r'
00130 WHILE [#llO LE 41 DO 1 ;
00140 #140 = 4.0 ;
00150 g141 = 0 ;
00160 #142 = 12 I'
00170 #143 = 4110 + 4 ;
00180 #144 = 10061 + #llO * 4 ;
00190 11145 = 4 r'
00200 #146 = -9999 ;
00210 #147 = 6 r'
00220 i98 P9504 ;
00230 #llO = #llO + 1 ;
00240 END 1 ;
00250 #100 = 2 ;
00260 #104 = 0 ;
00270 #105 = 0 ;
00280 #140 = 0 ;
00290 M98 P9502 ;

Al-45
APPENDEX I MACRO PROGRAM EXAMPLE

00300 M99 ;
00310 ;
00320 ;
00330 ;
00340 ;
00350 ;
00360 r’

(5) Cursor control data prepation


00010 08001 r’
00020 #10000 = 10010 ;
00030 #lOOOl = 2 ;
00040 #lo002 = 10026
00050 /10003 = 2 ;
00060 #lOOlO = 13 ;
00070 #lOOll = 2 ;
00080 #lo012 = 0 ;
00090 x10013 = 0 ;
00100 #10014 = 1 ;
00110 f10015 = 1 I'
00120 #lo016 = 1 ;
00130 f/10017 = 0 ;
00140 #lo018 = 10 ;
00150 #10019 = 4 r'
00160 #lo020 = 0 I'
00170 #10021 = 1 ;
00180 #lo022 = 1 ;
OOl90 110023 = 7 ;
00200 #lo024 = 1 ;
00210 #lo025 = 1 ;
00220 #lo026 = 13 ;
00230 (110027 = 2 ;
00240 #lo028 = 0 ;
00250 #lo029 = 0 ;
00260 #lo030 = 1 r'
00270 f10031 = 1 ;
00280 #lo032 = 1 ;
00290 110033 = 0 ;
00300 #10034 = 11 ;
00310 #10035 = 4 ;
00320 #lo036 = 6 ;
00330 #10037 = 1 ;
00340 110038 = 4 ;
00350 #10039 = 5 ;

Al-46
APPENDEX 1 MACRO PROGRAM EXAMPLE

00360 #lo040 = 1 I’
00370 /10041 = 0 ;
00380 #8SOO = 8000 ;
00390 M99 ;
00400 ;
00410 r’
00420 ;
00430 ;
00440 ;
Make this program so that it is executed only once after power ON.

Al-47
APPENDIX 1 MACRO PROGRAM EXAMPLE

3. STANDARD MACRO PROGRAM

3.1 Standard Routine List

Routine 0
No Explanation
Name Number

1 DDPL 09501 Data display to cursor position

2 CDPL 09502 Cursor display

3 KEYIN 09503 Key input control

4 VDPLX 09504 One- line display of variable data

5 VDPLY 09505 One- row display of variable data

6 DSPC 09506 Screen CLEAR

7 VSET 09507 Data setting to continuous variable area

8 VCOPY 09508 Variable copy

3.2 Area of Variable Used


In standard routine, the following vkriable area is used.
In user’s program, do not use this area for others purposes.
P-CODE variables
#loo-#109
#139-#148
Common variables
#10000-(up to the variables required)

Al-48
APPENDIX 1 MACRO PROGRAM EXAMPLE

3.3 Explanation of Variable Area

(1) P-CODE variable

#lOoc CSNO
Cursor control No. of
screen being now selected

1 Vacant

2 (CON-I-

(DATA Key input numerical data


(#8503 value)

CPNT
Cursor pointer
( 0, 1,2, l-•)

SUBP
Cursor subpointer
( 0, 1,2, l--)

Spare

work
area

#148

#149
For macro call using
r code (RESERVE)

Al-49
APPENDIX 1 MACRO PROGRAM EXAMPLE

(2) Cursor control data

zmor
data (1)

Cursor
:ursot data for
iata (2) . CSNo. 1

.. . .. .. .. .. .. ,

Cursor
............. data for
’ CSNo.2

..............

0 CSNO (Cursor control No.)


1, 2, 3...are assigned to screen No. requiring cursor control.
In a program, when it is desired to control the cursor on a screen, set this number to MOO value.
When #lOO is “O”, the cursor is not displayed.

@ CADDRI
It is necessary to prepare cursor data corresponding to cursor control No., but set its top address ’
to CADDRI.

Al-50
@ KOSUI
Specify the number of cursor data required on one screen.

(3) Explanation of cursor data

CADRI CPX Cursor position X

CPY Cursor position Y

CAX
X increment for group:
0 for no group

CAY
Y increment for group:
.
0 for no group

CNX
X number for group:
1 for no group
I
Y number for group:
CNY
1 for no group

CINP Data input relative position


,
CXYF
Cursor moving direction for
, group
0: Move in X direction
1: Move in Y direction

0 Cursor data
One cursor data corresponds to one cursor.
However, when the cursors are arranged in line regularly, those cursors are regarded as one
group, which corresponds to one cursor data.

0 Cursor position (X, Y)


Specify the cursor position, using the coordinate on the screen.
When the cursors from a group, specify the position of a cursor at the head of the cursors from a
group, specify the position of a cursor at the head of the group.

@ X increment and Y increment (AX, AY)


When the cursors from a group, specify the spacing between the cursors in line.
When the cursors are arranged only in the X-direction, specify 0 for AY, and when the cursors are
arranged only in the Y-direction, specify 0 for AX.

@ X number and Y number


When the cursors from a group, specify the number for arrangement in X-direction in Y-direction.
Specify 1 for Y and X number in case of X-direction only and Y-direction only arrangements
respectively.
When the cursors does not from a group, specify 1 for the both.

@ Data input relative position (CINP)


When the key input numerical value is displayed at the cursor, this function displays it at -the :
position deviated in X-direction by the specified figure.
9999.999
-
Cursor

Al-51
APPENDIX 1 MACRO PROGRAM EXAMPLE

In this case, “5” should be set for CINT.

@ CXYF
Specify the direction of cursor movement within the group.
When CXYF = 0:

WhenCXYF = 1:

(4) Sample preparation of cursor data

X coordinate
01234 9 14 18 24 29 34 39
0 AAAAAAAAA
1 88 -99 cc -99 DO -99999

‘f
c 4
DO
1 -9999 -9999 -9999 -9999
0
2 -9999 -9999 -9999 -9999
0
3 -9999 -9999 -9999 -9999
F 4 -9999 -9999 -9999 -9999
5 -9999 -9999 -9999 -9999

a”9 6 -9999 -9999 -9999 -9999


t
e

14

The position of @’ “ above indicates the position where the cursor moves.
(Actually, the c&or is always displayed at one place.)
Cursor movement

Al-52
APPENDIX 1 MACRO PROGRAM EXAMPLE

(5) Cursor data

BBICC
CURSOR

71 0

I=
8 28

9 1

F
20 0

1 0 D
2 1
cursor

3 1

4 1

5 0

6 I-- 7

71 4

81 7

91 1
LMatrix
30
cursor

3.4 Explanation of Standard Routine Function

To use the routines (09501, 09502, 09503) with which the cursor position is associated among
the following routines, the cursor data corresponding to the screen selected at that time should be
selected. Specifically, set the following;

P-CODE variables
#lOO = Cursor control No. of screen being selected at present
#104 = Cursor pointer (Initial value 0)
#105 = Cursor subpointer (Initial value 0)

#IO4 and #105 values are automatically changed each time the cursor key is depressed.
On the screen with no cursor, set WOO to “0”

Al-53
APPENDIX 1 MACRO PROGRAM EXAMPLE

(1) DDPL 09501


@ Function
This function displays the input data variable (KDATA value) in the position deviated in the X-
direction by “CINT” from the cursor position.

@ Calling format
#I40 = f (F) : Total digits and digits under decimal point
#I41 = t (Z) : Reading zero
M98 P9501

f and z are the values commanded by G243.

@ Remark
When this routine is executed , the cursor display position advances by one.
#I40 are #14l values are saved.

(2) CDPL 09502


0 Function
This function displayed the cursor.
The cursor position is determined by MOO-#1 05 and #I OOOO-values.

@ Calling format
#140 = n
M98 P9502
n = 0: No cursor pointer changes.
1 : The cursor pointer is advanced by one, displaying the cursor.
2 : The cursor pointer is retracted by one, displaying the cursor.

@ Remark
After this routine is executed, the #140 value is saved.

(3) KEYIN 09503


@ Function
This function accepts key input of numerical data, executing the following processing with its value.
@Cursor key
1 : Moves the cursor forward by one.
r : Moves the cursor backward by one.
@Other than the cursor key
#8501 and #8503 values are saved.
#I 02(KCONT) -8501
#I 03(KDATA) 48503
@ Caliing format
M98 P9503

(4) VDPLX 09504


0 Function

Al-54
APPENDIX 1 MACRO PROGRAM EXAMPLE

To display a continuous variable value, this function deviates it in the X-direction from the
specified place on the CRT screen.
(Within one line)

0 Calling format
#14O=F (F)
#141 =z (2)

1
#142=X Display position on CRT
#143=Y
#144=V Variable No. (head)
#145=N No. of display
#146=E End code
#147=AX Deviation in the X-direction on
the CRT
M98 P9504

E : END code
The display ends when the data which coincides with the end code is reached even within
the number of displays.

0 Remark
After this routine is executed, #140 - #147 values are saved.

(5) VDPLY 09505


0 Function
To display a continuous variable value, this function deviates it in the Y-direction from the
specified place on the CRT screen.
(within one row)
@ Calling format
#14O=F
#141 =z
#142=X
#143=Y 1 Display position on CRT

#144=V Variables No. (head)


#145=N No. of displays
#146=E End code
#147= AY Deviation in Y-direction
on the CRT
M98 P9505

E : End code
The display ends when the data which coincides with the end code is reached even within
the number of displays.
@ Remark _
After this routine is executed, #140-#147 values are saved.

Al-55
APPENDIX 1 MACRO PROGRAM EXAMPLE

(6) DSPC09506
0 Function
This function clears the screen, including the soft key.
@ Calling format
M98 P9506
@ Remark
The soft key is not cleared with G202.

(7) VSET 09507


0 Function l

This function sets the specified data to a continuous variable area.


@ Calling format
#140 = V Variable No. (head number)
#141 = D Data to be set
#142 = N No. of variables
M98 P9507

Remark
After this routine is executed, #I 40 - #142 are saved.

VCOPY 09508
Function
This function copies the data in a continuous variable area to another area.

Calling format
#I40 = ADD& Address of original data
to be copied
#141= ADDRo Address of data to be
copied
#142=N No. of variables
M98 P9508

Remark
After this routine is executed, the #140 - #142 values are saved.

Al-56
APPENDEX 1 MACRO PROGRAM EXAMPLE

3.5 List for Source Program

00010 09501 ;
00020 IF [#lo0 EQ 0] GOT0 900 I'
00030 #145 = #[10000 + [#lOO - l] * 21 f
00040 IF [#145 EQ 0] GOT0 900 ;
00050 Xl45 = #104 * 8 + f145 ;
00060 IF [#[#145+7] EQ l] GOT0 10 :
00070 ((139 = FIX [#105 / #[f145 + 411 ;
00080 #148 = #lo5 - #139 * 1([#145 + 41 r'
00090 GOT0 20 ;
00100 NlO #148 = FIX [#IO5 / #I#145 + 511 ;
00110 #139 = 1105 - $148 * #[#145 + 51 r'
00120 N20 G243 F#140 Z#141 ;
00130 X[#[#145]+#[#145+2]*#148+#[#145+6]] Y[#[#145+1]+#[#145+3],*#139]
D#l03
00140 1147 = #140 ;
00150 #140 = 1 ;
00160 M98 P9502 ;
00170 x140 = #147 ;
00180 N900 M99 ;
00190 t
00200 r’
00210 t
00220
00230 ;

Al-57
APPENDEX 1 MACRO PROGRAM EXAMPLE

00010 09502 r’

00020 IF [#lo0 EQ 0] GOT0 900 ;


00030 1145 = #[10000 + [#100-l] * 21 ;
00040 IF [#145 EQ 0] GOT0 900 ;
00050 1145 = #104 * 8 + #14S r'
00060 #146 = #[#145 + 41 * #[#145+5] f
00070 #147 =#[lOOOl + [#100-l] * 21 ;
00080 IF [I140 EQ 0] GOT0 200 ;
00090 IF [#140 EQ 21 GOT0 100 ;
00100 #lOS = #lOS + 1 ;
00110 IF [#lo5 LT #146] GOT0 200 ;
00120 #105 = 0 ;
00130 #lo4 = #lo4 i-1 ;
00140 #lSS = #lSS + 8 ;
OOlSO IF [#lo4 LT #147] GOT0 200 ;
00160 $104 = 0 ;
00170 #145 = #[lOOOO + [#lo0 -11 * 21 + f104 * 8 r'
00180 GOT0 200 ;
00190 NlOO 1105 = #105 - 1 ;
00200 IF [#lo5 GE 0) GOT0 200 ;
00210 11104 = #104 - 1 ;
00220 IF [#lo4 GE 0] GOT0 120 I'
00230 #104 = #147 - 1 ;
00240 N120 #145 = #[lOOOO + [#lo0 -11 * 21 + #104 * 8 ;
00250 (1105 = #I1145 + 41 * #[#145 + 5) - 1 ;
00260 N200 IF [$ (((145 + 71 EQ l] GOT0 210 I'
00270 #139 = FIX [#105 / #[#145 + 431 ;
00280 #148 = #105 - 1139 * #[#145 + 41 ;
00290 GOT0 220 ;
00300 N210 #148 = FIX [#lo5 / #[#145 + S]] r'
00310 #139 = #105 - #148 * #[#145 + 51 ;
00320 N220 #8505 = 1 ;
00330 #8506 = #[#145] + #[$145 + 21 * #148 r'
00340 #8507 = #[#145 + l] + #[(cl45 + 31 * 8139 ;
00350 N900 M99 ;
00360 t
00370 t
00380 r’
00390 :
00400 t

00010 09503 ;
00020 #8502 = 1 ;
00030 #102 = #8501 ;

Al-58
APPENDEX 1 MACRO PROGRAM EXAMPLE

00040 1103 = #8503 I'


00050 #140 = 1 ;
00060 IF [#lo2 EQ 31 GOT0 10 I'
00070 IF [#lo2 NE 41 GOT0 20 ;
00080 #140 = 2 ;
00090 NlO M98 P9502 r'
00100 N20 M99 ;
00110 r'
00120 ;
00130 ;
00140 r'
00150 I'

00010 09504 I’

00020 6243 F#140 21141 r'


00030 #139 = 0 ;
00040 WHILE [#139 LT #145] DO 1 ;
00050 IF [#[#144 + #139] EQ #146] GOT0 90 r'
00060 X[#l42 + #147 * f139) Y#143 Di[#144 + 11391
00070 #139 = #139 + 1 ;
00080 END 1 ;
00090 N90 M99 ;
00100 :
00110
00120
00130
00140 ;

00010 09505 ;

00020 G243 F#l40 2#141 ;


00030 #139 = 0 ;
00040 WHILE [#139 LT #145] DO 1 ;
00050 IF [a[#144 + #139] EQ #146] GOT0 90 ;
00060 X1142 Y[/143 + 1147 * #139] D#[#l44 + #139] ;
00070 x139 = #139 + 1 ;
00080 END 1 r'
00090 N90 M99 ;
00100 :
00110 ;
00120 :
00130 :
00140 l
.

Al-59
APPENDEX 1 MACRO PROGRAM EXAMPLE

00010 09506 r'


00020 6243 X0 YO KS60 ;
00030 #8505 = 0 ;
00040 Xl Y16 K6 ;
00050 x9 K6 ;
00060 Xl7 K6 ;
00070 X25 K6 ;
00080 x33 K6 ;
00090 M99 r'
00100 t
00110 ;
00120
00130
00140

00010 09507 ;
00020 x139 = 0 ;
00030 WHILE [#139 LT #142] DO 1 ;
00040 #[$140 + 11391 = #141 ;
00050 #139 = 8139 + 1 ;
00060 END 1 ;
00070 M99 I'
00080 :
00090 ;
OOlbO
00110
00120 r’

00010 09508 r'


00020 #139 = 0 ;
00030 WHILE [#139 LT #142] DO 1 :
00040 I[#141 + 11391 = #[#140 + 11391 ;
00050 1139 = #139 + 1 ;
00060 END 1 ;
00070 M99 ;

Al-60
APPENDEX 1 MACRO PROGRAM EXAMPLE

3.6 Explanation of Program

00010 09501 ; Display of data in cursor position


00020 IF [#lo0 EQ 0] GOT0 900 ; #lOO:CursorcontrolNo.
00030 #145 = # flOOO0 + [ilO0 - l] * 21 ; #145: Cursor data head address
00040 IF [f145 EQ 0] GOT0 900 ;
Cursor pointer/display cursor address
00050 11145 = f104 * 8 + (1145 ; #'O4: calculation
00060 IF [# [#145+7] EQ 1) GOT0 10 ; Displaydirection?
00070 x139 = FIX [#lo5 / #[#145 + 411 ; When displaying the data in the
00080 #148 = 11105 - #139 * /[I145 + 4) ; X-direction
00090 GOT0 20 ;
00100 NlO #148 = FIX [#lo5 / #[#145 + 511 ; When dis laying the data
00110 #139 = 1105 - #148 * #[#145 + 51 r'
in the Y-cpirection

00120 N20 G243 F#140 Z#l41 ; Format setting for data display
00130 X[#[#l45]+#[#145+2]+#148+#[#14S+6]] Y[#[#l45+1]+#[#145+3]*#139]
D(1103
00140 #147 = 11140 I'
Stack #140. #140= 1 .
00150 #140 = 1 ; >
00160 M98 P9502 ; Cursor display subrutine .
00170 #140 = ((147 ; Return # 140 to this intial state.
00180 N900 M99 ;
00190 I'
00200 ;
00210 ;
00220 ;
00230 ;

Al-61
APPENDEX 1 MACRO PROGRAM EXAMPLE

00010 09502 ; Cursor display


00020 IF [#lOO EQ 0] GOT0 900 ;
00030 #145 = #[10000 + (#100-l] * 21 r’
00040 IF [#145 EQ 0) GOT~ 900 : #145: Cursor data head address
00050 #145 = 1104 * 8 + #145 ;
00060 1146 = #I#145 + 41 * #[#145+5] ; No. of displays in group
00070 #147 =t[lOOOl + [#100-l] * 21 ; No.ofcursorpointers
00080 IF [f140 EQ 0] GOT0 200 ; Nocursor pointer changes
00090 IF [#140 EQ 21 GOT0 100 ;
00100 ilO5 = #lo5 + 1 ; 1 cursorpointer advances
00110 IF [#lo5 LT 11461 GOT0 200 ;
00120 #lo5 = 0 ; # 1OSis pointer No. in group
When in the last
00130 #104 = #104 +l ;
Next group poinnter is reached
00140 x145 = #145 + 8 ;
\
00150 IF [#lo4 LT #147] GOT0 200 ; Return to the begining when coming to the
00160 #lOS = 0 r' cursorpointer group end
00170 (1145 = #[lOOOO + [#lo0 -11 * 21 + #lo4 * 8 ;
00180 GOT0 200 ;
00190 NlOO #lo5 = #lo5 - 1 ; 1 Cursor pointer moves backward
00200 IF [#lo5 GE 0] GOT0 200 ;
00210 #104 = #lo4 - 1 r'
00220 IF [#lo4 GE 0] GOT0 120 ;
00230 1104 = #147 - 1 ;
00240 N120 1145 = #[lOOOO + [#lo0 -11 * 21 + #lo4 * 8 ;
00250 #lo5 = #[#145 + 41 * #[j/l45 + 51 - 1 ;
00260 N200 IF [#[#145 + 7) EQ l] GOT0 210 ; &
When the cursor does not change.
00270 #139 = FIX [#lo5 / #[I145 + S]] ; 1 The cursor pointer moves in the X-
. 00280 #148 = #lo5 - $139 * #[A145 + 4) ; j direction in a gruop: #148: X
00290 GOT0 220 ; #149:Y
00300 N210 #148 = FIX [#lo5 / #[#145 + 5]] ; The cursor pointer moves in the Y-
00310 #139 = #105 - 1148 * #[#145 + 51 I' } direction in a group.
00320 N220 #a505 = 1 ; Cursor display ON
00330 08506 = #[#145] + #[#145 + 2] * #148 ; Cursorxposition
00340 #8507 = #[#145 + 11 + #[#145 + 31 * 01139 ; CursorYposition
00350 N900 M99 ;
00360 r’ #140=0 : No cursor pointer changes # 100 Cursor control 1 No.
00370 ; #140=1 : The cursor pointer moves
forward by one.
#lOl
00380 ; )(140=2 : The cursor pointer moves #102 Key input control data
backward by one.
00390 ; # 103 key input numerical data
00400 t #104 Cursor pointer
#IOS Cursor subpointer

00010 09503 ; Key input control


00020 #8502 = 1 ; Numericaldatainput
00030 f102 = #SSOl ; Key input variable read

Al-62
APPENDEX 1 MACRO PROGRAM EXAMPLE

00040 #103 = #8503 ; Numerical dataread


00050 #l4O = 1 ; Advancethecursor.
00060 IF [#lo2 EQ 31 GOT0 10 ; 3: For cursor J , advance the cursor pointer.
00070 IF [#lo2 NE 41 GOT0 20 ; 4:For cursor 7, reaturn the cursor pointer.
00080 #140 = 2 ; Cursor moves backward
00090 NlO M98 P9502 ; Cursordiaplsysub
00100 N20 M99 r'
00110 ;
00120 ;
00130 ;
00140 ;
00150 r'

00010 09504 r'One-line display of variable data (X axis direction)


00020 6243 F#140 z#l41 ; Display format setting
00030 #139 = 0 ; Counter
00040 WHILE [I139 LT #145] DO 1 ; #145inNo.ofdisplays.
00050 IF [#[f144 + #139] EQ 11461 GOT0 90 ;
00060 X1$142 + $147 * 11391 Y#143 D#[#l44 + 11391 ;
00070 11139 = 1139 + 1 ; #144 Head of variable No.
00080 END 1 ; #146 END code + If the display data is
the same as END code, the cursor
00090 N90 M99 ; RETURNSwith no display.
00100
00110 # 147 Deviation in X direction
00120 t
00130 :
00140 ;

00010 09505 ; One-row display of variable data (Y direction) Difference from 009504 is
00020 G243 F#140 2#141 ; Display format setting that #147 is the deviation in
Y direction
00030 1139 = 0 ;Counter
00040 WHILE [#139 LT #145] DO 1 ;
00050 IF [#[#144 +#139] EQ #146] GOT0 90 r'
00060 X#142 Y[#143 + $147 * #139] D$[#lSS + 11391 ;
00070 #139 = #139 +l ;
00080 END 1 ;
00090 N90 M99 ;
00100 t
1
00110 t

00120 r’
00130 :
00140 t

Al-63 .
APPENDEX 1 MACRO PROGRAM EXAMPLE

00010 09506 r’ Screen clear


00020 G243 X0 YO KS60 ; Blankof560value
00030 #8505 = 0 r’ Cursor off
00040 Xl Y16 K6 I'
00050 X9 K6 r' Leaving the “frame” of the soft
key, erase the other part.
00060 Xl7 K6 ; Erase the soft key
00070 X25 K6 ;
00080 X33 K6 :
00090 M99 ;
00100 ;
00110 ;
00120 ;
00130 ;
00140 f

00010 09507 I'Set data in continued data area.


00020 8139 = 0 ;
00030 WHILE [#139 LT #142] DO 1 ;
00040 #[#140 + #139] = 8141 ;
00050 #139 = #139 + 1 f
00060 END 1 r'
00070 M99 ;
00080 ;
00090 ;
00100 I'
00110 r'
00120 ;

00010 09508 ; Variable copy


00020 #139 = 0 ;
.00030 WHILE [#139 LT #142] DO 1 :
00040 #[I141 + #139] = #[#140 + 11391 ;
00050 #139 = 11139 + 1 ;
00060 END 1 r'
00070 M99 I'

Al-64
APPENDEX 1 MACRO PROGRAM EXAMPLE

4. SCREEN LAYOUT

X -axis

fI1 7?Ae;678Qln----
“.W_ .*w- VI .”
----- 30 3 132 33 34 35 36 37 38 39

Y 5

H 6
xi 7

’ 8

10

11
12345
12 NUM

13

14 NOT READY BUF AUTO

15
, * 1 ?

16

Al-65
APPENDIX 2 MACRO COMPLIER OPERATION

APPENDIX 2 MACRO COMPLIER OPERATION

1. SYSTEM P-G OPERATION


1.1 Special Note
Explanation is given of P-G operation.
First, special note on operation is described below.

(1) When coming to a deadlock, press [NL] key.


Press [NL] key several times.
The display returns to the initial screen.
Next, checking what should be operated, proceed with operation.
When “FDO =-” is displayed at the left lower part of the screen, [F2] or [F7] is ON.
At that time, when it is desired to return the display to the initial screen, turn [ F2 or [F7] OFF,
and key in NO lNLl .

(2) Remember to switch!


Do not leave F key ([ FO] - [ F7]) ON.
Before pressing R key, be sure to check F key ON/OFF.

(3) Numeric 1 and aiphabet I


Numeric 0 and alphabets 0, Q
Comma, and point.
Most of input errors result from these figures, characters and symbols.

(4) Do not forget the minus ( - ) symbol.

1.2 Basic Operation


1.2.1 MACRO complier loading

1.2.2 PMC writer connection (if required)

Connect PMC writer to CN2 or CN3 of P-G.


P-G operation is as follows.
(Return to) Initial Screen
“Rl”
Answer the inquiry on the screen with NO = 2 [NL]

1.3 MACRO Program input from Keyboard


(Return to) Initial Screen, [FO] - [ F7] OFF
0 8)
R2
NO = 1 [NL]
PROGRAM = IN [NL]

INPUT = 0 Program No. [NL]


(First register Program No. only)

A24
APPENDIX 2 MACRO COMPLIER OPERATION

INPUT = [NL] only


PROGRAM = 0 Program No. [NL]
(Previously input number)
EDIT = K-OLD [NL] ( _ Space key)

Line No. at the left lower part of the screen is from 00020 on.

(1) Input each line [NL].

(2) Before keying in [NLJ, if a key-in error is found, use BS/CAN keys to correct it.

(3) Note that program input ends for [NL] only.

(4) After one line [NL], if a key operation error is found, press the “CHG” key. (Check that F15
key lights up.)
Skip the cursor at the left upper part of the screen and move it to the place to be corrected,
using the CURSOR key.
0 “CHG” screen edit switching
(F15 key lights up)
0 “INS” insertion: the line is spaced out by a push on this key when the cursor is located in
Line No.
@ “DEL” deletion: the line is deleted by a push on this key when the cursor is located in Line
No.
@ “Rl ” Correction/cancellation: the current data is corrected and canceled on the screen.
The cursor is moved at the left upper part of the screen.
0 “R2” Page shift backward
“R3” Page shift forward

(5) After correction, press the “CHG” key once again.


(Check that F15 key goes off.)
The cursor returns to the left lower part of the screen. (The left lower screen indicates Line
No.) : so input data successively.

(6) When it is desired to space out a line, input space [NL].

(7) After keying in the last line, this operation ends by a push on [NL] only. “EDIT = ” is
displayed at the left lower part of the screen.

(8) Further, when it is desired to input the next program, press [NL] once again:
“PROGRAM = ” is displayed at the left lower part of the screen.
Operate this with IN [NL] .

(9) Press [NL] several times : the display returns to the initial screen.

A2-2
APPENDIX 2 MACRO COMPLIER OPERATION

1.4 MACRO Program Correction (Screen edit)


(Return to) Initial Screen [FO]-[F2] OFF
@#0
R2
NO= 1 [NL]

PROGRAM = 0 program No. [NL]


(Number to be corrected)
EDIT =

( 1) Screen Edit
l Press the “CHG” key. (Check that F15 key lights up)
Skip the cursor at the left upper part of the screen, and move it to the place to be corrected,
using the CURSOR key. After completion of correction, return the “CHG” key to the left lower
part of the screen again.

THG” Screen edit switching (F15 key ON)

11

INS
@I
Insertion: the line is spaced out by a push on this key when the cursor is located in Line
No.

” DEL” Deletion: the fine is deleted by a push on this key when the cursor is located in Line No.
(Do this most carefully.)

“RI” Correction/cancellation: the current data is corrected and canceled on that screen.
The cursor is moved at the left upper part of the screen.

“R2” Page shift backward

“R3” Page shift forward

l After correction, press the “CHG” key once again.


(Check that F15 key goes off.)
The cursor returns to the left lower part of the screen.
( “EDIT = ” is displayed at the left lower part of the screen.)

1.5 MACRO Program Correction (Command edit)

(Return to) Initial Screen [FO]-[F2] OFF


@’
R2”
NO= 1 [NL]

PROGRAM = 0 Program No. [NL] (Number to be corrected)


EDIT =

Command Edit
l Check that left lower part of the screen is “EDIT = “.

A2-3
APPENDIX 2 MACRO COMPLIER OPERATtON

l Check that the cursor is located at the left lower part of the screen.
l Replacement : Line No..Program one line [NC]
l Insertion : New Line No .-Program one line [NL]
l One-line
deletion : Line No. [NL]
l Plural deletion : Start Line No., End Line No. [ NL]
l Display .. I-Line No. [ NL]
l Line renewal : REN [NL]
.. MOVE (Start Line No., End Line No. &/Frequency [NL]
l COPY
MOVE - Frequency [NL]
l Substitute : A (Start Line No., End Line No.) - /Original character string/New character
string /All [NL] A - /Original character string/, /New character string/, /All [NL]
l Character search : After [NL] only L
F/Character string 1 [NL]

1.6 Output to Floppy Disk


(Return to) Initial Screen [F7] ON : [F5] ON as needed
#I (8
R2
NO = 1 [NL]
PROGRAM = OUT-ALL [NL]
or
OUT-O (Program No.) [NL]
FDO = (For first time)
OK-{;7NT),/Date{y}
@ File name (NL)
FDO =

@ File name (NL)


Upon completion, turn IF71 OFF, and IF51 OFF as needed.

, / Date ,

mt
” is omissible
. 71 files can be registered for INT and 175 files can be registered for I2 for the first time.
Consequently, 695 files can be registered for 17. (incremented by 104)
. In the file with same name, no substituting processing is carried out, so that no output is
possible.
The file name consists of up to 17 character, ‘I,” comma cannot be used.
A longer file name is preferable for easier identification.=
At input, File No. can be used for access.

A2-4
APPENDIX 2 MACRO COMPLIER OPERATION

1.7 Input to P-G from Floppy Disk

(Return to) Initial Screen only [F2] ON


ee I#
R2
NO = 1 [NL]
PROGRAM IN [NL]

FDO = OK u @ Fi’eNo.
name w
: File
Upon completion, turn [F2] OFF.

1.8 Floppy Disk Handling

(1) File name directory


(Return to) Initial Screen
Turn IFS] ON as needed.
w #I
R3
REQUEST = FD LIST - L, W-1

1 sector = 256 characters


Converted to No. of characters if the size is multiplied by 256.
Upon completion, turn [F5] OFF as needed.
08
__‘I is omissible
(2) File delete
(Return to) Initial Screen
” R3”

REQUEST = SCRATCH -{ !f}

FDO = OK [NL]
In error
FDO = NO [NL]

(3) File delete area open


(Return to) Initial Screen
” R3”
REQUEST = CONDENCE-

(4) File delete area open


(Return to) Initial Screen
” R3”

REQUEST

a @ New File name [NL]

A24
APPENDIX 2 MACRO COMPLIER OPERATION

(5) File attribute change


(Return to) Initial Screen
B8 me
R3
REQUEST = REMOVE [NL]

“A : automatically”
“M : Ask for each time”
FDl = (for first time)

FDl = OK-Output drive No.

A2-6
APPENDIX 3 DATA ON MACRO COMPILER

APPENDIX 3 DATA ON MACRO


No. Explanation
COMPILER
1. COMPLIER ERROR 015 The NC statement contains an error.

MESSAGES (SYSTEM P-G) 016 The macro statement ends with an


other code than EOB.
(1) Display of error messages
The error messages are displayed as 017 The equal sign of the macro statement
follows when an error occurs. cannot be found.

018 The nesting of DO exceeds 3 levels

L
+ ME000 + NO. = 0000-0000-0000

1 Block
number
019 The relational operator in the
conditional expression is not found.

020 No GOT0 after IF.


Sequence
number 021 The ‘1’ of the IF [<conditional
I Program expression >] is not found.
number
022 There is a code other than EOB after
Error message number
GOTOn.
If the program does not contain any sequence 023 There is a code than EOB after DOm.
number, the program number is not shown in
024 There is a code than EOB after ENDm.
the error message.
The program number, sequence number and 025 The END identification number does
block number are not displayed in error not correspond to that of DO.
messages with numbers greater than 100.
030 No END found for DO.

(2) Summary of error messages 031 No DO found after WHILE.

032 The ‘1’ of the WHILE [<conditional


No. Explanation
expression >] is not found.
001 The program number exceeds the
033 It is unclear whether the block is a NC
maximum registered number. This
statement or a macro statement.
number is 125 for the Series 0 MODEL
A macro executor and 400 for the 034 No DO found for END.
Series 0 MODEL B macro executor.
035 The program number in the directory
002 No program available. and actual number used in the
program do not correspond.
011 The block delete address includes a
decimal point. 036 No program number in the program
heading.
012 The block delete address is out of the
1 - 9 range 041 Nesting of brackets exceeds 5 levels.

013 The program has a program number 042 The ‘1’ of the # [<expression >] is not
other than the head of program. found.

014 The block has a sequence number 043 The ‘1’ of the [<expression >] is not y
other than the head of program. found.

A34
APPENDIX 3 DATA ON MACRO COMPILER

No. Explanation No. Explanation

044 The second ‘1’ of the ATAN 059 m of DOm or ENDm consists of more
[<expression >I/[ < expression >] is than 1 digit.
not found.
060 DOm or ENDm is out of the 1 - 3 range.
045 The ‘1’ of the ATAN
061 Other codes than numeric codes follow
[<expression>]/[<expression>] is
DO or END.
not found.
062 Other alphabetical string than
046 The first ‘1’ of the ATAN
control directive or function found.
[ < exptession >I/[ < expression >] is
not found. 063 Alphabetical string of more than 5
characters found.
047 The ‘1’ of the function [<expression >]
is not found. 064 No EOR at the end of the program.

048 The <expression > format contains an 065 Inappropriate code found in the
error. program.

049 The left part of <expression> of 070 Character string exceeds 255

the substitution statement contains an characters.


error. 071 Inner code consists of more than 4
050 The <expression> of the figures.

< address > [ < expression >], 072 Inner code is not in hexadecimal
< address > - [<expression >] or format.
GOT0 [<expression >] format
073 Non-displayable system code is
contains an error.
specified.
051 The numeral contains more than 8
074 Not end with ‘*)I for character string
figures.
starting with ‘(*‘.
052 Other codes than numeric codes follow
075 ‘(’ and ‘)’ hold characters that are not
the decimal point.
allowed.
053 The variable address of the macro
081 The transient variable area used by the
variable consists of more than 6 digits.
macro executer is not available. Too
054 No figure or ‘[’ following #. many addresses in the <expression >
055 The program number consists of more of 1 block of a NC statement.
than 4 figures. 082 The branch point for the GOT0
056 The sequence number contains more statement is too large. Add a
than 4 figures. parameter to set the branch point as 4
bytes or reduce the program size.
OS7 The ‘[’ of function [<expression>] is
not found. 083 The number of addresses contained in
1 block of the NC statement exceed<
058 The ‘[’ of IF [<expression>] or WHILE
50.
[<expression >] is not found.

A3-2
APPENDIX 3 DATA ON MACRO COMPILER

No. Explanation No. Explanation

084 The variable No. of the macro variable 113 An overflow error occurred while
has more than 6 digits. waiting for answer from the PMC
writer.
085 The variable No. of the macro variable
is negative. 114 Framing error occurred while waiting
for answer from the PMC writer.
086 The variable No. of the macro variable
contains a decimal point. 115 PMC writer is not READY or cable is not
connected.
087 More than 4 digits following the GOT0
statement. 116 Error occurred during transmittion to
the PMC writer.
088 The figures following the GOT0
statement contain a decimal point. 117 Parity error occurred while sending to
the PMC writer. II
091 The number of GOT0 statements in
one block directly pointing to a 118 ROM is not erased.
sequence number, exceeds the limit.
119 ROM write error occurred.
The limit is 100 for versions earlier
than 3.1 and 200 for versions earlier 120 ROM verify error occurred.

than 3.2. 12 1 ROM cassette is not installed.

092 The sequence number indicated as the 122 Other than order made macro ROM
branch point of the GOT0 statement cassette is installed.
is not found.
123 Wrong PMC writer version number.
093 The number of WHILE statements in
124 Error occurred in ROM writer.
one program exceeds the limit. The
limit is 100 for versions earlier than 3.1 125 The address or length instruction for
and 200 for versions earlier than 3.2. the ROM writer is uneven.

094 There are several sequence numbers 126 The written data exceeds the capacity
for the branch point of the GOT0 of the installed ROM module.
statement.
127 The ROM writer is not set up properly.
100 The macro executor is not read into
128 Address setting error of the ROM
memory.
writer.
101 The ROM cassette has caused a
129 Inverse installment of ROM.
memory overflow.
13 1 Memory write error.
102 256 KByte ROM cassette cannot be
used with this macro executor. 132 Memory read error.

111 A time error occurred while waiting for 140 File open parameter error.

answer from the PMC writer. 141 Floppy disk hard error.
c
112 A parity error occurred while waiting 142 File not found.
for answer from the PMC writer.
143 Wrong file format.

A393
APPENDIX 3 DATA ON MACRO COMPILER

2. COMPLIER ERROR CODES


(Series 0 MODEL B)
No. Explanation

144 Floppy disk already in use. Summary of error codes

145 File is protected. Error


Explanation
code
146 File name already in use.

147 Password error. 0201 The program number exceeds 200.

0202 No program available.


148 File size overflow.

149 File number overflow. 1001 The block delete address includes a
decimal point.
150 File closed error.
1002 The block delete address is not within
the 1 - 9 range.

1003 The program has a program number


other than the one in the heading.

1004 The block has a sequence number


other than the one in the heading.

1005 The NC statement contains an error.

1006 The macro statement ends with an


other code than EOB.

1007 Cannot find the equal sign of the


macro statement.

1008 The nesting of DO exceeds 3 levels.

1009 The relational operator in the


conditional expression is not found.

1OOA No GOT0 after IF.

1OOB The ‘1’ of the IF [<conditional


expression > is not found.

1 OOC There is another code than EOB after


GOTOn.

100D There is another code than EOB after


DOm.

1OOE There is another code than EOB after


ENDm.

1OOF The END identification number does


not correspond to that of DO.

1010 No END found for DO.

1011 No DO found after WHILE.

A3-4
APPENDIX 3 DATA ON MACRO COMPILER

Error Error
Explanation Explanation
code code

1012 The ‘1’ of the WHILE [<conditional 1401 The numeral contains more than 8
expression > is not found. digits.

1013 It is unclear whether the block is a NC 1402 Non-numeric codes follow the
statement or a macro statement. decimal point.

1014 No DO found for END. 1403 The variable address of the macro
variable consists of more than 6
1015 The program number in the directory
digits.
and actual number used in the
program do not correspond. 1404 No figure or ‘[I following #.

1016 No program number in the program 1405 The program number consists of
heading. more than 4 digits.

1201 Nesting of brackets exceeds 5 levels. 1406 The sequence number contains more
than 4 digits.
1202 The ‘1’ of the # [<expression >] is not
found. 1407 The ‘[’ of function [<expression >] is
not found.
1203 The ‘1’ of the [<expression >] is not
found. 1408 The ‘[’ of IF [<expression>] or WHILE
[<expression >] is not found.
1204 The second ‘1’ of the ATAN
[ < expression >I/[ < expression >] is 1409 DOm or ENDm consists of more than
not found. 1 digits.

1205 The ‘1’ of the ATAN 140A DOm or ENDm is out of the 1 - 3
[<expression >I/[ < expression >] is range.
not found.
140B Non-numeric codes follow DO or
1206 The first ‘1’ of the ATAN END.
[<expression >)/[ < expression >] is
140C An alphabetical string that was not
not found.
the control directive or function was
1207 The ‘1’ of the function found.
[<expression >] is not found.
140D Alphabetical string of more than 5
1208 The <expression > format contains characters found.
an error.
140E No EOR at the end of the program.
1209 The left part of <expression > of
140F Inappropriate code found in the
the substitution statement contains
program.
an error.
1410 Character string exceeds 255
120A The <expression> of the
characters.
<address>[<expression>],
<address> - [<expression >] or 1411 Inner code consists of more than 4 ‘-

GOT0 [<expression >] format digits.

contains an error.

A3-5
APPENDIX 3 DATA ON MACRO COMPILER

Error
Explanation
code

1412 Inner code is not in hexadecimal


format.

1413 Non-displayable system code is


specified.

1414 Not end with I*)’ for character string


starting with ‘(*I.
I

1415 ‘(’ and ‘)’ hold characters that are not


allowed.
.

1601 The transient variable area used by


the macro executor is not available.
Too many addresses in the
<expression> of 1 block of a NC
statement.

1602 The branch point for the GOT0


statement to is too large. Add a
parameter to set the branch point as
4 bytes or reduce the program
length.

1603 The number of addresses contained


in 1 block of the NC statement
exceeds 50.
.

1604 The variable address of the macro


variable has more than 6 digits.

1605 The variable address of the macro


variable is negative.

1606 The variable address of the macro


variable contains a decimal point.

1607 More than 4 digits follow the GOT0


statement.

1608 The figures that follow the COT0


statement contain a decimal point.

1681 The number of GOT0 statements in


one block directly pointing to a
sequence number exceeds 100.

1682 The sequence number indicated as


the branch point of the GOT0
statement is not found.

A3-6
APPENDIX 3 DATA ON MACRO COMPILER

3. COMPILE PARAMETERS

LO6 = 1 : Always specify 1.


RIM =l: Data is output to the 1 M-byte ROM cassette.
= 0 : R512 is referenced.
R512 = 1 : Data is output to the 512K-byte ROM cassette.
= 0 : R256 is referenced.
R256 = 1 : Data is output to the 256K-byte ROM cassette.
= 0’ R128 is referenced.
R128 = 1 I Data is output to the f28K-byte ROM cassette.
= 0 : Data is output to the 64K-byte ROM cassette.
VRFY = 1 : The ROM is checked when the data is output to it.
= 0 .. The ROM is not checked when the data is output to it.

7 6 5 4 3 2 1 0

SEQN = 1 : When data is output to the ROM, sequence numbers are output to the P-CODE
program.
= 0 : When data is output to the ROM, sequence numbers are not output to the P-CODE
program.

(Note) When SEQN is set to 0, the P-CODE program requires a small amount of space and can
be executed at high speed. However, this cannot be specified in the following cases: When
GOT0 is specified by a variable in the P-CODE program and when a program contains M99 and
the number of the sequence (P) to which it is to be returned. (If an attempt is made to set SEQN
to 0 in either of these cases, a compilation error occurs.)

Examples) GOT0 #I 01;


M99 PlOO;

7 6 5 4 3 2 1 0

11 EXTl PWSR DAUX XDIL EVF ACL2 ACLl TCAL l

e 1
TCAL = 0 : Makes invalid the sub-program call with T code
= 1 : Makes effective the sub-program call with T code
ACLl = 0 : Makes invalid call by the specific code
= 1 : Makes effective call by the specific code (09004/#146)
ACL2 = 0 : Makes invalid call by the specific code
= 1 : Makes effective call by the specific code (09005/#147) c
EVF = 0 : Extension P-CODE variable #20000 is the floating decimal point format
= 1 : Extension P-CODE variable #20000 is the fixed decimal format
XDIL = 0 : Axis interlock function invalid

A3-7
APPENDIX 3 DATA ON MACRO COMPILER

= 1 : Axis interlock function valid


DAUX = 0 : Does not make the AUX screen appear at power on
= 1 : Makes AUX screen appear at power on
PWSR = 0 : P CODE work number search function invalid
= 1 : P CODE work number search valid
EXTl = 0: Extension functions invalid
= 1: Extension functions valid (RS-232-C control, NC program access)

(Note) When EXTl = 1, part program memory reduces by 1.22 m (when part program memory
capacity is 80 m or less).

7 6 5 4 3 2 1 0
I

PTCR KY20 FILM Cl40 HRGR EXV O N M S K

ONMSK= 0 : The 0 and N numbers are displayed on the CUSTOM screen.


= 1 : The 0 and N numbers are not displayed on the CUSTOM screen. ’ .
E X V = 0 : Expanded P-CODE variable #20000 is valid.
= 1 : Expanded P-CODE variable #20000 is invalid.
HRGR = 0 : Standard mode graphic display
= 1 : High resolution graphic mode display (set to “1 n usually)
C14D = 1 : 14” CRT display
= 0’ 9” CRT display
FILM = 1 I Program file names are not displayed on the menu or macro screen.
= 0 : Program file names are displayed on the menu and macro screens.
KY20 = 0 : Not + 20 to #8501 with decimal point input by key input variables
= 1 : + 20 to #8501 with decimal input by key input variables
PTCR = 0 : Does not output “CR” code twice in P-CODE variable outputting
= 1: Output “CR” code twice in P-CODE variable outputting

7 6 5 4 3 2 1 0
I
.
CUTLG NOP B HRGC IMG sp
- G- c SP - G -B

SP-G -B. SP G C

00 : standard G code system


01 : G code system B
10: G code system C
11 : G code system C
IMG = 0: FSO-T type (Special G code)
= 1 : FSO-G type (Special G code)
NOP-B= 0 : When no other address is specified in a block that calls a subprogram by a T or M
code, the block is executed.
= 1 : The block is not executed.
HRGC = 0 : 9” high resolusion monochrome CRT, standard
= 1 : 9” high resolution monochrome CRT, brightness modulation mode setting (paint)
CUTLG = 0 : Does not count cutting distance
= 1 : Count cutting distance

A3-8
APPENDIX 3 DATA ON MACRO COMPILER

p-j , :cc 6 5 4 3 * ’ O AX4CL AX3CL Ax2CL AxlCL

AXlCL = 0 : Subprogram call by the 1st address is invalid


= 1 : Subprogram call by the 1st address is valid
AX2CL = 0 : Subprogram call by the 2nd address is invalid
= 1 : Subprogram call by the 2nd address is valid
AX3CL = 0 : Subprogram call by the 3rd address is invalid
= 1 : Subprogram call by the 3rd address is valid
AX4CL = 0 : Subprogram call by the 4th address is invalid
= 1 : Subprogram call by the 4th address is valid
TMACC = 0 : Macro call by T code is invalid
= 1 : Macro call by T code is valid

190061 7 6 5 4 3 * ,:yc T Ol8C ’


OIOC = 0 : Standard Ul:G54/G55 and UO:F541F55 are used for UI/UO(#lOOO-#1132) of
execution macro/ conversational macro.
= 1 : UI:G82/G83 and UO:F84/F85 are used for Ul/lJO(#lOOO-#ll32) of execution macro/
conversational macro.
KEYC = 0 : When KEY switch = 0, completion code #8529 = 254 in an ac*cess to NC program
= 3 : KEY switch is not cheched in an access to NC program

A3-9
APPENDIX 3 DATA ON MACRO COMPILER

M code that calls sub-program 09001

,
M code that calls sub-program 09002

f
M code that calls sub-program 09003

G code that calls custom macro 09010


0
0
0
G code that calls custom macro 09019

M code that calls sub-program 09020

M code that calls sub-program 09029

M code that calls user program


.
,
G code that to cancel the modal call

f
(90351 I
M code calls sub-program 09001

M code calls sub-program 09002

Parameters 9035 and 9036 specify the bit signal of the internal PMC relay (R area) that determines
the control mode of the interlock function for a single axis direction.

Signal number (0 to 999): Specifies the number of the internal PMC relay (R area).
Signal position (0 to 7): Specifies the bit position of the signal.

Example) When parameters 9035 and 9036 are set to 900 and 7 respectively

The interlock function for a single axial direction is validated when the internal PMC relay
(R900, #7) is set to 1 in the JOG or HNDL mode.

A34 0
APPENDIX 3 DATA ON MACRO COMPILER

Used number of (l/l 00) of conversational macro exclusive variable


.
.
,
Conversational macro 8xeclusion program at the time of power supply input (AUX screen)
4

Auxility macro execution program number

Conversational macro execution program number at the time of power on (MENU screen)

Conversational macro execution program number at th8 tin18 of power on (MACRO screen)
l

pz-j M code call by area specification, lower limit M code

M code call by area specification, upper limit M code

.
Used number of extension conversational macro variables

Starting G code in G code calls of ,range specification

.
Number of G codes in G code calls of ,range specification

Starting 0 number in G code calls of ,range specification

A34 1
APPENDIX 3 DATA ON MACRO COMPILER

4. EXECUTER PARAMETER

7 6 5 4 3 2 1 0
11 - L2RN
I

MKG RSTC EXSP TSTP NDSP SQND

SQND = 1 : Displays program number of recorded program and sequence number during
execution of a recorded program.
= 0 : Displays program number and sequence number of called user program during
execution of a recorded program.
NDSP = 1 : Displays variables for P-CODE program.
=o* Does not display variables for P-CODE program.
TSTP = 1 I Stops execution of conversational macro program. ("lg8 is set by break function
automatically)
= 0 : Execute the conversational macro program.
EXSP = 1 : Execute macro statement till the next NC statement has come with feed hold, during
macro statement execution at execution level.
= 0: Stop if feed hold acts, during macro statement execution at execution level.
RSTC = 1 : Common variables #l 00-#149 are cleared to < vacant) if NC is reset.
= 0: Common variables #l 00-#149 do not clear to < vacant) if NC is reset.
MKG : Be sure to set to 0.
L2RN = 1 : Does not display conversational / auxiliary macro and screen during execution macro
operation.
= 0: Display conversational / auxiliary macro and screen during execution macro
operation.

[YG-1 Conversational macro variable number from which the display of


variables is to be started

,
Conversational macro break program number

Conversational macro break sequence number

A34 2
APPENDIX 3 DATA ON MACRO COMPILER

The following is an expfanation of the supplementary P/S error codes that may occur at the time of
execution of P/CODE program.

Code Explanation
110 The absolute value of the data of the fixed decimal point display exceeds the
allowable range.
111 The index of the data of the floating decimal point exceeds the allowable
range.
112 The divisor is 0.
115 Pointing to the value of an undefined variable address.
116 The left part of the substitution statement consists of an illegal variable.
The SQRT parameter is a negative value, the BCD parameter is a negative
value or the BIN parameter contains values others than 0 - 9.

A391 3
APPENDIX 3 DATA ON MACRO COMPILER

5. ARGUMENTTRANSFER
It is possible to specify parameters for macro calls that can be referred to as local variables by the
P-CODE program. In the parameter specification method for the custom macro of the custom
macro B type, the parameter specification 1 and parameter specification 2 can be specified
separately for mixed in one label.
Signs, decimal points, and other symbols not related to the address can be used in the parameters.

Figure 2.5.3 (a) Argument specification 1 for P- Figure 5(6) Argument specification 2 for P-
CODE program call CODE program call
Address of argument Address of argument
Local variable No. Local variable No.
specification 1 specification 2

A I1 A # 1

B #2 6 R2

C #3
C ‘X 3
I #4
I1 t4
J #5
Jr #5
K #6
Kl X 6
D #7
. l
0
l

E #8 l .
. .
F #9
110 # 31
t-l # 11
JlO R 32
M # 13
KlO # 33
Q # 17

R # 18

S # 19

T # 20

u # 21

w # 22

W # 23

X # 24

Y # 25

z # 26

A3-14
APPENDIX 3 DATA ON MACRO COMPILER

6 l SUMMARY OF SYSTEM VARIABLES


(1) Series O-MB

Tool compensation Position data Parameter instructions


#2001 Tool compensation #SO01 X. Block end position m
VajUe 1 #SO02 Y . d A A #1
sr2002 9 4 2 #5003 2. 4 B B #2
s I #SO04 4. * C C #3
kr2003 I 9 * 200 #SO21 X. Machine coordinates I I 1 #4
#SO22 Y . 4 3 J 1 #5
Work offset #SO23 2. r) K Kl #6
#SO24 4 . + 0 I 2 #7
n2500 X. External work OFFSET #SO25 5 . e E 3 2 #8
#2501 G54 * 4 4 F K2 #9
At5026 6 .
I I
#SO41 X. Work coordinates I 3 MO
rV2506 G59 4 ’ #SO42 Y . r) H #ll
3 3
R2600 Y. External work OFFSET +
#SO43 2. K3 Rrl2
U2601 G54 + @ 1) I 4
#SO44 4 . M #13
5 I
#SO45 5 . 4 J 4 #14
#2606 G59 9 9 * K4
#SO46 6 . #15
#2700 2. External work OFFSET
#2701
#SO61 X. Skip signal position I i5 #16
G54 9 4 4 #17
#SO62 Y . Q J5
I I
#SO63 2. 4 R K5 Ul8
#2706 es9 9 + +
#SO64 4 . S I 6 #19
#2800 4. External work OFFSET #5081 X. Tool compensation value T n20
3 6
#2801 G54 9 4 #SO82 Y . 4 #21
U K6
I I
#SO83 2. & V I 7 #22
#2806 G59 * + #5101 X. Servo variation value W J 7 #23
#5102 Y . + X K7 U24
G code #5103 2. 4 Y 1 8 #25
#5104 4 . * z J 8 #26
#4001 Goo, 01, 02, 03, 33
#4002 G17,18,19 K8 #27
a4003 G9o, 91 Control variables I 9 #28
#4004 l I I
#3000 Macro ALARM n < 99
#4005 G94,95 K 10 #33
#3001 Clock (msec)
MOO6 G20, 21 #3002 Clock (Hour)
#4007 G40,41,42 Common variables
#3003 Single block
#4008 G43,44,49 #3004 Feed hold #lOO
MOO9 G73, 74,76,80 - 89 #3005 Setting #lOl
#4010 G98,99 #3011 Clock (mm dd yy) I
#4011 G50.51 #3012 Clock (hour minute second) #149
#4012 G65,66,67 #3901 Number of processed parts c l
#4013 * Common variables
#3902 Number of required parts
#4014 G54 - 59 (Maintenance type)
#4015 G61 - 64 #3003
MO16 G68.69
#4017
I
+ tl I SBK FIN
0 : No control
x : Control
#4022 W : Waiting for
*.. Reserved auxiliary function Data input
end signal
Code
#4102 Bcode - #3004
#4109 Fcode n FH OR ES
#4111 Hcode -
#4113 Mcode 0 0 0 0 FH : Feed hold
#4114 Sequence Number 1 X 0 0 OR : Overwrite
#4115 Program Number 2 0 X 0 ES : Exact stop Data output
#4119 Scode 3 X X 0 check
#4120 Tcode 4 0 0 X
5 X 0 X
6 0 X X
7 X X X
-

A34 5
APPENDIX 3 DATA ON MACRO COMPILER

(2)1Series 0-TB

Toot compensation quantity Position data Parameter instructions


#2001 / 2701 X. Offset 1 #5001 X. Block end position rye
I I I #SO02 2. e A A ryl
#2032 I2732 * 32 #5003 3 . d B B #2
#5004 4 . + C C #3
#5021 X. Machine coordinates I I 1 #4
#5022 2. 4 3 J 1 #5
#5023 3 . 1) K Kl #6
a2201 / 2901 Tool nose #5024 4. d 0 I 2 R?
compensation #5025 5 . & E J 2 n8
value #5026 6 . * F K2 rv9
3 I I #5041 X. Work coordinates I 3 #lo
#2232 / 2 9 3 2 4 6 #5042 2. & H J 3 #ll
. #5043 3 . + K3 612
#2301 Hypothetical cutter tip T %5044 4 . + M I 4 #13
I postion #5045 5 . 4 3 4 #14
#2332 I #5046 6 . 4 K4 #15
I) 4 #SO61 X. Skip signal position I s #16
#5062 2. 4 Q J 5 #17
#2401 Y. Toot position OFFSET I)
#5063 3 . R KS #18
I #5064 4. 4 S I 6 #19
I I
#5081 X. Tool compensation value T J 6 #20
#2432 + * 32 I #5082 2. r) U K6 #21
l left : Wear compensation #5101 X. Servo variation value V I 7 #22
#5102 2. 4 W J 7 #23
right : Geometry compensation *
#5103 3 . X K7 #24
#5104 4. * Y I 8 #25
Work coordinates shift quantity f J 8 #26
K8 #27
#2501 X. Work coordinate Control variables I 9 #28
#2601 Y. Work coordinate r I I
& #3000 Macro ALARM n< 99
K 10 #33
#3001 Clock (msec)
G code (G code system A) - #3002 Clock (hour)
Common variables
#4001 Goo - 03,32,34,90 #3003 Single block
#4002 G96,97 #3004 Feed hotd #loo
#4003 I #3005 Setting #lOl
#4004 G68,69 #3011 Clock (mm dd yy) 5
#4005 G98,99 #3012 Clock (hour minute second) #149
#4006 G20,21 #3901 Number of processed parts
#4007 G40,41,42 #3902 Number of required parts Common variables
#4008 G25,26 (Maintenance type)
#4009 G22,23
#4010 G80 - 89
#4011 L
#4012 G66,67
#4013 +
#4014 + function end signal Data input
I I
#4021 +
I

*: Reserved
IR ES
Code
FH : Feed hold
OR : Overwrite
ES : Exact stop Data output
Sequence number check

l-l I
5 x 0 x
6 0 X X
7 x x x

A3-16
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

APPENDIX 4 SERIES 0 MACRO COMPILER/MACRO EXECUTER WITH


GRAPHIC CONVERSATION
1. OUTLINE
Registration and execution using a macro cassette instead of the custom macro prepared by the
machine tool manufacturer is now possible with the NC devices listed below

(1) FANUC Series 0-MF

(2) FANUC Series O-MC + “Graphic Conversation for machining centers”

(3) FANUC Series 0-TF

(4) FANUC Series 0-K + “Graphic Conversation for 2-axis lathes”

When using any of the above-listed systems, the Graphic Conversation and the user’s program
prepared by the machine tool manufacturer are both stored in the macro cassette as shown in the
figure below, thereby allowing both of these functions to be used with the same device.

NC device Macro cassette


FSO-TF or
FSO-TC or
FSO-MF or
FSO-MC

However, the Graphic Conversation for the FSO-TFffSO-TC is designed for 2-axis lathes, and that
for FSO-MF/FSO-MC is for machining centers.
The display screen and operating processes related to conversational programming cannot be
changed by the user’s program prepared by the machine tool manufacturer.

In order to store the user’s program prepared by the machine tool manufacturer and the Graphic
Conversation in the same macro cassette, the same procedure as making a macro cassette is
performed by compiling the standard format macro-executer program and user’s program.
However, either the P-G Mark-II or P-G Mate is required, and the dedicated macro executer floppy
disk must be used. Specific details are described hereinafter.

2. EQUIPMENT NEEDED FOR COMPILING


In order to produce the ROM for the macro cassette in which both the user’s program (custom
macro) and the Graphic Conversation are to be stored, either the FANUC SYSTEM P-G Mark II or
the FANUC SYSTEM P-G Mate are required.
In addition, a dedicated macro compiler system floppy disk is also needed. As the specific system
floppy disk to be used depends on the language appearing in the conversational programming
displays and corresponding CRT, select the appropriate floppy disk from the table below.

A4-1
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

Table 1) Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER) with
Graphic Conversation
(Related to Graphic Conversation for 2-axis lathes)

NC P-G Number of
Name of function
model model floppy disK File name

FAPT MACRO COMPILER (MACRO EXECUTER) A08B-O035-J54280A80


9” High resolution monochrome CRT 0-TF, 0A80, EXCl/**
English, Japanese O-TF, 0A80, EXC2/-
O-TF, CAP, PROW+*
L
FAPT MACRO COMPiLER (MACRO EXECUTER) A086-0035-J542rYOA81
9* High resolution monochrome CRT 0-TF, OA81, EXCW*
German, French O-TF, 0A81, EXCZI’@*
0-TF, CAP, PROW**
P-G Mark- II
FAPT MACRO COMPILER (MACRO EXECUTER) A08800035-J542#OA82
9” High resolution monochrome CRT 0-TF, OA82, EXCl/**
Italian, Spanish O-TF, 0A82, EXCZ/**
O-TF, CAP, PROG/**
FAPT MACRO COMPILER (MACRO EXECUTER) AO88-0035-J542#OA83
9” High resolution monochrome CRT O-TF, 0A83, EXCV-
Chinese, Korean 0-TF, 0A83, EXCZ/**
FSO-TF
0-TF, CAP, PROG/* *
or
FAPT MACRO COMPILER (MACRO EXECUTER) A088000360J542 #OA80
FSO-TC 9” High resolution monochrome CRT O-TF, 0A80, EXCl/**
English, Japanese 0-TF, 0A80, EXC2/**
O-TF, CAP, PROGW
FAPT MACRO COMPILER (MACRO EXECUTER) A08B-O036-J542#OA81
9” High resolution monochrome CRT 0-TF, OA81, EXCl/**
German, French 0-TF, OA8 1, EXCZ/* *
0-TF, CAP, PROGW
P-G Mate
FAPT MACRO COMPILER (MACRO EXECUTER) A08B-00360J542#OA82
9” High resolution monochrome CRT 0-TF, 0A82, EXCl/**
Italian, Spanish O-TF, 0A82, EXCZ/**
O-TF, CAP, PROG/**
FAPT MACRO COMPILER (MACRO EXECUTER) A088000360J542#OA83
9” High resolution monochrome CRT O-TF, OA83, EXCl/**
Chinese, Korean O-TF, 0A83, EXCZ/**
0-TF, CAP, PROG/**

Note) The I** at the end of the file name in the table indicates the version number of that
system’s software. As differences exist depending on the version number, at the time of actual
use, check the file name in the floppy disc and input the appended number.

A4-2
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

Table 2) Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER) with
Graphic Conversation
(Related to Graphic Conversation for machining centers)

NC P-G Number of
Name of function
model model floppy disK File name
FAPT MACRO COMPILER (MACRO EXECUTER) A080-0035-J543AOA85
9” High resolution monochrome CRT 0-MF, OA85, EXCl/**
English, Japanese, German, French, Italian, 0-MF, OA85, EXC2/**
Spanish 0-MF, CAP, PROW*
FAPT MACRO COMPILER (MACRO EXECUTER) A08B-Q035-J543AcOA86
9” High resoiution monochrome CRT O-MF, OA86, EXCW+
German, French, (Japanese, English) 0-MF, OA86, EXCZl**
0-MF, CAP, PROGFe*
P-G Mark-II ’ FAPT MACRO COMPILER (MACRO EXECUTER) A08800035-J543ROA87
9” High resolution monochrome CRT O-MF, 0A87, EXCl/**
LI.
Italian, Spanish, German, French, Italian, 0-MF, 0A87, EXCZ/**
Spanish 0-MF, CAP, PROW** ,_
L
FAPT MACRO COMPILER (MACRO EXECUTER) A08800035-J543#OA88
9” High resolution monochrome CRT 0-MF, 0A88, EXCW*
Chinese, Korean, (Japanese, English) 0-MF, 0A88, EXCZ/rt+
FSO-MF
0-MF, CAP, PROGI+*
.
Of
FAPT MACRO COMPILER (MACRO EXECUTER) A08B-O036-J543ROA85
FSO-MC 9” High resolution monochrome CRT 0-MF, OA85, EXCl/**
English, Japanese, German, French, Italian, O-MF, OA85, EXC2I**
Spanish 0-MF, CAP, PROW**
FAPT MACRO COMPILER (MACRO EXECUTER) A08800036-J543#OA86
9” High resolution monochrome CRT 0-MF, 0A86, EXCl/*+
Chinese, Korean, (Japanese, English) 0-MF, 0A86, EXC2/**
0-MF, CAP, PROG/**
P-G Mate ’ FAPT MACRO COMPILER (MACRO EXECUTER)
A088000360J543#OA87
9” High resolution monochrome CRT 0-MF, 0A87, EXCl/**
English, Japanese, German, French, Italian, 0-MF, OA87, EXCZ/**
Spanish 0-MF, CAP, PROG/**
FAPT MACRO COMPILER (MACRO EXECUTER) A08800036-J543#OA88
9” High resolution monochrome CRT 0-MF, OA88, EXCl/**
Chinese, Korean, (Japanese, English) 0-MF, OA88, EXC2/**
0-MF, CAP, PROG/**

Note) The symbol I** appearing at the end of the file name in the table indicates the version
number of the system software. As differences exist depending on the version, when putting
these to actual use, check the file name in the floppy disk, then input the attached number.
In addition to the above, the following development devices or software are required.

(1) Macro compiler system floppy disk


P-G Mark-II : A08B-035J540 Version 6.1 and after
P-G Mate : A08B-036.J540 Version 6.1 and after
(2) PMC writer : Al 3B-01260BOO2 .
(3) Adapter : A02B-00830 114
(4) Macro cassette (having a memory capacity of 512 Kbyte)
: A02B-0098-Cl17

A4-3
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

3. COMPILING PROCEDURE
USING SYSTEM P-G
(1) Outline
Graphic Conversation consists of a system section and a dedicated custom macro section.
The user’s program is compiled with this dedicated custom macro section, then stored in the
macro cassette.
r ----------f Data floppy disk
i Conversational :
I programming I Macro cassette
SYSTEM P-G Mark II /Mate
i system i

(2) Connection of devices


Connect the PMC writer to CN2 or CN3 of P-G. In general, connect CNl to PPR.

CN2.3
-
-
SYSTEM P-G
-

I
c
4
- -
PMC Series 0 - ROM
- CASSETTE
WRITER MACRO
- MODELD - ADAPTER -
,

(3) P-G Power Supply ON


Switch the P-G power supply ON.

(4) System loading


0 Insert the FAPT MACRO COMPILER system floppy disk into the disc drive (either one can be
used).
@ Depress the [LOAD] button on the upper left of the keyboard for several seconds.
@ Loading is ended when the menu is displayed.

(5) Input of macro executer 1 having conversational programming function

A494
APPENDIX 4 Series.0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

0 Press the R3 key in the initial screen.


0 Key in ‘MEXEC IN < NL) ’ from ‘REQUEST = ‘.
0 After the message “Set FD (DATA) and key in ‘OK’ or ‘NO”’ is displayed, insert the floppy disc
containing macro compiler having conversational programming function into disk drive 0, then
key in ‘OK @ ***. -*. EXCl/** < NL > ‘.

However, as ‘OK @ ***.**+.EXC1/** < NL >’ is different depending on the macro executer used,
refer to the Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECU-TER) with
Graphic Conversation in Section 2, then input the file name of the macro executer to be used.
Example)
The file name when using the FSO-TF 9” monochrome high resolution CRT, English,
Japanese version is “0-TF. 0A80. EXCl 107”.
The file name when using the FSO-MF 9” monochrome high resolution CRT, English,
Japanese, German, French, Italian, Spanish version is “0-MF.0A85.EXC1/02”.
Completion of the above-described procedure ends input of macro executer 1 having Graphic
Conversation.
The display returns to the initial screen when < NL) is pressed once.

(6) Input of Graphic Conversation custom macro program and user’s program.
0 Press the R2 key in the initial screen.
@ With the F2 key in ON status, key in ‘3 < NL > ’ from ‘NO. = ‘.
@ After the message “Set FD (DATA) and key in ‘OK’ or ‘NO”’ is displayed, insert the floppy disc
containing macro executer having Graphic Conversation into disk drive 0, then key in ‘OK
@****.CAP.PROG / ** < NL) ‘.

However, as ****.CAP.PROG / ** is different depending on the macro executer used, refer to the
Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER) with Graphic
Conversation in Section 2, then input the file name of the macro executer to be used.

Example)
The file name when using the FSO-TF 9” monochrome high resolution CRT, English,
Japanese version is “O-TF.CAP.PROG/ 07”.
The file name when using the FSO-MF 9” monochrome high resolution CRT, English,
Japanese, German, French, Italian, Spanish version is “0-MF.CAP.PROG/02”.

In the case when the program is not completely input to internal memory, external extension is
performed. When a message instructing that the floppy disk be set is displayed, insert a blank
data floppy disk into disk drive 1, then key in ‘OK < NL ) ‘. This allows input to continue. Do not
remove the floppy disk from disk drive 1 during program editing or compiling.

When all the dedicated custom macro program input has ended, ‘NO. = ’ is displayed.
Therefore, if ‘3 < NL )’ is keyed in, the same message as in step 3 will be displayed. After
inserting the floppy disk containing the user’s program into disk drive 0, key in ‘ OK@ file
<NL>‘. Specify the file name stored in the user’s program.

When all the custom macro program input has ended, ‘NO. = ’ is displayed. Pressing < NL> .
twice will return the display to the intial screen.

Setting compiling parameters


Press the $31 key in the initial screen.

A4-5
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

@ Key in ‘1 <NL>’ from ‘NO. =‘.


@ If the <CHG) key is pressed, screen editer will begin, hence the necessary parameters must
be set.
@ Setting parameters for FSO-TFTTC.
Parameter
number Setting data

8000 00000000
bit 0 = 1: The program of the block containing M99 ends
= 0: The program of the block containing M99 does not end
(se sure to set 0)
bit 1 = 1: The program of the block containing MO2 ends
= 0: The program of the block containing M99 does not end
(Be sure to set 0)
bit 2 = 1: The program of the block containing M30 ends
= 0: The program of the block containing M30 does not end
(Be sure to set 0)
8010 00000001
bit 0 = 1: Corresponds to nacro executer having
Graphic Conversation
= 0: Corresponds to the standard macro executer
(Be sure to set 1)
8011 0-TF, ****. EXC2/**
Specifies the file name of macro executer 2.
However, as ‘O-TF.****.EXC2/+* < NL ) ’ is different depending on the macro executer used,
refer to the Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER)
with Graphic Conversation in Section 2, then input the file name of the macro executer to be
used.
Example)
The file name when using the FSO-TF 9” monochrome high resolution CRT, English,
Japanese version is “0-TF.OA80.EXC2/07”.
9000 10001000
bit 3 = 1: Allows use of a macro cassette of 512 Kbyte capacity
= 0: Allows use of a macro cassette of other than 512 Kbyte capacity
(Be sure to set 1)
bit 7 = 1: Compiles a macro program with custom macro B format
= 0: Compiles a macro program with custom macro A format
(Be sure to set 1)
9001 10000001
bit 0 = 1: Outputs sequence number in the P-CODE program at ROM writing
= 0: Does not output sequence number in the P-CODE program at ROM writing
(Be sure to set 1)
bit 7 = 1: Can refer to variables at the #lOOOO level by RAM program
= 0: Cannot refer to variables at the #lOOOO level by RAM program
(Be sure to set 1)
9002 11000000
bit 7 = 1: Macro executer expansion function valid

A4-6
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

= 0: Macro executer expansion function not valid


(Be sure to set 1)
bit 6 = 1: Automatic work number search valid
= 0: Automatic work number search not valid
(Be sure to set I)
bit 3 = I: Expanded conversational macro exclusive variables at the #20000 level have
non-floating decimal point format
= 0: Expanded conversational macro exclusive variables at the #20000 level have
floating decimal point format
(Be sure to set 0)
9003 10000000
bit 7 = I: Special function for Graphic Conversation valid
= 0: Special function for Graphic Conversation not valid
. (Be sure to set I)
9033 97
,.
Dedicated data for Graphic Conversation
9037 5
Dedicated data for Graphic Conversation
9044 2044
Dedicated data for Graphic Conversation Set this value unconditionally for either case of
tape recording memory of I20 m or 320 m.
Setting parameters for FSO-MF/MC
Parameter
number Setting data

8000 00000000
bit 0 = I: The program of the block containing M99 ends
= 0: The program of the block containing M99 does not end
(Be sure to set 0)
bit 1 = I: The program of the block containing MO2 ends
= 0: The program of the block containing MO2 does not end
(Be sure to set 0)
bit 2 = 1: The program of the block containing M30 ends
= 0: The program of the block containing M30 does not end
(Be sure to set 0)
8010 00000001
bit 0 = I: Corresponds to macro executer having Graphic Conversation
= 0: Corresponds to the standard macro executer
(Be sure to set I)
801 I 0-MF, ****, EXC2/+*
Specifies the file name of macro executer 2.
However, as ‘O-MF.-. EXC2/“” is different depending on the macro executer used, refer to
the Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER) with
Graphic Conversation in Section 2, then input the file name of the macro executer to be ’
used.

A4-7
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

Example)
The file name when using the FSO-MF 9” monochrome high resolution CRT, English,
Japanese, German,French, Italian, Spanish version is “01MF.OA85.EXW02”.
9000 10001000
bit 3 = 1: Allows use of a macro cassette of 512 Kbyte capacity
= 0: Allows use of a macro cassette of other than 512 Kbyte capacity
(Be sure to set 1)
bit 7 = 1: Compiles a macro program with custom macro B format
= 0: Compiles a macro program with custom macro A format
(Be sure to set 1)
9001 10000001
bit 0 = 1: Outputs sequence number in the P-CODE program at ROM writing
= 0: Does not output sequence number in the P-CODE program at ROM writing
(Be sure to set 1)
bit 7 = 1: Can refer to variables at the #lOOOO level by RAM -program
= 0: Cannot refer to variables at the #lOOOO level by RAM program ’
(Be sure to set 1)
9002 10000000
bit 7 = 1: Macro executer expansion function valid
= 0: Macro executer expansion function not valid
(Be sure to set 1)
bit 6 = 1: Automatic work number search valid
= 0: Automatic work number search not valid
bit 3 = 1: Expanded conversational macro exclusive variables at the #20000 level
havenon-floating decimal point format
= 0: Expanded conversational macro exclusive variables at the #20000 level have
floating decimal point format
9003 10000000
bit 7 = 1: Special function for Graphic Conversation valid
= 0: Special function for Graphic Conversation not valid
(Be sure to set 1)
bit 3 = 1: Corresponds to 14” color CRT
= 0: Corresponds to 9” monochrome high resolution CRT
9013 100
Dedicated data for Graphic Conversation
9014 999
Dedicated data for Graphic Conversation
9015 8100
Dedicated data for Graphic Conversation
9016-9022 0
Be sure to set 0
9033 97
Dedicated data for Graphic Conversation
9037 10
Dedicated data for Graphic Conversation
9044 ?
Determine the setting values with reference to the Note) given below.

A4-8
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

N o t e ) Concerning expanded conversational macro exclusive variables (#20oo -)


If the length of the tape recording memory is 120m or 320m, an arbitrary number of exclusive
variables starting from #20000 can be used. Bit 3 of parameter number 9002 allows selection of
either floating decimal point format or non-floating decimal point format like regular common
variables of these variables.

Parameter No. 9002


bit 3 = 0: Floating decimal point format
= 1: Non-floating decimal point format

The nth value of the number set by parameter number 9044 is the number of expanded
conversational macro exclusive variables that can be used.
When the setting value of parameter number 9044 is 0, the expanded conversational macro
exclusive variables cannot be used.
When using the floating decimal point format, n = 12, and when using the integer format,
n=30.

Example)
Floating decimal point format
#20000cy#2001 1 can be used when parameter No. 9044 = 1
#20000+20023 can be used when parameter No. 9044 = 2
Integer format
#20000+20029 can be used when parameter No. 9044 = 1
#20000+20059 can be used when parameter No. 9044 = 2

When using the non-floating decimal point format, values in the range - 32768 to 32767 can be set.
In the case that assignment is performed at the left side of the assigned statement, settings are
made by rounding off to the nearest whole number. In the case that the variable appears in an
expression, evaluation is performed after conversion to a floating decimal point format.
Approximately 0.15m of tape recording memory is used per set of expanded conversational macro
exclusive variables (those of parameter no. 9044). Be careful of decrease in the capacity of
available tape memory when using a large number of expanded conversational macro exclusive
variables. The available tape recording memory capacity during use in accordance with the number
of specified variables is displayed on the program library screen.
The maximum number of variables that can be set to parameter no. 9044 varies, as shown below,
in accordance with the tape recording memory capacity.

Tape recording memory 120 m: .


Parameter No. 9044 = 831
Tape recording memory 320 m:
Parameter No. 9044 = 2111

@ When setting of all necessary parameters is completed, press the RO key, then press the
< NL) key twice to return to the initial screen.

A&9
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

Test Compiling
Press the RO key in the initial screen.
When you want to display the source program during compiling, put the F3 key into ON status,
and when you want to display only the program number, put the F3 key into OFF status.
Key in ‘I< NL>’ from ‘NO. = ‘.
As the dedicated custom macro program for Graphic Conversation and the user’s program are
compiled simultaneously, check for the absence of errors.

Setting the PMC writer channel


Press the Rl key in the initial screen.
By keying in ‘2 < NL )’ from “NO. = ‘, the current ROM writer channel setting status is
displayed.
Concerning CN = 1
‘ON < NL>’ :Uses the channel
‘OFF < NL ) ’ :Does not use the channel
‘<NL>’ :Setting is unchanged
The same as above applies to CN = 2
The same as above applies to CN=3
The same as the above appliestolLTlN ROM WRITER= (P-G Mate only)
By only pressing ‘ < NL) ’ in response to ‘NO = ‘, the display returns to the initial screen.

(1O)Preparation of the PMC writer


@ Install a macro cassette with the previous contents erased in the PMC writer
@ Switch ON the power supply of the PMC writer
@ Check that RDY (Green) on the PMC writer is lighted.

(11)ROM writing
Press the RO key in the initial screen.
Put the F7 into OFF and the F9 key into ON status. (PMC writer selection)
When you want to display the source program during compiling, put the F3 key into ON status,
and when you want to display only the program number, put the F3 key into OFF status.
Key in ‘2 < NL )’ from ‘NO = ‘.
If the floppy disk containing macro executer 2 is already inserted in floppy disk drive 0, the data
will be read automatically from the floppy disk and simultaneously written into the ROM
cassette. If the floppy disk has not been inserted in the disk drive, a message will be displayed.
After inserting the macro executer 2 floppy disk into disk drive 0, key In ‘ OK @ ****. ****
EXC2/** < NL ) ‘.
However, as the above-described ****. ****. EXC2/+* is different depending on the macro executer
used, refer to the Table of Figure Numbers of FAPT MACRO COMPILER (MACRO EXECUTER)
with Graphic Conversation in Section 2, then input the file name of the macro executer to be used.
Example)
The file name when using the FSO-TF 9” monochrome high resolution CRT, English,
Japanese version is “0.TF. OA80. EXC2107”.
The file name when using the FSO-MF 9” monochrome high resolution CRT, English,
Japanese, German, French, Italian, Spanish version is “O-MF.OA85.EXC2102”.
@ The PC Cassette Rom Module lamp of the PMC Writer flicker and writing to the ROM begins.
0 After approximately 1 hour, ROM writing will be completed.

A4-10
APPENDlX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

(12) Performance check


Aft8f writing is completed, install the macro cassette into the “PAS” socket on the Series 0 master
PCB, then check performance.
Custom macro variables #lOOOO and above and the RAM program are cleared from the setting
screen by switching the power supply ON while pressing the [DELETE] button with PWE = 1.

4. MACRO CASSETTE CAPACITY


The capacity of the memory area provided for the user’s program in combination with the system
section of macro executer in the macro cassette is 128 Kbyte.
Note) The system section of macro executer provided with Graphic Conversation is slightly larger
than that of the standard macro executer without Graphic Conversation. Therefore, take note that in
cases where the user’s program is stored by standard macroexecuter using close to the limit of
128 Kbyte macro cassette capacity, when stored using macro executer provided with Graphic
Conversation, the program may not be fully stored.

5. ADDITION OF OPTIONS
When the Graphic Conversation and macro executer function exist in combination as described,
procure the options listed below.

(1) FSO-TF, FSO-TC + Graphic Conversation for 2-axis lathes.


+ Macro executer provided with conversational programming function
(A02B-0098-J560)

(2) FSO-MF, FSO-MC + Graphic Conversation for machining centers


-_) Macro executer provided with Graphic Conversation (A02B-0099-J560)

6. LIMITATION ON THE USER’S PROGRAM .


Take note that the following limitations exist on the user’s program prepared by the machine tool
manufacturer (custom macro format).

FSO-TF, FSO-TC + Graphic Conversation for 2-axis lathes


Program numbers of 8999 and below cannot be used in the macro program.
The only alarm numbers that can be set by the macro program are P/S515 -519.
The only expanded conversational macro variables that can be used are in the range of
#10050 -#10399

FSO-MF, FSO-MC + Graphic Conversation for machining centers


Program numbers in the range of 8100 -9019 as well as 9030 and above cannot be used in
the macro program.
The only alarm numbers that can be set by the macro program are PISSIO-519.
The only expanded conversational macro variables that can be used are #20000 and above.
Macro calling by G code, which calls a P-CODE program (that is, a post-compiling program)
from a regular machining program is not possible.

A4-11
APPENDIX 4 Series 0 MACRO COMPILER/MACRO EXECUTER
WITH GRAPHIC CONVERSATION

Note 1) Conversational programming-related screens cannot be changed by the user’s


program.

Note 2) Some functions which can be used with the standard macro executer acnnot be used
with macro executer provided with Graphic Conversation.

A4-12
APPENDIX 5 FANUC Series O-TTC MACRO COMPILER/MACRO EXECUTER

APPENDIX 5 FANUC Series O-TTC MACRO COMPILER/MACRO

1 OVERVIEW
l

The FANUC Series O-TTC also supports the use of a macro compiler and macro executor.
Connect a compiled macro executor ROM cassette for HEADl, or two cassettes for HEAD1 and
HEAD2 (Note 1). P-code macro programs stored in the ROM can be executed.

From the ROM cassette for HEADl, the execution, auxiliary, and conversational macro functions
can be used(Note 2) in the same way as for the macro compiler/executor for the 0-TC.

From the ROM cassette for HEAD2, only the execution macro function can be used. Execution
macros for HEAD2 can, however, reference or write conversational macro variables (#lOOOO and
subsequent) and expanded conversational macro variables (#20000 and subsequent) defined using
HEADl. Common variables and system variables for HEAD2 are independent of those.for HEAD1 .

The user can, for example, create a conversational macro screen using the HEAD1 conversational
macro function, or control HEADVHEAD2 execution macro programs based on the execution
results of an auxiliary macro.
(Operation outline)

HEAD1 HEAD2

Execution macro function


Execution macro function User Prog.
User Prog. Conversational
00001; macro variables
Execution macro
P-code Prog. (#lOOOO and
09010 ;
09010 ; subsequent) I-- Cl23 ;
0 1 0 0 ; ,- . 4 - :
I .
.
;
Expanded
conversational 1 t99; io2;
lioz; M99
macro variables
(#ZOO00 and
subsequent)

Conversational/auxiliary macro function

P-code common P-code common


Conversational macro
variables variables
P-code Prog.
MDI+ (#lo0 and subsequent) (# 100 and subsequent)
CRT+ (At500 and subsequent) (R500 and subsequent)
Auxiliary macro
DI/DO- System variables System variables
P-code Prog.

(Note 1) A macro executor ROM cassette cannot be used if installed for HEAD2 only. In such a
case, install a ROM cassette containing a dummy compiled program for HEADl.
(Note 2) The functions are partially limited.

A5-1
APPENDIX 5 FANUC Series 0-lTC MACRO COMPILER/MACRO EXECUTER

2. COMPILATION
Macro executor ROM cassettes for the O-TTC cannot be compiled by the O-TTC, neither for
HEAD1 nor HEAD2.

Use FANUC System P-G Mark II or FANUC System P-G Mate for compilation.

2.1 System Software


r FANUC System P-G Mark II _j
FAPT MACRO COMPlLER A08B-0035J540,#E Version 6.1 or later
FAPT MACRO COMPILER (MACRO LIBRARY) A08B-0035J541 Version 7.1 or later

r FANUC System P-G Mate J


FAPT MACRO COMPILER A08B-0036- 3540,#E Version 6.1 or later
FAPT MACRO COMPILER (MACRO LIBRARY ) A08B-00360J541 Version 7.1 or later

(MACRO EXECUTER)
To compile a ROM cassette for HEADl, use the macro library for the 0-TC.
File name: 0-TC.EXEC03
To compile a ROM cassette for HEAD2, use the macro library for the O-TTCSUB.
File name: O-TTC.SUB.EXEC/Ol

3. INSTALLATION .
Attach a macro executor ROM cassette, compiled using P-G Mark II/Mate for HEAD1 or HEAD2, to
the PAS1 or PAS2 connector of the FANUC Series O-C master PCB.

Macro executor ROM cassette for HEAD1


PAS1 connector of the FANUC Series O-C master PCB

Macro executor ROM cassette for HEAD2


PAS2 connector of the FANUC Series O-C master PCB

4. FUNCTIONS AND NOTES


Macro executor ROM cassettes can be installed for both HEAD1 and HEAD2, as described in
Section 1. For HEAD2, however, only the execution macro function can be used. The
conversational macro function for controlling conversational screens and the auxiliary macro
function are supported only by the macro executor for HEADl. Notes on using the OTTC
HEAD1 /HEAD2 macro executor are described below.

A52
APPENDIX 5 FANUC Series 0-TTC MACRO COMPILER/MACRO EXECUTER

4.1 Variables
Conversational macro variables (#lOOOO and subsequent) and expanded conversational macro
variables (#20000 and subsequent) can be referenced or written by both HEAD1 and HEAD2 P-
code programs. The variables must be specified when performing macro compilation for HEADI.

System variables and P-code common variables (#lo0 to #149, #500 to #53l) for HEAD2 are
independent of those for HEADl.

4.2 Execution Macro Function


The execution macro function can be independently used for HEAD1 and HEAD2. The user can,
for example, call P-code program 09010 using Gl 00 for HEAD1 while calling P-code program
09019 using G123 for HEAD2, or call 09011 for HEAD1 and 09012 for HEAD2, both using GlOl l

P-code programs stored in the ROM for HEADI, however, cannot be called from HEAD2, and vice
versa.

4.3 Conversational Macro Function


The conversational macro function can be used only with the HEAD1 macro executor. The AUX.
MENU, and MACRO screens for HEAD1 can be controlled (MENU and MACRO can be controlled
only when the full keyboard is used).

For the OTT system, the following restrictions are imposed:

1) The NC program access function can be used. Programs for HEAD2, however, cannot
be referenced or written.

2) The compilation parameter (DAUX) for selecting the AUX screen upon power-on cannot
be used.

3) The RS232C line cannot be controlled.

4) An address function cannot be used to access PMC addresses R300 to R699 or DI for
HEAD2 (X40).

4.4 Auxiliary Macro Function

The auxiliary macro function can be used only with the HEAD1 macro executor.

For the OTT system, the following restrictions are imposed:

1) The function screen control variable (#8510) cannot be used to switch the function
screen.

2) The RS-232C line cannot be controlled.

AS-3
APPENDIX 5 FANUC Series 0-TTC MACRO COMPILER/MACRO EXECUTER

3) An address function cannot be used to access PMC addresses R300 to R699 or DI for
HEAD2 (X40).

5. PARAMETERS
5.1 HEAD1 Compile Parameters

7 6 5 4 3 2 1 0

9000 LO6 RSMBRlMB R512 VRFY

VFW = 1 : The ROM is checked whenever it receives data.


= 0 : The ROM is not checked when it receives data.
R512 = 1 : Data is output to the 128K-byte ROM cassette.
= 0:
RlMB = 1 : Data is output to the 256K-byte ROM cassette.
= 0:
R2MB = 1 : Data is output to the 512K-byte ROM cassette.
=o :
LO6 = 1 : Macro programs are compiled in custom macro B format. (Always specify 1.)
= 0 : Macro programs are compiled in custom macro A format. (Not to be set)

7 6 5 4 3 2 1 0
t
9001 LOC4 SEQN
B

SEQN =l : Sequence numbers are output to P-code programs.


= 0: Sequence numbers are not output to P-code programs.
LOC4 =l : GOT0 locations are output with 4 bytes.
= 0: GOT0 locations are output with 2 bytes. (Always specify 0.)

7 6 5 4 3 2 1 0

9002 EXTl EVF ACL2 ACLl TCAL

TCAL = 1 : Subprogram call using a T code is enabled.


= 0 : Subprogram call using a T code is disabled.
ACLl = 1 : Call using a specified code is enabled (09004/#146).
= 0 : Call using a specified code is disabled.
AU2 = 1 : Call using a specific code is enabled (09005/#147).
= 0 : Call using a specific code is disabled.
EVf= = 1 : Expanded conversational macro variable #20000 is of fixed decimal point format.
= 0 : Expanded conversational macro variable #20000 is of floating decimal point format. :
EXTl = 1 : Expanded functions (RS-23% control and NC program access) are enabled.
= 0 : Expanded functions are disabled.

A5-4
APPENDIX 5 FANUC Series O-7°K MACRO COMPILER/MACRO EXECUTER

7 6 5 4 3 2 1 0

9003 HRGR ONMSK


\ .

ONMSK = 1: The 0 and N numbers are not displayed on the AUX screen.
= 0 : The 0 and N numbers are displayed on the AUX screen.
HRGR = 1 : High-resolution mode graphic display (only for 9” high-resolution CRT)
= 0 : Standard mode graphic display

7 6 5 4 3 2 1 0

9004 CUTLG HRGC .


4

HRGC = 1 : 9” high-resolution monochrome CRT, brightness modulation mode (paint)


= 0 : 9” high-resolution monochrome CRT, standard
CUTLG = 1 : The cutting distance is counted.
= 0 : The cutting distance is not counted.

7 6 5 4 3 2 1 0

9005 TMACC AXllCLAX3CLAXtCLAXlCL

AX1 CL = 1 : Subprogram call by the 1st axis address is valid.


= 0 : Subprogram call by the 1st axis address is invalid.
Ax2CL = 1 : Subprogram call by the 2nd axis address is valid.
= 0 : Subprogram call by the 2nd axis address is invalid.
AX3CL = 1 : Subprogram call by the 3rd axis address is valid.
= 0 : Subprogram call by the 3rd axis address is invalid.
AX4CL = 1 : Subprogram call by the 4th axis address is valid.
= 0 : Subprogram call by the 4th axis address is invalid.
TMACC = 1 : Subprogram call by the T code is valid.
= 0 : Subprogram call by the T code is invalid.

7 6 5 4 3 2 1 0 .

9006 DIOC

DIOC = 1 : Ul:G135/Gl36 and UO:F182/F183 are used for UVUO (#lo00 to #1132) of execution
macros/conversational macros.
= 0 : Standard UI:G130/G131 and UO:F162/F163 are used for U/U0 (#lo00 to #1132) of
execution macfoskonvefsational macros.

M-5
APPENDIX 5 FANUC Series WTTC MACRO COMPILER/MACRO EXECUTER

.
9010 M code that calls subprogram 09001.
b

9011 M code that calls subprogram 09002.


\

,
9012 M code that calls subprogram 09003.

\
9013 C code that calls custom macro 09010.
.. ..

.. ..
. 4
9022 G code that calls custom macro 09019.
l

9023 M code that calls custom macro 09020.


.. ..
.. ..
\
9032 M code that calls custom macro 09029.
&

9034 G code that cancels modal call


#

9037 Number of conversational macro variables being used (WOO)

I 9038
I
Number of the conversational macro program to be executed upon power-on
I (AUX screen)
,
9039 Number of the auxiliary macro program to be executed

9040 Number of the conversational macro program to be executed upon power-on (MENU screen)
...
I 9041 INumber of the conversational macro program to be executed upon power-on I (MACR screen)

9042 Lower limit M code for M code call with a range specified
i .

9043 Upper limit M code for M code call with a range specified

9044 Number of expanded conversational macro variables being used

.
9045 Starting G code for G code call with a range specified

9046 Number of C codes for G code call with a range specified


i
\ l

9047 Starting 0 number for G code call with a range specified


.

A5-6
APPENDIX 5 FANUC Series 0-TTC MACRO COMPILER/MACRO EXECUTER

5.2 HEAD1 Executor Parameters

q 7 6 5 4 3 2 1 0

9000 RSTC EXSP TSTP NDSP SEQD

SEQD =l : Displays the program number and sequence number of the recorded program during
the execution of a recorded program.
.
= 0 . Displays the program number and sequence number of the called user program
during the execution of a recorded program.
NDSP =1 : Displays local and common variables for P-code programs.
=o : Does not display local and common variables for P-code programs.
TSTP =l : Stops the execution of the conversational macro program.
=O: Executes the conversational macro program.
EXSP =1 : Executes macro statements until the next NC statement is encountered, if feed hold
is applied during macro statement execution at execution level.
= 0: Stops execution if feed hold is applied during macro statement execution at
execution level.
RSTC =l : Common variables #lOO to #149 are cleared to < null ) if NC is reset.
=o: Common variables #lOO to #149 are not cleared to < null ) if NC is reset.

macro variable number from which display of variables is to be started


I

9002 Conversational macro break program number

I9003 IConversational macro break sequence number I

5.3 HEAD2 Compile Parameters

7 6 5 4 3 2 1 0

9000 LD6 RZMBRlMB R512 VRFY


,

VFW = 1 : The ROM is checked whenever it receives data.


= 0 : The ROM is not checked when it receives data.
R512 = 1 : Data is output to the 128K-byte ROM cassette.
=o:
RlMB = 1 : Data is output to the 256K-byte ROM cassette.
=o:
R2MB = 1 : Data is output to the 512K-byte ROM cassette.
=O:
LD6 = 1 : Macro programs are compiled in custom macro B format. (Always specify 1.)
= 0 : Macro programs are compiled in custom macro A format. (Not to be set)

A57
APPENDIX 5 FANUC Series 0-l-K MACRO COMPILER/MACRO EXECUTER

7 6 5 4 3 2 1 0
r
9001

SEQN = 1 : Sequence numbers are output to P-code programs.


= 0 : Sequence numbers are not output to P-code programs.
LOC4 = 1 : GOT0 locations are output with 4 bytes.
= 0 : GOT0 locations are output with 2 bytes. (Always specify 0.)

7 6 5 4 3 2 1 0

9002 ACL2 ACLl TCAL


\

TCAL = 1 : Subprogram call using a T code is enabled.


= 0 : Subprogram call using a T code is disabled.
ACLl = 1 : Call using a specified code is enabled (09004/#146).
= 0 : Call using a specified code is disabled.
ACL2 = 1 : Call using a specified code is enabled (09005/#147).
= 0 : Call using a specified code is disabled.

I 9010 IM code that calls subprogram 09001. I

I901I IM code that calls subprogram 09002.


I

I9012 IM code that calls subprogram 09003.


I

I 9013
IG code that calls custom macro 09010.
I

I 9022
IG code that calls custom macro 09019.

I 9023 IM code that calls custom macro 09020. I

I9032 IM code that calls custom macro 09029. I

I 9034 IG code that cancels modal call I

AS-8
APPENDIX 5 FANUC Series 0-l-K MACRO COMPILER/MACRO EXECUTER

5.4 HEAD2 Executor Parameters

7 6 5 4 3 2 1 0

9000 RSTC EXSP NDSP SEQD


l

SEQD =I : Displays the program number and sequence number of the recorded program during
the execution of a recorded program.
= 0: Displays the program number and sequence number of the called user program
during the execution of a recorded program.
NDSP =l : Displays local and common variables for P-code programs.
=o: Does not display local and common variables for P-code programs.
EXSP =l : Executes macro statements until the next NC statement is encountered, if feed hold
is applied during macro statement execution at the execution level.
= 0: Stops execution if feed hold is applied during macro statement execution at the
execution level.
RSTC =1 : Common variables #lOO to #149 are cleared to < null ) if NC is reset. ’ .
= 0: Common variables #lOO to #149 are not cleared to < null ) if NC is reset.

AS-9
APPENDIX 6 MACRO VARIABLES USED IN THE MACRO
EXECUTOR FUNCTIONS

APPENDIX 6 MACRO VARIABLES USED IN THE MACRO


EXECUTOR FUNCTIONS

R/W cowem- EXEtJta-


VariableNo. Function Auxiliq b)e
tional

#l - #33 Local variables R/W X X 0

#I on99 Array-type variables R/W 0 0 X

#loo - x149 Comnon variables (non-holdtype) RAN 0 0 0

lv500 - ru531 Common variables (hold type) RN 0 0 0

4wooo - P-CODE variables R/W 0 0 0

#2OOOo - Extended P-CODE variables R/w 0 0 0


.........I..............

rV8500 Variable 1 for controllingthe executh of cmversatial R/W 0 0 x


macros (CUSTOM screen 1)

#8550 Variabte 2 for contfolling the execution of conversational R/W 0 0 X


macros (CUSTOM screen 2)

R8551 Variable 3 for controlling the execution of conversational RMI 0 0 X


macros (CUSTOM screen 3)

#8501 Key input control variable R/ 0 x X


#8502 Data input control variable R/w 0 X X

#8503 Numeric data variable R/ 0 X X

#8504 Address data variable R/ 0 X X

#8552 Variable for controlling extended data input for conversational R/W 0 X X
macros

#8505 Cursor control variable RAN 0 0 X

#8506 Cursor X position control variable R/W 0 0 X

#8507 Cursor Y position control variable R/W 0 0 X

#8509 Variable for controlling the character string cataloging R/W 0 0 X


pfogram

#8510 Variable for controlling conversational macro function screens R/W 0 0 X

R : Readable W : Writable 0 : Usable X : Unusable

A64
APPENDIX 6 MACRO VARIABLES USED IN THE MACRO
EXECUTOR FUNCTIONS

Variabte No. Function RAN


I

S8602 PMC amtfol axis selectionvariable (with G codes)


_ ~_ I I x
#8700 PMC mtfd axis seiection variable (with macro variables) RAN 0 X

n87lO PMC command signaf variable (Area A)


I

#87ll
I PMC control command variable (Area A)

#8712 PMC cutting feedrate variable (Area A) R/w 0 0 X

#8713 Variable for traveling distance controlled by PMC (Area A) RAN 0 0 X

#8715 Read variable for PMC status signal (Area A) R 0 0 X

#872O PMC command signal variable (Area B) RAN 0 0 X

rY8721 PMC control command variable (Area B) RNV 0 0 X

#8722 PMC cutting feedrate variable (Area 8) R/W 0 0 X

R8723 Variable for traveling distance controlled by PMC (Area B) RAN 0 0 X

#8725 Read variable for PMC status signal (Area B) R 0 0 X

#8621
I Overridevalue of the torque limit for the 1st servo axis I O I O
#8622
I Override value of the torque limit for the 2nd servo axs

#8623
IOverride value of the torque limit for the 3rd sewo axis
IRMI O I O I O
#8624 Override value of the torque limit for the 4th servo axis RnrV 0 0 0

#8631 A/D converter data for channel 1 0 X

#8632 A/D converter data for channel 2 RAfV 0 0 X

#8633 A/D converter data for channel 3 RNV 0 0 X

#8634 A/D converter data for channel 4 R/W 0 0 X

#8998 System informationID

#8999 System information

I #99000 + Custom macro variable number

R:
.

w: Writable
Readable 0 : Usable Unusable

A6-3
APPENDIX 7 G CODES THAT CAN BE USED BY THE CONVERSATIONAL
AND AUXILIARY MACROS

APPENDIX 7 G CODES THAT CAN BE USED BY THE


CONVERSATIONAL AND AUXILIARY MACROS

(Note 1) The conversational macro can issue all G codes. The auxiliary macro cannot issue
commands relating to screen display (0). The execution macro cannot issue G codes. (GOI,
G02, and GO3 are commands for linear interpolation and cylindrical interpolation of the NC unit.)
(Note 2) A single-shot G code is marked with ‘1 S”. A continuous-state G code is marked with
u A
M Each continuous-state G code is shared by the conversational and auxiliary macros and
belongs to one G-code group.

G M,,S Conversa-
Function Standard command format Auxiliary
tional

GO1 Graphics: Displays a straight line. GO1 x -- Y ; M 0 l


GO2 Graphics: Displays an arc (clockwise). GO2 X_ Y_ I_ J_ Q_ ; M 0 l
GO3 Graphics: Displays an arc (counterclockwise). GO3 X_ Y_ I_ J_ Q_ ; M 0‘. a

G202 Erases the screen. G206 P_ ; 1s 0 a


G2O6 Graphics: Fills in an area. G206 P---X Y ; 1s 0 l
G240 Screen/graphics: Specifies a display color. G240 P-- t ; 1s 0 l
G242 Graphics: Specifies a start point. G242 X-- Y ; M 0 0
G243 Displays characters. G243 [String Form] ; M 0 @
G244 Graphics: Specifies a line type. G244 P- ; 1s 0 a

G310 Reads or writes the PMC data.


.
M 0 0
G315 Processes the array-type data G315 P-- K ; 1s 0 0
G319 Registration of external character G319 P-- Q ; 1s 0 0
G320 Reference to the NC program: Catalogs a G320 ; 1s 0 0
program.

G321 Reference to the NC program: Deletes a G321 ; 1s 0 0


program.

G325 Reference to the NC program: Reads a G325 ; 1s 0 0


block.

G326 Reference to the NC program: Writes a G326 P ; 1s 0 0


block.

G327 Reference to the NC program: Deletes a G327 ; 1s 0 0


block.

G330 RS232c: Opens a line. 033OPBSC(F/L);


-VW--- 1s 0 0
G331 RS232c: Closes a line. G331 ; 1s 0 0
G335 RS232c: Reads a single character. G335 P_; 1s 0 0
(Reception)

A74
APPENDIX 7 G CODES THAT CAN BE USED BY THE CONVERSATIONAL
AND AUXILIARY MACROS

-1
G
Function Standard command format 1 M/IS l’Ly”l Auxiliary

G336 1RS232c: Writes data. (Transmission) G336 [String Form] : PI OI O


--w-D; PI OI O
G337 1RS232c: Reads variable data (Reception) iG337 P-Q -- R ;
I4 O I O
G338 RS232c: Writes variable data. ’ G338 P Q F 2 R

I (Transmission)
G339 1 RS232c: Controls the FANUC cassette. G339 P----
F L S ; 1s 0 0

G340 PMC axis control: Issues a rapid traverse


command.
Gwo X- ;
PI O I O
G341

G34-4
I
1PMC
PMC axis control: Issues a cutting feed
command.

axis control: Issues a dwell command.


GWI X-- F

G344 X - ;
;
PI OI O
(1sI-0 IO

G345

I
PMC axis control: Issues a reference position
return command.
G345 ;

PI OI O
G346

I
PMC axis control: Issues a miscellaneous
function command.
G346 M_ ;
VI OI O
G348 PMC axis control: Issues a status signal read

I command.
G348 P- ;
PI OI O
G349 G349 P_;

PI O O I

A7-2
INDEX

<A>
Address code table .................................................. 67
Address functions ................................................... 47
Argument designation ................................................. 21
Auxiliary macro function ............................................... 26

<B>
Block deletion .. .. ... ... ... .. . ... .. .. ... .. .. . . .. . ... .. .. .. . ... .. . .. . 66
Block writing . .. .. .. .... ... . .. .. ... .. .. .. .. .. .. . .. .. .. .. . ... . .. ... . . 64

<c>
Call code and program No. ............................................. I6
Calling a macro using a T code .......................................... I9
Calling a subprogram using specified codes .................................. 17
Calling format ...................................................... 83
.Callingmacros09010-9019byGcode ................................... I8
Calling macros 09020 . 9029 by M code ................................... 19
Calling macros with a G code by specifying the range .......................... I9
Calling subprogram 09000 by T code ..................................... I7
Calling subprograms 09001 . 9003 by M code ............................... I7
Common variables (#IO0 to #149 and #500 to #53I) ........................... 29
Compiling procedure (main flow) .......................................... 6
Compiling procedure by series 0 (details) (preparation of source by system P-G) ........ 9
Compiling procedure using system P-G (details) ............................... 7
Continuous input by cursor and page key ................................... 68
Conversational macro execution control variable #8500, #8550, #8551 .............. 28
Conversational macro function and auxiliary macro function ...................... 24
Conversational macro ................................................. 24
Coordinates system of screen ........................................... 36
Cursor control ...................................................... 72

CD>
Data on macro compiler ............................................. A3-1
Data reading of A/D converter ........................................... 75
Deleting a program .................................................. 63
Detailed description of reference system information ........................... 91
Displaying Variables .................................................. 32

cE>
Endcode(#8529) ................................................... 67
End code (#8539) ................................................... 61 .
Equipment connection ................................................. 5
Equipment needed for compile ........................................... 4
Example .......................................................... 85
Execution control code ................................................ 27
Execution macro .................................................... 15
Extending the function for inputting and outputting a macro variable ................ 55

<F>
FANUC floppy cassette control .......................................... 57
FANUC series O-TTC macro compiler/macro executer ........................ A54
Function details ..................................................... 50
Function for calling a user program by an execution macro ...................... 83
Function for calling macros with an axis address .............................. 20
Function for finding a P-CODE work number ................................ 82
Function for identifying the pressed MDI key using a conversational macro ........... 85
Function for separating Ui from UO of the P-CODE program ..................... 81
Function screen control function ......................................... 46
Function ....................................................... 83,85
Functions for stopping a conversational macro ................................ 108
Functions of the macro executor ......................................... 33

<G>
G codes that can be used by the conversational and auxiliary macros .. .. .. . .. .. . A7-1
Graphic painting function .. ... . .. .. . .. ... ... .. . . . . .. .. .. .. .. .. . .. .. .. . . 45

<I>
Inputting and outputting macro variables .................................... 53
Interlock function for axis direction ........................................ 80
Internal code (hangwr) ............................................... 107
internal code ...................................................... 102

<K>
Key image correspondence . . . . . . . . . . . . . . . . . . . . ., . . . . . . . . . . . . . . . . . . . . . . . 85
Key-input and data-input control . .. .. . . ... ... .. . .. . . .. . ... .. . .. . .. .. .. .. . 70

CL>
Limitation for execution macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Local variables (#l to #33 or for referencing
the P-CODE variables of array type, #l to #99) ... . .. . . . . ... .. . . ... . .. .. .. .. . 29

<M>
Macro compiler and macro executer ....................................... 3
Macro compiler ...................................................... 3
Macro complier operation ............................................ A2-1
Macro executor controls ............................................... 14
Macro program example ............................................. Al-l .
Macro variables used in the macro executor functions ........................ A6-1
Macro variables ..................................................... 29
Masking of 0, N number appearance ...................................... 68
Modal call using G code . ... .. .. .. .. . ... ... ... . . .. .. . ... .. .. .. .. . ... . .. 18

<N>
Notes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28, 67, 83

co>
Operation functions (logarithm, exponent, arcsine, arccosine) . . .. .. .. ... .. . .. .. .. . 84
Operation .. .. . ... ..... ... . ... .. . ... ... ... . . .. .. . ... .. .. ... . .. .. .. . 84

<P>
P-CODE variables #lOOOO- ............................................. 29
PMC axis control by the G code ......................................... 75
PMC axis control by variables ........................................... 78
PMC axis control .................................................... 75
Presetting relative coordinates .......................................... 69
Processing array type P-CODE variables .................................... 72

<R>
Reader puncher interface control by conversational macro ....................... 49
Reading a specified block .............................................. 63
Reading and presetting cutting distance (#8554) .............................. 68
Reading and presetting cutting time (#8553) ................................. 68
Reading and presetting cutting time and cutting distance by conversational macro ...... 68
Reading and presetting relative coordinates by conversational macro ............... 69
Reading and writing a PMC address ...................................... 48
Reading relative coordinates ............................................ 69
Recording of a new program ............................................ 62
Referenced system information .......................................... 89
Referencing and reading NC program with conversational macro .................. 61
Referencing common variables of custom macros ............................. 82

es>
Screen control ...................................................... 36
Screen display control code ............................................ 39
Series 0 macro compiler/macro executer with graphic conversation .............. A4-1

Table for editing by P-G mate ... .. .. . .. .. ... .. .. . .. . . . .. .. .. .. .. .. . .. .. . 13


Torque limit control ... ...... . ... .. . .. .. ... .. .. . . .. . . .. .. .. .. .. .. .. .. . 74

cv>
Variables of expanded P-CODE (#20000 - . ...) . ... .. .. . . .. . .. .. .. .. .. .. . ... . . 30

<w>
Window function .. .. ....... . .. ... . . .. .... .. .. . . . .. . . .. ... .. .. .. .. . .. 88
· No part of this manual may be
reproduced in any form.

· All specifications and designs


are subject to change without
notice.

You might also like