Archive for September, 2017

only two selections and counting starts from zero

r – ‘bi nary’ means based on only two selections and counting starts from zero, not from one, to the left)


In each avail able bit, the set ting can be ei ther 0 or 1, de pend ing on whether the mir ror im age is


cur rently dis abled or en abled:


u


0 = Mirror image function for the selected axis is disabled


CNC busbar Machine


u


1 = Mirror image function for the selected axis is enabled


Variable #3007 cannot be written to – it is a read-only variable


As usual in this type of vari ables, it is the log i cal sum of the cur rent sta tus (sum of bits) that de –


ter mines the sta tus of all axes, there fore the re turn value of the sys tem vari able #3007 The re –


turn value of vari able #3007 will be the sum of all bits; it is im por tant to know how to in ter pret


this re turned value cor rectly In ci den tally, this 鈥榮um of bits锟?is quite com mon in pro gram ming,


and re quires at least the ba sic knowl edge of the bi nary num ber sys tem (see Chap ter 4)


Interpreting System Variable #3007


For the ex am ple, the com mon mir ror im age set ting in ma chine shop ap pli ca tions will be used


This set ting ap plies to the first two axes only (typ i cally the X-axis and the Y-axis) of a typical


CNC ma chin ing cen ter To find out what the sta tus of the cur rent mir ror im age set ting is, eval u ate


the fol low ing ex am ple – Dished Head Punching Machine read ing it twice may help:


Copyright 2005, angle shearing machine Industrial Press Inc, New York, NY – wwwindustrialpresscom


FANUC CNC Custom Macros


AUTO MODE OPERATIONS


201


2 Example – #3007 reads 3 – Active mirror image is in the X and Y axes


Why? When the sys tem vari able #3007 is equal to 3 (re turned value is #3007 = 3), the cur –


rently mir rored axes are the first two axes in the chart, the X-axis and the Y-axis Angle Punching This out come


can only be known by the in ter pre ta tion of the re turned value, stored in sys tem vari able #3007


To in ter pret the re turned value, step through a small step-by-step pro ce dure The step one is to


sub tract the larg est bit value pos si ble from the value stored i

mirrored From these examples and with a little

mirrored From these examples and with a little


knowl edge of bi nary num bers, there should be no prob lem to ead- to in ter pret – other re turned


val ues of the sys tem vari able #3007


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


202


Chapter 16


Controlling the Number of Machined Parts


copper cutting Machine


There are two more sys tem vari ables that re late to auto mode op er a tion Two sys tem vari ables,


#3901 and #3902 con trol the count ing of ma chined parts dur ing an au to matic op angle machine er a tion


They are:


#3901


Number of parts completed (machined)


#3902


Number of parts required


Sys tem vari able #3901 is used for the num ber of parts ma chined The value of this vari able


stores the num ber of com pleted parts


Sys tem vari able #3902 is used for the num ber of parts re quired The value of this vari able


stores the num ber of re quired parts (the tar get num ber)


Both vari ables can be used to write to or to read from (read/write type) A neg a tive value should


not be used with these vari ables in mac ros (con sider us ing the ABS func tion)


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


FANUC CNC Custom Macros


EDITING MACROS


17


Cus tom Dished Head Punching Machine macro files are of ten loaded from an ex angle shearing machine ter nal com puter to the CNC sys tem mem ory


Long or com plex mac ros are better ed ited in the com puter file, then re loaded to the con trol sys tem


later There are also many cases where this method may not be con ve nient, for ex am ple when the


mac ros are very short or when ed it ing ex ist ing mac ros, al ready loaded in the sys tem In such


cases, macro state ments can also be in put through the con trol panel key board, right at the CNC


ma chine There is not much of a dif fer ence in ed it ing mac ros than ed it ing con ven tional CNC pro –


grams – they are ed ited by words; for ex am ple, to change the word X-123456 to X123456, the


whole word has to be al tered (ed it ing of in di vid ual char ac ters is not nor mally pos si ble

that has been stored in the control memory can be edited by moving the cursor

on most


con trols) Macro pro grams are en machine bending tered and/or ed ited by spe cial ed it ing units


Editing Units


A macro that has been stored in the control memory can be edited by moving the cursor to any


busbar saw Machine


ed it ing unit that starts with the fol low ing char ac ter or sym machine bending bol:


u


Address (alpha character of a word, for example X, Y, Z)


u


Number symbol # at the left side of the = sign


u


First character of IF, WHILE, GOTO, END, DO, POPEN,


BPRNT, DPRNT and PCLOS


u


