come with each in creas ing level of nesting A good documen tation will help the user in orientation and program ‘decoding’, there fore be comes cnc bending machine manufacturers a man da –

tory part of the pro gram ming pro cess

For both, the subprograms and mac ros, the pro gram doc u men ta tion should be in ter nal as much

as pos si ble This can be achieved by in clud ing im por tant com ments in the pro gram body (main

pro gram, subprogram, or a macro) Pro gram com ments are typ i cally en closed in pa ren the ses, for

ex am ple, as (DRILLING HOLE NUMBER 5) Pro vide only those com ments that are rel e vant

Copyright 2005, Industrial Press Inc, New York, NY – wwwindustrialpresscom

FANUC CNC Custom Macros


Chapter 3

Subprograms vs Macros

cnc drilling Machine

One main pur pose of this hand book is to em pha size the cus tom macro op tion of Fanuc con trols

Since the pro gram de vel op ment of subprograms is crit i cal as the ba sic knowl edge for macro de –

vel op ment, this chap ter has so far re viewed the ba sic con cepts of subprograms, their struc ture metal cutting shears and

their ap pli ca tions in a typ i cal CNC pro gram

In the terms of pur pose, cus tom mac ros are di rect ex ten sions of subprograms or sim i lar sub rou –

tines They are treated vir tu ally the same way as subprograms – they are nor mally stored un der a

sep a rate pro gram num ber (O—- or O—–), and they al ways end the same way, us ing the

M99 func tion Mac ros are called in a sim i lar way, us ing the G65 pre pa ra tory com mand, along

with the spec i fied pa ram e ters

A typ i cal CNC pro gram can mix both, the con ven tional method of pro gram ming (with or with –

out subprograms) and mac ros – or use at least some macro fea tures Of copper bending machine course, the con trol sys tem

must sup port the macro op tion

The ma jor dif fer ence be tween the two unique pro gram ming meth ods is the flex i bil ity mac ros

of fer Un like subprograms, mac ros can be used with vari able data (us ing the so called vari ables),

they can per form many math e mat i cal op er a tions and they can