+ All Categories
Home > Documents > GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc...

GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc...

Date post: 07-Feb-2018
Category:
Upload: doquynh
View: 247 times
Download: 7 times
Share this document with a friend
166
GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer Programming Manual GFZ-62073E-2/03 September 1995
Transcript
Page 1: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

GE Fanuc Automation

Computer Numerical Control Products

Series 15 / 150 – Model BMacro Compiler/Executer

Programming Manual

GFZ-62073E-2/03 September 1995

Page 2: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

GFL-001

Warnings, Cautions, and Notesas Used in this Publication

Warning

Warning notices are used in this publication to emphasize that hazardous voltages, currents,temperatures, or other conditions that could cause personal injury exist in this equipment ormay be associated with its use.

In situations where inattention could cause either personal injury or damage to equipment, aWarning notice is used.

Caution

Caution notices are used where equipment might be damaged if care is not taken.

NoteNotes merely call attention to information that is especially significant to understanding andoperating the equipment.

This document is based on information available at the time of its publication. While effortshave been made to be accurate, the information contained herein does not purport to cover alldetails or variations in hardware or software, nor to provide for every possible contingency inconnection with installation, operation, or maintenance. Features may be described hereinwhich are not present in all hardware and software systems. GE Fanuc Automation assumesno obligation of notice to holders of this document with respect to changes subsequently made.

GE Fanuc Automation makes no representation or warranty, expressed, implied, or statutorywith respect to, and assumes no responsibility for the accuracy, completeness, sufficiency, orusefulness of the information contained herein. No warranties of merchantability or fitness forpurpose shall apply.

©Copyright 1995 GE Fanuc Automation North America, Inc.All Rights Reserved.

Page 3: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

B–62073E–2/03 Table of contents

i

PROGRAMMING

1. GENERAL 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1.1 OUTLINE 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

1.2 FEATURES 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2. MACRO COMPILER 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.1 OUTLINE 6. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.2 FLOW FOR CREATING, REGISTERING AND SAVING PROGRAMS 7. . . . . . . . . . . . . . . . . . . . .

2.3 USE OF MACRO COMPILER 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.1 Registering a P–CODE Program in F–ROM Using a Memory Card

(When Compiled with a Personal Computer) 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.2 Registering the P–CODE Program in F–ROM Using a ROM Cassette

(When the P–CODE Program has been Compiled with the System P or a Personal Computer) 14. . . . . 2.3.3 Compiling and Registering Custom Macro Programs in F–ROM Using the Series 15–B 19. . . . . . . . . . 2.3.4 P–CODE Program 23. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2.3.5 F–ROM 25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.4 COMPILE PARAMETER 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

2.5 ERROR CODE LIST 36. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3. EXECUTION MACRO 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1 INTERFACE WITH USER PROGRAM AND

EXECUTION MACRO IN P–CODE PROGRAM 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.1 Call Code and Program No. 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.2 Variables 43. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.1.3 Argument Designation 43. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.2 LIMITATION FOR EXECUTION MACRO 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.1 Argument Specification 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.2 Macro call 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.3 Variable 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.4 Custom Macro Commands 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.5 NC Commands Which Cannot be Used in Automatic Operation 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.6 Modal Call from Execution Macro 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.7 Calling a P–CODE Program from an Execution Macro Using the G, M, S, T, or B User Code 45. . . . . . 3.2.8 Calling a User Program Using an Execution Macro 45. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.9 Specifying of the G Code for Macro Calls of P–CODE Programs 45. . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.10 Calling a Macro Using a T Code 46. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.2.11 Macro and Subprogram Multiplexity in Execution Macro 47. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.3 DISPLAYING AND SETTING VARIABLES 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.1 User Program Common Variables (#100–#199, #500–#999) 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.2 P–CODE Program Common Variable (#100–#199, #500–#999) 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.3 P–CODE Program Local Variable (#1–#33) 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3.3.4 Variable Name Setting (SETVN) 48. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

3.4 CAUTIONS 49. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4. CONVERSATIONAL MACRO FUNCTION 50. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.1 OVERVIEW 50. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.2 CONVERSATIONAL MACRO FUNCTION 52. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.3 AUXILIARY MACRO FUNCTION 54. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.4 COORDINATE SYSTEM SCREEN 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.4.1 Character Coordinate System 56. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 4: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

B–62073E–2/03Table of contents

ii

4.4.2 Graphic Coordinate System 57. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.5 VARIABLE, FUNCTION AND CONTROL CODE 58. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.1 System Variable 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.2 P–CODE Program Exclusive Local Variables 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.3 Conversational Macro P–CODE Common Variables 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.4 UI and UO Signal Separation for User and P–CODE Programs 62. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.5 Conversational Macro Special Variables (#30000–) 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.6 Expanded Conversational Macro Exclusive Variable (#40000 –) 64. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.7 Reference and Writing System Common Variables 65. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.8 Execution Control Variable 65. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.9 Key Input Control Variable 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.10 Character String Registered Program Control Variable #8509 68. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.11 Arrangement Type Processing of Conversational Macro Exclusive Variable 69. . . . . . . . . . . . . . . . . . . . 4.5.12 Reference of Arrangement of Conversational Macro Exclusive Variables 70. . . . . . . . . . . . . . . . . . . . . . 4.5.13 Refer to and Read CNC Program with Conversation Macro 71. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.14 Reading of Cutting Time and Cutting Distance by Conver–Sational Macro, and Preset Functions 79. . . 4.5.15 PMC Axis Control by Conversational Macro 79. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.16 Torque Limit Override Control 82. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.17 A/D Converter Data Reading by Conversational Macro 84. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.18 Conversational Macro Variable Window Function 86. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.19 Reading Relative Coordinates by Conversational Macro, and Preset 96. . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.20 Address Function 97. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.21 Screen Display Control Codes 98. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.22 Execution Control Code 105. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.23 RS–232–C Control by Conversational Macro 106. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.24 File Control 115. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.25 Functions of PMC Address 121. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.26 PMC Address Control Code (G310) 122. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.27 Variable for Reading Remaining Shift Amount 123. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.5.28 Referring to NC Parameter 124. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

4.6 CONVERSATIONAL MACRO DEBUG FUNCTION 125. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.1 Overview 125. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.2 Displaying Macro Variables 125. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4.6.3 Conversational Macro Debugger Function 125. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

5. PARAMETER 128. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

APPENDIX

A. Macro Program Example 131. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . A.1 DESCRIPTION OF PROGRAMS 132. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.2 DESCRIPTION OF MACRO VARIABLES 133. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.3 SOURCE PROGRAM 134. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.4 FLOW CHART 139. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.5 PROGRAM EXPLANATION 143. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.6 PROGRAM DESCRIPTION 146. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.7 LIST OF KANJI AND HIRAGANA CODES 151. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

A.8 MACRO EXECUTOR FUNCTIONS 159. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Page 5: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

PROGRAMMING

Page 6: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 1.GENERAL

3

1 GENERAL

NC programs include those which are prepared by custom macro and veryseldom altered and those which may differ from one another according torelevant machining such as part programs. This function is that which convertsthe created custom macro program to execu–tion format (P–CODE program)at the machine tool builder and executes it. Further, the conversationalmacro can also be executed independently in parallel with a normal NCprogram by means of converting the conversational macro program toexecution format (P–CODE program).

M/T/G code call

Part program strage

User program Execution macro

executer

Conversational macro

executer

(Memory operation execution level)

CRT/MDI

Software key call

Parameter 8537 Parameter 8536

Control variable #8600 Control variable #8500

Auxiliary macro

executerProgram number change

Program number changeStartup by system variable

Programnumberchange

Startup by systemvariable

(when switching on power)

Macro compiler basic outline diagram

1.1OUTLINE

Page 7: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������1. GENERAL B–62073E–2/03

4

The words used in the explanation are defined as follows.

“P–CODE program” –––––

Execution type macroprogram prepared by machine tool builders,being compiled and registered to ROM.

“Execution macro” –––

Program to operate machine in P–CODE program.

“Conversational macro” –––

Program operated screen in P–CODE program.

“User program” –––––

Program prepared by end–user for program edit memory.

This manual describes the following products.

Model name Abbreviation

FANUC Series 15–TB 15–TBSeries 15B

FANUC Series 15–MB 15–MBSeries 15B

Page 8: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 1.GENERAL

5

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

(2) The registration to the ROM eliminates prevents custom macrodamage through misoperation. This will improve the reliability.

(3) Since the converted program into execution format is not indicatedon the program display, the machine tool builder’s knowhow can beprotected.

(4) Since the execution format program is registered in the ROM, theprogram edit memory can effectively be used.

(5) The user can call the execution format program (P–CODE program)with an easy call procedure without being conscious of the registeredprogram.

(6) Using the conversational function and conversational macro,execution can be performed.

(7) There is an auxiliary macro for executing regardless of the selectedmode and screen.

(8) Compiling the NC program, and ROM output can be performed bythe Series 15 itself.

(9) When compiled in Series 15, without writing the execution formatprogram to ROM, it can be started up as it is and execution/debug canbe performed.

1.2FEATURES

Page 9: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

6

2 MACRO COMPILER

A custom macro program is converted to executable form (hereaftercalled a P–CODE programs), then registered in flash ROM (hereaftercalled F–ROM). The registered P–CODE program can be called from theuser programs and executed by using the G, M or T code (executionMacro) or by setting the program number in the associated parameter(conversational macro execution).

Set parametersRegister programs

P–CODE programs and executer

Custom macro programs

O9000 ;#1=#2+#5 ;

::

M99 ;

Macro compiler (FANUC System P)

(Personal computer)

(FANUC Series 15–B)

Compile parameters

8500=100000018501=00000001

:::

8550=50

Compile

Write to ROM

F–ROM

NoteThe executer executes the P–CODE program generated bycompiling a custom macro program with the macro compiler.

2.1OUTLINE

Page 10: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

7

In Series 15–B, custom macro and P–CODE programs are created,registered and saved as follows.

(8) or (9)(7)

(9)

(8)

(2) (3)(6)

(5)

(4)F–ROM

Custom macroprogram

P–CODE program

Series 15–B

Memory card

P–CODE file

D–RAM

P–CODE program

ROM cassette

P–CODEprogram

(1)

Tape

(7) or (8)

PMC–writer

(7)

System P Personalcomputer

Custom macro program

No. Process Performed by

(1) Compile Series 15–B macro compiler

(2) ROM write Series 15–B macro compiler

(3) Activate P–CODE program CNC

(4) Load Boot system

(5) Save Boot system

(6) Load Boot system

(7) Compile System P macro compiler

(8) Compile Personal computer macro compiler

(9) Compile Personal computer macro compiler

2.2FLOW FORCREATING,REGISTERING ANDSAVING PROGRAMS

Page 11: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

8

The P–CODE program created by compiling a custom macro programcan be registered in F–ROM in any one of the following ways:

(1) When the P–CODE program is compiled with a personal computer,it can be registered in F–ROM using a memory card.

(2) When the P–CODE program is compiled with a personal computeror System P, it can be registered in F–ROM using a ROM cassette.

(3) Series 15–B can compile the P–CODE program for registration inF–ROM.

NoteThe P–CODE program resident in F–ROM can be savedonto a memory card via the boot system and copied toanother F–ROM unit.

This method uses a memory card to register a P–CODE programcompiled with a personal computer in the F–ROM unit of Series 15–B.For how to compile a program, refer to the FAPT Macro Compiler (forPersonal Computer) Programming Manual (B–66102E).

Register

Boot system

Custom macro programs

O9000 ;#1=#2+#5 ;

::

M99 ;

Memory card

Save

F–ROM

Personal

computer

Compile custom macro programsinto the P–CODE program.

Fig.2.3.1 (a) P–CODE Program Registration Using a Memory Card

2.3USE OF MACROCOMPILER

2.3.1Registering a P–CODEProgram in F–ROMUsing a Memory Card(When Compiled with aPersonal Computer)

Page 12: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

9

(1) Procedure for registering a P–CODE program in a memory card toF–ROM1) Insert the memory card in the memory card interface of the CNC

unit.

Memory card

PMC PSU

Series 15–B

Fig.2.3.1 (b) Mounting of a Memory Card

NoteThe PMC slot is used as the memory card interface. Thememory card can be inserted or removed while the poweris turned on. When the boot system is active, make sure thatthe main menu [see Fig. 2.3.1(c)] is displayed on the screenbefore inserting or removing the memory card. Otherwise,proper access is not made, and the contents of the memorycard files may be destroyed.

2) Turn on the power of the CNC unit while holding down thepage–up and page–down keys. The boot system is activated, andthe following screen appears.

SYSTEM MONITOR

1. SYSTEM DATA LOADING 2. SYSTEM DATA CHECK 3. SYSTEM DATA SAVE 4. FILE DATA BACKUP 5. END

*** MESSAGE *** SELECT MODE AND HIT INPUT KEY

Fig.2.3.1 (c) Boot System Main Menu

Page 13: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

10

3) Select ”2. SYSTEM DATA CHECK” using the cursor keys andpress the input key. The contents of F–ROM are retrieved, andthe following information is displayed on the screen:

SYSTEM DATA CHECK FILE DIRECTORY 1. OPTIONA3 ( 2) 2. HELP MSG ( 2) 3. DG SERVO ( 1) 4. NC BASIC (10) 5. PCD 256A ( 2) 6. PMC–NA0B ( 1) 7. MCR–CMPA ( 2) END

*** MESSAGE *** SELECT FILE AND HIT INPUT KEY

Fig.2.3.1 (d) DATA CHECK DIRECTORY Screen

Check this screen to see if any P–CODE programs are registered. If aP–CODE program is already registered, its file name is displayed (see thetable below).

����� 2.3.1 P–CODE File Names)

File name Description

PCD 256A For systems without a sub–CPU (256K bytes)

PCD 512A For systems without a sub–CPU (512K bytes)

PCD 256M For systems with a sub–CPU (256K bytes)

PCD 512M For systems with a sub–CPU (512K bytes)

4) If a P–CODE file is already registered, delete it. To delete aP–CODE file, select it with the cursor, then press the ”delete” key.When no P–CODE file is registered, proceed to step 7.

5) The message “DELETE OK?” appears. Make sure that the selectedfile is a P–CODE file, then press the input key. If the wrong file hasbeen selected, press the cancel key. The DATA CHECKDIRECTORY screen [Fig. 2.3.1(d)] is then displayed again.

NoteWhen an attempt is made to delete a system file, such asa CNC program or the macro compiler, the message”PROTECT FILE” appears on the screen and the attempt isrejected. However, the system deletes user files, such asthe PMC ladder, without asking for confirmation. Oncedeletion has started, the process cannot be halted. If nobackup file exists on a memory card or another storagemedium, the contents of the file cannot be restored in anyway. To avoid such inadvertent deletion of files, make surethat the correct file has been selected before deleting it.Also, back up user files at appropriate intervals.

Page 14: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

11

6) When the file has been successfully deleted, the message “DELETECOMPLETED” appears. Press the input key. The DATA CHECKDIRECTORY screen [Fig. 2.3.1(d)] 1 is then displayed again.Confirm that the P–CODE file is no longer listed.

7) Select ”END” and press the input key. The main menu [Fig.2.3.1(c)] is then displayed again.

8) Select “1. SYSTEM DATA LOADING” using the cursor keys,then press the input key. The directories in the memory card arelisted on the screen.

SYSTEM DATA LOADING FILE DIRECTORY 1. LADDER1. ROM 2. LADDER2. ROM 3. TEST. DAT 4. MACRO. ROM END

*** MESSAGE *** SELECT FILE AND HIT INPUT KEY

Title

Fig.2.3.1 (e) DATA LOADING DIRECTORY SCREEN

NoteIf a ROM cassette error occurs, check the title. When theboot system has been activated by holding down thepage–up and page–down keys, the title should read:

SYSTEM DATA LOADING.If this title is not displayed, turn off the system power once,then turn it on again.

For the functions of the boot system, see 2.3.5, (1) Methods of starting upthe boot system and the corresponding main menu functions.

9) Select the P–CODE file using the cursor keys, then press theinput key.

10)The message ”OK? INPUT/CANCEL” appears. To register theselected program, press the input key. To not register the selectedfile cancel, press the ”cancel” key. The DATA LOADINGDIRECTORY screen [see Fig. 2.3.1 (e)] is then displayed again.

Page 15: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

12

NoteThe boot system registers any file having the acceptableformat. Once registration has started, it cannot be halted.If no backup file exists on a memory card or another storagemedium, the previously saved data of the file cannot berestored in any way. To avoid such inadvertent registrationof files, make sure that the correct file has been selectedbefore registering it. Also, back up files at appropriateintervals.

11)When the file has been successfully registered, the message”PROGRAM COMPLETED” appears. Press the input key. TheDATA LOADING DIRECTORY screen [see Fig. 2.3.1 (e)] isthen displayed again.

12)Select “END” and press the input key. The main menu [Fig. 2.3.1(c)] is then displayed again.

13)Select “2. SYSTEM DATA CHECK” to retrieve the contents ofF–ROM. After confirming that the P–CODE file has beenregistered, press the input key to return the main menu [Fig. 2.3.1(c)].

14)Select “END” on the main menu and press the input key. Theblinking message “LOADING CNC DATA” appears. The CNCstarts up about ten seconds later.

15)Make sure that the registered P–CODE file operates normally.16)Remove the memory card from the memory card interface. The

card can be removed even when the CNC power is on.

(2) Procedure for registering a P–CODE program in F–ROM to amemory card1) Insert the memory card in the memory card interface of the CNC

unit to activate the boot system. See steps 1 and 2 of 2.3.1 (1),Procedure for registering a P–CODE program in a memory cardto F–ROM.

2) Select “3. SYSTEM DATA SAVE” using the cursor keys, thenpress the input key. The contents of F–ROM are retrieved, andthe following information is displayed on the screen:

SYSTEM DATA SAVE FILE DIRECTORY 1. OPTIONA1 ( 2) 2. HELP MSG ( 2) 3. DGTL SRV ( 1) 4. NC BASIC (10) 5. PCD 256A ( 2) 6. PMC–NA0B ( 1) 7. MCR–CMPA ( 2) END

*** MESSAGE *** SELECT FILE AND HIT INPUT KEY

Fig.2.3.1 (f) DATA SAVE DIRECTORY SCREEN

Page 16: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

13

3) Select one of the P–CODE files listed below using the cursor,then press the input key.

File name Description

PCD 256A For systems without a sub–CPU (256K bytes)

PCD 512A For systems without a sub–CPU (512K bytes)

PCD 256M For systems with a sub–CPU (256K bytes)

PCD 512M For systems with a sub–CPU (512K bytes)

NoteSystem files, such as the CNC program or the microcompiler, cannot be saved (if you attempt to save one ofthese files, the message ”PROTECT FILE” is displayed).

4) The message “INPUT FILE NAME” appears. Input the file nameusing the MDI key. A file must be named according to MS–DOSfile naming rules; that is, a file name consisting of up to eightcharacters followed by a three–character or shorter extension.During file name input:� The cursor can be moved using the cursor (� and �) keys.� The cancel key functions as the backspace key.� Pressing the reset key displays the DATA SAVE

DIRECTORY screen [Fig. 2.3.1 (f)] again.� Characters are input in the overwrite mode.

5) After inputting the file name, press the input key to save the file.6) If the save operation terminates normally, the message “SAVE

COMPLETED” appears. Press the input key. The DATA SAVEDIRECTORY screen [Fig. 2.3.1 (f)] is then displayed again.

7) Select “END” and press the input key. The main menu [Fig. 2.3.1(c)] is then displayed again.

(3) Specifications and limitations of the memory card(a) Specifications

The boot system of Series 15–B permits the use of commerciallyavailable memory cards conforming to the followingspecifications:

Standards : JEIDA Ver.4 or laterCapacity : 512K bytes or more

(b) P–CODE file sizeWhen a P–CODE file is saved onto a memory card, its size is asfollows:

File capacity Size on memory card

256K#bytes 262272#bytes (256K#bytes + 128#bytes)

512K#bytes 524416#bytes (256K#bytes + 128#bytes)

NoteA P–CODE file cannot be divided and saved onto two ormore memory cards. Prepare a memory card havingenough capacity to save the whole file. Two or moreP–CODE files can be saved onto the same card.

Page 17: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

14

(c) Limitations The boot system is capable of handling only root directory files.Subdirectory files are not accessible. Avoid using a memory cardwith a subdirectory for the boot system.

A P–CODE program compiled with the System P or a personal computercan be registered in F–ROM of Series 15–B by using a ROM cassette.For how to compile and write programs to ROM, refer to FANUC SystemP series FAPT Macro Compiler Operator’s Manual (B–66032E) andFAPT Macro Compiler (for Personal Computer) Programming Manual(B–66102E).

Register

Boot system

Custom macro programs

O9000 ;#1=#2+#5 ;

::

M99 ;

ROM cassette

F–ROM

Personal computer

Writing the P–CODEprogram into ROM

or

System P

Fig.2.3.2 (a) Registering the P–CODE Program Using a ROM Cassette

2.3.2Registering theP–CODE Program inF–ROM Using a ROMCassette (When theP–CODE Program hasbeen Compiled withthe System P or aPersonal Computer)

Page 18: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

15

(1) Writing data into a ROM cassette

ROM cassette

Personal computer

or

System P

Printed circuit board for the ROM cassette adapter

PMC writer

RS–232–C

POM cassette adapter

Series 15–B

Fig.2.3.2 (b) Writing Data into a ROM Cassette

The following are required to write data into a ROM cassette:

1) System P or a personal computer

2) RS–232–C cable

3) PMC writer (A13B–0126–B002)

4) Printed circuit board for the ROM cassette adapter(A16B–1212–0182)

5) ROM cassette: A02B–0094–C163 for 1M–bit ROM (256Kbytes)/A02B–0094–C164 for 2M–bit ROM (512K bytes)

6) Compiler for System P: COMPILER (A08B–0035–J720 forP–G Mate/A08B–0036–J720 for P–G Mark II)/LIBRARY(A08B–0036–J721 for both P–G Mate and P–G Mark II)

or FAPT macro compiler for a personal computer (A08B – 9001 – J540#EN03) /FAPT macro library (A08B–9001–J640#ZZ03)

7) ROM cassette adapter (A20B–2000–0760)

Page 19: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

16

NoteItems 1) to 5) were required when compiling programs forSeries 15–A using System P or a personal computer. Items6) and 7) have been required for Series 15–B additionally.

(2) Procedure for registering a P–CODE program in a ROM cassette toF–ROM

1) Connect the ROM cassette into which the program has beenwritten using System P or a personal computer to the ROMcassette adapter (A20B–2000–0760).

ROM cassette adapter(A20B–2000–0760)ROM

cassette

Fig.2.3.2 (c) Connection of the ROM Cassette to the ROM Cassette Adapter

2) Turn off the power of the CNC unit, then insert the ROM cassetteadapter into the mini slot of the CNC unit. The mini slot is onthe PSU and is protected with a cover when not in use.

ROM cassette

PMC PSU

Series 15–B

ROM cassette adapter

Fig.2.3.2 (d) Connection of the ROM Cassette Adapter to the CNC Unit

Page 20: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

17

NoteBe sure to turn off the power of the CNC unit before insertingor removing the adapter. Inserting or removing the adapterwhile the CNC power is on can not only damage the CNCunit and the ROM cassette but can also destroybattery–retained data, such as NC programs andparameters.

3) Turn on the power of the CNC unit while holding down the cursor(� and �) keys. The boot system is activated, and the followingscreen appears:

SYSTEM MONITOR

1. SYSTEM DATA LOADING 2. SYSTEM DATA CHECK 3. SYSTEM DATA SAVE 4. FILE DATA BACKUP 5. END

*** MESSAGE *** SELECT MODE AND HIT INPUT KEY

4) Check the contents of F–ROM. If a P–CODE program is alreadyregistered, delete it. For the deletion procedure, see 2.3.1 (1)Procedure for registering a P–CODE program in a memory cardto F–ROM, steps 3 to 7.

5) Select ”SYSTEM DATA LOADING” using the cursor keys, thenpress the input key. The following contents of the ROM cassetteare read and displayed on the screen:

SYSTEM DATA LOADING (CASSETTE) P–CODE 256K (WITHOUT SUB–CPU)

*** MESSAGE *** SELECT FILE AND HIT INPUT KEY

Title

ROMtype

Fig.2.3.2 (e) DATA LOADING DIRECTORY SCREEN (for ROM Cassette)

Page 21: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

18

The type of mounted ROM cassette (P–CODE file) is displayed(see the table below). If the displayed ROM cassette type does notagree with that of the connected ROM cassette, check the ROMcassette.

ROM cassette/P–CODE file Display

1M–bit ROM without a sub–CPU P–CODE 256K (without sub–CPU)

2M–bit ROM without a sub–CPU P–CODE 512K (without sub–CPU)

1M–bit ROM with a sub–CPU P–CODE 256K (with sub–CPU)

2M–bit ROM with a sub–CPU P–CODE 512K (with sub–CPU)

NoteIf an alarm related to the memory card occurs or whendisplaying memory card directories, confirm the title. Whenthe CNC unit has been activated with the cursor (� and �)keys pressed down, the title should read:

SYSTEM DATA LOADING (CASSETTE)If this title is not displayed, activate the CNC unit again.

6) The message “OK? INPUT/CANCEL” appears. To register theP–CODE file, press the input key. To not resister the P–CODEfile, press the “cancel” key. Then the main menu [Fig. 2.3.1 (c)]is then displayed again.

7) When the file has been successfully registered, the message“PROGRAM COMPLETED” appears. Press the input key. Themain menu [Fig. 2.3.1 (c)] is then displayed again.

8) Select “2. SYSTEM DATA CHECK” to retrieve the contents ofF–ROM. After confirming that the P–CODE file has beenregistered in F–ROM. Press the input key to return the mainmenu [Fig. 2.3.1 (c)].

9) Turn off the power of the CNC unit, and remove the ROMcassette adapter from the mini slot. After removing the adapter,place the cover over the slot to protect it.

NoteAvoid using the CNC unit while the ROM cassette remainsin its mini slot. If the CNC unit is used without removing theROM cassette, the data stored in the ROM cassette takesprecedence, disabling the use of the micro compiler andP–CODE program resident in F–ROM.For more information, see 2.3.4 (3), Priority of the microcompiler and P–CODE program.

10)Make sure that the registered P–CODE program operatesnormally.

Page 22: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

19

Custom macro programs resident in the part–program edit memory canbe compiled and registered in F–ROM using the Series 15–B.

Series 15–B

Register

Custom macro programs

O9000 ;#1=#2+#5 ;

::

M99 ;

Part–programedit memory

F–ROM

Compile

ÅÅÅÅ

Fig.2.3.3 (a) Compilation and Registration Using the Series 15–B

(1) Procedure for operating the micro compiler1) In part–program edit memory register all the custom macro

programs to be compiled into the P–CODE program.Be sure to compile a program into one P–CODE file at a time.Compiling a custom macro program into several P–CODE filesand then combining them into one file is not allowed.The compiler only checks programs for basic syntax error.

2) Set the compile parameters.Specify parameters necessary for program compilation, includingthose related to the conditions for P–CODE program generation andthe correspondence between call codes and program numbers. Thealarm message “POWER MUST BE OFF” may be displayed on thescreen while changing the compile parameters; ignore the messageand proceed with the parameter setting.

NoteFor details about the compile parameters, see 2.4, CompileParameters.

2.3.3Compiling andRegistering CustomMacro Programs inF–ROM Using theSeries 15–B

Page 23: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

20

3) When all the parameters have been set, turn off the power of theCNC.

4) Turn on the power of the CNC unit while holding down MDI keys4 and 6. The utility is activated, and the following screen appears:

FANUC SERIES 15 1. MACRO COMPILER 2. TROUBLE GUIDANCE 3. END ?

Fig.2.3.3 (b) Utility Screen

5) Select “1. MACRO COMPILER” from the menu by typing ”1”,then press the input key. The macro compiler is activated, and themenu screen appears.

FANUC SERIES 15 NC PROGRAM COMPILER 1. COMPILE 2. COMPILE AND ROM WRITE 3. COMPILE AND VERIFY ROM 4. END ?

Fig.2.3.3 (c) Menu Screen

6) Select the desired operation from the menu.

1 COMPILE: Compile custom macro programs. TheP–CODE file is not registered in F–ROM.

2 COMPILE AND ROM WRITE: Compile custom macroprograms and register the P–CODE file in F–ROM.

3 COMPILE AND VERIFY ROM: Compile custom macroprograms and verify the compiled file with the P–CODE filein F–ROM.

4 END: Terminate the compiler and return to the utility screen[Fig. 2.3.3 (b)].

Page 24: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

21

NoteSince the compiled P–CODE file is also written on RAM ofthe CNC unit, the P–CODE program can be executed afterthe complier is terminated, irrespective of whether it isregistered in F–ROM. While the selected operation is beingperformed, its number is displayed next to the questionmark (?). The question mark disappears when theoperation is completed.

7) The status of the operation being performed is displayed in thestatus indication area on the screen.

FANUC SERIES 15 NC PROGRAM COMPILER 1. COMPILE 2. COMPILE AND ROM WRITE 3. COMPILE AND VERIFY ROM 4. END

Status indication areaThe following data items are dis-played here depending on the selectedoperation, one of COMPILE, F–ROMERASE & BLANK CHECK, F–ROM WRITE, andF–ROM VERIFY.

Fig.2.3.3 (d) Status Indication Area

(1) COMPILECompilation can be suspended while it is in progress by pressing thereset key.

COMPILE PROGRAM NO. 9010 (Note 1) BLOCK NO. 120 (Note 2) P–CODE SIZE 00012EF0 (Note 3) ALARM NO. 0000 (Note 4) DIAGNOSIS 110 (Note 5)

Fig.2.3.3 (e) Status Indication (COMPILE)

