(Part A) Machinerys Handbook 31st Edition Pages 1-1484

Machinery's Handbook, 31st Edition

1378 CNC SUBROUTINES AND MACROS Any subprogram has to have a number (for example O6001), in the same format as the main program (or other program of origin). The end of subprogram uses the M99 function, which transfers the processing put of the subprogram back to the program of origin. Another miscellaneous function—M98—is used to call a previously stored subprogram, for example M98 P6001. The address O is used for storing the subprogram, address P is used for calling the subprogram. If required, a subprogram can be repeated, up to 9999 times. That is achieved in three ways, depending on the control system: Method 1: M98 P6001 L5 will repeat subprogram O6001 five times Method 2: M98 P6001 K5 will repeat subprogram O6001 five times Method 3: M98 P00056001 will repeat subprogram O6001 five times Subprograms can be nested. Nesting is a feature that allows one subprogram to call another subprogram up to four levels deep. In the example of a simple subprogram application Fig. 30, a complete toolpath is devel­ oped for one pocket, stored as a subprogram, and called at the equivalent location of the three remaining pockets. Typical programming methods will use a incremental method of dimensioning.

Fig. 30. Typical Subprogram Application. Macros and Parametric Programming.— In this general introduction to the subject of mac- ros and parametric programming, the most common development tool is known as Fanuc Custom Macros B. In spite of the great advancement of CAD/CAM software, macros still have their special place. In addition to manual or computer assisted programming., macros are used to provide a special solution to a special requirement. Macro programming is a method using variable data is a special subprogram (now called a macro), with actual values defined in the main program. This method provides a single ‘master’ program that can be used many times with different numerical values. A typical example is a bolt circle, where only a few values change. The main purpose of a macro program is to save programming time. Basic Macro Skills.— Depending on the complexity of the macro to be developed, some basic knowledge and skills are required. The following list identifies the most important items:

Copyright 2020, Industrial Press, Inc.

ebooks.industrialpress.com

Made with FlippingBook - Share PDF online