What's new
What's new

Macro programming worth it? Thanks for insights

SmlG54

Aluminum
Joined
Apr 5, 2018
Hey all, I've been programming, mostly g/m code but with some/decent amount of Cad/cam experience. I have recently been thinking about Macro Programming.

Im somewhat out of touch with what different shops are doing and I guess my general question is the title. Basically, in the high tech era we are all in, is there a benefit (monetary and efficiency wise) for me to take on the task of learning how to macro program.

Thanks to all who give feed back. Any thoughts or criticism is greatly appreciated.

SML
 
Absolutely. Most common application is for probing, but also for setting up mixed batch runs on a pallet fed mill or a Swiss, and for cutting families of parts. Oh, and serial number engraving. I once wrote a macro on commission that would engrave PN, date, SN in a line at specified angle, or on a specified arc, and/or projected on a specified cylinder. Lots of trig.
 
I have seen and understand a lot of evidence of probing. Make sense. I also follow the family of parts. I dont quite get the mixed batch or swiss application (not because its not useful, but i just dont get it. (does program switch back and forth and completion. i dont know application). The PN/date/SN....Ah i think i get it, tell the control to automatically update PN and redo with understood geometry of cylinder?.....

So it seems like those are some useful and direct applications and deserve merit. All in all, and you did answer, but wanting to know if the big picture investment of learning macros would increase what I could bring to a shop upon hiring. If I had my own shop and a probe or families of part I can already see the value in it. Just wondering if the REST of INDUSTRY does??
 
mhajicek is correct, macros are very useful.

Most of my macros are set-up applications and macros that insure that nothing goes wrong.
 
Absolutely worth learning to program macros. A job we do that comes to mind is one that I have to broach a shape on the outside of a part. I have to take a cut, rotate the C-axis 6.316 degrees and repeat. It's much easier (and shorter) to put the movements in a WHILE/DO loop than to write a four line move 57 times. It also makes it easier to edit. I only have to change what I need to in one place, rather than 57 places.
 
Just wondering if the REST of INDUSTRY does??

Depends on the individual. Some still don't see the value of CAM, more than three axes, or quality tooling. My take is learn everything you can, git gud, and if a shop will appreciate that then it's a job you want. If they don't care and just want you to shut up and push the button, you don't want the job.
 
....I dont quite get the mixed batch

Not sure if this is what was meant...

I did a macro for a company that made their own product. All the lathe parts were made from the same stock. The operator only had to key in how many assemblies worth of parts were needed for the day. A Macro then determined how many times to run the first program then switch to the next program and run it so many times. Some of the parts were 1 piece per assembly and others were 2 pieces and one part needed 4 pieces.
 
Yup. Oh, and while we're at it, if you want to practice your macro programming safely, check it with NCPlot. I never could have written and debugged that serial macro I mentioned without it.
 
Depends on the individual. Some still don't see the value of CAM, more than three axes, or quality tooling. My take is learn everything you can, git gud, and if a shop will appreciate that then it's a job you want. If they don't care and just want you to shut up and push the button, you don't want the job.

You said it well, I am of the same philosophy. I recently turned down a job and told the manager that "respectfully, it would be boring" (not the id cutting ;) )

Also, thanks vanc. That makes sense, in a really cool and practical way.

I have already seen a need for macros in the short time at my new company. Family of parts and also this job that parts of "washers" but the length of the raw stock differs and was thinking about just having one variable (part length sticking out from jaws) and have the program insure no crashes happens.
 
Yup. Oh, and while we're at it, if you want to practice your macro programming safely, check it with NCPlot. I never could have written and debugged that serial macro I mentioned without it.

NC plot is not free, but if Mit digital calipers cost 300$ then I should look at it as a tool worth purchasing. Thanks
 
There's a lot you can do with macro programming. A shop I do work for uses macros to control all their NC programs. Basically, each tool is a macro that is called from the main program. This allows operators to easily re-run a single tool right from the control which is VERY useful when you want to adjust an offset and re-run a specific tool which cuts one feature, etc.

Not to mention all the other stuff you do can (modular programming, adaptive programs, and much more).

It's very useful to learn macro programming. I'd say macro programming has much MORE application in industry than it does in the small business or home shop.
 
Do it, don't hesitate. I am a small shop and 2 small macros (block centre and hole centre finding) have saved me loads of time. The rest of them that I have written have made my life easier.

Think of not being able to use sub programs is the best way that I can explain the value of macro programming. Even just understanding how variables and their calculations work/react will be a big bonus in any shop in my opinion.

If you are thinking about it get this book, Sorry! Something went wrong! I know that I have "advertised" it here a few times but it helped me to start understanding way easier and quicker than trying to bang my head on my own. Once you have gone through it think of it as a reference book that you can refer to anytime.

Once you have the book (I think there are others that you can buy) start going through the sticky on this sub forum on macro programming. I tried without any previous knowledge and it was tough... till I bought the book and used the two of them hand in hand.

Not sure if the link is working but it is "CNC programming using Fanuc custom Macro B" by S.K Sinha (A member here on PM)
 
hi :)

use macros as long as they don't reduce your buffer size, or as long as you are satisfied with the lower buffer size; you may use soubroutines instead of macros, so to avoid messing with the buffer size

custom build macros, so to fully use the cnc capability

you may call these custom macros from a CAM code, so to enhance the CAM output, because is simpler to edit a macro, rather than to edit a CAM post

applications ( software ) :
... stand alone : for editing a CAM output, delivering a parametric thing, etc
... interfaced with the control :
...... passive : for example when loading a probe program
...... active : to change the way a program works, in real-time :)
 
hi :)

use macros as long as they don't reduce your buffer size, or as long as you are satisfied with the lower buffer size; you may use soubroutines instead of macros, so to avoid messing with the buffer size

Could you explain this ^? My BS meter hit the peg when I read it.

Sounds a lot like the idiot formerly known as "deadlykitten".
 
Could you explain this ^? My BS meter hit the peg when I read it.

Sounds a lot like the idiot formerly known as "deadlykitten".

language sunshine :) okuma controller requires storage space from the read-ahead

if you are don't polite, next time i won't answer you ...
 
Well aware that OSP utilizes temp files in storage. IME that does not affect buffering ability. If you have a clip from an OSP programming manual describing otherwise please post that.

buff size and buffering ability are differrent things; buffering ability is manifested longer if the buff size is larger, as long as there is no buffering prohibit code

is enough to create a *.lib file pretty close to buffer size, so to create problems

time scale for such stuff is arround 0.005 - 0.015 seconds / block; depends on actual scenario

for an exact comparison, is possible to disable the read-ahead from parameters, etc

i avoid such situations by using only soubroutines instead of macros, and no buffer prohibit codes ( if possible )

truth is that few *.lib files have a size that can be compared to the 2mb, so the actual read-ahead size is more than enough to permit using general macros ... is good to be aware of this numbers, so to avoid a situation where the read-ahead is compromised

using soubroutines instead of macros has almost same execution time, without affecting the read-ahead size

a problem may appear if *.lib is close to 2mb and HiCut or Nurbs is used on a toolpath with high feed and small segments ( for example on a high resolution 3d, or when using deposition, or a laser head ) ... but for such cases is recomended to use the "S" type when selecting programs, and in this method no soubroutines are used, and only a *.lib of maximum 1.8mb is allowed ... so would you preffer only 0.2mb read-ahead ? this case is too particular, but not impossible :)
 
Again, instead of posting a bunch BS, post a clip from an OSP programming manual describing this. When I worked for an Okuma distributor, we were told 100kB is the recommended minimum amount of storage space for OSP generated temporary data.
 








 
Back
Top