This commit is contained in:
2026-09-13 19:45:24 +08:00
parent 397a7a8cc4
commit 2db889ad89
58 changed files with 3526 additions and 213 deletions
@@ -376,6 +376,11 @@ tool-house refresh is chosen on <a class="xref" href="../../anatomy/general-setu
with its own feedrate, so material removal and cycle time come out of the real motion rather than an
approximation. Modal repetition and <code>G91</code> incremental cycle data are resolved before the strokes are
built.</p>
<p>On SoftNc (the 3.2 default) a repeat block is the XYZ / <code>R</code> / <code>Q</code> / <code>F</code> / <code>P</code> / <code>K</code> family. An
A / B / C word on a repeat is <strong>not taken</strong>: a rotary-only repeat does not fire the cycle, a mixed
block drops the rotary word, and under <code>G68.2</code> the hole follows the table. Programs that index a
rotary axis that way should run with SoftNc off — the HardNc fallback indexes those blocks the way a
control does. See the <a href="../../release-note/index.html">Adoption status</a> note.</p>
<h3 id="polar-interpolation">Polar interpolation</h3>
<p><code>G12.1</code> turns polar coordinate interpolation on and <code>G13.1</code> turns it off. Inside a polar section the
<code>X</code> word is a <strong>diameter</strong> and the <code>C</code> word is a hypothetical Cartesian axis in millimetres, not
@@ -437,7 +442,7 @@ the Fanuc, Syntec and Mazak presets:</p>
</tr>
<tr>
<td><code>M02</code> / <code>M30</code></td>
<td>Program end.</td>
<td>Program end. On SoftNc the next block starts with tool-length compensation (including TCP), tilt, cutter-radius compensation and canned cycles cancelled; the <code>M02</code> / <code>M30</code> block itself still runs under the modal state it executed with. The HardNc fallback does not apply that reset.</td>
</tr>
<tr>
<td><code>M03</code> / <code>M04</code> / <code>M05</code></td>
@@ -511,10 +516,11 @@ tool table — lengths and radius plus additive wear.</p>
<code>DEF INT</code> declarations lower into assignments, and a full expression evaluator means <code>Z=R63+150</code> and
<code>X=SIN(R10)*20</code> drive real motion. <code>$P_UIFR[n,axis,TR]</code> binds both ways to the frame table. Any other
<code>$</code> variable is recorded with an unsupported note rather than silently dropped.</p>
<p><strong>Frames and five-axis.</strong> <code>TRANS</code> / <code>ATRANS</code> / <code>ROT</code> / <code>AROT</code> (with <code>RPL=</code>) compose into the tilt
chain in Sinumerik RPY order; <code>TRAORI</code> is a real RTCP mode, the sibling of ISO <code>G43.4</code>, with
<code>TRAFOOF</code> handing the offset back; <code>CYCLE800</code> is decoded from its MODE bits across all four swivel
modes.</p>
<p><strong>Frames and five-axis.</strong> <code>TRANS</code> / <code>ATRANS</code> / <code>ROT</code> / <code>AROT</code> (with <code>RPL=</code>) and the solid-angle
forms <code>ROTS</code> / <code>AROTS</code> compose into the tilt chain in Sinumerik RPY order (<code>ROTS</code> / <code>AROTS</code> behave
as <code>ROT</code> / <code>AROT</code>: at most two angles, first-named axis first); <code>TRAORI</code> is a real RTCP mode, the
sibling of ISO <code>G43.4</code>, with <code>TRAFOOF</code> handing the offset back; <code>CYCLE800</code> is decoded from its MODE
bits across all four swivel modes.</p>
<p><strong>Calls and control flow.</strong> <code>L</code>-prefixed and named subprogram calls, inlined with their <code>P</code> repetition
count; <code>M17</code> / <code>RET</code>; <code>REPEAT</code> over a labelled slice; <code>MCALL CYCLE81</code> / <code>82</code> / <code>83</code> / <code>85</code> mapped onto
the shared canned-cycle machinery; <code>PROC</code> headers and labels. <code>GOTOF</code> / <code>GOTOB</code>, <code>IF</code> / <code>ELSE</code> /
@@ -528,7 +534,7 @@ instead of a coordinate, resolved against the machine's own indexing-position ta
<p><strong>OEM auxiliary M-codes.</strong> The preset declares <code>M12</code> / <code>M13</code> / <code>M22</code> / <code>M23</code> and <code>M330</code> / <code>M331</code> as
note-only, so each occurrence voices <code>DeclaredMCode--UnmodeledEffects</code> rather than an unknown-code
warning. A machine's own table overrides the declaration once the real effects are known.</p>
<p><strong>Recognized, not simulated.</strong> <code>ROTS</code> / <code>AROTS</code>, <code>SCALE</code> / <code>ASCALE</code>, and <code>MIRROR</code> / <code>AMIRROR</code> — each
<p><strong>Recognized, not simulated.</strong> <code>SCALE</code> / <code>ASCALE</code>, <code>MIRROR</code> / <code>AMIRROR</code> and <code>CROTS</code> — each
reported as <code>SiemensFrame--Unsupported</code>.</p>
<p><strong>Not supported.</strong> <code>SETAL</code>.</p>
<h2 id="see-also">See Also</h2>
@@ -374,14 +374,14 @@ misread as something else — a <code>PLANE AXIAL B+45</code> will not be mistak
<tbody>
<tr>
<td><strong>Fanuc</strong></td>
<td>ISO core, canned cycles G73G89, G41/G42, G43.4 RTCP, G53/G53.1, G68/G68.2/G69, G12.1/G13.1 polar with compensation, Custom Macro B (<code>#</code> variables, <code>IF</code>/<code>GOTO</code>, <code>WHILE</code>/<code>DO</code>), <code>M98</code>/<code>M99</code> subprograms, <code>G65</code>/<code>G66</code>/<code>G67</code> macro calls</td>
<td>ISO core, canned cycles G73G89 (XYZ / R / Q / F / P / K; rotary A/B/C words on a repeat are not taken on SoftNc), G41/G42, G43.4 RTCP, G53/G53.1, G68/G68.2/G69, G12.1/G13.1 polar with compensation, Custom Macro B (<code>#</code> variables, <code>IF</code>/<code>GOTO</code>, <code>WHILE</code>/<code>DO</code>), <code>M98</code>/<code>M99</code> subprograms, <code>G65</code>/<code>G66</code>/<code>G67</code> macro calls, <code>G54.1 Pn</code> / <code>G54 Pn</code>, <code>G59.1</code><code>G59.9</code></td>
<td>bare <code>G05 P</code> HPCC selections (<code>Hpcc--NoOp</code>, <code>Hpcc--HighSpeedCycleIgnored</code>, <code>Hpcc--UnsupportedFunction</code>, <code>Hpcc--UnevaluatedFunction</code>, <code>Hpcc--MissingFunctionWord</code>)</td>
<td><code>G10</code> programmable data setting, <code>G50</code> spindle limit, <code>G31</code> skip</td>
</tr>
<tr>
<td><strong>Siemens</strong></td>
<td>modal vocabulary, <code>SUPA</code>/<code>G153</code>, <code>T=&quot;name&quot;</code> with <code>D</code> offsets, <code>$TC_DP</code> tool tables, R-parameters and <code>DEF</code> variables with a full expression evaluator, <code>$P_UIFR</code>, <code>TRANS</code>/<code>ATRANS</code>/<code>ROT</code>/<code>AROT</code> frames, <code>TRAORI</code>/<code>TRAFOOF</code>, <code>CYCLE800</code>, <code>MSG</code>/<code>STOPRE</code>, <code>CR=</code>/<code>TURN=</code> arcs, <code>L</code>/named subprograms, <code>MCALL</code>, <code>REPEAT</code>, <code>PROC</code>/labels, <code>GOTOF</code>/<code>GOTOB</code>, <code>IF</code>/<code>ELSE</code>/<code>ENDIF</code>, <code>WHILE</code>/<code>FOR</code>/<code>REPEAT-UNTIL</code>/<code>LOOP</code>, <code>AC()</code>/<code>IC()</code>/<code>DC()</code>/<code>ACP()</code>/<code>ACN()</code>, the coded-position family, <code>G74</code>/<code>G75</code></td>
<td><code>ROTS</code>/<code>AROTS</code>, <code>SCALE</code>/<code>ASCALE</code>, <code>MIRROR</code>/<code>AMIRROR</code> (<code>SiemensFrame--Unsupported</code>)</td>
<td>modal vocabulary, <code>SUPA</code>/<code>G153</code>, <code>T=&quot;name&quot;</code> with <code>D</code> offsets, <code>$TC_DP</code> tool tables, R-parameters and <code>DEF</code> variables with a full expression evaluator, <code>$P_UIFR</code>, <code>TRANS</code>/<code>ATRANS</code>/<code>ROT</code>/<code>AROT</code>/<code>ROTS</code>/<code>AROTS</code> frames, <code>TRAORI</code>/<code>TRAFOOF</code>, <code>CYCLE800</code>, <code>MSG</code>/<code>STOPRE</code>, <code>CR=</code>/<code>TURN=</code> arcs, <code>L</code>/named subprograms, <code>MCALL</code>, <code>REPEAT</code>, <code>PROC</code>/labels, <code>GOTOF</code>/<code>GOTOB</code>, <code>IF</code>/<code>ELSE</code>/<code>ENDIF</code>, <code>WHILE</code>/<code>FOR</code>/<code>REPEAT-UNTIL</code>/<code>LOOP</code>, <code>AC()</code>/<code>IC()</code>/<code>DC()</code>/<code>ACP()</code>/<code>ACN()</code>, the coded-position family, <code>G74</code>/<code>G75</code></td>
<td><code>SCALE</code>/<code>ASCALE</code>, <code>MIRROR</code>/<code>AMIRROR</code>, <code>CROTS</code> (<code>SiemensFrame--Unsupported</code>)</td>
<td><code>SETAL</code></td>
</tr>
<tr>
@@ -185,7 +185,7 @@ public unsafe RenderingCanvas(params IDisplayee[] displayees)
DispEngine.BackgroundColor = new Vec3d(0.1, 0.1, 0.5);
DispEngine.BackgroundOpacity = 0.1;
DispEngine.SetViewToHomeView();
DispEngine.ImageRequestAfterBufferSwapped += DispEngine_ImageRequestAfterBufferSwapped;
DispEngine.FrameReady += DispEngine_FrameReady;
// Set initial size and start the rendering engine
this.Size = new System.Drawing.Size(500, 300);
@@ -193,7 +193,7 @@ public unsafe RenderingCanvas(params IDisplayee[] displayees)
}
</code></pre><h3 id="rendering-pipeline">Rendering Pipeline</h3>
<p>The rendering pipeline processes images from DispEngine and displays them:</p>
<pre><code class="lang-csharp" name="RenderingCanvas">private unsafe void DispEngine_ImageRequestAfterBufferSwapped(byte* bgra_unsignedbyte_pixels, int w, int h)
<pre><code class="lang-csharp" name="RenderingCanvas">private unsafe void DispEngine_FrameReady(byte* bgra_unsignedbyte_pixels, int w, int h, FramePins pins)
{
// Create a bitmap from the raw pixel data provided by DispEngine
Bitmap bitmap;
@@ -500,7 +500,7 @@ public RenderingCanvas()
<pre><code class="lang-csharp" name="RenderingCanvas">/// &lt;summary&gt;
/// Handles the buffer swapped event from DispEngine
/// &lt;/summary&gt;
private unsafe void RenderingCanvas_BufferSwapped(byte* data, int w, int h)
private unsafe void RenderingCanvas_BufferSwapped(byte* data, int w, int h, FramePins pins)
{
if (data == null)
return;
@@ -703,11 +703,11 @@ private unsafe void CanvasDataContextChanged(object sender, DependencyPropertyCh
if (pre != null) //this section will never occur if the datacontext not set twice.
{
pre.Terminate();
pre.ImageRequestAfterBufferSwapped -= RenderingCanvas_BufferSwapped;
pre.FrameReady -= RenderingCanvas_BufferSwapped;
}
if (cur != null)
{
cur.ImageRequestAfterBufferSwapped += RenderingCanvas_BufferSwapped;
cur.FrameReady += RenderingCanvas_BufferSwapped;
cur.Start((int)DisplayerPane.RenderSize.Width, (int)DisplayerPane.RenderSize.Height);
cur.IsVisible = IsVisible;
@@ -743,8 +743,8 @@ private unsafe void RenderingCanvas_Loaded(object sender, RoutedEventArgs e)
CurrentWindow = Window.GetWindow(this);
// Set up DispEngine rendering
DispEngine.ImageRequestAfterBufferSwapped -= RenderingCanvas_BufferSwapped;
DispEngine.ImageRequestAfterBufferSwapped += RenderingCanvas_BufferSwapped;
DispEngine.FrameReady -= RenderingCanvas_BufferSwapped;
DispEngine.FrameReady += RenderingCanvas_BufferSwapped;
DispEngine.Start((int)DisplayerPane.RenderSize.Width, (int)DisplayerPane.RenderSize.Height);
DispEngine.IsVisible = IsVisible;
}
@@ -755,7 +755,7 @@ private unsafe void RenderingCanvas_Loaded(object sender, RoutedEventArgs e)
private unsafe void RenderingCanvas_Unloaded(object sender, RoutedEventArgs e)
{
DispEngine.IsVisible = IsVisible;
DispEngine.ImageRequestAfterBufferSwapped -= RenderingCanvas_BufferSwapped;
DispEngine.FrameReady -= RenderingCanvas_BufferSwapped;
CurrentWindow = null;
}
</code></pre><h3 id="resource-cleanup-1">Resource Cleanup</h3>