Table of Contents

Class SiemensProgrammableFrameSyntax

Namespace
Hi.NcParsers.LogicSyntaxs.Siemens
Assembly
HiMech.dll

Siemens programmable frame (TRANS/ATRANS/ROT/AROT incl. RPL=, plus the solid-angle forms ROTS/AROTS): consumes the structured Parsing.<keyword> sub-objects captured by SiemensFrameStatementSyntax, accumulates the programmable-frame matrix across blocks, and composes it into ProgramToMcTransform as the shared TransformSource entry — the same Source CYCLE800 writes, so the two stay mutually exclusive via AddOrReplaceTransform's in-place replacement (on a real Sinumerik, CYCLE800 itself writes the programmable frame chain, so single ownership mirrors the control).

Semantics follow the Sinumerik programmable-frame rules (HardNc reference: HardNcLine.ParseSiemensFrameTransform + NcArgSiemensFrame): the absolute forms TRANS/ROT reset the whole programmable frame and set only their own component; the additive forms ATRANS/AROT compose onto the current frame with the new operation applied first (M = M_op · M_prev, row-vector convention — an AROT after a TRANS rotates inside the translated frame). A bare keyword (any of the four) resets the programmable frame entirely — written as the shared inactive sentinel Term = "G69" plus an identity chain entry (the same convention HardNc's CYCLE800 reset uses). Multi-axis rotation in one statement applies the Sinumerik RPY order (intrinsic Z → Y′ → X″, i.e. row-vector Rx·Ry·Rz); RPL rotates about the active G17/G18/G19 plane normal and composes after the axis angles.

The solid-angle forms ROTS/AROTS follow the Sinumerik rules (Programming Manual Fundamentals 03/2010 §12.5, "ROTS and AROTS behave in the same way as ROT and AROT"): at most two solid angles orient a plane, composed first-named axis first with the second rotation about the original (extrinsic) axis — the pair X,Y keeps the new X axis in the old Z/X plane (row-vector Rx·Ry), Y,Z keeps the new Y axis in the old X/Y plane (Ry·Rz), Z,X keeps the new Z axis in the old Y/Z plane (Rz·Rx). A single angle is identical to ROT/AROT; RPL= alone rotates in the active plane. Three angles, or RPL mixed with axis angles, fall outside the documented grammar: the statement is left unapplied with a SiemensFrame--SolidAngleInvalid warning plus the visible Parsing--Unconsumed residue — never a guessed frame.

CROTS/SCALE/ASCALE/MIRROR/AMIRROR (zero corpus occurrences; CROTS references the control's frame database which has no offline counterpart, SCALE/MIRROR would inject non-rigid matrices whose remaining breakages are the radius-compensation magnitude, the program-space path length feeding durations, and the writeback Euler decomposition) are consumed recognized-but-not-simulated with a SiemensFrame--Unsupported warning and zero transform effect. A structured keyword whose capture fell back to the verbatim Statement shape, or whose value is an unevaluated variable expression, is left in Parsing — the VariableExpression--Unevaluated diagnostic plus the visible Parsing--Unconsumed residue is the correct fail-soft (P2 acceptance doctrine); the frame is not partially applied.

Must run after SiemensCycle800TiltSyntax (this syntax owns the once-per-block TiltTransform modal carry: it carries only when no earlier syntax authored the section on this block) and before the coordinate-offset syntaxes, so the frame entry lands ahead of CoordinateOffset in the chain (McXyz = ProgramXyz · M_frame · M_offset · … — the programmable frame applies to program coordinates first, then the settable G54 frame, matching the Sinumerik frame chain).

public class SiemensProgrammableFrameSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
Inheritance
SiemensProgrammableFrameSyntax
Implements
Inherited Members
Extension Methods

Examples

Bare cancel — programmable frame reset to the shared inactive sentinel (identity entry overwrites any previously composed frame): #BeforeBuild:

{ "Parsing": { "ROT": { "Bare": true } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "G69" },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
    }
  ]
}

Absolute translation — corpus reset idiom (TRANS X10 Y20 Z-5 arrives structured from the Parsing stage): #BeforeBuild:

{ "Parsing": { "TRANS": { "X": 10, "Y": 20, "Z": -5 } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "TRANS", "X": 10, "Y": 20, "Z": -5 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,20,-5,1]
    }
  ]
}

Additive rotation onto a previous translation — M = Rx(30°) · T(10,0,0): the rotation applies first (inside the translated frame), the translation column survives: #Previous:

{
  "TiltTransform": { "Term": "TRANS", "X": 10 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,0,0,1]
    }
  ]
}

#BeforeBuild:

{ "Parsing": { "AROT": { "X": 30 } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "AROT", "X": 30 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [
        1, 0, 0, 0,
        0, 0.8660254037844387, 0.49999999999999994, 0,
        0, -0.49999999999999994, 0.8660254037844387, 0,
        10, 0, 0, 1
      ]
    }
  ]
}

