Class CodedPositionUtil
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Shared coded-position resolution for the write-stage consumers
(McAbcSyntax for rotary words,
IncrementalResolveSyntax for linear words): turns a
per-word PositioningOverride entry of the coded family
(CodedAbsolute /
CodedIncremental /
CodedShortest /
CodedPositiveOnly /
CodedNegativeOnly — stamped by
SiemensAcIcSyntax for
CAC()/CIC()/CDC()/CACP()/CACN())
plus the evaluated position number into an axis coordinate via
IIndexingPositionConfig, and names the plain override
value the caller rewrites the entry to — so the
McAbcCyclicPathSyntax tail-pass and every other
downstream reader only ever see the established non-coded vocabulary.
Failure semantics mirror the Siemens alarms as far as a simulator can:
an invalid position number (alarm 17510) or a missing table reports an
error diagnostic and resolves to "hold" — the caller writes the anchor
so the axis does not move. CIC(0) also resolves to hold, by
specification ("the indexing axis is not traversed") and silently.
A CIC from between two indexing positions advances to the n-th
next position in the programmed direction. On a cyclic indexing axis
the incremental sign becomes a directional
(PositiveOnly /
NegativeOnly) approach; increments spanning
more than one revolution reach the correct position but collapse the
extra full turns (the tail-pass windows cover one revolution).
public static class CodedPositionUtil
- Inheritance
-
CodedPositionUtil
- Inherited Members
Fields
ConfigMissingDiagId
Diagnostic id for a coded-position word whose axis no longer resolves an indexing table at the write stage (the unwrap stage only stamps coded overrides for configured indexing axes, so this indicates the dependency list changed between stages). The axis holds its position.
public const string ConfigMissingDiagId = "CodedPosition--ConfigMissing"
Field Value
NumberInvalidDiagId
Diagnostic id for a coded position number the indexing table cannot
resolve: not an integer, outside the table, or (via CIC)
advanced past the end of a non-cyclic table. The Siemens control
raises alarm 17510 and stops; the simulation reports this error and
holds the axis.
public const string NumberInvalidDiagId = "CodedPosition--NumberInvalid"
Field Value
Methods
IsCodedOverride(string)
True when overrideValue is one of the five
coded-position PositioningOverride values.
public static bool IsCodedOverride(string overrideValue)
Parameters
overrideValuestring
Returns
TryResolveCodedTarget(IIndexingPositionConfig, string, string, double, double, ISentenceCarrier, NcDiagnosticProgress, out double, out string)
Resolves a coded-position word to its target axis coordinate.
Returns true with the target position; false means “hold” — the
caller writes anchorPosition instead (no motion
on this axis), with any error already reported.
resolvedOverride is always set to the plain
override value the caller stamps over the coded entry
(Absolute on every hold).
public static bool TryResolveCodedTarget(IIndexingPositionConfig indexingConfig, string axis, string codedOverride, double parsedValue, double anchorPosition, ISentenceCarrier sentenceCarrier, NcDiagnosticProgress diag, out double targetPosition, out string resolvedOverride)
Parameters
indexingConfigIIndexingPositionConfigIndexing table, or null when the dependency list carries none.
axisstringAxis name (e.g., “C”).
codedOverridestringThe coded PositioningOverride entry value.
parsedValuedoubleEvaluated word value — the position number (or count, for CodedIncremental).
anchorPositiondoubleCurrent axis position, used as the
CICanchor and as the hold target.sentenceCarrierISentenceCarrierBlock to anchor diagnostics to.
diagNcDiagnosticProgressDiagnostic sink; may be null.
targetPositiondoubleResolved target axis coordinate.
resolvedOverridestringPlain override value to stamp over the coded entry.