Table of Contents

Class SiemensTraoriSyntax

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

Siemens TRAORI/TRAFOOF (orientation transformation = RTCP): the Siemens sibling of G43p4RtcpSyntax. While TRAORI is active, the IToolHeightCompensationDef section carries Term = “TRAORI” and the ToolHeightCompensation chain entry becomes a tool-normal · offset translation at the block endpoint ABC (MakeToolHeightMat(IMachineKinematics, Vec3d, double)), tagged KindDynamic when the rotary state changes across the block — the single signal that routes the block to MotionForm.ClLinear per-step IK.

Tool length ownership stays with the (T,D) machinery: on real Sinumerik, TRAORI uses the active D edge's length. Activation adopts the compensation the D edge (or a mixed-dialect ISO G43) has already resolved — SiemensToolOffsetSyntax runs earlier in the bundle, so an explicit D1 on any TRAORI-modal block first resolves Term = "D" and this syntax re-takes the section with the fresh Offset_mm. The adopted owner is recorded in PriorTermKey; TRAFOOF hands the section back to it (default "D"), because plain length compensation survives TRAORI deactivation on the control — TRAFOOF only ends the orientation-following. A TRAFOOF with no active TRAORI (the corpus' ubiquitous defensive preamble) is consumed silently.

Must run after ToolHeightOffsetSyntax / SiemensToolOffsetSyntax / the coordinate-offset syntaxes (mirroring G43p4RtcpSyntax's Fanuc slot) and before SiemensPivotTransformationSyntax, whose gate recognizes the TRAORI term and folds the kinematic pivot. Silently degrades to a plain UnitZ · offset translation when IMachineKinematics is absent.

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

Examples

Activation with no prior compensation and no kinematics — the section is taken with zero offset and the chain entry collapses to identity (Static: no rotary change is observable on a single block): #BeforeBuild:

{ "Parsing": { "Flags": ["TRAORI"] } }

#AfterBuild:

{
  "ToolHeightCompensation": { "Offset_mm": 0, "Term": "TRAORI", "OffsetId": 0 },
  "ProgramToMcTransform": [
    {
      "Source": "ToolHeightCompensation",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,0,1]
    }
  ]
}

Activation adopting the D edge resolved earlier on the same block (SiemensToolOffsetSyntax has already written Term = “D” and its entry) — the section is re-taken with the fresh offset and the owner recorded for the TRAFOOF hand-back: #BeforeBuild:

{
  "Parsing": { "Flags": ["TRAORI"] },
  "ToolHeightCompensation": { "Offset_mm": 50, "Term": "D", "OffsetId": 2 },
  "ProgramToMcTransform": [
    {
      "Source": "ToolHeightCompensation",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,50,1]
    }
  ]
}

#AfterBuild:

{
  "ToolHeightCompensation": {
    "Offset_mm": 50, "Term": "TRAORI", "OffsetId": 2, "PriorTerm": "D"
  },
  "ProgramToMcTransform": [
    {
      "Source": "ToolHeightCompensation",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,50,1]
    }
  ]
}

Modal continuation — no flag on the block, the previous block carries the TRAORI section; the snapshot (incl. the recorded owner) is carried and the entry rebuilt: #Previous:

{
  "ToolHeightCompensation": {
    "Offset_mm": 50, "Term": "TRAORI", "OffsetId": 2, "PriorTerm": "D"
  }
}

#BeforeBuild:

{}

#AfterBuild:

{
  "ToolHeightCompensation": {
    "Offset_mm": 50, "Term": "TRAORI", "OffsetId": 2, "PriorTerm": "D"
  },
  "ProgramToMcTransform": [
    {
      "Source": "ToolHeightCompensation",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,50,1]
    }
  ]
}

TRAFOOF hand-back — the section returns to the recorded owner (“D”), the plain translation entry is rebuilt, and the D modal re-resolve resumes on following blocks: #Previous:

{
  "ToolHeightCompensation": {
    "Offset_mm": 50, "Term": "TRAORI", "OffsetId": 2, "PriorTerm": "D"
  }
}

#BeforeBuild:

{ "Parsing": { "Flags": ["TRAFOOF"] } }

#AfterBuild:

{
  "ToolHeightCompensation": { "Offset_mm": 50, "Term": "D", "OffsetId": 2 },
  "ProgramToMcTransform": [
    {
      "Source": "ToolHeightCompensation",
      "Kind": "Static",
      "Mat4d": [1,0,0,0, 0,1,0,0, 0,0,1,0, 0,0,50,1]
    }
  ]
}

Defensive TRAFOOF with no active TRAORI (corpus preamble idiom) — consumed silently, nothing written: #BeforeBuild:

{ "Parsing": { "Flags": ["TRAFOOF"] } }

#AfterBuild:

{}

Constructors

SiemensTraoriSyntax()

Initializes a new instance with default settings.

public SiemensTraoriSyntax()

SiemensTraoriSyntax(XElement)

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

public SiemensTraoriSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

PriorTermKey

Extra ToolHeightCompensation section key recording which owner's compensation TRAORI adopted at activation (“D” or an ISO term) — the term TRAFOOF hands the section back to. Absent when TRAORI activated with no prior compensation (hand-back then defaults to “D”, the native Siemens owner).

public const string PriorTermKey = "PriorTerm"

Field Value

string

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