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) following real Fanuc parameter numbering.
public class FanucParameterTable : ControllerParameterTableBase, IHomeMcConfig, IMachineAxisConfig, IRapidFeedrateConfig, IStrokeLimitConfig, 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
srcXElementXML 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
CoordOffsetMin
Inclusive lower bound of the G54-G59 work coordinate offset address range (#5221).
public const int CoordOffsetMin = 5221
Field Value
ExtCoordOffsetMax
Inclusive upper bound of the G54.1 P-table extended offset range (#7999).
public const int ExtCoordOffsetMax = 7999
Field Value
ExtCoordOffsetMin
Inclusive lower bound of the G54.1 P-table extended offset range (#7001).
public const int ExtCoordOffsetMin = 7001
Field Value
ParamAxisType
#1006: Axis type per axis. See AxisType.
public const int ParamAxisType = 1006
Field Value
ParamControlledAxes
#1020: Number of controlled axes.
public const int ParamControlledAxes = 1020
Field Value
ParamCutterCompType
#5003: Cutter compensation startup type. See CutterCompensationType.
public const int ParamCutterCompType = 5003
Field Value
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
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
ParamMaxSpindleSpeed
#3741: Maximum spindle speed (RPM).
public const int ParamMaxSpindleSpeed = 3741
Field Value
ParamPeckRetraction
#4002: G83 peck drilling retraction distance (mm). Fanuc stores this value in mm directly in the system parameter.
public const int ParamPeckRetraction = 4002
Field Value
ParamRapidRate
#1420: Rapid traverse rate per axis (mm/min or deg/min).
public const int ParamRapidRate = 1420
Field Value
ParamReferencePosition
#1240: G28 first reference position per axis.
public const int ParamReferencePosition = 1240
Field Value
ParamStrokeLimitNeg
#1320: Negative stroke limit per axis (mm or deg).
public const int ParamStrokeLimitNeg = 1320
Field Value
ParamStrokeLimitPos
#1300: Positive stroke limit per axis (mm or deg).
public const int ParamStrokeLimitPos = 1300
Field Value
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
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
AxisParam1420
#1420: Rapid traverse rate per axis (mm/min or deg/min). See IRapidFeedrateConfig.
public Dictionary<string, double> AxisParam1420 { get; set; }
Property Value
AxisTypeParamId
Parameter/MD/MP number for axis type (linear/rotary/spindle).
protected override int AxisTypeParamId { get; }
Property Value
ControlledAxisCount
Number of controlled axes. Delegates to Param1020.
public int ControlledAxisCount { get; set; }
Property Value
CoordinateIds
Enumerates the G-code coordinate ids that this provider currently has data for.
public IEnumerable<string> CoordinateIds { get; }
Property Value
CutterCompType
Cutter compensation startup type. Delegates to Param5003.
public CutterCompensationType CutterCompType { get; set; }
Property Value
Default3Axis
Default 3-axis Fanuc milling machine.
public static FanucParameterTable Default3Axis { get; }
Property Value
IdAttributeName
XML attribute name for the parameter ID (“ParamId”, “MdId”, “MpId”).
protected override string IdAttributeName { get; }
Property Value
MaxSpindleSpeed_rpm
Maximum spindle speed in RPM. Delegates to Param3741.
public double MaxSpindleSpeed_rpm { get; set; }
Property Value
Param1020
#1020: Number of controlled axes. See ControlledAxisCount.
public int Param1020 { get; set; }
Property Value
Param3741
#3741: Maximum spindle speed (RPM). See MaxSpindleSpeed_rpm.
public double Param3741 { get; set; }
Property Value
Param5003
#5003: Cutter compensation startup type. See CutterCompType.
public CutterCompensationType Param5003 { get; set; }
Property Value
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
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
StrokeLimitNegParamId
Parameter/MD/MP number for negative stroke limit per axis. 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. 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
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
keystring
Returns
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.
GetCoordinateOffset(string)
Gets the offset for the given G-code coordinate id. Returns null when no offset is configured for that id by this provider (callers iterate the next provider, or fall back to Zero).
public Vec3d GetCoordinateOffset(string coordId)
Parameters
coordIdstring
Returns
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
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
SetCoordinateOffset(string, Vec3d)
Sets the offset for the given G-code coordinate id.
public void SetCoordinateOffset(string coordId, Vec3d offset)