(2) F–ROM ERASE & BLANK CHECKThe displayed indication remains unchanged while this operation isbeing performed. This operation cannot be suspended while it is inprogress.

Page 25: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

22

F–ROM ERASE & BLANK CHECK ADDRESS 00000000 (Note 6) ALARM NO. 0000 (Note 4) DIAGNOSIS 140 (Note 5)

Fig.2.3.3 (f) Status Indication (ERASE)

(3) F–ROM WRITEWriting of F–ROM can be suspended while it is in progress bypressing the reset key. However, avoid suspending this operationwhile it is in progress since doing so will shorten the life of theF–ROM unit.

F–ROM WRITE ADDRESS 00027A00 (Note 6) ALARM NO. 0000 (Note 4) DIAGNOSIS 150 (Note 5)

Fig.2.3.3 (g) Status Indication (WRITE)

(4) F–ROM VERIFYVerification of F–ROM can be suspended while it is in progress bypressing the reset key suspending this processing does not affect thelife of the F–ROM unit.

F–ROM VERIFY ADDRESS 00027A00 (Note 6) ALARM NO. 0000 (Note 4) DIAGNOSIS 160 (Note 5)

Fig.2.3.3 (h) Status Indication (VERIFY)

Page 26: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

23

Notes1 Number of the custom macro program being compiled

(number preceded by an O)2 Block number assigned by the macro compiler3 Total size of the compiled P–CODE file4 Alarm number of the error. If an error occurs, the micro

compiler suspends its operation. For details, see 2.5,ERROR CODE LIST.

5 This information is displayed for maintenance purposesonly. No special attention is required.

6 Address in F–ROM to which data is being written or forwhich verification is being performed

(1) P–CODE file sizeThe size of a P–CODE file can be either 256K bytes or 512K bytes.Whether the size is 256K bytes on 512K bytes depends on the settingof parameter No.8500 (P512) and whether the option (macro executoruser program memory) is used.

Bit No.#7 #6 #5 #4 #3 #2 #1 #0Address

8500 P512

Option : Macro executer user program memory with acapacity of 512K bytes (A02B–0162–J607)

P512 0 1

OptionUsed

256K#bytes512K#bytes

O tionNot used

256K#bytesError

Error : If 1 is specified for P512 when the option is not used,the P–CODE file size selection error (error number4109) occurs. For details, see 2.3.5 (3), F–ROMerrors and corrective action.

(2) P–CODE program sizeThe maximum size of a P–CODE program to be created depends onthe selected P–CODE file size as shown in the table below.

File size System without sub–CPU System with sub–CPU

256K#bytes 192K#bytes 128K#bytes

512K#bytes 416K#bytes 384K#bytes (Note)

NoteWhen a file size of 512K bytes is selected for a system witha sub–CPU, a total of 384K bytes is allocated as theP–CODE program area. Of these 384K bytes, 128K bytesare used for the execution macro.

(3) Priority of the macro compiler and P–CODE programThe priority of the macro compiler and P–CODE program is asfollows.

2.3.4P–CODE Program

Page 27: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

24

1. P–CODE program in resident ROM cassette2. P–CODE program in resident F–ROM3. Macro compiler

P–CODE programin ROM cassette

P–CODE program in F–ROM

Macro compile

How to activate CNC Result

Resident No effect on priority no ope The P–CODE program in the ROM cas-sette is activated.

“4”, “6” The compiler is not activated.

Not resident Resident Resident no ope The P–CODE program in F–ROM is acti-vated.

“4”, “6” The compiler is activated.

Not resident no ope The P–CODE program in F–ROM is acti-vated.

“4”, “6” The compiler is not activated.

Not resident Resident no ope The P–CODE program in not activated.

“4”, “6” The compiler is activated.

Not resident no ope The P–CODE program in not activated.

“4”, “6” The compiler is not activated.

no ope : Turn on the power of the CNC unit.“4”, “6” : Hold down MDI keys 4 and 6 while turning on the power of the CNC unit.)

Priority changes depending on how the CNC unit is activated.}

Page 28: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

25

(1) Methods of starting up the boot system and the corresponding mainmenu functionsThe following table lists the main menu items and their functions.(The function of SYSTEM DATA LOADING changes depending onhow the boot system is started up.)

Main men itemHow to start up the boot system

Main menu item“page up key”. “page down key” “�”, “ �”

SYSTEM DATA LOADING Load files from memory card to F–ROM. Load files from ROM cassette to F–ROM.

SYSTEM DATA CHECK List files registered in F–ROM and check ROM data.

SYSTEM DATA SAVE Save files registered in F–ROM to memory card.

FILE DATA BACKUP Save battery–retained data (NC programs, parameters, etc.) to memory card andrestore these data.

(2) Files in F–ROMThe following table lists the files shown on the SYSTEM DATACHECK DIRECTORY screen that are related to the micro compilerexecuter.

File name Type Description

MCR–CMPA S Micro compiler for systems without a sub–CPU

MCR–CMPM S Micro compiler for systems with a sub–CPU

PCD 256A U P–CODE file for systems without a sub–CPU(256K bytes)

PCD 512A U P–CODE file for systems without a sub–CPU(512K bytes)

PCD 256M U P–CODE file for systems with a sub–CPU (256K bytes)

PCD 512M U P–CODE file for systems with a sub–CPU (512K bytes)

File typeS : System files provided by FANUC.

Note)These files are used to compile custom macro programs withthe Series 15–B.

The following operations cannot be performed for these files:

� Saving files to memory card

� Deleting files from F–ROM

U : User–defined data files. These files are accessible in every operation.

2.3.5F–ROM

Page 29: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

26

(3) F–ROM errors and corrective actionThe following table lists F–ROM errors caused by erroneousoperations and the corrective actions to be taken for then.

Error Cause Corrective action

Error code 4109 is output. Parameter No.8500 is set to 512Kbytes when the option (user programmemory with a capacity of 512K bytes)is not used.

Check and correct the parameter.

The compiler is not activated when theCNC is powered up with MDI keys 4

d 6 d d

The ROM cassette is still in the slot. Turn off the CNC power and removethe cassette.

and 6 pressed down. The compiler is not registered inF–ROM.

Check the SYSTEM DATA CHECKDIRECTORY screen. If the compiler isnot listed there, register it.

The wrong compiler is registered. Thecompiler for systems without a sub–CPU is inadvertently registered forsystems with a sub–CPU, or viceversa.

Check the SYSTEM DATA CHECKDIRECTORY screen. If the wrongcompiler is listed there, register thecorrect one.

The newly registered P–CODE pro-gram is not activated. The old one is

ti t d i t d

The ROM cassette is still in the slot. Turn off the CNC power and removethe cassette.

activated instead. ”COMPILE AND VERIFY ROM” wasselected instead of ”COMPILE ANDROM WRITE” when compiling files

Select ”COMPILE AND ROM WRITE”and execute it.

The P–CODE program does not oper-ate at all.

The P–CODE program is not regis-tered in F–ROM.

Check the SYSTEM DATA CHECKDIRECTORY screen. If the P–CODEprogram is not listed there, register it.

The compiler was terminated beforecompilation was completed.

Re–execute compilation.

Parameters are not set. Set the parameters correctly, then re–execute compilation.

The meassage ”USER FILE(P–CODE): ILLEGAL KIND FILE” isdisplayed when the CNC power isturned on.

The P–CODE program for the wrongsystem is registered. The program forsystems without a sub–CPU is inad-vertently registered for systems with asub–CPU, or vice versa.

Check the SYSTEM DATA CHECKDIRECTORY screen. Delete the regis-tered P–CODE program, then registerthe correct one or compile the pro-grams.

Page 30: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

27

Bit No.#7 #6 #5 #4 #3 #2 #1 #0Address

8500 0 P512 VERY

Parameter inputData format : bit typeVERY When “COMPILE AND ROM WRITE” is executed, F–ROM is

0 : not verified1 : verified

P512 The size of the P–CODE program to be output to F–ROM is

0 : 256K bytes (the same size as that used in the 1M bit ROMcassette)

1 : 512K bytes (the same size as that used in the 2M bit ROMcassette)

#4 Always specify a “0.”

#7 Always specify a “1.”

#7 #6 #5 #4 #3 #2 #1 #0Address

8501 SEQN

Parameter inputData format : bit typeSEQN Outputs sequence number to P–CODE program

0 : does not1 : does

#7 #6 #5 #4 #3 #2 #1 #0Address

8502 NPEF TMCC EUI0 DMV2 DBG SBK VAR DIR

Parameter inputData format : bit typeDIR Displays directory of P–CODE program.

0 : does not1 : does

VAR In case of debug mode, displays macro variable for macrocompiler

0 : does not1 : does

SBK Single block stop when conversational macro is started up indebugging function of conversational macro

0 : does not1 : does

DBG Execution of macro compiler in debug mode

0 : does not perform1 : performs

Note) DIR, VAR, SBK are enabled only when debugging mode (DBG= 1).Auxiliary macro cannot be executed during debugging mode

DMV2 When not in the debug mode, micro compiler variables are

0 : not displayed

2.4COMPILEPARAMETER

Page 31: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

28

1 : displayedEUI0 For the P–CODE program (execution, conversational, and

auxiliary macros), the UI and UO signals range from0 : UI00/UO00 to UI15/UO151 : EUI00/EUO00 to EUI15/EUO15

TMCC Macro calls by T codes are0 : invalid1 : valid

NPEF In RS–232–C control by conversational macros, the end of file(EOF) mark (%) is0 : output1 : not output

#7 #6 #5 #4 #3 #2 #1 #0Address

8503 VR7 VR6 VR5 VR4 VR3 VR2 VR1 VR0

