Class ProgramRxczSyntax
- Namespace
- Hi.NcParsers.LogicSyntaxs
- Assembly
- HiMech.dll
Polar-mode sibling of ProgramXyzSyntax: while the PolarInterpolationState valve section is present, consumes the block's X/C/Z words as polar hypothetical-plane coordinates (X = diameter, halved; C = hypothetical axis in mm) and writes:
- ProgramPolarRxcz — the
anchor-relative polar position (G90/G91 resolved against the previous
block's position, mirroring HardNc
NcGroup03.GetNcFromSyntax); - ProgramXyz — the derived ordinary program position (radius, previous program Y, Z), so the downstream McXyzSyntax derives machine XYZ through the normal transform chain — ProgramXyzSyntax itself naturally no-ops because the axis words are already consumed;
- the machine C angle (degrees) into MachineCoordinateState — placed before McAbcSyntax, which then preserves the value instead of treating C as a directly-commanded rotary word;
- on motion-programmed blocks, MotionState and a MotionEvent with McPolarLinear (G00/G01) or McPolarArc (G02/G03 with R or I/J/K resolved on the hypothetical plane).
public class ProgramRxczSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
ProgramRxczSyntax
- Implements
- Inherited Members
- Extension Methods
Examples
G90 linear move along the radius axis — the X word is a diameter (X20 → radius 10), the missing C word carries over from the previous polar position, the machine C angle is written in degrees: #Previous:
{ "ProgramPolarRxcz": { "X": 58, "Y": 0, "Z": 25 }, "MachineCoordinateState": { "X": 58, "Y": 0, "Z": 25, "C": 0 } }
#BeforeBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"Parsing": { "X": 20, "Z": 2, "Flags": ["G01"] }
}
#AfterBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 2 },
"ProgramXyz": { "X": 10, "Y": 0, "Z": 2 },
"MachineCoordinateState": { "C": 0 },
"MotionState": { "Term": "G01" },
"MotionEvent": { "Form": "McPolarLinear" }
}
Hypothetical-axis move to the 90° branch — the C word is a Cartesian
millimeter coordinate on the hypothetical plane; the machine C angle
follows by atan2 with chained branch resolution:
#Previous:
{ "ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 2 }, "MachineCoordinateState": { "X": 10, "Y": 0, "Z": 2, "C": 0 } }
#BeforeBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"Parsing": { "X": 0, "C": 10, "Flags": ["G01"] }
}
#AfterBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"ProgramPolarRxcz": { "X": 0, "Y": 10, "Z": 2 },
"ProgramXyz": { "X": 10, "Y": 0, "Z": 2 },
"MachineCoordinateState": { "C": 90 },
"MotionState": { "Term": "G01" },
"MotionEvent": { "Form": "McPolarLinear" }
}
G02 arc on the hypothetical plane with an I word — I/J are start→center increments in plane millimeters (not halved, unlike the X endpoint word); the center is stored in anchor-origin (central) coordinates: #Previous:
{ "ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 0 }, "MachineCoordinateState": { "X": 10, "Y": 0, "Z": 0, "C": 0 } }
#BeforeBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"Parsing": { "X": 0, "C": -10, "I": -10, "Flags": ["G02"] }
}
#AfterBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"ProgramPolarRxcz": { "X": 0, "Y": -10, "Z": 0 },
"ProgramXyz": { "X": 10, "Y": 0, "Z": 0 },
"MachineCoordinateState": { "C": -90 },
"MotionState": { "Term": "G02" },
"MotionEvent": { "Form": "McPolarArc", "ArcCenter": { "X": 0, "Y": 0, "Z": 0 }, "IsCcw": false, "AdditionalCircleNum": 0 }
}
G91 incremental — the X increment is still a diameter value (halved), components without words stay put: #Previous:
{ "ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 2 }, "MachineCoordinateState": { "X": 10, "Y": 0, "Z": 2, "C": 0 } }
#BeforeBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G91", "Mode": "Incremental" },
"Parsing": { "X": 10, "Z": -1, "Flags": ["G01"] }
}
#AfterBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G91", "Mode": "Incremental" },
"ProgramPolarRxcz": { "X": 15, "Y": 0, "Z": 1 },
"ProgramXyz": { "X": 15, "Y": 0, "Z": 1 },
"MachineCoordinateState": { "C": 0 },
"MotionState": { "Term": "G01" },
"MotionEvent": { "Form": "McPolarLinear" }
}
Non-motion block inside polar mode (e.g. a bare M08) — the polar position is still carried and the derived sections written, but no motion sections appear and the unrelated flag is untouched: #Previous:
{ "ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 2 }, "MachineCoordinateState": { "X": 10, "Y": 0, "Z": 2, "C": 0 } }
#BeforeBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"Parsing": { "Flags": ["M08"] }
}
#AfterBuild:
{
"PolarInterpolationState": { "Dir": "XC", "InitRxcz": { "X": 0, "Y": 0, "Z": 0 } },
"Positioning": { "Term": "G90", "Mode": "Absolute" },
"Parsing": { "Flags": ["M08"] },
"ProgramPolarRxcz": { "X": 10, "Y": 0, "Z": 2 },
"ProgramXyz": { "X": 10, "Y": 0, "Z": 2 },
"MachineCoordinateState": { "C": 0 }
}
Constructors
ProgramRxczSyntax()
Initializes a new instance with default settings.
public ProgramRxczSyntax()
ProgramRxczSyntax(XElement)
Initializes a new instance by deserializing from the given XML element.
public ProgramRxczSyntax(XElement src)
Parameters
srcXElementSource XML element.
Fields
ArcCenterNotFoundDiagId
Diagnostic id for a modal G02/G03 polar block whose arc center cannot
be resolved (no R / I/J/K). Mirrors HardNc
GetActSpiralMcXyzContour–CircleCenterNotFound.
public const string ArcCenterNotFoundDiagId = "FanucPolar--ArcCenterNotFound"
Field Value
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