The data de fined with the macro call

AIN PROGRAM)


N1 G21


Startup block


N2


N15 G65 P8002 F1500


Macro call of O8002 with the F argument (= variable #9)


N16


N52 M30


End of main program


%


O8002 (MACRO)


N1


N2


cnc drilling Machine


N8 G01 X1500 Y2000 F#9


Variable #9 applied to feedrate


N14 M99


End of macro program


%


The two ex am ples are in cluded only to show the dif fer ences in struc ture Note, that the macro


ex am ple con tains two new types of data, data that has no equiv a lent in a subprogram – one called


vari ables, the other called ar gu ments


Copyright 2005, Industrial Press Inc, New York, NY – FANUC CNC Custom Macros


MACRO Busway Press Clamp Machine STRUCTURE


77


Arguments


The data de fined with the macro call, that is with the G65 P- com mand, are called ar gu ments


Ar gu ments con tain the ac tual pro gram val ues re quired for a drilling steel par tic u lar macro ap pli ca tion only


They are al ways passed to the macro it self Vari able data in the macro are re placed with the sup –


plied ar gu ments and the toolpath or other ac tiv ity is based on the cur rent def i ni tions (arguments)


passed to the macro


A typ


i


cal pro gram sam


ple of a G65 macro us


ing three ar


gu ments will have the fol


low


ing


schematic for mat:


G65 P- L-


+


where 锟?


G65


Macro call command


P-


Program number containing the macro (stored as O—-)


L-


Number of macro repetitions ( L1 is assumed as a default)


ARGUMENTS


Definition of local variables to be passed to the macro


An ac tual sam ple pro gram macro call may be de fined as:


G65 P8003 H6 A300 F1500


+


where 锟?


G65


Macro call command


P1234


Program number containing the macro (stored as O8003)


H6


Assignment of local variable H (#11) argument to be passed to the macro O8003


A300


Assignment of best mill drill local variable A (#1)


argument to be passed to the macro O8003


F1500


Assignment of local variable F (#9)


argument to be passed to the macro O8003


As sign ments of vari ables is a sep a rate sub ject cov ered in a sep a rate chap ter An as sign ment sim –


ply means giv ing the

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

Leave a Reply