
In many ways, Macro Programming is the highest level of G-code Programming. The next several lessons in the tutorial stand together as a Mini-Tutorial on Macro Programming and Fanuc Macro B. Mastering them is pretty easy and they’ll give you tremendous power and control in your g-code programming. They’re just buzzwords and jargon that stand for some pretty simple concepts. Introduction to Fanuc Macro System Variables, Parameterized Programming and Fanuc Macro Bįanuc Macro System Variables, Parameterized Programming, and Fanuc Macro B. (INCREMENT REGISTER COUNTER)ĮND 2 #4=#4 + 1.Parameterized Programming: Macro Variables for Fanuc CNCCookbook’s G-Code Tutorial

N200 (OUTPUT A ROTARY AXIS REGISTER VALUE) N100 (OUTPUT A LINEAR AXIS REGISTER VALUE) IF GOTO 200 (IF WE WILL OUTPUT A ROTARY AXIS) WHILE DO 2 (SAVE ALL REGISTERS IN A FIXTURE OFFSET) (INITIALIZE FIXTURE OFFSET REGISTER NO.)ĭPRNT] (OUTPUT THE FIXTURE OFFSET NAME) DPRNT WHILE DO 1 (SAVE ALL FIXTURE OFFSET DATA) This will be important to know as you study the programs below. This trend repeats for every axis of every fixture offset. That is, the X system variable for fixture offset number two is twenty greater than the X system variable for fixture offset number one. Notice how each fixture offset system variable is twenty greater than the previous one. #5304: is the B value of fixture offset number six

#5303: is the Y value of fixture offset number six #5302: is the Y value of fixture offset number six #5301: is the X value of fixture offset number six #5284: is the B value of fixture offset number five #5283: is the Y value of fixture offset number five #5282: is the Y value of fixture offset number five #5281: is the X value of fixture offset number five #5264: is the B value of fixture offset number four #5263: is the Y value of fixture offset number four #5262: is the Y value of fixture offset number four #5261: is the X value of fixture offset number four #5244: is the B value of fixture offset number three #5243: is the Y value of fixture offset number three #5242: is the Y value of fixture offset number three #5241: is the X value of fixture offset number three

#5224: is the B value of fixture offset number two #5223: is the Y value of fixture offset number two #5222: is the Y value of fixture offset number two #5221: is the X value of fixture offset number two #5204: is the B value of fixture offset number one #5203: is the Y value of fixture offset number one #5202: is the Y value of fixture offset number one #5201: is the X value of fixture offset number one
