Posts Tagged ‘trialpresscom’

The G65 block for the above macro contains all input correctly

Monday, September 4th, 2017

FANUC CNC Custom Macros


ALARMS AND TIMERS


189


The G65 block for the above macro contains all input correctly – 8 holes, 12 mm apart It means


busbar Machine


all IF tests will be false and the macro will con tinue as in tended It will con tinue un til busbar bending machine it reaches the first alarm mes sage At this point the alarm takes over and macro pro cess ing stops Iron i cally,


if one ar gu ment is in put in cor rectly, the macro will is sue the ap pro pri ate alarm With all ar gu –


ments be ing cor rect, one alarm will al ways be is sued! That angle machine means a flaw less macro will gen er ate


alarm 3101 or 101 (HOLE SPACING IS TOO SMALL), in di cat ing wrong data in put Noth ing is


wrong with the in put, so what is the rea son? If a branch is based on a cer tain con di tion, the macro


true and false sec tions have to be sep a rated In the O8013 ex am ple they were not The alarm mes –


sages cnc equipment were not by passed if all data in put is good To by pass them, the un con di tional GOTOn func –


tion must be in cluded by it self in a block The n is the block num ber to branch to In un con di tional


branch ing, there is no IF, no WHILE – just GOTOn Pro gram O8014 cor rects the pre vi ous macro:


O8014


CORRECT way to program alarms


IF[#4 LE 0] GOTO1001


I=#4 variable stores the hole spacing


IF[#11 LT 2] GOTO1002


H=#11 variable stores the number of holes


IF[#11 NE FUP[#11]] GOTO1003


Check if #11 contains the decimal point


G90 X#24 Y#25


Previously defined tool location XY


< macro body processing 锟?>


GOTO9999


Unconditional bypass added


N1001 #3000 = 101 (HOLE SPACING TOO SMALL)


N1002 #3000 = 102 (TWO HOLES MINIMUM REQUIRED)


N1003 #3000 = 103 (DECIMAL POINT NOT ALLOWED)


N9999 M99


Block number to branch to


%


Com pare the two pre vi ous ver sions (changes are iden ti fied in the O8014 ver sion) The only ad –


di tion that can make the macro even better is the sav ing and sub se quent re stor ing of the cur rent


modal val ues Such im prove ment has noth ing to do with alarms, and is in cluded here to show the