{"id":1606,"date":"2026-11-08T16:32:11","date_gmt":"2026-11-08T14:32:11","guid":{"rendered":"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-macro-b-canned-cycles-examples\/"},"modified":"2026-11-13T14:04:18","modified_gmt":"2026-11-13T12:04:18","slug":"fanuc-macro-b-canned-cycles-examples","status":"publish","type":"post","link":"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-macro-b-canned-cycles-examples\/","title":{"rendered":"Combining Fanuc Macro B With Canned Cycles: 6 Worked Examples"},"content":{"rendered":"<h1 class=\"wp-block-heading\">Combining Fanuc Macro B With Canned Cycles: 6 Worked Examples<\/h1>\n<p class=\"wp-block-paragraph\">Canned cycles such as G81, G83, G84, G71 and G76 do the hard work of drilling, pecking, tapping, roughing and threading in one line. Fanuc Custom Macro B adds variables, maths, loops and checks. When you put the two together, you get short programs that the control executes reliably and that adapt to new sizes by changing a few numbers.<\/p>\n<p class=\"wp-block-paragraph\">This post shows six practical ways to combine macros with canned cycles, and the modal pitfalls to watch out for. If you are new to macros, start with our overview <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<p class=\"wp-block-paragraph\"><em>Note: all code below is a reference example only. Cycle formats, parameters, available options and variable ranges differ between Fanuc control models and machine builders. Always check your control manual and prove the program out with single block and a dry run before cutting.<\/em><\/p>\n<h2 class=\"wp-block-heading\">First, how canned cycles behave inside a macro<\/h2>\n<p class=\"wp-block-paragraph\">A few rules explain almost every problem people have when mixing the two:<\/p>\n<ul class=\"wp-block-list\">\n<li><strong>Canned cycles are modal.<\/strong> Once G81, G83 or G84 is active, every block that contains an X or Y move drills a hole at that position until you cancel with G80. That is exactly what makes them useful in a loop, but a forgotten G80 means the next positioning move also drills a hole.<\/li>\n<li><strong>Macro statements don&#8217;t trigger the cycle.<\/strong> Lines such as <code>#5=#5+1<\/code> or <code>WHILE [...] DO1<\/code> are calculations, not motion, so they don&#8217;t drill a hole. Only blocks with axis words do.<\/li>\n<li><strong>G98 and G99 decide the return height.<\/strong> G98 returns to the initial Z level after each hole, and G99 returns to the R plane. Use G98 when there are clamps or steps between holes, and G99 only when the path between holes is clear.<\/li>\n<li><strong>R is the rapid plane.<\/strong> The tool rapids down to R and feeds from there. A wrong R value, especially on a part with steps, is a common cause of crashes.<\/li>\n<li><strong>K0 or L0 sets up the cycle without drilling.<\/strong> On most Fanuc mill controls, adding K0 (or L0 on some) to the cycle block stores the cycle data without drilling at the current position, so the loop can supply every hole position itself.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Example 1: Bolt circle with G81 in a WHILE loop<\/h2>\n<p class=\"wp-block-paragraph\">The control calculates each X and Y position with COS and SIN, and the modal G81 drills at each one.<\/p>\n<pre class=\"wp-block-code\"><code>(BOLT CIRCLE - G81 SPOT\/DRILL)\n#1=8       (NUMBER OF HOLES)\n#2=40.0    (BOLT CIRCLE RADIUS)\n#3=22.5    (START ANGLE)\n#4=0.0     (CENTRE X)\n#5=0.0     (CENTRE Y)\n#10=0      (HOLE COUNTER)\nG90 G54 G00 X#4 Y#5\nG43 H01 Z50.0\nG98 G81 Z-12.0 R2.0 F120 K0\nWHILE [#10 LT #1] DO1\n#11=#3+[360\/#1*#10]\nX[#4+#2*COS[#11]] Y[#5+#2*SIN[#11]]\n#10=#10+1\nEND1\nG80\nG00 Z50.0<\/code><\/pre>\n<p class=\"wp-block-paragraph\">To drill a different pattern, change #1 to #5. The G80 straight after END1 makes sure the next move doesn&#8217;t drill.<\/p>\n<h2 class=\"wp-block-heading\">Example 2: Parametric peck drilling with G83<\/h2>\n<p class=\"wp-block-paragraph\">Peck depth is usually chosen from the drill diameter. A macro can calculate Q from the diameter so the same program works for different drills:<\/p>\n<pre class=\"wp-block-code\"><code>#20=8.5          (DRILL DIAMETER)\n#21=-30.0        (HOLE DEPTH Z)\n#22=#20*0.5      (PECK = 0.5 x DIAMETER)\nIF [#22 LT 1.0] THEN #22=1.0\nG98 G83 X20.0 Y15.0 Z#21 R2.0 Q#22 F90\nX60.0\nX100.0\nG80<\/code><\/pre>\n<p class=\"wp-block-paragraph\">The 0.5 x diameter rule here is only an example starting point, so use your tooling supplier&#8217;s recommendation. The IF line stops the peck from becoming too small to be useful.<\/p>\n<h2 class=\"wp-block-heading\">Example 3: Rectangular grid tapping with G84<\/h2>\n<p class=\"wp-block-paragraph\">Two nested loops tap a grid of holes. With G84 rigid tapping, the feed must match the pitch. In feed per minute (G94), that means F = spindle speed x pitch, which the macro calculates:<\/p>\n<pre class=\"wp-block-code\"><code>#1=4         (COLUMNS)\n#2=3         (ROWS)\n#3=25.0      (X SPACING)\n#4=20.0      (Y SPACING)\n#5=1.25      (PITCH M8)\n#6=600       (RPM)\n#7=#6*#5     (FEED MM\/MIN)\nM03 S#6\nM29 S#6      (RIGID TAP - CHECK YOUR MACHINE)\nG98 G84 Z-15.0 R3.0 F#7 K0\n#10=0\nWHILE [#10 LT #2] DO1\n#11=0\nWHILE [#11 LT #1] DO2\nX[#11*#3] Y[#10*#4]\n#11=#11+1\nEND2\n#10=#10+1\nEND1\nG80<\/code><\/pre>\n<p class=\"wp-block-paragraph\">The rigid tapping command (M29 or another M-code, or a parameter setting) depends on the machine builder, so check your manual.<\/p>\n<h2 class=\"wp-block-heading\">Example 4: A G65 drilling macro with arguments and #3000 checks<\/h2>\n<p class=\"wp-block-paragraph\">Wrapping the cycle in a macro program gives you a custom cycle that the operator calls in one line. Safety checks stop the machine with a clear message if an argument is missing or wrong.<\/p>\n<pre class=\"wp-block-code\"><code>(MAIN PROGRAM)\nG65 P9100 H6 R50.0 Z-10.0 F150 A0\nM30\n\nO9100 (BOLT HOLE DRILL - H=#11 R=#18 Z=#26 F=#9 A=#1)\nIF [#11 EQ #0] THEN #3000=1 (HOLE COUNT H MISSING)\nIF [#18 LE 0] THEN #3000=2 (RADIUS R MUST BE POSITIVE)\nIF [#26 GE 0] THEN #3000=3 (DEPTH Z MUST BE NEGATIVE)\nIF [#1 EQ #0] THEN #1=0\n#30=0\nG98 G81 Z#26 R2.0 F#9 K0\nWHILE [#30 LT #11] DO1\n#31=#1+[360\/#11*#30]\nX[#18*COS[#31]] Y[#18*SIN[#31]]\n#30=#30+1\nEND1\nG80\nM99<\/code><\/pre>\n<p class=\"wp-block-paragraph\">In a G65 call, the address letters map to local variables: A goes to #1, F to #9, H to #11, R to #18 and Z to #26. Because R is used as an argument here, the R plane inside the macro is written as a fixed value. Note that the pattern centre is the current work offset zero.<\/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\/NkShbL2a930?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<h2 class=\"wp-block-heading\">Example 5: Lathe G71\/G70 roughing with variable dimensions<\/h2>\n<p class=\"wp-block-paragraph\">On a lathe, variables can drive the profile between the P and Q blocks of G71, so one program handles a family of shafts. This uses the two-block G71 format found on most current Fanuc lathe controls:<\/p>\n<pre class=\"wp-block-code\"><code>#1=30.0     (FINISHED DIAMETER)\n#2=-40.0    (SHOULDER Z)\n#3=1.0      (CHAMFER)\n#4=50.0     (STOCK DIAMETER)\nG00 X[#4+2.0] Z2.0\nG71 U2.0 R0.5\nG71 P10 Q20 U0.4 W0.1 F0.25\nN10 G00 X[#1-2*#3]\nG01 Z0 F0.15\nX#1 Z-#3\nZ#2\nN20 X[#4+2.0]\nG70 P10 Q20\nG00 X100.0 Z100.0<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Check that your control allows macro expressions inside the G71 profile blocks, since some older models restrict what can appear between P and Q. It is best to test the result in a simulator first. Our free <a href=\"https:\/\/macromillcnc.com\/cnc-lathe-simulator\/\">CNC lathe simulators<\/a> are a quick way to see a turned profile before running it.<\/p>\n<h2 class=\"wp-block-heading\">Example 6: G76 threading driven by variables<\/h2>\n<p class=\"wp-block-paragraph\">For a standard metric thread, a macro can calculate the minor diameter from the major diameter and pitch, then feed it into G76:<\/p>\n<pre class=\"wp-block-code\"><code>#1=20.0              (MAJOR DIAMETER)\n#2=1.5               (PITCH)\n#3=0.6134*#2         (EXTERNAL THREAD DEPTH, PER SIDE)\n#4=#1-2*#3           (MINOR DIAMETER)\n#5=-25.0             (THREAD END Z)\nG00 X[#1+4.0] Z5.0\nG76 P020060 Q100 R0.05\nG76 X#4 Z#5 P920 Q350 F#2\nG00 X100.0 Z100.0<\/code><\/pre>\n<p class=\"wp-block-paragraph\">Be careful with units. On the second G76 block, P (thread height) and Q (first cut depth) are normally entered in the control&#8217;s least input increment, for example microns, without a decimal point. Here P920 is about 0.92 mm, matching 0.6134 x 1.5. If you calculate P with a variable, round it to the correct units. The thread depth factor varies with the thread standard and your insert, so confirm it against your thread tables.<\/p>\n<p class=\"wp-block-paragraph\">For thread forms that G76 can&#8217;t cut, such as buttress or progressive pitch threads, a full parametric macro is usually needed. Our post <a href=\"https:\/\/macromillcnc.com\/2026\/11\/08\/cnc-thread-groove-simulator-before-you-cut\/\">Simulate Before You Cut<\/a> shows how to check those profiles first.<\/p>\n<h2 class=\"wp-block-heading\">Common pitfalls checklist<\/h2>\n<ul class=\"wp-block-list\">\n<li><strong>Always cancel with G80<\/strong> after the last hole, and before any tool change or positioning move.<\/li>\n<li><strong>Don&#8217;t reuse cycle letters as G65 arguments by mistake.<\/strong> R, Z, Q and F all mean something in a drilling cycle and something else as macro arguments.<\/li>\n<li><strong>Use G98 when unsure.<\/strong> Returning to the initial level is slower but safer.<\/li>\n<li><strong>Watch rounding.<\/strong> COS and SIN results may have long decimals, and the control rounds them to its input increment. This is normal, but check critical positions.<\/li>\n<li><strong>Use the null value check.<\/strong> <code>IF [#n EQ #0]<\/code> catches arguments that were never passed.<\/li>\n<li><strong>Test before cutting.<\/strong> Use a simulator, then single block and a dry run on the machine.<\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\">Going further<\/h2>\n<p class=\"wp-block-paragraph\">Once you are comfortable wrapping cycles in macros, the next step is building your own custom canned cycles. <a href=\"https:\/\/payhip.com\/b\/9IpYU\" target=\"_blank\" rel=\"noopener\">CNC Automation Pro\u2122 2026<\/a> covers Fanuc Macro B and other controls, from beginner to advanced level, including custom canned cycles, pre-written macros, books and certification. If you have repetitive CAM-generated code that you want to turn into reusable macro logic, take a look at <a href=\"https:\/\/payhip.com\/b\/W4hsw\" target=\"_blank\" rel=\"noopener\">MacroFusion\u2122<\/a>. For free examples, see our <a href=\"https:\/\/macromillcnc.com\/free-cnc-macro-resources\/\">CNC macro resources<\/a>.<\/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\/BuKnqJnK9uI?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<h2 class=\"wp-block-heading\">Frequently asked questions<\/h2>\n<h3 class=\"wp-block-heading\">Can I call a canned cycle inside a WHILE loop?<\/h3>\n<p class=\"wp-block-paragraph\">Yes. Set up the cycle once, ideally with K0 so it doesn&#8217;t drill at the start point, then supply X and Y positions inside the loop. Cancel with G80 after END.<\/p>\n<h3 class=\"wp-block-heading\">Why did my machine drill an extra hole?<\/h3>\n<p class=\"wp-block-paragraph\">Usually the cycle was still active because G80 was missing, or the cycle block itself contained an X\/Y position without K0.<\/p>\n<h3 class=\"wp-block-heading\">Can variables be used in G71 and G76?<\/h3>\n<p class=\"wp-block-paragraph\">On most controls, yes, but check the units of P and Q in G76 and any restrictions your control places on the blocks between P and Q in G71.<\/p>\n<p class=\"wp-block-paragraph\"><strong>MacroMill<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bolt circles with G81, parametric G83 pecking, G84 grid tapping, G65 drilling macros with #3000 checks, and G71 and G76 lathe cycles driven by variables: six worked Fanuc macro and canned cycle examples.<\/p>\n","protected":false},"author":279632934,"featured_media":1597,"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-1606","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-pU","jetpack-related-posts":[{"id":1611,"url":"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-cnc-simulators-built-in-cycles\/","url_meta":{"origin":1606,"position":0},"title":"FANUC CNC Simulators With Built-In Cycles: What MacroMill&#8217;s Simulators Solve","author":"MacroMill","date":"November 8, 2026","format":false,"excerpt":"Learn CNC without machine time, prove macros before cutting and generate code for threads, grooves, pockets and patterns. See the built-in cycles in MacroMill's FANUC-style lathe and VMC simulators.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"MacroMill FANUC CNC simulator all-in-one bundle","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-simulator-all-in-one-bundle.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-simulator-all-in-one-bundle.png?fit=1080%2C1080&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-simulator-all-in-one-bundle.png?fit=1080%2C1080&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-simulator-all-in-one-bundle.png?fit=1080%2C1080&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-simulator-all-in-one-bundle.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":1606,"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":1605,"url":"https:\/\/macromillcnc.com\/2026\/11\/08\/what-problems-do-cnc-macros-solve-fanuc-macro-b\/","url_meta":{"origin":1606,"position":2},"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":1797,"url":"https:\/\/macromillcnc.com\/2026\/11\/19\/cnc-macro-programming-guide\/","url_meta":{"origin":1606,"position":3},"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":[]},{"id":1632,"url":"https:\/\/macromillcnc.com\/2026\/11\/08\/g-code-vs-macro-programming-cam-macros\/","url_meta":{"origin":1606,"position":4},"title":"G-Code Is Not a Programming Language. Macros Make It One: From My First Macro to CAM + Macro B","author":"MacroMill","date":"November 8, 2026","format":false,"excerpt":"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.","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":1675,"url":"https:\/\/macromillcnc.com\/2026\/11\/10\/fanuc-macro-while-loop\/","url_meta":{"origin":1606,"position":5},"title":"How a FANUC Macro WHILE Loop Works \u2014 Tip of the Iceberg","author":"MacroMill","date":"November 10, 2026","format":false,"excerpt":"Learn how a FANUC macro WHILE loop works: WHILE[...]DO1, the 0\/90\/180\/270 keyway walkthrough, and how MacroMill helps you master Macro B.","rel":"","context":"In &quot;Tutorials&quot;","block_context":{"text":"Tutorials","link":"https:\/\/macromillcnc.com\/category\/tutorials\/"},"img":{"alt_text":"Step-through table in the MacroMill simulator showing a FANUC macro WHILE loop: counters 0 to 3 are true at 0, 90, 180 and 270 degrees, counter 4 is false and exits","src":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/fanuc-macro-while-loop-step-through.jpg?fit=1200%2C675&ssl=1&resize=350%2C200","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/fanuc-macro-while-loop-step-through.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 1x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/fanuc-macro-while-loop-step-through.jpg?fit=1200%2C675&ssl=1&resize=525%2C300 1.5x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/fanuc-macro-while-loop-step-through.jpg?fit=1200%2C675&ssl=1&resize=700%2C400 2x, https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/fanuc-macro-while-loop-step-through.jpg?fit=1200%2C675&ssl=1&resize=1050%2C600 3x"},"classes":[]}],"jetpack_featured_media_url":"https:\/\/i0.wp.com\/macromillcnc.com\/wp-content\/uploads\/2026\/11\/macromill-fanuc-0i-mf-plus-vmc-simulator.png?fit=1080%2C1080&ssl=1","_links":{"self":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1606","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=1606"}],"version-history":[{"count":7,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1606\/revisions"}],"predecessor-version":[{"id":1733,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1606\/revisions\/1733"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media\/1597"}],"wp:attachment":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media?parent=1606"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/categories?post=1606"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/tags?post=1606"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}