Programming CNC Macros - Part 1

preview_player
Показать описание
Having a look at Fanuc Macro B Programming. We'll go through a very basic program to provide an introduction into what you can do with macro programming. I'm going to focus on the Fanuc Macro B language since it happens to be very common control and the Haas macro language is pretty much exactly the same. In the accompanying video, the software being used is Cimco Edit 8. Another popular software for simulating your macro programs is NCplot. Here are links to both of those softwares...

In the example, I start with a very basic gcode program that profiles a rectangle that is 6"x4". From there input those length and width values into variables.

#1=6.0

#2=4.0

Now instead of calling X6.0 in the program, you can call X#1. Same goes for the Y location, instead of Y4.0 we're calling Y#2. So why would you want to do this? Typing X6.0 is pretty much the same as typing X#1. The reason is flexibility.

You can now simply edit the variable values and the program will automatically update to the new sizes. In the example, there is only one callout for variables 1 and 2 so this is not a great example just yet but we can increase the complexity a bit and then maybe show some of the power of fanuc macro b programming.

In the example, I add in a radius at one of the corners and a new variable to hold the size of that radius. In the program, to cut this radius correctly the original command of X#1 needs to be updated to stop short of the end of the part. It needs to stop short by the size of the defined radius. We can use macro math functions for this. When doing math, otherwise referred to as an equation, we need to encase it in square brackets [ ]. Our equation will look like this...

X[#1-#3]

This will set the value for X to whatever #1 - #3 is. Using math inside of your programs will unleash some amazing capabilities for you. Even if you do not completely use macro programming, these equations are still valuable.

Trying to figure out the feedrate for a tap? Lets pretend a mill is used, so inches per minute are needed, using a 1/2-13 tap running at 200 rpm....for the G84 canned cycles F values you can type in F[1/13*200] no need for a calculator!

Keep an eye out for video 2 on Fanuc Macro B Programming!

See other blog posts

Check out our website

#Mastercam #LearnCNC
Рекомендации по теме
Комментарии
Автор

For anyone who wants to dive deeper, Peter smid has probably the best book for fanuc group B macro programming. You can go as deep as you want to go with macro and it is an incredible tool that most shops don’t even utilize. Nice intro vid!!!!

theberrymanmanman
Автор

Yes please add more videos on macro programming. Extremely interested in learning more so I can utilize. Thank you!

jwalexander
Автор

Very well done sir, hopefully great to look forward too.

Sports_publish
Автор

Very helpful video. Many greetings from Austria.

stefankrimbacher
Автор

That was a really informative video! Thanks .

bikefarmtaiwan
Автор

I used this to create a face mill program, works great....thank you. But I need help with the step over amount when you give it a wider value for cant figure out how to get it to add half the cutter for the step over amount(using a 1.6 diameter face mill so .8 step over would be great). Can you help? Thanks so much

claynorris
Автор

Great videos very informative do you have an engraving macro tutorial or would you make one in the near future? Thanks again keep the vids coming

Wackjacko
Автор

I saw some examples of macros for. Circular hole paterns. For a 3 axes milling. Help me with this please how can i modified that program for circular pockets around one center thanks. Y meam instead of holes circular pockets thanks in advance..

willgonzales
Автор

Is that Cimco as installed with Mastercam?

cncmanufacturingptyltd
Автор

I wrote a a program using this technique that will corner round or full dish a round puck on a mill. Variables for EM size, speed, stepover, Diameter, Radius, and feed. You can get the machine to do all the trigonometry for you

davidliskey
Автор

Yes please I am an instructor and veteran CNC machinist and I’m always looking for ways to add more control and use ability out of old equipment. Macros are helpful in making smaller code to run complex parts.

aaronauclair
Автор

Good day sir as always excellent video. Is their a handbook you would recommend for me to get which covers macro programming in detail.

haroldjoubert
Автор

Is it possible to create a macroprogram for archimedian spiral or a 3d surface based on curves?

Віталій-цъ
Автор

Very good video, thanks for making it..

davidhall
Автор

This looks like it would be very useful when combined with canned cycles, or subprograms.

sbeprecisionproducts
Автор

Yes very interesting...Would be great to learn more of this type of programming and when its best to be used

flr
Автор

Macros or for me r parameters on siemens is nice way to make some things.

TommiHonkonen
Автор

Thanx for this great video really help full ...Can you include some milling pockets [ macro for z level ] [ drilling and tapping ]..

agfisher
Автор

could you help me with some fadal probing macros?

joesmith
Автор

Please do some CNC lathe program macros.

jerojr