Class IsoCoordinateAddressMap
- Namespace
- Hi.NcParsers.Dependencys
- Assembly
- HiMech.dll
Fanuc-style ISO coordinate parameter address mapping. G54–G59 → #5221+ (stride 20, three consecutive numbers per entry for X/Y/Z), G54.1 P1–P48 → #7001+ (stride 20). Shared between FanucParameterTable (which calls these “ParamId”) and SyntecParameterTable (which calls them “PrId”) because both follow the same numeric scheme.
public static class IsoCoordinateAddressMap
- Inheritance
-
IsoCoordinateAddressMap
- Inherited Members
Fields
G54Base
#5221: base address of G54 (X). G54.Y=#5222, G54.Z=#5223.
public const int G54Base = 5221
Field Value
G54p1P1Base
#7001: base address of G54.1 P1 (X). G54.1 P1.Y=#7002, P1.Z=#7003.
public const int G54p1P1Base = 7001
Field Value
G54p1PCount
48: number of G54.1 P entries (P1..P48).
public const int G54p1PCount = 48
Field Value
G5xCount
6: number of G5x entries (G54..G59).
public const int G5xCount = 6
Field Value
Stride
20: address stride between successive coordinate entries.
public const int Stride = 20
Field Value
Methods
EnumerateCoordinateIds(IDictionary<int, double>)
Enumerates the coordinate ids (G54..G59, G54.1P1..G54.1P48) that have
at least one axis entry present in systemParams.
public static IEnumerable<string> EnumerateCoordinateIds(IDictionary<int, double> systemParams)
Parameters
systemParamsIDictionary<int, double>
Returns
Read(IDictionary<int, double>, int)
Reads X/Y/Z from systemParams at consecutive addresses
starting at baseAddr. Returns null when none of the
three addresses are present (i.e. the entry is unmanaged).
public static Vec3d Read(IDictionary<int, double> systemParams, int baseAddr)
Parameters
systemParamsIDictionary<int, double>baseAddrint
Returns
SeedAllDefaults(IDictionary<int, double>)
Seeds all G54–G59 and G54.1 P1–P48 entries with zero. Total 162 SystemParams entries (6×3 + 48×3). Used by brand parameter tables to satisfy the “managed parameter must have default” invariant — real Fanuc on a fresh-battery controller also reads 0 for these addresses, so the model matches hardware.
public static void SeedAllDefaults(IDictionary<int, double> systemParams)
Parameters
systemParamsIDictionary<int, double>
TryResolveBase(string)
Resolves a coordinate id to its 3-axis base address (X address; Y at +1, Z at +2), or null if the id is outside the Fanuc-mapped set (G54–G59, G54.1P1–G54.1P48).
public static int? TryResolveBase(string coordId)
Parameters
coordIdstring
Returns
- int?
Write(IDictionary<int, double>, int, Vec3d)
Writes X/Y/Z to systemParams at consecutive addresses
starting at baseAddr.
public static void Write(IDictionary<int, double> systemParams, int baseAddr, Vec3d offset)
Parameters
systemParamsIDictionary<int, double>baseAddrintoffsetVec3d