Table of Contents

Class SiemensRParameterTable

Namespace
Hi.NcParsers.Dependencys.Siemens
Assembly
HiMech.dll

Sinumerik R-parameter table (R0-R999). R parameters are the Siemens arithmetic-variable surface (R63=100.5, C=R61, R26=(558.5+14)/2); on real hardware they live in retentive memory (sized by MD28050) and survive program end and power cycles, so — like the Fanuc sibling RetainedCommonVariableTable — this table is not session-reset and is serialised into the project file.

Reads flow through Get(string) (registered automatically because the table sits on the runner's effective NcDependencyList); writes flow through SiemensRParameterReadingSyntax, which consumes literal Parsing.Assignments.Rn entries after VariableEvaluatorSyntax has normalized expression RHS to literals.

Vacant is represented by null: either the dictionary has no entry for the key, or the entry maps to null — both read identically. Real Sinumerik default-initialises every allocated R to 0, but a vacant read failing loud (Variable--Vacant via the evaluator) surfaces missing setup data instead of silently machining with 0.

public class SiemensRParameterTable : INcDependency, IMakeXmlSource, IVariableLookup
Inheritance
SiemensRParameterTable
Implements
Inherited Members
Extension Methods

Constructors

SiemensRParameterTable()

Empty table.

public SiemensRParameterTable()

SiemensRParameterTable(XElement)

Loads from XML produced by MakeXmlSource(string, string, bool).

public SiemensRParameterTable(XElement src)

Parameters

src XElement

Fields

RParameterMax

Inclusive upper bound of the R-parameter range (R999). Real machines size this by MD28050 MM_NUM_R_PARAM (often 100); 999 covers the extended ranges seen in the corpus (R400+) without machine data.

public const int RParameterMax = 999

Field Value

int

RParameterMin

Inclusive lower bound of the R-parameter range (R0).

public const int RParameterMin = 0

Field Value

int

Properties

Variables

Backing store. Key = R-parameter number (e.g. 63 for R63). Value null = vacant; a missing key is also vacant. Keys are constrained to RParameterMin..RParameterMax; out-of-range writes are silently ignored.

public Dictionary<int, double?> Variables { get; set; }

Property Value

Dictionary<int, double?>

XName

XML element name.

public static string XName { get; }

Property Value

string

Methods

Get(string)

Returns the value of the variable identified by key (e.g. "#124"), or null if vacant or unknown to this lookup.

public double? Get(string key)

Parameters

key string

Returns

double?

Remarks

Routes Rn keys (canonical form produced by SiemensExpressionParser; a lowercase rn from a raw capture also resolves) to GetVariable(int); other keys return null so the evaluator's lookup chain falls through.

GetVariable(int)

Reads an R parameter. Returns null for vacant (either the entry is absent or stored as null).

public double? GetVariable(int id)

Parameters

id int

Parameter number in RParameterMin..RParameterMax.

Returns

double?

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

SetVariable(int, double?)

Writes an R parameter. Pass null to set vacant. Ignores ids outside RParameterMin..RParameterMax.

public void SetVariable(int id, double? value)

Parameters

id int

Parameter number.

value double?

New value, or null for vacant.