A special type of user-defined cycles is called macros which are generic cycles with parametric variables.
MACROS A special type of user-defined cycles is called macros which are generic cycles with parametric variables. It would be used where certain motion sequences would be repeated several times within a program. It is used to reduce the total number of statements required in APT program. The macro is called from the main program with a set of numerical values for these variables. It allows to use one and the same macro to machine different in sige but it is similar in shape components. Programming with macros is often referred as a parametric programming. Macros are blocks of code that use any of the logical features such as variables, decision structures, or functions. It provides the user with some flexibility and automation through the use of variables, loops and decision structures. Macro is a programming concept used (i) to program (ii) to store (iii) to recall, and (iv) to execute automatic cycles and family of programs. The features of macros are as follows: (i) Variables are allowed. (ii) Mathematical operations +, -, ×, ÷ are possible. (iii) Interrupt control can be done. Macro is mainly useful where there is a need to produce similar components with different sizes or variables. For example, a place which manufactures components those vary only in length or size of the holes. An example for the situation where the macro is useful is given in Figure 5.61. The rail A has 5 post holes and rail B has 11. In this case, one program can be written to drill a set of both holes. The operator would simply change the variables to match the customer's requirement. Programming structure in Macro: The macro can be called using a G65 command. The basic syntax and use of the G65 are as follows: 00005 (Main program) N1 G21 (Startup block) ..... ..... N100 G65 L1234 F150.0 (Call of macro 01234 with F argument = variable #9) ..... ..... N150 M30 (End of main program) 01234 (Start of macro program) ..... ..... N25 G01 X150.0 Y200.0 F#9 (variable #9 applied to feedrate) ..... ..... ..... M99 (End of macro program)
Manufacturing Technology: Unit V: Programming of CNC Machine Tools : Tag: : Programming of CNC Machine Tools - Manufacturing Technology - macros
Manufacturing Technology
ME3493 4th semester Mechanical Dept | 2021 Regulation | 4th Semester Mechanical Dept 2021 Regulation