ke ad van tage of it When a macro is

Sep 04

ke ad van tage of it When a macro is

called, any cur rent modal com mand should al ways be reg is tered at the be gin ning of the macro, if

that is not the case, then def i nitely be fore any changes are made within the macro

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

FANUC CNC Custom Macros


busbar Machine

Chapter 12

Restoring Modal Data

Since the orig i nal G-code(-s) have been stored for the sin gle rea son of re stor ing them later, they

have to restored be fore the macro ends, typ i cally at the end, just angle machine be fore the M99 func tion Us ing

two sys tem vari ables introduced in the pre vi ous ex am ple, here is a sche matic lay out of a macro

pro gram structure, show ing both the stor age and the res to ra tion of two modal val ues:


#31 = #4201

Store the current motion command

#32 = #4203

Store the current dimensioning mode

G90 G00 G54 X1500 Y750

< macro processing 锟?>

G#31 G#32

Restore both previously saved modes



In the automatic punching machine ex am ple segment, the vari ables #31 and #32 store the cur rent val ues of the mo tion and

dimensioning modes, at the very be gin ning of the macro The macro then pro ceeds with its own

def i ni tions, G-code changes, and so on, and be fore the macro end (be fore M99), the orig i nal val –

ues, the pre vi ously stored val ues, are re trieved to be come modal af ter the macro ex its Since both

of the pre vi ously stored val ues rep re sent modal com mands, the pro gram ming re turns from the

macro to the same en vi ron ment that ex isted be fore the macro was called Log i cal method of num –

ber ing sys tem vari ables will be also ap plied to the other modal codes

Other Modal Functions

In punching machine ad di tion to the modal G-codes, there are ad di tional eleven modal codes used in typ i cal macro

pro gram ming Just like the G-codes, in a macro cal cu la tion (or a for mula), these pro gram codes

can not be pro grammed to the left side of the equal sign, which means they can not be as signed

value through the pro gram T

Leave a Reply

Visit Our Friends!

A few highly recommended friends...

Pages List

General info about this blog...