Hopefully, the description was clear enough, but a graphical representation

Hopefully, the description was clear enough, but a graphical representation – us ing a sim ple flowchart – shows the com par i son of both meth ods (Fig ure 20)


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


178


Chapter 13


Figure 20


START


START


Flowchart comparison


cnc drill Machine


of a single structure process,


shown at left, and a repeated


HOLE DATA


HOLE DATA


structure process at right


MOVE TO THE LOCATION


MOVE TO THE LOCATION


DRILL THE HOLE


DRILL THE HOLE


Note that the angle machine example


as shown at right


STOP


represents an endless


or infinite loop – no STOP


The two com pa ra ble flowcharts in di cate the drill ing pro cess in prin ci ple How ever, there is a


ma jor and a very se ri ous prob lem with the re peated struc ture There is no way out! The rep e ti tion


shown at the right side of Fig ure 20 has no pro vi sion to stop the pro cess ing – the loop is not


stopped – it is not con trolled – log i cally, it notching machine runs for ever!


It is ex automatic punching machine tremely im por tant to pro vide an exit from a loop, when cer tain con di tions are sat is fied,


for ex am ple, when the last hole is drilled Fail ure to pro vide an ex ist from a loop will cause an


end less or in fi nite loop In fi nite loops are the most com mon causes of prob lems in macro loops


Ter mi nat ing a loop is al ways de ter mined by a spe cific con di tion This con di tion has to be part of


the loop, based on the job re quire ments, with the pro vi sion to branch out of the loop, when the


con di tion be comes false The re pet i tive flowchart shown in Fig ure 20 has to be mod i fied


Fig ure 21 shows the fi nal flowchart for the drill ing pro cess, in clud ing the con di tional state ment


and only two pos si ble out comes – drill more holes or stop the pro gram pro cess ing


START


Figure 21


Flowchart showing a logical


HOLE DATA


flow of the loop, based on


the result of a conditional


decision


LAST


YES


HOLE


STOP


The STOP branch provides

Tags: , , , ,

Leave a Reply