Parameter inputData format: bit typeVR0 Macro variable for macro compiler (#100–149)

0 : uses the same as normal custom macro1 : uses one for macro compiler

VR1 Macro variable for macro compiler (#150–199)0 : uses the same as normal custom macro1 : uses one for macro compiler

VR2 Macro variable for macro compiler (#500–549)0 : uses the same as normal custom macro1 : uses one for macro compiler

VR3 Macro variable for macro compiler (#550–599)0 : uses the same as normal custom macro 1: uses one for macro compiler

VR4 Macro variable for macro compiler (#600–699)0 : uses the same as normal custom macro1 : uses one for macro compiler

VR5 Macro variable for macro compiler (#700–799)0 : uses the same as normal custom macro1 : uses one for macro compiler

VR6 Macro variable for macro compiler (#800–899)0 : uses the same as normal custom macro1 : uses one for macro compiler

VR7 Macro variable for macro compiler (#900–999)0 : uses the same as normal custom macro1 : uses one for macro compiler

#7 #6 #5 #4 #3 #2 #1 #0Address

8507 PMC–NB STDM ECAN

Parameter inputData type: Bit typeECAN While data receiving (G335) or data sending (G336) is in the

wait state under conversational macro RS–232–C control,pressing the CANCEL key on the MDI/CRT panel:

Page 32: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

29

0 : Does not suspend data sending or receiving.1 : Cancels the wait state for data sending or receiving.

STDM On the conversational macro screen, status display (mode andstatus display) is:0 : Not masked.1 : Masked.

PMC-NB If the system features PMC–NB, writing or reading oftwo–byte or four–byte data by G310 is done in the:0 : PMC–NA format.

Two–byte data :The high–order byte is assigned A. The low–order byte isassigned A + 1.Four–byte data :The bytes are read or written in a sequence such that thehigh–order byte is assigned the lowest address A, while thelow–order byte is assigned the highest address A + 3.

1 : PMC–NB format.Two–byte data :The low–order byte is assigned A. The high–order byte isassigned A + 1.Four–byte data :The bytes are read or written in a sequence such that thelow–order byte is assigned the lowest address A, while thehigh–order address is assigned the highest address A + 3.

2 bytes 4 bytes

A

A+1

A

A+1

A+2

A+3

#7 #6 #5 #4 #3 #2 #1 #0Address

8508 EXT1 CUTL BCAL ONMK SCAL TCAL ACL2 ACL1

Parameter inputData format: bit typeACL1 Sub program call by designated code (O9004/#146)

0 : disabled1 : enabled

ACL2 Sub program call by designated code (O9005/#147)0 : disabled1 : enabled

TCAL Sub program call by T code (O9000/#149)0 : disabled1 : enabled

SCAL Sub program call by S code (O9029/#147)0 : disabled1 : enabled

ONMK O,N number display in conversational macro screen

Page 33: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

30

0 : performs1 : does not perform

BCAL Sub program call by B code (O9028/#146)

0 : disabled1 : enabled

CUTL Cutting distance

0 : does not integrate1 : integrates

EXT1 Reference/writing of CNC program, reading/ preset of cuttingdistance function, and circuit control function

0 : does not perform1 : performs

#7 #6 #5 #4 #3 #2 #1 #0Address

8509 PGMP PTCR MODC EVF2 EVF1

Parameter inputData format: bit typeEVF Expanded conversational macro exclusive variable (#40000–) is

0: floating decimal point format1: fixed decimal point format

EVF2 Format of conversational macro special variables (#30000 to#39999)

0: Floating–point1: Fixed–point

MODC Macro modal call

0: Call after move (corresponding to G66)1: Block–by–block call (corresponding to G66.1)

PTCR CR code output after LF at the time of macro variable dataoutput

0: Outputs no CR code.1: Outputs a CR code twice.

PGMP Calling a P–CODE by using an M code, S code, T code, B code, Mcodes specifying a range, or a specific code during a P–CODE call bya G code, and calling a G code during a P–CODE call by using an Mcode, S code, T code, B code, M codes specifying a range, or aspecific code are:

0 : permitted1 : not permitted (codes are executed in the normal way)

Address

8510 Sub program M–CODE for calling 09001

8511 Sub program M–CODE for calling 09002

8512 Sub program M–CODE for calling 09003

Parameter inputData format : word typeData range : 0 to 9999Specifies M–CODE to perform sub program call by M–CODE.

Page 34: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

31

Address

8513 Custom macro G–CODE for calling O9010

8514 Custom macro G–CODE for calling O9011

8522 Custom macro G–CODE for calling O9019

Parameter inputData format : word typeData range : 1 to 255 (except for 65 to 67)Specifies G–CODE to perform macro call by G–CODE.

Address

8523 Custom macro M code to call O9020

8524 Custom macro M code to call O9021

8532 Custom macro M code to call O9029

Parameter inputData format : word typeData range : 0 to 9999Specifies M–CODE to perform macro call by M code.

Address

8533 M code for calling a user program

Parameter inputData type : WordValid data range : 0 to 99Note)M00, M01, M02, M30, M98, and M99 cannot be used to call a user

program.

A P–CODE program (execution macro program) called by a user programcan call another user program as a subprogram, according to the specifiedM code.

Address

8536 Value of conversational macro execution control variable 1 when turning on power

Parameter inputData format : word typeData range : 0 to 9999Sets the program number of the first conversational macro to be executedafter power–on. This value is set in conversational macro executioncontrol variable 1 (#8500).

Address

8537 Value of conversational macro execution control variable 2 when turning on power

Parameter inputData format : word typeData range : 0 to 9999

Page 35: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

32

Sets the program number of the auxiliary macro to be executed atpower–on. This value is set in conversational macro execution controlvariable 2 (#8600).

Address

8538 Calls by range specified M–CODE, lower limit M–CODE

8539 Calls by range specified M–CODE, upper limit M–CODE

Parameter inputData format : word typeData range : 0 to 9999Specifies the upper limit/lower limit value of the M–CODE for subprogram call by range specified M–CODE.Note)The special M–CODES M00, M01, M02, M30, M99 cannot be

used even when inside the range.

Address

8540 Timeout period (seconds) for data receiving (G335) or data sending (G336) under conversational macro RS–232C control

Parameter inputData type : WordUnits of data : SecondsValid data range : 0 to 180Note) If zero is set, no timeout occurs in either data sending or receiving.

Address

8541 Conversational macro debug start key

Parameter inputData format : byte typeData range : 1 to 21After the single block stop of the conversational body macro, when inconversational macro debug mode, set the key code for restarting. Referto (Note) for the correspondence between the key code to be set and thekey.

Address

8542 Conversational macro debug single block switching key

Parameter inputData format : byte typeData range : 1 to 21Set the key code for switching ON/OFF the single block of theconversational body macro when in conversational macro debug mode.Refer to (Note) for the correspondence between the key code to be set andthe key.

Address

8543 Conversational macro debug trigger point setting key

Parameter inputData format : byte typeData range : 1 to 21

Page 36: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

33

Set the key code for executing the conversational body macro up to triggerpoint when in conversational macro debug mode. Refer to (Note) for thecorrespondence between the key note to be set and the key.

Note)Setting the MDI/CRT key for the conversational macro debug function is as follows.

PAGE � : 1 SOFT FUNCTION KEY 3:14PAGE � : 2 SOFT FUNCTION KEY 4:15CURSOR LEFT : 5 SOFT FUNCTION KEY 5:16CURSOR RIGHT : 6 SOFT FUNCTION KEY 6:17INPUT : 8 SOFT FUNCTION KEY 7:18SOFT FUNCTION KEY RIGHT : 11 SOFT FUNCTION KEY 8:19SOFT FUNCTION KEY 1 : 12 SOFT FUNCTION KEY 9:20SOFT FUNCTION KEY 2 : 13 SOFT FUNCTION KEY 10:21

SOFT FUNCTION KEY LEFT, POS, OFSET, and other keys used todirectly select a screen have specific functions. The functions of thesekeys cannot be changed.

POS, OFSET, etc: Clears the current screen and displays thecorresponding NC screen.

SFT KEY LEFT: Terminates the conversational macro.

The 14” CRT can be set as SOFT FUNCTION KEY 1–SOFTFUNCTION KEY 10,

and the 9” CRT can be set as SOFT FUNCTION KEY 1–SOFTFUNCTION KEY 5. Further, set without giving importance to the keysetting.

Address

8544 Address to call O9004 (argument #146)

Parameter inputData format : byte typeData range : “A” to “Z” (character code)Calls O9004 by the set address when parameter No. 8508 ALC1 is 1. Thecommand value of that address is stored as an argument in #146.

Address

8545 Address to call O9005 (argument #147)

Parameter inputData format : byte typeData range : “A” to “Z” (character code)Calls O9005 by the set address when parameter No. 8508 ALC2 is 1. Thecommand value of that address is stored as an argument in #147.

Address

8546 Quantity

Parameter inputData type : ByteValid data range : 0 to 40Sets the number of G codes to be added for calling P–CODE macros.

Page 37: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

34

Address

8547 Conversational macro Trigger program number

Parameter inputData format : long typeData range : 0 to 9999Set the trigger program number of the conversational macro when inconversational macro debugging mode.

Address

8548 Conversational macro Trigger sequence number

Parameter inputData format : long typeData range : 0 to 99999Set the trigger sequence number of the conversational macro when inconversational macro debugging mode.

Address

8549 A number of conversational macro exclusive variables (#30000–)

Parameter input

Data format : word typeData range : 0 toThe upper limit of the conversational macro exclusive variables is

0 : 30000+ (value of parameter No. 8549)�40–11 : 30000+ (value of parameter No. 8549)�100–1

Address

8550 A number of conversational macro exclusive variables (#40000–)

Parameter inputData format : word typeData range : 0 toThe upper limit of the conversational macro exclusive variables is

40000+ (value of parameter No. 8550)�10–1when parameter No. 8509 EVF is 0, and40000+ (value of parameter No. 8550)�30–1when parameter No. 8509 EVF is 1.

Address

8551 First G–code number among the G codes to be called

Parameter inputData type : WordValid data range : 0 to 9999Sets the first G–code number among the G codes to be used to add G codesfor calling P–CODE macros.

Page 38: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

35

Address

8552 First program number among the programs to be called

Parameter inputData range : WordValid data range : 0 and 9000 to 9999Sets the first program number among the programs to be called by the Gcodes added for calling P–CODE macros.

Page 39: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

36

The meanings of error codes which should occur in compilation are givenbelow.

ÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔ

Table 2.5 Error code list (1/3)

Errorcode Meaning

0201 Number of programs exceeds 400.

0202 There is not program.

1001 Block delete No. is provided with decimal point.

1002 Block delete No. is other than 1–9.

1003 The program No. is placed but not at the program head.

1004 The sequence No. is placed but not at the block head.

1005 There is an error in the NC statement format.

1006 Code other than EOB is placed at the end of the macro statement.

1007 The equal sign of macro statement is missing.

1008 The multiplexity of DO exceeds 3.

1009 The relational operator in the conditional expression is missing.

100A GOTO is missing after IF.

100B ’]’ of IF [<conditional expression>] is missing.

100A GOTO is missing after IF.

100B ’]’ of IF [<conditional expression>] is missing.

100C There is code other than EOB after GOTO n.

100D There is code other than EOB after DO m.

100E There is code other than EOB after END m.

100F The identification No. of END does not correspond to DO.

1010 There is no END corresponding to DO.

1011 DO after WHILE is missing.

1012 ’]’ of WHILE [<Conditional expression>] is missing.

1013 There is a block which is judged neither as an NC statement nor as a macro sentence.

1014 There is no DO corresponding to END.

1015 The directory program No. does not correspond to the program No. in the program.

1016 Program No. is missing at the head of program.

1201 The multiplexity of parentheses exceeds 5.

1202 ’]’ of #[expression>] is missing

1203 ’]’ of [<expression>] is missing.

1204 The second ’[’ of ATAN [<Expression>]/[<Expression>] is missing.

1205 ’/’ of ATAN [<Expression>]/[<Expression>] is missing.

1206 The first ’]’ of ATAN [<Expression>] is missing.

1207 ’]’ of the function [<Expression>] is missing.

1208 There is an error in the format of <Expression>.

1209 There is an error in the format of the <Expression> to the left of the substitution statement.

120A There is an error in the format of the <Expression> in <Address> [<Expression>], or <Address>–[<Expres-sion>], or GOTO [<expression>].

1401 The numeric word exceeds 8 digits.

1402 There is code other than a numeric code after decimal point.

1403 The variable No. of the macro variable exceeds 6 digits.

1404 Something found after # is neither a numeric code nor ’[’.

1405 The pro ram No. exceeds 4 digits.

1406 The sequence No. exceeds 4 digits.

1407 ’[’ of the function IF [<Expression>] is missing.

1408 ’[’ of IF [<Conditional expression>] or WHILE (<Conditional expression>] is missing.

2.5ERROR CODE LIST

Page 40: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 2.MACRO COMPILER

37

ÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔ

Table 2.5 Error code list (2/3)

Errorcode Meaning

1409 m of ”DO m” or ”END m” exceeds 1 digit.

140A m of ”DO m” or ”END m” is another than 1–3.

140B A code other than a numeric code is found behind DO or END.

140C There is an alphabetic spelling other than a control command and a function.

140D There is an alphabetic spelling of more than 5 characters.

140E EOR is missing at the program end.

140F There is a code which is not used in the program.

1410 The length of the character string exceeds 255.

1411 The internal code exceeds 4 digits.

1412 The internal code is not of a hexadecimal expression.

1413 A non–displayable internal code is commanded.

1414 The command of the character string starting with ’(*’ is not terminated ith ’*)’.

1415 There is an unallowable character between ’(’ and ’)’.

1601 The area of temporary variable used by the executor is insufficient. There are too many addresses including<Expression> in 1 block NC sentence.

1602 The destination of GOTO is too far. Reduce the program size.

1603 The number of addresses in 1 block NC statement exceeds 50.

1604 The macro variable No. exceeds 6 digits.

1605 The macro variable No. is negative.

1606 There is a decimal point in the macro variable No.

1607 The numeric code after GOTO exceeds 4 digits.

1608 There is a decimal point in the numeric code after GOTO.

1681 GOTO sentences directly designating the sequence No. exceed 100 in one program.

1682 The sequence No. to which jump is commanded by GOTO is missing.

1683 WHILE statement exceed 100 in number in one program.

1684 There are several sequence Nos. to which a jump is commanded by GOTO.

1801 The ROM cassette overflows.

2001 Time has run out for receiving from the PMC writer.

2002 A parity error occurred during receiving from the PMC writer.

2003 An overrun error occurred during receiving from the PMC writer.

2004 A framing error occurred during receiving from the PMC writer.

2005 The PMC writer is not ready. Or the reader/puncher interface cable is not connected.

2006 An error occurred at a transfer to the PMC writer.

2007 A parity error occurred at a transfer to the PMC writer.

2008 The ROM is not erased.

2009 A ROM writing error occurred.

200A A ROM verify error occurred.

200B The ROM cassette is not set.

200C Another ROM cassette than order–made macro is set.

200D The PMC writer edition is wrong.

200E An error occurred in the PMC writer.

200F RESET key is depressed during processing.

2010 An odd number is designated as address or the length for the PMC writer.

2011 Writing was tried exceeding the capacity of ROM cassette connected.

2012 The baud rate is inadequately set.

3000 Normal termination

Page 41: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������2. MACRO COMPILER B–62073E–2/03

38

ÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔÔ

Table 2.5 Error code list (3/3)

Errorcode Meaning

3001 There is no receive data.PC–writer is busy.

3002 Number of characters in transmitted data does not match.

3003 Parity error occurred during transmission.

3004 ROM is not erased.

3005 ROM program error occurred.

3006 Verification error with ROM occurred.

3007 Error other than those indicated above occurred with PC–writer.

3008 Power to PC–writer is turned off.RS–232–C cable is not connected.Cable is not connected to logical channel specified in parameter.

3009 Carry signal was driven low during data transmission.

300A Overrun error occurred.

300B Framing error occurred.

300C Ten or more characters were entered after termination request.

300D Invalid instruction was issued to ACI–IOS.

300E Reset key was pressed.

300F RS–232–C interface is already opened.

3010 Baud rate other than 4800 bps is set.

3011 P.C.B is not set.

3012 Another ROM cassette is set.ROM cassette is not set.

3013 Odd–numbered address or size is set.

3014 Size larger than ROM size was specified.

3015 Parameter is not set correctly.

4000 Normal termination.

40FB A file type that cannot be output to F–ROM is specified.

40FE An invalid command was input for F–ROM.

40FF The reset key was pressed (canceled).

4101 The file cannot be written to F–ROM.

4102 The file cannot be read from F–ROM.

4103 The file cannot be deleted from F–ROM.

4104 An attempt was made to read a file from a position which is beyond the file size.

4105 No file is resident in F–ROM.

4106 An attempt was made to write a file having a size which exceeds the specified size.

4107 A verification error occurred.

4108 The ROM number range was exceeded.

4109 A file size of 512K bytes is specified when the option is not used.

Page 42: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

39

3 EXECUTION MACRO

Only a registered P–CODE program cannot be executed. It is called fromthe user program by G, M, T code, or specified code by parameter setting,and executed. In case of macro call, argument designation is possible, andit is compared as a local variable at the P–CODE (execution macro) side.Further, for the specification method for the argument, in the same manneras the normal NC macro, there are possible 2 types of specificationmethods, argument specification I, argument specification II, or amixture of argument specification I and II. Regarding argumentspecification I and argument specification II, refer to FANUC SeriesOPERATOR’S MANUAL (macro call command). Moreover, if a minusvalue is set at parameter as for macro call by G code, modal call ofP–CODE program can be done by corresponding G code.

P–CODE program insidemacro ROM cassette(execution macro)

User program(Program edit memory)

Parameter8513 � 101

G–CODE callM–CODE callT–CODE callS–CODE callB–CODE call

O0001 ;G92X0Y0 ;G00X100. Y100. ;� � � � � �G101 <Argument>

� � � � � �� � � � � �M02 ;

O9010 ;� � � � � �#100=#100+10 ;� � � � � �M99 ; � � �

To call a P–CODE program from the user program, call with G, M, or Tcode as indicated above.)

Call code Call mode Called programnumber

Variable number inwhich the specified

code is stored

Parameter to be spe-cified

T Subprogram call 9000 #149 TCAL (No. 8508#2)

M Subprogram call 9001–9003 Unused No. 8510–8512

S Subprogram call 9029 #147 SCAL (No. 8508#3)

B(Second miscella-

neous function code)

Subprogram call 9028 #146 BCAL (No. 8508#5)No. 1030

G Macro call Continuouscall

9010–9019 Unused No. 8513–8522MODC (No. 8509#2)

3.1INTERFACE WITHUSER PROGRAMAND EXECUTIONMACRO IN P–CODEPROGRAM

3.1.1Call Code and ProgramNo.

Page 43: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������3. EXECUTION MACRO B–62073E–2/03

40

Call code Parameter to be spe-cified

Variable number inwhich the specified

code is stored

Called programnumberCall mode

M Macro call 9020–9029 Unused No. 8523–8532

Special Subprogram call 9004, 9005 #146, #147 ACL1, ACL2 (No.8508#0, #1) No. 8544,8545

Range–designation M Subprogram call 9009 #148 No. 8538, 8539

Range–designation G Macro call Specified in theparameter

Unused No.8546No. 8551, 8552

T Macro call 9008 #27 TMCC (No. 8502#6)

NoteIf the system features a SUB–CPU, only programs 9000 to9999 can be stored and executed as execution macros.

The priorities of calling custom macros by G, M, S, T, and B, and callingmacro executors by G, M, S, T, and B are as follows:

High LowPriority

Calling custommacros by G, M, S,T, and B

Calling macroexecutors by G, M,S, T, and B

Calling macroexecutors by specialcodes

Calling macroexecutors byM–code with rangespecified

> > >

Call of each macro, comparison of subprogram call code and programnumber to be called is determined by a compile parameter.

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

(2) Macro modal call is enabled by setting a negative value in theG–CODE parameters (Nos. 8513 to 8522) for macro call. Forexample, –11 set in a parameter represents G11 for a modal call state.Whether the modal call state corresponds to G66 or G66.1 dependson parameter No. 8509, MODC.The macro modal call function can be used to call a P–CODE programfrom a CNC program. The function cannot be used to call a P–CODEprogram from a P–CODE program.G67 is used for modal call cancellation.For the detailed specifications, refer to the description of macro callusing G–CODEs in the FANUC Series 15 operator’s manual.

When parameter No. 8513=–100, and parameter No. 8509 MODC=0

CNC program

G91 G01 F100. ;

Example

Page 44: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

41

G100 ; � � � Modal call state ONX10.; � � � Calls O9010 after move.X10.; � � � Calls O9010 after move.G90; � � � Does not call O9010.Y20.; � � � Calls O9010 after move.G67; � � � Modal call state OFF

P–CODE program

09010;Z5.;Z–5.;M99;

Notes1 No P–CODE program can be called from a P–CODE

program in the modal call mode.2 In the modal call state, no P–CODE program can be called

in the macro call or subprogram call mode.

(3) Subprogram call using special codesBy setting character codes (decimal notation of ASCII codes) to theparameters (No. 8544,8545), the P–CODE program (09004, 09005)corresponding to the address can be called as a subprogram. Thedefined integer will be stored as a parameter to the macro variable(#146, #147). The actual use of this function is decided by specifyingthe appropiate parameter (No.8508 ACL1 ACL2).

When parameter

No. 8508, ACL1=1No. 8544=66

User program

O0001 ;:

G00 X123. B100. ;:

M02 ;

P–CODE program

O9004 ;(#146=100.)

Notes1 Addresses that can be specified are all the addresses with

the exception of those used by G, O, N, P. L, and the axis.2 When program calls such as G65, M98, T code are specified

in the same block, G65, etc. has priority.

(4) M code subprogram call specified range M codeSub program call of the ”9009” P–CODE program can be performedby specifying the M–CODE of the range specified by parameter No.8538, 8539. At this time, the commanded M code is stored as anargument in macro variable #148.

Example

Page 45: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������3. EXECUTION MACRO B–62073E–2/03

42

When parameterNo. 8538=50 No. 8539=60M50–M60 become the M codes to call “09009”.

Notes1 When parameter No. 8538 is 0, this processing cannot be

performed.2 When the value of parameter No. 8538 is specified as

greater than the value of 8539, it will not operate correctly.3 Special M codes M00, M01, M02, M30, M99 cannot be used

even they are inside the range.4 When program calls such as G65, M98, T code are specified

in the same block, G65, etc. has priority.

(5) Subprogram call (O9000) by T–codeBy setting the parameter (No. 8508, TCAL), a T–code can be used tocall the P–CODE program (O9000) as a subprogram. At this time,a specified numeric value is stored as an argument in the macrovariable (#149).The program check screen displays a T–code, but TF and T–codes arenot transmitted.

(6) Subprogram call (O9029) by S–code By setting the parameter (No. 8508, SCAL), an S–code can be usedto call the P–CODE program (O9029) as a sub–program. At thistime, a specified numeric value is stored as an argument in the macrovariable (#147).The program check screen displays an S–code, but SF and S–codesare not transmitted.

(7) Subprogram call (O9028) by B–code (second auxiliary functioncode)By setting the parameter (No. 8508, BCAL), a second auxiliaryfunction code (set in parameter No. 1030) can be used to call theP–CODE program (O9028) as a subprogram. At this time, a specifiednumeric value is stored as an argument in the macro variable (#146).The program check screen displays a second auxiliary function code,but BF and second auxiliary function codes are not transmitted.

(8) Subprogram call by M code (O9001 – O9003)By commanding designated M codes, the P–CODE programs”O9001 – O9003” registered to the ROM can be called forsubprograms. All the local variables are < Blank >.

N_ _ G_ _ X_ _ Y _ _ M<mm>;

(9) Macro call by G code (O9010 – O9019)By commanding designated G codes, the programs ”O9010–O9019”registered to the ROM can be called to macro.Local variables without argument designation are <Blank>.

N_ _ G <gg> Argument designation>;

Example

Page 46: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

43

(10)Macro call by M code (O9020 – O9029)By commanding designated M codes, the P–CODE programs”O9020 – O9029” can be called by macro.Local variables without argument designation will become <Blank>.

N_ _ M <mm> Argument designation>;

(1) P–CODE local variables for automatic operation (#1–#33)The local variable to be used by the automatic operation P–CODEprogram is the same as the local variable to be used by the normal NCmacro.

(2) P–CODE common variable for automatic operation (#100–#199, #500–#999)Whether the common variable to be used by the P–CODE programis the same as that used by the normal NC macro or whether it isdifferent can be selected by parameter (No. 8503). Further, when it is a different one, the common variable for theP–CODE program can be displayed after the normal macro variableby setting the parameter (No. 8502 #1 or No. 8502 #4).

Argument specification is possible in the case of macro call. It can bereferred to as a local variable on the P–CODE program side.

For the specification method for the argument, in the same manner as thenormal NC macro, there are possible 2 types of specification methods,argument specification I, argument specification II, or a mixture ofargument specification I and II.

Regarding detailed specifications, refer to the FANUC Series 15OPERATOR’S MANUAL (macro call command).

3.1.2Variables

3.1.3Argument Designation

Page 47: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������3. EXECUTION MACRO B–62073E–2/03

44

Source program for registration custom macro (P–CODE program) isprogrammed by the Custom macro used for FANUC Series 15. But, thereare some limits for execution in Series 15. The P–CODE program custommacro is described below.

Argument specification is same as in Custom macro used for Series 15.

Macro of P–CODE program call P–CODE program is executed with“G65” as same as in Custom macro used for Series 15.

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

<Argument specification> ;

Expression, argument, etc. of variables are the same as those of Custommacro used for Series 15.

NoteThe local variable to be used by the P–CODE program andthe local variable to be used by the user program are thesame, but note that for the common variable, whether it isthe same or different can be selected by the parameter.Further, the conversational macro special variables(#30000–, #40000–) can also be used.

All the custom macro commands which can be commanded in normalautomatic operations can be used. Further, the custom macro commandswhich can handle files can be used.

The following kinds of commands, NC commands necessary forpre–reading or editing the program must not be used.

� Complex type canned cycle� Optional angle chamfering/corner R

� Diagram dimensions direct input

� Custom macro interruption� Override playback

Modal call cannot be made.

3.2LIMITATION FOREXECUTION MACRO

3.2.1ArgumentSpecification

3.2.2Macro call

3.2.3Variable

3.2.4Custom MacroCommands

3.2.5NC Commands WhichCannot be Used inAutomatic Operation

3.2.6Modal Call fromExecution Macro

Page 48: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

45

Because a P–CODE program is called using a user G, M, S, T, or B code,the following is inhibited: calling of a user G code during a P–CODE callby a user G code, and the calling of a user M code, S code, T code, B code,M codes specifying a range, or a specific code during a P–CODE call bya user M code, S code, T code, B code, M codes specifying a range, or bya specific code.

The PGMP bit of parameter 8509 sets whether to permit the following:calling of a user M code, S code, T code, B code, M codes specifying arange, or a specific code during a P–CODE call by a user G code, and thecalling of a user G code during a P–CODE call by a user M code, S code,T code, B code, M codes specifying a range, or by a specific code.

After a P–CODE program (execution macro program) is called from auser program, another user program can be called as a subprogram byusing the M code specified in parameter No.8533 of the execution macroprogram.

[User program]

O0001;G100 X10. Z20. ;M30 ;

O1000 ; :M99 ;

[P–CODE program]

O9010 ; :Mmm P1000 ; :M99 ;

Call format)

Mmm Ppppp;

where,

mm: M code specified in parameter No.8533

pppp: Number of the user program to be called

Notes1 Another P–CODE program (execution macro program)

cannot be called from the called user program.2 The sequence number cannot be specified when returning

from the called user program.

A specified range of programs can be called at a time by specifying theG code corresponding to the first program to be called in parameterNo.8551, the program number of the first program to be called inparameter No.8552, and the total number of programs to be called inparameter No.8546. The specified number of programs are called in theorder of the G codes and corresponding program numbers, starting withthe first specified program.

3.2.7Calling a P–CODEProgram from anExecution Macro Usingthe G, M, S, T, or BUser Code

3.2.8Calling a User ProgramUsing an ExecutionMacro

3.2.9Specifying of the GCode for Macro Callsof P–CODE Programs

Page 49: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������3. EXECUTION MACRO B–62073E–2/03

46

The specifiable G code range is 1 to 9999, and the specifiable programnumber range is 9000 to 9999. Up to 40 programs can be called at a time.

Parameter No.8546 : 10No.8551 : 1000No.8552 : 9500

When the parameters are set as shown above, the correspondence betweenthe G codes and program numbers is as follows:

G code Corresponding program number

G1000 O9500

G1001 O9501

G1002 O9502

G1003 O9503

G1004 O9504

G1005 O9505

G1006 O9506

G1007 O9507

G1008 O9508

G1009 O9509

NoteFor each parameter, the action taken when a value outsidethe specifiable range is specified is as follows.Parameter No.8546:

If zero on a negative value is specified, the program callis not activated. Even when a value larger than 40 is specified, only 40 programs are called.

Parameter No.8551:Values outside the specifiable range are ignored (the program call is not activated).

Parameter No.8552:Values outside the specifiable range are a any out–of–range value is ignored (the program call is not activated).

By setting compile parameter TMCC (No.8502) to 1, P–CODE programNo. 9008 is called by specifying a T code in a user program.

All addresses specified in this block are used as arguments except that theT 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 #28to #32 for each group.

Be sure that addresses shall be those available for CNC and the significantdigits are those specified by the CNC.

Example

3.2.10Calling a Macro Usinga T Code

Page 50: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

47

Variable Data to be transferred

#1–#26 Address data for each variable

#27 T code

#28 G code

#29 G code

#30 G code

#31 G code

#32 G code

G91G28X123.45678T5678:#24=123.456#27=5678.0#28=28.0#29=91.0

Other variables = < vacant >

NoteThe L specified in the same block as the T code does notindicate the number of times that the T code macro call isrepeated.

Separately from the user program multiplexity, 4–stack nesting of macroprogram, and 4–stack nesting of subprogram are possible on theexecution macro.

Example

3.2.11Macro andSubprogramMultiplexity inExecution Macro

Page 51: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������3. EXECUTION MACRO B–62073E–2/03

48

In the user program, creation and execution of Series 15 custom macroformat custom macros can be performed as a standard. Commonvariables can also be displayed and set as a standard on the commonvariable screen.

The common variables used by P–CODE program can be selected byparameter (No.8503) as to whether they are the same or different as thoseused normally by NC macro.

When the common variables are set as different ones they can bedisplayed after the normal custom macro variables by setting parameter(No. 8502 #1).

The local variables used by the P–CODE program are the same as thosenormally by custom macros in execution macros, but in conversationalmacros the local variables used are different from those used normallyused in custom macros. Further, the conversational macro local variablescan be displayed after the local variables used by normal custom macrosby setting parameter No. 8502.

SETVN used for setting a variable number cannot be used with aP–CODE.

3.3DISPLAYING ANDSETTING VARIABLES

3.3.1User ProgramCommon Variables(#100–#199,#500–#999)

3.3.2P–CODE ProgramCommon Variable(#100–#199,#500–#999)

3.3.3P–CODE ProgramLocal Variable (#1–#33)

3.3.4Variable Name Setting(SETVN)

Page 52: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 3. EXECUTION MACRO

49

(1) Separate compiler of a program cannot be made. Register the wholeprogram to the edit memory, and then to the ROM. Max. 400programs can be registered to the ROM.

(2) In one program, limit the sequence number used for branchdestination (GOTO) to 99. Program end is “M99;”.

(3) One block can accept designation of only one sequence number.Except the program No. and the optional block skip, designate asequence No. at the block head.

3.4CAUTIONS

Page 53: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

50

4 CONVERSATIONAL MACRO FUNCTION

The conversational macro function is the function to independentlyexecute the compiled macro program by the P–CODE program compilerand the normal NC part program operation.

This function is executed at a lower level than automatic operationprocessing. Further, this function is unrelated to such as whether there arebasic operation modes or whether or not it is during automatic operation.Therefore, the conversational macro function operates independently inparallel to the NC part program even during automatic operation.

The following functions can be realized by the conversational macro.

� Read/write of macro variable (local variable, common variable,system variable)

� Macro command� Screen display (character screen, graphic screen)� Reading of keys� Reading of NC parameters� Read/write of files� Other conversational macro exclusive functions

There are also other auxiliary macro functions as conversational macrofunctions. These functions are executed at an execution level the sameas the conversational macro function.

The following functions can be executed in this function.

� Macro command (definition of variable, replacement, addition typecalculation, branching, repetition)

� Read/write of common variables (#100–#199)� Startup of conversational macro body� Simple call (G65, M98)� Read/write of P–CODE exclusive variables� Data reading of A/D converter� Conversational window function� Reading of relative coordinates� Reading of cutting time and cutting distance, and preset� Torque limit override control� RS–232–C control

NoteThe conversational macro function and the execution of theauxiliary macro function are processed at a lower level thanthe NC operation processing. Therefore, the execution ofthe conversational macro function is not influenced by theprocessing speed of the NC operation, but it is that theconversational macro and the auxiliary macro processingspeeds will be slowed down during NC operation.

4.1OVERVIEW

Page 54: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

51

If both the auxiliary and conversational macro functions have beenspecified, the following operations are performed:

1) Conversational macro screenConversational and auxiliary macros are alternately executed, in thisorder.

2) Other than conversational macro screeOnly auxiliary macros are executed.

The conversational macro function is available to use with MMC–II.

All the custom macro formats of Series 15 are described in the macroformat of the conversational macro program. Further, all the systemvariables which can be referred to by the P–CODE program and thecommon variables can all be read and written. However, there is nofunction to refer to local variables held by the NC. (However,conversational macro function exclusive local variables have beenprovided.)

Page 55: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

52

The execution of the conversational macro function is processedinternally at a lower level than the automatic operation processing.Therefore, the execution of the conversational macro function is notinfluenced by the processing speed of the automatic operation. However,it is possible that the conversational macro function processing speed willbe slowed down during automatic operation. Because of this, there is noguarantee that the conversational macro body must periodically beexecuted.

The following functions can be executed at this level.

� Macro call instructions (all macro call instructions which can becommanded in automatic operation)

� Read/write of macro variable (local variable, common variable,system variable)

� Reading of NC parameters� Reading of keys� Screen display (character screen, graphic screen)� Read/write of files� Other conversational macro exclusive functions

Normal NC format cannot be executed in conversational macro programNC format. It is ignored if commanded. Further, note that in theconversational macro program NC format the meaning of addresses andmethod of use is different from in the normal NC format.

The conversational macro screen to be started up by the conversationalmacro progam is under the same control as other screens (POS screen,etc.). Because of this the conversational macro screen must be finishedto switch to other screens. The timing of this finishing is decided whenM99 of the main program is executed. Note that if the conversationalmacro program is a program like the following bad example, switchingto other screens will not be possible and the hangup state will occur.

Bad example Good example

O1234 ;

NO

YES

Key input processing

M99 ;

Key input? Key input?

O1234 ;

NO

YES

Key input processing

M99 ;

For the conversational macro program, perform programming such thatit becomes a cyclic program to return to sequence number specified byhead of main program or M99 Pp, after executing M99 like the PMCladder program.

By means of the above, avoid programming in which the branchdestination goes in the reverse direction by GOTO.

4.2CONVERSATIONALMACRO FUNCTION

Page 56: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

53

(1) Starting up conversational macro program

Conversational macros can be executed by pressing the TALKMACRO soft key or when activated by an auxiliary or executionmacro.The program to be started up is the program number of the value ofthe conversational macro execution control variable 1 (#8500). Thevalue of the conversational macro execution control variable 1(#8500) when turning on the power is set by parameter (No.8536).However, when the parameter (No.8536) is ”0”, the conversationalmacro body cannot be started up.If a conversational macro program having a program numberspecified with conversational macro execution control variable#8500 has not been compiled, the conversational macro functionexecutes no program resulting in a PS11 ‘3 IMPROPERNC–ADDRESS alarm.

(2) Stopping the conversational macro

The conversational macro cannot be stopped by such as reset, singleblock, feed hold. However, the conversational macro can be stoppedby either setting the parameter (No.8536) to ”0” or by setting theconversational macro execution control variable 1 (#8500) to 0.Further, it is possible to end the display of the conversational macroscreen and return to the screen which was displayed before selectingthe conversational macro screen by pressing the software key on theleft edge.

Page 57: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

54

The auxiliary macro function is executed at an execution level the sameas the conversational macro function.

The following functions can be executed in this function.� Macro command (definition of variable, replacement, addition type

calculation, branching, repetition)� Read/write of common variables� Startup of conversational macro body� Simple call (G65, M98)� Read/write of P–CODE exclusive variables� Data reading of A/D converter� Conversational window function� Reading of relative coordinates� Reading of cutting time and cutting distance, and preset� Torque limit override control� RS–232–C control

(1) Starting up the auxiliary macro programThe auxiliary macro program to be started up is the program numberof the value of the conversational macro execution control variable2 (#8600). The value of the conversational macro execution controlvariable 2 (#8600) when turning on the power is set by parameter(No.8537). However, when the parameter (No.8537) is ”0”, theauxiliary macro program cannot be started up.

(2) Stopping the auxiliary macro programThe auxiliary macro program cannot be stopped by such as reset,single block, feed hold. However, the auxiliary macro program canbe stopped by either setting the parameter (No.8537) to ”0” or bysetting the conversational macro execution control variable 2 (#8600)to 0.

(3) Setting the auxiliary macro execution cycleThe auxiliary macro executes one block of a P–CODE programapproximately every 32 ms. This execution cycle can be changedusing parameter No.7045, thus enabling faster execution of theauxiliary macro.

NoteThe faster the auxiliary macro executes the program, thelonger it takes for the program to be displayed on the CNCscreen.

Address

79045 Auxiliary macro execution cycle

Parameter inputData format : Byte typeData range : 0 to 20The parameter value N indicates the number of blocks (N+1) that can beexecuted every 32 ms. Examples follow.

N = 0: Approx. 32 ms per a blockN = 1: Approx. 32 ms per two blocksN = 2: Approx. 32 ms per three blocks :

4.3AUXILIARY MACROFUNCTION

Page 58: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

55

The larger the value of N, the longer the delay in displaying the programon the CNC screen.

(4) NoteIn an auxiliary macro program, do not write data into system commonvariables (custom–macro common variables) frequently. Readcommon variables once, then write data into them as required.Alternatively, use variables dedicated to the macro compiler (P–codeexclusive variables) to write data into the common variables when itis necessary to write data into the variables frequently.This note also applies to data write (output to the UO signal) to systemvariables No. 1100 to No. 1135.

Page 59: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

56

In the conversational macro function the coordinate system usingcharacter display and cursor display is called the character coordinatesystem. The character coordinate system sets left/right direction as Xcoordinate and up/down direction as Y coordinate. In the 9”CRT, the Xcoordinate is 0 to 39 from left to right, and Y coordinate is 0 to 16 fromtop to bottom; in the 14” CRT, X coordinate is 0 to 73 from left to rightand Y coordinate is 0 to 26 from top to bottom.

Further, display commands which exceed these ranges are ignored. 1 unitis 1 character. However, the following sections cannot be displayedbecause they are used by the system. In 9” CRT, the 0 line ON displayline, 12th line warning message line, 13, 14th line data input line, 15thstatus display line sections; in the 14” CRT 0, lst ON display line, 21stwarning message line, 22nd data input line, 23rd status display line, 24th,25th, 26th line software key frame sections.

NoteIt is possible to write to a location to be used by system, butonce a character is displayed when set to a different screen,there are cases that the character remains on the screen.

(Example) 9ICRT

MEM * * * STOP * * * * * * * * * *

POSiITON PROGRAM OFFSET PRG–CHK CHAPTER+

ON display line

0123456789

10111213141516

0 1 2 30123456789012345678901234567890123456789

00000 N0000

Software key display line

Status display line

Data input display line

Warning message display line

(1) Mask of O, N Number Display in Conversational Macro ScreenThe conversational macro screen can be set such as not to display O,N number.If parameter number 8508 ONMSK=1 is set, O,N number is notdisplayed.

4.4COORDINATESYSTEM SCREEN

4.4.1Character CoordinateSystem

Page 60: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

57

(2) Mask of Status Display on Conversational Macro ScreenThe status display (mode and status) on the conversational macroscreen can be masked using parameter STDM (No.8507#3).

In conversational macro function, the coordinate system using a graphicdisplay is called graphic coordinate system. The graphic coordinatesystem sets left/right direction as X coordinate and up/down direction asY coordinate. The X coordinate is –297 to 297 from left to right, and theY coordinate is –216 to 216 from top to bottom. Namely, the screen centerbecomes (X, Y) = (0, 0). Further, display commands which exceed therange –32767 to 32767 are clamped by minimum and maximum values.

215

X

295–295

–216

196

X

320–320

–195

14” CRT dot coordinate system

9” CRT dot coordinate system

4.4.2Graphic CoordinateSystem

Page 61: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

58

(1) Variables which can be used in the conversational macro function areAll the Series 15 system variables and the following.

Variable number Function R/W

Conversationalmacro

Auxiliarymacro

Executionmacro

Macro variables

#1 – #33 Local variables (different function for conversationaland execution macros)

R/W � × �

#1 – #99 Referencing a variable as an array R/W � � ×

#100 – #199 Common variables (not battery–powered) R/W � � �

#500 – #999 Common variables (battery–powered) R/W � � �

#30000 – P–CODE variables R/W � � �

#40000 – Expanded P–CODE variables R/W � � �

#99100 – System common variables R/W � � �

Execution control

#8500 Conversational–macro execution–control variable 1 R/W � � �

#8510 Conversational–macro activation–control variable 1 /W � � �

#8600 Conversational–macro execution–control variable 2 R/W � � �

Screen control

#8509 Character–string input program control variable R/W � � ×

#8530 Function–screen control variable R/W � � ×

Key/data input control

#8501 Command–key input variable R/ � × ×

#8502 Data input control variable R/W � × ×

#8503 Numerical–data variable R/ � × ×

#8504 Address–data variable R/ � × ×

#8550 Character–string input R/ � × ×

Expanded key/data input control

#8552 Setting a variable number R/W � × ×

Array processing for P–CODE variables

#8511 Source data R/W � � ×

#8512 Two–dimensional array number at transfer source R/W � � ×

#8513 Three–dimensional array number at transfer source R/W � � ×

#8514 Two–dimensional array number at transfer destination R/W � � ×

#8515 Three–dimensional array number at transfer destination R/W � � ×

Array reference for P–CODE variables

#8512 Two–dimensional array number R/W � � ×

#8513 Three–dimensional array number R/W � � ×

#8516 Number of elements in a one–dimensional array R/W � � ×

#8517 Number of elements in a two–dimensional array R/W � � ×

#8518 (Always set to 1) R/W � � ×

#8519 Number of the first variable in an array R/W � � ×

4.5VARIABLE,FUNCTION ANDCONTROL CODE

Page 62: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

59

Variable number

Executionmacro

Auxiliarymacro

Conversationalmacro

R/WFunction

CNC–program reference/write

#8520 Designating a program number R/W � � ×

#8521 Designating a block number R/W � � ×

#8522 Designating the number of a variable to be stored R/W � � ×

#8523 Variable number specifying the number of decimalplaces

R/W � � ×

#8529 Completion code R/ � � ×

Read/preset of machining time and machined distance

#8553 Read/preset of machining time R/W � � ×

#8554 Read/preset of machined distance R/W � � ×

PMC–axis control

#8602 Selecting PMC control axes R/W � � ×

Line control

#8539 Completion code R/ � � ×

Torque–limit override

#8990 Selecting read or write /W � � ×

#8991 Axis number /W � � ×

#8992 Torque–limit override R/W � � ×

#8995 Completion code R/ � � ×

A/D conversion data input

#8996 Completion code R/ � � ×

#8997 A/D converter selection code /W � � ×

#8998 Connector number R/W � � ×

#8999 A/D conversion data R/W � � ×

Window function

#8996 Completion code R/ � � ×

#8997 Alarm information selection code /W � � ×

#8998 Axis number R/W � � ×

#8999 Alarm information R/W � � ×

Relative–coordinate read

#8996 Completion code R/ � � ×

#8997 Selection code for relative–coordinate read /W � � ×

#8998 Axis number R/W � � ×

#8999 Relative coordinates R/W � � ×

Remaining travel–distance read

#5181–#5195 Variables for reading remaining travel distance R/ � � ×

Reading part–program information

#8526 Reading the state of background editing R/ � � ×

#8527 Reading the number of stored programs R/ � � ×

#8528 Reading the capacity of the unused CNC program area R/ � � ×

R: Read enable, W: Write enable, �: Available, X: Not available)

Page 63: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

60

(2) Functions which can be used in the conversational macro functionsare all the Series 15 custom macro functions and address functions.

(3) Control codes which can be used in the conversational macrofunctions are the following.

Controlcode Meaning of code Function

G230G202G240G242G243G244G280G301G302G303G390G391G392G311G300G320G321

Cursor displayScreen deletionColor specificationDrawing start point settingCharacter displayDrawing line type specificationPrompt character displayLinear drawingCircular drawing (clockwise)Circular drawing (counter clockwise)Absolute mode specificationIncremental mode specificationWork coordinate system specificationRapid traverse speed specificationRapid traverse drawingClosed area paintingMarking

Screen display control code

G65M98M99

Conversational macro program macro callConversational macro program subprogram callConversational macro program end

Executioncontrol code

G330G331G335G336G337G338

Circuit openCircuit close1 byte readData transmissionMacro variable data inputMacro variable data output

RS232Ccontrol code

FGENFDEL

FOPENFCLOSFREADFWRITFPSET

Creating filesDeleting filesOpening filesClosing filesReading filesWriting filesSetting file pointer

File control code

G370G371G375G376G377G328G329

Registering new programsDeleting programsReading specified programsWriting blocksDeleting blocksReading character type blocksWriting character type blocks

Referring/writing CNC programs

G315 Commanding for arrangement processing Arrange-ment typeprocessingof con-versationalmacroexclusivevariable

Page 64: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

61

Controlcode FunctionMeaning of code

G340G341G344G345G346G348G349G350G351

Rapid traverse commandCutting feed commandDwell commandReference point return commandAuxiliary function commandStatus signal reading commandCommand signal writing commandPositioning device coordinate systemchanging override

PMC axiscontrol

G360 Preset of relative coordinate value Relativecoordinatesystem preset

G310 Reading PMC address PMCaddresscontrol

All the system variables which can be used by Series 15 custom macrocan be used except for the following system variables. For details ofsystem variables, refer to the FANUC Series 15 OPERATOR’SMANUAL.

(System variables which cannot be used)

Alarm message display by #3000

(Alarm number can be displayed)

The local variables to be used by the conversational macro functionP–CODE program are different from the normal local variables to be usedby normal NC macro. This local variable can be displayed after normalmacro variables by setting parameter (No. 8502 #1, #4).

In the auxiliary conversational macro function P–CODE program localvariables cannot be used.

NoteLocal variables are enabled only in the variousprogrammes. If program end is executed by M99 isinitialized.

Common variables to be used by conversa–tional macro P–CODEprogram can be selected by parameter (No. 8503) as to whether they arethe same or different as those used by normal NC macro. However, thesecommon variables are the same as common variables used by automaticoperation P–CODE macro. Further, these common variables can bedisplayed after normal macro variables by setting parameter (No. 8502#1and No. 8502#4).

4.5.1System Variable

4.5.2P–CODE ProgramExclusive LocalVariables

4.5.3Conversational MacroP–CODE CommonVariables

Page 65: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

62

The user program and the P–CODE program can use different signals forthe system variables (UI: #1000 to #1015, #1032, UO: #1110 to #1115,#1132).

How to set the parameter:When EUIO of parameter No.8502 is set to 1, the interface signals listedin the tables below are used for reading and writing the system variablesof the P–CODE program (execution, conversational and auxiliarymacros).

The status of the following interface signals can be learned by readingsystem variables #1000 to #1015 and #1032.

System variable Point Interface input signal

#1000#1001#1002#1003#1004#1005#1006#1007#1008#1009#1010#1011#1012#1013#1014#1015#1032

111111111111111116

EUI00EUI01EUI02EUI03EUI04EUI05EUI06EUI07EUI08EUI09EUI10EUI11EUI12EUI13EUI14EUI15

EUI00–EUI15

The following interface signals can be read and written using systemvariables #1100 to #1115 and #1132.

System variable Point Interface input signal

#1100#1101#1102#1103#1104#1105#1106#1107#1108#1109#1110#1111#1112#1113#1114#1115#1132

111111111111111116

EUO00EUO01EUO02EUO03EUO04EUO05EUO06EUO07EUO08EUO09EUO10EUO11EUO12EUO13EUO14EUO15

EUO00–EUO15

NoteThe UI and UO signals used for user programs (programsother than the P–CODE program) are the same interfacesignals as conventionally used.

4.5.4UI and UO SignalSeparation for Userand P–CODE Programs

Page 66: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

63

Conversational macro special variables can be used with a P–CODEprogram.

An arbitrary number of conversational macro special variables startingwith #30000 can be used.

To specify the variable format, the parameter (No. 8509, EVF2) allowsthe user to select floating–point format as used for general macrovariables or fixed–point format.

Parameter No. 8509

EVF2=0 : Floating–point formatEVF2=1 : Fixed–point format

The usable number of conversational macro special variables is thenumber set in parameter No. 8549 multiplied by n. When zero is set inparameter No. 8549, no conversational macro special variable can beused.

For floating–point format, n=40

For fixed–point format, n=100.

When EVF2=0 for floating–point format

Parameter No. 8549=1#30000 to #30039

Parameter No. 8549=2#30000 to #30079

When EVF2=1 for fixed–point formatParameter No. 8549=1

#30000 to #30099Parameter No. 8549=1

#30000 to #30199

Notes1 When fixed–point format is used, a value from –32768 to +32767 can be set in a conversational

macro special variable. A fractional part, if any, is rounded before the value is stored infixed–point format.If a variable in fixed–point format appears in an expression, the variable is evaluated after beingconverted to floating–point format.

2 The maximum number of usable conversational macro special variables depends on the tapememory size.When the length of tape memory is 160 m or shorter: Maximum value of parameter

No. 8549=64When the length of tape memory is 320 m or longer: Maximum value of parameter

No. 8549=100The length of tape memory corresponding to the value of 1 set in parameter No. 8549 is 0.8 m.

3 The values of conversational macro special variables are preserved even if power is turned off.4 If the value of parameter No. 8549 is changed, power needs to be turn on again.5 Conversational macro special variables are displayed on the macro variable display screen

(SETTING), and can be entered through MDI.6 When the value of parameter EVF2 is 1(fixed–point format), <Null> can not be used.

4.5.5Conversational MacroSpecial Variables(#30000–)

Example

Page 67: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

64

Expanded conversational macro exclusive variables starting from #40000can be arbitarily used. This variable can be selected to be floating decimalpoint format variable the same as normal macro variable, or to be fixeddecimal point format variable by parameter specification (parameter No.8509, EVF).Parameter No. 8509

EVF=0 : Floating decimal point formatEVF=1 : Fixed decimal point format

In the same manner as conversational macro exclusive variables(#30000–), the n multiple of the numerical value specified by parameterNo. 8550 becomes the number of expanded conversational macroexclusive variables which can be used. When parameter number 8550 is0, the expanded conversational macro exclusive variable cannot be used.For the value of n, n=10 when floating decimal point format, and n=30when fixed decimal point format.

EVF=0 : When floating decimal point formatParameter No.8550=1

#40000 to #40009Parameter No.8550=2

#40000 to #40019EVF=1 : When fixed decimal point format

Parameter No.8550=1 #40000 to #40029

Parameter No.8550=2 #40000 to #40059

(1) When fixed decimal point format, the value which can be set to thisvariable is –32768 – 32767. The figures after the decimal point arerounded off and it is memorized in fixed decimal point format.Further, when the variable in this fixed decimal point format appearsin <format> it is converted to floating decimal point format andevaluated.

(2) The maximum expanded macro exclusive variables which can beused depends on the capacity of tape storage memory.Tape storage memory 80m:Expanded conversational macro cannot be usedPart program storage memory 160m:Max. value of parameter No.8550=500Part program storage memory 320m:Max. value of parameter No.8550=1000Part program storage memory more than 640m:Max. value of parameter No.8550=1970The relationship between value of parameter 8550 and part programstorage length is as follows.Approx. 0.2m used for each value 1 of parameter No. 8550.

(3) The expanded macro exclusive variable keeps its value even if poweris cut.

(4) If value of parameter No. 8550 is changed, it is necessary to turn onpower again.

4.5.6ExpandedConversational MacroExclusive Variable(#40000 –)

Example

Caution

Page 68: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

65

(5) The expanded macro exclusive variable is displayed on macrovariable display screen (SETTING). Further, input from MDI ispossible.

(6) Cannot express <Vacant> when paramter EVF=1 is set (fixed decimalpoint format).

Reference and writing of execution macros and conversational macroprograms system common variables by conversational macro programscan be performed. The number adding 99000 to the variable number youwant to reference corresponds to the system common variable.

#99100 � Corresponds to #100

#99149 � Corresponds to #149

#99500 � Corresponds to #500

#99531 � Corresponds to #531

(1) Conversational macro execution control variable 1 (#8500)If the conversational macro body is started up, it executes theconversational macro program of the value of #8500 as programnumber. However, the value of #8500 when turning on the power isthe value of the parameter (No. 8536).Control can be transferred to other conversational macro programs byrewriting the value of #8500. If the value of #8500 is rewritten, afterexecution finishes of the currently executing conversational macroprogram, the character screen and graphic screen are deleted, and theconversational macro program of the value of #8500 as programnumber is executed. If the value of #8500 is not rewritten, the sameconversational macro program continues to be executed. At this time, the character screen and graphic screen are not deleted.

(2) Conversational macro start control function 1 (#8501)The conversational macro body can be started up by setting theconversational macro start control variable (#8510) to “1”.The conversational macro body can also be ended by setting theconversational macro start control variable 1 to “0”.

(3) Conversational macro execution control variable 2If the conversational execution control macro is started up, it executesthe auxiliary macro program of the value of #8600 as the programnumber. However, the value of #8600 when turning on the power isthe value of the parameter (No. 8537).Control can be transferred to other auxiliary macro programs byrewriting the value of #8600. If the value of #8600 is rewritten, afterexecution finishes of the currently executing auxiliary macroprogram, the auxiliary macro program to set the value of #8600 asprogram number is executed. If the value of #8600 is not rewritten,the same auxiliary macro program continues to be executed.

4.5.7Reference and WritingSystem CommonVariables

4.5.8Execution ControlVariable

Page 69: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

66

(1) Command key input variable (#8501)Command key input can be read by #8501. The correspondencebetween command key input and the value of #8501 is as shownbelow. If there is no command input, the value of #8501 is 0.If there once was command key input, the value of #8501 remains thisvalue until read by conversational macro command, and subsequentkey input cannot be accepted. If #8501 is read, it enters the state thatkey input is accepted and the value of #8501 becomes 0. Writing a value to #8501 cannot be performed.

PAGE � : 1PAGE � : 2CURSOR UP : 3CURSOR DOWN : 4CURSOR LEFT : 5CURSOR RIGHT : 6INPUT : 8RESET : 10SOFT FUNCTION KEY RIGHT : 11SOFT FUNCTION KEY 1 : 12SOFT FUNCTION KEY 2 : 13SOFT FUNCTION KEY 3 : 14SOFT FUNCTION KEY 4 : 15SOFT FUNCTION KEY 5 : 16SOFT FUNCTION KEY 6 : 17SOFT FUNCTION KEY 7 : 18SOFT FUNCTION KEY 8 : 19SOFT FUNCTION KEY 9 : 20SOFT FUNCTION KEY 10 : 21

NoteCRT14” is SOFT FUNCTION KEY 1–SOFT FUNCTION KEY10 CRT 9” is SOFT FUNCTION KEY 1–SOFT FUNCTION KEY5SOFT FUNCTION KEY LEFT, POS, OFSET, and other keysused to directly select an NC screen are managed by thesystem and cannot be read.

(2) Data input control variable#8502 : Data input control variable#8502 : Numerical data variable#8502 : Address data variable#8502 : Character variable

Controls input of numerical data and address data by setting the followingvalue to data input control variable #8502.

#8502= 0 : No data input= 1 : Inputting numerical data= 2 : Inputtting address data and numerical data= 3 : Inputting character row

� When #8502 is 0, nothing is displayed to data input line anddata input cannot be performed.

4.5.9Key Input ControlVariable

Page 70: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

67

� When #8502 is 1, “NUM” is displayed to data input line andnumerical data input can be performed. The inputtednumerical data can be read by numerical data variable #8503.

� When #8502 is 2, first ”ADRS” is displayed to the data inputline, and address data can be inputted. Next, if address datais inputted ”ADRS ? NUM” (? is inputted address) isdisplayed and numerical data can be inputted.The inputted data can be read by the various address datavariables #8504 and numerical data variables #8503.

� when #8502 is 3, nothing is displayed to the data input line.However, data can be inputted. The inputted data can be readin the sequence inputted by character variable #8550. Thedata to be read is in ASCII code. Further, if it is read until theend, can be read.

The key input to set a value other than 0 for the command key inputvariable (#8501) acts as a trigger and the data input line reterns to initialstate. The inputted numerical value and address can be read by the variousnumerical data variables and address data variables. Further, thenumerical data variable and address data variable are kept untilnumerically set in data input control variable.When there is no input of numerical data and address data, the value of#8503 and #8504 becomes <Vacant>.The correspondence between the inputted address and #8504 is as shownbelowA ...1 B ...2 C ...3 D ...4 E ...5

F ...6 G ...7 H ...8 I ...9 J ..10

K ..11 L ...12 M ..13 N ..14 O ..15

P ..16 Q ..17 R .. 18 S ..19 T .. 20

U ..21 V ..22 W .. 23 X .. 24 Y .. 25

Z ..26

(3) Conversational macro extension data input control functionIf you set 3 for #8502, and a variable number for #8552 to provide,full key data input mode, and appears < for the input line, and it ispossible to input addresses and number data. The data input line changes to the initial state on key input to set keyinput control variable #8501 to 0. The input number and address canread for 32 variables from a variable number which is set to variable#8552 as each ASCII code, data. <blank> input a 32 number seriesif there is no input data.

Example:Set for

#8502=3 ;#8552=500 ;

and input0123456ABCD<

and press return key#500=48#501=49#502=50#503=51#504=52#505=53

Page 71: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

68

#506=54#507=65#508=66#509=67#510=68#511=<blank>

:#531=<blank>

#8501=8

(1) Until the INPUT key is pressed, the previous value remains for thecontents of macro variable from number specified in #8552. TheINPUT key is pressed and first the value is set.

(2) The value of 8503, 8504 is not guaranteed.

(3) When a macro variable number other than 0 has been set in #8552,if the INPUT key is pressed this function is unconditionallyperformed. In that case, input by #8550 (character variable) cannotbe performed.

(4) Function–screen control variableVariable #8530 indicates the function currently displayed on the CNCscreen.Writing the following data into variable #8530 changes the screen tothe corresponding function screen.

#8530 : 0:Position screen1:Program screen2:Offset screen3:Program check screen4:Setting screen5:Service screen6:Alarm screen7:Graphic screen (only when the option is used)8:Conversational macro screen

11:Operation history screen

NoteIf a value other than those described above is written, it isignored.

#8509 is the variable command to call the registered character stringprogram. Refer to Character display (Address P of G243) for detail.

Caution

4.5.10Character StringRegistered ProgramControl Variable #8509

Page 72: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

69

This is the function to control the processing for arrangement typevariables or one group of variable rows.

1) Clearing arrangement type variables, variable rows (continuousreading of specified data)

2) Transfer from arrangement type variables, variable rows to variablerow

In each processing, control code ”G315” is commanded after defining thearrangement, variable row, or data to each of the following controlvariables.

#8511 : Transmission origin Data

#8512 : Transmission originTwo–dimensional arrangement number or variable row headvariable number

#8513 : Transmission originThree–dimensional arrangement number

#8514 : Transmission destinationTwo–dimensional arrangement number or variable row headvariable number

#8515 : Transmission destinationThree–dimensional arrangement number

Control code

G315 P (processing code) K (processing data number) ;

The processing code specifies the contents of the processing by a 3–digitnumber. Zero–suppress is possible with the upper rank ”0”

P001 : Stores #8511 data from variable

(P1) specified by #8514 to K con–tinuous variables.

P002 : Transfers K continuous variables

(P2) data from variable specified by #8512, from variable specified by #8514 to K continuous variables. (Ascendingsequence transfer)

P003 : Transfers K continuous variables

(P3) data from variable specified by #8512, from variable specified by #8514 to K continuous variables. (Descendingsequence transfer)

P101 : Stores #8511 data from arrangement variable #1 specified by#8514, #8515 to K continuous arrangement vari–ables.

P102 : Transfers K continuous arrangement variables data from arrrangement variable specified by #8512, #8513, from arrangement variable #1 specified by #8514, #8515 to K continuous arrangement vari–ables. (As–cending sequencetransfer)

4.5.11Arrangement TypeProcessing ofConversational MacroExclusive Variable

Page 73: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

70

Conversational macro exclusive variables (#30000...) can be referred toby the two or three–dimensional arrangement types. Set a proper value tothe following arrangement control variables beforehand and theconversational macro exclusive variable of the arrangement elementcorresponding to the variable number (#1 – #99).

Note#1 to #99 for convesational macro are different from #1 to#33 local variables for execution macro.

Arrangement control variable

#8512 Two–dimensional arrangement number

#8513 Three–dimensional arrangement number

#8516 One–dimensional arrangement element number

#8517 Two–dimensional arrangement element number

#8518 1 (Note (1))

#8519 Arrangement top variable number

Specify the arrangement type by the arrangement control variables from#8516 to #8519 beforehand and specify the arrangement number referredto by the #8512 and #8513 to refer to the variables with #1 to #99.

The correspondence between the conversational macro exclusivevariable and arrangement element is as shown below:

Conversational macro exclusive variable number

= #8519 + ((#8516_#8517)_(#8513–1))

+(#8516_(#8512–1)+(Specified variable number–1)

When the #8516, #8517, and #8519 are set to 10, 5, and 30100,respectively:

1. When both of #8512 and #8513 are set to 1, the #1 correspondsto the #10100.

2. When the #8512 and #8513 are set to 3 and 2, respectively, the#10 corres–ponds to the #10179.

Notes1 Set #8518=1 when using #1–#99 as a arrangement type reference variable of the

conversational macro exclusive variable. When #8518=0, an alarm occurs as #1–#33 are localvariables and #34–#99 are unusable variable.When turning on the power, #8518=0 is set.

2 #8512–#8517=1, #8519=30000 is set for each arrangement control variable when turning onthe power. Because of this, #8513 and #8517 can be used without recognition when used asa two–dimensional arrangement.

3 For each variable and for the conversational macro variable number after calculation, checkis not performed. When necessary, make it correspond to the macro program.

4 This function is a function that is usable only by the conversational macro program.

4.5.12Reference ofArrangement ofConversational MacroExclusive Variables

Example

Page 74: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

71

(1) SummaryRecording, deleting and changing of NC part program is possible bythe conversation macro function. Control the CNC program withprogram number and block number. Count the block number countin order by each EOB using the block No.1 which is the block ofaddress “O” of the relevant program. In the converational macroCNC program, the data of one word is expressed by the address codeand 2 numbers, which are reported to form a block.Set parameter No.8508, EXT1 to “1” at compiling when using thisfunction.

Example:00001 ; Block No.1G00 X10. ; Block No.2M03 S1000 ; Block No.3

Program number 0001, block No. 3, storage variable number = 100#100= 13 Address M#101= 3 Numerical value#102= 19 Address S#103=1000 Numerical value#104= 27 Address EOB

The control command instructs the G code by the conversational macro.There is a complete code for checking whether or not the commandedfunction has been correctly executed.After execution of G328, G329, G370 to G377, check the complete code.

System variable#8520 Program number specification#8521 Block number specification#8522 Storage variable number specification#8523 Number of digits after decimal point specification variable

number#8526 Status of background editing (reading exclusive)#8527 The number of registered programs (reading exclusive)#8528 Vacant area of CNC programming memory (reading exclusive)#8529 Complete code (reading exclusive)

Control codeG370 Registration of new programG371 Deleting programsG375 Reading specified blocksG376 Block writingG377 Deleting blocksG328 Reading specified blocks of character typeG329 Writing specified blocks of character type

Note0 is set for #8520 to #8523 when turning on the power.

4.5.13Refer to and Read CNCProgram withConversation Macro

Page 75: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

72

(2) Recording of a new programG370 ;Specify the program number you wish to record and instruct G370 toyou record a new program.

Example:If you want to record O0002;

#8520=2 ;G370 ;IF[#8529 NE 0] GOTO 900 ;Recording end

N900 ;Error

Conduct similar processing as the edit “Oxxxx”+“INSRT” whenrecording of a new program. EOB is not insegted.

O0002

%

(3) Deleting a programG371 ;

Specify the program number that you want delete and instruct G371when you delete a program.

Example:If you want to delete O0003#8520=3 ;G371 ;IF[#8529 NE 0] GOTO900 ;End of deletion

N900 ;Error

(4) Reading a Specified BlockG375 ;

Specify the program number and block number. As a result, therelevant block can be read to a specified variable area.

Example:IfO0004 ;G92 X0. M08 ;G90 G00 X10.5 M05 ;

#8520=4 ;

#8521=3 ;#8522=100 ;G375 ;IF[#8529 NE 0] GOTO900 ;

End of readingN900 ;

Page 76: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

73

Error

The following program data is housed from #100 which is specifiedby housed variable number #8522, if you execure the above describedinstruction;#100=7 Address “G”#101=90 Number#102=7 Address “G”#103=0 Number#104=24 Address “X”#105=10.5 Number#106=13 Address “M”#107=5 Numbew#108=27 Address “EOB”

EOR (28) is housed as an address, if EOB is not at the end block of theprogram or EOR position is specified with block number. Reading is not conducted as the end code becomes “255”, if youspecify a block No. in addition to the block of EOR.

Example:IfO0004 ;G92 X0. M08 ;M02%

#100=13 Address “M”#101=2 Number#102=28 Address “EOR”

Example:IfO0004 ;G92 X0. M08 ;

%

#100=28 Address “EOR”

(5) Block writingG376 (Pp) ;Prepared program data can be written in the variable area after theblock specified by the program number and block number. Specifythe maximum series of variable data by address P. If address “EOR”is present within the specified data, write to “EOR”; if “EOR” ispresent, write to the immediately preceding data; and if neither“WOR” nor “EOR” is present, write data specified by address “P”.

Example:IfO0004 ;G92 X0. M08 ;

G90 G00 X10.5 M05 ;#8520=4 ;#8521=2 ;

Page 77: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

74

#8522=100 ;#100=7 ;#101=1 ;#102=24 ;#103=20.5 ;#104=6 ;#105=1000 ;#106=20.7 ;G376 P7 ;IF[#8529 NE 0] GOTO900 ;End of writing

N900 ;Error

If you execute the above instruction, a block is input as follows;O0004 ;G92 X0. M08 ;G1 X20.5 F1000. ;G90 GO X10.5 M05 ;End code becomes “255” and it is impossible to conduct writing,if thespecification of block number is EOR block only or higher numbers.However, when writing a program to a program of only a programnumber, it becomes possible by setting 0 to the block number.

(6) Decimal point specification of every address in block writingThe number of digits after under the decimal point of every addresscan be specified. With this specification, the contents of the variablenumber which was specified to #8523 becomes the number of digitsafter the decimal point of address A, and it is possible to determinethe number of digits after the decimal point of every address, asshown 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 ZSpecify <blank> or 0–7 for the number of digits after the decimalpoint. In the case of <blank>, it is considered that no decimal pointexists in the address.

Example:If address code=A, number=1.2345678

Decimal point specification= <blank> A1= 0 A1.= 1 A1.2= 2 A1.23= 3 A1.235 *= 4 A1.2346*= 5 A1.23457 *

Page 78: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

75

= 6 A1.234568 *= 7 A1.2345678

* The data after decimal point specification is rounded off.When #8523 is 0, least input increment for specified address is set.

(7) Block deletionG377 ;

Blocks which are specified by a program number and block numbercan be deleted.

#8520=4 ;#8521=3 ;G377 ;IF[#8529 NE 0] GOTO900 ;End of deletionN900 ;Error

The block of block No.3 of program O0004 is deleted, if you executeto the above instruction.

(8) Special cases A block constructed from a word formed by the combination ofaddress+number” and EOB is the usual processing unit in thisfunction described above. Therefore, it is impossible to show the caseof block delete instruction without a number on to conversational atmacro variable as follows. So displays it with a variable.

Specification of block delete

/ M00; � #100=29 Address “/”#101=<blank> Number <blank>#102=13 Address “M”#103= 0 Number 0#104=27 Address “EOB”

(9) Reading the specified character–type block (G328)This control code converts every character of the specified block toa decimal ASCII code and puts them into the specified variable area,even if non–word–type data is specified in the block. Controlcommands (WHILE, IF, etc.) and functions (SIN, COS, FUP, etc.) arerepresented with special codes.

#8520=Program number ;#8521=Block number ;#8522=100 ; (Reading variable number)G328 ;IF [#8529 NE 0] GOTO900 ; (Error check)

When the specified block is ”#1=SIN[#2];, the following is read:#100 : 35 (23H) “#”#101 : 49 (31H) “1”#102 : 61 (3DH) “=”#103 : 276 ( 114H) “SIN”

Page 79: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

76

#104 : 91 (5BH) “[”#105 : 35 (23H) “#”#106 : 50 (32H) “2”#107 : 93 (5DH) “]”#108 : 59 (3BH) “;”

When a character–type block is read using the word–type blockreading function (G375), completion code 253 is returned to #8529.If this code is returned, read the specified block again using thecharacter–type block reading function (G328).

#8520=Program number ;#8521=Block number ;#8522=Reading variable number ;G375 ; (Word–type block reading function)IF [#8529 EQ 253] GOTO100 ; :N100 G328 ;

(Character–type block reading function)

(10)Writing the specified character–type block (G329)This control code allows program data to be written to a specified areain character units even if non–word–type data is specified. First,define the program data in the macro variable area with ASCII codes.Then, execute this control code to write it to the specified area.

#8520= Program number ;#8521= Block number ;#8522= Number of the first ASCII code stringG329 P10 ;IF [#8529 NE 0] GOTO900 ; (Error check)

Instructions, such as P that specifies the maximum number of dataitems to be written, are used in the same manner as for control codeG376 (writing word–type blocks).

(11)Background Edit StatusThe background edit status of the CNC can be read in the form of avariable by using the conversational or auxiliary macro.#8526: The background editing is

0:suspended1:in progress

(12)The Number of Registered ProgramsThe number of programs registered in the CNC program memory canbe read in the form of a variable by using the conversational orauxiliary macro.#8527: The number of registered programs

(13)Free Capacity of CNC Program MemoryThe free capacity of the CNC program memory can be read in theform of a variable by using the conversational or auxiliary macro.#8528: Free capacity of the CNC program memory

(number of characters)

Page 80: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

77

(14)End code (#8529)Check the end code after running every processing.

#8526 Contents

0 Normal Completion

1 Double open has occurred

2 Cannot open because being used by another user

3 Cannot open because program does not exist

4 Attempted to edit program during operate

10 Specified program does not exist (has not been registered)

11 Specified program number already exists (cannot be newly created)

12 No vacant area in tape storage memory

13 No vacant area in directory (over the register number)

15 Attempted to edit language which cannot be edited

16 Attempted to edit program which cannot be edited

100 There is already background editing

101 Data protection key has been set OFF

102 Erroneous program number has been specified

103 Erroneous block number has been specified

104 Address not in address code table existed during editing(There is not format ”address plus numerical value”)

105 There is an error in macro variable number for editing

253 The specified block is not of word type (address + numeric)

255 Parameter number 8508, EXT1 is 0

(15)NotesSelection processing by work number search etc. is required in thecase foreground operation of a program which has been prepared andedited processed with background functions.

(16)Address code table

Address Code Address Code Address Code

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 O 15 Y 25

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

Page 81: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

78

(17)Special code list

Instruction Decimal Hexadecimal

IF 258 102H

WHILE 259 103H

GOTO 260 104H

DO 261 105H

END 262 106H

GE 264 108H

GT 265 109H

LE 266 10AH

LT 267 10BH

NE 268 10CH

EQ 269 10DH

MOD 270 10EH

THEN 271 10FH

XOR 272 110H

OR 273 111H

AND 274 112H

SIN 276 114H

COS 277 115H

TAN 278 116H

ATAN 279 117H

SORT 280 118H

ABS 281 119H

BCD 282 11AH

BIN 283 11BH

FIX 284 11CH

FUP 285 11DH

ROUND 286 11EH

ACOS 287 11FH

ASIN 288 120H

LN 289 121H

EXP 290 122H

POPEN 291 123H

PCLOS 292 124H

DPRNT 293 125H

BPRNT 294 126H

SETVN 295 127H

ADP 296 128H

FGEN 298 12AH

FDEL 299 12BH

FOPEN 300 12CH

FCLOS 301 12DH

FPSET 302 12EH

FREAD 303 12FH

PWRIT 304 130H

Page 82: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

79

Cutting distance and cutting time can be read and preset with the macrovariable of the conversational macro.

Use it for the control of a tool life.

(1) Reading and presetting of cutting time (#8553)Count the time only for instruction of G01 (linear interpolation), G02(circular interpolation) by #8554.The unit is the same as the macro variable (#3002).

(2) Reading and presetting of cutting distance (#8554)Count the distance only for instruction of G01(linear interpolation),G02, G03 (circular interpolation) by #8554.The unit is the same as the least input increment of control axis.

Notes1 It is necessary to set

Parameter No. 8508 EXT1=1Parameter No. 8508 CUTLG=1in order to use cutting distance reading and preset function.

2 As the tool movement distance is added to #8554 at the timeof slot of the cutting block, the distance of block movementis still added even if cutting stops due to resetting, etc.

(3) Caution:#8553 and #8554 are not set to 0 when turning on the power. The userhimself should manage this.

(1) OverviewControl of PMC control axis can be performed by conversationalmacro via the access control interface by PMC.Axis control is performed by the following nine types of controlcodes. Which PMC control axis control is performed is specified bythe PMC control axis selection variable (#8602).G340� Rapid traverse command G341� Cutting feed commandG344� Dwell commandG345� Reference point return commandG346� Auxiliary function command G348� Status signal read commandG349� Command signal write commandG350� Machine coordinate system positioningG351� Override change#8602 � PMC control axis selection variable

* Control axis selection

#8602 Control axis

1 1st axis

2 2nd axis

3 3rd axis

4.5.14Reading of CuttingTime and CuttingDistance byConversationalMacro, and PresetFunctions

4.5.15PMC Axis Control byConversational Macro

Page 83: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

80

#8602 Control axis

4 4th axis

5 5th axis

6 6th axis

7 7th axis

8 8th axis

1) When other than 1–8 is specified to #8602, the control command isignored.

2) #8602=0 occurs when turning on the power.

(2) Control code details1) Rapid traverse command (G340)

G340 Xxxx ;Performs rapid traverse shift command to PMC control axis. For theshift amount, incremental shift amount is always commanded byaddress X.

2) Cutting feed command (G341) G341 Xxxx Ffff ;

Performs cutting feed shift command to PMC control axis. For theshift amount, incremental shift amount is always commanded byaddress X. The feed rate is commanded by address F.

3) Dwell command (G344) G344 Xxxx ;

Performs dwell command to PMC control axis. The dwell amountis commanded by address X.

4) Reference point return command (G345)G345 ;

Performs reference point reutrn command to PMC control axis.5) Auxiliary function command (G346)

G346 Mmm ;Performs auxiliary function command for PMC control interface.The auxiliary control code is commanded by address M.

6) Status signal reading command (G348)G348 Pppp ;

Reads the status signal of the pertinent PMC axis control interface tothe variable number specified by address P.

Bit No.#7 #6 #5 #4 #3 #2 #1 #0

CNCAx DENx MFnX BUFx

x : PMC control axis numbern : Auxiliary function selection number

. . . . . uses 1 in this function1. CNCAx (axis control command reading complete signal)

Signal to notify that one block amount of command data of PMCaccess control has been stored in the execution wait buffer afterthe CNC side has read it.

2. DENx (distribution complete signal) In the axis control command, the axis becomes LOW during shiftby rapid traverse, cutting feed, reference point return, and devicecoordinate system positioning.

Caution

Page 84: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

81

3. MFnX (auxiliary function reading signal)Auxiliary function command (G346) is executed and becomesHIGH until auxiliary function complete signal FINX is inputted.

4. BUFx (buffer full notification signal)Becomes HIGH when axis command block exists in inputregister (execution wait buffer).

Example:When MFX=1, #100=8 is inputted by

G348 P100 ;

7) Command signal writing command G349G349 Pppp ;

Writes the specified numerical value specified by address P to thepertinent PMC axis control interface command signal.

Bit No.#7 #6 #5 #4 #3 #2 #1 #0

PMCAx RSTx STPx SBKx MSBKx FINnX

x : PMC control axis numbern : Auxiliary function selection number

. . . . . uses 1 in this function1. PMCAx (axis control command read strobe signal)

Requests CNC side to read 1 block of specified data of PMC axiscontrol.This signal cannot be written. (Can not be controlled withconversational macro.)

2. RSTx (reset signal)Resets axis control by PMC. Simultaneously, disables all thecommands for which buffering is performed.

3. STPx (axis control temporary stop signal)Stops the axis controlled by PMC. The stopped operation restartsif this signal is set to LOW.

4. SBKx (block stop signal)During execution of commands from PMC, if this signal is set toHIGH, stops axis control when the currently executing block hasfinished. If set to LOW, executes the command on whichbuffering has been performed.

5. MSBKx (block stop prohibit signal)SBK becomes enabled when this signal is HIGH.

6. FINnX (auxiliary function complete signal)If this signal is returned, the auxiliary function ends and proceedsto the next command block.This signal cannot be written. (Can not be controlled withconversational macro.)

Example: when you desire to set RSTx=1 G349 P64

8) Device coordinate system positioning G350G350 Xxxx ;

Performs positioning command of device coordinate system for PMCcontrol axis. For the shift amount, commands device coordinatesystem absolute position to address X.

9) Override change G351G351 Pppp ;

Commands override amount applied to PMC control axis cutting feedin numerical value by address P.Units are in % and are settable from 0–255%. Kept until the next

Page 85: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

82

change command is performed. It is set to 100% when turning on thepower.

(3) Caution1) Command buffering

Buffering of command block is performed on CNC side in order tocontinuously carry out multiple commands in the axis controlfunction by PMC. Namely, even if one block is being executed, ifthere is a vacancy in CNC buffer it is possible to perform the nextcommand. However, note that when there is no vacancy in CNCbuffer, the previous block command completes until a vacancy occursin the buffer because wait state occurs inside the command.As commands are stored in the buffer when G3** is executed, (1)PMCAx described on the previous page is not needed.

2) Auxiliary command functionCommanding an auxiliary function is possible by G346, but theauxiliary function complete signal FINnX cannot be controlled in theconversational macro. Control it by the PMC.

3) Conflict of axis control functions by original PMCNever perform commands from both the PMC and this function forthe same PMC controlaxis. For the PMC control axis to be used bythis function, control in the PMC by only the auxiliary functioncomplete signal ”FINnX”.

4) Data unitsCommand the shift amount to be commanded by address X (dwellamount), and feed rate to be commanded by address F in theminimum setting units.

The specified value of the torque lilmit override can be changed by settinga value in the range #8990–#8992. Further, reading the torque limitoverride value to #8992 by setting a value to #8990, #8991.

#8990: Information I.D.#8991: Axis number#8992: Torque limlit override setting value#8993: Complete code

Macro variable Contents

#8990 Information I.D.100: Writing torque limit override101: Reading torque limit override

#8991 Axis number (1–8)

#8992 Torque limit override value (0–255)

#8993 Complete code0: Normal end–1: Abnormal end

There is the following relationship between the setting value and thetorque limit override.Setting value Torque limit override

0 0 %: :255 100 %

4.5.16Torque Limit OverrideControl

Page 86: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

83

Notes1 The torque limit override of each axis becomes 100% when

turning on the power.2 This function is programmed as an execution macro.3 When attempting to set a value other than 0–255 to #8992,

that command will be ignored.4 Enable/disable of the torque limit can be performed by

parameter in G00 mode.5 Enable/disable of the torque lilmit can be performed by

parameter during acceleration /deceleration.

Bit No.#7 #6 #5 #4 #3 #2 #1 #0Address

1802 TRQ

TRQ Torque limit override function is0: Disabled (override 100%)1: Enabled

#7 #6 #5 #4 #3 #2 #1 #0Address

1803 TQL TQE

TQL Torque limit override function in G00 mode is 0: Enabled1: Disabled (override 100%)

TQE Torque limit override function during acceleration/deceleration is.

Note)TQE, TQL are enabled when 1802#TRQ is 1

Address

1882 Allowable range after exponential type acceleration/deceleration

Parameter inputData format : Word typeData unit : Detection unitData range : 0 to 65535

Judges during acceleration/deceleration by difference of 1ITP ofaccumulated amount when parameter 1803#TRQ=1. By this means, itkeeps to the permissable range when in exponential typeacceleration/deceleration.When in exponential acceleration/deceleration, in order not to make F(commanded speed) –f (actual speed) become zero, the acceleration/deceleration is regarded as ended if it is within the allowable range.

1ITP 1ITP

Commanded

speed F

α1

Time

Actual

speed f

α2

Page 87: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

84

Data can be read from the A/D converter by conversational macro.

The following items are A/D conversion data which can be read.

� General purpose analog input� Analog input in which load current of spindle has been converted to

voltage� Analog input in which load current of NC control axis has been

converted to voltage

In A/D conversion, if the necessary data is set to #8997, #8998 and theread operation for #8999 is performed by conversational macro program,at that point the A/D conversion data of each channel will be inputted.

Further, the information of whether or not the read operation to #8996ended normally will be set. (0 if normal end, –1 if abnormal end)

Reference system and information I.D. No. list

ID No. ID No. ConnectorInformation(#8997) (#8998) Connecting line OVInformation

400 12

CA8(18)CA8(7)

(19)(20)

General purpose analoginput

401 12

01P1E/CA1(5)01P26/CA1(5)

(18)(18)

Analog input in whichspindle load current hasbeen converted to voltage

402 123456789101112131415

–––––––––––––––

–––––––––––––––

Conversion value of loadcurrent of NC control axisto voltage

A/D conversion data is data in which the –10V to +10V inputted to theNC A/D converter has been converted to a 0 to +255 digital value.

The digital value becomes the value of the ratio –10V to 0, 0V to 128,+10V to 255.

The relationship between AC servo motor load current and calculatedvoltage of the NC control axis is as follows. Voltage indicates load whichshows a positive voltage, but if the rotation direction of the AC servomotor changes, a negative voltage will be inputted. In that case, the ratingand converted digital value change to the value shown inside ( ).

4.5.17A/D Converter DataReading byConversational Macro

Page 88: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

85

1) AC analog servo

AC Form la for conversionRating

motormodel

Form ula for conversionto digital current value Load current I

(Arms) Digital value

5–04–04–02–01–00510

20M2030

30R30A0L5L6L7L10L

128+102I128+30.7I128+30.7I128+10.9I128+10.9I128+3.2I128+3.2I128+3.2I128+3.2I128+1.6I128+1.6I128+1.28I128+1.28I128+3.2I128+1.6I128+1.6I128+1.28I128+1.28I

0.49 (0.69)0.93 (1.3)0.93 (1.3)3.0 (4.2)2.9 (4.1)4.6 (6.5)6.8 (9.6)11 (16)15 (21)20 (28)22 (31)29 (41)32 (45)5.8 (8.2)11.4 (16)15.1 (21)37 (52)51 (72)

178 (199)156 (168)156 (168)160 (174)160 (173)143 (149)150 (159)163 (179)176 (195)160 (173)163 (178)165 (180)169 (200)147 (154)146 (154)152 (162)175 (195)193 (220)

2) AC digital servo

AC Form la for conversionRating

motormodel

Form ula for conversionto digital current value Load current I

(Arms) Digital value

5–04–0S3–0S2–0S1–0S0S5S10S

20S/150020S30S

30S/150040

50S60S70S

128+64I128+32I128+32I128+10.9I128+10.9I128+3.2I128+3.2I128+3.2I128+3.2I128+1.6I128+1.6I128+1.28I128+1.28I128+0.577I128+0.384I128+0.384I

0.49 (0.69)0.93 (1.3)0.93 (1.3)3.0 (4.2)2.9 (4.1)4.6 (6.5)5.9 (8.3)7.6 (10.7)15 (21)20 (28)22 (31)29 (41)32 (45)66 (45)88 (124)119 (168)

152 (172)158 (170)158 (170)160 (174)160 (173)143 (149)147 (155)152 (162)176 (195)160 (173)154 (165)165 (180)169 (200)166 (182)162 (176)174 (193)

AC Form la for conversionRating

motormodel

Form ula for conversionto digital current value Load current I

(Arms) Digital value

0L5L6L7L10L

128+3.2I128+1.6I128+1.6I128+1.28I128+1.28I

5.8 (8.2)11.4 (16)15.1 (21)37 (52)51 (72)

147 (154)146 (154)152 (162)175 (195)193 (220)

NoteThe values in parentheses in the columns of load currentand digital value represent peak values. Peak values arenormally read.

Page 89: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

86

The following system information can be referenced by conversationalmacro by the window function.

1. Alarm information2. External alarm information3. Machining parts total number, shift time, cutting time4. Diagnose information

Conversational macro variable#8997: System information I.D.#8998: Axis number#8999: System information#8996: Complete code

Method of useSet the system information I.D. number you desire to reference to #8997.Further, when system information is dependent on the axis, set thenumber of the axis you want to reference to #8998, and then the systemside information can be learnt by reading #8999.

Further, the information of whether or not the read operation to #8996ended normally will be set. (0 if normal end, –1 if abnormal end)

Example:� Alarm information1) P/S alarm (foreground) monitoring

#8997=1 ; Alarm system information I.D. is 1#500=#8999 ; Incorporates alarm information#500=#500AND2 ;IF [500EQ0] GOTO 90 ;

Distinguishes if P.S alarm status#8997=30 ; P/S alarm system information I.D. is 30#500=#8999 ; Incorporates P.S alarm number#501=#8996 ; Sets function execution resultsN90 M99 ;

If above is set, the P/S alarm number is set to #500. Further, theinformation of whether the window function in #501 hasexecuted normally or not is set.

2) Monitoring axis type OT alarm (Monitoring stored stroke limit 1 of plus direction of control 1st axis)#8997=11 ; Axis type OT alarm flag 1 I.D. is 11#8997=1 ; Axis number#500=#8999 ; (Incorporates I.D. number 11 contents)#500=#500AND1 ;#501=#8996 ; (Sets execution results of function)N90 M99 ;

If (above) is set, 1 is set to #500 when there is stored stroke limit1 prohibited area. Further, the information of whether thewindow function in #501 has executed normally or not is set.

Machining parts total number#8997=200 ;(Machining parts total number I.D. is 200)#500=#8999 ;#501=#8996 ; (Sets execution results of function)

4.5.18Conversational MacroVariable WindowFunction

Page 90: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

87

If (above) is set, the machining parts total number is set to #500.Further, the information of whether the window function in #501has executed normally or not is set.

In the following cases, when the window function is executed, –1(abnormal end) is set to #8996. When value inputted to #8997 is illegal.When value inputted to #8998 exceeded 8 axes.

Reference system and information I.D. No. list

I.D. No.(#8997)

Axis I.D. No.(#8998) Information contents

1234567891011121314151617181930313233343536

––––––––––

1 to 61 to 61 to 61 to 61 to 61 to 61 to 61 to 61 to 6

–––––––

Alarm basic flagOH alarm flagSW alarm flagPW alarm flagOT alarm flag 1OT alarm flag 2OT alarm flag 3OT alarm flag 4I/O alarm flagSV alarm flagAxis type OT alarm flag 1Axis type OT alarm flag 2Axis type OT alarm flag 3Axis type OH alarm flagAxis type SV alarm flag 1Axis type SV alarm flag 2Axis type SV alarm flag 3Axis type SV alarm flag 4Axis type SV alarm flag 5P/S alarm number (foreground)P/S alarm number (background)SR alarm numberExternal alarm number 1External alarm number 2External alarm number 3External alarm number 4

200201202

–––

Machining parts total numberProcess timeCutting time

300301

––

Diagnose 1000Diagnose 1001

NoteAxis I.D. No. is as described below.Control 1st axis 1. . . . . . Control 2nd axis 2. . . . . Control 3rd axis 3. . . . . . Control 4th axis 4. . . . . . Control 5th axis 5. . . . . . Control 6th axis 6. . . . . .

Caution

Page 91: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

88

Alarm basic flag

I.D No.(#8997) Bit name Information contents Error

code

BGPS (01H) Background P/S alarm

FGPS (02H) Foreground P/S alarm

OHALM (04H) OH alarm

– (08H) Undetermined

– (10H) Undetermined

SWON (20H) SW alarm

OTALM (40H) OT alarm

1– (80H) Undetermined

1EXTALM (100H) External alarm

– (200H) Undetermined

SRALM (400H) SR alarm

– (800H) Undetermined

SVALM (1000H) SV alarm

IOALM (2000H) I/O alarm

PWALM (4000H) PW alarm

– (8000H) Undetermined

External alarm:

When this bit is 1 it means that data has been set to external alarmnumber 1, 2, 3, or 4.

SR alarm:

When this bit is 1 it means that data has been set to external alarmnumber 1, 2, 3, or 4.

SV alarm:

When this bit is 1 it means that data has been set to SV alarm flag, oraxis type SV alarm flag 1, 2, 3, or 4.

IO alarm:

When this bit is 1 it means that data has been set to IO alarm flag.PW alarm:

When this bit is 1 it means that data has been set to PW alarm flag.Background P/S alarm:

When this bit is 1 it means that data has been set to P/S alarm number(background).

Foreground P/S alarm:

When this bit is 1 it means that data has been set to P/S alarm number(foreground).

OH alarm:

When this bit is 1 it means that data has been set to OH alarm flagor axis type OH alarm flag.

SW alarm:

When this bit is 1 it means that data has been set to SW alarm flag.OT alarm:

When this bit is 1 it means that data has been set to OT alarm flag 1,2, 3 or 4, or axis type OT alarm flag 1, 2 or 3.

Page 92: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

89

OH alarm flag

I.D No.(#8997) Bit name Information contents Error

code

OHLOK (01H) NC cabinet is over–heated OH001

– (02H) Undetermined

– (04H) Undetermined

2– (08H) Undetermined

2– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

SW alarm flag

I.D No.(#8997) Bit name Information contents Error

code

SWON (01H) State that parameter setting is pos-sible (parameter. data number 8000PWE=1)

SW000

– (02H) Undetermined

– (04H) Undetermined3 – (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

PW alarm flag

I.D No.(#8997) Bit name Information contents Error

code

SWOFF (01H) Parameter for which power must beonce interrupted has been set.

PW000

PWMIS (02H) There is an error in the setting of aparameter related to straightnesscompensation or inclination com-pensation.

PW100

4 – (04H) Undetermined

– (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

Page 93: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

90

OT alarm flag 1

I.D No.(#8997) Bit name Information contents Error

code

– (01H) Undetermined

SPOH (02H) Spindle motor is overheated OT 101

SPVE (04H) Deviation between spindle motorcommanded speed and actualspeed is excessive (15–20%)

OT 012

SPFU7 (08H) Spindle motor speed control unitfuse F7 has been cut

OT 103

5 SPFU1 (10H) Spindle motor speed control unitfuse F1, F2, or F3 has been cut

OT 104

SPFUA (20H) Spindle motor speed control unitfuse AF2 or AF3 has been cut

OT 105

SPEXA (40H) Spindle motor speed has exceededmaximum rating (analog detection)

OT 106

SPEXD (80H) Spindle motor speed has exceededmaximum rating (digital detection)

OT 107

OT alarm flag 2

I.D No.(#8997) Bit name Information contents Error

code

SP24V (01H) Spindle motor speed control unit24V voltage is too high

OT 108

SPCND (02H) Power semi–coductor is overheated OT 109

SP15V (04H) Spindle motor speed control unit15V voltage is too low

OT 110

6

SPHIV (08H) Spindle motor speed control unitDC link section voltage has risenexcessively

OT 111

6SPCUR (10H) Spindle motor speed control unit

DC link section current has flowedexcessively

OT 112

SPCPU (20H) Spindle motor speed control unitCPU or peripheral circuit is abnormal

OT 113

SPROM (40H) Spindle motor speed control unitROM is abnormal

OT 114

– (80H) Undetermined

Page 94: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

91

OT alarm flag 3

I.D No.(#8997) Bit name Information contents Error

code

OTPCD (01H) Position coder disconnection hasbeen detected

OT 116

OTADH (02H) External data input/output I/F signalupper rank 4 bits are not definedAddress (major category) is notspecified

OT 120

OTADL (04H) External data input/output I/F signallower rank 4 bits are not definedAddress (minor category) is notspecified

OT 121

OTMOV (08H) More than 5 displays simulta-neously requested for external;operator message or external alarmmessage display

OT 122

7

OTNOM (10H) Because there is no specified mes-sage number in cancel of externaloperator message or external alarmmessage, it cannot be cancelled.

OT 123

7OTOUT (20H) Output again requested during

external data output, Or, outputrequested for address with no out-put data.

OT 124

OTNUM (40H) Value specified outside range0–999 for number of external oper-ator message or external alarmmessage

OT 125

OTSRH (80H) There is no external data input pro-gram number or number specifiedby sequence number search. Or,there is no program number speci-fied by workpiece number search.Tool data pot number and offsetamount input/output was requested,but when power turned on toolnumber input was not performed,or, there is no tool data corre-sponding to inputted tool number.

OT 126

Page 95: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

92

OT alarm flag 4

I.D No.(#8997) Bit name Information contents Error

code

OTHW (01H) Numerical value inputted by exter-nal data input data signalEID32–EID47 has exceeded per-missable range.

OT 127

OTLL (02H) Numerical value inputted by exter-nal data input data signalEID00–EID31 has exceeded allow-able range.

OT 128

OTREV (04H) Position coder CPU or peripheralcircuit are abnormal.

OT 129

8 OTNOR (08H) Status that program number,sequence number search requestscannot be received. (Because notin memory mode or not in reset sta-tus)

OT 130

OTCVT (10H) A/D converter has failed. OT 150

– (20H) Undetermined

OTOTR (40H) There were input requests for potnumber, offset number in the midstof registering tool data by G10.

OT 131

– (80H) Undetermined

I/O alarm flag

I.D No.(#8997) Bit name Information contents Error

code

– (01H) Undetermined

– (02H) Undetermined

– (04H) Undetermined

– (08H) Undetermined

– (10H) Undetermined9 100VR (20H) Attempted to perform writing or

reading of data at address outsidefile memory area.

IO 032

10SUM (40H) NC memory 1 page unit checksomeis not correct.

IO 303

10CHR (80H) Ilegal code has been read from NCmemory.

IO 031

SV alarm flag

I.D No.(#8997) Bit name Information contents Error

code

SVESP (01H) Emergency stop has been applied. SV 030

– (02H) Undetermined

– (04H) Undetermined

10– (08H) Undetermined

10– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

Page 96: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

93

OT axis type alarm flag 1

I.D No.(#8997) Bit name Information contents Error

code

OTSP1 (01H) Entered prohibited areas of storedstroke limit 1 during shift in + direc-tion.

OT 001

OTSM1 (02H) Entered prohibited areas of storedstroke limit 1 during shift in – direc-tion.

OT 002

OTSP2 (04H) Entered prohibited areas of storedstroke limit 2 during shift in + direc-tion. Entered prohibited areas ofcheck tailstock barrierduring shift in+ direction.

OT 003

11OTSM2 (08H) Entered prohibited areas of stored

stroke limit 2 during shift in – direc-tion. Entered prohibited areas ofcheck tailstock barrier during shift in– direction.

OT 004

OTSP3 (10H) Entered prohibited areas of storedstroke limit 3 during shift in + direc-tion.

OT 005

OTSM3 (20H) Entered prohibited areas of storedstroke limit 3 during shift in – direc-tion.

OT 006

OTHP (40H) Exceeded + side stroke limit switch. OT 007

OTHM (80M) Exceeded – side stroke limit switch. OT 008

OT axis type alarm flag 2

I.D No.(#8997) Bit name Information contents Error

code

OTPSP (01H) Entered prohibited area in + direc-tion by preprocess stroke check.

OT 021

OTPSM (02H) Entered prohibited area in – direc-tion by preprocess stroke check.

OT 022

– (04H) Undetermined

12 – (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

Page 97: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

94

OT axis type alarm flag 3

I.D No.(#8997) Bit name Information contents Error

code

OTAD2 (01H) A/D converter failed. OT 151

OTABS (02H) No correspondence between abso-lute pulse coder count value anddevice coordinate

OT 032

– (04H) Undetermined13 – (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

OH axis type alarm flag

I.D No.(#8997) Bit name Information contents Error

code

– (01H) Undetermined

OHMTR (02H) Servo motor is overheated. OH 000

– (04H) Undetermined

14– (08H) Undetermined

14– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

SV axis type alarm flag 1

I.D No.(#8997) Bit name Information contents Error

code

SVTAC (01H) Taco generator disconnection alarmhas been disconnected.

SV 000

SVEXC (02H) Servo motor excess load has beendetected (overload).

SV 001

SVBRK (04H) Speed control circuit breaker hasbeen cut.

SV 002

15SVCUR (08H) Excess current has been detected

by speed control circuit.SV 003

SVVOL (10H) Excess voltage has been detectedby speed control circuit.

SV 004

SVDIS (20H) Excess circuit current has beendetected by speed control circuit.

SV 005

SVLOW (40H) Low voltage has been detected byspeed control circuit.

SV 006

– (80H) Undetermined

Page 98: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

95

SV axis type alarm flag 2

I.D No.(#8997) Bit name Information contents Error

code

SVSTP (01H) Position deviation amount duringstop exceeds parameter setting.

SV 008

SVMOV (02H) Position deviation amount duringprocess exceeds parameter setting.

SV 009

SVDRF (04H) Drift amount is excessive. SV 010

SVLSI (08H) Position deviation amount hasexceeded + –32767. Or, DA con-verter speed command value is out-side the range –8192 – +8192

SV 011

16 SVMOT (10H) Speed of more than 512K pulse/sec. has been commanded.

SV 012

SVON (20H) Although position control ready sig-nal (PRDY) was on, speed controlready signal (VRDY) became off.

SV 013

SVOFF (40H) Although position control ready sig-nal (PRDY) was off, speed controlready signal (VRDY) became on.

SV 014

SVPDS (80H) Pulse coder disconnection wasdetected.

SV 015

SV axis type alarm flag 3

I.D No.(#8997) Bit name Information contents Error

code

SVLSI (01H) Abnormality was detected by posi-tion control LSI.

SV 017

SVFRE (02H) Abnormality was detected byresolver or induction feedback fre-quency check.

SV 018

SVUNF (04H) Abnormality was detected in returnpulse from pulsecoder.

SV 019

17

SVPHA (08H) Resolver or induction phase shiftamount cannot be correctlyrequested.

SV 020

SVRON (10H) Pulse coder 1 rotation signal wasset on at abnormal location.

SV 021

SVRMS (20H) Pulse coder 1 rotation signal wasset on at abnormal location.

SV 022

SVOVL (40H) Servo motor overload wasdetected.

SV 023

SVCMP (80H) Straightness compensation amountexceeded �32767.

SV 100

Page 99: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

96

SV axis type alarm flag 4

I.D No.(#8997) Bit name Information contents Error

code

– (01H) Undetermined

SVABS (02H) Absolute pulse coder failure ordevice position for greatly movingthe device when turning on powerwas not correctly requested.

SV 101

18– (04H) Undetermined

18– (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

SV axis type alarm flag 5

I.D No.(#8997) Bit name Information contents Error

code

SVCVO (01H) When servo control is on, speedcontrol ready signal is on although itshould be off.

SV 025

SVARG (02H) Servo axis arrangement parameteris not correctly set.

SV 026

19– (04H) Undetermined

19– (08H) Undetermined

– (10H) Undetermined

– (20H) Undetermined

– (40H) Undetermined

– (80H) Undetermined

Alarm number

I.D No.(#8997) Information contents

30 Foreground P/S alarm number

31 Background P/S alarm number

32 SR alarm number

33 External alarm number

34 External alarm number

35 External alarm number

36 External alarm number

(1) Reading relative coordinatesReading the relative coordinate value can be performed byconversational macro.Set the axis number to perform relative coordinate value reading to#8998, and the relative coordinate value can be read by #8999.

4.5.19Reading RelativeCoordinates byConversational Macro,and Preset

Page 100: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

97

#8996 : Complete code#8997 : Information I.D.#8998 : Axis number#8999 : Relative coordinate value

Macro Variable Contents

#8997 Information ID500: Reading relative coordinate

#8998 Axis number (1 to 8)

#8999 Relative cordinate value

#8996Complete code0: Normal end–1: Abnormal end

Example:Relative coordinate value of 1st axis is read as –123456 to #500 if #8997=500 ;#8998=1; (Incorporates contents of 1st axis)#500=#8999;is set when –123.456

1) The value which will be read by #8999 is <Vacant> when a value outside1–8 is specified to #8998.

2) For #8998, 0 is set when turning on the power.

(2) Preset of relative coordinate valueThe relative coordinate value can be freely preset by G360 Aa Qq.The axis number is set in address A.A1 to 8Set the relative coordinate you desire to preset to address Q.Q–999999999 to 999999999The relative coordinate value can be preset by executing this controlcode.

Example:When you desire to preset the relative coordinate value of 1st axis to–123.45G360 A1 Q–123450 ;

1) G360 command is ignored when a value other than 1 to 8 is specifiedto address A, or when A is not specified.

2) The units of address Q are the minimum setting units of the specifiedaxis.

The address function is that which returns the PMC address or NCparameter contents as a functional value. However, the address functioncannot be described to the left side of the calculation because it cannot bewritten.

Caution

Caution

4.5.20Address Function

Page 101: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

98

There exist the following screen display control codes. The meanings ofthe control codes and addresses differ from the meanings of the normalNC character addresses.

G230 : Cursor displayG202 : Screen deletionG240 : Color specificationG242 : Drawing start point settingG243 : Character displayG244 : Drawing line type specificationG280 : Prompt character displayG301 : Linear drawingG302 : Circular drawing (clockwise)G303 : Circular drawing (counter clockwise)G390 : Absolute mode specificationG391 : Incremental mode specificationG392 : Dot coordinate system specification

G230, G202, G242, G244, G280, G392 are one–shot G codes. All theother G codes are modal G codes and are interpreted as the same G codegroup.

� Modal addresses and their meaningX : X coordinate of character coordinate system, X coordinate of

graphic coordinate system drawing end point

Y : Y coordinate of character coordinate system, Y coordinate ofgraphic coordinate system drawing end point

I : X coordinate of graphic coordinate system circular drawingcenter

J : Y coordinate of graphic coordinate system circular drawingcenter

A : Character size (character display)

B : Blinking specification (character display)

F : Format of numerical value display (character display)

Z : Zero suppress specification of numerical display (characterdisplay)

NoteNote that addresses X, Y are used as modal addresses incommon with character display, graphic display.

� One–shot addresses and their meaningD : Numerical value to be displayed

K : Number of spaces to be displayed

C : Character code

P : Sequence number, screen specification, attribute specification,drawing line type specification

NoteAll addresses cannot be processed when macro call. Theyare treated as arguments.

4.5.21Screen Display ControlCodes

Page 102: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

99

(1) Cursor control codePerforms cursor display.G230XxYyLl ;1. Commands cursor display position by address X, Y in character

coordinate system.2. Commands cursor length by address L.

NoteA cursor with cursor length of 0 is deleted.

(2) Screen deletion (G202)Graphic screen, character screen, or both are deleted by specificationof address P.G202Pp ;P=1 : Graphic screen deletionP=2 : Character screen deletionP=3 : Graphic screen deletion, character screen deletion

(3) Color specification (G240)Specifies color of lines and character arrays.G240Pp(Ll) ;When CRT 14”

P=1 : RedP=2 : GreenP=3 : YellowP=4 : BlueP=5 : PurpleP=6 : Light–blueP=7 : WhiteP=–1 : Red (Reversal)P=–2 : Green (Reversal)P=–3 : Yellow (Reversal)P=–4 : Blue (Reversal)P=–5 : Purple (Reversal)P=–6 : Light–blue (Reversal)P=–7 : White (Reversal)

When CRT 9”P=1 to 3 : StandardP=4 to 7 : High brightnessP=–1 to –3 : Standard (Reversal)P=–4 to –7 : High brightness (Reversal)L1: Blink specification on (When L1 not specified, blink is off)

The line, character row to be commanded after this command isdisplayed in the color specified by P.

(4) Drawing start point specification (G242)Commands drawing start point and graphic coordinate systemabsolute value by address X, Y. The next drawing is per–formed fromthis point.G242XxYy ;

(5) Character load displayG243XxYyAaBbCc(C–––––)(*H–––––*)KkFfEeDdPp ;1. Address X, Y commands character row display position by

address X, Y in character coordinate system.

Page 103: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

100

NoteWhen both X, Y are commanded you must continue tocommand.

2. Address A commands size of character.A=1 : Standard character A=2 : Double characterA=3 : Triple characterOnly alphanumerics can be displayed with double size. Whendoublesize display is specified, alphanumerics having the samesize as kanji characters are displayed. Double–size displaycannot be applied to characters and symbols included in thekanji/hiragana code table.Triple character have a size three times the length and twice theheight of the standard characters. The characters which can bedisplayed as triple characters are alphabet, numerals, minussymbol, and the decimal point. Characters other than thesecannot be displayed as triple characters.

3. Address B commands blinking control.B=0 : Does not blinkB=1 : Blinks

NoteIf B1 is commanded, subsequent character row displays allblink.

4. Address K specifies the number of spaces. Displays only thenumber of spaces specified by K. If space is displayed, thecoordinates are renewed.

5. The circle directly commands the character row you want todisplay. Characters which can be commanded directly byenclosing in circles are alphabet, numerals, minus symbol,decimal point, and space.Example:

G243 (FANUC) ; ”FANUC” is displayed.

NoteThe character row can be specified up to a total maximumof 255 characters in one block.

6. “(*“and”*)” command the character row you want to display byinternal codes after enclosing by “(*”and”*)”. The character codeis specified in hexadecimal. Further, separate the codes byspaces. Hiragana, alphabet and Kanji take a space equivalent totwo characters.Example:

G243 (*46 41 4E 55 43 20*) ;G243 (*4E 43 4175 4356*) ;“FANUC NC UNIT” is displayed.

Notes1 The character row can be specified up to a total maximum

of 255 characters in one block.2 For the code, use the JIS code. (Codes on “1.7 List of Kanji

and Hiragana Codes” in Appendix 1.

Page 104: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

101

7. Address C commands a character code you want to directlydisplay. Codes which can be commanded are 32–95 (20–5F inhexadecimal) or 160–223 (A0–DF in hexadecimal).Example:

G243 C65 ; “A” is displayed.

NoteFor the code, use ASCII code.

8. Address P commands the sequence number containing thecharacter row. Regarding the display contents, the sequencenumber 1 block character row which is specified by P in theprogram set to character row registered program control variable(#8509), is displayed. However, when the value of #8509 is 0,the sequence number 1 block character row specified inside thesame program is displayed.Example:

O9000 ; O8000 ;: :

#8509=8000 ; N10 (IJK) ;G243 (ABC) P20 ; N20 (XYZ) ;

: :M99 ; M99 ;

In the above example, 1 block of the program number 8000sequence number 20 is displayed. Namely, “ABCXYZ”.

9. Address D commands the numerical value to be displayed.10. Address F commands the format when displaying the numerical

value. Commands the number of digits displayed to the left ofthe decimal point, and the number of digits after the decimal pointon the right.

11. Address Z commands whether or not to set Leading ZeroSuppress when displaying the numerical value. When Z is 0 theencoding is not displayed.

Z=0 : Does not set Leading Zero SuppressZ=1 : Sets Leading Zero Suppress

Example: G243 D123 F4.2 Z1 ;“1.23” is displayed.

Notes� Display is executed in specification sequence.� The same address must not be commanded twice.� X and Y must not be specified separately.� F and Z are enabled first.� (_), (*_* ) are enabled up to a maximum of 5 together in the

same block.� (_*_*_) specification is also enabled.

(6) Drawing line type specificationSpecifies types of line to be drawn linearly or circularly.P=0 : Continuous line ———————P=1 : Broken line ––––––––––––––P=2 : One–dot chain line –�–�–�–�–�–�–�–�–�P=3 : Two–dot chain line –��–��–��–��–��–��–P=4 : Deleted

Page 105: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

102

(7) Prompt character display (G280)The prompt character is the character to prompt input. This can bedisplayed to the character row input mode (when input controlvariable #8502=3). The specification method for the character rowis the same as for G243.G280 (C–––––) ;G280 (*H–––––*) ;G280 Pp ;

NoteG280 is a one–shot G code. Namely, it is enabled only forthe commanded block.

(8) Dot coordinate system setting (G392)Sets the dot coordinate system by graphic coordinate system.Subsequent commanded drawing commands will be commands inthis coordinate system.G392XxYy ;

(9) Absolute command (G390), incremental command (G391)Commands whether coordinate commands in character coordinatesystem, graphic coordinate system are absolute mode commands(G390) or incremental mode commands (G391).

(10)Linear drawing (G301)Draws lines in specified X, Y coordinates.G301XxYy ;

(11)Circular drawing (G302/G303)G302 Circular drawing CWG303 Circular drawing CCWG302 (or G303) XxYyIiJj ;

Xx :X coordinate of circular drawing end point

Yy :Y coordinate of circualr drawing end point

Ii : Component of X direction vector looking at circle center fromcircle start point

Jj : Component of Y direction vector looking at circle center fromcircle start point

i

Center

Start point

End point(x, y)

j

Page 106: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

103

Example:G242 X0.0 Y0.0 ;G391 G301 X200.0 ;G302 X–200.0 I–100.0 ;G303 X–200.0 I–100.0 ;G301 X200.0 ;

If the above described program is executed, the drawing below willbe performed in the graphic coordinate system.

14” CRT

100

–100

–216

0

216

–297 –200 0 200 297

(12)Rapid traverse rate specification (G311)Determines speed in X direction, Y direction when rapid traversedrawing.G311 X__ Y__ ;

Function: Specifies speed rate when performing rapid travsersedrawing.

(13)Rapid traverse drawing (G300)Draws from current position to specified point by rapid traverse. Pathis by rapid traverse rate specification.G300 X__ Y__ ;

(14)Closed area painting (G320)Paints a closed area at specified position in specified color.G320 X__ Y__ P__ ;X, Y : Coordinate value inside area to be paintedP : Color of area to be painted

Page 107: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

104

Notes1 The color used to fill in a graphic (specified in G320) must be the same as the color of the line

drawing the graphic.2 When specifying black as the color used to fill in the graphic (deletion of the graphic), set the

value of P to 0 in the following instructions:G240Pp;G320XxYyPp;Example :G240P4;

G242X0Y0;

G390G301X200;

Y100;

X0;

Y0;

G320X15Y5P4;

Blue

G240P0;

G242X0Y0;

G390G301X200;

Y100;

X0;

Y0;

G320X15Y5P0;

Black

(15)Marking (G321)G321 X__ Y__ M__ P__ ;X, Y : Coordinate value to display markM : Specifies number of mark to be displayedP : Specifies color of mark to be displayed

The following describes the mark number and associated mark typeby a dot pattern.

Mark number 1 2 3 4 5

Mark Origin mark Upwards arrow Downwards arrow Leftwards arrow Rightwards arrow

000000 0000

0 000000 000000000*00000000 00000 0

000 000000

*0 0

0 00 0

0 00 0

0 0*

00

0*

00

0

00

0*

00

0

Mark number 6 7 8 9 10

Mark Left upwardsarrow

Left downwardsarrow

Right upwardsarrow

Right downwardsarrow

Black circle mark

*0 0 0000

000*0 0 0

*0 0 0000

000

*0 0 0

00000000

0000000000*0000000000

00000000

Note“*” indicates the coordinate value to be displayed.

Page 108: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

105

The following control codes are provided for execution control. Thenumber of times the conversational macro program call can be performedis 4 times.G65 : Conversational macro program macro callM98 : Conversational macro program sub–program callM99 : Conversational macro program end

(1) Macro call (G65) G65P(program number) L(repetition count) <Argument specification> ;By means of executing the above command the conversational macroprogram specified by P (program number) is called. When it isnecessary to transfer the argument, it can be referred to as a localvariable in the called program by .<Argument specification>.

(2) Subprogram call (M98)M98P(program number) L (repitition count);By means of executing the above command the conversational macroprogram specified by P (program number) is called.

(3) Conversational macro program end (M99)M99 or M99P (Sequence number) ;When specified by call destination program, it returns to call originprogram. If address P has been specified, it returns to the sequencenumber block specified by call origin program P.The final part of the main program must command “M99”. The following describes the main program ”M99”.

1. If “M99” is commanded in main program, the conversationalmacro execution ends.

2. If the conversational macro program execution is started, until“M99” ends it will not switch to other screens even if functionkeys are pressed.

3. If “M99” is commanded in main program, it examines the valueof conversational macro control variable 1 (#8500) and, if it ischanged, both the character display and graphic display aredeleted and control transfers to a new conversational macroprogram. If it is not changed, the same conversational macroprogram continues to execute without either the character displayor graphic display being deleted. At this time, if address P isspecified, execution restarts from the sequence number blockspecified by P.

4. If “M99” is specified, local variables are initialized as <Vacant>.5. If the function keys are pressed during conversational macro

execution, after the conversational macro executioion ends boththe character display and graphic display are deleted and itswitches to the corresponding screen. Again, if theconversational macro call key (software key) is pressed, theconversational macro execution restarts according to the value ofthe converdsational macro execution control variable (#8500).At this time, the program is executed from the beginningregardless of the address P command.

4.5.22Execution ControlCode

Page 109: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

106

(4) Auxiliary macro program end (M99)M99 or M99P(Sequence number) ;The final part of the main program must command “M99”. The following describes the main program “M99”.1. If “M99” is commanded, the auxiliary macro execution ends.2. If “M99” is commanded, it examines the value of conversational

macro control variable 2 (#8600) and, if it is changed, controltransfers to a new conversational macro program. If it is notchanged, the same conversational macro program continues toexecute. At this time, if address P is specified, execution restartsfrom the sequence number block specified by P.

3. If “M99” is specified, local variables are initialized as <Vacant>.

Circuit control can be performed by conversational macro function.Control is performed by a combination of the following 7 control codes.These functions are valid if bit 7 of parameter 8508 is set to 1. Otherwise,operation will be unpredictable.

G330 � Circuit openG331 � Circuit closeG335 � 1 byte readG336 � Data transmissionG337 � Macro variable data input G338 � Macro variable data output G339 � Directory information read, file deletion

A completion code is available which allows the user to check ifinput/output processing has been executed normally. Check the code aftercontrol code execution.#8539: Completion code (read only)

(1) Circuit open (G330)G330 Pp Bb Ss Cc ;Function: Opens the specificed channel according to controlconditions and sets useable status.P : Interface number of I/O device for foreground1 : User macro control with RS–232–C12 : User macro control with RS–232–C23 : User macro control with RS–232–C3101 : Input control with RS–232–C 1102 : Input control RS–232–C 2103 : Input control RS–232–C 3110 : Input control with remote buffer113 : Input control with RS–422201 : Output control with RS–232–C 1202 : Output control with RS–232–C 2203 : Output control with RS–232–C 3210 : Output control with remote buffer213 : Output control with RS–422301 : Directory control with RS–232–C 1302 : Directory control with RS–232–C 2303 : Directory control with RS–232–C 3310 : Directory control with remote buffer313 : Directory control with RS–422B : Baud rate of input/output device

4.5.23RS–232–C Control byConversational Macro

Page 110: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

107

1:50 2:100 3:1104:150 5:200 6:3007:600 8:1200 9:240010: 4800 11: 9600

S : Number of stop bits1 : 1 stop bit, without parity2 : 2 stop bits, without parity11: 1 stop bit, with parity12: 2 stop bit, with parity

NoteWhen FANUC Cassette or FANUC PROGRAM FILE Mateis used, specify S11 or S12.

C : Specification of output code0 : ISO code1 : EIA code

(i) User macro controlUser macro control allows data reception and transmission usingcontrol signals CS and RS instead of control codes DC1 to DC4.Protocol:Data transmission is started and stopped by using control signals CSand RS.(1) When the CNC receives data(a) The CNC turns on its RS signal when it is ready to receive data.(b) Upon reception of the on RS signal (recognized by the I/O device

as the CS signal), the I/O device starts data transmission to theCNC.

(c) When the CNC has received more data than it can handle (overflow), it turns off the RS signal.

(d) Upon reception of off RS signal (the CS signal on the I/O device),the I/O device suspends data transmission to the CNC. After theoff RS signal is received data transmission must be stoppedwithin two characters. Otherwise, an alarm is issued.

(e) When the CNC becomes ready to receive data again, it turns onthe RS signal.

(f) Upon reception of the on RS signal (the CS signal), the I/O deviceresumes data transmission to the CNC.

(g) When the CNC has received all the data, it turns off the RS signal.(h) When data transmission is completed, the I/O device stops

operating.

DataData

CompleteResumeSuspendStartCNC

RS

(Output)

I/O device

RD

(Input)

Within two characters

(2) When the CNC transmits data(a) Upon detection of the on CS signal, the CNC starts data

transmission to the I/O device.

Page 111: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

108

(b) When the I/O device has received more data than it can handle(over flow), it turns off the CS signal it sends to the CNC (the RSsignal of the I/O device). After it detects the OFF CS signal theCNC stops data transmission within two characters. Datatransmission is continued when the CS signal is turned on again.

(c) When the I/O device becomes ready to receive data again, it turnson the CS signal of the CNC (the RS signal of the I/O device).The CNC then resumes data transmission and sends theremaining data.

(d) When all the data has been transmitted, the I/O device turns offthe CS signal of the CNC (the RS signal of the I/O device).(1)

DataData

CompleteResumeSuspendStartI/O deviceCS(Input)

CNCSD(Output)

Within two characters

(2) Circuit close (G331)G331 ;Function: Closes circuit during open.

(3) 1 byte read (G335)G335 Pp ;Function: Substitutes data to 1 byte reading specified macro variable.

P : Specifies macro variable number to substitute data which hasbeen read.

(4) Data transmission (G336)G336 Cc (c � � ) (*H � � *) Kk Ff.e Dd Pp Zz ;Function: Outputs data in specified format.

C : Specifies character code you desire to direct output.

( ) : Direct specifies the character row you desire to output enclosedin ( ).

(**): Encloses the character row you desire to output by “(*“and”*)”and specifies by internal code.Character code is specified in hexadecimal.Separate the codes with spaces.

K : Specifies number of spaces (null). Outputs only the numberof null codes specified by K.

F : Specifies format when outputting numerical value.

D : Specifies numerical value to be output.

P : Specifies sequence number containing character row. Outputcontents are set in c character array registration programcontrol variable (#8509), and outputs character array ofsequence number 1 block specified by P in the program.

Z : Commands whether or not to set reading zero suppress whencommanding numerical value.0 : Does not set reading zero suppress.1 : Sets reading zero supprewss.

Page 112: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

109

(5) Canceling data–receive wait (G335/G336)In the conventional RS–232–C control by the conversational macrofunction, the system remains in a wait state in the G335 block(one–byte read function) until data is received from the externaldevice.When data is not received within the time specified in the associatedparameter (8540), the wait state is canceled and completion code#8539 is set to 200. Note that by setting the associated parameter(8507#1), the cancel keys on the MDI/CRT panel can also be used tocancel the wait state.This function is also used to cancel the wait state during datatransmission (control code G336).

i) ExampleO9000;N1 G330 P101 B10 S12 C0; Line openN2 IF [#8539 NE 0] GOTO 10;N3 G335 P500; One byte readN4 IF [#8539 NE 0] GOTO 11;N5 G331; Line close :N11 G331;

G243 X0 Y1 (DATA INPUT ERROR); :During execution of the N3 block, if data is not receivedwithin the specified time, the N3 block is terminated, theprogram proceeds to the N4 block, then jumps to errorprocessing. At the same time, completion code #8539 is setto 200.By setting the associated parameter, the wait state at the N3block can also be canceled using the cancel keys on theMDI/CRT panel.

NoteWhen the parameter is set so that the MDI/CRT panelcancel key is effective, the key can also be used to cancelthe data receive operation during line data reading by theauxiliary macro function.

(6) Macro variable data input (G337)G337 Pp ;p : Number of the first variable where a macro variable is to be set

(omissible)Input macro variable data is read via a RS–232–C line opened in theread control mode, then is set in a specified variable.The following tape format is used for macro variable data:

LF N––––P–––– LF P–––– LF %

Reader part

Input startVariable number

Variable data Tape end

%

All information present before the first LF on tape is ignored. Validinformation starts with the first LF and ends with a tape end code(EOR).

Page 113: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

110

A valid information area starting with an LF and ending immediatelybefore the next LF is called a block; one block contains the data of amacro variable. Intra–block address N represents a variable number.Address P represents variable data.Address N is omissible; in this case, the variable number of theimmediately preceding block plus 1 is assumed.If N is omitted in the first block, a variable number specified inaddress P of the G337 command is set. Thus, tape with address N notspecified can be created, and the command of G337 Pp enablesvariable data to be read into an arbitrary variable.Address P represents the value of a variable, and cannot be omitted.The null value (#0) is to be set by specifying an LF immediately afterP without specifying a value, as shown below.

LF N––––– P LF

Notes1 G337 is a one–shot G–code.2 In valid information areas, all codes other than LF and EOR

codes, address N, address P, and succeeding numeric dataare ignored.

(7) Macro variable data output (G338)G338 Pp Qq Ff Zz;

p : Specifies the number of the first macro variable that is output.

q : Specifies the number of macro variable data items that areoutput.

f : Specifies the output format of macro variable data (Note 1).

z : Specifies zero suppression for macro variable data(Note 2).

Notes1 If F=9.3 is set when power is turned on, and f is specified,

the value, 9.3, is memorized. If f is not specified, theprevious value is used.

2 z=0 : Zero suppression is not performed.(Signs are not output.)

z=1: Zero suppression is performed.If Z=0 is set when power is turned on, and z is specified, thevalue, 0, is memorized.If z is not specified, the previous value is used.

Specified macro variable data converted to a certain tape format istransmitted (output) via a RS–232–C line opened in the transmissioncontrol mode. The output code depends on the C specification foropening the line.The output tape format is the same as the input format. The first blockcontains address N representing the first variable number and addressP representing variable data. In the succeeding blocks, a specifiednumber of variable data items are output with address P in succession,followed by a tape end code (EOR) at the end.Parameter No. 8509 PTCR can be specified to enable CR codes to beoutput block by block. Use this function, for example, for line feedon a printer.

Page 114: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

111

PTCR=0:The CR code is not output after an LF when macro variabledata is output.

LF N30000P1234 LF% P5678 LF %

PTCR=1:Two CR codes are output after an LF when macro variable datais output.

LF% CR CR N30000P1234 LF CR CR

P1234 LF CR CR %

Addresses F and Z are specified in the same way as for the screendisplay control code, G243. Address F allows the followingspecifications:1. If F=–9.9 is specified, the significant digits of macro variable data

are automatically determined before output. The same tapeformat as above is used for output. However, for variable dataother than–999999999. to –0.00000001 and999999999. to 0.00000001an LF is output immediately after P as in the case of the null value.

2. If F=–9.8 is specified, macro variable data is output infloating–point format. The same tape format as above is used foroutput except that address P is replaced by address Q, and thevariable data section is always 10 characters long.Macro variable data output in this tape format is read by G337without being concerned, and is stored in the variable infloating–point format.At the time of output, feed control is not exercised. When feedcontrol is required with a device such as paper tape/punch, useG336 (data transmission).

Notes1 G338 is a one–shot G–code.2 If invalid data is used to specify a variable number, output

processing is terminated with completion code 115.

(8) FANUC Cassette controlA specification of opening a line and the G339 control code allowoperations such as file data read, file creation, and file deletion on theFANUC Cassette or the FANUC Program File Mate.File data read (G330)File creation and data write (G330)Directory information read (G330/G339 P1)File deletion (G330/G339 P2)

1) File data read (G330)G330 Pp Bb Ss Cc (Ll/Ff/Aa);By specifying address L, F, or A when opening a line in the readcontrol mode, a specified file on the FANUC Cassette can be searchedfor to read file data.

Page 115: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

112

For address P/B/S/C specification, see the description of G330(opening a line).Note that read control (101/102/ . . .) must be specified in address P,and ISO(0) must be specified in address C.Select address L, F, or A according to the desired processing.

(i) Searching for a file by file nameBy specifying the first variable number of a variable stringcontaining a file name with address L, the desired file can besearched for by file name.A file name is to be set by using ASCII codes converted todecimal in a string of 17 variables beforehand, and the firstvariable number is to be specified with address L.Example: Searching for a file named ABCDIn 17 variables from #100 to #116, set 65 (A), 66 (B), 67 (C),68 (D), 32, . . . , 32 (space).G330 P101 B10 S12 C0 L100 ;

Notes1 A file name must always be 17 characters long. A file name

shorter than 17 characters must be padded on the right withspaces (32) to make a name 17 characters long.

2 A file name must consist of alphanumeric characters andspaces. However, completion code 20 is returned if a filename starts with a space code (32).

(ii) Searching for a file by file number By specifying the file number (1 to 9999) of a desired filewith address F, the file can be searched for by file number.Example: Searching for a file with file number 3G330 P101 B10 S12 C0 F3 ;

(iii)Searching for the next file By specifying address A, the file immediately following thefile that is currently searched for can be found. This functioncan be used to read files in succession.Always specify A1 for address L. Otherwise, completioncode 20 is returned.Example: Searching for the file next to the file currentlysearched for

G330 P101 B10 S12 C0 A1 ;2) File creation and data write (G330)

G330 Pp Bb Ss Cc (Ll/Ff);By specifying address L or F when opening a line in the transmissioncontrol mode, a new file can be created on the FANUC Cassette sothat data can be written to the file.For address P/B/S/C specification, see the description of G330(opening a line).Note that read control (201/202/ . . . ) must be specified in address P,and ISO(0) must be specified in address C.Select address L or F according to the desired processing.

(i) Creating a file by file nameBy specifying the first variable number of a variable stringcontaining a file name with address L, a new file can becreated under the specified name on the FANUC Cassette sothat data can be written to the file.A file name is to be set by using ASCII codes converted todecimal in a string of 17 variables beforehand, and the firstvariable number is to be specified with address L.

Page 116: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

113

Example:Creating a file named ABCDIn 17 variables from #100 to #116, set 65 (A), 66 (B), 67 (C),68 (D), 32, . . . , 32 (space).G330 P201 B10 S12 C0 L100 ;

Notes1 A file name must always be 17 characters long. A file name

shorter than 17 characters must be padded on the right withspaces (32) to make a name 17 characters long.

2 A file name must consist of alphanumeric characters andspaces. However, completion code 20 is returned if a filename starts with a space code (32).

3 A created file is added to the end of files already registered.

(ii) Creating a file by file number By specifying a file number (1 to 9999) with address F, a filewith the specified file number can be created so that data canbe written to the file.Example:Creating a file with file number 3G330 P201 B10 S12 C1 F3 ;

Notes1 When a file is created by specifying a file number, the

original file with the specified file number and the all files withthe succeeding file numbers are deleted.

2 To create a file by file number, the file number of a filealready registered only can be specified. For file addition,a file must be created by file name.

3) Directory information control (G330/G339)With control code G339, directory information can be controlled.Directory information read (G339 P1)File deletion (G339 P2)To use this function, a line must be opened in a directory informationcontrol mode. To specify a directory information control mode, 301,302, 303, 310, or 313 must be specified in address P when a line isopened.

G330 Pp Bb Ss Cc ;P301: Directory information control with RS–232–C 1

P302: Directory information control with RS–232–C 2

P303: Directory information control with RS–232–C 3

P310: Directory information control with remote buffer

P313: Directory information control with RS–422

For address B/S/C specification, see the description of opening a line.ISO (0) must be specified in address C.When a line is opened in a directory information control mode, adirectory information read operation and file deletion operation mustnot be specified more than once during the same line opening period.For example, when a file is to be deleted after directory informationis read for checking, the line must be closed after each operation asfollows:

Page 117: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

114

Open a line in a directory information control mode.Read directory information.Close the line.Open the line in a directory information control mode.Delete a file.Close the line.

(i) Directory information readG339 P1 Ff Ll Ss ;By specifying G339 P1, file directory information (name andsize) can be read into a specified variable.With address F, specify a desired file number (1 to 99999) toread the directory information of the file.With address L, specify the first variable number of a stringof 17 variables used to contain a read file name (17 characterslong). Each file name character is set in ASCII codeconverted to decimal.With address S, specify the number of a variable to containthe size of a read file. A file size is indicated in bytes.The directory information of the next file can be read byspecifying a file number (F specification), then omitting Fspecification in the G339 P1 command.If there is no directory for a specified file number, completioncode 23 is returned.

(ii) File deletion (G339 P2)G339 P2 (Ll/Ff)By specifying G339 P2, a file can be deleted.With address L, specify the first variable number of a stringof variables containing the name of a file (ASCII code) to bedeleted. Alternatively, with address F, specify the number ofa file to be deleted.Note that when a file has been deleted, the succeeding filenumbers are updated accordingly.

(iii)File name changeG339 P3 (LI/Ff) ;Control code G339 P3 allows the specified file name to bechanged.Address F specifies the number of the file whose name is tobe changed. Address L specifies the first variable number ofthe variable string containing the new file name (ASCIIcode).

4) Completion code (#8539)When using the G330 to G339 codes, check the completion code.Note, however, that line close processing is always terminatednormally.

Page 118: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

115

#8539 Meaning

0 Normal termination

1 Invalid command was specified.

2 Command not usable with selected I/O device was specified.For example, file search was specified when FANUC Cassetteis not used.

3 There is no line function option.

10 Line error (DR signal off) occurred.

11 Line error (CD signal off) occurred.

12 Line error (overrun error) occurred.

13 Line error (framing error) occurred.

14 Line error (buffer overflow) occurred.

15 Line is not opened.

20 Parameter is not specified correctly.

21 Data format is invalid.

22 Incorrect file number is specified.

23 There is no file that matches file number specified to readdirectory information.

30 Line is busy.

115 Undefined variable number was specified.

255 There is no receive data.

File control can be performed with the conversational macro and with theexecution macro.

(1) User file setting methodThe files which are used in file control use the user file area for settingby the IPL screen. Therefore, for performing file control it isnecessary to set the user file area in advance. The user file area can be set after a P–CODE file is stored in F–ROM.Before setting the area, execute COMPILE & ROM WRITE.Alternatively, store a dummy P–CODE file.The following shows the setting method for user files.

1. While pressing the MDI keys [ – ] and [ � ], turn on the power.The following diagram is displayed on the display screen.

IPL1. DUMP MEMORY

2. SET FILE3. CLEAR FILE4. FILE5. SETTING6. END IPL?

2. Press key ”2”, and after selecting ”SET FILE”, press the [ INPUT] key.After the above display, it continues with the following displayone line at a time. However, if you continue after a ”?” byinputting numerals and alphabetic characters according to thefollowing explanation and press the [ INPUT ] key, it moves tothe next line.

4.5.24File Control

Page 119: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

116

SYSTEM GENERATERCHECK SYSTEM LABEL :PASSCURRENT AREA : 0M – (1)USER FILE AREA?10 – (2)CURRENT FILE : 0 – (3)PROGRAM FILES ?10 – (4)FILES MUST BE CLEARED !! 7:PROGRAM DIRECTORY30:USER FILE DATACLEAR FILE OK ?Y – (5)

(1) The size of the user file which is currently being set is displayed.

(2) Set the size of the user file to be used. (The units are the tape memory length in meters.)

(3) The number of user files which are currently being set isdisplayed.

(4) Set the number of user files to be used.

(5) If the user files are set, the programs within the tape memorylength and the previous user files are deleted. Insert “Y” whensetting is performed.

3. Next, perform initialise of the user file areas.While pressing the MDI keys [ – ] and [ 0 ], turn on the power.The displaying of the following diagram is performed.

FILE UTILITY MENU1. FILE INITIALIZE2. FILE CONDENSE3. END?

Key in “1”, press [ INPUT ] , and select ”FILE INITIALISE”.You are asked ”ARE YOU SURE?”, therefore key in ”Y” andpress [ INPUT ] .

ARE YOU SURE ?YFILE INITIALIZE STARTFREE SIZE : 6M – (1)FREE FILES : 10 – (2)FILE INITIALIZE END

(1) From among the areas which have been set by the earlierdescribed 2(2), the areas which the user can freely use aredisplayed. Areas other than these (4M) are used by the systemfor management of user files.The following calculation gives the area which can be freelyused in byte units. Area in byte units=Memory length (M) * 1000/2.54 * 6/8In the above example the memory length is 6M and therefore 6 * 1000/2.54 * 6/8=1771 bytes

(2) Displays the number of files which can be freely used by theuser.(Becomes the value which was set by the earlier described 2 (4).)When initialise is finished, press key ”3”, select ”3 END”, pressthe [ INPUT ] key, and leave the initialise screen.(1)

(2) Commands which can be used by file control

Page 120: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

117

1. File creation command (FGEN)Function: Creates file.Description:

FGEN (file number, file size, status variable number)Explanation:

<File number> sets number to file to be created. File isaccessed using this number. For the value, refer to Table 1.<File size> specifies the size of the file. Specification unitsare in byte length.<Status variable umber> specifies macro variable number toreturn command execution results. It is necessary that theuser checks this value. For the status value, refer to Table 5.

NoteFile no.1 (key) cannot be specified.

Example:FGEN (200, 120, 100)Creates file with file no.200 and file size 120 byte. Returnsresults to macro variable #100.

2. File deletion command (FDEL)Function: Deletes file.Description:

FDEL (file number, status variable number)Explanation:

<File number> sets number of file to be deleted. For thevalue, refer to Table 1.<Status variable umber> specifies macro variable number toreturn command execution results. It is necessary that theuser checks this value. For the status value, refer to Table 5.

NoteFile no.1 (key) cannot be specified.

Example:FDEN (200, 100)Deletes file with file no.200. Returns results to macrovariable #100.

3. Command for opening files (FOPEN)Function:

Commands opening of files.Description:

FOPEN (File number, access mode, status variable number)Explanation:

<File number> specifies the file number to open. For thevalue, refer to the table 1.<Access mode> specifies the reading and writing modes. Forthe access mode value, refer to table 2.<Status variable umber> specifies the macro variablenumber to return execution result of the command. It isnecessary that the user checks this value. For the status value,refer to table 5. Further, this specified status variable numberis enabled for FCLOS, FREAD, FWRIT, and FPSET.

NoteThe maximum number of files which can be openedsimultaneously is 10.

Page 121: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

118

Example:FOPEN (200,1,100)Opens the file with file no. 200 in the writing and readingmodes. Further, the result is returned to macro variable #100.

4. Command for closing files (FCLOS)Function:

Commands closing of files.Description:

FCLOS (File number)Explanation:

<File number> specifies the file number to close. For thevalue, refer to table 1.Further, the execution result of the command is returned tothe status variable number specified by FOPEN. It isnecessary that the user check this value. For the status value,refer to table 5.

Example:FCLOS (200)Closes the file with file number 200. Further, the result isreturned to the status variable number specified at theopening.

5. Command for reading files (FREAD)Function:

Reads the contents of files.Description:

FREAD (File number, data type, data variable number)Explanation:

<File number> specifies the file number that is going to beread. For the value, refer to table 1.<Data type> specifies what type the data that is going to beread will be. For the data type, refer to table 3.<Data variable number> specifies the macro variable numberto substitute the data which was read. Further, the execution result of the command is returned tothe status variable number specified by FOPEN. It isnecessary that the user check this value. For the status value,refer to table 5.

Notes1 After the data has been read, the pointer is automatically

renewed.2 The data type of file no. 1 (key) must be specified in binary

format (word type).

Example:FREAD (200,2,500)Substitutes the data from the pointer currently indicating thefile with file no. 200 to the read #500 common variable inbinary format (word type).

6. Command for writing files (FWRIT)Function:

Writes data to files.Description:

FWRIT (File number, Data type, data)Explanation:

<File number> specifies the file number that is going to bewritten. For the value, refer to table 1.

Page 122: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

119

<Data type> specifies what type the data that is going to bewritten will be. For the data type, refer to table 3.<Data> specifies the data that is going to be written. Further,the execution result of the command is returned to the statusvariable number specified by FOPEN. It is necessary that theuser checks this value. For the status value, refer to table 5.

Notes1 After the data has been written, the pointer is automatically

renewed.2 File no. 1 (key) cannot be specified.

Example:FWRIT (200,2,123) ;Writes the data 123 from the pointer which is currentlyindicating the file with file no. 200 in binary format 2 (wordtype). Further, the result is returned to the status variablenumber specified at opening.

7. Command for setting file pointerFunction:

Sets the file pointer.Description :

FPSET (File number, pointer type, pointer)Explanation:

<File number> specifies the file to set the pointer. For thevalue, refer to table 1.<Pointer type> specifies the type the pointer sets. For thetype value, refer to table 4.<Pointer> specifies the pointer in accordance with the type.,Further, the execution result of the command is returned tothe status variable number specified by FOPEN. It isnecessary that the user checks this value. For the status value,refer to table 5.

Notes1 When the pointer type is 0, <Pointer> is disabled.2 Pointer can be specified before and after.3 File number 1 (key) cannot be specified.

Example:FPSET (200,2,12) ;Advances the pointer 12 from the pointer currently indicatingthe file with file no. 200. Further, the result is returned to thestatus variable number specified at opening.

Table 1: File number1 : Key

200 : File (general)Table 2: Access mode value

0 : Read mode1 : Write mode, read mode

Table 3: Data type value0 : Macro format (6 byte)2 : Binary format 1 (word type)3 : Binary format 2 (long type)

Table 4: Pointer type value0 : Sets pointer to head1 : Sets pointer from head2 : Sets pointer from current position

Page 123: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

120

Table 5: Status value0 : Ended normally1 : File does not exist2 : File has not had OPEN performed3 : Number of files which can OPEN (10) has been exceeded)4 : Number of files which can be created has been exceeded5 : File area exceeded6 : Pointer is not correct7 : File size is not correct8 : File OPEN did not finish correctly9 : File did not CLOSE

10 : Access mode is not correct 11 : File already exists 12 : I/O error has occurred 13 : File number is not correct 14 : Data type is not correct

Example:Using data created by conversational macro 09000, performsautomatic operation by execution macro 09100.

Conversational macroO9000 :#100=0 ;#101=0 ;#102=3 ;N10 IF[#100 NE 0] GOTO 20 ;FGEN (200, 120, 110) ;

Creates file number 200FOPEN (200, 1, 110) ;

Opens file No. 200IF[#110 NE 0] GOTO 90 ;#100=1 ;N20 M98 P9001 ;

Reads data from keysIF[#101 NE 0] GOTO 80 ;FWRIT (200, 0, #120) ;

Writes read data to fileIF[#110 NE 0] GOTO 90 ;#102=#102 – 1 ;IF[#102 NE 0] GOTO 20 ;N90 FCLOS (200) ;

Closes file No. 200N80 M99 P10 ;

O9001 ;IF[#101 NE 0] GOTO 10 ;#101=1 ;#8502=1 ; Read start of keysN10 IF[#8501 EQ 0] GOTO 20 ;#120=#8503 ; Read keys#101=0 ;N20 M99 ;

Execation macroO9100 ;FOPEN (200, 0, 110) ; Opens fileIF[#110 NE 0] GOTO 90 ;

Page 124: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

121

FREAD (200, 0, 120) ;Substitutes 1st data to reading #120

IF[#110 NE 0] GOTO 90 ;FREAD (200, 0, 121) ;

Substitutes 2nd data to reading #121IF[#110 NE 0] GOTO 90 ;FREAD (200, 0, 122) ;

Substitutes 3rd data to reading #122IF[#110 NE 0] GOTO 90 ;G01 X #120 Y #121 Z #122 F100 ;

Performs shift command by more than 3 datasN90 FCLOS (200) ; Closes fileM99 ;

The PMC address function returns the contents of a PMC address asa function value. Writing cannot be executed. Therefore, the addresscannot be described to the left side of the calcalation.The format of the PMC address function is as follows:<Address> <address–number>.or<Address> <address–number>.<bit–position>Example:#100=G100.1;The contents of bit 1 of PMC address G100 are substituted into #100.#100=G105;The contents of PMC address G105 are substituted into #100.#100=T10;Reads the contents of PMC address T10 and write it into #100.#101=C22.2;Reads the contents of bit 2 of PMC address C22 and write it into #101.The usable PMC addresses are G, F, X, Y, D, R, T, C, and K. Thenotation conforms to the PMC ladder description. For detailedinformation, refer to the PMC PROGRAMMING MANUAL.This function is usable only with the BMI interface.

NoteThe following table lists values which can be specified forPMC addresses. If a value out of range is specified, thecorresponding actual data cannot be read.

Address PMCNA PMCNB

GFXYRDTKC

0 to 511 (0.0 to 511.7)0 to 319 (0.0 to 319.7)0 to 127 (0.0 to 127.7)0 to 127 (0.0 to 127.7)0 to 999 (0.0 to 999.7)

0 to 1859 (0.0 to 1859.7)0 to 79 (0.0 to 79.7)0 to 18 (0.0 to 18.7)0 to 79 (0.0 to 79.7)

0 to 511 (0.0 to 511.7)0 to 511 (0.0 to 511.7)0 to 127 (0.0 to 127.7)0 to 127 (0.0 to 127.7)

0 to 1499 (0.0 to 1499.7)0 to 2999 (0.0 to 2999.7)

0 to 79 (0.0 to 79.7)0 to 19 (0.0 to 19.7)0 to 79 (0.0 to 79.7)

4.5.25Functions of PMCAddress

Page 125: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

122

(1) PMC address write controlG310 Dd Qq Ll ;G310 Rr Qq Ll ;G310 Cc Qq Ll ;G310 Kk Qq Ll ; (L1/2/4)The data specified in address Q having the byte length specified inaddress L is written to PMC address D, R, C, or K. Before beingwritten to the PMC address, the data is rounded off to the unit’s placeand converted to binary form. Negative values are converted to thetwo’s complement.When word data or longer data is written in PMC–NA format, thebytes are arranged in a sequence such that the high–order byte isassigned the lowest address, while the low–order byte is assigned thehighest address. If the system features PMC–NB, and if bit 4 ofparameter 8507 is set to 0, the data is arranged in the same sequenceas in PMC–NA format. If the system features PMC–NB, and if bit4 of parameter 8507 is set to 1, the bytes are arranged in a sequencesuch that the low–order byte is assigned the lowest address, while thehigh–order byte is assigned the highest address.Example:

#100=–500.0 ;G310 D300 Q#100 L4 ;Executing this program writes the following data to the PMC data

area D300 to D303:

Bit 7 6 5 4 3 2 1 0

D300D301D302D303

1110

1110

1110

1110

1111

1111

1110

1100

The decimal value –500.0 is converted to the two’s complement FFFFFE0CH.

Notes1 Bit–by–bit specification is not allowed.2 When the data exceeds the byte length specified in address

L, the data is only written up to the specified length. This isnot treated as an error. In the above example, if L1 isspecified, the least significant byte of the binary value of–500.0 (namely, 0CH) is written to D300 only.

(2) PMC address read controlG310 Dd Pp Ll ;G310 Rr Pp Ll ;G310 Cc Pp Ll ;G310 Kk Pp Ll ;Data can be read from PMC address D, R, C, or K by specifying avariable number in address P of control code G310. Address L canbe used to specify whether data is read in units of two or four bytes.The data is regarded as a binary code having the specified byte lengthand is converted to a variable.When word data or longer data is written in PMC–NA format, thebytes are arranged in a sequence such that the high–order byte isassigned the lowest address, while the low–order byte is assigned thehighest address. If the system features PMC–NB, and if bit 4 of

4.5.26PMC Address ControlCode (G310)

Page 126: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

123

parameter 8507 is set to 0, the data is arranged in the same sequenceas in PMC–NA format. If the system features PMC–NB, and if bit4 of parameter 8507 is set to 1, the bytes are arranged in a sequencesuch that the low–order byte is assigned the lowest address, while thehigh–order byte is assigned the highest address.Example:

When the PMC data area (D400 and D401) is as follows:

Bit 7 6 5 4 3 2 1 0

D400D401

10

10

10

10

11

11

10

00

Executing the following control code inputs –500,0 into #101:G310 D400 P101 L2;

Notes1 One–byte data can be read using the PMC address function. However, since data is converted

to a two’s complement with a sign, the wrong data may be read.2 Address Q specifies write control, while address P specifies read control. When both

addresses are specified, write control is executed.3 Addresses other than D, R, C, and K (namely, X, Y, G, and F etc...) cannot be used in the control

codes.4 Address L specifies one of three different byte lengths: 1, 2, and 4 bytes. When a value other

than 2 or 4 is specified or when this address is omitted, data is read or written as one–byte data.5 When L2 or L4 is specified, and a command for reading or writing odd–number values of

addresses D, R, C, and K is issued, the values are read and written at the following timings:L2: 1 byte – 1 byteL4: 1 byte – 2 bytes – 1 byte

In this case, 2–byte or 4–byte data read or write is not performed at the same timing.6 When 0, 4, 8, etc. is specified in address R with address L set to L4, data is read or written at

the timing of 2 bytes – 2 bytes. Four–byte data read or write is not performed at the same timing.When 2, 6, 10, etc. is specified in address R, 4–byte data read and write are performed at thesame timing.When 0, 4, 8, etc. is specified in address D, 4–byte read and write are performed at the sametiming.When 2, 6, 10, etc. is specified in address D, data is read or written at the timing of 2 bytes –2 bytes. Four–byte data read or write is not performed at the same timing.

7 The table below shows the specifiable range for each PMC address. Make sure that thespecified value is within the allowable range because a value outside the range can cause anerroneous data write operation.

Address PMCNA PMCNB

RDKC

0 to 9990 to 18590 to 190 to 79

0 to 14990 to 29990 to 190 to 79

This function is available only for BMI interface

The remaining shift amount of each CNC control axis can be read in theform of a variable by using the conversational or auxiliary macro.

#5181: Remaining shift amount of axis 1#5182: Remaining shift amount of axis 2

:#5195: Remaining shift amount of axis 15

4.5.27Variable for ReadingRemaining ShiftAmount

Page 127: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

124

NoteData cannot be written to this variable.

NC parameter can be read, however cannot be described to the leftside of the calculation because it is exclusive reading.The format is as follows. It cannot be commanded in 1 bit units.P<Parameter nummber> or P<Parameter number>. <Axis number>For parameter details, refer to FANUC Series 15 OPERATOR’SMANUAL.Example:

To read the value of NC parameter no.1000 to macro variable(#100).

#100=P1000;

4.5.28Referring to NCParameter

Page 128: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

125

The debug function creates a highly efficient conversational macroprogram. In the debug function there is a function to display macrovariables and a function to debug conversational macros.

Conversational macro variables (local variables, common variables) canbe displayed after normal macro variables by setting parameter No.8502#1.

(1) Displaying conversational macro debugger functionSet the parameter No. 8502#3 which enables the conversationalmacro debug mode to 1. The conversational macro is started up, andif it enters the conversational macro screen the following will bedisplayed.(When 14 inch CRT or Series 15TT)

3)1)

1

2

@O00001234 N00012345

SBK:1 TR:04) 5)

2)

(When 9 inch CRT)3)1)

1 @O00001234 N00012345 SBK:1 TR:0

2)

When conversational macro debug mode is enabled information fordebug (When 14 inch CRT, when Series 15TT)is displayed on 1st, 2nd, line(When 9 inch CRT)is displayed on 1st line.However, NC program number and sequence number are notdisplayed.

Explanation of screens1) Displays conversational macro status

“@” Conversational macro stop status“ ” Conversational macro execution status“*” Conversational macro break point setting status

2) Conversational macro execution program number3) Conversational macro execution sequence number4) Conversational macro single block status display5) Conversatinal macro break point setting status display

4.6CONVERSATIONALMACRO DEBUGFUNCTION

4.6.1Overview

4.6.2Displaying MacroVariables

4.6.3Conversational MacroDebugger Function

Page 129: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������4. CONVERSATIONAL MACRO FUNCTION B–62073E–2/03

126

(2) Debugger functions1) Conversational macro single block

Set the parameter to enable conversational macro single block no.8502#2 to 1. If the conversational macro is started up, it can executeby single block. ON/OFF can be set by setting the CRT/MDIcommand keys to parameter No. 8541.If conversational macro enters stop status, conversational macrostatus of 1 is displayed as @ (stop status), and the currently executingconversational macro program number and sequence number aredisplayed. If ON is set in conversational macro single block statusdisplay of 1 is displayed; if OFF, 0 is displayed.If stopped, break point is automatically released

2) Conversational macro restartAfter stopping at conversational macro single block or break point,the conversational macro can be started up again. The conversationalmacro can be restarted by setting the CRT/MDI command keys asconversational macro restart setting keys to parameter No. 8541. Ifrestart key is pressed and start accepted, the conversational macrostatus of 1 is displayed as ” ” (execution status). Restart keys areaccepted only when conversational macro is in STOP status.

3) Displaying conversational macro execution program number andsequence numberThe conversational macro execution program number and sequencenumber are displayed when conversational macro has entered STOPstatus. The execution program number and sequence number are notdisplayed during exeuction.

4) Setting conversational macro break pointThere are two methods for setting break point to conversationalmacro.After executing either, break point single block ON status occurs.

� Method by setting break point in advance by parameter� Method by inputting by CRT/MDI when conversational macro is in

STOP status(Method by setting break point in advance by parameter)

Can be stopped by setting conversational macro execution programnumber to parameter no.8547 or by setting conversational macroexecution sequence number break point to parameter number 8548.Either setting is acceptable, and is set as break point. When onlyprogram number, executes preset program number block; when onlysequence number, executes preset sequence number block regardlessof program number, and stops. If both are set, it is possible to stopafter executing sequence number of preset program.

(Method by inputting by CRT/MDI when conversational macro is inSTOP status)

Conversational macro break point setting key (abbreviated to $) canbe set by CRT/MDI when conversational macro is in STOP status bysetting CRT/MDI command key by parameter No. 8543.Break point program number (O) is input by 4 digits; the seuqencenumber (N) by 5 digits

i) Input O1234 by CRT/MDI.ii) Press p key.iii) Break point is displayed on debug mode display.

Example: when 14” CRT)

Page 130: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������B–62073E–2/03 4.CONVERSATIONAL MACRO FUNCTION

127

3)1)

*O00001234 N00000000 SBK:1 TR:1

4) 5)

2)

Conversational macro status of 1) is displayed as * and entersconversational macro break point setting status.Break point program number and sequence number aredisplayed to 2), 3).“1” is displayed to conversational macro break point settingstatus display to 5), and break point is shown as being set.

iv) After pressing restart key start up conversational macroagain.

3)1)

O00000100 N09999999 SBK:1 TR:1

4) 5)

2)

Conversational macro status of 1) is displayed as ” ” andenters conversational macro break point setting status.Break point program number and sequence number aredisplayed to 2), 3) when the conversational macro has finallyentered stop status.“1” is displayed to conversational macro break point settingstatus display to 5), and break point is shown as being set.“TR” with an underline continues to blink until either breakpoint is executed or released.

v) Stops after break point is executed

3)1)

@O00001234 N00000000 SBK:1 TR:0

4) 5)

2)

Conversational macro status of 1) is displayed as @ anddisplays the fact that conversational macro is in status.Program number, sequence number, for conversationalmacro with break point in 2), 3) are displayed.Displays the fact that single block is ON in conversationalmacro single block status display of 4).0 is displayed to conversational macro break point settingstatus display of 5), and indicates that break point has beenreleased.If the input in i) is set as O1234N56789 the program numberand sequence number will be set to break point.When there is mistaken input, if the setting is corrected theoriginal setting is released. Setting is released by onlypressing the $ key.$ key can be accepted only when conversational body macois in stop status.

Page 131: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

�����������5. PARAMETER B–62073E–2/03

128

5 PARAMETER

Bit No.#7 #6 #5 #4 #3 #2 #1 #0Address

8000 NLMP

Parameter inputData format : bit typeNLMP Macro executor parameter from F–ROM cassette

0 : performs loading1 : does not perform loading

NoteThis parameter is used by the machine tool builder at hisown company in order to debug created macro programs.If NLMP is set to 1, the executor parameter is not loadedfrom ROM cassette and therefore parameters can be setwhich differ from parameters written in ROM can be set.However, for parameter 8549 and 8550 it is invalid.

Page 132: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

APPENDIX

Page 133: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

131

A MACRO PROGRAM EXAMPLE

Circular Cutting Display Layout :The cursor is moved, using the cursor key or “�” “ �”, or soft keies“RADIUS”, “FEED” or “OFSNUM”. Key in data from MDI at the cursorposition and press “INPUT” to write data. Or after keying has been indata, press the soft key for direct input.If software key execution os pressed after all data input, checks whetheror not in memory mode, and because cycle start request is displayed,performs cycle start.

CIRCURAR CUTTING O0050 N00000 I (RADIUS) = F (FEED) = D (OFS NUM) =

**** MEM **** STOP **** **** 09:01:40*LSK[ RADIUS ][ FEED ][ OFS NO ][ EXEC ][ END ]

I

Circular Cutting Inputand Execution

Page 134: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

132

Programnumber Function

O0001 Main program memory list

O0010 Key input test

O0011 Software key display

O0020 Cursor test

O0030 Display test

O0031 BLINK test

O0032 Character row data

O0040 Address value test

O0050 True circle cutting main program

O0051 Cursor and data display

O0052 True circle cutting character row display

O0053 True cicle cutting graphic display

O9010 True circle cutting execution macro program

A.1DESCRIPTION OFPROGRAMS

Page 135: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

133

Programnumber Function

#100 to#103

Used as variable temporary store, etc. for work piece

#142 Key input value (#8501)

#143 Character row data offset

#144 Numerical data input value (#8503)

#145 Address data input value

#146 Cursor X coordinate (#8504)

#147 Cursor Y coordinate

A.2DESCRIPTION OFMACRO VARIABLES

Page 136: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

134

(1) Main Program00010 O0001 ;00020 G390 ;00030 G202 P3 ;00040 G230 L0 ;00050 G243 X0 Y0 A1 B0 (SAMPLE PROGRAM) ;00060 X2 Y3 (1 –– KEY TEST) ;00070 X2 Y5 (2 –– COUSOR TEST) ;00080 X2 Y7 (3 –– DISPLAY TEST) ;00100 X2 Y9 (4 –– ADDRESS VARIABLE) ;00100 X2 Y11 (5 – CIRCLE) ;00110 #8509 = 0033 ;00120 #143 = 300 ;00130 M98 P0011;00140 N001 #142 = #8501 ;00150 IF [ #142 EQ 0 ]GOTO 99 ;00160 IF [ #142 LT 12 ]GOTO 99 ;00170 IF [ #142 GT 16 ]GOTO 99 ;00180 #8500 =[ #142 – 11 ]* 10 ;00190 M99 ;00200 N099 M99 P1 ;

(2) Source Program for Key Input00010 O0010 ;00020 N10 G202 P3 ;00030 N20 G243 X0 Y2 A1 B0 (KEYTEST –– HIT ANY KEY ––);00040 N30 #143 = 100 ;00050 M98 P0011 ;00060 N100 #8502 = 2 ;00070 N110 #142 = #8501 ;00080 IF [ #142 EQ 0 ]GOTO 200 ;00090 #101 = #142 ;00100 #102 = #8503 ;00110 #103 = #8504 ;00120 G243 X0 Y4 A1 B0 (CONTROL ) F8.3 Z0 D#101 ;00130 G243 X0 Y5 A1 B0 (ADDRESS ) F8.3 Z0 D#103 ;00140 G243 X0 Y6 A1 B0 (DATA ) F8.3 Z0 D#102 ;00150 N200 IF [ #142 NE 16 ]GOTO 220 ;00160 N210 #8500 = 1 ;00170 M99 ;00180 N220 IF [ #142 EQ 0 ]GOTO 300 ;00190 M99 P100 ;00200 N300 M99 P110 ;

00010 O0011 ;00020 #100 = 0 ;00030 WHILE [ #100 LT 5 ] DO 1 ;00040 #1 = #143 + #100 ;00050 G243 X[ #100 * 7 + 2 ]Y25 A1 B0 P [ #1 ];00060 #100 = #100 + 1 ;00070 END 1 ;00080 M99 ;

(3) Source Program for Cursor Control00010 O0020 ;00020 G202 P3 ;00030 G230 L0 ;00040 #8502 = 0 ;00050 N008 G243 X0 Y1 (CORSOR TEST –– MOVE COUSOR ––) ;00060 G243 X0 Y3 (A) ;00070 G243 X0 Y4 (B) ;

A.3SOURCE PROGRAM

Page 137: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

135

00080 G243 X0 Y5 (C) ;00090 G243 X0 Y6 (D) ;00100 G243 X0 Y7 (E) ;00110 G243 X0 Y8 (F) ;00120 #143 = 100 ;00130 M98 P0011 ;00140 #100 = 0 ;00150 #146 = 2 ;00160 N001 #142 = #8501 ;00170 IF [ #142 EQ 0 ] GOTO 20 ;00180 IF [ #142 NE 1 ] GOTO 10 ;00190 #100 = #100 + 1 ;00200 N10 IF [ #142 NE 2 ]GOTO 20 ;00210 #100 = #100 – 1 ;00220 N20 #100 = #100 + 6 ;00230 #100 = #100 – [ FIX[ #100 / 6 ]]* 6 ;00240 #147 = #100 + 3 ;00250 G230 X#146 Y#147 L1 ;00260 IF [ #142 NE 16 ]GOTO 100 ;00270 #8500 = 1 ;00280 M99 ;00290 N100 M99 P1 ;

(4) Source Program for Character Strings00010 O0030 ;00020 #8509 = 33 ;00030 G202 P3 ;00040 #8502 = 0 ;00050 G230 L0 ;00060 #143 = 100 ;00070 M98 P0011 ;00080 N1 #100 = 1234.567 ;00090 X0 Y0 (DISPLAY TEST) ;00100 X0 Y1 (FANUC 15 SERIES MACRO COMPILER) ;00110 X0 Y5 ( * 3C 20 3441 2438 493D 3C28 00C3 00BD 00C4 20 3E * );00120 X3 Y7 ( * 352D 3966 2F40 2F48 2F79 2F53 * ) ;00130 M98 P0032 ;00140 X0 Y13 ( * 3C* DATA DISPLAY TEST 1234.567 * 3E* ) ;00150 X3 Y15 ( * 28* LEADING ZERO SUPPRESS* 29* ) ;00160 X6 Y16 Z1 F8.3 (F8.3 ) D#100 ;00170 X6 Y17 Z1 F5.2 (F5.2 ) D#100 ;00180 X3 Y18 ( * 28* NOT LEADING ZERO SUPPRESS* 29* ) ;00190 X6 Y19 Z0 F8.3 (F8.3 ) D#100 ;00200 X6 Y20 Z0 F5.2 (F5.2 ) D#100 ;00210 X39 Y5 ( * 3C* STRINGS DISPLAY TEST * 3E* ) ;00220 X41 Y7 P10 ;00230 X41 Y8 P20 ;00240 X41 Y9 P30 ;00250 X39 Y11 ( * 3C* 3 * 475C 4A38 2438 * * 3E* ) ;00260 X41 Y13 A3 B0 (3 MULTI) ;00270 #142 = #8501 ;00280 IF [ #142 NE 16 ]GOTO 100 ;00290 #8500 = 1 ;00300 M99 ;00310 N100 M99 P1 ;

00010 O0032 ;00020 G243 X0 Y9 A1 B0 ( * 3C* BLINK TEST * 3E* ) ;00030 N001 G243 X3 Y11 A1 B1 (BLINK) ;00040 G243 B0 ;00050 M99 ;

00010 O0033 ;00020 N10 (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;00030 N20 (0123456789) ;00040 N30 (FANUC TECHNICAL TRAINING CENTER) ;00050 N100 ( ) ;

Page 138: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

136

00060 N101 ( ) ;00070 N102 ( ) ;00080 N103 ( ) ;00090 N104 ( * 0020 3D2A 4E3B 0020 * ) ;00100 N200 ( * 0020 483E 3742 0020 * ) ;00110 N201 ( * 0020 422E 4559 0020 * ) ;00120 N202 ( * 0020 4A64 4035 0020 * ) ;00130 N203 ( * 0020 3C42 3954 0020 * ) ;00140 N204 ( * 0020 3D2A 4E3B 0020 * ) ;00150 N300 (TEST–1) ;00160 N301 (TEST–2) ;00170 N302 (TEST–3) ;00180 N303 (TEST–4) ;00190 N304 (TEST–5) ;00200 N500 (INPUT DEV NUM FOR FOREGROUND) ;00210 N504 (OUTPUT DEV NUM FOR FOREGROUND) ;00220 N508 (INPUT DEV NUM FOR BACKGROUND) ;00230 N512 (OUTPUT DEV NUM FOR BACKGROUND) ;00240 M99 ;

(5) Source Program for Address Variables00010 O0040 ;00020 #143 = 100 ;00030 M98 P0011 ;00040 N10 G243 X0 Y2 A1 B0 (ADDRESS VARIABLE TEST) ;00050 #100 = 20 ;00060 X0 Y4 (ADDRESS G READ TEST) ;00070 N20 #101 = G00.4 ;00080 IF [ #101 EQ 0 ]GOTO 30 ;00090 X0 Y6 Z1 F1.0 (ESP STATUS –– ) D#101 ( PUSH ESP ) ;00100 #142 = #8501 ;00110 IF [ #142 EQ 16 ]GOTO 100 ;00120 M99 P20 ;00130 N30 X0 Y6 Z1 F1.0 (ESP STATUS –– ) D#101 ( RESET ESP);00140 G243 X0 Y8 (PARAMETER READ) ;00150 #102 = 0 ;00160 #8509 = 0033 ;00170 WHILE [ #102 LE 3 ]DO 1 ;00180 #1 = #102 + 20 ;00190 #103 = P#1 ;00200 #2 = #102 + 10 ;00210 #100 = #100 + 1 ;00220 G243 X0 Y#2 (NUM ) Z1 F3.0 D#548 ;00230 ( –– ) D#103 ;00240 G243 ( ) P [ #102 * 4 + 500 ];00250 #102 = #102 + 1 ;00260 #3 = #3 + 1 ;00270 END 1 ;00280 #142 = #8501 ;00290 IF [ #142 NE 16 ]GOTO 200 ;00300 N100 #8500 = 1 ;00310 N200 M99 ;

(6) Source Program for Graphic Display and Circuit Cutting00010 O0050 ;00020 G202 P3 ;00030 #146 = 13 ;00040 #147 = 2 ;00050 G230 X#146 Y#147 L6 ;00060 #147 = 0 ;00070 M98 P0052 ;00080 M98 P0053 ;00090 M98 P0051 ;00100 N10 #8502 = 1 ;00110 N20 #142 = #8501 ;00120 #144 = #8503 ;00130 IF [ #142 EQ 0 ]GOTO 110 ;

Page 139: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

137

00140 IF [ #142 NE 12 ]GOTO 30 ;00150 #147 = 0 ;00160 GOTO 90 ;00170 N30 IF [ #142 NE 13 ]GOTO 40 ;00180 #147 = 1 ;00190 GOTO 90 ;00200 N40 IF [ #142 NE 14 ]GOTO 50 ;00210 #147 = 2 ;00220 GOTO 90 ;00230 N50 IF [ #142 NE 4 ]GOTO 60 ;00240 #147 = #147 – 1 ;00250 GOTO 90 ;00260 N60 IF [ #142 NE 3 ]GOTO 70 ;00270 #147 = #147 + 1 ;00280 GOTO 90 ;00290 N70 IF [ #142 NE 15 ]GOTO 80 ;00300 M98 P54 ;00310 GOTO 100 ;00320 N80 IF [ #142 NE 8 ]GOTO 100 ;00330 N90 #147 = #147 + 3 ;00340 #147 = #147 – FIX [ #147 / 3 ] * 3 ;00350 IF [ #144 EQ #0 ]GOTO 100 ;00360 # [ 500 + #147 ]= #144 ;00370 #1 = #147 + 2 ;00380 G243 X14 Y#1 Z1 F4.0 D# [ #147 + 500 ] ;00390 N100 M98 P0051 ;00400 N110 IF [ #142 NE 16 ]GOTO 200 ;00410 #8500 = 1 ;00420 M99 ;00430 N200 IF [ #142 EQ 0 ]GOTO 210 ;00440 M99 P10 ;00450 N210 M99 P20 ;

00010 O0051 ;00020 #1 = #147 + 2 ;00030 N100 G230 Y#1 L6 ;00040 #100 = 0 ;00050 WHILE [ #100 LT 3 ]DO 1 ;00060 G243 X14 Y[ #100 + 2 ]Z1 F4.0 D#[ 500 + #100 ];00070 #100 = #100 + 1 ;00080 END 1 ;00090 M99 ;

00010 O0052 ;00020 G243 X0 Y0 A1 B0 ( * 3F3F 315F 405A 3A6F * ) ;00030 X1 Y2 (I) ;00040 ( * 0028 0020 483E 0020 0020 3742 0020 0029 003D * ) ;00050 X1 Y3 (F) ;00060 ( * 0028 405A 3A6F 422E 4559 0029 003D * ) ;00070 X1 Y4 (D) ;00080 ( * 0028 4A64 4035 4856 3966 0029 003D * ) ;00090 #143 = 200 ;00100 M98 P0011 ;00110 M99 ;

00010 O0053 ;00020 G244 P0 ;00030 G240 P2 ;00040 G242 X80 Y20 ;00050 G301 X125 Y65 ;00060 G302 X170 Y20 I0 J–45 ;00070 G302 X170 Y20 I–90 J0 ;00080 G302 X125 Y–25 I–45 J0 ;00090 G301 X80 Y20 ;00100 G244 P2 ;00120 G242 X80 Y20 ;00130 G240 P7 ;00140 G301 Y–100 ;

Page 140: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

138

00150 G242 X–10 Y20 ;00160 G301 Y–100 ;00170 G244 P1 ;00180 G242 X80 Y–95 ;00190 G240 P6 ;00200 G301 X–10 ;00210 G240 P7 ;00220 G243 X41 Y18 A1 B0 (I) ;00230 M99 ;

00010 O0054 ;00020 #1 = F03.5 ;00030 IF [ #1 EQ 1 ]GOTO 10 ;00040 G240 P–3 ;00050 G243 X0 Y16 B1 ( WARNING ) ;00060 G243 X0 Y18 B0 ( PLEASE CHANGE MEMORY MODE ) ;00070 GOTO 20 ;00080 N10 G240 P7 ;00090 G243 X0 Y16 K30 ;00100 G243 X0 Y18 K30 ;00110 G240 P–5 ;00120 G243 X0 Y18 B1 ( PUSH CYCLE START ) ;00130 N20 G240 P7 ;00140 G243 B0 ;00150 M99 ;

00010 O9010 ;00020 G40 G49 G80 ;00030 #1 = #500 / 2 ;00040 G91 G42 G01 X#1 Y#1 F#501 ;00050 G02 G17 X#1 Y–#1 J–#1 ;00060 I–#500 ;00070 X–#1 Y–#1 I–#1 ;00080 G40 G01 X–#1 Y#1 ;00090 M99 ;

Page 141: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

139

O0001 (Main program) O0010 (Key input test)

No

No

No

Yes

No

Yes

Yes

Yes

Was any datakeyed in?

Screen clearing

Cursor OFF

Menu display

Key input variablereading

Soft key 1?

Soft key 2?

Soft key 3?

Key input test

Cursor display test

Character display test

M99

(START)

Soft key display

Screen clearing

Title display

Soft key display

Yes

NoWas any datakeyed in?

Key input variable, numerical datavariable and address data variabledisplay

M99

Counter = 0

Yes

NoCounter < 5?

M99

(START)

(START)

Soft key is displayed.

Counter + 1

O0011(Soft key display)

A.4FLOW CHART

Page 142: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

140

O0020 (Cursor test) O0030 (Display test)

Screen clearing

Cursor OFF

Title display

Soft key display

Counter = 0

Cursor X–coordinate = 2

Yes

Yes

No

No

Was any datakeyed in?

Key input by thecursor � ?

Counter +1

Yes

NoKey input by the

cursor � ?

Counter –1

1

1

Cursor position calculation

Cursor display

M99

(START)

Screen clear

Cursor display OFF

(START)

Soft key display

Title display

Character display

Blink display

Data display

Character string display

M99

Triple character display

No

YesHas end keybeen pressed?

#8500 = 1

Page 143: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

141

O0032 (Blink test) 00050 (Circuit cutting)

O0040 (Address variable test)

(START)

Title display

M99

Blink display

No

Screen clear

Title display

(START)

Soft key display

PMC data read (G00.4emergency stop signal)

Yes

G00.4=0 ?

”Press Emergency StopButton ”display

”Reset Emergency StopButton ”display

Parameter read test

M99

M99

No

No

(START)

Screen clear

Cursor display

X=13, Y=2

Cursor display ON

Character stringdisplay for data

Graphic display

Data display

Numerical data read

Yes

Was any datakeyed in?

Yes

Soft key 1?

Cursor pointer = 0

2

1

4

Page 144: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

142

No

No

No

No

2

Yes

Soft key 2?

Cursor pointer = 1

Yes

Soft key 3?

Cursor pointer = 2

Yes

Is cursor �pressed?

Cursor pointer = –1

Yes

Is cursor �pressed?

Cursor pointer = +1

3

No

3

Yes

Soft key 4?

Execution macro startup Message display

Data display

M99

1

4

Page 145: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

143

(1) O0001 explanation

0030 G202 P3

Screen deletionP1 : Character screenP2 : Graphic screenP3 : Character and graphic screens

004 0 G230 L0

Cursor controlL0 : Cursor OFFL1 : Cursor ON cursor length 1

0050 G243 X0 Y0 A1 B0 (SAMPLE PROGRAM)0060 X2 Y3 ( ����)

Displays character row on screenG243 : Character displayX0 : X axis display start positionY0 : Y axis display start positionA1 : Character size

(A1: Same size, A3: Triple)(����) : Characters enclosed in parantheses are displayed on

the screen.

NoteParentheses in the NC programming can be used ascomment in the control IN/OUT function, but in theconversational macro comment cannot be used because ofsignifi–cance of display data.

0110 #8509 = 00330120 #143 = 3000130 M98 P0011

Characters corresponding to sequence numbers using G234XYPsequence numbers can be displayed by character registered programcontrol variable.Sets program number including sequence number by #8509.#143 uses common variables as sequence number offset.Displays menu corresponding to software keys by software keys byO0011.

0140 N001 #142 = #8501

#8501 is a variable to set acceptance of such as cursor key/pagekey/shift key/edit key/input key by input key variable, but it shuntsdata to #142 because (0) is cleared if once read.

A.5PROGRAMEXPLANATION

Page 146: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

144

(2) O0011 Explanation

0030 WHILE [Condition expression] D01����

����

0070 END1

In WHILE macro, performs processing while condition expression isbeing calculated and while DO–END and when not calculatedexecutes by the next block after corresponding END character.

0040 #1 = #143+#1000050 G243 X[#100*7+2] Y25 A1 B0 P[#1]

#1 is a local variable and formed by the total of the common variables#143 and counter #100 to use sequence number offset.#100 is used as a counter and counts from 0–4.At this point, sets head number of character row which wroteprogram number O0033 to #143 and loops by #100 in order tocorrespond to software keys 1–5.

(3) O0020 Explanation

0220 N20 #100 = #100+60230 #100 = #100+[FIX[#100/6]]*6

Calculation to obtain cursor position.At 220nd line, 6 is to be added in advance in order that the cursorposition is not negative. The reason for the [6] is that there are 6cursor shift positons.The 230th line FIX is a function that rounds off digits after thedecimal point of the answer and obtains the remainder after dividingby 6.

(4) O0030 Explanation

0020 #8509 = 33

Uses character registered program variable #8509 and specifiesprogram number including sequence number to specify by G243P(sequence number).At this point, uses character row of program number 0033.

0120 X3 Y7 (*352D 3966 2F40 .....)

Enclosed by “(*“ and ”*)” when using internal codes such as kanji onthe display screen. The kanji used are double width characters.

A B

Kanji

0160 X6 Y16 Z1 F5.2 (F5.2) D#100

Page 147: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

145

F5.2 means total digits are 5, and there are 2 digits after decimal pointby digit number specification when displaying numerical data.Example: when 1234.567 is contained in #100

Displayed as 234.57

(5) O0032 Explanation

0030 N0011 G243 X3 Y11 A1 B1 (BLINK)

Enters blink display mode by G243B1. Subsequent to this commandcharacters to be displayed will all be blink display. When releasingblink display mode, command G243B0.

(6) O0040 Explanation

0070 N20 #100 = G00.4

Reads G00.4 (emergency stop) status to common variable #100.

0180 #1 = #102+200190 #103 = P#1

Reads contents of parameter to be specified by P#_ to commonvariable #103.At this point, reads out parameters 20, 21, 22, 23 to change #102 from0–3.

20 Interface number of foreground input device21 Interface number of foreground output device22 Interface number of background input device23 Interface number of background output device

(7) O0054 Explanation

0020 #1 = F03.5

Reads F03.5 (during memory mode) status to local variable #1.

0040 G240 P–3

Specifies color of line and character display. In this case a reversedisplay of yellow.

Page 148: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

146

(1) Main Program00010 O0001 ; Main00020 G390 ; Absolute mode specification00030 G202 P3 ; Screen clear00040 G230 L0 ; Cursor OFF00050 G243 X0 Y0 A1 B0 (SAMPLE PROGRAM) ;00060 X2 Y3 (1 –– KEY TEST) ;00070 X2 Y5 (2 –– COUSOR TEST) ;00080 X2 Y7 (3 –– DISPLAY TEST) ;00190 X2 Y9 (4 –– ADDRESS VARIABLE) ;00100 X2 Y11 (5 – CIRCLE) ;00110 #8509 = 0033 ; Character registered program number00120 #143 = 300 ; Software key display00130 M98 P0011; ������� ��� �� ���00140 N001 #142 = #8501 ; Key input variable reading00150 IF [ #142 EQ 0 ]GOTO 99 ; Loop if nothing is displayed00160 IF [ #142 LT 12 ]GOTO 99 ;00170 IF [ #142 GT 16 ]GOTO 99 ;00180 #8500 =[ #142 – 11 ] * 10 ;00190 M99 ;00200 N099 M99 P1 ;

00010 O0010 ; Key test00020 N10 G202 P3 ;00030 N20 G243 X0 Y2 A1 B0(KEYTEST ––HIT ANY KEY––); Title display00040 N30 #143 = 100 ;00050 M98 P0011 ;00060 N100 #8502 = 2 ; Input of address and numerical value00070 N110 #142 = #8501 ; Save of key input variable00080 IF [ #142EQ0 ]GOTO 200; Determines presence/absence of key input, loop if none00090 #101 = #142 ;00100 #102 = #8503 ;00110 #103 = #8504 ;00120 G243 X0 Y4 A1 B0 (CONTROL ) F8.3 Z0 D#101 ;00130 G243 X0 Y5 A1 B0 (ADDRESS ) F8.3 Z0 D#103 ;00140 G243 X0 Y6 A1 B0 (DATA ) F8.3 Z0 D#102 ;00150 N200 IF [ #142 NE 16 ]GOTO 220 ; Returns to menu if end key is pressed00160 N210 #8500 = 1 ; Next execution program is number No. O000100170 M99 ;00180 N220 M99 P100 ;00190 N300 M99 P110 ;

00010 O0011 ; Software key display00020 #100 = 0 ; Counter clear00030 WHILE [ #100 LT 5 ] DO 1 ;00040 #1 = #143 + #100 ; Obtains display character sequence number00050 G243 X[ #100 * 7 + 2 ]Y25 A1 B0 P [ #1 ];00060 #100 = #100 + 1 ; Counter + 100070 END 1 ;00080 M99 ;

00010 O0020 ; Cursor control00020 G202 P3 ; Screen clear00030 G230 L0 ; Cursor OFF00040 #8502 = 0 ; No key input00050 N008 G243 X0 Y1 (CORSOR TEST –– MOVE COUSOR ––) ; Title display00060 G243 X0 Y3 (A) ;00070 G243 X0 Y4 (B) ;00080 G243 X0 Y5 (C) ;00090 G243 X0 Y6 (D) ;00100 G243 X0 Y7 (E) ;00110 G243 X0 Y8 (F) ;

A.6PROGRAMDESCRIPTION

Menu display

Software key display, #143 is head of display character sequence number

Key input data reading

Key input data display

Displays cursor menu

Page 149: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

147

00120 #143 = 100 ;00130 M98 P0011 ;00140 #100 = 0 ; Cursor display position pointer00150 #146 = 2 ; X axis direction cursor position00160 N001 #142 = #8501 ; Key input control variable save00170 IF [ #142 EQ 0 ] GOTO 20 ; Key input presence determination00180 IF [ #142 NE 1 ] GOTO 10 ; If cursor “�”, pointer+100190 #100 = #100 + 1 ;00200 N10 IF [ #142 NE 2 ]GOTO 20 ; If cursor “�”, pointer–100210 #100 = #100 – 1 ;00220 N20 #100 = #100 + 6 ;00230 #100 = #100 – [ FIX[ #100 / 6 ]] * 6 ;00240 #147 = #100 + 3 ; Actual Y axis cursor position00250 G230 X#146 Y#147 L1 ; Cursor display on00260 IF [ #142 NE 16 ]GOTO 100 ; Returns to menu if end key is pressed00270 #8500 = 1 ;00280 M99 ;00290 N100 M99 P1 ;

00010 O0030 ; Character display test00020 G202 P3 ; Screen clear00030 #8502 = 0 ; No key input00040 G230 L0 ; Cursor OFF00050 #143 = 100 ;00060 M98 P0011 ;00070 N1 #100 = 1234.567 ;00080 X0 Y0 (DISPLAY TEST) ; Title display00090 X0 Y1 (FANUC 15 SERIES MACRO COMPILER) ;00100 X0 Y5 ( * 3C 20 3441 2438 493D 3C28 00C3 00BD 00C4 20 3E * ) ;00110 X3 Y7 ( * 352D 3966 2F40 2F48 2F79 2F53 * ) ;00120 M98 P0032 ; Blink test subprogram00130 X0 Y13 ( * 3C* DATA DISPLAY TEST 1234.567 * 3E* ) ;00140 X3 Y15 ( * 28* LEADING ZERO SUPPRESS* 29* ) ;00150 X6 Y16 Z1 F8.3 (F8.3 ) D#100 ;00160 X6 Y17 Z1 F5.2 (F5.2 ) D#100 ;00170 X3 Y18 ( * 28* NOT LEADING ZERO SUPPRESS* 29* ) ;00180 X6 Y19 Z0 F8.3 (F8.3 ) D#100 ;00190 X6 Y20 Z0 F5.2 (F5.2 ) D#100 ;00200 X39 Y5 ( * 3C* STRINGS DISPLAY TEST * 3E* ) ;00210 X41 Y7 P10 ; Displays sequence No. 10 character array00220 X41 Y8 P20 ; Displays sequence No. 20 character array00230 X41 Y9 P30 ; Displays sequence No. 30 character array00240 X39 Y11 ( * 3C* 3 * 475C 4A38 2438 * * 3E* ) ;00250 X41 Y13 A3 B0 (3 MULTI) ; Displays triple characters00260 #142 = #8501 ; Saves key input variable00270 IF [ #142 NE 16 ]GOTO 100 ; Returns to menu if software key ends00280 #8500 = 1 ;00290 M99 ;00300 N100 M99 P1 ;

00010 O0032 ; Blink display00020 G243 X0 Y9 A1 B0 ( * 3C* BLINK TEST * 3E* ) ;00030 N001 G243 X3 Y11 A1 B1 (BLINK) ; BLINK display on00040 G243 B0 ; BLINK display OFF00050 M99 ;

00010 O0033 ; Display character data00020 N10 (ABCDEFGHIJKLMNOPQRSTUVWXYZ) ;00030 N20 (0123456789) ;00040 N30 (FANUC TECHNICAL TRAINING CENTER) ;00050 N100 ( ) ;00060 N101 ( ) ;00070 N102 ( ) ;00080 N103 ( ) ;

Software key display

Pointer position calculator

Encloses characters to be displayed in ()

Software key display

Page 150: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

148

00090 N104 ( * 0020 3D2A 4E3B 0020 * ) ;00100 N200 ( * 0020 483E 3742 0020 * ) ;00110 N201 ( * 0020 422E 4559 0020 * ) ;00120 N202 ( * 0020 4A64 4035 0020 * ) ;00130 N203 ( * 0020 3C42 3954 0020 * ) ;00140 N204 ( * 0020 3D2A 4E3B 0020 * ) ;00150 N300 (TEST–1) ;00160 N301 (TEST–2) ;00170 N302 (TEST–3) ;00180 N303 (TEST–4) ;00190 N304 (TEST–5) ;00200 N500 (INPUT DEV NUM FOR FORGROUND) ;00210 N504 (OUTPUT DEV NUM FOR FORGROUND) ;00220 N508 (INPUT DEV NUM FOR BACKGROUND) ;00230 N512 (OUTPUT DEV NUM FOR BACKGROUND) ;00240 M99 ;

00010 O0040 ; Address variable test00020 #143 = 100 ;00030 M98 P0011 ;00040 N10 G243 X0 Y2 A1 B0 (ADDRESS VARIABLE TEST) ; Title display00050 #100 = 20 ; Initial value setting of reading parameter00060 X0 Y4 (ADDRESS G READ TEST) ;00070 N20 #101 = G00.4 ; Emergency stop signal reading00080 IF [ #101 EQ 0 ]GOTO 30 ;00090 X0 Y6 Z1 F1.0 (ESP STATUS –– ) D#101 ( PUSH ESP ) ;00100 #142 = #8501 ;00110 IF [ #142 EQ 16 ]GOTO 100 ;00120 M99 P20 ;00130 N30 X0 Y6 Z1 F1.0 (ESP STATUS –– ) D#101 ( RESET ESP) ;00140 G243 X0 Y8 (PARAMETER READ) ;00150 #102 = 0 ;00160 #8509 = 0033 ; Display character row is O003300170 WHILE [ #102 LE 3 ]DO 1 ;00180 #1 = #102 + 20 ; Parameter number calculation00190 #103 = P#1 ; Stores parameter contents in #10300200 #2 = #102 + 10 ;00210 G243 X0 Y#2 (NUM ) Z1 F3.0 D#548 ; Parameter number display00220 ( –– ) D#103 ; Parameter contents display00230 G243 ( ) P [ #102 * 4 + 500 ]; Parameter name display00240 #102 = #102 + 1 ;00250 END 1 ;00260 #142 = #8501 ; Saves key input variable00270 IF [ #142 NE 16 ]GOTO 200 ; Returns to menu if end key has been pressed00280 N100 #8500 = 1 ;00290 N200 M99 ;

00010 O0050 ; True circle cutting00020 G202 P3 ; Screen clear00030 #146 = 13 ; Cursor X coordinate setting00040 #147 = 2 ; Cursor Y coordinate setting00050 G230 X#146 Y#147 ; Displays cursor with 6 characters length00060 #147 = 0 ; Cursor Y coordinate setting00070 M98 P0052 ; Data character display subroutine00080 M98 P0053 ; Graphic display subroutine00090 M98 P0051 ; Data display subroutine00100 N10 #8502 = 1 ; Data input is numerical value00110 N20 #142 = #8501 ; Saves key input variable00120 #144 = #8503 ; Reads numerical data variable00130 IF [ #142 EQ 0 ]GOTO 110 ; Loop if there is not key input (must include M999)00140 IF [ #142 NE 12 ]GOTO 30 ;00150 #147 = 0 ;00160 GOTO 90 ;00170 N30 IF [ #142 NE 13 ]GOTO 40 ;00180 #147 = 1 ;00190 GOTO 90 ;

For internal code, encloses (*” and *)”Note: kanji codes use two characters for display

Software key display

Emergency stopsignal statusdisplay

Cursor pointer is 0 if software key 1 is pressed

Cursor pointer is 1 if software key 2 is pressed

Page 151: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

149

00200 N40 IF [ #142 NE 14 ]GOTO 50 ;00210 #147 = 2 ;00220 GOTO 90 ;00230 N50 IF [ #142 NE 2 ]GOTO 60 ;00240 #147 = #147 – 1 ;00250 GOTO 90 ;00260 N60 IF [ #142 NE 1 ]GOTO 70 ;00270 #147 = #147 + 1 ;00280 GOTO 90 ;00290 N70 IF [ #142 NE 15 ]GOTO 80 ; To N80 if software key is not ”Execution”00300 M98 P54 ; Mode check, message display00310 GOTO 100 ;00320 N80 IF [ #142 NE 8 ]GOTO 100 ; Was input pressed?00330 N90 #147 = #147 + 3 ;00340 #147 = #147 – FIX [ #147 / 3 ] * 3 ;00350 IF [ #144 EQ #0 ]GOTO 100 ; Was there numerical value key inputted?00360 # [ 500 + #147 ]= #144 ; Data reading to common variable #500–00370 #1 = #147 + 2 ;00380 G243 X14 Y#1 Z1 F4.0 D# [ #147 + 500 ] ;00390 N100 M98 P0051 ;00400 N110 IF [ #142 NE 16 ]GOTO 200 ; To menu if end key was pressed00410 #8500 = 1 ;00420 M99 ;00430 N200 IF [ #142 EQ 0 ]GOTO 210 ; Was there key input?00440 M99 P10 ;00450 N210 M99 P20 ;

00010 O0051 ; Cursor and data display00020 #1 = #147 + 2 ;00030 N100 G230 Y#1 L6 ;00040 #100 = 0 ;00050 WHILE [ #100 LT 3 ]DO 1 ;00060 G243 X14 Y[ #100 + 2 ]Z1 F4.0 D#[ 500 + #100 ];00070 #100 = #100 + 1 ;00080 END 1 ;00090 M99 ;

00010 O0052 ; Data character display00020 G243 X0 Y0 A1 B0 ( * 3F3F 315F 405A 3A6F * ) ; True circle cutting00030 X1 Y2 (I) ;00040 ( * 0028 0020 483E 0020 0020 3742 0020 0029 003D * ) ; Radius00050 X1 Y3 (F) ;00060 ( * 0028 405A 3A6F 422E 4559 0029 003D * ) ; Cutting rate00070 X1 Y4 (D) ;00080 ( * 0028 4A64 4035 4856 3966 0029 003D * ) ; Compensation number00090 #143 = 200 ;00100 M98 P0011 ;00110 M99 ;00010 O0053 ; Graphic drawing00020 G244 P0 ; Drawing line type specification (continuous line)00030 G240 P2 ; Color specification (green)00040 G242 X80 Y20 ; Drawing start point setting00050 G301 X125 Y65 ; Linear drawing00060 G302 X170 Y20 I0 J–45 ; Circular drawing00070 G302 X170 Y20 I–90 J0 ; Circular drawing00080 G302 X125 Y–25 I–45 J0 ; Circular drawing00090 G301 X80 Y20 ; Linear drawing00100 G244 P2 ; Drawing line type specification (1–dot chain line)00120 G242 X80 Y20 ; Drawing start point setting00130 G240 P7 ; Color specification (white)00140 G301 Y–100 ; Linear drawing00150 G242 X–10 Y20 ; Drawing start point setting00160 G301 Y–100 ; Linear drawing00170 G244 P1 ; Drawing type line specification (broken line)00180 G242 X80 Y–95 ; Drawing start point setting00190 G240 P6 ; Color specification (pale blue)00200 G301 X–10 ; Linear drawing00210 G240 P7 ; Color specification (white)

Cursor pointer is 2 if software key 3 is pressed

If cursor “�” pointer–1

If cursor “�” pointer+1

Cursor position calculation

Data length

Displays data while changingdisplay position

Page 152: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

150

00220 G243 X41 Y18 A1 B0 (I) ;00230 M99 ;

00010 O0054 ; Mode check, message display00020 #1 = F03.5 ; Puts F03.5 to #100030 IF [ #1 EQ 1 ]GOTO 10 ; Whether memory mode or not00040 G240 P–3 ; Color specification (yellow reversal)00050 G243 X0 Y16 B1 ( WARNING ) ;00060 G243 X0 Y18 B0 ( PLEASE CHANGE MEMORY MODE ) ;00070 GOTO 20 ;00080 N10 G240 P7 ;00090 G243 X0 Y16 K30 ;00100 G243 X0 Y18 K30 ;00110 G240 P–5 ; Color specification (green reversal)00120 G243 X0 Y18 B1 ( PUSH CYCLE START ) ; BLINK display00130 N20 G240 P7 ;00140 G243 B0 ; BLINK display release00150 M99 ;

00010 O9010 ; True circle cutting macro program00020 G40 G49 G80 ;00030 #1 = #500 / 2 ;00040 G91 G42 G01 X#1 Y#1 F#501 ;00050 G02 G17 X#1 Y–#1 J–#1 ;00060 I–#500 ;00070 X–#1 Y–#1 I–#1 ;00080 G40 G01 X–#1 Y#1 ;00090 M99 ;

Page 153: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 154: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 155: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 156: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 157: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 158: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 159: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 160: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer
Page 161: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������B–62073E–2/03 A.MACRO PROGRAM EXAMPLE

159

Item Function DescriptionConversa-

tionalmacro

Auxiliarymacro

Executionmacro

4.5.4 UI/UO separation Different signals can be used for macro DI/DOsystem variables in a user program andP–CODE program

� � �

4.5.5 P–CODE macro exclusivevariables

Variables #30000 and upwards can be used. � � �

4.5.6 Expanded P–CODE macroexclusive variables

Variables #40000 and upwards can be used. � � �

4.5.8 Conversational–macroexecution–control variables

The execution of conversational macros andauxiliary macros can be controlled.

� � �

4.5.9 Key–input control variable MDI keys and input data can be read. � � �

4.5.10 Character–string input–pro-gram control variable

The number of a program in which characterstrings are input can be specified.

� � �

4.5.11 Array processing forP–CODE exclusive variables

P–CODE exclusive variables can be handledas either array–type variables or as a variable–string set.

� � �

4.5.12 Array reference for P–CODEexclusive variables

P–CODE exclusive variables can be referencedas either two–dimensional or three–dimensionalarrays.

� � �

4.5.13 Referencing and writing CNCprograms

Programs stored on the CNC part–programstorage can be referenced or written.

� � �

4.5.14 Expanded–data input control Multiple input data items can be read. � � �

4.5.15 Reading or presettingmachining time andmachined distance

Using conversational–macro system variables,the machining time and machined distance canbe read or preset.

� � �

4.5.16 PMC–axis control Using conversational macros, PMC axes canbe controlled.

� � �

4.5.17 Torque–limit override control An override for the torque limit can be changed. � � �

4.5.18 A/D conversion data read Data converted in the A/D converter can beread.

� � �

4.5.19 Window function The following data can be referenced using thewindow function.� Alarm information� External alarm information� Number of machined parts, operation time, machining time� Diagnostic information

� � �

4.5.20 Reading and presetting rela-tive coordinates

Relative coordinates can be read and preset. � � �

4.5.21 Display control The conversational macro screen can be dis-played, and the cursor and graphic can be con-trolled.

� � �

4.5.22 Execution control G65 and M98 can be used in conversationaland auxiliary macro programs.

� � �

4.5.23 RS–232C control The RS–232C interface can be controlled. � � �

4.5.24 File control The user file area can be used. � � �

4.5.25 PMC address function PMC address can be read. � � �

A.8MACRO EXECUTORFUNCTIONS

Page 162: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

��������A. MACRO PROGRAM EXAMPLE B–62073E–2/03

160

Item Executionmacro

Auxiliarymacro

Conversa-tionalmacro

DescriptionFunction

4.5.26 PMC address control Data can be read and written for PMCaddresses.

� � �

4.5.27 Reading remaining travel–dis-tance

Remaining travel distance along the controlaxis can be read.

� � �

4.5.28 Reference of NC parameter NC parameter can be read. � � �

�: Available, ×: Not available

Page 163: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

IndexB–62073E–2/03

[A]A/D Converter Data Reading by Conversational Mac-

ro, 84

Address Function, 97

Argument Designation, 43

Argument Specification, 44

Arrangement Type Processing of Conversational Mac-ro Exclusive Variable, 69

Auxiliary Macro Function, 54

[C]Call Code and Program No., 39

Calling a Macro Using a T Code, 46

Calling a P–CODE Program from an Execution MacroUsing the G, M, S, T, or B User Code, 45

Calling a User Program Using an Execution Macro,45

Cautions, 49

Character Coordinate System, 56

Character String Registered Program Control Variable#8509, 68

Compile Parameter, 27

Compiling and Registering Custom Macro Programsin F–ROM Using the Series 15–B, 19

Conversational Macro Debug Function, 125

Conversational Macro Debugger Function, 125

Conversational Macro Function, 50, 52

Conversational Macro P–CODE Common Variables,61

Conversational Macro Special Variables (#30000–),63

Conversational Macro Variable Window Function, 86

Coordinate System Screen, 56

Custom Macro Commands, 44

[D]Description of Macro Variables, 133

Description of Programs, 132

Displaying and Setting Variables, 48

Displaying Macro Variables, 125

[E]Error Code List, 36

Execution Control Code, 105

Execution Control Variable, 65

Execution Macro, 39

Expanded Conversational Macro Exclusive Variable(#40000 –), 64

[F]F–ROM, 25

Features, 5

File Control, 115

Flow Chart, 139

Flow for Creating, Registering and Saving Programs,7

Functions of PMC Address, 121

[G]Graphic Coordinate System, 57

[I]Interface with User Program and Execution Macro in

P–CODE Program, 39

[K]Key Input Control Variable, 66

[L]Limitation for Execution Macro, 44

List of Kanji and Hiragana Codes, 151

[M]Macro and Subprogram Multiplexity in Execution

Macro, 47

Macro call, 44

Macro Compiler, 6

Macro Executor Functions, 159

Macro Program Example, 131

Modal Call from Execution Macro, 44

Page 164: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

Index B–62073E–2/03

[N]NC Commands Which Cannot be Used in Automatic

Operation, 44

[O]Overview, 50, 125

[P]P–CODE Program, 23

P–CODE Program Common Variable (#100–#199,#500–#999), 48

P–CODE Program Exclusive Local Variables, 61

P–CODE Program Local Variable (#1–#33), 48

Parameter, 128

PMC Address Control Code (G310), 122

PMC Axis Control by Conver–Sational Macro, 79

Program Description, 146

Program Explanation, 143

[R]Reading of Cutting Time and Cutting Distance by

Conver–Sational Macro, and Preset Functions, 79

Reading Relative Coordinates by Conversational Mac-ro, and Preset, 96

Refer to and Read CNC Program with ConversationMacro, 71

Reference and Writing System Common Variables, 65

Reference of Arrangement of Conversational MacroExclusive Variables, 70

Referring to NC Parameter, 124

Registering a P–CODE Program in F–ROM Using aMemory Card (When Compiled with a PersonalComputer), 8

Registering the P–CODE Program in F–ROM Using aROM Cassette (When the P–CODE Program hasbeen Compiled with the System P or a PersonalComputer), 14

RS–232–C Control by Conversational Macro, 106

[S]Screen Display Control Codes, 98

Source Program, 134

Specifying of the G Code for Macro Calls of P–CODEPrograms, 45

System Variable, 61

[T]Torque Limit Override Control, 82

[U]UI and UO Signal Separation for User and P–CODE

Programs, 62

Use of Macro Compiler, 8

User Program Common Variables (#100–#199,#500–#999), 48

[V]Variable for Reading Remaining Shift Amount, 123

Variable Name Setting (SETVN), 48

Variable, Function and Control Code, 58

Variables, 43

Page 165: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

Rev

isio

n R

ecor

d

FAN

UC

#S

erie

s#15

–MO

DE

LB

#�

��

��

��

���

��

��

��

���

����

���

�������

����

�"��! �

��

��

���

��

03S

ep.,’

95� C

orre

ctio

n of

err

or

02D

ec.,’

93

� A

ppen

dix

1.8,

“M

acro

Exe

cuto

r F

unct

ions

,” h

as b

een

adde

d.� T

ypog

raph

ical

err

ors

have

bee

n co

rrec

ted.

01S

ep.,

’93

Edi

tion

Dat

eC

onte

nts

Edi

tion

Dat

eC

onte

nts

Page 166: GE Fanuc Automation - pudn.comread.pudn.com/downloads197/ebook/929428/62073e2.pdf · GE Fanuc Automation Computer Numerical Control Products Series 15 / 150 – Model B Macro Compiler/Executer

· No part of this manual may bereproduced in any form.

· All specifications and designsare subject to change withoutnotice.


Recommended