{"id":1632,"date":"2026-11-08T17:50:37","date_gmt":"2026-11-08T15:50:37","guid":{"rendered":"https:\/\/macromillcnc.com\/2026\/11\/08\/g-code-vs-macro-programming-cam-macros\/"},"modified":"2026-11-13T13:59:45","modified_gmt":"2026-11-13T11:59:45","slug":"g-code-vs-macro-programming-cam-macros","status":"publish","type":"post","link":"https:\/\/macromillcnc.com\/2026\/11\/08\/g-code-vs-macro-programming-cam-macros\/","title":{"rendered":"G-Code Is Not a Programming Language. Macros Make It One: From My First Macro to CAM + Macro B"},"content":{"rendered":"<h1 class=\"wp-block-heading\">G-Code Is Not a Programming Language. Macros Make It One: My Journey From the First Macro to CAM + Macro B<\/h1>\n\n<p class=\"wp-block-paragraph\">Most CNC programs are not really programs. They are recordings. A long list of moves that tells the machine exactly where to go, one line at a time, the same way an operator would turn the handwheels. Change the part, and you record it all again.<\/p>\n\n<p class=\"wp-block-paragraph\">That is the honest truth about plain G-code: it is a repetition of manual movements, not a full-fledged computer language. The moment you add macros, that changes. This post is about that change, what it did for me, and how you can start.<\/p>\n\n<h2 class=\"wp-block-heading\">Why plain G-code is not a real language<\/h2>\n\n<p class=\"wp-block-paragraph\">A real programming language can store values, do math, make decisions and repeat work. Plain ISO G-code can do almost none of that. Every X, Y, Z and F is a fixed number typed into a line.<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>No variables:<\/strong> a 100 mm part and a 120 mm part are two different programs.<\/li>\n<li><strong>No decisions:<\/strong> the program cannot check a condition and choose a different path.<\/li>\n<li><strong>No loops:<\/strong> five depth passes means the same block of code written five times.<\/li>\n<li><strong>No awareness:<\/strong> it cannot read a probe result, a tool offset or a part counter.<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">Subprograms (M98) and canned cycles help a little, but they are still fixed playback. The control follows. It never thinks.<\/p>\n\n<h2 class=\"wp-block-heading\">What Macro B adds<\/h2>\n\n<p class=\"wp-block-paragraph\">Fanuc Custom Macro B turns that playback into a real language, running directly on the control:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>Variables:<\/strong> #1\u2013#33 local, #100\u2013#199 common, #500\u2013#999 persistent.<\/li>\n<li><strong>Math:<\/strong> + \u2212 * \/, SIN, COS, ATAN, SQRT, ROUND, FIX and more.<\/li>\n<li><strong>Decisions:<\/strong> IF [condition] GOTO n and IF [condition] THEN.<\/li>\n<li><strong>Loops:<\/strong> WHILE [condition] DO1 \u2026 END1.<\/li>\n<li><strong>Arguments:<\/strong> G65 P9010 A.. B.. X.. Y.. passes values into a macro like a function call.<\/li>\n<li><strong>System variables:<\/strong> read and write offsets, positions, modal states, and raise alarms with #3000.<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">With those six things, the machine stops being a playback device and becomes a computer that cuts metal.<\/p>\n\n<h2 class=\"wp-block-heading\">From my first macro to today<\/h2>\n\n<p class=\"wp-block-paragraph\">My first macro was nothing special. A bolt hole circle. I was tired of calculating X and Y for every hole by hand, so I wrote a few lines with SIN and COS and a WHILE loop. Six holes, eight holes, twelve holes, any diameter: change two numbers and run.<\/p>\n\n<p class=\"wp-block-paragraph\">That small program changed how I looked at every job. I started to see patterns everywhere. Families of parts that differ only by a few dimensions. Repeated operations that could be one cycle. Checks that a human forgot at 2 a.m. that the control could do every single time.<\/p>\n\n<p class=\"wp-block-paragraph\">Then came probing macros that measured the part and updated the work offset. Tool-life counters stored in persistent variables. Safety checks that stopped the machine with a clear message instead of a crash. Custom cycles the operators could use without ever opening the code.<\/p>\n\n<p class=\"wp-block-paragraph\">Today that journey is what MacroMill is built on: simulators, tools and training that help other programmers make the same jump, without learning it the hard way on a real machine.<\/p>\n\n<h2 class=\"wp-block-heading\">The value it brings and why it makes you stand out<\/h2>\n\n<p class=\"wp-block-paragraph\">Many programmers can post a CAM file. Far fewer can make the control think. That is the gap macros fill, and it shows on the shop floor:<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>Speed:<\/strong> a new size is a few numbers, not a new program.<\/li>\n<li><strong>Fewer errors:<\/strong> one proven macro replaces dozens of hand-edited files.<\/li>\n<li><strong>Safety:<\/strong> the program checks itself before it moves.<\/li>\n<li><strong>Automation:<\/strong> probing, counters and offsets update without the operator touching a key.<\/li>\n<li><strong>Career value:<\/strong> you become the person who solves problems, not just the one who loads programs.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">The best of both: CAM + macros<\/h2>\n\n<p class=\"wp-block-paragraph\">This is not CAM versus macros. The strongest programmers combine them.<\/p>\n\n<ul class=\"wp-block-list\">\n<li><strong>CAM<\/strong> is the best tool for complex geometry: 3D surfaces, adaptive roughing, smooth finishing toolpaths.<\/li>\n<li><strong>Macros<\/strong> are the best tool for logic: families of parts, part positions, probing, parametric features, safety checks and tool-life counters.<\/li>\n<\/ul>\n\n<p class=\"wp-block-paragraph\">Let CAM generate the hard geometry once. Let a macro decide where, how often and under which conditions it runs. That combination gives you endless possibilities.<\/p>\n\n<h2 class=\"wp-block-heading\">A short example: one CAM path, many parts<\/h2>\n\n<p class=\"wp-block-paragraph\">Say CAM gives you a finishing path for one part, saved as subprogram O2000 relative to that part&#8217;s zero. You have four parts on a fixture, 150 mm apart in X. The macro loops over the positions with a G52 local shift, counts tool use, and stops safely when the tool is due for a change.<\/p>\n\n<pre class=\"wp-block-code\"><code>O1000 (CAM FINISH x4 PARTS - MACRO DRIVER)\n#100=4          (NUMBER OF PARTS)\n#101=150.0      (PITCH IN X)\n#102=0          (PART COUNTER)\n#501=200        (TOOL LIFE LIMIT - SET ONCE)\nIF[#500 LT #501] GOTO10\n#3000=1 (T01 TOOL LIFE REACHED)\nN10\nG90 G17 G21 G40 G49 G80\nG54\nT01 M06\nS8000 M03\nG43 H01 Z50.0\nWHILE[#102 LT #100] DO1\nG52 X[#102*#101] Y0\nM98 P2000       (CAM-GENERATED FINISH PATH)\n#102=#102+1\n#500=#500+1     (PERSISTENT TOOL-LIFE COUNT)\nEND1\nG52 X0 Y0       (CANCEL LOCAL SHIFT)\nG00 Z50.0\nM05\nM30<\/code><\/pre>\n\n<p class=\"wp-block-paragraph\">CAM did the geometry. The macro handles the number of parts, their positions and the tool life. Need six parts at 120 mm pitch? Change two numbers. Add a probing macro before the loop and each part can even get its own measured offset.<\/p>\n\n<p class=\"wp-block-paragraph\"><em>Note: reference example only. Check G52 and variable ranges against your control manual and machine builder&#8217;s documentation, and prove it out with single block and a dry run before cutting.<\/em><\/p>\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<span class=\"embed-youtube\" style=\"text-align:center; display: block;\"><iframe loading=\"lazy\" class=\"youtube-player\" title=\"YouTube video player\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/z4eBXsEeB7k?version=3&#038;rel=1&#038;showsearch=0&#038;showinfo=1&#038;iv_load_policy=1&#038;fs=1&#038;hl=en-US&#038;autohide=2&#038;wmode=transparent\" allowfullscreen=\"true\" style=\"border:0;\" sandbox=\"allow-scripts allow-same-origin allow-popups allow-presentation allow-popups-to-escape-sandbox\"><\/iframe><\/span>\n<\/div><\/figure>\n\n\n<h2 class=\"wp-block-heading\">Where to begin learning macro programming<\/h2>\n\n<ol class=\"wp-block-list\">\n<li><strong>Learn the variable types first.<\/strong> #1\u2013#33 are local to a macro call, #100\u2013#199 are common and usually clear at power off, #500\u2013#999 are persistent and survive power off. Know which is which before you write anything.<\/li>\n<li><strong>Learn #3000.<\/strong> #3000=1 (MESSAGE) stops the machine with your own alarm text. It is your most important safety tool.<\/li>\n<li><strong>Start with a bolt hole circle.<\/strong> It uses variables, SIN\/COS and a WHILE loop in about ten lines. Then try the parametric contour in our post <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/parametric-cnc-program-fanuc-macro-contour-variables\/\">From Hard-Coded G-Code to a Parametric Program<\/a>.<\/li>\n<li><strong>Test in a simulator, never first on the machine.<\/strong> Watch the variables change line by line. See <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-cnc-simulators-built-in-cycles\/\">FANUC CNC Simulators With Built-In Cycles<\/a> and <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/cnc-thread-groove-simulator-before-you-cut\/\">Simulate Before You Cut<\/a>.<\/li>\n<li><strong>Read the Custom Macro section of your Fanuc operator&#8217;s manual.<\/strong> It covers variables, operators, system variables and G65 argument assignment.<\/li>\n<li><strong>Combine macros with canned cycles.<\/strong> Our post <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-macro-b-canned-cycles-examples\/\">Combining Fanuc Macro B With Canned Cycles<\/a> shows how.<\/li>\n<li><strong>Build a personal library.<\/strong> Every macro you prove out goes in a folder with notes. In a year you will have your own toolbox of custom cycles.<\/li>\n<\/ol>\n\n<p class=\"wp-block-paragraph\">Not sure why macros matter yet? Start with <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/what-problems-do-cnc-macros-solve-fanuc-macro-b\/\">What Problems Do CNC Macros Solve?<\/a><\/p>\n\n<h2 class=\"wp-block-heading\">Tools to practise with<\/h2>\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/payhip.com\/b\/9IpYU\" target=\"_blank\" rel=\"noopener\">CNC Automation Pro\u2122 2026<\/a>: Macro B from beginner to advanced, including custom canned cycles.<\/li>\n<li><a href=\"https:\/\/payhip.com\/b\/WtAqz\" target=\"_blank\" rel=\"noopener\">MacroMill FANUC 0i-MF Plus VMC Simulator<\/a>: Macro Lab and live CUSTOM MACRO variable screens.<\/li>\n<li><a href=\"https:\/\/payhip.com\/b\/XF3YG\" target=\"_blank\" rel=\"noopener\">FANUC 0i-TF Plus Lathe Simulator<\/a> and the <a href=\"https:\/\/payhip.com\/b\/vqdKz\" target=\"_blank\" rel=\"noopener\">All-In-One Bundle<\/a>.<\/li>\n<li><a href=\"https:\/\/payhip.com\/b\/W4hsw\" target=\"_blank\" rel=\"noopener\">MacroFusion\u2122<\/a>: helps turn repetitive CAM-generated G-code into reusable, variable-driven macro logic.<\/li>\n<li>Free: <a href=\"https:\/\/macromillcnc.com\/cnc-lathe-simulator\/\">CNC lathe simulators<\/a> and <a href=\"https:\/\/macromillcnc.com\/free-cnc-macro-resources\/\">CNC macro resources<\/a>.<\/li>\n<\/ul>\n\n<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n\n<h3 class=\"wp-block-heading\">Do I still need CAM if I learn macros?<\/h3>\n<p class=\"wp-block-paragraph\">Yes. CAM is better for complex geometry. Macros add the logic around it. Together they are stronger than either alone.<\/p>\n\n<h3 class=\"wp-block-heading\">Does my control support Macro B?<\/h3>\n<p class=\"wp-block-paragraph\">Most modern Fanuc controls do, but on some machines it is an option. Check your parameters or ask your machine builder.<\/p>\n\n<h3 class=\"wp-block-heading\">How long does it take to learn?<\/h3>\n<p class=\"wp-block-paragraph\">You can write a useful bolt hole macro in a day. Real confidence comes after building and proving a handful of your own macros in a simulator.<\/p>\n\n<p class=\"wp-block-paragraph\"><strong>MacroMill<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Plain G-code is a recording of manual moves. Fanuc Macro B makes it a real programming language. The journey from a first macro to combining CAM and macros, plus where to begin.<\/p>\n","protected":false},"author":279632934,"featured_media":1601,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_seo_llms_txt_always_include":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_wpcom_ai_launchpad_first_post":false,"_jetpack_feature_clip_id":0,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1378],"tags":[],"class_list":["post-1632","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_likes_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/phcvZP-qk","jetpack-related-posts":[{"id":1605,"url":"https:\/\/macromillcnc.com\/2026\/11\/08\/what-problems-do-cnc-macros-solve-fanuc-macro-b\/","url_meta":{"origin":1632,"position":0},"title":"What Problems Do CNC Macros Solve? 8 Shop-Floor Problems Fanuc Macro B Fixes","author":"MacroMill","date":"November 8, 2026","format":false,"excerpt":"Families of parts, manual edits, probing, tool wear, bolt circles, safety checks and special threads: 8 real shop-floor problems that CNC macro programming with Fanuc Macro B solves, with code examples.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"CNC Automation Pro 2026 CNC macro programming course and software","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1827,"url":"https:\/\/macromillcnc.com\/2026\/11\/24\/how-to-choose-a-cnc-simulator\/","url_meta":{"origin":1632,"position":1},"title":"How to choose a CNC simulator for FANUC G-code and macro training","author":"MacroMill","date":"November 24, 2026","format":false,"excerpt":"A practical checklist for how to choose a CNC simulator for FANUC G-code and macro training, and a clear look at where MacroMill\u2019s simulators fit.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"MacroMill VMC simulator for FANUC 0i-MF Plus style controls","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1693,"url":"https:\/\/macromillcnc.com\/2026\/11\/12\/cnc-macro-programming-rare-skill\/","url_meta":{"origin":1632,"position":2},"title":"Why CNC Macro Programming Is a Rare Skill \u2014 and Why It Sets Elite Programmers Apart","author":"MacroMill","date":"November 12, 2026","format":false,"excerpt":"CNC macro programming is a rare shop-floor skill. See why few programmers write FANUC Custom Macro B, what it lets you do that CAM cannot, and why that skill is so hard to replace.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"CNC operator at a machine control, writing a program \u2014 CNC macro programming","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1840,"url":"https:\/\/macromillcnc.com\/2026\/11\/26\/black-art-of-cnc-macro-programming\/","url_meta":{"origin":1632,"position":3},"title":"The black art of CNC macro programming, and what it can do for your career","author":"MacroMill","date":"November 26, 2026","format":false,"excerpt":"CNC macro programming is often called a black art. See what parametric programs do in the shop, how to practise them, and what the skill can do for your career.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"CNC operator at a machine control, writing a program \u2014 CNC macro programming","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/cnc-macro-programming-rare-skill.jpg?fit=1200%2C1200&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1660,"url":"https:\/\/macromillcnc.com\/2026\/11\/10\/cnc-macros-productivity-write-once\/","url_meta":{"origin":1632,"position":4},"title":"Unlock CNC Macros Productivity on the Shop Floor \u2014 Write Once, Not Again","author":"MacroMill","date":"November 10, 2026","format":false,"excerpt":"Unlock CNC macros productivity in a machine shop by writing one Macro B program with variables and logic, instead of rewriting a new program for every size.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"Bolt hole circle 4-View simulation","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/ft-m2-bolt-hole-4view.jpg?fit=1200%2C742&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/ft-m2-bolt-hole-4view.jpg?fit=1200%2C742&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/ft-m2-bolt-hole-4view.jpg?fit=1200%2C742&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/ft-m2-bolt-hole-4view.jpg?fit=1200%2C742&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/ft-m2-bolt-hole-4view.jpg?fit=1200%2C742&ssl=1&resize=1050%2C600 3x"},"classes":[]},{"id":1797,"url":"https:\/\/macromillcnc.com\/2026\/11\/19\/cnc-macro-programming-guide\/","url_meta":{"origin":1632,"position":5},"title":"CNC macro programming: a practical guide to FANUC Macro B","author":"MacroMill","date":"November 19, 2026","format":false,"excerpt":"A practical guide to CNC macro programming in FANUC Custom Macro B: variables, IF\/GOTO, WHILE loops, G65 calls, one worked example and common mistakes.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"MacroMill VMC simulator for FANUC 0i-MF Plus style controls","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-cnc-automation-pro-2026.png?fit=1080%2C1080&ssl=1","_links":{"self":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1632","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/users\/279632934"}],"replies":[{"embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/comments?post=1632"}],"version-history":[{"count":4,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1632\/revisions"}],"predecessor-version":[{"id":1725,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1632\/revisions\/1725"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media\/1601"}],"wp:attachment":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media?parent=1632"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/categories?post=1632"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/tags?post=1632"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}