Class FanucSystemControlVariableSyntax
- Namespace
- Hi.NcParsers.EvaluationSyntaxs.Fanuc
- Assembly
- HiMech.dll
Consumes Fanuc-style system-control variable assignments
(#3000-#3999) — alarm trigger (#3000), millisecond and
hour clocks (#3001 / #3002), single-block / feed-hold
bypass flags (#3003 / #3004), pause-with-message
(#3006), mirror-image flags (#3007), date / time
(#3011 / #3012), tool-life data (#3030 /
#3032), etc.
Every id in this range is a controller-side state variable — its authoritative value lives on the real hardware (RTC, alarm bus, override switches, …) and an NC write at most triggers a side effect (clock reset, alarm raise, message-pause prompt). Offline simulation has none of that machinery, so this syntax does not emulate the effect. Instead it:
- records the literal write on the block JSON under
Vars.SystemControl(round-trip and cache-dump visibility); - emits a
FanucSystemControl--UnsupportedUnsupportedMessage(ISentenceCarrier, string, string, object) so the user knows the assignment was recognised but its controller-side effect is not simulated. Message-severity (not Warning) because these writes are safe no-ops offline — every consumed assignment would emit a Warning per block, which would be noisy without signalling anything the user must act on; - removes the entry from
Parsing.Assignmentsso it does not re-surface as a genericParsing--Unconsumeddiagnostic.
The dictionary carries forward block-by-block (same dict-merge pattern
as VolatileVariableReadingSyntax) so a downstream consumer
can read the most recent recorded value via SyntaxPiece linkage.
Only literal numeric RHS values are consumed; non-literal RHS
(e.g. #3002 = #500) is left in Parsing.Assignments for
VariableEvaluatorSyntax to resolve, mirroring the
retained / volatile reading syntaxes.
Fanuc-family only — Siemens uses named system variables
($AC_TIME, $A_DAY, …) and Heidenhain uses
FN18: SYSREAD; neither flows through Parsing.Assignments.#nnn.
public class FanucSystemControlVariableSyntax : ISituNcSyntax, INcSyntax, IMakeXmlSource
- Inheritance
-
FanucSystemControlVariableSyntax
- Implements
- Inherited Members
- Extension Methods
Constructors
FanucSystemControlVariableSyntax()
Default constructor.
public FanucSystemControlVariableSyntax()
FanucSystemControlVariableSyntax(XElement)
Loads from an XML element produced by MakeXmlSource(string, string, bool). No state to deserialise.
public FanucSystemControlVariableSyntax(XElement src)
Parameters
srcXElement
Fields
SystemControlMax
Inclusive upper bound of the system-control range (#3999).
public const int SystemControlMax = 3999
Field Value
SystemControlMin
Inclusive lower bound of the system-control range (#3000).
public const int SystemControlMin = 3000
Field Value
UnsupportedDiagId
Diagnostic id emitted for every consumed #3000-#3999
assignment — recognised by the parser, ignored by simulation.
public const string UnsupportedDiagId = "FanucSystemControl--Unsupported"
Field Value
Properties
Name
Syntax kind name (typically the concrete type name).
public string Name { get; }
Property Value
XName
XML element name for Generators registration.
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