FANUC Macro Compiler, Macro Executor Programming Manual

Page 1
GE Fanuc Automation
Computer Numerical Control Products
Series 16 / 18 / 20 / 21 Macro Compiler / Macro Executor
Programming Manual
GFZ-61803E-1/07 August 1997
Page 2
Warnings, Cautions, and Notes as Used in this Publication
Warning notices are used in this publication to emphasize that hazardous voltages, currents, temperatures, or other conditions that could cause personal injury exist in this equipment or may be associated with its use.
In situations where inattention could cause either personal injury or damage to equipment, a Warning notice is used.
Caution notices are used where equipment might be damaged if care is not taken.
GFL-001
Warning
Caution
Note
Notes merely call attention to information that is especially significant to understanding and operating the equipment.
This document is based on information available at the time of its publication. While efforts have been made to be accurate, the information contained herein does not purport to cover all details or variations in hardware or software, nor to provide for every possible contingency in connection with installation, operation, or maintenance. Features may be described herein which are not present in all hardware and software systems. GE Fanuc Automation assumes no obligation of notice to holders of this document with respect to changes subsequently made.
GE Fanuc Automation makes no representation or warranty, expressed, implied, or statutory with respect to, and assumes no responsibility for the accuracy, completeness, sufficiency, or usefulness of the information contained herein. No warranties of merchantability or fitness for purpose shall apply.
©Copyright 1997 GE Fanuc Automation North America, Inc.
All Rights Reserved.
Page 3
B–61803E–1/07

Table of Contents

