ariable data in its memory The non-holding group is re tained

ariable data in its memory The non-holding group is re tained until the system is re Drilling Machine for Plate started, the hold ing group is re tained un til re moved by a pro gram Com mon vari ables are not cleared by M99 or M30 func –

tions Study the same ex er cise – this ver sion uses macro call and com mon vari ables

2 Example 5 Revisited

The main pro gram O0017, is the one that calls the macro pro gram O8005, and passes the re –

turned val ues of any de fine vari able to the macro body That way, the con tents of macro pro gram

will never change, angle machine only the vari able data sup plied to it by the main pro gram (G65 macro call)

CNC Beam Drilling Machine


N1 G21

N2 G90 G00 G54 X1000 Y500 S800 M03

N3 G43 Z50 H01 M08

N4 G65 P8005 D150 T130 A1180 C15

Macro call block with arguments

N5 G99 G81 R25 Z-[ABS[#100]] F1500

Distance-to-go is Z-215

N6 G80 Z50 M09

N7 G28 X1000 Y500 Z50 M05

N8 M30


The as so ci ated macro O8005 is short and sim ple – it only con tains the for mula it self, this time

us ing the vari able automatic punching machine as sign ments match ing those that are called by the G65 macro call:


#100 = #7/2*TAN[90-#1/2]+#20+#3



The for mula built into the macro is iden ti cal to the for mula used in pre vi ous ex am ples The only

items that change are the call ing pa ram e ters – the in put val ues – in the G65 block:

D = #7 = 150, A = #1 = 1180, T = #20 = 130, and C = #3 = 15

The ad van tage of this method is that macro pro gram O8005 can be used for any job, pro vid ing

the def i ni tion of ar gu ments is de fined con sis tently In the ex am ples, a sin gle ob jec tive has been

achieved by sev eral meth ods, some very sim i lar

Speeds and Feeds Calculation

An other ex am ple of using com mon vari ables is for cal cu la tions of the spin dle speed and the cut –

ting feedrate, us ing for mulas For mulas are used in mac ros quite of ten, be cause their in put can

eas ily be re placed with vari ables Based on stan dard ma chine shop for mu las, many related values

can be cal cu lated, us ing

You can leave a response, or trackback from your own site.

Leave a Reply