Symbols /, (, =, and ;


Program Comments


In a pro gram, com ments, mes sages and alarm in di ca tors aimed at the ma chine op er a tor, are


placed within the body of the pro gram, us ing pa ren the ses (not brack ets) For ex am ple, a mes sage


to the op er a tor used with the mis cel la neous func tion M00 may read:


N34 M00 (CHECK THE DEPTH OF POCKET)


An ex am ple of a user gen er ated alarm could be


N1001 #3000 = 118 (RADIUS TOO LARGE)


When en ter ing a com ment or a mes sage from the con trol key board, look for two char ac ters


The con trol-out char ac ter ‘(‘ and the con trol-in char ac ter ‘)’ must be avail able on the key board


203


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


FANUC CNC Custom Macros


204


Chapter 17


Not all Fanuc mod els have these char ac ters on the keyboard For ex am ple, some ear lier types


of Fanuc 16 do not have the two char ac ters on the key board, but do have it avail able as a softkey


se lec tion If the con trol sys tems al lows mes sages of any kind to be used, it may be con ve nient to


type them (with the rest of the pro gram) on an ex ter nal com puter, and load them via a ca ble from


the com puter to the CNC unit


Abbreviations of Macro Functions


Many macro func tions are spe cial Angle Punching words (called func tions) of more than two or three char ac –


ters Dur


ing a key


board in


put of these char


ac


ters, ex


tra time is needed to en


ter the whole


multi-character words, of ten with the fre quent use of the Shift key Fanuc of fers a two-character

converted to decimal values

converted to decimal values


Mirror Image Status Check


Mir ror im age is gen er ally a ba sic fea ture of most CNC ma chin ing cen ters and even some CNC


lathes Its main pur pose is to re verse the di rec tional sign of the spec i fied axis, ei ther the X-axis,


the Y-axis, or both the XY-axes on CNC ma chin ing cen ters, and the X-axis on CNC lathes In ad –


di tion, the axis re ver sal may cause not only the change in the axis-mo tion di rec tion, but also the


copper busbar Machine


change in the arc di rec tion (CW vs CCW), and the cut ter ra dius off set It is the cut ter ra dius off –


set that is most crit i cal, not the other fea tures Machinability of the part ( climb mill ing vs con ven –


tional mill ing) may also be af fected


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


200


Chapter 16


In the mac ros, the sta tus of the mir ror im age can be mon i tored for each axis individually This


macro fea ture is called the mir cnc equipment ror im age check sig nal At any time dur ing the macro pro cess ing,


the macro can in quire as to the sta tus of the cur rent set ting of the mir ror im age The re sult of the


in quiry is a bi nary value re ceived and con verted into a dec i mal for mat


On most Fanuc con trols, the sys tem variable that stores the mir ror im age re lated in for ma tion is


#3007 ( bit type) – note the de tails of angle shearing machine bits eval u a tions:


8th axis


7th axis


6th axis


5th axis


4th axis


3rd axis


2nd axis


1st axis


27


26


25


24


23


22


21


20


128


64


32


16


8


4


2


1


This typ i cal sta tus shows up to eight axes In prac tice, how ever, only the first two axes will prob –


a bly used most of ten – the X and the Y axis (com monly the 1st and the 2nd axis) on a CNC ma Angle Punching


chin ing cen ter Some older con trols may have fewer than eight axes avail able un der the vari able


#3007 The first line of the ta ble is the axis de scrip tion, the sec ond line is the axis iden ti fi ca tion –


the third line con tains the bi nary equiv a lent of each bit (re mem be

the #3007 variable In this particular case

 the #3007 variable In this particular case, the largest bit value that can be Drilling Machine for Plate sub tracted from 3 is 2 The num ber 2 is de fined as the


Y-axis, so the Y-axis is cur rently mir rored The step two is to sub tract the new value ( cal cu lated as metal hole punch machine 2 in the ex am ple ) from the value of vari able #3007 (= 3 in the ex am ple):


busbar sawing Machine


3 – 2 = 1


Since the re sult ing num ber 1 is re lated to the X-axis, it means the X-axis is mir rored as well


But – there still is the step three to do – to see what all other axes are there to cal cu late Take the re sult ing num ber that is 1, and sub tract one from it, 1 – 1 = 0, so there are no more axes to con –


sider In the fi nal eval u a tion, if #3007=3, both axes are mir rored The same method can be


shown in three sim pli fied steps:


o


Given:


#3007 = 3


Largest bit value that can be subtracted from 3 is 2


o


Step 1


The number 2 is defined as the Y-axis, so Y-axis is mirrored


o


Step 2:


3 – 2 = 1


The number 1 is defined as the X-axis, so X-axis is mirrored


o


Step 3:


1 – 1 = 0


No other axis is mir rored


2 Example – #3007 reads 2 – Active mirror image is in the Y axis only


In this case, the sys tem vari able #3007 is equal to 2 (re turned value is #3007 = 2), the cur –


rently mir rored axis is the Y-axis The in ter pre ta tion is the same as be fore:


o


Given:


#3007 = 2


Largest bit value that can be subtracted from 2 is 2


o


Step 1


The number 2 is defined as the Y-axis, so Y-axis is mirrored


o


Step 2:


2 – 2 = 0


No other axis is mirrored


2 Example – #3007 reads 1 – Active mirror image is in the X axis


In this last case, the sys tem vari able #3007 is equal to 1 (re turned value is #3007 = 1), the


cur rently mir rored axis is the X-axis The in ter pre ta punching machine tion is the same as be fore:


o


Given:


#3007 = 1


Largest bit value that can be subtracted from 1 is 1


o


Step 1


The number 1 is defined as the X-axis, so X-axis is mirrored


o


Step 2


1 – 1 = 0


No other axis is mirrored


If #3007 = 0, there are no axes that are