Posts Tagged ‘value’

variable a value required at the time of call From the example

variable a value required at the time of call From the example, it is evident


that cus tom macro call G65 is only sim i lar to, but def i nitely not the same as, the subprogram call


M98 When two dif fer ent calls (M98 and G65) of a pre vi ously stored re pet i tive pro gram are com –


pared, there are sev eral very im por tant dif fer ences:


u


In the G65 command, argument is passed to the macro in the form of variable


data In M98 only the subprogram can be called No data passing is possible


u


In a subprogram call M98, the block may include another data ( ie, a motion to a


tool location) In this case, the processing can be stopped in a single block


mode This is not possible in the G65 mode


u


CNC Steel Structural Drilling Machine


In a subprogram call M98, the block may include another data ( ie, a motion to a


tool location) In this case, the processing of the macro starts only after the


other data is completed The G65 copper hole punching machine busbar bending machine command calls a macro unconditionally


u


Local variables are not changed with M98 but they are changed with G65


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


FANUC CNC Custom Macros


78


Chapter 6


Vi sual Rep re sen ta tion


Fig ure 16 shows a sche matic rep re sen ta tion of a macro def i ni tion and a macro call Note that the gen eral struc ture is iden ti cal with the one shown ear lier (Fig ure 4) – a sin gle level subprogram


nest ing struc ture


START


Figure 16


Macro definition and


O0001


O8001


macro call


(MAIN)


(MACRO)


Basic structure


G00 X#1 Y#2


G65 P8001 A1200 B800


M30


%


M99


%


END


In the main CNC pro gram, the macro call com mand G65 P8001 re trieves pre vi ously stored


macro O8001 and passes two ar gu ments to the macro – ar gu ment A and ar gu ment B Ar gu ment A


passes the cur rent value of 1200 best mill drill to the macro O8001, ar gu ment B passes the cur rent value of


800 to the same macro


Ar gu ments A and B have fixed vari able num bers as signed to them (see Chap ter 8 for de tails)


By def i ni tion, vari able #1 is as signed to ar gu ment A, vari able #2 is a