<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Macro programming: variables, conditions and loops in NC code on CNC-Master</title><link>https://cnc-master.xyz/en/academy/advanced/macro-programming/</link><description>Recent content in Macro programming: variables, conditions and loops in NC code on CNC-Master</description><generator>Hugo</generator><language>en</language><atom:link href="https://cnc-master.xyz/en/academy/advanced/macro-programming/index.xml" rel="self" type="application/rss+xml"/><item><title>Control flow basics: how a program makes decisions</title><link>https://cnc-master.xyz/en/academy/advanced/macro-programming/control-flow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cnc-master.xyz/en/academy/advanced/macro-programming/control-flow/</guid><description>&lt;p&gt;A G-code program runs from top to bottom, block by block. Every value is written in the program: X50, Z-12, F200. If the part changes, the program has to be changed.&lt;/p&gt;
&lt;p&gt;A macro program can do more. It stores values under a name, calculates new values from them, checks conditions and jumps to another part of the program depending on the result. These tools are called control flow, because they control in which order the blocks are executed.&lt;/p&gt;</description></item><item><title>NC macros and computer code: a comparison with Python</title><link>https://cnc-master.xyz/en/academy/advanced/macro-programming/macros-and-python/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cnc-master.xyz/en/academy/advanced/macro-programming/macros-and-python/</guid><description>&lt;p&gt;NC macro languages are small programming languages. They were designed decades ago and look old-fashioned, but the ideas behind them are the same as in any modern language. This page puts NC macros next to Python, a language that is often used for teaching because it reads almost like English.&lt;/p&gt;
&lt;p&gt;You do not need to install or learn Python. The comparison has two goals. If you have seen Python or a similar language before, you can transfer that knowledge directly. If not, the Python lines help to see the structure behind the cryptic NC syntax.&lt;/p&gt;</description></item><item><title>Fanuc Macro B: variables, IF, WHILE and G65 explained</title><link>https://cnc-master.xyz/en/academy/advanced/macro-programming/fanuc-macro-b/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://cnc-master.xyz/en/academy/advanced/macro-programming/fanuc-macro-b/</guid><description>&lt;p&gt;Fanuc Custom Macro B, usually just called Macro B, is the macro language of Fanuc controls and of many controls that copy the Fanuc dialect. This page explains the parts you need for everyday work. The general ideas behind variables, conditions and loops are explained in &lt;a href="https://cnc-master.xyz/en/academy/advanced/macro-programming/control-flow/"&gt;Control flow basics&lt;/a&gt;.&lt;/p&gt;
&lt;div class="notice notice--info"&gt;
 &lt;svg width="20" height="20" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" aria-hidden="true"&gt;&lt;circle cx="12" cy="12" r="9"/&gt;&lt;path d="M12 11v6m0-10v.01"/&gt;&lt;/svg&gt;
 &lt;div&gt;&lt;div class="notice-title"&gt;Is Macro B available?&lt;/div&gt;&lt;p&gt;On older controls Macro B is an option. If the offset screen shows a page for macro variables, the function is installed. The available variable ranges and some details depend on the control generation and the machine builder&amp;rsquo;s settings. When in doubt, test with harmless values in MDI first.&lt;/p&gt;</description></item></channel></rss>