This commit is contained in:
2026-09-09 17:35:23 +08:00
parent 2a98ae7556
commit 161af68fe3
1271 changed files with 58251 additions and 98639 deletions
@@ -6,7 +6,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="title" content="Class UnitModeSyntax | HiAPI-C# 2025 ">
<meta name="description" content="Detects the unit-system code (ISO Group 06: G20 inch / G21 metric) from and writes a section (, ). Modal — absence of an explicit flag inherits the previous block&#39;s unit, defaulting to at program start. The code vocabulary is configurable per brand: / default to ISO G20 / G21; the Siemens preset uses G70+G700 / G710+G71 instead (G70/G71 switch geometry-word interpretation only, G700/G710 also switch feedrate interpretation — a distinction preserved via the verbatim but irrelevant to this record-only syntax; both inch variants warn identically). The first entry doubles as the program-start default Term. Note Siemens G70/G71 must never be added to ISO/Fanuc presets — on Fanuc lathes the same codes are finishing/roughing cycles (same collision family as the documented Siemens G74 exclusion). The HiNC pipeline works exclusively in millimetres. When an inch code is detected this syntax emits an Unit--InchNotSupported Unsupported Error so upstream callers are forced to pre-convert the NC program to metric — while still recording what the program said. Metric codes are accepted as no-op confirmations of the default.">
<meta name="description" content="Detects the unit-system code (ISO Group 06: G20 inch / G21 metric) from and writes a section (, ). Modal — absence of an explicit flag inherits the previous block&#39;s unit, defaulting to at program start. The code vocabulary is configurable per brand: / default to ISO G20 / G21; the Siemens preset uses G70+G700 / G710+G71 instead (G70/G71 switch geometry-word interpretation only, G700/G710 also switch feedrate interpretation — a distinction preserved via the verbatim but irrelevant to this record-only syntax; both inch variants warn identically). The first entry doubles as the program-start default Term. RS-274-D, Syntec and Fanuc turning G-code system C all spell the units G70 inch / G71 metric, and the Fanuc milling dialects (RS-274-D descendants) read them the same way, so the Fanuc/Syntec presets carry all four codes. The finishing/roughing-cycle collision exists only on Fanuc turning G-code systems A/B (system C moved those cycles to G72/G73) — a future turning preset for those systems must not inherit this milling preset&#39;s vocabulary. The HiNC pipeline works exclusively in millimetres. When an inch code is detected this syntax emits an Unit--InchNotSupported Unsupported Error so upstream callers are forced to pre-convert the NC program to metric — while still recording what the program said. Metric codes are accepted as no-op confirmations of the default.">
<link rel="icon" href="../img/HiAPI.favicon.ico">
<link rel="stylesheet" href="../public/docfx.min.css">
<link rel="stylesheet" href="../public/main.css">
@@ -110,10 +110,14 @@ interpretation only, G700/G710 also switch feedrate interpretation —
a distinction preserved via the verbatim <a class="xref" href="Hi.NcParsers.Keywords.IUnitDef.html#Hi_NcParsers_Keywords_IUnitDef_Term">Term</a>
but irrelevant to this record-only syntax; both inch variants warn
identically). The first <a class="xref" href="Hi.NcParsers.LogicSyntaxs.UnitModeSyntax.html#Hi_NcParsers_LogicSyntaxs_UnitModeSyntax_MetricCodes">MetricCodes</a> entry doubles as the
program-start default <code>Term</code>. Note Siemens G70/G71 must never be
added to ISO/Fanuc presets — on Fanuc lathes the same codes are
finishing/roughing cycles (same collision family as the documented
Siemens G74 exclusion).
program-start default <code>Term</code>. RS-274-D, Syntec and Fanuc turning
G-code system C all spell the units G70 inch / G71 metric, and the
Fanuc milling dialects (RS-274-D descendants) read them the same way,
so the Fanuc/Syntec presets carry all four codes. The
finishing/roughing-cycle collision exists only on Fanuc turning
G-code systems A/B (system C moved those cycles to G72/G73) — a
future turning preset for those systems must not inherit this milling
preset's vocabulary.
</p>
<p>
The HiNC pipeline works exclusively in millimetres. When an inch code
@@ -252,6 +256,21 @@ section; program-start default would be the first
"Parsing": { "X": 10 },
"Unit": { "Term": "G710", "System": "Metric" }
}</code></pre>
<p>Fanuc/Syntec mill dialect (SUT configured with
<code>InchCodes = [&ldquo;G20&rdquo;, &ldquo;G70&rdquo;]</code>,
<code>MetricCodes = [&ldquo;G21&rdquo;, &ldquo;G71&rdquo;]</code>) — the RS-274-D / Fanuc system C /
Syntec spelling G71 is consumed exactly like G21:
#BeforeBuild:</p>
<pre><code class="lang-csharp">{ "Parsing": { "Flags": ["G71"] } }</code></pre>
<p>#AfterBuild:</p>
<pre><code class="lang-csharp">{ "Unit": { "Term": "G71", "System": "Metric" } }</code></pre>
<p>Same instance reading the inch spelling G70 — recorded faithfully as
<code>Inch</code> and the <code>Unit&ndash;InchNotSupported</code> error is emitted,
exactly like G20:
#BeforeBuild:</p>
<pre><code class="lang-csharp">{ "Parsing": { "Flags": ["G70"] } }</code></pre>
<p>#AfterBuild:</p>
<pre><code class="lang-csharp">{ "Unit": { "Term": "G70", "System": "Inch" } }</code></pre>