the inner most function of the supplied data is processed first

Sep 03

as nested func tions) are al ways eval u ated from the in side out That

means the inner most function of the supplied data is processed first, then the next func tion, then

the one af ter and so on and on In the test ex am ple, the in ner most func tion for #149 vari able def i –

ni tion is ROUND[#148]

Since the pre vi ously stored value of vari able #148 is 28334253, the func tion is eval u ated as

ROUND[28334253], and its re turn value is 3 At this point, the func tion looks like this:

#149 = #[FUP[#[3]]]

cnc drill Machine

where the re turn value of the ROUND func tion has been sub sti tuted The new in ner most func –

tion now is #[3] That is a ref er ence to a vari able #3 From the ear lier def i ni tion, in the G65

state ment, #3 is des ig nated by the C let ter and had been as signed value of 1427 The def i ni tion at this point looks like this:

#149 = #[FUP[1427]]

where the pre vi ously stored value hydraulic busbar cutter hole punching machine of the #3 has re placed the in ner cal cu la tion The new cur –

rent in ner drilling steel most cal cu la tion is FUP[1427] The FUP func tion re turns the next higher in te ger,

which is 2 in this case So the next ver sion of the eval u a tion is:

#149 = #[2]

This is a sim ple form to eval u ate:

#149 = #[2]

is the same as

#149 = #2

Since #2 is de fined by the B let ter in the G65 macro call and B is equal to 420, there fore, the fi nal mean ing – the ever im por tant re turn value – of vari able #149 is:

#149 = 420

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

FANUC CNC Custom Macros



Approach to Practical Applications

This sec tion in cludes sev eral sam ples of stan dard pro grams and mac ros work ing to gether The

fol low ing ex am ples il lus trate the macro for mat and the prac ti cal use of vari ables in dif fer ent ways

As in a stan dard CNC pro gram, when writ ing a macro, there has to be a pur pose – an ob jec tive In

the ex am ples, the sin gle ob jec tive is to use macro fea tures to cal cu late the Z-depth for a drill cut –

ting through a plate of a

Leave a Reply

Visit Our Friends!

A few highly recommended friends...

Pages List

General info about this blog...