Table of Contents

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:

  1. records the literal write on the block JSON under Vars.SystemControl (round-trip and cache-dump visibility);
  2. emits a FanucSystemControl--Unsupported UnsupportedMessage(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;
  3. removes the entry from Parsing.Assignments so it does not re-surface as a generic Parsing--Unconsumed diagnostic.

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

src XElement

Fields

SystemControlMax

Inclusive upper bound of the system-control range (#3999).

public const int SystemControlMax = 3999

Field Value

int

SystemControlMin

Inclusive lower bound of the system-control range (#3000).

public const int SystemControlMin = 3000

Field Value

int

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

string

Properties

Name

Syntax kind name (typically the concrete type name).

public string Name { get; }

Property Value

string

XName

XML element name for Generators registration.

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