Table of Contents

Class HeidenhainLnOrientationSyntax

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

Heidenhain LN posture rules — the brand adapter between the Parsing.LN vector record (HeidenhainLnSyntax) and the shared OrientationVectorResolveSyntax. Applies the TNC640/TNC7 manual's rules verbatim:

  • T vector present + M128/FUNCTION TCPM active → the tool axis is T ("Tool keeps the set tool orientation").
  • T absent + RTCP active → the tool axis is the surface normal N ("the control maintains the tool perpendicular to the workpiece contour").
  • RTCP inactive → the T vector is ignored, exactly like the control ("the control ignores the direction vector T, even if it is defined in the LN block") — diagnosed as Orientation-Vector--IgnoredNoTcpm, posture untouched.
The chosen vector is written (verbatim within the unit-length tolerance; normalized with a diagnostic beyond it) to the brand-agnostic ToolOrientationKey section; the surface normal is always carried on SurfaceNormalKey — compensation along it (DR2 / 3D-ToolComp) is recognized, not simulated (SurfaceNormal--CompNotSimulated, first LN block of a run only).

RTCP activity is judged dual-source — the same-block Parsing words (M128 / FUNCTION TCPM, before HeidenhainRtcpSyntax consumes them; the same-block on+off contradiction resolves off, the P1 rule) OR the most recent IToolHeightCompensationDef owner term — so an LN block that itself activates RTCP is not silently skipped.

Must run after McAbcSyntax and before OrientationVectorResolveSyntax (the producer/consumer order) and before HeidenhainRtcpSyntax (which reads the resolved endpoint ABC for its Dynamic/Static marking). The vector is interpreted in the untilted program frame; combining LN with an active PLANE tilt is diagnosed (Orientation-Vector--TiltedFrameAssumed), not remapped.

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

Examples

T vector under same-block M128 activation — promoted to the shared ToolOrientation section (M128 record stays for the RTCP syntax); the normal is carried on SurfaceNormal: #BeforeBuild:

{
  "Parsing": {
    "M128": { "Bare": true },
    "LN": {
      "NX": 0, "NY": 0, "NZ": 1,
      "TX": 0.5, "TY": 0, "TZ": 0.8660254
    }
  }
}

#AfterBuild:

{
  "Parsing": { "M128": { "Bare": true } },
  "SurfaceNormal": {
    "Vector": { "X": 0, "Y": 0, "Z": 1 }, "Term": "NX/NY/NZ"
  },
  "ToolOrientation": {
    "Vector": { "X": 0.5, "Y": 0, "Z": 0.8660254 }, "Term": "TX/TY/TZ"
  }
}

RTCP inactive — T ignored (diagnosed), N still carried, no ToolOrientation: #BeforeBuild:

{
  "Parsing": {
    "LN": {
      "NX": 0, "NY": 0, "NZ": 1,
      "TX": 0.5, "TY": 0, "TZ": 0.8660254
    }
  }
}

#AfterBuild:

{
  "SurfaceNormal": {
    "Vector": { "X": 0, "Y": 0, "Z": 1 }, "Term": "NX/NY/NZ"
  }
}

T absent, RTCP active from the previous block's owner term — the normal stands in as the posture source (tool perpendicular to the contour): #Previous:

{
  "ToolHeightCompensation": { "Offset_mm": 0, "Term": "M128", "OffsetId": 0 }
}

#BeforeBuild:

{ "Parsing": { "LN": { "NX": 0.5, "NY": 0, "NZ": 0.8660254 } } }

#AfterBuild:

{
  "SurfaceNormal": {
    "Vector": { "X": 0.5, "Y": 0, "Z": 0.8660254 }, "Term": "NX/NY/NZ"
  },
  "ToolOrientation": {
    "Vector": { "X": 0.5, "Y": 0, "Z": 0.8660254 }, "Term": "NX/NY/NZ"
  }
}

Zero T vector — diagnosed, posture untouched (the Syntec COR-159 analogue); the N-less record leaves no SurfaceNormal either: #Previous:

{
  "ToolHeightCompensation": { "Offset_mm": 0, "Term": "M128", "OffsetId": 0 }
}

#BeforeBuild:

{ "Parsing": { "LN": { "TX": 0, "TY": 0, "TZ": 0 } } }

#AfterBuild:

{}

Constructors

HeidenhainLnOrientationSyntax()

Initializes a new instance with default settings.

public HeidenhainLnOrientationSyntax()

HeidenhainLnOrientationSyntax(XElement)

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

public HeidenhainLnOrientationSyntax(XElement src)

Parameters

src XElement

Source XML element.

Fields

NVectorTerm

Term recorded when the posture source is the surface normal.

public const string NVectorTerm = "NX/NY/NZ"

Field Value

string

TVectorTerm

Term recorded when the posture source is the tool vector.

public const string TVectorTerm = "TX/TY/TZ"

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