macro programming is not duffer from the standard programming of CNC mill, its just used only some mathematical formulas and equations.
For macro programming learn you should have sound knowledge about the standard programming and good practical experience. The basic fundamental of macro is old G and M codes. There are nothing to new here i told only some kind of formulas are used.
![](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVBw0u6cpopPp6Q-Rj69S-tqjYnBq7U9HLmZ6DWq1J20j0b6aFl4FanOc_q_q86Zxuc_Tal3eBDCzHW0juQY5y7olUg2ISIJDwPPNhUGTAzCZxQh1n5L2Qf9pcApbV7Q0f7DGsMaflejjr/s320/Macro_Programming.jpg)
In every new technologies the program get shorter and easy to use by operators. By the macro programming program gets shorten and flexible. The only one program held lot of data.
This macro condition i only used in fanuc advanced controller, i don't know others controller.
For the macro programming development there are basic three areas to understand
Variable: Stored value
this is a main parameter of macro. Its stored the predefined value. In macro programming real data replaced by the variable
Logical Formulas: Looping
You might have heard that people of computer engineering are programming software applications or websites. Also know that If.....else is also used in it. Its called logical function.
For simple example: If I have a job I will call you. In this statement condition is i have job otherwise i will not call you. Such types of logic are used in macro for looping.
Function and constant: significant numbers
Function are used to calculate the formula and constant like basic math constant is ะป and its value is 3.14
The simple Program for macro is
%
O0001
N1 #100=500 ⇐ (Variable defined)
N2 #101=250 ⇐ (Variable defined)
N3 G0 G90 G54 X0 Y0
N4 Z10
N5 G01 Z0 F440
N6 Y50 F#101 ⇐ (Variable applied)
N7 G03 Y-50 I0 J-50 F#100 ⇐ (Variable applied)
N8 Y50 I0 J50 F#101 ⇐ (Variable applied)
N9 G01 Z50
N10 M30
%
Simulation of simple macro programming.