local to the program that called them We use local variables

local to the program that called them We use local variables


to as sign val ues to macro pro gram ar gu ments Lo cal vari ables are also used for a tem po rary stor –


age within the macro body, dur ing cal cu la tions of for mu las and other ex pres sions


In ad di tion to the G65 command, there are also pre pa ra tory com mands G66, G661, and G67, all re lated to mac ros The G65 com mand cnc cutter is most sig nif i cant of them and is cov ered here in depth


93


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


FANUC CNC Custom Macros


94


Chapter 8


Clearing Local Variables


CNC Plastic plate drilling machine


Lo cal vari ables are nor mally cleared (made va cant) by an in ter ven tion from the con trol panel


(usu ally done by the CNC op er a tor), or a pro gram code (usu ally done by the CNC pro gram mer)


Each of the fol low ing hydraulic busbar cutter ac tions will clear the lo cal vari ables and sets them to null:


o


Pressing the control RESET key will set all local variables to null


o


Pressing the external RESET key will set all local variables to null


o


Pressing the EMERGENCY switch will set all local variables to null


o


Programming code M30 custom processing machine (program end) will set all local variables to null


o


Programming code M99 (subprogram end) will set all local variables to null


Any lo cal vari able can be cleared by these means, but it can also be cleared in a macro pro gram,


if re quired In the macro state ment, it must be as signed the value of #0 Some man u als re fer to the pro cess of clear ing vari ables in a pro gram as a pro cess of purg ing vari ables, with the same mean –


ing This ex am ple il lus trates the clear ing (purging) pro cess of lo cal vari ables in a pro gram:


#1 = 1350


Sets a value of variable #1 to 1350


G00 X#1


Uses variable #1 in the macro (X will be equal to X1350)


#1 = #0


Sets #1 variable to #0 (null) – it holds no value – it is called


an empty or null or vacant variable – with the same meaning


A null vari able is always iden ti fied as #0, never as a 0 only !


Assigning Local Variables

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>