es as to what is al lowed and what is not, what is le git i mate en try and what


is not – with explanations


Restrictions


Pro gramming in any lan guage has to ad here to a num ber of very strict rules and re stric tions im –


posed by the lan guage de vel op ers for many good rea sons Pro gram mers must fol low the rules,


con di tions and re stric tions that ap ply to the lan guage used Al though not strictly a lan guage,


Fanuc mac ros are no dif fer ent in this re spect In cor rect use of the macro tools can cause a sys tem


er ror (alarm) – it can also cause an un punch machine for Head wanted re sult, even dan ger ous sit u a tions


The fol low ing con di tions and re stric tions ap ply to all Fanuc cus tom macros, with some typ i cal


ex am ples shown for each item – the first col umn spec i fies the state ment, er ror or re stric tion, the


sec ond col umn pro vides con di tion or ex am ple:


Colon character


:


drilling Machine


Colon character is not allowed


Semicolon character


;


Semicolon character is not allowed


Zero value is neutral


(neither positive nor negative)


+0 or -0 cannot be identified


Leading zeros are ignored


#1 = 003 is the same as #1 = 3


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


CONCEPT OF VARIABLES


91


Program number as an EIA identification


address O cannot be used with a variable


O#1 is not allowed


Program number as an ISO identification


address : cannot be used with a variable


:#1 is not allowed


Block number identification address N


cannot be used with a variable


N#1 is not allowed


Block skip identification address /


(slash symbol) cannot be used with a variable


/#1 is not allowed


Maximum value of an address


If


cannot be exceeded


#1=1000


then G#1 is not allowed


Brackets for a single variable


will be ignored


#[7] is the same as #7


One variable cannot replace another


variable directly Hydraulic punching machines – example 1 – incorrect


# #7 is drilling tools not allowed


One variable cannot replace another


variable directly – example 2 – incorrect