Table of Contents

Class SiemensProgrammableFrameSyntax

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

Siemens programmable frame (TRANS/ATRANS/ROT/AROT incl. RPL=): 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.

ROTS/AROTS/SCALE/ASCALE/MIRROR/AMIRROR (zero corpus occurrences; SCALE/MIRROR would inject non-rigid matrices that downstream consumers have never been audited for) 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 G53p1RotaryPositionSyntax / 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": { "ROTS": { "Statement": "X30 Y40" } } }

#AfterBuild:

{ "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