All given conditions must be true

All given conditions must be true,


for the whole condition to be true


u


OR


Only one given condition must be true,


for the whole condition to be true


drilling Machine


XOR


Also, there is the third func tion – the XOR ( ex clu sive OR) – func tion, but that is quite dif fi cult to un der stand at the mo ment, and is very sel dom used in a nor mal macro work


When you eval u ate a com bined con di tional state ment, al metal hole punch machine ways ask the ques tion o the con di –


tions have to be true ALL at the same time If the an swer is Yes, use the AND angle machine func tion, oth er wise use the OR func tion The for mat of in put of these func tions into a macro has al ready been de –


scribed ear lier The AND and the OR func tions are typ i cal Bi nary Func tions, be cause their re turned value can only have two states – ei ther TRUE or FALSE


Al though not al ways nec es sary, un der stand ing the Bi nary Num ber Sys tem may be help ful in


cer tain sit u a tions A brief over view of bi nary num bers is in cluded in this hand book as well – see


Chap ter 4 – Sys tem Pa ram e ters


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


FANUC CNC Custom Macros


BRANCHES AND LOOPS


177


Concept of Loops


Loop ing is an other method of mak ing a de ci sion in the macro pro gram flow, also based upon a


spec i fied con di tion Just like the IF func tion re quires a true/false eval u a tion, looping con di tion can also re turn only True or False state


The great est dif fer ence be tween the sin gle con di tion test ing (IF) and loop ing (WHILE) is how many pro cesses are in volved – one or many


Sin gle Process


Sin gle pro cess has al ready been cov ered – the IF copper busbar machine func tion rep re sents a sin gle pro cess In or der


to un der stand the con cept of loop ing, it is crit i cal to un der stand the sim ple top-down gen eral pro –


gram pro cess, with out a loop, for any operation This is the typical pro cess used in stan dard pro –


grams, with no con di tions and no de ci sions It can be rep re sented as a ge neric step-by

Leave a Reply