Machinery's Handbook, 31st Edition
1356 CNC PROGRAM STRUCTURE comments are an excellent way to inform the machine operator about key issues relating to the job at hand. Typical comments should be in capital letters (for best compatibility between programs) and contain a short message, description, or caution. Comments may be used as separate blocks or at the end of a block—for example, both the following comments are valid: Comment as a whole block: (CHECK HOLE DEPTH) Comment as part of a block: N55 M00 (CHECK HOLE DEPTH) Program Number (O-address): In most cases, a program number can be assigned at the machine, by the CNC operator. Only special program numbers can be selected by the pro grammer, typically, for subprograms. Program number requires the letter “O” to be fol lowed by four or five numeric digits (O1 to O9999 or O99999), depending on the control. Block Number (N-address): One or more instructions can be programmed in a single program sequence (block). A typical program may only require a very small number of blocks for a simple machining job, but—literally—hundreds or thousands of blocks for complex work. To distinguish one instruction (one block) from another, a simple number ing system can be used for each block sequence. Depending on the control system, the block numbers can be ascending, descending, or even mixed. Most control systems offer all these options, and it is up to the programmer to choose the most advantageous ones. The address “N” is used for block numbering. The smallest block number is N1 (N0 is usually not allowed), the largest is either N9999 or N99999, depending on the control system. Block numbers can be used for each program sequence, or they can be used selec tively, to enable more efficient search. A forward slash symbol “/” placed in front of the N-address identifies a block that can be selectively skipped during processing. This block skip function is activated or deactivated from the operation panel of the CNC machine. Preparatory Commands (G-address, G-codes): Preparatory commands are commonly known as G-codes. The address “G” identifies a preparatory command, which has one and only objective—to preset or to prepare the control system for a certain desired condition, or to a certain mode or a state of operation. For example, the address G00 presets (prepares or selects) a rapid motion mode, G01 selects a linear motion, G81 selects the drilling cycle, etc. The term preparatory command indicates its meaning—a G-code will prepare the control to correctly interpret the programming instructions following the G-code in a specific way. Standard G-codes are programmed in the range of G00 to G99, although not all numbers are available. G-codes with three digits usually apply to special machine functions provided by the control manufacturers. Most—but not all—of G-codes are standard for various controls, and most—but not all—are modal . A modal G-code in one that is programmed only once and remains in effect until changed or canceled. Non-modal G-codes have to be repeated anytime they are used. On the majority of controls, one or more G-codes can be programmed in a single block, providing there is no conflict between them. It is customary to program a G-code or G-codes at the beginning of the block, after the sequence number. Table 1. Typical Turning G-Codes G-Code Description G -Code Description G00 Rapid positioning G57 Work coordinate offset 4 G01 Linear interpolation G58 Work coordinate offset 5 G02 Circular interpolation clockwise G59 Work coordinate offset 6 G03 Circular interpolation counterclockwise G61 Exact stop mode G04 Dwell (as a separate block) G62 Automatic corner override mode G09 Exact stop check—one block only G64 Cutting mode G10 Programmable data input (Data setting) G65 Custom macro call G11 Data setting mode—cancel G66 Custom macro modal call
Copyright 2020, Industrial Press, Inc.
ebooks.industrialpress.com
Made with FlippingBook - Share PDF online