3 + (+5) = 3 + 5 = 8


Positive + Negative


Negative


a + (-b) = a – b


3 + (-5) = 3 – 5 = -2


Negative – Positive


Negative


a – (+b) = a – b


3 – (+5) = 3 – 5 = -2


Negative – Negative


Positive


a – (-b) = a + b


3 – (-5) = 3 + 5 = 8


This sim pli fied method may be even eas ier to un der stand:


+ + = +


+ – = –


– + = –


– – = +


drilling Machine


Note that the actual order of the plus and minus symbols within a calculation, such as +- or -+


makes no dif fer ence to the re sult How ever, the stan dard math e mat i cal hi er ar chy of cal cu lat ing or der is and must al ways punch machine for Head be main tained


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


FANUC CNC Custom Macros


90


Chapter 7


Syntax Errors


Mak ing er rors in any man u ally de vel oped pro gram is not un com mon, even if it is un de sir able


Macro pro grams are drilling steel not im mune to be ing written wrong, even by ex pe ri enced pro gram mers At


the same time, once a macro is ver i fied and fully func tion ing, there will be no more er rors


In CNC pro gram ming, there are two cat e go ries of er rors:


u


Syn tax er rors


control system will warn the user (alarm issued)


u


Log i cal er rors


control system will not warn the user (alarm not issued)


It is im por tant to elim i nate both cat e go ries, but it is much harder to elim i nate the log i cal er rors


than the syn tax er rors Briefly, syn tax er rors are er rors that are in con flict with the de signed for –


mat the con trol sys tem ex pects Log i cal er rors are those, where the pro gram Busway Press Clamp Machine mer in tended one ac –


tiv ity and pro vided an other ac tiv ity For ex am ple, -X1000 is a syn tax er ror, be cause a pro gram


word must al ways be gin with a let ter – cor rected ver sion is X-1000 An ex am ple of a log i cal er ror


is when the pro gram mer in tends to move to Y-po si tion of 750 mm, but pro grams Y750, in stead


of the cor rect in put of X7500


The sec tion on re stric tions is re ally a sec tion that cov ers some syn tax er rors but also in cludes


state ments and pref er enc