PROGRAMMING
1. OUTLINE 3. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2. MACRO COMPILER AND MACRO EXECUTOR 7. . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1 MACRO COMPILER 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.1 Equipment Needed for Compile 8. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.2 Euipment Connection 9. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.3 Compiling Procedure (Main Flow) 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.4 Compiling Procedure Using System P Series (Details) 10. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.5 Table for Editing by P–G Mate 12. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6 P–CODE Loader Function 13. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6.1 Operation 14. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6.2 Notes 19. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6.3 Parameters 20. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.1.6.4 Alarms 22. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
2.2 MACRO EXECUTOR CONTROLS 23. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3. EXECUTION MACRO 24. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1 CALL CODE AND PROGRAM NO. 25. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.1 Calling Subprogram O9000 by T code 26. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.2 Calling subprograms O9001–9003 by M code 26. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.3 Calling a Subprogram Using Specified Codes 26. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.4 Calling Macros O9010–9019 by G Code 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.5 Modal Call Using G Code 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.6 Calling Macros O9020–9029 by M Code 27. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.7 Calling a Macro Using a T Code 28. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.8 M Code Subprogram Call with Range Specified 28. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.9 Calling Macros with a G Code by Specifying the Range 29. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.1.10 Function for Calling Macros with an Axis Address 29. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.2 ARGUMENT DESIGNATION 31. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
3.3 LIMITA TION FOR EXECUTION MACRO 32. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4. CONVERSATIONAL MACRO FUNCTION AND
AUXILIARY MACRO FUNCTION 34. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.1 CONVERSATIONAL MACRO 35. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.2 AUXILIARY MACRO FUNCTION 38. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.3 EXECUTION CONTROL CODE 39. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
4.4 CONVERSATIONAL MACRO EXECUTION CONTROL VARIABLE #8500, #8550, #8551 40. . . .
4.5 NOTES 41. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5. MACRO VARIABLES 42. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.1 MACRO VARIABLES 43. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.2 LOCAL VARIABLES (#1 TO #33 OR FOR REFERENCING THE P–CODE VARIABLES
OF ARRAY TYPE, #1 TO #99) 43. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.3 COMMON VARIABLES (#100 TO #149 AND #500 TO #531) 43. . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.4 P–CODE VARIABLES #10000– 44. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.5 VARIABLES OF EXPANDED P–CODE (#20000 – ....) 45. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
5.6 DISPLAYING VARIABLES 46. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
c–1
Page 4
Table of Contents
B–61803E–1/07
6. FUNCTIONS OF THE MACRO EXECUTOR 47. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1 SCREEN DISPLAY FUNCTION 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.1 Coordinates System of Screen 51. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.2 Screen Display Control Code 53. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.3 Graphic Painting Function 59. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.4 Graphic Cursor Function 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.5 Rectangular Display Funciton 61. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.6 Intensity Modulation Mode Display of 9” Monochrome CRT 63. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.7 Displaying Seven Soft Keys Data on the Twelve Soft Keys Type 64. . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.8 Function Screen Control Function 65. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.1.9 Function for Masking the Status Display on the Conventional Macro Screen 65. . . . . . . . . . . . . . . . . . .
6.1.10 Shift Function for Adjusting the Graphic Screen 65. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.2 ADDRESS FUNCTIONS 66. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.3 READING AND WRITING A PMC ADDRESS 67. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4 READER PUNCHER INTERF ACE CONTROL BY CONVERSATIONAL MACRO 69. . . . . . . . . .
6.4.1 Outline 69. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4.2 Function Details 70. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4.3 Inputting and Outputting Macro Variables 72. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4.4 Extending the Function for Inputting and Outputting a Macro Variable 75. . . . . . . . . . . . . . . . . . . . . . . .
6.4.5 FANUC Floppy Cassette Control 77. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.4.6 End Code (#8539) 80. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5 REFERENCING AND READING NC PROGRAM WITH CONVERSATIONAL MACRO 81. . . . . .
6.5.1 Outline 81. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.2 Recording of a New Program 82. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.3 Deleting a Program 82. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.4 Reading a Specified Block 82. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.5 Block Writing 84. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.6 Block Deletion 86. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.7 Condensation of Program 87. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.8 End Code (#8529) 87. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.9 Notes 87. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.5.10 Address Code Table 87. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.6 CONTINUOUS INPUT BY CURSOR AND PAGE KEY 89. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.7 MASKING OF O, N NUMBER APPEARANCE 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.8 READING AND PRESETTING CUTTING TIME AND
CUTTING DIST ANCE BY CONVERSATIONAL MACRO 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.8.1 Reading and Presetting Cutting Time (#8553) 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.8.2 Reading and Presetting Cutting Distance (#8554) 90. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9 READING AND PRESETTING RELATIVE COORDINATES BY
CONVERSATIONAL MACRO 91. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.1 Reading Relative Coordinates 91. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.9.2 Presetting Relative Coordinates 91. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.10 KEY–INPUT AND DATA–INPUT CONTROL 92. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.11 CURSOR CONTROL 94. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.12 PROCESSING ARRAY TYPE P–CODE VARIABLES 95. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.13 TORQUE LIMIT CONTROL 98. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.14 DAT A READING OF A/D CONVERTER (Series 16/18) 99. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.15 KEY–IN LINE CONTROL 100. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.16 READING THE BACKGROUND EDITING STA TUS 101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.17 READING THE NUMBER OF CATALOGED PROGRAMS 101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.18 READING THE SIZE OF THE FREE SPACE IN THE CNC PROGRAM MEMORY 101. . . . . . . . . . .
c–2
Page 5
B–61803E–1/07
6.19 READING THE REMAINING TRAVELING DISTANCE 101. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.20 OFFSET MEMORY C AND EXTENDED SYSTEM VARIABLE
6.21 PMC AXIS CONTROL 102. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.22 INTERLOCK FUNCTION FOR AXIS DIRECTION 106. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.23 FUNCTION FOR SEPARATING UI FROM UO OF THE P–CODE PROGRAM 107. . . . . . . . . . . . . .
6.24 REFERENCING COMMON VARIABLES OF CUSTOM MACROS 108. . . . . . . . . . . . . . . . . . . . . . . .
6.25 DISPLAYING THE CONVERSATIONAL MACRO SCREEN WHEN THE POWER
6.26 LEAVING THE SCREEN UNCHANGED WHEN THE
6.27 FUNCTION FOR FINDING A P–CODE WORK NUMBER 109. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.28 FUNCTION FOR CALLING A USER PROGRAM BY AN EXECUTION MACRO 110. . . . . . . . . . .
6.29 OPERATION FUNCTIONS (LOGARITHM, EXPONENT , ARCSINE, ARCCOSINE) 113. . . . . . . . .
6.30 FUNCTION FOR IDENTIFYING THE PRESSED MDI KEY USING
6.31 WINDOW FUNCTION 117. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.32 EXTERNAL CHARACTER REGISTRATION/DISPLAY FUNCTION (Series 20) 136. . . . . . . . . . . . .
6.33 EXECUTION MACRO CALL MASK FUNCTION 139. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
  
OF THE WORKPIECE COORDINATE SYSTEM (Series 16/18) 101. . . . . . . . . . . . . . . . . . . . . . . . . . .
6.21.1 PMC Axis Control by the G Code 102. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.21.2 PMC axis Control by Variables 104. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
IS TURNED ON 108. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
CUSTOM
KEY IS PRESSED 108. . . . . . . . . . . . .
6.28.1 Function 110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.28.2 Calling Format 110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.28.3 Multiple Calls 110. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.29.1 Overview 113. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.29.2 Operation 113. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A CONVERSATIONAL MACRO 114. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.30.1 Overview 114. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.30.2 Function 114. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.30.3 Key Number List 114. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.31.1 Overview 117. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.31.2 Referenced System Information 118. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.31.3 Detailed Description of Reference System Information 122. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.33.1 Function 139. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
6.33.2 Macro Variables 140. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7. Series 16/18 2–PATH DEDICATED CONTROL FUNCTION 141. . . . . . . . . . . . . . . . .
7.1 COMMON CONVERSATIONAL MACRO SCREEN 142. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
7.2 COMMON CONVERSATIONAL MACRO VARIABLE 143. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
8. FUNCTIONS FOR STOPPING A CONVERSATIONAL MACRO 144. . . . . . . . . . . . . .
APPENDIX
A. MACRO PROGRAM EXAMPLE 147. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1 EXAMPLE–1:CIRCULAR CUTTING INPUT AND EXECUTION 148. . . . . . . . . . . . . . . . . . . . . . . . .
A.1.1 Source Program for Main Program 148. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.2 Source Program for Input Control 150. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.3 Source Program for Cursor Control 151. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.4 Source Program for Character Display 152. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.5 Source Program for Address Variables 156. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
c–3
Page 6
Table of Contents
A.1.6 Source Program for Graphic Display and Circle Cutting 158. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.7 Execution Macro 161. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.8 Flow Chart 162. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.9 Explanation of Program 168. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.1.10 Program Example for PMC Sequence 171. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B–61803E–1/07
A.2 EXAMPLE-2 EXAMPLE FOR KEY INPUT AND CURSOR CONTROL 185. . . . . . . . . . . . . . . . . . . .
A.2.1 Source program List 185. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.2 Specification 190. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.2.1 Type of Screen 190. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.2.2 Variable Data 191. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.3 Program Structure 193. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.4 Flow Chart 194. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.2.5 Coding 195. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3 ST ANDARD MACRO PROGRAM 200. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.1 Standard Routine List 200. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.2 Area of Variable Used 200. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.3 Explanation of Variable Area 200. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.4 Standard Routine 204. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.5 List for Source Program 208. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.3.6 Explanation of Program 212. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
A.4 SCREEN LAYOUT 216. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B. MACRO COMPLIER OPERATION (Series 16–A/18–A) 217. . . . . . . . . . . . . . . . . . . . .
B.1 OPERATION ON P–G 218. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.1 Special Notes 218. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.2 Basic Operations 218. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.2.1 Connectiing to FA writer 218. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.3 Inputting Macro Program from Keyboard 218. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.4 Correcting Macro Program (Screen edit) 219. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.5 Correcting Macro Program (Command edit) 220. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.6 Outputting Files to Floppy Disk 220. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.7 Inputting Files to P-G from Floppy Disk 221. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
B.1.8 Handling Floppy Disk 221. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C. DATA ON MACRO COMPILER 223. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C.1 ARGUMENT TRANSFER 224. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C.2 SUMMARY OF SYSTEM VARIABLES
(REFER TO OPERATOR’S MANUAL FOR DETAILS) 226. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D. MACRO COMPILER/MACRO EXECUTOR WITH CAP I (Series 16/18) 229. . . . . . .
D.1 OUTLINE 230. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.2 EQUIPMENT NEEDED FOR COMPILING 231. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.3 COMPILING PROCEDURE USING SYSTEM P-G 233. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.4 ROM MODULE 241. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.5 ADDITION OF OPTIONS 241. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
D.6 LIMITA TION ON THE USER’S PROGRAM 241. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E. FANUC SUPER CAP T/CAP II T MACRO COMPILER/EXECUTOR
(Series 16/18) 242. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.1 GENERAL 243. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.2 EQUIPMENT REQUIRED FOR DEVELOPMENT 244. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
c–4
Page 7
B–61803E–1/07
E.3 TYPE OF USER PROGRAMS 246. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.4 DETAILS OF NEW USER PROGRAMS 247. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.5 USER PROGRAM SIZE 250. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6 SOFTWARE PACKAGE FOR USER PROGRAM DEVELOPMENT 251. . . . . . . . . . . . . . . . . . . . . . .
  
E.6.1 Software Package Associated with Tool Data and Cutting Condition Data 251. . . . . . . . . . . . . . . . . . . . .
E.6.1.1 Overview 251. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.1.2 Details of the Software Package Associated with Tool Data 251. . . . . . . . . . . . . . . . . . . . . . . . .
E.6.1.3 Details of the Software Package Associated with the Cutting Condition Data 257. . . . . . . . . . .
E.6.2 Software Package Associated with Process Data 295. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.2.1 Overview 295. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.2.2 Specifications 295. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3 Software Package Associated with the Interface Between User Programs and the System 343. . . . . . . . .
E.6.3.1 Overview 343. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.2 Interface Between the Conversational Programming Menu and User Programs 343. . . . . . . . . .
E.6.3.3 Display Character Specification 348. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.4 Executable Macro Program Numbers 353. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.5 System Variable for Conversational Programming Menu Indication 353. . . . . . . . . . . . . . . . . . .
E.6.3.6 System Variable for Window ON/OFF State Indication 353. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.7 System Variable for Conversational Mode/NC Mode Indication 353. . . . . . . . . . . . . . . . . . . . . .
E.6.3.8 System Variable for Execution Mode Indication 354. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.9 Conversational Macro Program Executed Immediately Before Execution 354. . . . . . . . . . . . . .
E.6.3.10 Parameters and System Variables 354. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.3.11 Program Numbers Usable with User Programs 354. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.4 Data Which Can Be Referred to by Macro Programs 355. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.4.1 Outline 355. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.4.2 Description 355. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.5 Displaying the Basic Menu Screen by a User Program (Not Supported by Ver.1.) 370. . . . . . . . . . . . . . .
E.6.5.1 Overview 370. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.5.2 Setting a parameter 370. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.5.3 Details 370. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.6 Display of a Window by a User Program, Depending on the Cursor Position
(Not Supported by Ver.1.) 371. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.6.1 Overview 371. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.6.2 Details 371. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.7 Using a User Program to Display Guidance on the Detailed Program Data Screen
(Not Supported by Ver.1.) 396. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.7.1 Overview 396. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.7.2 Details 396. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.8 Displaying a Window by Using a User Program and Pressing a Soft Key
on the Program Process Data Screen (Not Supported by Ver.1.) 398. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.8.1 Overview 398. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.8.2 Details 398. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.9 Displaying a Window by Using a Soft Key on the Tooling Data Screen (Not Supported by Ver.1.) 399. .
E.6.9.1 Overview 399. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.9.2 Setting a parameter 399. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.9.3 Details 400. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.10 Starting the Chuck/Tailstock Barrier Setting Screen (Not Supported by Ver.1.) 401. . . . . . . . . . . . . . . . . .
E.6.10.1 Overview 401. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.6.10.2 Details 401. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
c–5
Page 8
Table of Contents
B–61803E–1/07
E.7 SETTING PARAMETERS USED FOR COMPILER 403. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.7.1 Overview 403. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.7.2 Setting Parameters Used for Compiling 403. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.8 COMMAND USED IN THE DYNAMIC GRAPHIC FUNCTION 405. . . . . . . . . . . . . . . . . . . . . . . . . .
E.8.1 Outline 405. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.8.2 Description 405. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.8.3 Example 413. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.8.4 Transferring a Workpiece in Animated Simulation 414. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.9 COMMANDS FOR READING/WRITING VARIABLES STORED IN THE REMOTE HEAD 416. . .
E.9.1 Outline 416. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.9.2 Description 416. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.10 FUNCTION FOR CONVERTING PROGRAMS USED FOR THE AUXILIARY
AND TRANSFER PROCESSES TO NC STATEMENTS 417. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.10.1 Outline 417. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.10.2 Setting Parameters 417. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.10.3 Format Used for NC Statements Only for Calling Sub-programs 418. . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.10.4 Note 418. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.11 IMPROVEMENTS FEATURED BY VERSION 4 419. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.11.1 Modifications Made to the Link File 420. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.12 IMPROVEMENTS FEATURED BY FANUC SUPER CAP II T 421. . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.12.1 Software Package Related to Process Data 421. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.12.1.1 Specifications 421. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.12.2 Software Package Related to the Interface Between the System and User Programs 423. . . . . . . . . . . . . .
E.12.2.1 Interface Between the Conversational Program Screen and User Programs 423. . . . . . . . . . . . .
E.12.2.2 Specification of Display Characters 424. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
E.12.3 Modifications Made to the Link File 426. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
F. MACRO VARIABLES USED IN THE MACRO EXECUTOR FUNCTIONS 427. . . . .
G. DIFFERENCES BETWEEN SERIES 0 AND Series 16/18
(CONVERSION FROM FS0 TO FS16/18) 430. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.1 CHARACTER DISPLAY (G243) 431. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.2 DISPLAY COLOR SPECIFICATION (G240) 431. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.3 KEY INPUT VARIABLE (#8501) 431. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.4 CONTROLLING CONVERSATIONAL MACRO FUNCTION SCREENS (#8510) 432. . . . . . . . . . . .
G.5 PMC WRITE CONTROL CODE 432. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.6 PMC READ CONTROL CODE 432. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.7 CALLING A SUBPROGRAM WITH AN AXIS ADDRESS 433. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.8 CALLING A MACRO WITH A T CODE 434. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.9 A BIT CANNOT BE SPECIFIED TO READ A PARAMETER. 435. . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.10 THE ROM SIZE IS SPECIFIED DIFFERENTLY. 435. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
G.11 THE USE OF P–CODE DEDICATED VARIABLES HAS BEEN EXTENDED. 436. . . . . . . . . . . . . . .
G.12 THE METHOD FOR DISPLAYING P–CODE VARIABLES #10000 OR
LARGER HAS BEEN CHANGED. 437. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
H. G CODES THAT CAN BE USED BY THE CONVERSATIONAL
AND AUXILIARY MACROS 438. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
I. INTERNAL CODE 440. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
c–6
Page 9
B–61803E–1/07
  
J. PARAMETERS 445. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
J.1 COMPILE PARAMERTES 446. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
J.2 EXECUTOR PARAMETER 453. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K. ERROR CODES 455. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K.1 COMPLIER ERROR CODES (SYSTEM P) 456. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
K.2 EXECUTOR ERROR CODE 459. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
L. CHARACTER COORDINATE SYSTEM 460. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M. SCREEN DISPLAY ON A VGA GRAPHICS DISPLAY UNIT
(SUPPORTED BY SUPER CAP EXECUTOR ONLY) 463. . . . . . . . . . . . . . . . . . . . . . .
M.1 DISPLAY COLOR SPECIFICATION EXTENSION 464. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.1.1 Overview 464. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.2 SCREEN ERASURE EXTENSION 466. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.2.1 Overview 466. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.3 EXTENSION OF NUMBER OF DISPLAY LINES 467. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.3.1 Overview 467. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.3.2 Compile Parameters 468. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.4 GRAPHICS COORDINATE SYSTEM 469. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
M.4.1 Overview 469. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N. DISPLAY WITH A BACKGROUND COLOR ON THE CUSTOM SCREEN 470. . . . .
N.1 OVER VIEW 471. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.2 COMMAND FOR DISPLAY WITH A BACKGROUND COLOR 471. . . . . . . . . . . . . . . . . . . . . . . . . .
N.3 ITEMS OF THE COMMAND FOR DISPLAY WITH A BACKGROUND COLOR (P_) 472. . . . . . . .
N.4 DETAILS OF ITEMS OF THE COMMAND FOR DISPLAY WITH A
BACKGROUND COLOR (P_) 473. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.5 COMPILE PARAMETERS 479. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.6 RELATED ITEMS 480. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.6.1 Related Compile Parameters 480. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.6.2 Conversational/Auxiliary Macro Alarms 481. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.6.3 Graphics Display Screen Erasure 481. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
N.6.4 Color Palette Difference between Character Display and Graphics Display 481. . . . . . . . . . . . . . . . . . . .
c–7
Page 10

PROGRAMMING

Page 11
B–61803E–1/07
1

PROGRAMMING
NC programs include those which are prepared by custom macro and very seldom altered and those which may differ from one another according to relevant machining such as part programs. A batch handling of these programs of different characters may cause 1 quicker battery consumption, or spoil the custom macro in case of misoperation.
T o solve a problem, this function will convert the custom macro prepared by a machine tool builders into an execution format, register it to the ROM module, and enables it to be executed.
(1) Since the custom macro is converted into an execution format and
registered, the execution speed is high. This will shorten the machining time and improve the machining accuracy.
(2) The registration to the ROM eliminates battery consumption and
prevents custom macro damage through misoperation. This will improve the reliability.
(3 ) Since the registered program is not indicated on the program display,
the machine tool builder’s knowhow can be protected.
(4) Since the custom macro is registered in the ROM, the program edit
memory can effectively be used.
(5 ) The user can call the macro with an easy call procedure without being
conscious of the registered program. On the program edit memory, custom macros can be prepared and executed in the standard manner.
(6) The user can confirm the operation using RAM module before
making a ROM. (excluding Series 21–B)
(7) Conversational macro function can compile machine tool builders
original screen.
1. OUTLINE
3
Page 12
1. OUTLINE
Series 16–B
Series 16–C
Series 16–A
Series 18–A
Series 18
Series 18–B
PROGRAMMING
B–61803E–1/07
The models covered by this manual, and their abbreviations are :
Model name Abbreviation
FANUC Series 16–TA 16–TA FANUC Series 16–MA 16–MA FANUC Series 16–TTA 16–TTA FANUC Series 16–GCA 16–GCA FANUC Series 16–GSA 16–GSA FANUC Series 16–PA 16–PA FANUC Series 16–LA 16–LA FANUC Series 16–TB 16–TB FANUC Series 16–MB 16–MB FANUC Series 16–PB 16–PB FANUC Series 16–LB 16–LB FANUC Series 160–TB 160–TB FANUC Series 160–MB 160–MB FANUC Series 160–PB 160–PB FANUC Series 160–LB 160–LB FANUC Series 16–TC 16–TC FANUC Series 16–MC 16–MC FANUC Series 16–PC 16–PC FANUC Series 160–TC 160–TC FANUC Series 160–MC 160–MC FANUC Series 160–PC 160–PC FANUC Series 16i–TA 16i–TA FANUC Series 16i–MA 16i–MA FANUC Series 16i–PA 16i–PA FANUC Series 16i–LA 16i–LA FANUC Series 160i–TA 160i–TA FANUC Series 160i–MA 160i–MA FANUC Series 160i–PA 160i–PA FANUC Series 160i–LA 160i–LA
FANUC Series 18–TA 18–TA FANUC Series 18–MA 18–MA FANUC Series 18–TTA 18–TTA FANUC Series 18–GCA 18–GCA FANUC Series 18–GSA 18–GSA FANUC Series 18–PA 18–PA FANUC Series 18–TB 18–TB FANUC Series 18–MB 18–MB FANUC Series 18–PB 18–PB FANUC Series 180–TB 180–TB FANUC Series 180–MB 180–MB FANUC Series 180–PB 180–PB
Series 16–A
Series 16
i
4
Page 13
B–61803E–1/07
Series 18–C
Series 18
Series 18–A
Series 20–A
Series 20
Series 21–B
Series 21
Series 21–A
PROGRAMMING
Model name Abbreviation
FANUC Series 18–TC 18–TC FANUC Series 18–MC 18–MC FANUC Series 18–PC 18–PC FANUC Series 180–TC 180–TC FANUC Series 180–MC 180–MC FANUC Series 180–PC 180–PC FANUC Series 18i–TA 18i–TA FANUC Series 18i–MA 18i–MA FANUC Series 18i–PA 18i–PA FANUC Series 180i–TA 180i–TA FANUC Series 180i–MA 180i–MA FANUC Series 180i–PA 180i–PA
FANUC Series 20–FA 20–FA FANUC Series 20–TA 20–TA
FANUC Series 21–TB 21–TB FANUC Series 21–MB 21–MB FANUC Series 210–TB 210–TB FANUC Series 210–MB 210–MB FANUC Series 21i–TA 21i–TA FANUC Series 21i–MA 21i–MA FANUC Series 210i–TA 210i–TA FANUC Series 210i–MA 210i–MA
1. OUTLINE
i
i
The 21–TB model is available in two types: control unit type A and control unit type B. The two types may also be referred to as the 21–TB (control unit A) and the 21–TB (control unit B) when the descriptions of the types differ.
In this manual, the models may be classified as indicated below.
System Model name
16–TA, 16–TTA, 16–GCA, 16–TB, 160–TB, 16–TC,
Lathe system T series
Machining center
system
M series
160–TC, 16i–TA, 160i–T A, 18–T A, 18–TTA, 18–GCA, 18–TB, 180–TB, 18–TC, 180–TC, 18i–TA,180i–TA, 20–TA, 21–TB, 210–TB, 21i–TA, 210i–TA
16–MA, 16–GSA, 16–PA, 16–LA, 16–MB, 16–PB, 16–LB, 160–MB, 160–PB, 160–LB, 16–MC, 16–PC, 160–MC, 160–PC, 16i–MA, 16i–PA, 16i–LA, 160i–MA, 160i–PA, 160i–LA, 18–MA, 18–GSA, 18–PA, 18–MB, 18–PB, 180–TB, 180–MB, 180–PB, 18–MC, 18–PC, 180–MC, 180–PC, 18i–MA, 18i–P A, 180i–MA, 180i–PA, 20–FA, 21–MB, 210–MB, 21i–T A, 210i–TA
The words used in the explanation are defined as follows. ”P-CODE program” :
Execution type macro program prepared by a machine tool builder, being compiled and registered to ROM.
”Execution macro” :
Program to operate machine in P-CODE program.
”Auxiliary macro” :
Program to make an auxiliary operation for the execution macro and the conversational macro in P-CODE program.
5
Page 14
1. OUTLINE
PROGRAMMING
”Conversational macro” :
Program to operate screen in P-CODE program.
”User program” :
Program prepared by end-user for program edit memory.
B–61803E–1/07
6
Page 15
B–61803E–1/07
2
2. MACRO COMPILER AND MACRO
PROGRAMMING

MACRO COMPILER AND MACRO EXECUTOR

EXECUTOR
7
Page 16
2. MACRO COMPILER AND MACRO EXECETOR
2.1

MACRO COMPILER

PROGRAMMING
B–61803E–1/07
NOTE
For the macro compiler for other than Series 16/18–A, refer to the ”FAPT MACRO COMPILER (For Personal Computer) PROGRAMMING MANUAL (B–66102E).” (When reading the manual, skip Section 2.1.)
The NC program is converted into an execution form (P-CODE program), output to the ROM module, and registered into a ROM. Mount the prepared ROM module on the Series 16-A or Series 18 to execute the registered P-CODE program to be called from the user program by means of G, M and T codes or specified code set by parameter.
Custom macro O9000;
#1=#2+#5;
·
· M99;
Compile parameter
2.1.1
Equipment Needed for Compile
NC program compiler
P–CODE program executor
ROM transformation
MACRO Compiler Developing Equipment (When SYSTEM P series is used)
8
Page 17
B–61803E–1/07
PROGRAMMING
2. MACRO COMPILER AND MACRO EXECUTOR
ROM module
128KbyteA02B–0120–K510256KbyteA02B–0120–K511512KbyteA02B–0120–K5121Mbyte A02B–0120–K513
FA writer (D) A13B–0157–B001
Adaptor A13B–0157–H010
P–G Mate
P–G Mark II
Special floppy
disk
(prepared at
customer’s end)
Special floppy
disk
(prepared at
customer’s end)
P–G Mate
MACRO compiler
A08B–0036–J760 (Series 16–A) A08B–0036–J740 (Series 18–A)
executor
A08B–0036–J761 (Series 16–A) A08B–0036–J741 (Series 18–A)
P–G Mark II
MACRO compiler
A08B–0035–J760 (Series 16–A) A08B–0035–J740 (Series 18–A)
executor
A08B–0036–J761 (Series 16–A) A08B–0036–J741 (Series 18–A)
2.1.2
Equipment Connection
NOTE
Refer to Appendix D for macro executor with graphic conversation.
Connect FA writer to CN2 or CN3 for SYSTEM P series.
CN2,3
SYSTEM P series
FA WRITER
ROM MODULE ADAPTER
ROM MODULE
NOTE
Use CN1 normally for PPR.
9
Page 18
2. MACRO COMPILER AND MACRO EXECETOR
2.1.3
Compiling Procedure (Main Flow)
PROGRAMMING
(START)
Source program
preparation
B–61803E–1/07
2.1.4
Compiling Procedure Using System P Series (Details)
Compile
parameter setting
Test compile
ROM write
Check performance
* If a compiling error occurs, correct a source program and re-start compiling.
Loading in RAM module
(1) Equipment connection
Connect FA writer to CN2 or CN3 of SYSTEM P series. Generally, connect FANUC PPR to CN1.
(2) Turning on power of SYSTEM P series
Turn SYSTEM P series power ON.
(3) Loading system
1. Load the FAPT MACRO compiler system disk to either drive unit.
2. Keep pressing the ”LOAD” key on the left upper side of the keyboard for a few seconds.
3. When the menu is displayed, loading operation is completed.
(4) Source program input and correction
For detailed operation method, refer to APPENDIX B.
1. ”R2” (Display and edit)
2. No.=
”1” (Custom MACRO program display and edit) <NL>
(a) Input from keyboard
D <FO> = OFF, <F1> = OFF, <F2> = OFF” D PROGRAM = D INPUT =
”IN” <NL>
”Oxxxx” <NL>,” Date <NL> , , , , only ”<NL>” at the last
(b) Reading from floppy disk
D <F0> = OFF, <F1> = OFF, <F2> = OFF”
10
Page 19
B–61803E–1/07
2. MACRO COMPILER AND MACRO
PROGRAMMING
EXECUTOR
D PROGRAM = ”IN” <NL> D FD =
”OK_ @File Name <NL>
or ”OK
: File No. <NL>
_
” : Space
_
(c) Progran correction within memory
D <F0> = ON, <F1> = OFF, <F2> = OFF” D PROGRAM = ”Oxxxx” <NL> D Correct a program, using a screen editor.
(5) Setting Compile parameter
Not required when the compile parameter is already set.
1. For no initial screen, press <NL> a few times.
2. ”R1” (setting)
NO.= ”1” (Parameter) <NL>
3. No.=
”1” (parameter setting) <NL>
4. Set the parameter, using the screen editor with ”CHG”.
5. ”R0” (End) when the setting of all parameters is completed
6. Only <NL> (End of program)
(6) Test compile
1. For no initial screen, press <NL> a few times.
2. ”R0” (Start)
3. ”<F3> = ON ” : Displays a source program during compile. ”<F3> = OFF”: Displays o[NL]y program No. during compile.
4. No. =
”1” (Test compile) <NL>
5. If an error occurs during compiling, correct the error and compile a program.
(7) Setting FA writer Channel
1. ”R1” (setting)
2. No.=
”2 ” (ROM writer) <NL>
3. The current ROM writer channel setting conditions are displayed on the CRT screen.
4. CN1 =
: ”ON” <NL> : The channel is used. : ”OFF” <NL>: The channel is not used. : only <NL> : No setting is changed.
5. CN2 = : Same as above.
6. CN3 = : Same as above.
7. BUILT-IN ROM WRITER =
: Same as above (only P-G mate)
8. No. =
<NL> (End)
(8) Preparations for FA writer
1. Install the erased ROM module to the FA writer.
2. Turn the FA writer power ON.
3. Set the FA writer to the remote mode.
(9) ROM writing
11
Page 20
2. MACRO COMPILER AND MACRO
yp
Data in ut
Data out ut
Replacement
EXECETOR
PROGRAMMING
B–61803E–1/07
1. For no initial screen, press <NL> a few times.
2. ”R0” (start)
3. ”<F7> = OFF, F9 = ON” : (FA writer selection)
4. ”<F3> = ON ” : Displays a source program during compiling. ”<F3> = OFF” : Displays only program No. during compiling.
5. No. =
: ”2” : (ROM writing) <NL>
6. Data writing to ROM is started.
7. Writing is completed within a few minutes to 10 minutes or so.
D If compile parameter ”9000.0 = 0” is selected, no comparison
after ROM writing is made, thus making it possible to reduce the writing time.
(10) Performance Check
Install ROM module after writing to ”MACRO” socket on the main CPU PCB of Series 16/ Series 18 to check the operation. PWE = 1 of setting No.0 : When power is ON while pressing ”DELETE” key , the 10, 000 level P-CODE variables and program within RAM are cleared.
2.1.5
Table for Editing by P–G Mate
Job
Major
classification
Data input
Data display
Data output
p
Insertion
Minor classification
Paper tape, keyboard, floppy disk
Addition from keyboard KEYIN Display filenames for files on
floppy disk Any line LIST Lines containing the specified
string Punch spece SPACE SP n Punch n speces Punch feed FEED Output to paper tape, floppy
disk Alter a whole line ALTER Line number 1 line of data
Alter part of a line
Replace address character REPLACE Reverse order of 2 address
data characters Insert1 line of data INSERT Line number 1 line of data
Insert string INSERT
Copy and add a specified block MOVE MOV[line number1, line number2]
Keyboard input
Command
(enter NL at end of
command)
INPUT
FDLIST FDL
LIST L string
OUTPUT
ALTER
CHANGE
IN [ string] K OLD, line number, increment
L[
line number
FE n OUT[ string]
A string1 [ , string2 ], { }
R character1/character2 C character1/character2
string1 , [, string2 ] { }
Notes
Input terminated by the string specified
Data added several line at a time
]
n
ALL
n
ALL
Display from the specified line number
Punch n feeds
Replace ALL or n strings with string1
Replace character1 with charac­ter2
Change the order in one block
Insert string2 after string1
Copy and add the data from line number1 to line number 2
12
Page 21
B–61803E–1/07
g
PROGRAMMING
2. MACRO COMPILER AND MACRO EXECUTOR
Job
Command
Major
classification
Deletion
Scaling to re-
quire values
Adding and sorting sequence numbers SEQNO
Copy paper tape COPY COPY
Modification
support
Process control
Minor classification
Deletion n whole lines DELETE Line number1 [,line number2]
Delete string DELETE
Delete address data ADELETE AD address character Delete lines containing a partic-
ular string Multiple of a pecific address SCALE S address character / n n is the scaling factor Multiple of incremental NC data ASCALE AS address character / n n is the scalling factor
Renumber lines RENUMBER Change character used to dis-
play EOB Display list of commands HELP H
NC data TH, TV check THTV THTV
Advance pointer FIND
Move pointer back RACK Bn
Comment * * comment string Insert any commnet after * Start editing EDIT Change data type and code
system End editing END E
Change from integer NVC data to floating point NC data
Command
D character , { }
BDELETE BD atring
SEQ intial value [ , increment [ , n ]]
REN[ intial value [ , increment]]
EOB EOB Character
F { } [,n]
ED { } [, { } ]
MODE
POINT
M { } [, { } ]
PO X1 / n1 [ , Xi / ni ]
Keyboard input
Keyboard input
(enter NL at end of
(enter NL at end of
command)
command)
n
string
FAPT
FAPT
NC
NC
n
ALL
EIA ISO
EIA ISO
5 i=2
Notes
Notes
Delet the data from line number1 to line number2
The string can be an address character
If n is given, add a sequence number every n blocks
Copies any sort of data on paper tape.
Read in NC data from tape read­er, and check TH, TV’
Advance pointer by n lines Advance to a line containing a particular string
Move pointer back n lines. If n is omitted, move pointer back
to preceding line
Special
conversion
2.1.6
P–CODE Loader Function
Change from floating point NC data to integer NC data
ADD a specified amount ADD
INTEGER
The P-CODE loader function transfers files in Motorola format S, which is a ROM format, to the RAM module installed in the Series 16/18-A or the Series 16-TT A (tool posts 1 and 2). The files are created by the macro compiler for the FANUC SYSTEM P-MODEL G (referred to hereafter as the P-G) or a personal computer (referred to hereafter as the PC). The P-CODE loader function also operates the macro executor in the RAM.
The RS-232C interface is used to connect the Series 16/18–A to the P-G or PC.
INT X1 / n1 [ , Xi / ni ]
ADD X1 / n1 [ , Xi / ni ]
13
5 i=2
5 i=2
Page 22
2. MACRO COMPILER AND MACRO EXECETOR
PROGRAMMING
B–61803E–1/07
The communication parameters for transferring the file in the ROM format (referred to below as loading) depend on the parameters of the Series 16/18–A. The parameters must be set before loading.
2.1.6.1
Operation
If the
CAN
and
PROG
keys are pressed simultaneously on the MDI, and
the power to the Series 16/18–A is turned off, this function displays the data transfer screen (loading screen). For the Series 16/18-TTA, the function displays the data transfer selection screen. When tool post 1 or 2 is selected on the selection screen, the loading screen is displayed. Data can only be transferred while the loading screen is displayed.
Issue a data transfer command in the P-G or PC. For a description of the transfer commands and other details, refer to the specifications of the FAPT Macro Compiler.
The function eliminates the need to store data on a ROM chip when developing a macro program.
The P-CODE loader function is executed while a power-on sequence is suspended. The functions of the CNC are disabled while the data transfer selection screen or loading screen is displayed. The P-CODE loader function requires an executor option and reader/punch control option.
(1) The communication parameters for loading depend on the
parameters of the Series 16/18–A. Specify parameters such as the channels to be used and the baud rate before loading.
(2) Turn off the power to the Series 16 and install a RAM module instead
of the ROM module for custom macros. In Series 16/18-TT A, install the RAM module(s) in tool post 1 and/or tool post 2. Connect the Series 16/18 to the P-G or PC via the RS-232C interface.
(3) Turn on the power to the Series 16/18 while simultaneously pressing
the
CAN
and
PROG
keys on the MDI. Hold down the CAN and
PROG keys until the title, MACRO COMPILER/EXECUTOR P-CODE LOADER is displayed.
14
Page 23
B–61803E–1/07
2. MACRO COMPILER AND MACRO
PROGRAMMING
EXECUTOR
(4) On the Series 16/18-TTA, however, the following data transfer
selection screen is displayed instead of the above title. Pressing address key M on the screen selects tool post 1 and pressing address key S selects tool post 2. Pressing numeric key 0 starts the Series 16/18-TTA and enables the executor to execute the macros loaded in the RAM.
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 BAUDRATE =11 STOP BIT = 1 INPUT CODE = 1
LOADING PATH 1 : YES (PUSH M KEY) LOADING PATH 2 : YES (PUSH S KEY) LOADING END : YES (PUSH 0 KEY)
For the Series 16/18–TTA onty
(5) On CNCs other than the Series 16/18-TT A, performing the operation
in step (3) displays the following screen. On the Series 16/18-TT A, selecting a tool post displays the following screen and initializes the RAM. The following screen remains displayed while the RAM is being initialized. If the RAM has low capacity , the screen in step (6) may be displayed instead of the following screen. The selected tool post, HEAD 1 or HEAD 2, is displayed on the second line of the screen for the Series 16/18-TTA.
MACRO COMPILER/EXECUTOR P–CODE LOADER HEAD 1/HEAD 2 (I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 BAUDRATE =11 STOP BIT = 1 INPUT CODE = 1
OMM RAM MODULE INITIALIZE
Screen for the Series 16/18-TTA (The screens shown in subsequent steps are for the same CNC series.)
15
Page 24
2. MACRO COMPILER AND MACRO EXECETOR
PROGRAMMING
B–61803E–1/07
(6) When the RAM module has been initialized, the following loading
screen is displayed:
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 BAUDRATE =11 STOP BIT = 1 INPUT CODE = 1
LOADING READY ? : YES (PUSH 1 KEY)
(7) When the P-G or PC is ready for data transmission, press numeric
key 1. Then, the system waits for loading. When this screen is displayed, execute a data transfer command on the P-G or PC to start data transmission.
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 ________________ BAUDRATE =11 ________________ STOP BIT = 1 ________________ INPUT CODE = 1 ________________
ADR000000H:00
________________ ________________ ________________ ________________
16
Page 25
B–61803E–1/07
2. MACRO COMPILER AND MACRO
PROGRAMMING
EXECUTOR
(8) When the Series 16/18–A receives data, the following data reception
state is displayed. The transmitted data and its address are displayed. Mapping is merely a term indicating how much RAM the created P-CODE program and executor occupy. A single asterisk (
) refers to 16K bytes when a 2MB RAM module
*
is installed and 8K bytes when a RAM module of 1MB or less is installed.
D When a RAM module of 1MB or less is installed
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 ___________ BAUDRATE =11 ________________ STOP BIT = 1 ________________ INPUT CODE = 1 ________________
ADRxxxxxxH:xx
________________ ________________ ________________ ________________
D When a 2MB RAM module is installed
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 2MB) I/O UNIT = 0 ___________ BAUDRATE =11 ________________ STOP BIT = 1 ________________ INPUT CODE = 1 ________________
ADRxxxxxxH:xx
________________ ________________ ________________ ________________
17
Page 26
2. MACRO COMPILER AND MACRO EXECETOR
PROGRAMMING
B–61803E–1/07
(9) When loading terminates normally, the following message is
displayed. Pressing numeric key 1 starts the Series 16/18–A and enables the executor to execute the macros loaded in the RAM.
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0  BAUDRATE =11 __________ STOP BIT = 1 _______________ INPUT CODE = 1 _______________
LOADING END : TOTAL xxxxxxxxBYTES PUSH 1 KEY : CNC START WITH executor
ADRxxxxxxH:xx
_______________ _______________ _______________ _______________
When loading terminates normally for the Series 16/18-TTA, the following message is displayed. Pressing numeric key 1 returns to the screen in step (4). Select the next tool post on the screen.
MACRO COMPILER/EXECUTOR P–CODE LOADER HEAD 1 (I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0  BAUDRATE =11 __________ STOP BIT = 1 _______________ INPUT CODE = 1 _______________
ADRxxxxxxH:xx
_______________ _______________ _______________ _______________
LOADING END : TOTAL xxxxxxxxBYTES PUSH 1 KEY : RETURN TO HEAD SELECTION
18
Page 27
B–61803E–1/07
2. MACRO COMPILER AND MACRO
PROGRAMMING
EXECUTOR
(10) If an error occurs during loading, the following message is displayed.
To perform loading again, press the CAN key to retry from the beginning, that is, initializing the RAM in step (5). If an error such as a parameter setting error occurs in the Series 16/18–A, turn the power to the Series 16/18–A off then on again.
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 _____ BAUDRATE =11 _______________ STOP BIT = 1 _______________ INPUT CODE = 1 _______________
(ERROR OCCURED) _______________ ILLEGAL CHARACTER _______________
LOADING RESTART ? : YES (PUSH CAN KEY)
: NO (TURN OFF POWER)
ADRxxxxxxH:xx
_______________
_______________
(11) When an executor option or reader/punch control option is not
selected, the following message is displayed. In this case, loading cannot be performed. Turn off the power.
MACRO COMPILER/EXECUTOR P–CODE LOADER
(I/O PARAMETERS) (DATA TRANSFER)
I/O CHANNEL = 0 (MAPPING – 1MB) I/O UNIT = 0 BAUDRATE =11 STOP BIT = 1 INPUT CODE = 1
2.1.6.2
Notes
executor OPTION NOTHING I/O OPTION NOTHING I/O OPTION (CH2) NOTHING
PLEASE TURN OFF POWER
(1) Either channel 1 or 2 is used for I/O for the Series 16 during loading.
Data cannot be loaded using other channels.
(2 ) Either ASCII or ISO code is used to transmit data. EIA codes cannot
be used. The setting of parameter ASI (bit 3 of parameter 101, 111, or 121) determines whether ASCII or ISO code is used to transmit data.
(3 ) The settings of RS-232C parameters described in items (1) and (2) are
displayed in the fields of I/O parameters on the loading screen. However, the parameters cannot be set on the screen.
19
Page 28
2. MACRO COMPILER AND MACRO EXECETOR
PROGRAMMING
B–61803E–1/07
(4) Whether P-code data is transmitted together with the executor
depends on the operation of the macro compiler even when parameter PCODE for loading by overwriting (bit 1 of parameter 8701) is 1.
(5) When data is transferred for the first time after the RAM module is
installed, set parameter PCODE (bit 1 of parameter 8701) to 0, so that the P-code data is transferred together with the macro executor.
2.1.6.3
Parameters
No.
0020 Selection of an I/O device: I/O CHANNEL
Input setting enabled Data type : Bytes Valid range : 0 to 3 Selects an I/O device to be used.
0 : The device for channel 1 is selected.
(I/O device connected to JD5A of the main CPU board)
1 : The device for channel 1 is selected.
(I/O device connected to JD5A of the main CPU board)
2 : The device for channel 1 is selected.
(I/O device connected to JD5B of the main CPU board)
Either channel 1 or 2 can be used for I/O for the P-code loader.
No.
0101 ASI SB2
#7 #6 #5 #4 #3 #2 #1 #0
Data type: Bits SB2 : The number of stop bits is:
0 : 1 1 : 2
ASI : The following code is used for the data to be input.
0 : ISO code 1 : ASCII code
NOTE
The P-code loader cannot use EIA code.
No.
0102 Specification number of the I/O device (when I/O CHANNEL = 0)
Data type: Bytes
Specify the number of the I/O device when I/O CHANNEL = 0 as follows:
20
Page 29
B–61803E–1/07
PROGRAMMING
2. MACRO COMPILER AND MACRO EXECUTOR
T able 1
Setting
0 RS-232C 1 FANUC CASSETTE ADAPTOR 1 (FANUC CASSETTE B1/B2) 2 FANUC CASSETTE ADAPTOR 3 (FANUC CASSETTE F1) 3 FANUC PROGRAM FILE MATE
FANUC FA CARD ADAPTOR FANUC FLOOPY CASSETTE ADAPTOR
FANUC SYSTEM P MODEL H 4 Not used 5 Portable tape reader 6 FANUC PPR
FANUC SYSTEM P MODEL G
FANUC SYSTEM P MODEL H
I/O device
Specify 0 to use the P-code loader.
No.
0103 Baud rate (When I/O CHANNEL = 0
Data type: Bytes
Specify the baud rate for the I/O device when I/O CHANNEL = 0 according to Table 2:
T able 2
Setting
Baud rate Setting Baud rate Setting Baud rate
1 50 5 200 9 2400 2 100 6 300 10 4800 3 110 7 600 11 9600 4 150 8 1200 12 19200
Specify the same baud rate for the P-code loader as that for the PC or P-G.
No.
011 1 ASI SB2
#7 #6 #5 #4 #3 #2 #1 #0
Data type: Bits
This parameter must be set when I/O CHANNEL = 1. The meanings of the bits correspond to those of the bits in parameter 101.
No.
0112 Specification number of the I/O device (when I/O CHANNEL = 1)
Data type: Bytes
Specify the number of the I/O device when I/O CHANNEL = 1 according to Table 1.
No.
0113 Baud rate (when I/O CHANNEL = 1)
Data type: Bytes
Specify the baud rate for the I/O device when I/O CHANNEL = 1 according to Table 2.
21
Page 30
2. MACRO COMPILER AND MACRO EXECETOR
PROGRAMMING
B–61803E–1/07
No.
0121 ASI SB2
#7 #6 #5 #4 #3 #2 #1 #0
Data type: Bits
This parameter must be set when I/O CHANNEL = 2. The meanings of the bits correspond to those of the bits in parameter 101.
No.
0122 Number of the I/O device (when I/O CHANNEL = 2)
Data type: Bytes
Specify the number of the I/O device when I/O CHANNEL = 2 according to Table 1.
No.
0123 Baud rate (when I/O CHANNEL = 2)
Data type: Bytes
Specify the baud rate for the I/O device when I/O CHANNEL = 2 according to Table 2.
No.
8701 PLD
#7 #6 #5 #4 #3 #2 #1 #0
2.1.6.4
Alarms
Data type: Bits
PLD In the P-code loader for the macro compiler or executor, the RAM is:
0 : Cleared with OMM and rewritten. 1 : Not cleared with OMM, but overwritten.
Message Explanation
EXECUTOR OPTION NOTHING A macro executor option is not yet selected. I/O OPTION NOTHING Reader/punch control 1 option is not yet selected. I/O OPTION (CH2) NOTHING Reader/punch control 2 option is not yet selected. ILLEGAL CHANNEL A channel other than channel 1 or 2 is selected. ILLEGAL CHARACTER The transmitted data is not correct. OVERRUN Overrun error FRAMING ERROR Framing error DSR SIGNAL OFF Communication error PARITY ERROR Data without parity was transmitted. CHECK SUM ERROR Checksum error
22
Page 31
B–61803E–1/07
PROGRAMMING
2. MACRO COMPILER AND MACRO EXECUTOR
2.2

MACRO EXECUTOR CONTROLS

The macro executor controls the execution of the P-CODE program created by the macro compiler.
The P-CODE program (execution macro) stored in the ROM can be called and executed by specifying G, M, T or original code set by parameter during compilation in the user program.
Custom macros can be created and executed in the user program, independently of P-CODE program.
23
Page 32
3. EXECUTION MACRO

EXECUTION MACRO

3
PROGRAMMING
B–61803E–1/07
Only a registered P-CODE program cannot be executed. It is called from the user program by G, M, T code, or specified code by parameter setting, and executed. In case of macro call, argument designation is possible, and it is compared as a local variable at the P-CODE (execution macro) side.
Moreover, if a minus value is set to a parameter for macro call by G code, modal call of P-CODE program can be done by corresponding G code. Refer to 3.1.5 for details.
User program (Program edit memory)
O0001; G92X0.0Y0.0; G00 X100.0 Y20.0; : G101<Argument
designation> : : : M02;
P–CODE program (ROM registration)
G code call
M code call
T code call Special code call
Compile parameter 9013
101
O9010; #1=#2+#4; DO1; : END1; : : M99;
24
Page 33
B–61803E–1/07
PROGRAMMING
3. EXECUTION MACRO
3.1
CALL CODE AND PROGRAM NO.
Codes for call
T Subprogram call 9000 #149 Compile parameter TCAL(No.9002#0) M Subprogram call 9000-9003 None Compile parameters No.9010-9012
Specified code Subprogram call
G
M Macro call 9020-9029 None Compile parameters No.9023-9032 T Macro call 9008 #27 Compile parameter TMACC(No.9005#7) M (range specifi-
cation) G (range specifi-
cation)
Address for axis Macro call
T ype of call
Macro call, Modal call
Sbprogram call 9009 #148 Compile parameters No.9042,9043
Macro call Parameter None Compile parameters No.9045-9047
To call a P-CODE program from the user program, the codes shown in Table 3.1 are used.
Table 3.1 Codes for Calling P–CODE program
Program num-
bers called
9004 9005
9010-9019 None
9009 or 9031 to 9038
Common variables in
which a specified
code is stored
#146,#147
#27
Parameters to be set
Compile parameter ACL1,ACL2 (No.9002#1,#2)
Compile parameters No.9013-9022, No.9034
Compile parameter AX*CL(No.9005#0-#3, No.9008#0-#3) AXCLS (No.9005#4)
NOTE
These codes cannot be used in combination. For example, a macro call by a T code cannot be executed together with a subprogram call by an M code.
Correspondence between codes that call macro programs or subprograms and program numbers of called programs, and whether or not to call a subprogram or a macro , are determined by compile parameters. Since these parameters are registered to the ROM at compilation, be sure to designate them at compilation. Exclusive codes that call subprograms shall be set to CNC parameter (No,6090,6091) in executing.
(1) The return sequence number definition for returning to the user’s
program When operational control is returned to the user’s program from the P-CODE program, control passes to the sequence number of the user’s program defined by address P.
User’s program O0001; : G100X123Y456; G00X789; : N100G00Y999; : M02;
P–CODE program
O9010; #100=#24+#25; : M99P100;
25
Page 34
3. EXECUTION MACRO
PROGRAMMING
B–61803E–1/07
(2 ) Difference between Subprogram Call (T, M) and Macro Call (G, M)
Argument designation can be made in macro call. In subprogram call,
(a)
however, argument designation is not possible without T code, special code and call code.
(b) In subprogram call, after execution of another command than T-
or M-code, it will branch to a subprogram. In macro call, however, it will branch off without doing anything.
(c) In subprogram call, single block stop is made when another
command than T- or M-code is commanded. In macro call, however, no stop is made.
3.1.1
Calling Subprogram O9000 by T code
3.1.2
Calling subprograms O9001–9003 by M code
3.1.3
Calling a Subprogram Using Specified Codes
The P-CODE program 09000 registered to the ROM can be called by a T code.
The commanded T code is stored as an argument in the common variable #149.
All the local variables will become <Vacant>. N_ G_ X_ Y _ T < tttt >;
By commanding M codes which is designated by compilation parameter, the programs O9001, O9002, O9003” registered to the ROM can be called for subprograms. All the local variables are <Blank>.
N_ G_ X_ Y _ M<mm> ;
By setting character codes (decimal notation of ASCII codes) to the parameters (No. 6090, 6091) of CNC, the P-CODE program (09004,
09005) corresponding to the address can be called as a subprogram. The defined integer will be stored as a parameter to the macro variable (#146, #147). The actual use of this function is decided by specifying the appropiate compilation parameter (No. 9002#1, 9002#2, ACL1, ACL2).
Example) Compiler parameter (No. 9002#1, ACL=1)
When parameter No. 6090 = 66 at execution
User’s program O0001; O0001; : G00X123Y456B100; : M02;
P–CODE program
O9004;(#145=100.)
Definable addresses for 16-TB/16-TA/GCA, 18-TB/18-TA/GCA, 20-TA, 21-TB: A, B, D, F, H, I, J, K, M, Q, R, S, T
Definable addresses for 16-MB/16-MA/GSA, 18-MB/18-MA/GSA, 20-FA, 21-MB: A, B, F, H, I, K, M, Q, R, S, T
26
Page 35
B–61803E–1/07
PROGRAMMING
3. EXECUTION MACRO
3.1.4
Calling Macros O9010–9019 by G Code
3.1.5
Modal Call Using G Code
By commanding G codes which is designated by compilation parameter (No. 9013 to 9022), the macro programs ”O9010-O9019” registered to the ROM can be called.
Local variables without argument designation are <Vacant>. N_ G<gg>< Argument designation>;
A modal call can be used to call a macro when using G code. When calling a G code is specified with a compilation parameter,
continuous-state calling can be specified using a negative number. Continuous-state calling is canceled with G167 or the G code specified
by compilation parameter 9034. During continuous-state calling, the values of address of each block for
the user program are all arguments. Example) When compilation parameter 9013 = –100
User’s program O0001; : G100X123Y456; X789 Z678; : : G167;
(Modal call cancelled or code set to compile parameter
No.9034.) : M02;
P–CODE program
O9010 for each block the difined address is called as a parameter of “09010” and executed.
3.1.6 Calling Macros O9020–9029 by M Code
Multiple modal calls is not permitted.
By commanding M codes which is designated by compilation parameter (No. 9023 to 9032). the programs ”O9020 - O9029” registered to the ROM can be called.
Local variables without argument designation will become <Vacant> . N_ M<mm>< Argument designation>;
27
Page 36
3. EXECUTION MACRO
PROGRAMMING
B–61803E–1/07
3.1.7
Calling a Macro Using a T Code
By setting compile parameter TMACC(No.9005#7) to 1, program of No.9008 registered to ROM can be called macros by specifying a T code in a user program.
All addresses specified in this block are used as arguments except that the T code is transferred to #27, values for address P and L are transferred to #16 and #12, respectively. Also G codes are transferred to variables #28 to #32 for each group.
Be sure that addresses shall be those availabe for CNC and the significant digits are those specified by the CNC.
Variable Data to be transferred
#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
NOTE
G codes are assigned to variables #28 to #32 in ascending order, starting with the lowest G code group number. When a G code of G code group 01 exists, G80 may be generated and assigned to #28 to #32.
3.1.8
M Code Subprogram Call with Range Specified
Example) G91G28X123.45678T5678:
#24=123.456 #27=5678.0 #28=28.0 #29=91.0
Other variables = < vacant >
ROM-resident program 09009 can be called as a subprogram by using compilation parameters No. 9042 and No. 9043.
Specify the following codes in compilation parameters No. 9042 and No. 9043:
No. 9042 = M code indicating the lower limit No. 9043 = M code indicating the upper limit
Examples are given below:
No. 9042 = 100 No. 9043 = 110
If the above codes are specified in the parameters upon compilation, specifying an M code within the range from M100 to M110 calls ROM-resident program O9009 as a subprogram.
28
Page 37
B–61803E–1/07
PROGRAMMING
3. EXECUTION MACRO
3.1.9
Calling Macros with a G Code by Specifying the Range
The code specified by compilation parameters 9045 to 9047 can be used to call the programs registered in ROM.
Specifying call arguments is the same as calling macros with G code (3.1.4).
Specify the following for parameters 9045 to 9047:
Parameter 9045 : G code to start calling Parameter 9046 : Number of P-CODE programs Parameter 9047 : Number of the program to be called first
For example, suppose programs are compiled with 200 specified for parameter 9045, 100 specified for parameter 9046, and 1000 specified for parameter 9047. When G200 to G299 are specified, 100 programs from O1000 to O1099 compiled on the ROM can be called.
NOTE
1
Specifying call arguments is the same as calling macros with the G code specified by compilation parameters 9013 to 9022.
2 Continuous-state calling cannot be specified. 3 When the G code specified with compilation parameters 9013 to
9022 is specified, the specified parameters 9013 to 9022 are effective.
Parameter 9013 = 250 Parameter 9045 = 200 Parameter 9046 = 100
Parameter 9047 = 1000 When G250 is issued with the settings above, program O9010 is called.
3.1.10
Function for Calling Macros with an Axis Address
Axis address commands enable calling macros. When AX1CL to AC8CL of compilation parameter 9005#0 to #3,
9008#0 to #3 are set to 1, the programs registered to ROM can be called by the axis address command.
The program number to be called is selected by compile parameter AXCLS (No. 9005#4) as follows:
AXCLS 1 : The program number to be called depends on a specified
axis: Program O9031 is called when 1st axis is specified. Program O9032 is called when 2nd axis is specified. :: Program O9038 is called when 8th axis is specified.
0: Always program O9009 is called irrespective of specified
axes.
In this case, all the addresses in the block specified axis address are passed for use as arguments. However, the specified axis address is passed to variable 27. Addresses P and L are passed to variable 16 and 12, respectively, for use as arguments. Up to five G codes in each G code group are passed to variables 28 to 32 starting from the group with the lowest number. When a G code of G code group 01 exists, G80 may be generated and assigned to #28 to #32.
29
Page 38
3. EXECUTION MACRO
PROGRAMMING
B–61803E–1/07
When G code system A is used in the lathe system (T/TT), whether the axis addresses are called with an absolute or incremental command are informed to variable 33.
Variable No. Address
#1 to #26 Usual argument address
#27 Specified axis address (1st to 8th) #28 Specified G code #29 Specified G code #30 Specified G code #31 Specified G code #32 Specified G code #33 Vacant for absolute address
1.0 for incremental address
If the following are specified when a 4th-axis address is B, for example:
G91G28B1.234567X123.4567;
The settings are passed to variables as follows:
123.456 to variable #24
1.234 to variable #27
28.0 to variable #28
91.0 to variable #29 Other variables: Null
The addresses transferred as arguments specified in a block used to call a macro make changes modal information of the CNC when calling the macro. In the above example, the CNC model of absolute/incremental command changes to G91 (incremental command) when a macro is called.
In the lathe system, for G code system A, and when a 2nd-axis address is Z (absolute) or W (incremental), the settings are passed to variables as follows:
Variable #27 = 100.0, variable #33 = <null> for Z100.; Variable #27 = 100.0, variable #33 = 1.0 for W100.;
NOTE
The addresses those can be used and the range of the values specified to those addresses are the same as those allowed to each CNC model concerned.
30
Page 39
B–61803E–1/07
PROGRAMMING
3. EXECUTION MACRO
3.2

ARGUMENT DESIGNATION

Address of argument
specification I
A #1 N (NOTE) #14 B #2 P (NOTE) #16 C #3 Q #17
I #4 R #18 J #5 S #19 K #6 T #20 D #7 U #21 E #8 V #22 F #9 W #23
G (NOTE) #10 X #24
H #11 Y #25
L (NOTE) #12 Z #26
M #13
Argument designation is possible when calling a call. It can be referred to as a local variable at the P-CODE program side. Argument specification I and argument specification II are possible.
For arguments designation, negative symbol and decimal point can be used irrespective of the address.
T able 3.2(a) Argument specification I at P–CODE program call
Local variable
No.
Address of argument
specification I
Local variable
No.
Address of argument
specification II
A #1 K1 #6 B #2
C #3 I10 #31
I1 #4 J10 #32 J1 #5 K10 #33
NOTE
It is available when compilation parameter bit5 of No.9008 is 1.
Table 3.2(b) Argument specification II at P-CODE program call
Local variable
No.
Address of argument
specification II
·
·
Local variable
No.
·
·
31
Page 40
3. EXECUTION MACRO
PROGRAMMING
B–61803E–1/07
3.3

LIMITATION FOR EXECUTION MACRO

Source program of execution macro should be programmed in the same way as for custom macro. But, there are some limits for execution.
(1) Macro call
Macro call from an execution macro is executed with ”G65” as the custom macro . In the execution macro , since it is a macro program itself to be called from the user program with G (M, T) code or specified code, it is impossible to use a G
CODE call, etc. from
execution macro. G65 P (Program No.) L (Number of repetition) <Argument
specification> ;
(2) Argument specification
Argument specification is the same as the
custom macro.
(3) Variable
Expression, argument, etc. of variables are the same as those of the
Custom macro.
NOTE
Common variables referred by a P–CODE program and Common variables referred by user program are completely different. Refer to ”5.3 Common variable”.
(a) P–CODE variable (#10000 – )
Any number of 100 unit of P-CODE exclusive variables starting from #10000 can be used. Since it can be used from execution, it is considered as extension of common variable #500. However, execution macro cannot refer to P-CODE variable in arrangement type. For details, refer to ”5.4 P-CODE exclusive variable”.
(4) Operation command
Operation commands can be used as with the custom macro.
(5) Control command
Both divergence and repetition commands can be used . IF <Conditional expression> GOTO n; WHILE <Conditional expression> DO m; END m;(m=1,2,3)
(6) Modal call from execution macro
Modal call cannot be made.
(7) Macro and subprogram multiplexity in execution macro.
Separately from the user program multiplexity, 4-stack nesting of macro program, and 4-stack nesting of subprogram are possible on the execution macro.
(8) Cautions
(a)
Separate registration of a program cannot be made. Max. 400 programs can be registered to the ROM.
(b) In one program, limit the sequence number used for branch
destination (GOTO) to 200. In one program, the same sequence No. cannot be designated for others.
32
Page 41
B–61803E–1/07
PROGRAMMING
3. EXECUTION MACRO
(c) One block can accept designation of only one sequence number .
Except the program No. ”0” and the optional block skip ”/”, designate a sequence No. at the block head.
(d) In T series multiple repetitive canned cycle cannot be executed
in the P-CODE program. In case a program including a multiple repetitive canned cycle is registered and executed, the function cannot be guaranteed.
(e) In T series programming through direct drawing dimensions
programming cannot be made in the P-CODE program.
In case a program made through direct drawing dimension input is registered and executed the function cannot be guaranteed.
33
Page 42
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
4
PROGRAMMING
B–61803E–1/07
34
Page 43
B–61803E–1/07
PROGRAMMING
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
4.1

CONVERSATIONAL MACRO

Part program storage memory
Main program
The conversational macro function executes a program compiled by the macro compiler independently of the normal NC part program. This function basically is not affected by operation modes of NC . Accordingly, it works concurrently with the NC part program under execution independently even during the memory operation.
NOTE
The execution of the conversational macro function is processed at a lower level than that of the CNC operation internally. Therefore, the execution of the conversational macro function will not affect the processing speed of the CNC operation, but the processing speed of the conversational macro function may become slow while the CNC operation is ON.
ROM M code call T code call G code call Special code call
P–CODE
Execution macro program
Memory operation execution level executor
Memory operation execution level (higher level)
CRT/MDI
CUSTOM screen
Conversation macro and auxiliary macro execution level (lower level)
Compiling Parameter 9039
Initial setting on power on
Control variable #8500
Program number specification
Program number modification
Conversation macro execution level executor
P–CODE
Conversation macro program
Auxiliary macro execution level executor
Execution (always)
Compiling Parameter 9039
4.1 Conversational macro function conceptional diagram
Program number specification
35
P–CODE
Auxiliary macro program
Page 44
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
The conversational macro function is executed only when the conversational screen is selected with the function key
The conversational macro function executes its macro program whose program No. is the value of the conversational macro execution control variable #8500. The value of the conversational macro execution control variable #8500 is to be set with the parameter No. 9038 at compiling. The conversational macro function will not be executed when there is not a conversational macro program compiled whose program No. is the value of the conversational ma ro execution control variable #8500.
The conversational macro program, as well as NC part program, consists of macro sentences and NC sentences (specific G code commands).
The conversational macro program can describe all the macro statements used for the custom macro. And all the system variables and common variables which can be referred to in the P-CODE program can be read and written. But the conversational macro program has no local variables except for #1 to #99. They are used to refer an array type P-CODE variables #10000 ’s. Also, P-CODE variables are prepared for the conversational macro control.
PROGRAMMING
B–61803E–1/07
CUSTOM
.
It is impossible to execute the NC part program statement with the NC statement of the conversational macro program. They will be ignored though commnded. It is impossible to use any codes except the screen display codes and the execution control codes described in the following sections. And be sure that the NC statement of the conversational macro program have the addresses whose meanings and usage are different from those of the NC part program statement.
The CUSTOM screen started by the conversational macro program is under the same control as the other screens (POS screen, etc.). Therefore, finishing of the CUSTOM screen is necessary for changing over from one screen to another. Decide the timing to finish when executing M99 of the main program. Be careful about the condition of the conversational macro program, because if it is of a bad program example as shown below , it will be impossible to change the screen to another and HANG-UP ST A TE will be held. When another function key is pressed mistake, press
CUSTOM
again.
36
Page 45
B–61803E–1/07
4. CONVERSATIONAL MACRO FUNCTION
PROGRAMMING
Bad example Good example
AND AUXILIARY MACRO FUNCTION
O1234 ;
NO
Key input ?
YES
Key input process
M99 ;
O1234 ;
NO
Key input ?
YES
Key input process
M99 ;
Program the conversational program so that it will be a cyclic like the PMC ladder program. That is, execute M99 without fail and it will return to the head of the main program or to the sequence No. specified with M99Pp.
Thus, avoid the programming that the divergence destination by GOTO will reverse direction.
NOTE
To select a conversational macro screen, press function key
CUSTOM
.
T o change the screen from the conversational macro screen to another screen such as current position screen or program screen, press the correspondence function key
such as
POS
and
PROG
.
If the Series 20 is your NC, press both right most and left most soft keys at the same time and the screen changes from the conversational macro screen to the current position display screen.
37
Page 46
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
PROGRAMMING
B–61803E–1/07
4.2

AUXILIARY MACRO FUNCTION

The auxiliary macro is always executed regardless of the selection screen while the conversational macro function is executed only when the
CUSTOM
conversational macro screen is selected in the function
.
The auxiliary macro function executes the auxiliary macro program with the program number set by parameter 9030 on compiling.
If parameter 9039 is equal to 0 or the auxiliary macro with a set program number has not been compiled, no auxiliary macro function is executed.
Major differences between the conversation macro and auxiliary macro functions are as in the following:
1) Auxiliary macro function is always executed regardless of the screen being displayed.
2) No screen display control code can be used in the auxiliary macro function. G202, G240, G242, G243, G01, G02, G03
3) No variables for controlling and cursor can be used in the auxiliary macro function. #8501-#8509
4) The conversational macro function can control the program number executed by conversational macro execution control variable #8500. On the other hand, the auxiliary macro function always executes the program of the program number set by parameter 9039 on compiling.
NOTE
1 Switching to another screen is disabled while an auxiliary
macro is controlling the reader/punch interface.
2 A larger auxiliary macro (requiring a longer time to execute)
causes screen drawing to become slower.
The conversation macro function and auxiliary macro function are executed at the same execution level (lower level). The execution processing is as shown in the following when both the conversation macro function and auxiliary macro function are specified.
1) CUSTOM screen selected The auxiliary macro execution and conversation macro executed are repeated in this order.
2) Screen other than CUSTOM screen A compilation parameter makes it possible to display CUSTOM screen at power on.
38
Page 47
B–61803E–1/07
PROGRAMMING
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
4.3

EXECUTION CONTROL CODE

The following control codes are prepared for execution control. M98 : Subprogram call
M99 : Subprogram end (1) Subprogram call (M98)
M98 Pp ;
A macro subprogram specified by address P is called. Frequency of calling the macro subprogram shall be up to quadruple.
(2) Subprogram end (M99)
M99 Pp ;
When command is done in the c lled subprogram, the calling program will be restored. When the address P is specified, the block of the sequence No. specified at P of the calling program will be restored.
Command M99 without fail at the end of the main program. The command of M99 in the main program is explained below.
When M99 is commanded in the main program, execution of the conversational macro function is finished once.
Once execution of the conversational macro function is started, the screen will not change over to another though the function key is depressed until execution of the conversational macro function ends at M99. Accordingly, it is necessary to command M99 at the end of the main program.
When the function key is depressed during the execution of the conversational macro program, both character display and graphic display will be erased after the conversational macro program ends, and
CUSTOM
a corresponding screen will take place. When the function key
is
depressed again, the execution of the conversational macro program will be started according to the value of the conversational macro execution control variable #8500. At this time, the program will be executed from the beginning regardless of the command of the address P in block of M99.
When M99 is executed, the value of the conversational macro execution control variable #8500 will be checked. When the value of #8500 is rewritten, both character display and graphic display will be erased and the control will be transferred to a new conversational macro program. If not, neither the character display nor the graphic display will be erased, and execution of the same conversational macro program will be repeated. In this case, when the address P is commanded, execution will be started at the block of the sequence No. specified at P.
Once M99 is executed, the graphic display will not be output on th screen until the graphic screen is erased next. Consequently, when the same conversational macro program is still executed, the second and the following graphic displays will not be output on the screen When you want to redisplay the graphic display in 1 conversational macro program, command the graphic screen to be erased once.
39
Page 48
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
PROGRAMMING
B–61803E–1/07
4.4

CONVERSATIONAL MACRO EXECUTION CONTROL VARIABLE #8500, #8550, #8551

Three screens are available for execution of the conversational macro. These screens are selected by pressing the function key CUSTOM. The three screens correspond with those for the FANUC Series 0 as follows;
Screen for Series
16/18/20 CUSTOM screen 1 AUX #8500 CUSTOM screen 2 MENU #8550 CUSTOM screen 3 MACRO #8551
When the function key program number is specified by a value of the conversational macro
execution control variale is executed. Compile parameters (No.9038,No.9040,No.9041) set values of the
conversational macro execution control variable effected at power on. When the value of the conversational macro execution control variable is re-written, another conversational macro is controlled. When the value is re-written, characters and graphics are erased after completion of M99 of the currently executed conversational macro program(main) and the new conversational macro is controlled.
Screen for Series 0
CUSTOM
is pressed, a conversational macro whose
Conversational macro execution control variable
If the value of the conversational macro execution control variable is not re-written, the same conversational macros are repeatedly executed. In this case, no characters and graphics are erased.
40
Page 49
B–61803E–1/07
PROGRAMMING
4. CONVERSATIONAL MACRO FUNCTION AND AUXILIARY MACRO FUNCTION
4.5

NOTES

The conversational macro and auxiliary macro must be programmed so that M99 of the main program is executed.
The conversational macro, auxiliary macro and standard CNC display (POS screen, etc.) are executed on the same level. If a wait is programmed in any macro not having M99, the following occurs:
D If the wait is executed by the conversational macro, the auxiliary
macro is not executed.
D If the wait is executed by the auxiliary macro, the conversational
macro is not executed. The CNC display (POS screen, etc.) is not updated.
When common variables are used by an auxiliary macro (or conversational macro) and execution macro, the same variable must not be written to as a flag. An execution macro has higher priority than an auxiliary macro (or conversational macro). So, while an auxiliary macro (conversational macro) is writing to a variable, an execution macro may interrupt and write to that variable.
In such a case, once writing to the variable by the execution macro ends, the remaining write processing by the auxiliary macro (or conversational macro) is completed. So, the value written by the execution macro may be overwritten by the auxiliary macro (or conversational macro).
Example: Bit 0 of the #100 value is used as an execution macro flag, while bit 1 of #100 is used as an auxiliary macro flag
To set bit 0 to ON: #100 = 100 OR 1 To set bit 1 to ON: #100 = 100 OR 2
Execution macro
#100=#100 OR 1
Auxiliary macro
Execution macro
Auxiliary macro
#100=#100 OR 2
The value of #100, read at the start of auxiliary macro processing, is written to #100 after auxiliary macro processing ends. So, a value written by execution macro processing may be lost.
41
Page 50
5. MACRO VARIABLES

MACRO VARIABLES

5
PROGRAMMING
B–61803E–1/07
42
Page 51
B–61803E–1/07
5.1

MACRO VARIABLES

PROGRAMMING
5. MACRO VARIABLES
Variable No. User program
Local variable #1 to #33 (#99)
Common variable #100 and up
P-CODE variable Extended P-CODE variable
Control variable #8500 and up
#500 and up #10000 and up
#20000 and up
Conversational
macro
(NOTE 1)
: Usable : Partially usable : Unusable
NOTE
1
To be used when the P-CODE variables of array type are referenced.
2 The variables for controlling screen display and key input cannot
be used.
5.2 LOCAL VARIABLES
The local variables can be used for executable macros. These local variables are different from those used for the user programs.
Auxiliary macro
(Common variable)
(Common variable)
(NOTE 2)
Executable mac-
ro
(#1 TO #33 OR FOR REFERENCING THE P–CODE VARIABLES OF ARRAY TYPE, #1 TO #99)
5.3
COMMON VARIABLES (#100 TO #149 AND #500 TO #531)
The local variables can be used for auxiliary and conversational macros to reference the P-CODE variables of array type.
The common variables can be used for conversational macros, auxiliary macros, and executable macros.
The common variables are common to the conversational, auxiliary , and executable macros.
However, they are different from those used for the user programs.
43
Page 52
5. MACRO VARIABLES
PROGRAMMING
B–61803E–1/07
5.4
P–CODE VARIABLES #10000–
It is possible to use optional quantity of the P-CODE variables starting with #10000 on 100-pc. basis.
A 100 times as many as the numerical value preset on the compiling parameter No. 9037 will be the usable quantity of P-CODE variables. When the value on the parameter No. 9037 is 0, P-CODE exclusive variables are not usable. The upper limit of the P-CODE variables is as follows. 10000 + (Value of Compiling Parameter No. 9037) 100–1
The lower limit of the P-CODE variables is 10000. For example, the P-CODE variables can be used as follows: #10000 to #10099 when the value of parameter No. 9037 is 1 #10000 to #10199 when the value of Parameter No. 9037 is 2
NOTE
1 For P-CODE variables, about 1.63 meter of part program
memory is consumed per 100 pieces of variables when part program storage is 20 to 80m. The more P–CODE are used, the more part program memory decreases. The maximum no. of the usable P-CODE variables depends on the capacity of the part program memory. Part program storage memory 10 m:
Parameter on compiling No. 9037 = 6
Part program storage memory 20 m:
Parameter on compiling No. 9037 = 12
Part program storage memory 40 m:
Parameter on compiling No. 9037 = 25
Part program storage memory 80 m:
Parameter on compiling No. 9037 = 51
Part program storage memory 160 m - 1280 m:
Parameter on compiling No. 9037 = 60
In Series 16-B/18-B, part program storage memory is not
used. (Parameter no. 9037 needs to be set). When compilation parameter no. 9007#7 EXT=1, the no. of P-CODE variables is the above value–1.
For the 21-TB, approximately 1.63 meters of tape is
required to store each 100 P-CODE variables, even when the tape length is 160 meters.
For the 21-MB, whether part program memory is used
varies with the CNC system software series.
- DDA1 series : Part program memory is not used.
- D201 series : Part program memory is used.
2 The P–CODE variables still maintain their values after the
power is turned off.
3 Before executing the conversational macro with the
complied ROM module loaded, erase all the programs in the part program storage memory once.
(Turn on the power while pushing key with the setting
DELETE
(PWE = 1).) With this operation all the conversational macro functions will be initialized to be ”blank”. Array type variables for P–CODE in conversational macro #10000 – can be refered to in 2 to 3 dimentional array type. (See 6.12 (1) )
44
Page 53
B–61803E–1/07
PROGRAMMING
5. MACRO VARIABLES
5.5
VARIABLES OF EXPANDED P–CODE
(#20000 – ....)
The variables of the expanded P-CODE which start from #20000 can be used for the optional number, if the capacity of tape memory is 160m to 1280m. This variable can be selected for numbers with floating decimal points, the same as the usual common variable or for numbers with the integer type by parameter (parameter No. 9002#3 EVF) specification.
Parameter No. 9002#3
EVF= 0: floating decimal point type EVF= 1: the integer type
N times the number set paramater No.9044 is the number of the usuable variables for the P-CODE the same as the exclusive variables for the P-CODE (#10000 ---). The P-CODE variables cannnot be used, if parameter No. 9044 is 0.
The number of n is 12 with the floating decimal point type, and is 30 with the integer type.
EVF=0: in the case of the floating decimal point type
#20000 to #20011 if parameter No. 9044 equals 1 #20000 to #20023 if parameter No. 9044 equals 2
EVF=1: in the case of the integer type
#20000 to #20029 if parameter No.9044 equals 1 #20000 to #20059 if parameter No.9044 equals 2
In the case of the integer type, one of -32768 to 32767 can be set. Digits under the decimal point are rounded off when a value is substituted to the left side of the substitution statement.
Furthermore, this variables is evaluated after converted into the floatingdecimal point type, if this varables occurs in expression.
About a 0.21 meter of part program memory is used per set (number of parameter No. 9044) of the variables of the expanded P-CODE.
The part program memory being used is displayed on the program library screen. The maximum number of P-CODE variables depends on the capacity of the part program memory.
Part program memory 160m: Parameter No. 9044=819 Part program memory 320m: Parameter No. 9044=1638 Part program memory 640m (EVF=0): Parameter No. 9044=3276 Part program memory 640m (EVF=1): Parameter No. 9044=2184 Part program memory 1280m (EVF=0): Parameter No. 9044=5461 Part program memory 1280m (EVF=1): Parameter No. 9044=2184
NOTE
For Series 20, Series 21, expanded P-CODE (#2000 -) cannot be used.
45
Page 54
5. MACRO VARIABLES
PROGRAMMING
B–61803E–1/07
5.6

DISPLAYING VARIABLES

The variables used for P-CODE programs, such as local variables, common variables, P-CODE variables, and extended P-CODE variables,
can be displayed by pressing the function key
OFFSET
several times.
SETTING
The values of these variables can be specified using the MDI keys.
P–CODE VARIABLE
No. DATA No. DATA 0 123.45678 0 123.45678 1 123.45678 1 123.45678 2 123.45678 2 123.45678 3 123.45678 3 123.45678 4 123.45678 4 123.45678 5 123.45678 5 123.45678 6 123.45678 6 123.45678 7 123.45678 7 123.45678 8 123.45678 8 123.45678 9 123.45678 9 123.45678
NUM.
[ ] [ ] [ ] [ ] [NO–SEL]
The desired screen can be selected using page keys, cursor key, and [NO-SEL] key.
Pressing the screen. Pressing the
page key returns the current screen to the previous
page key displays the next screen.
A desired variable can be displayed with the numeric key and [NO-SEL] key .
The desired value can be entered for the variable at the cursor position using the numeric keys and the
INPUT
key. However, no values can be
entered in local variables or write-inhibited system variables.
NOTE
1
The setting of NDP, bit 1 in parameter 9000, for the executor depends on whether variables to be used for P-CODE programs are displayed. T o display the variables, set bit 1 of parameter 9000 to 1.
2 The specified values of the variables are displayed when the
screen is displayed. In other words, if the values of the variables are changed while the screen is displayed, the changed values are not displayed.
3 To change the screen from the P-CODE VARIABLE screen to
another screen such as current position screen or conversational macro screen, press the correspondence function key such as
and .
POS
If the 20-FA or 20-TA is your NC, press both right most and left most soft keys at the same time and the screen changes from the P-CODE screen to the current position display screen.
CUSTOM
46
Page 55
B–61803E–1/07
6
6. FUNCTIONS OF THE MACRO
PROGRAMMING

FUNCTIONS OF THE MACRO EXECUTOR

T able 6 (a) Functions (1/2)
EXECUTOR
No.
6.1 Screen display function 1 Screen display control 2 Function screen control 3 Masking conversational macro screen
status display
4 Shift for adjusting the graphic screen
6.2 Address function Reads data at PMC addresses.
6.3 Writing at PMC addresses Writes data at PMC addresses.
6.4 Reader/punch interface control Controls the RS-232C interface.
6.5 Reading and writing an NC program Reads NC programs from and writes them
6.6 Continuous input with the cursor and page keys
6.7 Masking the display of O and N numbers Clears the display of O and N numbers on
6.8 Reading and presetting the cutting time and cutting distance
6.9 Reading and presetting the relative coordi­nates
6.10 Key/data input control Reads the states of MDI keys and the val-
6.11 Cursor control Displays the cursor at any position on the
6.12 Processing of P-CODE variables of array type
6.13 Torque limit control Specifies the override values of the torque
6.14 Reading A/D converter data Reads A/D converter data.
6.15 Key-in line function Specifies a desired display position and
6.16 Reading the status indicating editing in the background
6.17 Reading the number of registered pro­grams
6.18 Reading the unused capacity of CNC pro­gram memory
6.19 Reading the remaining travel distance Reads the remaining travel distances for
Function Outline
Controls the display of the conversational macro screen.
onto the CNC tape. Continuously inputs data with the cursor
and page keys.
the CUSTOM screen. Reads and presets the cutting time and the
cutting distance. Reads and presets the relative coordi-
nates.
ues of entered data.
conversational macro display screen. References P-CODE variables of two- or
three-dimensional array type.
limits for each servo axis.
color of the key-in line for conversational macros.
Reads the status indicating whether editing is currently performed in the background.
Reads the number of the programs regis­tered in CNC program memory.
Reads the capacity of unused areas in CNC program memory.
each servo axis.
Conversa-
tional
(NOTE 1)
(NOTE 3)(NOTE 3)
Auxiliary
(NOTE 1)
Execut-
(NOTE 2)
able
47
: Usable : Partially usable : Unusable
Page 56
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
T able 6 (a) Functions (2/2)
B–61803E–1/07
No. Function Outline
6.20 Use of offset memory and extended system variables in the workpiece coordinate sys­tem
6.21 PMC axis control Controls the PMC control axes.
6.22 Interlock along each axis Applies interlocks along each axis and
6.23 Separation of P-CODE program UI/UO Separates the system variables for macro
6.24 Referencing the common variables for cus­tom macros
6.25 Displaying the conversational macro screen when power is turned on
6.26 Masking of screen switching with the CUS­TOM key
6.27 Searching for a P-CODE workpiece num­ber
6.28 Function for calling a user program with an executable macro
6.29 Arithmetic function Logarithmic function, Exponential function
6.30 MDI key image read function by conversa­tional macro
6.31 Window function Various CNC system information can be re-
6.32 Special character registeration and display function
6.33 Execution macro call mask function An execution macro call can be masked by
Reference data in offset memory and the values of extended system variables in the workpiece coordinate system using macro variables from 100000 to 199999.
reads the travel axis and the direction of movement along the axis when the skip sig­nal goes high.
DI/DO into the signals for user programs and those for P-CODE programs.
Reads the common variables for the user program from and writes them to the P­CODE program.
Displays the conversational macro screen in the emergency stop state of the CNC or in the external reset state.
Inhibits the conversational macro program from being executed again from the begin­ning when the CUSTOM key is pressed on the conversational macro screen.
Directly executes the P-CODE program registered in an executable macro variable.
Calls a user program from the P-CODE programs for executable macros.
Arc sine function and Arc cosine function can be used.
MDI key image that reflects MDI key status (pressed/or released) can be read from the conversational macro.
ferred to through window. Maximum 40 special characters can be
registered and displayed.
using an executor parameter or macro vari­able.
Conversa-
tional
(NOTE 3)(NOTE 3)(NOTE 3)
(NOTE 4)(NOTE 4)
(NOTE 5)(NOTE 5)
(NOTE 7)
Auxiliary
Execut-
able
(NOTE 6)
: Usable : Partially usable : Unusable
NOTE
Since the Series 21 do not support the graphic display feature, they
1
cannot use the drawing, painting, or other functions based on the graphic coordinate system.
2 This function can be used only for Series 16-B. 3 This function can not be used for Series 20 and for Series 21. 4 This function can not be used for Series 20-TA. 5 This function can not be used for Series 20. 6 To use the arithmetic function in the execution macro, custom
macro B option must be combined in the CNC.
7 This function can be used only for Series 20.
48
Page 57
6. FUNCTIONS OF THE MACRO
B–61803E–1/07
T able 6 (b) Functions of the Macro Executor and the Associated G Codes and Macro Variables (1/2)
PROGRAMMING
EXECUTOR
No. Function
6.1 Screen display function G01, G02, G03, G202,
6.2 Address function  
6.3 Writing at PMC addresses G310
6.4 Reader/punch interface con­trol
6.5 Reading and writing of an NC program
6.6 Continuous input with the cur­sor and page keys
6.7 Masking the display of O and N numbers
6.8 Reading and presetting the cutting time and cutting dis­tance
6.9 Reading and presetting the relative coordinates
6.10 Key/data input control  #8501, #8502, #8503, #8504,
6.11 Cursor control  #8505, #8506, #8507
6.12 Processing of P-CODE vari­ables of array type
6.13 Torque limit control  #8621, #8622, #8623, #8624
6.14 Reading of A/D converter data  #8631, #8632, #8633, #8634
6.15 Key-in line function  #8561, #8562, #8563, #8564,
6.16 Reading the status indicating editing in the background
6.17 Reading the number of regis­tered programs
6.18 Reading the unused capacity of CNC program memory
6.19 Reading the remaining travel distance
6.20 Use of offset memory and ex­tended system variables in the workpiece coordinate sys­tem
6.21 PMC axis control G340, G341, G344,
Associated G
code
G204, G206, G240, G242, G243, G244, G249
G330, G331, G335, G336, G337, G338, G339
G320, G321, G325, G326, G327, G328, G329
 #8501
 
 #8553, #8554
 #8998, #8999
G315 #851 1, #8512, #8513, #8514,
 #8526
 #8527
 #8528
 #5181 to #5188
 #100000 and up
G345, G346, G348, G349
Associated macro vari-
able
#8509
#8539
#8520, #8521, #8522, #8523, #8529
#8552
#8515, #8516, #8517, #8519
#8565
#8602, #8700 #8710 to #8713, #8715, #8720 to #8723, #8725 #8730 to #8733, #8735 #8740 to #8743, #8745
Conversa-
tional
(NOTE 1)∆(NOTE 1)
(NOTE 3)(NOTE 3)
(NOTE 3)(NOTE 3)
(NOTE 4)(NOTE 4)
Auxiliary
Executa-
ble
(NOTE 2)
49
: Usable : Partially usable : Unusable
Page 58
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
T able 6 (b) Functions of the Macro Executor and the Associated G Codes and Macro Variables (2/2)
B–61803E–1/07
No. Function
6.22 Interlock along each axis  #8600, #8601
6.23 Separation of P-CODE pro­gram UI/UO
6.24 Referencing the common variables for custom macros
6.25 Displaying the conversational macro screen when power is turned on
6.26 Masking screen switching with the CUSTOM key
6.27 Searching for a P-CODE workpiece number
6.28 Function for calling a user pro­gram with an executable mac­ro
6.29 Arithmetic function  
6.30 MDI key image read function by conversational macro
6.31 Window function  #8998, #8999
6.32 Special character registera­tion and display function
6.33 Execution macro call mask function
Associated G
code
 
 #99000
 
 
 
 
 #8549
 
 #8690, #8691
Associated macro vari-
able
Conversa-
tional
(NOTE 5)(NOTE 5)
(NOTE 7)
Auxiliary
Executa-
ble
(NOTE 6)
: Usable : Partially usable : Unusable
NOTE
Since the Series 21 do not support the graphic display feature, they
1
cannot use the drawing, painting, or other functions based on the graphic coordinate system.
2 This function can be used only for Series 16-B. 3 This function can not be used for Series 20 and for Series 21. 4 This function can not be used for Series 20-TA. 5 This function can not be used for Series 20. 6 To use the arithmetic function in the execution macro, custom
macro B option must be combined in the CNC.
7 This function can be used only for Series 20.
50
Page 59
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.1

SCREEN DISPLAY FUNCTION

6.1.1 Coordinates System of Screen
In this section, the terms twelve–soft–key type and seven–soft–key type represent the following display units:
Twelve–soft–key type: Those display units with twelve (10 + 2) soft
keys (such as the 14” CRT, 10” LCD, 9.5” LCD, and 10.4” LCD units)
Seven–soft–key type: Those display units with seven (5 + 2) soft keys
(such as the 9” CRT, 8.4” LCD, 9” PDP, and
7.2” LCD units)
The coordinates system used for character display and cursor display in the conversational macro program is called the character coordinates system.
The coordinate system used for graphic display in the conversational macro program is called the graphic coordinate system.
(1) Display unit with seven soft keys
The graphic coordinate system can be selected from the standard mode and the high resolution mode. Select one of these by the parameter HRGR (No.9003#2) in compiling. Select high-resolution mode for Series 16 and Series 18.
As for the character coordinates system, the horizontal direction is X coordinate and the vertical direction is Y coordinate. Specify the X coordinates from 0 to 39 from left to right and the Y coordinates from 0 to 15 from top to bottom. Any command of display exceeding the above range will be ignored. 1 unit is 1 character.
Since the 13th is used for the input section and the 14th is used for the state display section, they cannot be specified. Furthermore, the soft key frame section cannot be specified either.
123
0123456789012345678901234567890123456789
0 1 2 3 4 5 6 7 8
9 10 11 12 13 14 15
6.1.1(a) Character Coordinate System (In Case of Seven Soft Keys)
[][][][][]
012345678901234567890123456 7890123456789
123
The coordinates system used for graphic display in the conversational macro function is called the graphic coordinates system.
51
Page 60
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
As for the graphic coordinates system, too, the horizontal direction is the X coordinate and the vertical direction is the Y coordinate. Specify the X coordinates from -160 to 159(-320 to 319) from left to right and the Y coordinates from -112 to 112(-200 to 199) from bottom to top.(Value in parenthesis is for high resolution mode.) Any command of display outreaching the above range will be ignored. 1 unit is 1 dot.
The center of the screen will be (X, Y) = (0, 0).
Y
–160 (–320)
Screen
+112(199)
0.0
–112(–200)
Value in parenthesis is for high resolution mode.
X
+159 (319)
6.1.1(b) Graphic Coordinate System
(a) Standard mode
Use the same coordinate system as that of the series 0 standard seven soft keys.
Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = (–160 – 159)
Top and bottom of screen
(Y coordinates) = (–112 – 112)
(b) High resolution mode
Use the high resolution coordinate system. Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = (–320 – 319)
Top and bottom of screen
(Y coordinates) = (–200 – 199)
Graphic display macro prepared in the series 0 standard seven soft keys can almost be used unchanged in standard mode. The high resolution graphic mode allows highly accurate display that was not possible in standard mode.
(2) Display unit with twelve soft keys
(a) Character coordinates line, graphic coordinates line
Character coodinate system instructs in the range of 0-79 for the left and righ directions (X coodinates), and 0-24 for the up and down directions (Y coordinates). The 20th line is used for input and the 21st line is used by the system for status display and can not be satisfied. The space for the software key also cannot be satisfied.
52
Page 61
B–61803E–1/07
19 20 21 22 23 24
6. FUNCTIONS OF THE MACRO
PROGRAMMING
167
0123456789012 to 678901234567890123456789
0 1 2 3 4 5 6 7 8
0123456789012 to 678901234567890123456789
167
6.1.1(c) Character Coordinate System (twelve soft keys)
EXECUTOR
6.1.2
Screen Display Control Code
Instruct the following graphic coordinates of the graphic coordinates system.
Center of screen
(X coordinates, Y coordinates) = (0, 0)
Left and right of screen
(X coordinates) = (–320 – 319)
Up and down of screen
(Y coordinates) = (–200 – 199)
It is possible to make the screen freely by commanding the contents of the screen display with the conversational macro program. The following control codes are prepared for the screen display.
1. G243 Character display
2. G202 Screen erase
3. G240 Color specification
4. G244 Graphic line specification
5. G242 Setting of graph start point
6. G01 Straight line graph
7. G02 Circular graph (Clockwise)
8. G03 Circular graph (Counterclockwise)
G202, G242 and G244 are the one-shot G codes. All the other G codes are the modal G codes and they are considered as belonging to the same G code group.
Also the following are the modal addresses. X : X coordinate of the character coordinates system,
53
Page 62
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
X coordinate of the graphic coordinates system
Y : Y coordinate of the character coordinates system, Y coordinate of
the graphic coordinates system
I : X coordinate at the center of the circular graph of the graphic
coordinates system
J : Y coordinate at the center of the circular graphic of the graphic
coordinates system A : Character size (Character display) B : Flash specification (Character display) F : Format of numeric display (Character display) Z : Zero supress specification of numeric display (Character display) Q : Circular graph (Graphic display), PC address write data
NOTE
Since the Series 21 do not support the graphic display feature, they cannot use G01, G02, G03, G242, or G244. Only character deletion is possible when using G202 (screen deletion).
(1) Character display (G243)
G243 Xx Yy Aa Bb Cc (c..) (*hhhh..*) Kk Ff.e Zz Dd Pp ;
There are 2 ways of commanding the character string to display.
a) Command to display a character string by enclosing it with
parentheses: G243 (FANUC 16-SERIES) ; ”FANUC 16-SERIES” will be displayed.
Those which you can command by enclosing with parentheses are the alphabet, numbers, minus marks, and decimal points only.
b) Commandto display a character string by bounding with ”(*” and
”*)” by internal codes: G243 (*46 41 4E 55 43*) ; ”FANUC” will be displayed. G243 (*4E 43 4175 4356*) ; ”NC system” will be displayed.
Command with hexadecimal number. Divide the internal codes with blanks. Take a space for 2 characters aside for hiragana and kanji. The coordinates will be renewed when a character string is displayed.
For the character string, it is possible to specify up to maximum total 255 characters in 1 block. Count hiragana and kanji as 2 characters respectively.
Also, it is possible to command the character code to display directly at the address C
by decimal number. The commandable codes are 32 - 95 (20 - 5F with hexadecimal number) or 160 - 223 (A0 - DF with hexadecimal number).
C40
* C61
=
Command the display positions of the character strings at the addresses X and Y with the character coordinates.
54
Page 63
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
Command character size at the address A.
A1 = Normal size A2 = Full size A3 = Triple size (32 size) A4 = 22 size
The following characters and symbols can be displayed at full size:
Alphabetic characters, numeric characters, kana characters, blanks, the plus sign (+), minus sign (–), period ( . ), equal sign (=), comma ( , ), asterisk (
), slash ( / ), paretheses ( ( ) ), square brackets ( [ ] ),
*
inequality signs ( < and > ), and the sharp (#)
The triple size is 3 times as wide as and 2 times as long as the normal size. The characters which can be displayed with the triple size characters are the alphabet, numbers, minus marks, decimal points and blanks. No other characters can be displayed with the triple size.
A 2-by-2 character is two times taller and two times wider than a standard character. Fifteen types of 2-by-2 characters can be displayed: numbers (0 to 9), plus sign, minus sign, decimal point, asterisk, and slash. Note, however, that the Greek character φ is displayed for a slash.
NOTE
Only the Series 20 allows 2-by-2 character display . With the Series 16/18/21, 2-by-2 characters cannot be displayed; A4 cannot be specified.
1. Standard character G243 Xx Yy A1 (8)
2. Full-size character G243 Xx Yy A2 (8)
3. Triple-size character (3-by-2 character) G243 Xx Yy A3 (8)
4. 2-by-2 character G243 Xx Yy A4 (8)
55
Page 64
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
Bink control is commanded by the address B.
B0 = Does not blonk. B1 = Blinks slowly. (Energized for about 1/2 sec. and deenergized
for about 1/4 sec..)
B2 = Blinks quickly. (Energized for about 1/4 sec. and deenergized
for about 1/8 sec..)
NOTE
When a blink is specified, the display is energized or deenergized according to the timer condition when the display is commanded. Therefore, when the display is not repeated, it will be kept energized or deenergized.
Command the number of blanks at the address K
. The blanks as many as commanded at K will be displayed. When the blanks are displayed, the coordinates will be renewed.
Command the format to display the numeric values at the address F Command the number of display figures on the left of the point and the number of figures under the point on the right of the point.
Command at the address Z
whether you do ”leading zero suppress” or not
when displaying the numeric values.
Z = 0 .. leading zero suppress will take place.
= 1 .. leading zero suppress will not take place.
The mark will not be displayed when Z is 0. Command the numeric values to display at the address D
.
Command the sequence No. that the character string is cataloged at the address P
. The character displayed will be the character string in one block of the sequence No. commanded with P in the program set at the character string registered program control variable #8509. The variable for controlling character-string registration programs (#8509) is defined as the number of the first program in the character-string registration program group. Use the five digits for address P to select the desired character-string registration program in the group.
.
G243 Xxx Yyy Ponnnn; o : A number from 0 to 8 to select a program in the
character-string registration program group
nnnn : Sequence number 0001 to 9999
Example 1) #8509 = 1000 ;
G243 P10 ; Displays the character string with sequence
number N10 in program O1000
G243 P80010 ; Displays the character string with sequence
number N10 in program O1008.
Up to nine character-string registration programs can be selected as desired in the above way.
56
Page 65
B–61803E–1/07
PROGRAMMING
Example 2)
6. FUNCTIONS OF THE MACRO EXECUTOR
O9000;
:
#8509=8000;
X0Y0; G243(ABC)P20;
O8000;
:
N10(IJK);
N20(XYZ);
In this case, one block of the sequence No. 20 in the program No. 8000 will be executed.
In the above example, ”ABCXYZ” will be executed. And address P executes the specified block after the process of the
corresponding block is finished. Consequently, ”ABCXYZ” will be displayed though command is done as follows with the above example.
G243 P20 (ABC) ;
Nothing but the character string will be described at the block specified by P.
When #8509 is 0, the block of the sequence No. specified in the current program will be executed.
NOTE
Process sequence of modal address
Program is processed by block in the normal NC program, but it is processed in sequence of address command in the conversation macro program. (Example)
1 F8.3 ;
G243 F5.1 D#100 ;
2 F8.3 ;
G243 D#100 F5.1 ; In 1 #100 is displayed with F5.1, but in 2 it is displayed with F8.3.
(2) Screen erase (G202)
G202 XxYyIiJjPp; X= Start point of X coordinate in character coordinate Y= Start point of Y coordinate in character coordinate I = Number of characters to be erased from the start point
(X coordinate) for partial erasing.
J = Number of characters to be erased from the start point
(Y coordinate) for partial erasing. P = 1 ... Erasing graphic screen = 2 ... Erasing character screen
57
Page 66
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
= 3 ... Erasing graphic and character screens
Also to make partial erasing, all X, Y, I and J addresses must be specified. If any address is omitted, all the screen is erased.
(3) Displayed color specification (G240)
G240 Pp L
;
l
Colors of segments and character strings specified by conversational program can be designated.
P = 0 .. Black
= 1 .. Red=–1 Red (highlights) = 2 .. Green=–2 Green (highlights) = 3 .. Yellow =–3 Yellow (highlights) = 4 .. Blue =–4 Blue (highlights) = 5 .. Purple =–5 Purple (highlights) = 6 .. Blueish green =–6 Bluish green(highlights) = 7 .. White=–7 White (highlights)
L = 0 .. not blink
= 1 .. blink
If no designation is made, a segment and a character string are white without blink.
(4) Graphic line specification (G244)
G244 Pp ; P = 0 .. Full line
= 1 .. Broken line
= 2 .. 1-dot line
= 3 .. 2-dot line = 4 .. Erase
The graphic line is full line at power ON. (5) Setting of graph start point (G242)
G242 Xx Yy ;
Command the display start point with the absolute coordinates at the addresses X and Y.
Next display will start at this point. (6) Straight line graph (G01)
G01 Xx Yy ;
Command the coordinate of the end of the straight line with the absolute coordinate at the addresses X and Y.
A straight line will be made with the line commanded with G244 from the current position to the commanded coordinate. The coordinates will be renewed.
(7) Circular display (G02, G03)
G02 Xx Yy Ii Jj Qq ; G03 Xx Yy Ii Jj Qq ;
58
Page 67
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
G02 display the arc clockwise and G03 counter-clockwise. Command the end of the arc with the absolute coordinate at the adresses
X and Y.
Y
Q=0
Q=1
X
Q=4
Q=2
Q=3
[No. of quadrants]
6.1.3
Graphic Painting Function
Command the center coordinate of the arc with the absolute coordinate at the address I and J.
Command the number of quadrant (0 - 4) of the arc at the address Q. The arc will be graphed with the line commanded with G244 from the current position to the coordinate of the commanded end.
The coordinate will be renewed.
The graphic function for conversational macros enables painting the specified field.
NOTE
The graphic painting function cannot be used for Series 21.
(1) Description
The field to be painted is drawn using a solid line with the graphic function. Then the paint command is used together with control code G206 to specify any point inside the field and the boundary color. The field is filled with the color which is used as standard when G206 is issued.
G206PpXxYy;
Painting boundary color (P)
p = 0: Same as the fill color p = 1: Red p = 2: Green p = 3: Yellow p = 4: Blue
59
Page 68
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
p = 5: Purple p = 6: Blue-green p = 7: White p = 8: Specified two or more colors other than black
Arbitrary point inside the field to be painted (X, Y)
NOTE
The field to be painted must have a closed boundary.
Corrent Incorrent
B–61803E–1/07
NOTE
To use the painting command on the high-resolution 9” monochrome CRT, set HRGC of compilation parameter 9004 to 1 to make the CRT enter the intensity modulation mode.
(2) Examples
(a) When p = 8 is specified
The innermost field is painted.
G240P1; G244P0; G242X0Y0; G01X100; Y100; X0; Y0; G240P4; G242X50Y50; G01X150; Y150; X50; Y50; G206P8X110Y110;
Red
Blue
Blue
(b) When the same color is specified for the fill and the boundary
(p = 0) A line with another color in the field to be painted is painted.
60
Page 69
B–61803E–1/07
PROGRAMMING
G240P1; G244P0; G242X0Y0; G01X100; Y100; X0; Y0; G240P4; G242X50Y50; G01X150; Y150; X50; Y50; G206P0X110Y110;
6. FUNCTIONS OF THE MACRO EXECUTOR
Blue
Red
Blue
6.1.4
Graphic Cursor Function
6.1.5
Rectangular Display Function
Graphic cursor can be displayed in the conversational macro.
(Command Format)
G249 Pp Xxxx Yyyy;
p:Control code
=0 : Display on (lit) =1 : Display on (Blinks at low speed) =2 : Display on (Blinks at high speed) =3 : Display off
xxx/yyy:Graphic cursor display position
(Graphic coordinate) (When display off is specified, this specification is ignored. It can be omitted).
In a conversational macro, a rectangular figure can be displayed. (1)Function
In rectangular display, a rectangle in which addresses X and Y, I and J become diagonal positions is displayed.
(Xx,Yy)
(Ii,Jj)
Addresses X and Y, I and J are any position that can create a rectangle.
61
Page 70
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
(Ii,Jj)
(Xx,Yy)
(Ii,Jj)
(Xx,Yy)
(Command format)
G204 X_ Y_ I_ J_ [P ];
X: X coordinate of the start of a rectangle Y: Y coordinate of the start of a rectangle I : X coordinate of the end of a rectangle J : Y coordinate of the end of a rectangle P : Painting control= 1 : Painting in rectangle (red)
= 2 : Painting in rectangle (green) = 3 : Painting in rectangle (yellow) = 4 : Painting in rectangle (blue) = 5 : Painting in rectangle (purple) = 6 : Painting in rectangle
(bluish green)
= 7 : Painting in rectangle (white)
Command in parentheses can be omitted.
The color of boundary of a rectangle is of specified by G240P_ and painted color in rectangle is of specified by address P.
When address P is omitted, only boundary of a rectangle is displayed. After the painted color is specified by P, the color remains the following
movement. That is, the color specified by P changes the P value of G240P_.
T ype of line of rectangle is of a type specified by the line type specification command (G244P_).
(2) Example
G244 P1; G240 P1; G204 X-200 Y150 I0 J10;
–320 0 319
199
Boundary line is red.
0
~ ~
–200
62
Page 71
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
G244 P0; G240 P2; G204 X50 Y50 I-200 J150 P1;
–320 0 319
199
~ ~
–200
Painting is
Boundary line is green.
(High resolution mode)
EXECUTOR
6.1.6
Intensity Modulation Mode Display of 9” Monochrome CRT
NOTE
Be sure to specify full line when you specify painting. Painting is started from the point determined to be the midpoint between addresses X and I and that between addresses Y and J. In painting, a boundary line can be displayed in any color other than black. Painting is executed only when specified on a black ground.
For 9” monochrome CRT, the conversational macro screen can be displayed in intensity modulation mode using a compile parameter (No. 9004#4, 9008#7).
Color specification code (G240) specifies intensity. During the monochrome mode, the color specification code is ignored.
G240 Pp L1;
P = 7 (Brightest ) to 1 (Darkest), 0 (Black) L = Reverse specification
63
Page 72
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
6.1.7
Displaying Seven Soft Keys Data on the Twelve Soft Keys Type
Data for a twelve soft keys can be displayed on the user-1 screen for a conversational macro screen on the twelve soft keys by setting US19W of compilation parameter (bit 5 of parameter 9006). (This screen is equivalent to the AUX screen in Series 0.)
The whole of user screens 2 and 3 can be used as macro screens while they are displayed. (The absolute coordinates are always displayed on the position screen.)
US19W = 1: Displays seven soft keys data on the twelve soft keys type
<<USER1 screen when seven soft keys data is displayed>>
Position screen
Macro screen
NOTE
Upper left corner of the macro screen is X=40 and Y=7.
<<USER2 and USER3 screens>>
Macro screen
64
Page 73
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.1.8
Function Screen Control Function
Function screen for a small keyboard
POS
: Current value display screen
: Program display screen
PROG
OFFSET
: Offset/setting screen
SETTING
SYSTEM
: Parameter/diagnosis and suchlike
MESSAGE
: Alarm/message screen
CUSTOM
: Graphic/user screen
GRAPH
CUSTOM
: User screen
Writing a desired value in parameter 8510 enables displaying any function screen. Reading the value of parameter 8510 enables checking which function screen is currently displayed.
The following table shows the correspondence between function screens and the values of parameter 8510.
Value of pa-
rameter 8510
0
1
2
3
4
5
6
Function screen for a standard/FAPT
keyboard
: Current value display screenPOS
: Program display screen
PROG
OFFSET
: Offset/setting screen
SETTING
SYSTEM
: Parameter/diagnosis and suchlike
MESSAGE
: Alarm/message screen
GRAPH
: Graphic screen
CUSTOM
: User screen
Value of pa-
rameter 8510
0
1
2
3
4
5
6
6.1.9
Function for Masking the Status Display on the Conventional Macro Screen
6.1.10
Shift Function for Adjusting the Graphic Screen
: FAPT screen (FAPT key)FAPT
7
The mode and status display can be masked on the user-1, -2, and -3 screens for displaying the conversational macro screen by specifying compilation parameter STDM (bit 2 of parameter 9006).
The 14th line on the seven soft keys and 21st line on the twelve soft keys can therefore be controlled with conventional macros.
The graphic coordinate system can be shifted in units of dots on the conversational macro screen by specifying compilation parameters 9048 and 9049.
Compilation parameter 9048: Shift value along the X-axis in the graphic coordinate system on the conversational macro screen
Compilation parameter 9049: Shift value along the Y-axis in the graphic coordinate system on the conversational macro screen
65
Page 74
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
6.2

ADDRESS FUNCTIONS

The address functions are the functions to return the address of PMC or the contents of the parameter as the function values. However, as the address functions cannot be written, it is impossible to describe them on the left side of an operation. Control code G310 is prepared for PMC address writing.
The format of the address functions is as follows. <Address><Address No.> or <Address><Address No.>.<Bit position>
(parameter cannot be used) or<Address><Address No.>.<Axis No.> Address P indicates the parameter and the other addresses indicate PMC
addresses. P100 returns the contents of the parameter No. 100 as function values
respectively. Since the bit position cannot be specified for parameters, if it is required,
take the bit data using AND instruction. Also, G100.1 returns the contents of the bit 1 of PMC address G100 ,and
G105 returns the contents of PMC address G105 as function values respectively.
It is possible to describe <Address No.> and <Bit position>or<Axis No.> with variables or # [<Expression>] or [<Expression>], instead of numbering them with numerical values directly.
For example, it is possible to describe as follows.
P#100 P#100.#101 G# [#100+1] G [#100+1] .[[#100-1]/2]
The usable addresses are ”P” for parameter and X, Y, F, G, R, D,T,C, K and A of PMC addresses.
Format conforms to that used for ladder diagram. Refer to the operator’s manual for the detail of parameters and to the PMC
programming manual for details of the PMC addresses.
NOTE
Refer to the section titled ”PMC Address Write Control Code (G310)” for writing data to the PMC addresses R,D,C, and K.
66
Page 75
B–61803E–1/07
6.3

READING AND WRITING A PMC ADDRESS

6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
(1) PMC address write control
Data of one, two, or four bytes can be written when address L is specified with control code G310.
G310 Dd Qq Lx; G310 Rr Qq Lx; G310 Cr Qq Lx; G310 Kr Qq Lx; These commands write the data indicated by address Q at the PMC
address indicated by address D, R, C, or K, a number of bytes at a time as indicated by address L. The data cannot be specified in bits.
The write data indicated by address Q is rounded as follows: Decimal places of 0.5 and over are counted as a whole number and the rest are discarded. Then the data is expressed in binary form and written. When the data is a negative value, it is handled and converted as two’s complement.
When the following is specified, the data is written in the PMC data area (D300 to D303) as shown in the table below:
#100 = –500.0; G310 D300 Q#100 L4;
Bit 7 6 5 4 3 2 1 0
D300 0 0 0 0 1 1 0 0 D301 1 1111110 D302 1 1111111 D303 1 1 1 1 1 1 1 1
In two’s complement, the decimal number –500 becomes FFFFFE0CH in hexadecimal.)
When the specified data contains more bytes than that indicated by address L, only the data of the length specified by address L is written. This will not cause an error. (If L1 is specified in the example above, the identical data is written only in D300.)
(2) PMC address read control
When a variable is indicated by address P with control code G310, the PMC data can be read. Address L indicates that the data of one, two, or four bytes is read at a time.
G310 Dd Pp Lx; G310 Rr Pp Lx; G310 Cr Pp Lx; G310 Kr Pp Lx; These commands read the data which starts from the PMC address
indicated by address D, R, C, K or A and whose length is indicated in bytes by address L into the variable indicated by address P. The read data is handled as binary data consisting of the specified number of bytes, converted, and assigned to the variable.
If G310 D400 P101 L2; is specified when the PMC data area (D400 to D401) has the data shown below, –500.0 is input in #101.
Bit 7 6 5 4 3 2 1 0
D400 0 0 0 0 1 1 0 0 D401 1 1 1 1 1 1 1 0
67
Page 76
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
The address function can read data the specified number of bytes at a time. However, the following must be noted: As the address function handles and converts the read data as a signed value (in two’s complement), the read data may be changed.
If the following is specified with the example shown above, –2.0 and
254.0 are read into #102 and #103 respectively. G310 D401 P102 L1; #103 = D401;
NOTE
1
When address Q is specified, write control is executed. When address P is specified, read control is executed. If both addresses Q and P are specified, write control is executed.
2 Addresses other than D, R, C, K (X, Y , G, F...) cannot be specified. 3 With address L, 1, 2, or 4 can be specified. If another value is
specified, or if address L is omitted, the data is written or read the specified number of bytes at a time.
4 For details of the PMC address, refer to the PMC programming
manual.
68
Page 77
B–61803E–1/07
6.4

READER PUNCHER INTERFACE CONTROL BY CONVERSATIONAL MACRO

PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.4.1
Outline
The conversation macro function allows the reader/puncher interface to be controlled.
The control is performed by combining the following four control codes. When this function is used, always set the expansion function validity
(No. 9002.7, EXT1) to 1 in the parameter on compiling.
G330 reader puncher interface open G331 reader puncher interface close G335 1 byte read G336 Data transmit G337 input of macro variable G338 output of macro variable
Select either channel 1 or channel 2 as a circuit to be used by specification on opening.
Channels 1 and 2 cannot be controlled simultaneously. In addition, when the normal I/O function is commanded on the channel
which is being used in this function, operation is not proper if the channel, where the input of NC program is being executed by the I/O function, is opened.
Select one control method out of the three methods shown in the following by specification on opening a circuit.
(1) User macro control
The reader puncher interface is opened in the bidirectional mode and no output control of control codes (DC1 to DC4) can be carried out by the macro executor. Use the macro executor when creating your own protocol. When overflow of the reception buffer is detected, send the transmission stop/restart message to the target device by switching ON/OFF the control signal ”RS”.
(2) Read control (DC1/DC3 automatic control)
The ”DC1” code is automatically sent on opening, thus requesting the target device to transmit data. The ”DC3” code is transmitted on closing. In addition, when overflow of the reception buffer is detected, the output of ”DC3” and ”DC1” is automatically controlled. No control of data transmission (G336) can be performed when the reader/puncher interface circuit is opened in the read control mode. (End code = 8)
(3) Transmission control (DC2/DC4 automatic control)
The ”DC2” code is automatically on opening, thus requesting the target device to transmit data. The ”DC4” code is transmitted on closing. The interruption and restart processing of transmission by the target device using the ”DC3” and ”DC1” are also automatically carried out.
69
Page 78
6. FUNCTIONS OF THE MACRO EXECUTOR
6.4.2
Function Details
PROGRAMMING
B–61803E–1/07
No control of 1 byte reading (G335) can be carried out when the reader/puncher interface circuit is opened in the transmission control mode (End code = 8). There is an end code to check to see if the commanded control code has been properly executed or not. Check the end code after executing G330 to G338.
#8539 : End code (only for reading) However, the circuit closing processing always ends normally.
(1) Circuit open (G330)
G330 Pp Bb Ss Cc ;
The reader puncher interface of the specified channel is opened according to the control method and control conditions to enable it to be used.
Select the channel and control method used by the specification of address ”P”.
1 : Channel 1 User macro control
2 : Channel 2 User macro control 11 : Channel 1 Reading control (DC1/DC3 automatic control) 12 : Channel 2 Reading control (DC1/DC3 automatic control) 21 : Channel 1 Transmission control
(DC2/DC4 automatic control)
22 : Channel 2 Transmission control
(DC2/DC4 automatic control)
NOTE
In case of 21-TB, only channel 1 is used.
Specify the baud rate by the specification of address ”B”.
1 : 50b/s 2 : 100b/s 3 : 110b/s 4 : 150b/s 5 : 200b/s 6 : 300b/s 7 : 600b/s 8 : 1200b/s 9 : 2400b/s
10 : 4800b/s 11 : 9600b/s
Specify the stop bit and parity by the specification of address ”S”.
1 : 1 stop bit, No parity
2 : 2 stop bits, No parity 11 : 1 stop bit, Odd parity 12 : 2 stop bits, Odd parity 21 : 1 stop bit, Even parity 22 : 2 stop bits, Even parity
Specify the output code on transmitting data by the specification of address ”C”.
1 : Output code (ASCII)
2 : Output code (ISO)
70
Page 79
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
Example) Device and transmission control of channel 2
(DC2/DC4 automatic control) Baud rate = 4800 b/s, Stop bit = 2, Even parity, ISO code output G330 P22 B10 S22 C2 ; IF [#8539 NE 0] GOTO 900 ; Open processing end N900 error processing :
(2) Circuit closing (G331)
G331 ; The circuit, which is currently open, is closed. There is no end code for the circuit closing processing. It always ends normally.
(3) 1 byte reading (G335)
G335 Pp ; p : Reading variable number
Data 1 byte received through circuit is read into the variable area specified.
The received data is stored in the reception buffer (128 bytes) temporarily and is read one byte at a time by this control code.
When there is no reception data, end code 255 is sent. If the reception buffer is nearly overflowing due to delay of reading
processing for the reception data, either of the following processing is carried out according to the opening specification of control method.
(a) In the case of user macro control
When overflow of the reception buffer is detected, the
transmission stop is requested to the target by the turning OFF of
control signal ”RS”.
Then, when there is an empty reception buffer area by reading,
the signal (RS) is turned ON, thus requesting the target device
to continue transmission.
(b) In the case of reading control (DC1/DC3 automatic control)
When overflow of the reception buffer is detected, the ”DC3”
code is output automatically , thus requesting the target device to
stop transmission.
Then, when there is an empty reception buffer area by reading,
the DC1” code is output, thus requesting the target device to
continue transmission.
(c) In the case of transmission control (DC2/DC4 automatic control)
When the circuit is opened in the transmission control mode, no
control of 1 byte reading is carried out (end code = 8).
Example)
N100 G335 P100;
IF [#8539 EQ 255] GOTO100;
IF [#8539 NE 0] GOTO900;
Reading processing ended
(#100: Received data)
N900 error processing
71
Page 80
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
(4) Data transmission (G336)
G336 transmission data;
The following commands of transmission data are available:
(c...) String command 1
hh..*) String command 2
(
*
Ff Data format command Zz Zero suppress command Dd Data command Pp Block number command Kk Null code command Cc 1-character command
See screen display control code G243 (character display) for string commands 1 and 2 and address F, Z, D, P, and K commands since they are similar.
The commanded string is converted into either ASCII or ISO code and is transmitted by the specification on opening.
However, the code output by address K is not the space but the null code (no punching).
In the one-character command by address C, no code conversion processing is carried out.
Use it when the code is output other than the control code (DC1 ­DC4) or ASCII/ISO code.
Example)
G336 C18 K20 (FANUC) K20 C20; IF [#8539 NE 0] GOTO900; Transmission processing ended N900 error processing;
The following data is transmitted in the circuit by this command:
C18 DC2 (12hex) K20 Null code 20 (Feed) (FANUC) ”FANUC” (ASCII/ISO) K20 Null code 20 (Feed) C20 DC4 (14hex)
When the circuit is opened in the reading control mode, no control of data transmission is carried out (End code = 8).
6.4.3
Inputting and Outputting Macro Variables
Macro variable data input and output can be conducted simply by an instruction via reader puncher interface. Instruct the control with the following G code.
G337 macro variable data input G338 macro variable data output
An end code #8539 is provided to check that input and output processing runs correctly or not. Check the end code #8539 after running G337, G338.
#8539 end code (read only)
72
Page 81
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
(1) Macro Variable Data Input (G337)
G337 Pp ; p : the head variable number which mounts the macro variable
(omissible)
A macro variable data, which is input from reader puncher interface that opened with the read control mode, is read and set it to the correspondenting variable.
The tape format of macro variable data is as follows;
LF N_ P_ LF P_ LF %
Leader part
Start to input
Variable number
Variable data
T ape end
Information before ”LF” which appears on the tape at first is all disregarded.
The tape to the end (”EOR”) from the first ”LF” is analyzed as significant information.
A section which is spaced with ”LF” and ”LF” into significant information segments called a block, and one block shows one macro variable data.
Address ”N” can be omitted. In this case, the variable number is interpreted to be (the variable number of the preceding block) +1. If ”N” is omitted at the head block, the variable number is assumed to be the one specified by address ”P” with instruction G337. Therefore, a tape without ”N” is made out, and arbitrary variables are read by the instruction of ”337” ” Pp”.
Address ”P” on the tape indicates the value of the variable and cannot be omitted. ”LF” is specified after ”P” for value zero (#0) without specifying the value.
LF N_ P LF
”LSK” or ”EDIT” goes on and off under the right of the screen if the data is being read. If the data is being read, the screen cannot be changed.
NOTE
1 G337 is a one shot G code. 2 Address ”O” data and every ”CR”, space, ”DEL” code is
disregarded within the significant information section.
3 Only ISO or ASCII code can be used for input code. 4 TV, TH check does not run.
73
Page 82
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
(2) Outputting Macro Variable Values(G338)
G338 Pp Qq Ff Zz ;
A specified macro variable is changed into a prescribed tape format and output from reader puncher interface which opened with the transmit control mode.
Output code is selected between ISO and ASCII code by the open command.
p : Specify the head of output macro variable q : Specidy the number of output macro variable data f : Specify the output format of macro variable data
(modal value when omitted)
z : Specify the zero-suppress of macro variable data
(modal value when omitted)
For output tape format, same as the input format, the head variable number address ”N” and variable values with address ”P” at the head block, then variable values are continuously output with P in the following blocks and finally, the tape end (”EOR”) code is output.
”CR” code of every block can be output by the compile parameter PTCR(No.9003#6) . Use this code to make carriage return of a printer, etc.
PTCR=0: ”CR” is not output after ”LF”, when outputting macro variable values.
%LF N10000P1234 P5678LF LF%
PTCR=1: ”CR” is output twice after ”LF”, when outputting macro variable values.
LF N10000P1234% CRCR LF CRCR P1234 LF CRCR %
Control of the feed part does not act at output. Conduct with ”G336Kk” data transmission to feed with a paper tape puncher, etc.
”EDIT” goes on and off at the lower right of the screen if a data is outputting. Screen cannot change if data is outputting.
NOTE
1
G338 is a one-shot G code.
2 Only ISO code or ASCII code can be used for output. 3 An end code is communicated by 115 when an invalid data is
specified to a variable number, and the outputting stops.
74
Page 83
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.4.4
Extending the Function for Inputting and Outputting a Macro Variable
The conversational macro can input and output a macro variable via the reader/punch interface. This function can be extended so that two or more variable groups can be output at a time and the output data can be read into another variable.
(1) Outputting macro variables
By adding address R to G338 described in (2) of Section 6.4.3, the tape format of the variable data to be output can be controlled.
(Command format)
G338 Pp Qq Ff Zz Rr;
------------­R0 : Standard format (Same as when R is not specified) R1 : Variable numbers are not output. R10 : At the end of the tape, % (EOR) is not output. R11 : Variable numbers are not output. At the end of the tape,
% (EOR) is not output. R20 : At the beginning of the tape, % (EOR) is not output. R21 : V ariable numbers are not output. At the beginning of the
tape, % (EOR) is not output. R30 : At the beginning and end of the tape, % (EOR) is not
output. R31 : Variable numbers are not output. At the beginning and
end of the tape, % (EOR) is not output.
(a) When variable numbers are not output, the function for inputting
a macro variable (G337) can read the output variable data into a variable indicated by address P.
(b) When % (EOR) is not output at the beginning and/or end of a tape,
two or more variable groups can be output to form a single tape format.
(Example)
G330 Pp Bb ... ;
G338 P10000 Q10 F8.3 Z1 R11; IF[#8539NE0]GOTO999;
At the beginning, % (EOR) is output. Then the data of #10000 to #10009 is output without variable numbers. At the end, % (EOR) is not output.
G338 P11000 Q20 F8.3 Z1 R31; IF[#8539NE0]GOTO999;
At the beginning and end, % (EOR) is not output. The data follows the data output above to form a single tape format.
G338 P12000 Q10 F8.3 Z1 R21; IF[#8539NE0]GOTO999;
At the end, % (EOR) is out­put. The tape format is closed.
G331;
75
Page 84
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
%;P___;P___; .. ;P___;P___;P___; ... ;P___;P___;P___; ... ;P___;%
|#10000 to #10009|#11000 to #11019|#12000 to #12009|
”R11” ”R31” ”R21”
B–61803E–1/07
(2) Function for inputting macro variables
By adding address Q to G337 described in (1) of Section 6.4.3, the number of variables to be input can be specified. When address R is also specified, data reading can be continued.
(Command format)
G337 Pp Qq R99;
--------­P : Number of the variable to be read (V alid when variable
number N is not specified on the input tape) Q : Number of variables to be read (Can be omitted) R99 : Reading to be continued (Can be omitted)
(a) When address Q is specified, the number of variables to be read
can be specified. After the specified number of variables are input, completion code #8539 is set to 99 to indicate that data reading can be continued. If % (EOR) is read before reading the specified number of variables, completion code #8539 is set to 0. If address Q is omitted, the system assumes that an infinite number is specified.
(b) When R99 is specified, the remaining variable data can be read
after the specified number of variables are read and completion code #8539 is set to 99. If data reading is continued without R99, the data of a variable is lost in the middle of reading because of a significant information check. (The data up to the first ”;(LF)” is skipped.)
(Example) Reading the tape output according to the example
described above
G330 Pp Bb ... ;
G337 P100 Q10 ; IF[#8539 NE 99]GOTO888;
G337 P15000 Q20 R99 ; IF[#8539 NE 99]GOTO888;
G337 P16000 R99 ; IF[#8539 NE 0]GOTO888;
G331 ;
76
The data of the first ten vari­ables is read into #100 to #109. (After the data is normally read, #8539 is set to 99.)
The data of twenty variables is read into #15000 to #15019.(After the data is normally read, #8539 is set to 99.)
The remaining variable data is read into #16000 to #16009. (After the data is normally read, #8539 is set to 0.)
Page 85
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.4.5
FANUC Floppy Cassette Control
File data on the FANUC FLOPPY CASSETTE, FA CARD or FANUC PROGRAM FILE M
ate can be read, prepared and deleted, by an opening
command and the instruction of control code ”G339”.
Read file data (G330) Make file and write data (G330) Read directory information (G330/G339 P1) Delete file (G330/G339 P2) Change file data (G330/G339 P3)
(1) Reading File Data (G330)
G330 Pp Bb Ss Cc Ll/Ff/Aa ; Specify one of the address ”L/F/A” at the time when the line is open
by read control mode. At the result of this action, the head of specified file and file data reading is conducted. Refer to Section 6.4.2(1) ”Circuit open” about address ”P/B/S/C”. However, specify reading control (11/12) for address ”P” and ISO(2) for address (C).
Select one of addresses L,F, or A depending on the process. (a) Head call by file name
Head call by file name is possible if the head variable number of the variable string which is housed in the file name is specified by address”L”. Set the file name by decimalized ASCII code to the variable string of 17 variables, and specify the head variable number by address ”L”.
(Example)
When calling the file name ”ABCD”, set 65(A), 66(B), 67(C), 68(D), 32...32(space) to 17 variables of common variables #100-116.
G330 P11 B10 S2 C2 L100 ;
NOTE
1
A file name is fixed to 17 characters. Be sure to use 17 characters.
2 Specify the file name with alphanumerics and space. Alarm 8 will
be generated if code 32(space) is specified at the head of file name.
(b) Head call by the file number
Head call can be conducted with a file number, if the file number (1-9999) is specified with address ”F”.
(Example)
When making a head call of file number 3 G330 P11 B10 S2 C2 F3 ;
(c) Head call of next file
Next file’s head call, which already exists can be conducted by the specification of address ”A”. Use this function to read files continuously . Be sure to specify ”A1” for address A”. End code (=8) is the other specification.
(Example)
When making a head call of the next file which is being called now
G330 P11 B10 S2 C2 A1 ;
77
Page 86
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
(2) Making Files and Writing Data (G330)
G330 PpB
Ss Cc (Ll/Ff) ;
b
New files are made and data can be written on a F ANUC cassette by specifying one of address L or F when the communication line is opened with transmission control mode.
Refer to 6.4.2(1) ”Circuit open” for the specification of address ”P/B/S/C”. Be sure to specify transmission control (21/22) for address ”P”, and ISO (2) for address ”C”.
Select one of address L or F by processing. (a) Making files by file name
A new file can be made and data can be written on a FANUC cassette with a specified file name, if you specify the head variable number of a variable string describing a file name by address ”L”. Set the file name by decimalized ASCII code to a variable string of 17 variables. Set the head variable number with address ”L”.
(Example)
If you make a file of file name ”ABCD”; 65(A), 66(B), 67(C), 68(D), 32...32(space) shall be set to the
17 common variables of #100-116 G330 P21 B10 S2 C2 L100 ;
NOTE
A file name is fixed to 17 characters. Be sure to fill spaces(code
1
32), if the file name is less than 17 characters.
2 Specify a file name with alphanumeric and spaces. Alarm 8 will be
generated if the 32(space) code is specifyed at the head of the file name.
3 A new file is added to the end of recorded files.
(b) Making files by file number
A new file can be made and data can be written to a specified file number by specifying the file number (1-9999) after address ”F”.
(Example)
To make file No.3, specify as follows: G330 P21 B10 S2 C2 F3 ;
NOTE
1 If you make a file with the file number, be careful that every file
which was previously input in the specifyed file number, and all subsequent file numbers are deleted.
2 Preparation of files by file number can only be conducted for the
existing files. Files can be added only by file name specification.
(3) Control of Directory Information (G330/G339)
The control of directory information is possible with control code ”G339”.
Read directory information (G339 P1)
78
Page 87
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
Delete file (G339 P2) Change file name (G339 P3) The control mode at line opening shall be of directory information to
use this function. Instruct P=31/32 at the opening time for specification of directory information.
G330 Pp Bb Ss Cc ; P31 : Channel 1 Directory information control P32 : Channel 2 Directory information control Refer to the section on line opening for address ”B/S/C”. Be sure to
specify ISO (2) for address ”C”. Do not instruct several functions continuously in one opening time
for every function of directory reading, file deleting, file name changing if you open with the control mode of directory information.
For instance, close the line once to delete the file after reading and checking directory information, as follows;
1. Open with the control mode of directory information
2. Read directory information
3. Close the line
4. Open with the control mode of directory information
5. Delete a file
6. Close the line The same function can be instructed several times in one openning. (a) Reading directory information
G339 P1 Ff Ll Ss ; File directory information can be read to a specified variable by
specifying ”G339 P1”. Specify the file number(1-9999) for which the directory
information is to be read by address ”F”. Address ”L” specifies the head variable number of a continuous
17 variables which houses the read file name. The file name is read with decimalized ASCII code every character.
Address ”S” specifies the variable number which houses the read file size.
If you have specified (F specification) the file number once, the next directory information can be read by instructing ”G339 P1” without F specification.
End code =11 reports that the directory of the specified file number does not exist.
(b) Deleting a file (G339 P2)
G339 P2 Ll/Ff ; The relevant file can be deleted by the specification of ”G339
P2”. Specify the head variable number of the variable string which
houses the file name (ASCII code) you wish to delete by address ”L”, or specify the file number of the file you want to delete by address ”F”.
Be carefull when deleting with the file number because subsequent file numbers will change after deletion.
79
Page 88
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
(c) Changing the file name (G339 P3)
G339 P3 Ff Ll ; The recorded file name can be changed by the specification of
”G339 P3”. Specify the file number (1-9999) of the file name you wish to
change, by address ”F”. Specify the head variable number of the variable string that
houses the file name (ASCII code) to be changed, with address ”L”.
6.4.6
End Code (#8539)
Check the end code when G330-G339, has been instructed. There is no end code for line closing processing. It is always a normal end.
#8539 Contents
0 Normal end 1 Line doesn’t open 2 Line trouble ,DSR signal OFF 3 Line trouble, Over run 4 Line trouble, Receive buf fer over flow 5 Line trouble, Framing error, parity error 6 No option for line function 7 Line use 8 Error in parameter
G335 instructed with transmit control mode G336 instructed with read control mode
9 Data format error 10 Error on file number 11 File of file number specified to read directory information does not exist
115 Undefined variable number specified 255 Receive data does not exist
80
Page 89
B–61803E–1/07
6.5
REFERENCING AND READING NC PROGRAM WITH CONVERSATIONAL MACRO
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.5.1
Outline
Recording, deleting and changing of NC part program is possible by the conversational macro function. Control the NC program with program number and block number. The block numbers are counted on each EOB regarding the block with address ”O” being the No.1 block. For NC programs in the converational macro , one word is expressed by 2 variables of an address code and a number, and several words construct a block.
Set extension function valid (Parameter EXT1(No. 9002#7)) to ”1” at compiling when using this function.
Make the control instruction using G codes (G320-G329) in the conversational macro.
There is an end code #8529 to check that the instructed function run correcctly or not. Check end code after running G320-G329.
The end is normal when the end code #8529 is 0, and in the cases other than 0, the same number as the P/S alarm in the usual editing process will be notified.
Control variable
#8520 Specification of program number. . . .
#8521 Specification of block number. . . .
#8522 Specification of housed variable number. . . .
#8523 Variable number of a variable that specifies the number. . . .
of digits under a decimal point.
#8529 End code(for reading only). . . .
Control codes
G320 Record a new block. . . .
G321 Delete block. . . .
G322 Condensation of program. . . .
G325 Read specified block. . . .
G326 Write block. . . .
G327 Delete block. . . .
G328 Read a specified block coded in characters. . . .
G329 Write a specified block coded in characters. . . .
Background editing function as NC function is necessary for this function.
81
Page 90
6. FUNCTIONS OF THE MACRO EXECUTOR
6.5.2
Recording of a New Program
PROGRAMMING
G320 ;
Specify the program number to #8520 and instruct G320 to record a new program.
(Example)
To record O0002, #8520=2 ;
G320 ; IF[#8529 NE 0] GOTO 900 ; Recording end N900 ; Error
Conduct similar processing as the edit ”Oxxxx”+”INSERT” when recording a new program. EOB is not inserted.
O0002 %
B–61803E–1/07
6.5.3
Deleting a Program
6.5.4
Reading a Specified Block
G321 ;
Specify the program number and instruct G321 to delete a program.
(Example)
To delete O0003 #8520=3 ; G321 ; IF[#8529 NE 0] GOTO900 ; End of deletion N900 ; Error
(1) Reading a specified block coded in words (G325)
When issuing this command, specify a program number, block number, and the number of the variable into which the block is to be read. From the corresponding NC program coded in words, the corresponding block is read into the specified variable area. Each word contains two variables: an address code and numerical value.
(Example)
O0004 ; G92 X0. M08 ; G90 G00 X10.5 M05 ; #8520=4 ;
82
Page 91
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
#8521=3 ; #8522=100 ; G325 ; IF[#8529 NE 0] GOTO900 ; End of reading N900 ; Error
The following program data is loaded from #100 which is specified by variable number #8522, when the above instruction is executed.;
#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 the program or EOR position is specified with block number.
Reading is not conducted as the end code becomes ”255”
, if a block
No. exceeding the block of EOR is specified. (Example)
O0004 ; G92 X0. M08 ; M02 % #100=13 Address ”M” #101=2 Number #102=28 Address ”EOR”
(Example)
If O0004 ; G92 X0. M08 ; % #100=28 Address ”EOR”
If the function for reading a specified block coded in words (G325) reads a block which is not coded in words, completion code #8529 is set to 253 to indicate the fact.
When the completion code is set to 253, use the function for reading a specified block coded in characters (G328) to read the same block.
#8520 = program-number ; #8521 = block-number ;
83
Page 92
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
#8522 = number-of-the-variable-into-which-the-block-is-read ; G325 ; IF[#8529 EQ 253]GOTO100 ; Conventional processing N100 G328 ; Character-type analysis
(2) Reading a specified block coded in characters (G328)
When entering this command, specify a program number and block number. From an NC program which is not coded in words, the corresponding block can be read in units of characters into a specified variable area. The block is read in the form of decimal ASCII codes. Each control command (WHILE/IF/...) or function (SIN/COS/FUP/...) is represented as a single data item consisting of special code.
#8520 = program-number ; #8521 = block-number ; #8522 = 100 ;
(Number of the variable into which the block is read)
G328 ; IF[#8529 NE 0]GOTO900 ; Error check
When the corresponding block is ”#1 = SIN [#2];”
#100 : 35 (23H) ”#” #101 : 49 (31H) ”1” The data is input as shown on the left. #102 : 61 (3Dh) ”=” #103 : 276 (114H) ”SIN” #104 : 91 (5BH) ”[” #105 : 35 (23H) ”#” #106 : 50 (32H) ”2” #107 : 93 (5DH) ”]” #108 : 59 (3BH) ”;” ”EOB” code
6.5.5
Block Writing
(a) Writing a block coded in words (G326Pp)
Prepared program data can be written in the variable area after the block specified by the program number and block number. Specify the maximum number of variable data by address P. If address ”EOB” is present within the specified data, program is written up to ”EOB”; if ”EOR” is present, program is written up to the EOR; and if neither ”EOB” nor ”EOR” is present, program is written by the number of data specified by address ”P”.
(Example)
O0004 ; G92 X0. M08 ; G90 G00 X10.5 M05 ; #8520=4 ; #8521=2 ; #8522=100 ; #100=7 ;
84
Page 93
B–61803E–1/07
6. FUNCTIONS OF THE MACRO
PROGRAMMING
EXECUTOR
#101=1 ; #102=24 ; #103=20.5 ; #104=6 ; #105=1000 ; #106=20.7 ; G326 P7 ; IF[#8529 NE 0] GOTO900 ; End of writing N900 ; Error
If the above instruction is executed, 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 the specification of block number is EOR block only or higher numbers.
(1) Decimal point specification of every address in block writing
The number of digits after the decimal point of every address can be specified. With this specification, the contents of the variable number which was specified to #8523 becomes the number of digits after the decimal point of address A, and it is possible to determine the number of digits after the decimal point of every address, as shown below.
#8523=501 ; #501 is the number of digits after the decimal point of address A #502 is the number of digits after the decimal point of address B
:
: #525 is the number of digits after the decimal point of address Y #526 is the number of digits after the decimal point of address Z
Specify <vacant> or 0 - 7 for the number of digits after the decimal point. In the case of <vacant>, it is considered that no decimal point exists in the address.
(Example)
If address code=A, number=1.2345678 Decimal point specification
= <blank> A1 = 0 A1. = 1 A1.2 = 2 A1.23 = 3 A1.235
*
= 4 A1.2346 * = 5 A1.23457 * = 6 A1.234568 * = 7 A1.2345678
85
Page 94
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
* The data less than the specified digits is rounded off.
When #8523 is 0, auto setting is conducted by the system conditions (mm input/inch input, 0.1µm instruction) and specified address. #8520 - #8523 is set to 0 when the power is turned on.
(2) Writing a block coded in characters (G329Pp)
Use this command to write a program whose data is not coded in words. This command writes the program data coded in units of characters in a variable area.
The block to be written must be defined beforehand in ASCII code in a macro variable area. This command writes the data after the block specified by the program number and block number.
The maximum number of variable data items is indicated by address P . If EOB or EOR is detected while the specified variable data is being written, data writing ends at the EOB or EOR. When neither EOB nor EOR is found, the complete data indicated by address P is written.
(ASCII string definition)
#8520 = program-number
6.5.6
Block Deletion
#8521 = block-number #8522 = number-of-variable-at-the-beginning-of-the-ASCII-
string
G329 P20 ; IF[#8529 NE 0]GOTO900 ; Error check
NOTE
This command cannot catalog a program. If an attempt is made to catalog a program with this command (if the data to be written begins with O), an error code is indicated and #8529 is set to 202.
G327 ;
A block specified by a program number and a block number can be deleted.
#8520=4 ; #8521=3 ; G327 ; IF[#8529 NE 0] GOTO900 ; End of deletion N900 ; Error
The block of block No.3 of program O0004 is deleted by the above instruction.
86
Page 95
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.5.7
Condensation of Program
6.5.8
End Code (#8529)
When writing an NC program prepared by a conversational macro onto the NC’s tape memory, the program can be condensed to extend memory area.
Set a program number of a program to be condensed to the variable #8520 and specify G322. Then the program is condensed.
The result of condensation is informed to the end code #8529. (Example) To condense O1234
#8520=1234; G322; IF [#8529 NE 0] GOTO Error;
Check the end code after running every processing. The end is normal when the end code is 0, and when the end code is a
number other than 0, the same number as with the P/S alarm in the usual edition processing and the following codes are informed.
#8529 Contents
140 Processing of the program being selected in the foreground cannot be con-
ducted. 200 The specified character code is not found. (G329) 202 The data to be written begins with O. (G329) 253 The specified block is not coded in words. 254 Program editing is prohibited by setting the memory protection key [when
compilation parameter bit 1 of No. 9006 (KEYC) is set to 0]. 255 Need the option for background editing function.
It is impossible to instruct the statement during background editing.
Parameter for the extension function effective (No.9002#7 EXT1) must be
set to ”1” at compiling.
6.5.9
Notes
6.5.10
Address Code Table
Selection processing by work number search etc. is required when foreground operation is executed for a program which has been prepared and edited under background.
Address Code Address Code Address Code
A 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
EOB 27 EOR 28 / 29
87
Page 96
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
Statement Decimal Hexadecimal Statement Decimal Hexadecimal
IF 258 102H SIN 276 114H WHILE 259 103H COS 277 115H GOTO 260 104H TAN 278 116H
DO 261 105H ATAN 279 117H
END 262 106H SQRT 280 118H
GE 264 108H ABS 281 119H GT 265 109H BCD 282 11AH
LE 266 10AH BIN 283 11BH
LT 267 10BH FIX 284 11CH NE 268 10CH FUP 285 11DH EQ 269 10DH ROUND 286 11EH
XOR 272 110H POPEN 291 123H
OR 273 111H PCLOS 292 124H
AND 274 112H DPRNT 293 125H
BPRINT 294 126H
SETVN 295 127H
88
Page 97
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.6

CONTINUOUS INPUT BY CURSOR AND PAGE KEY

Continuous input by cursor and page key is possible with the conversational macro key input control (#8501).
(Address code table) #8501 can be read with the following timing if the cursor and page key,
are continuously pressed.
Page key ON
OFF
#8501=data
#8501=0
3232128 (MSEC)
NOTE
The value of #8501 remains as is until read by a macro statement. Once the value has been read, all key entries are ignored.
89
Page 98
6. FUNCTIONS OF THE MACRO EXECUTOR
PROGRAMMING
B–61803E–1/07
6.7
MASKING OF O, N NUMBER APPEARANCE
6.8
READING AND PRESETTING CUTTING TIME AND CUTTING DISTANCE BY CONVERSATIONAL MACRO
6.8.1
Reading and Presetting Cutting Time (#8553)
O, N number appearance can be erased on the CUSTOM screen. O, N numbers does not appear when compile parameter ”ONMSK=1”
(No.9003#0).
Cutting distance and cutting time can be read and preset with the macro variable of the conversational macro.
Use it for the control of a tool life. #8553, #8554 does not bocome 0 at power on.
The time only for instruction of G01 (linear interpolation) and G02,G03 (circular interpolation) can be counted by #8553.
The unit is the same as the macro variable (#3002).
6.8.2
Reading and Presetting Cutting Distance (#8554)
The distance only for instruction of G01(linear interpolation), and G02, G03 (circular interpolation) can be counted by #8554.
It is valid also for helical instruction. Parameters (No.9002#7 / EXT1) and (No.9004#7 / CUTLG) have to be
on at compiling to use this function. The unit is
... 0.001(mm) for the mm input system. ... 0.0001(inch) for the inch input system.
As the tool movement distance is added to #8554 at the time of starting the cutting block, the distance of block movement is added even when cutting stops during a block due to resetting, etc.
90
Page 99
B–61803E–1/07
PROGRAMMING
6. FUNCTIONS OF THE MACRO EXECUTOR
6.9

READING AND PRESETTING RELATIVE COORDINATES BY CONVERSATIONAL MACRO

6.9.1
Reading Relative Coordinates
Relative coordinates can be read and preset with the conversational macro.
Reading of relative coordinates can be informed by the window function. Set ID No.110-115 to #8993, and relative coordinates can be read by
#8999.
ID No. 110 1st axis coordinates
111 2nd axis coordinates 112 3rd axis coordinates 113 4th axis coordinates 114 5th axis coordinates 115 6th axis coordinates 116 7th axis coordinates 117 8th axis coordinates
(Example)
6.9.2 Presetting Relative Coordinates
If the relative coordinates value of the 1st axis is #8998=110; ((Include the contents of ID No.110) #500=#8999; Contents of #500 is -123456.
Relative coordinate values can be freely preset by G310AaQq. Set the ID No. shown above to address A.
A110 - 115
Set the coordinates values to be preset to address Q.
99999999 to 99999999
Q
Relative coordinate values can be preset freely by execution of this control.
(Example)
To preset the relative coordinates value of 1st axis to -123.45;
G310 A110 Q-123450
Be sure that this function does not change the increment system.
123.456
91
Page 100
6. FUNCTIONS OF THE MACRO EXECUTOR
6.10
KEY–INPUT AND DATA–INPUT CONTROL
PROGRAMMING
B–61803E–1/07
(1) Key-input control variable #8501
You can read out the key input with #8501. The following is the correspondence of the key input and #8501.
Display unit with seven soft keys
Key input Value Key input Value
PAGE.DOWN 1 SOFT FUNCTION KEY LEFT 11 PAGE UP 2 SOFT FUNCTION KEY 1 12 CURSOR DOWN 3 SOFT FUNCTION KEY 2 13 CURSOR UP 4 SOFT FUNCTION KEY 3 14 ALTER 5 SOFT FUNCTION KEY 4 15 INSERT 6 SOFT FUNCTION KEY 5 16 DELETE 7 SOFT FUNCTION KEY RIGHT 17 INPUT 8
RESET 10 CURSOR RIGHT 18 CURSOR LEFT 19
Display unit with twelve soft keys
The soft function keys follows: The other keys are the same as seven softy keys.
Key input Value Key input Value
SOFT FUNCTION KEY LEFT 20 SOFT FUNCTION KEY 1 21 SOFT FUNCTION KEY 2 22 SOFT FUNCTION KEY 3 23 SOFT FUNCTION KEY 4 24 SOFT FUNCTION KEY 5 25 SOFT FUNCTION KEY 6 26 SOFT FUNCTION KEY 7 27 SOFT FUNCTION KEY 8 28 SOFT FUNCTION KEY 9 29 SOFT FUNCTION KEY 10 30 SOFT FUNCTION KEY RIGHT 31
When there is no key input, the #8501 value is 0. Once there is a key input, #8501 holds its value till it is input with the
macro statement, and the following key inputs will be ignored. When #8501 is input, the status gets ready to accept the key input and #8501 will be 0.
It is impossible to write a value into #8501.
(2) Data input control variable #8502, numerical data variable #8503,
address data variable #8504 Control the input of numeric data and address data by setting the
following values to #8502. #8502 = 0 ...No data input
= 1 ... Input of numeric data = 2 ...Input of address data and numeric data = 3... Expanded data input control
When #8502 is 0, nothing will be displayed on the data input line and it will be impossible to input data, either.
When #8502 is 1, NUM will be displayed on the data input line and input of numeric data will be possible. When #8502 is 2, ADRS will be displayed on the data input line. After address data is input, NUM is displayed and it is possible to input the numeric data. #8502 value is 0 at switching on the power.
92
Loading...