{"id":1874,"date":"2026-12-03T03:55:11","date_gmt":"2026-12-03T01:55:11","guid":{"rendered":"https:\/\/macromillcnc.com\/2026\/12\/03\/fanuc-probing-g31-lesson\/"},"modified":"2026-12-03T04:05:41","modified_gmt":"2026-12-03T02:05:41","slug":"fanuc-probing-g31-lesson","status":"publish","type":"post","link":"https:\/\/macromillcnc.com\/2026\/12\/03\/fanuc-probing-g31-lesson\/","title":{"rendered":"A FANUC probing lesson: G31 skip, stylus radius and a custom cycle"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">This FANUC probing lesson has two parts. First you will write a single-surface G31 probe in X, read the skip position and turn it into a surface position with the stylus radius. Then you will build a custom probing cycle that takes two G31 touches, finds the centre of a slot and writes that centre to G54 X.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can step through both programs in <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">MacroMill VMC Pro<\/a>, which supports the G31 skip signal and custom probing cycle creation. Yes, programs and macros you write and test in a MacroMill simulator can be saved or exported and run on a real CNC machine, after a normal prove-out with single block, reduced rapids and a dry run.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What G31 does in FANUC probing<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">On a FANUC control, G31 is the skip function. It is a feed move, like G01, with one difference. The axis starts toward the programmed end point. When the probe, or another skip signal, triggers, motion stops, the rest of that block is discarded, and the next block starts.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The position at that moment is stored in the skip-position system variables, in the active workpiece coordinate system, for example G54 if G54 is selected. On a typical mill those standard variables are #5061 for X, #5062 for Y and #5063 for Z. Other axes use #5064 and so on. Copy the value into your own variable on the next line. The next G31 overwrites #5061 to #5063.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the skip signal does not trigger, G31 simply finishes at the programmed end point, and #5061 to #5063 hold that end point. The control does not raise an alarm on its own, so a real cycle must check that a touch actually happened. Cancel cutter compensation first: G31 with G41 or G42 active gives an alarm on FANUC. Keep the probe\u2019s tool-length offset on with G43, so the X and Y skip position is the centre of the stylus ball.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Lesson 1: a single-surface probe in X<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The aim is to find one face in X. The figures below are metric training values, not a job setup. The program starts at X20, drops to Z5, then makes a G31 move toward X-20. That is a move in the minus X direction, so it would touch the right-hand face of a part that sits somewhere between those two points.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>O8001 (TRAINING - SINGLE SURFACE X)\nG90 G54 G17 G21 G40 G49 G80\n#111 = 3.0 (TRAINING STYLUS RADIUS)\nG00 X20. Y0.\nG43 Z50. H01\nG00 Z5.\nG31 X-20. F100\n#100 = #5061\n#110 = #100 - #111\nG00 X20.\nG00 Z50.\nM30<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Read it line by line.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The safe-start line selects absolute metric motion in G54, the XY plane, and cancels cutter compensation, tool length and cycles. #111 holds the stylus ball radius. Use your calibrated radius on a real probe; 3.0 mm is only a training value. The next lines send the probe to a safe XY start, apply a tool-length offset, and drop to the measuring height.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">G31 X-20. F100 is the measuring move. The axis feeds toward X-20. When the probe triggers, motion stops and #5061 holds the X skip position: the centre of the ball, in G54. The next line copies that into #100 so it is safe if another G31 comes later.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The surface is not at the ball centre. Because this move was in the minus X direction, the ball touched on its minus-X side, and the face is one radius further in that direction. Subtract the stylus radius:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#110 = #100 &#8211; #111<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you approached from the other side, starting to the left of a left-hand face and moving in plus X, you would add the radius instead:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#110 = #100 + #111<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The rule is simple. Add the stylus radius when the G31 move is in the plus X direction. Subtract it when the G31 move is in the minus X direction. The same plus-or-minus rule applies in Y with #5062. The program then retracts to a safe height.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you wanted that face to become G54 X0, you would not replace #5221 with #110. #5061, and therefore #110, is already in the current workpiece coordinate system. #5221 is the standard FANUC system variable for the G54 X workpiece zero point offset. You shift the existing offset by the measured work position:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#5221 = #5221 + #110<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the compensated face currently reads X2.0 in G54, adding 2.0 to #5221 moves the G54 origin so that face becomes X0. A direct #5221 = #110 would write a work-coordinate measurement on top of an offset, which is not the same thing. Confirm #5221 against your control\u2019s Custom Macro B manual. On a typical mill, #5222 is G54 Y and #5223 is G54 Z.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Once you have the program, step it through in <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">MacroMill VMC Pro<\/a>. It is the full FANUC VMC simulator plus a Renishaw-style probing suite, with an OMP60-style probe, and it supports the G31 skip signal. Run O8001 in single block, watch the touch point live in 2D and 3D, and check that #5061 and #110 are the values you expected before you ever try the same move on a machine.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Lesson 2: a custom cycle that finds a slot centre<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A single face is useful, but a lot of setup work needs a centre. This custom cycle starts roughly in the middle of a slot, takes one G31 touch to the plus-X wall and one to the minus-X wall, then writes the centre to G54 X. The figures are again training values, not a job setup. This is a teaching cycle, not a finished shop routine: it uses one measuring feed, and it does not include your machine\u2019s probe on or off M-codes.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>O8002 (TRAINING - SLOT CENTRE X)\nG90 G54 G17 G21 G40 G49 G80\n#111 = 3.0 (TRAINING STYLUS RADIUS)\nG00 X0. Y0.\nG43 Z50. H01\nG00 Z5.\nG31 X25. F100\nIF [ABS[#5061-25.] LT 0.02] GOTO 90\n#101 = #5061\nG00 X0.\nG31 X-25. F100\nIF [ABS[#5061+25.] LT 0.02] GOTO 90\n#102 = #5061\n#103 = [#101+#102]\/2\n#5221 = #5221+#103\nG00 X0.\nG00 Z50.\nM30\nN90 #3000=1(NO SKIP TOUCH)<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The first G31 moves in plus X toward X25. If the probe triggers, #101 stores that skip position, the ball centre at the right-hand wall. The IF check is the no-touch test: if #5061 is still at the programmed end point, within 0.02 mm, the skip never happened and the program jumps to a #3000 alarm. The probe then returns to X0 and repeats the same idea in minus X, storing the left-hand skip position in #102.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The centre of the slot, in the current G54, is the average of the two skip positions:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#103 = [#101+#102]\/2<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You do not add or subtract the stylus radius here. The two ball-centre positions are each one radius away from their wall, in opposite directions, so the radius cancels and #103 is the true centre. The same centre formula works for a web, where the two touches come from the outside instead of from inside a slot.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Then the cycle writes the result to G54 X by shifting the existing offset:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">#5221 = #5221+#103<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">After that line, the measured centre is G54 X0, and the following G00 X0. should put the ball on that new centre. The stylus radius does not cancel if you want the width of the feature. For a slot, the true width is the distance between the two ball centres plus one ball diameter: ABS[#101-#102] + 2*#111. For a web, subtract the diameter instead: ABS[#101-#102] &#8211; 2*#111.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A shop cycle would usually add a protected approach, a second slower measuring touch, and a retract that is not hard-coded to X0. The logic you have just written is still the core of a custom probing cycle: two G31 moves, two stored skip positions, a centre, and a write to #5221. For the macro slips that most often show up at the control, see <a href=\"https:\/\/macromillcnc.com\/2026\/11\/26\/fanuc-macro-mistakes\/\">common FANUC macro mistakes that crash machines<\/a>. For a wider path from writing a macro to running it on the machine, see <a href=\"https:\/\/macromillcnc.com\/2026\/11\/26\/write-test-and-run-a-fanuc-macro\/\">Write a FANUC macro, test it in MacroMill, then run it on your machine<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is also the point at which a custom cycle should be tested, not guessed at on a live probe. <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">MacroMill VMC Pro<\/a> supports custom probing cycle creation, so you can write that slot-centre program, step through both G31 touches, and watch G54 update in the live 2D and 3D graphics. The probing suite already includes packages for slots, webs, bores, bosses, edges, corners and pockets, and the setup screen can write a G65 probe macro for those cycles, so you can compare your own logic with a standard pickup, then save or export the program when it is right.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Try it yourself<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Work these out before you look at the answers. In a training run, the two skip positions are #101 = 12.0 and #102 = -8.0, the stylus radius #111 is 3.0, and #5221 is currently 200.0.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>What is the slot centre #103?<\/li>\n<li>What is the true slot width?<\/li>\n<li>What value should #5221 have after you write the centre so that it becomes G54 X0?<\/li>\n<li>If the first G31 was a plus-X move to a left-hand face, do you add or subtract #111 to get the surface from #5061?<\/li>\n<li>If a G31 move never triggers, what does #5061 hold?<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Answers: the centre is [12.0 + -8.0] \/ 2 = 2.0. The true slot width is ABS[12.0 &#8211; (-8.0)] + 2*3.0 = 26.0. The new #5221 is 200.0 + 2.0 = 202.0, not 2.0. You add the stylus radius for a plus-X measuring move. If the skip never triggers, #5061 holds the programmed end point of the G31 block.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When the answers make sense on paper, run the same figures in <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">MacroMill VMC Pro<\/a> and confirm them on the control. Single-block the cycle, check #103 and the new #5221, and only then save or export the program for a prove-out on the machine. You can do that work on any of the ten FANUC-style controls in VMC Pro, and use Macro Lab if you want more macro practice around the same ideas.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prove it out before you cut<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Learning the logic in a simulator is the right first step, but it does not replace a prove-out. Addresses, stylus radius, tool-length offsets, clearances, feeds and the work offset you write must be confirmed against your machine, your probe and your control\u2019s Custom Macro B manual. On many FANUC controls, feed override does not slow a G31 move, so keep the probing feed modest. When the program is ready, save or export it, load it on the machine, and prove it out with single block, reduced rapids and a dry run before you rely on the offset or cut the part.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Practise the lesson in MacroMill VMC Pro<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to learn FANUC probing properly, the practical next step is to run the programs, not only read them. <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">MacroMill VMC Pro Probing Edition<\/a> gives you a place to step through the G31 lesson, test your custom slot-centre cycle, and watch every touch point as G54 updates, without tying up a production machine. It supports the G31 skip signal and custom probing cycle creation, and you can save or export the program when it is ready for a prove-out.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Start with the product page at <a href=\"https:\/\/macromillcnc.com\/macromill-vmc-pro\/\">macromillcnc.com\/macromill-vmc-pro<\/a>, or buy it at <a href=\"https:\/\/payhip.com\/b\/FX2DZ\" target=\"_blank\" rel=\"noopener\">payhip.com\/b\/FX2DZ<\/a>. If you have a question about the lesson, write to <a href=\"mailto:info@macromillcnc.online\">info@macromillcnc.online<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For tips and updates, join the MacroMill WhatsApp group: <a href=\"https:\/\/chat.whatsapp.com\/Htae97asBiD14QiwMXjGJA\" target=\"_blank\" rel=\"noopener\">chat.whatsapp.com\/Htae97asBiD14QiwMXjGJA<\/a>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><em>The software is for training and simulation only. Yes, programs and macros you write and test in a MacroMill simulator can be saved or exported and run on a real CNC machine. As with any new program, prove it out first with single block, reduced rapids and a dry run before you cut. Addresses, tool offsets, stylus data, clearances, spindle speeds and feeds must be confirmed against your machine, your tooling, your probe and your control\u2019s Custom Macro B manual.<\/em><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>MacroMill<\/strong><\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>A FANUC probing lesson: work through a G31 skip in X, compensate the stylus radius, then build a custom cycle that finds a slot centre and updates G54.<\/p>\n","protected":false},"author":279632934,"featured_media":1780,"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-1874","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-ue","jetpack-related-posts":[{"id":1827,"url":"https:\/\/macromillcnc.com\/2026\/11\/24\/how-to-choose-a-cnc-simulator\/","url_meta":{"origin":1874,"position":0},"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":1874,"position":1},"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":1852,"url":"https:\/\/macromillcnc.com\/2026\/11\/28\/stop-learning-cnc-on-a-live-machine\/","url_meta":{"origin":1874,"position":2},"title":"Stop learning CNC on a live machine: get job-ready faster","author":"MacroMill","date":"November 28, 2026","format":false,"excerpt":"Learning CNC on a live machine is slow and expensive. See how programmers get job-ready on a MacroMill simulator first, then take the program to the machine.","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":1611,"url":"https:\/\/macromillcnc.com\/2026\/11\/08\/fanuc-cnc-simulators-built-in-cycles\/","url_meta":{"origin":1874,"position":3},"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":1836,"url":"https:\/\/macromillcnc.com\/2026\/11\/26\/write-test-and-run-a-fanuc-macro\/","url_meta":{"origin":1874,"position":4},"title":"Write a FANUC macro, test it in MacroMill, then run it on your machine","author":"MacroMill","date":"November 26, 2026","format":false,"excerpt":"Write and test a FANUC Custom Macro B program in a MacroMill simulator, then save or export it and run it on a real CNC machine after a normal prove-out.","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":1675,"url":"https:\/\/macromillcnc.com\/2026\/11\/10\/fanuc-macro-while-loop\/","url_meta":{"origin":1874,"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\/01_cover.png?fit=1024%2C1024&ssl=1","_links":{"self":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1874","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=1874"}],"version-history":[{"count":3,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1874\/revisions"}],"predecessor-version":[{"id":1877,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/posts\/1874\/revisions\/1877"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media\/1780"}],"wp:attachment":[{"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/media?parent=1874"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/categories?post=1874"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/macromillcnc.com\/wp-json\/wp\/v2\/tags?post=1874"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}