Table of Contents

Class FanucParameterTable

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

Fanuc controller parameter table. Stores system parameters (single value) and axis parameters (per-axis value) under keys numbered after FANUC's parameters. The keys are this table's own: some are a FANUC 0i-C's number for the value they hold (the first reference position 1240, the rapid traverse rate 1420, the maximum spindle speed for gear 1, 3741), and the keys known not to be are marked by IsStorageKeyOnly(int). Values are in mm, deg and rpm (a FANUC 0i-C keeps positions as integers in its least increment).

public class FanucParameterTable : ControllerParameterTableBase, IHomeMcConfig, IMachineAxisConfig, IRapidFeedrateConfig, IStrokeLimitConfig, ISpindleControlConfig, IMCodeDeclarationConfig, IToolChangeTriggerConfig, ICannedCycleConfig, IIsoCoordinateConfig, INcDependency, IMakeXmlSource, IVariableLookup
Inheritance
FanucParameterTable
Implements
Inherited Members
Extension Methods

Constructors

FanucParameterTable()

Initializes a new instance, seeding Param1020, Param3741, Param5003, and the ISO G54-G59/G54.1 P-table coordinate offsets with their default values.

public FanucParameterTable()

FanucParameterTable(XElement)

Initializes a new instance by deserializing from src.

public FanucParameterTable(XElement src)

Parameters

src XElement

XML element produced by MakeXmlSource(string, string, bool).

Fields

CoordOffsetMax

