Class SiemensAcIcSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Siemens
- Assembly
- HiMech.dll
Recognizes the Siemens per-word coordinate function family on axis
words — AC(...) (absolute), IC(...) (incremental),
DC(...) (rotary shortest-path), ACP(...) /
ACN(...) (rotary directional approach), and the coded-position
(indexing axis) counterparts CAC(...) / CIC(...) /
CDC(...) / CACP(...) / CACN(...) — e.g.
X=AC(400), C=IC(360/17), C=DC(47.296),
B=CAC(2) — unwraps the inner
expression so the downstream VariableEvaluatorSyntax
resolves it through the normal Siemens expression machinery, and
records the per-word positioning override in a block-root
PositioningOverride section keyed by word name
(Absolute /
Incremental /
Shortest /
PositiveOnly /
NegativeOnly, and the
Coded* values for the coded-position verbs).
Siemens semantics: the wrapper forces the interpretation of that one coordinate word for that one block, regardless of the modal G90/G91 state. The positional conversion itself stays with the same consumers that honor the modal state — IncrementalResolveSyntax for linear axes and McAbcSyntax for rotary axes (both treat every non-Incremental override as an absolute write), while the rotary shortest/directional resolution stays with the McAbcCyclicPathSyntax tail-pass — this syntax only normalizes the text and stamps the override; it never reads machine position (the Evaluation stage is not the place for position-state reads).
Scope: axis words (per AxisNames,
falling back to X/Y/Z/A/B/C) accept the full family, except that the
rotary-only verbs DC/ACP/ACN are unwrapped only
on rotary axes (per IsRotaryAxis(string),
falling back to A/B/C) — on a linear axis they are invalid Siemens
and are left untouched so they surface as unevaluated residue
instead of being silently mis-read. The interpolation parameters
I/J/K accept AC/IC only (Siemens circle centers are
incremental by default; I=AC(...) switches that one component
to an absolute center coordinate, consumed by
SiemensCircularMotionSyntax) —
the rotary verbs are meaningless there and are left untouched.
The coded-position verbs (their argument is a 1-based indexing
position number, not a coordinate) are unwrapped only on axes
that IsIndexingAxis(string) reports as
usable indexing axes — CDC/CACP/CACN
additionally require the axis to be rotary. Everywhere else (a
non-indexing axis, no indexing config on the list, I/J/K) they stay
untouched, mirroring the Siemens alarm 17500 ("axis is not an
indexing axis") with loud unevaluated residue. The number→coordinate
lookup happens at the write stage
(McAbcSyntax /
IncrementalResolveSyntax via
CodedPositionUtil), not here — the
Evaluation stage neither reads machine position nor resolves tables.
Positioning-axis forms (POS[C]=DC(...) / SPOS=) never
reach the word path and are out of scope. Values whose parentheses
do not balance around the wrapper (e.g. IC(1)+AC(2)) are also
left untouched.
Must be placed in the Evaluation bundle before VariableEvaluatorSyntax (the unwrapped inner text is a plain Siemens expression the evaluator numeric-ifies on the same block). Inside REPEAT / subprogram splices each re-fed piece runs the full bundle again, so the unwrap happens on every iteration.
public class SiemensAcIcSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
SiemensAcIcSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
C=IC(360/17) (the HUA08126 REPEAT shape) — the wrapper is
unwrapped to the inner expression (still a string; the evaluator
numeric-ifies it later on the same block) and the override section
records the per-word incremental interpretation:
#BeforeBuild:
{ "Parsing": { "C": "IC(360/17)" } }
#AfterBuild:
{
"Parsing": { "C": "360/17" },
"PositioningOverride": { "C": "Incremental" }
}
X=AC(25) — absolute override; the inner literal stays a string
here (pass-2 of the evaluator turns it numeric):
#BeforeBuild:
{ "Parsing": { "X": "AC(25)" } }
#AfterBuild:
{
"Parsing": { "X": "25" },
"PositioningOverride": { "X": "Absolute" }
}
A plain expression without the wrapper is not touched and no override section appears: #BeforeBuild:
{ "Parsing": { "X": "R5+2" } }
#AfterBuild:
{ "Parsing": { "X": "R5+2" } }
Unbalanced wrapper parentheses (IC(1)+AC(2) — the outer regex
shape matches but the inner text closes the wrapper early) — left
untouched so it surfaces as unevaluated residue instead of a silent
mis-read:
#BeforeBuild:
{ "Parsing": { "X": "IC(1)+AC(2)" } }
#AfterBuild:
{ "Parsing": { "X": "IC(1)+AC(2)" } }
C=DC(47.296) (the A055548 corpus shape, 6632 lines in one
program) — rotary shortest-path: unwrapped like AC and stamped
Shortest; the write stays absolute and the shortest swing is
the unconditional McAbcCyclicPathSyntax
tail-pass for modular rotary axes (an exactly-180° target resolves
deterministically to the negative swing — the tail-pass window is
half-open [anchor-180°, anchor+180°); real controls make that
measure-zero tie machine-data-dependent):
#BeforeBuild:
{ "Parsing": { "C": "DC(47.296)" } }
#AfterBuild:
{
"Parsing": { "C": "47.296" },
"PositioningOverride": { "C": "Shortest" }
}
X=DC(90) — the rotary-only verb on a linear axis is invalid
Siemens (real controls alarm): left untouched, loud residue instead
of a silent absolute conversion:
#BeforeBuild:
{ "Parsing": { "X": "DC(90)" } }
#AfterBuild:
{ "Parsing": { "X": "DC(90)" } }
C=ACP(270) — absolute target, positive-direction-only
approach (may deliberately take the long way around):
#BeforeBuild:
{ "Parsing": { "C": "ACP(270)" } }
#AfterBuild:
{
"Parsing": { "C": "270" },
"PositioningOverride": { "C": "PositiveOnly" }
}
C=ACN(90) — the negative-direction mirror:
#BeforeBuild:
{ "Parsing": { "C": "ACN(90)" } }
#AfterBuild:
{
"Parsing": { "C": "90" },
"PositioningOverride": { "C": "NegativeOnly" }
}
I=AC(400) — interpolation parameter switched to an absolute
center coordinate (Siemens I/J/K default incremental); consumed by
SiemensCircularMotionSyntax:
#BeforeBuild:
{ "Parsing": { "I": "AC(400)" } }
#AfterBuild:
{
"Parsing": { "I": "400" },
"PositioningOverride": { "I": "Absolute" }
}
I=DC(10) — rotary verbs are meaningless on interpolation
parameters: left untouched, loud residue:
#BeforeBuild:
{ "Parsing": { "I": "DC(10)" } }
#AfterBuild:
{ "Parsing": { "I": "DC(10)" } }
The coded-position cases below inject a
SiemensMachineDataTable declaring C rotary and X linear, both
assigned to indexing table 1 = [0, 90, 180, 270] (the values
double as mm for X). C=CAC(3) — coded absolute: the inner
text (a position number expression, numeric-ified later by the
evaluator like every other case) is unwrapped and the coded override
is stamped; the number→angle lookup stays with the write-stage
consumers:
#BeforeBuild:
{ "Parsing": { "C": "CAC(3)" } }
#AfterBuild:
{
"Parsing": { "C": "3" },
"PositioningOverride": { "C": "CodedAbsolute" }
}
C=CIC(2) — coded incremental (advance two indexing
positions):
#BeforeBuild:
{ "Parsing": { "C": "CIC(2)" } }
#AfterBuild:
{
"Parsing": { "C": "2" },
"PositioningOverride": { "C": "CodedIncremental" }
}
C=CDC(4) — coded shortest-path:
#BeforeBuild:
{ "Parsing": { "C": "CDC(4)" } }
#AfterBuild:
{
"Parsing": { "C": "4" },
"PositioningOverride": { "C": "CodedShortest" }
}
C=CACP(2) — coded positive-direction-only:
#BeforeBuild:
{ "Parsing": { "C": "CACP(2)" } }
#AfterBuild:
{
"Parsing": { "C": "2" },
"PositioningOverride": { "C": "CodedPositiveOnly" }
}
C=CACN(2) — coded negative-direction-only:
#BeforeBuild:
{ "Parsing": { "C": "CACN(2)" } }
#AfterBuild:
{
"Parsing": { "C": "2" },
"PositioningOverride": { "C": "CodedNegativeOnly" }
}
C=CAC(3) with no indexing config on the dependency list (this
case injects none) — the axis is not an indexing axis, so the word
stays untouched and surfaces as loud unevaluated residue (the
Siemens control raises alarm 17500 here):
#BeforeBuild:
{ "Parsing": { "C": "CAC(3)" } }
#AfterBuild:
{ "Parsing": { "C": "CAC(3)" } }
X=CDC(2) — the rotary coded verbs are invalid on a linear
indexing axis: left untouched, loud residue (X=CAC(2) /
X=CIC(2) would unwrap):
#BeforeBuild:
{ "Parsing": { "X": "CDC(2)" } }
#AfterBuild:
{ "Parsing": { "X": "CDC(2)" } }
I=CAC(3) — interpolation parameters take no coded verbs:
#BeforeBuild:
{ "Parsing": { "I": "CAC(3)" } }
#AfterBuild:
{ "Parsing": { "I": "CAC(3)" } }
Constructors
SiemensAcIcSyntax()
Initializes a new instance with default settings.
public SiemensAcIcSyntax()
SiemensAcIcSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public SiemensAcIcSyntax(XElement src)
Parameters
srcXElementSource XML element.
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name used to register this syntax with XFactory.
public static string XName { get; }
Property Value
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
syntaxPieceNodeLazyLinkedListNode<SyntaxPiece>ncDependencyListList<INcDependency>ncDiagnosticProgressNcDiagnosticProgress
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
baseDirectorystringThe base directory for resolving relative paths
relFilestringThe relative file path for the XML source
exhibitionOnlyboolif 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
factoryXFactory