Stringing Together Multiple Controller Macros for Sequenced Operations

Programming tips for creating a main G-code and multiple subroutines to manage a series of different nested operations on one panel after another. March 4, 2009

Question
Say you’re nesting 30 plus sheets with each sheet a different operation. How can I set up the machine to bring up and start the next operation simply by activating the cycle start button? Where can I learn to write macros?

Forum Responses
(CNC Forum)
From contributor E:
Our KOMO which has a Fanuc controller has a program called DNC Barcode which lets you batch multiple programs. I'm not sure if that's a KOMO program or part of the Fanuc controller?



From contributor J:
You need the Fanuc Basic operation package and the DNC operation management package.


From contributor M:
Best of my knowledge it would take a macro and some discipline setting up your file system, but my thought is that it a barcode reader would be easier, more reliable and more versatile. The issue you are bringing up is my one gripe with the Anderson machines. I really like the hardware a lot, having used one for a year, and the Fanuc controller is very reliable and solid. But the user interface is clunky, slow and not operator friendly. It takes forever to call a sheet, and treeing through a directory of 60 files 9 lines at a time, 5 to 10 seconds per scroll is maddening

There is another way if you are using CV or CW or Alpha Cam, though it has its own problems too. You can output your nested runs as one large file running over DNC with a pause between each sheet. This can work pretty well, but if you have an error or an issue that needs attention on sheet 7 of a 30 sheet run, you have a problem picking that up in the middle again. The Macro solution may present this issue in a different way, depending on how you write it.




From contributor T:
It would seem to me that if you batched all of the sheets together and made sure they each included a start/stop command at the beginning and end, that this should be somewhat easy to accomplish. The overall program will be quite large and could possibly be spoon fed into the control with some simple DNC software.


From contributor O:
Contributor L - FYI, that program you use is a KOMO program. The Fanuc Basic Operation Package and the DNC software is all you need. Since you have an Andi already, you probably have the B.O.P. software. It’s pretty simple to set up.


From contributor K:
Hopefully you will have had this addressed to your satisfaction, but if you have not , here is what I would recommend - typically my recommendations are using the software of the control itself, because it’s cheap, you already have it and once you get used to it it really isn't a huge undertaking! I am assuming you have a standard Fanuc or standard EIA/ISO control.

1.) Transfer all nest programs to the control memory.
2.) Edit the last line of each program from M30 or M02 to M99. This is the M command which tells the control this program is functioning as a sub program so after it has executed, the control must jump back to the main program.
3.) Create a main program. Use the standard preperatory blocks you would normally (you can get this by looking at the lines of your current programs prior to movements). After you have inserted these lines create a line that looks like so: N30 M98 P0001 then repeat this process for every program number of the nests.
4.) You can place man readable comments between () and specify what each program is for to make it easier to find.
5.) Your main program would be 30 or so lines long, jumping in and out of each of the nested programs in whatever sequence you specified.
6.) At the end of the main program - place an M02 or M30 (whichever you use). You can actually create a spread sheet to do this for you once you are familiar enough with the syntax.

I know it’s not the preferred option for many, but if you’re on a budget it works pretty well. It does take some studying of the way you code your machine - which I recommend to most people anyway. If you do not understand the code, it is very difficult to troubleshoot anything. It is worth the investment to understand how your control interprets code!



From contributor K:
Revision # 1 – I forgot to put this in the original post, but inserting an M00 in-between the subprogram call lines will provide for you to unload/load then press cycle start to continue with next nest. My apologies for overlooking that!