In-plane rotation — no PlaneSelect section on the block, so the default XY plane (Z normal) applies: #BeforeBuild:

{ "Parsing": { "ROT": { "RPL": 30 } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "ROT", "RPL": 30 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [
        0.8660254037844387, 0.49999999999999994, 0, 0,
        -0.49999999999999994, 0.8660254037844387, 0, 0,
        0, 0, 1, 0,
        0, 0, 0, 1
      ]
    }
  ]
}

Recognized-but-not-simulated keyword — consumed with a SiemensFrame–Unsupported warning, zero transform effect (the JSON shape shows only the consumption; no chain entry, no section beyond the first-block default): #BeforeBuild:

{ "Parsing": { "SCALE": { "Statement": "X2 Y2" } } }

#AfterBuild:

{ "TiltTransform": { "Term": "G69" } }

Solid-angle pair X,Y — ROTS X30 Y40 applies X first, then Y about the original axis (row-vector Rx·Ry); the resulting first row (the new X axis) has a zero Y component — the manual's “the new X axis lies in the old Z/X plane”: #BeforeBuild:

{ "Parsing": { "ROTS": { "X": 30, "Y": 40 } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "ROTS", "X": 30, "Y": 40 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [
        0.766044443118978, 0, -0.6427876096865393, 0,
        0.32139380484326957, 0.8660254037844387, 0.38302222155948895, 0,
        0.5566703992264194, -0.49999999999999994, 0.6634139481689384, 0,
        0, 0, 0, 1
      ]
    }
  ]
}

Solid-angle pair Y,Z additively composed onto a previous translation — M = (Ry(20°)·Rz(50°)) · T(10,0,0): the second row (the new Y axis) has a zero Z component — “the new Y axis lies in the old X/Y plane” — and the translation column survives: #Previous:

{
  "TiltTransform": { "Term": "TRANS", "X": 10 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 10,0,0,1]
    }
  ]
}

#BeforeBuild:

{ "Parsing": { "AROTS": { "Y": 20, "Z": 50 } } }

#AfterBuild:

{
  "TiltTransform": { "Term": "AROTS", "Y": 20, "Z": 50 },
  "ProgramToMcTransform": [
    {
      "Source": "TiltTransform",
      "Kind": "Static",
      "Mat4d": [
        0.6040227735550537, 0.7198463103929542, -0.3420201433256687, 0,
        -0.766044443118978, 0.6427876096865394, 0, 0,
        0.2198463103929542, 0.2620026302293849, 0.9396926207859084, 0,
        10, 0, 0, 1
      ]
    }
  ]
}

Three solid angles fall outside the documented grammar (“up to 2 solid angles may be programmed”) — the statement is left unapplied with a SiemensFrame–SolidAngleInvalid warning and the residue stays visible for the Parsing–Unconsumed report: #BeforeBuild:

{ "Parsing": { "ROTS": { "X": 10, "Y": 20, "Z": 30 } } }

#AfterBuild:

{
  "Parsing": { "ROTS": { "X": 10, "Y": 20, "Z": 30 } },
  "TiltTransform": { "Term": "G69" }
}

Constructors

SiemensProgrammableFrameSyntax()

Initializes a new instance with default settings.

public SiemensProgrammableFrameSyntax()

SiemensProgrammableFrameSyntax(XElement)

Initializes a new instance by deserializing from the given XML element.

public SiemensProgrammableFrameSyntax(XElement src)

Parameters

src XElement

Source XML element.

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name used to register this syntax with XFactory.

public static string XName { get; }

Property Value

string

Methods

Build(LazyLinkedListNode<SyntaxPiece>, List<INcDependency>, NcDiagnosticProgress)

Build syntax arrangement into the syntaxPieceNode in-place.

public void Build(LazyLinkedListNode<SyntaxPiece> syntaxPieceNode, List<INcDependency> ncDependencyList, NcDiagnosticProgress ncDiagnosticProgress)

Parameters

syntaxPieceNode LazyLinkedListNode<SyntaxPiece>
ncDependencyList List<INcDependency>
ncDiagnosticProgress NcDiagnosticProgress

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public XElement MakeXmlSource(string baseDirectory, string relFile, bool exhibitionOnly)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

exhibitionOnly bool

if true, the extended file creation is suppressed.

Returns

XElement

An XML element representing the object's state

Remarks

For the demand of easy moving source folder (especially project folder) without configuration file path corruption, the relative file path is applied. The baseDirectory is typically the folder at the nearest configuration file folder. Since the folder can be moving with the configuration file.

Reg(XFactory)

Registers this type's deserializer with the given XFactory (or Default when factory is null). Idempotent.

public static void Reg(XFactory factory = null)

Parameters

factory XFactory