Inclusive upper bound of the G54-G59 work coordinate offset address range (#5328).

public const int CoordOffsetMax = 5328

Field Value

int

CoordOffsetMin

Inclusive lower bound of the G54-G59 work coordinate offset address range (#5221).

public const int CoordOffsetMin = 5221

Field Value

int

ExtCoordOffsetMax

Inclusive upper bound of the G54.1 P-table extended offset range (#7999).

public const int ExtCoordOffsetMax = 7999

Field Value

int

ExtCoordOffsetMin

Inclusive lower bound of the G54.1 P-table extended offset range (#7001).

public const int ExtCoordOffsetMin = 7001

Field Value

int

ParamAxisType

#1006: Axis type per axis, stored as the AxisType ordinal (0 linear / 1 rotary / 2 spindle). A FANUC 0i-C's No. 1006 holds bit flags instead, so a value read off the control does not copy across as it is.

public const int ParamAxisType = 1006

Field Value

int

ParamControlledAxes

Storage key 1020 of the number of controlled axes: HiNC's own key, not FANUC's parameter number for it (on a FANUC 0i-C No. 1020 is each axis' program axis name, and the number of controlled axes is No. 1010). See IsStorageKeyOnly(int).

public const int ParamControlledAxes = 1020

Field Value

int

ParamCutterCompType

#5003: Cutter compensation startup type, stored as the CutterCompensationType ordinal. A FANUC 0i-C's No. 5003 holds bit flags instead, so a value read off the control does not copy across as it is.

public const int ParamCutterCompType = 5003

Field Value

int

ParamG54OffsetBase

#5221: Base address (X) of G54 work coordinate offset. G54.Y at +1 (#5222), G54.Z at +2 (#5223). G55..G59 follow at stride 20. See IsoCoordinateAddressMap.

public const int ParamG54OffsetBase = 5221

Field Value

int

ParamG54p1P1OffsetBase

#7001: Base address (X) of G54.1 P1 extended work coordinate offset. G54.1 P2..P48 follow at stride 20. See IsoCoordinateAddressMap.

public const int ParamG54p1P1OffsetBase = 7001

Field Value

int

ParamMaxSpindleSpeed

#3741: Maximum spindle speed (RPM) — a FANUC 0i-C's maximum spindle speed for gear 1.

public const int ParamMaxSpindleSpeed = 3741

Field Value

int

ParamPeckRetraction

Storage key 4002 of the peck drilling retract distance — the G73 return and the G83 clearance — in mm: HiNC's own key, not FANUC's parameter number (on a FANUC 0i-C milling control No. 5114 is the G73 return value and No. 5115 the G83 clearance, both in the least input increment; on the lathe series No. 5114 is the G83 return or clearance value). See IsStorageKeyOnly(int).

public const int ParamPeckRetraction = 4002

Field Value

int

ParamRapidRate

#1420: Rapid traverse rate per axis (mm/min or deg/min).

public const int ParamRapidRate = 1420

Field Value

int

ParamReferencePosition

#1240: G28 first reference position per axis, in mm or deg (a FANUC 0i-C's No. 1240 holds the same position as an integer in the least increment).

public const int ParamReferencePosition = 1240

Field Value

int

ParamStrokeLimitNeg

Storage key 1320 of the negative stroke limit per axis (mm or deg): HiNC's own key, not FANUC's parameter number for that limit (on a FANUC 0i-C No. 1320 is the positive end of stored stroke check 1, and No. 1321 the negative one). See IsStorageKeyOnly(int).

public const int ParamStrokeLimitNeg = 1320

Field Value

int

ParamStrokeLimitPos

Storage key 1300 of the positive stroke limit per axis (mm or deg): HiNC's own key, not FANUC's parameter number for that limit (a FANUC 0i-C keeps stored stroke check 1 at No. 1320 positive and No. 1321 negative, in the least increment). See IsStorageKeyOnly(int).

public const int ParamStrokeLimitPos = 1300

Field Value

int

Properties

AxisParam1006

#1006: Axis type per axis. See AxisType. See AxisNames. See IsRotaryAxis(string). See SetAxis(string, AxisType).

public Dictionary<string, int> AxisParam1006 { get; set; }

Property Value

Dictionary<string, int>

AxisParam1240

#1240: G28 first reference position per axis. See IHomeMcConfig. See GetHomePosition(string). See SetHomePosition(string, double).

public Dictionary<string, double> AxisParam1240 { get; set; }

Property Value

Dictionary<string, double>

AxisParam1420

#1420: Rapid traverse rate per axis (mm/min or deg/min). See IRapidFeedrateConfig.

public Dictionary<string, double> AxisParam1420 { get; set; }

Property Value

Dictionary<string, double>

AxisTypeParamId

Parameter/MD/MP number for axis type (linear/rotary/spindle).

protected override int AxisTypeParamId { get; }

Property Value

int

ControlledAxisCount

Number of controlled axes. Delegates to Param1020.

public int ControlledAxisCount { get; set; }

Property Value

int

CoordinateIds

Enumerates the G-code coordinate ids that this provider currently has data for.

public IEnumerable<string> CoordinateIds { get; }

Property Value

IEnumerable<string>

CutterCompType

Cutter compensation startup type. Delegates to Param5003.

public CutterCompensationType CutterCompType { get; set; }

Property Value

CutterCompensationType

Default3Axis

Default 3-axis Fanuc milling machine.

public static FanucParameterTable Default3Axis { get; }

Property Value

FanucParameterTable

IdAttributeName

XML attribute name for the parameter ID (“ParamId”, “MdId”, “MpId”).

protected override string IdAttributeName { get; }

Property Value

string

MaxSpindleSpeed_rpm

Maximum spindle speed in RPM. Delegates to Param3741.

public double MaxSpindleSpeed_rpm { get; set; }

Property Value

double

Param1020

Number of controlled axes, under storage key 1020 (ParamControlledAxes) — not FANUC's parameter number for it, see IsStorageKeyOnly(int). See ControlledAxisCount.

public int Param1020 { get; set; }

Property Value

int

Param3741

#3741: Maximum spindle speed (RPM). See MaxSpindleSpeed_rpm.

public double Param3741 { get; set; }

Property Value

double

Param5003

#5003: Cutter compensation startup type. See CutterCompType.

public CutterCompensationType Param5003 { get; set; }

Property Value

CutterCompensationType

PeckRetractionDistance_mm

G83 peck drilling clearance distance above the previous stroke bottom before re-entering at feed (mm).

public double PeckRetractionDistance_mm { get; }

Property Value

double

RapidRateParamId

Parameter/MD/MP number for rapid traverse rate per axis. Null if not defined for this controller brand.

protected override int? RapidRateParamId { get; }

Property Value

int?

ReferencePositionParamId

Parameter/MD/MP number for reference position (G28 home).

protected override int ReferencePositionParamId { get; }

Property Value

int

StrokeLimitNegParamId

Parameter/MD/MP number for negative stroke limit per axis; IsStorageKeyOnly(int) marks it as a storage key rather than the controller's own number. Null if not defined for this controller brand.

protected override int? StrokeLimitNegParamId { get; }

Property Value

int?

StrokeLimitPosParamId

Parameter/MD/MP number for positive stroke limit per axis; IsStorageKeyOnly(int) marks it as a storage key rather than the controller's own number. Null if not defined for this controller brand.

protected override int? StrokeLimitPosParamId { get; }

Property Value

int?

XName

XML element name used to register this dependency with XFactory.

public static string XName { get; }

Property Value

string

Methods

DeepClone()

Returns an independent deep copy of this table (all three parameter dictionaries cloned). Used by FanucParameterTableProxy to clone its fixed machine-config seed into a host that has no table yet.

public FanucParameterTable DeepClone()

Returns

FanucParameterTable

DescribeAxisParam(int)

Per-axis double counterpart of DescribeSystemParam(int). Covers the role ids the base class consumes (reference position, rapid rate, stroke limits); brand subclasses may override for their own vocabulary or extra numbers.

public override string DescribeAxisParam(int paramId)

Parameters

paramId int

Brand-specific parameter/MD/MP number.

Returns

string

DescribeSystemParam(int)

Short usage label for a well-known system parameter id, or null when the id has no modeled meaning (a raw pass-through row). Brand subclasses extend this with their own well-known numbers; the native parameter UI shows the label next to the raw id so an operator can tell the modeled parameters from free extras.

public override string DescribeSystemParam(int paramId)

Parameters

paramId int

Brand-specific parameter/MD/MP number.

Returns

string

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 Fanuc system-variable reads to SystemParams: #5221-#5328 (G54-G59 work coordinate offsets) and #7001-#7999 (G54.1 P1-P48 extended offsets) are returned directly by parameter address. Other ranges return null so the evaluator's lookup chain can fall through.

IsStorageKeyOnly(int)

Whether the modeled id paramId is only a storage key of this table: the number the table keeps its value under is known not to be the controller's own parameter number for that value, so a value read off a real control goes into such a row by its meaning, and in the unit the row's caption names, never by matching the number. False does not make an id the controller's number: only the ids known to differ are marked. The base class marks the positive and the negative stroke-limit ids; each brand table adds the other keys it knows to differ.

public override bool IsStorageKeyOnly(int paramId)

Parameters

paramId int

Brand-specific parameter/MD/MP number, as the row that DescribeSystemParam(int), DescribeAxisParam(int) or DescribeIntAxisParam(int) describes; a number the table does not model in a section is a free extra there, whatever this answers.

Returns

bool

True for a storage key known not to be the controller's number; false for every other id.

Remarks

Beyond the stroke-limit pair, marks the controlled-axes key 1020 and the peck-retract key 4002.

MakeXmlSource(string, string, bool)

Creates an XML representation of the object. This method may also generate additional resources such as related files.

public override 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

SetCoordinateOffset(string, vec3d_t)

Sets the offset for the given G-code coordinate id.

public void SetCoordinateOffset(string coordId, vec3d_t offset)

Parameters

coordId string
offset vec3d_t

TryGetCoordinateOffset(string, out vec3d_t)

Gets the offset for the given G-code coordinate id. Returns false when no offset is configured for that id by this provider (callers iterate the next provider, or fall back to Zero).

public bool TryGetCoordinateOffset(string coordId, out vec3d_t offset)

Parameters

coordId string

The G-code coordinate id.

offset vec3d_t

The offset, when the method returns true.

Returns

bool