Table of Contents

Class NcEnv

Namespace
Hi.Numerical
Assembly
HiUniNc.dll

Represents the numerical control environment containing configuration for CNC operations.

public class NcEnv : IMakeXmlSource
Inheritance
NcEnv
Implements
Inherited Members
Extension Methods

Constructors

NcEnv(CncBrand)

Ctor.

public NcEnv(CncBrand cncBrand = CncBrand.Fanuc)

Parameters

cncBrand CncBrand

NcEnv(XElement, string, string)

Ctor.

public NcEnv(XElement src, string baseDirectory, string relFile)

Parameters

src XElement

XML

baseDirectory string

The base directory for relative paths.

relFile string

The relative file path.

Properties

AttacherAtMcZeroOnTableCoordinate

Gets the attacher position at machine zero on table coordinate.

public Vec3d AttacherAtMcZeroOnTableCoordinate { get; }

Property Value

Vec3d

CncBrand

Gets or sets the CNC brand/controller type.

public CncBrand CncBrand { get; set; }

Property Value

CncBrand

CommentSymbol

Gets the comment symbol used by the current CNC controller.

public string CommentSymbol { get; }

Property Value

string

ConfigurationTable

Gets a dictionary of CNC configuration parameters used by the system.

public Dictionary<string, int> ConfigurationTable { get; }

Property Value

Dictionary<string, int>

CoordinateConverter

Gets or sets the coordinate converter used for transformations between different coordinate systems.

public ICoordinateConverter CoordinateConverter { get; set; }

Property Value

ICoordinateConverter

EnableArcCornerRadiusCompensation

Gets or sets whether arc corner radius compensation is enabled.

public bool EnableArcCornerRadiusCompensation { get; set; }

Property Value

bool

EnableIntegerShrinkOnPositionCommand

Gets whether integer shrinking is enabled for position commands based on the CNC brand.

public bool EnableIntegerShrinkOnPositionCommand { get; }

Property Value

bool

EnableShortestRotary

Enables shortest rotary path movement. This option does not affect Heidenhain controllers. For Heidenhain controllers, see Hi.UniNc.Heidenhain.IHeidenhainShortestRotaryPathEnabled, Hi.UniNc.Heidenhain.HeidenhainM126 and Hi.UniNc.Heidenhain.HeidenhainM127.

public bool EnableShortestRotary { get; set; }

Property Value

bool

FanucPara5003

Fanuc 5003. These bits are used to specify the type of startup/cancellation of tool radius - tool nose radius compensation. 0: type A; 1: type B; 2,3: type C. Assume always zero.

Type A: A compensation vector perpendicular to the block next to the startup block or the block preceding the cancellation block is output. Type B: A compensation vector perpendicular to the startup block or cancellation block and an intersection vector are output. Type C: When the startup block or cancellation block specifies no movement operation, the tool is shifted by the cutter compensation amount in a direction perpendicular to the block next to the startup or the block before cancellation block.

public byte FanucPara5003 { get; set; }

Property Value

byte

HeidenhainDatumPresetTable

For Heidenhain CYCL DEF 247 Datum Preset.

public Dictionary<int, Vec3d> HeidenhainDatumPresetTable { get; }

Property Value

Dictionary<int, Vec3d>

Remarks

Datum Preset seems an older settings in heidenhain manual relative to Datum Shift.

HeidenhainDatumShiftTable

For Heidenhain CYCL DEF 7 Datum Shift. Also called Datum table in heidenhain manual.

public Dictionary<int, Vec3d> HeidenhainDatumShiftTable { get; }

Property Value

Dictionary<int, Vec3d>

Remarks

Datum Preset seems an older settings in heidenhain manual relative to Datum Shift.

HeidenhainMasterAxisChar

Gets or sets the Heidenhain master rotary axis as a character (A, B, or C).

public char HeidenhainMasterAxisChar { get; set; }

Property Value

char

HeidenhainMasterAxisDir

The master axis determines the behaviour of SEQ command. ex. PLANE SPATIAL SPA-77.516 SPB+0 SPC-10.365 STAY SEQ-TABLE ROT The master axis is the 1st rotary axis from the tool, or the last rotary axis from the table(depending on the machine configuration). SEQ+ positions the master axis so that it assumes a positive angle. See: TNC 640 | User's ManualDIN/ISO Programming | 1/2015 p432

public int HeidenhainMasterAxisDir { get; set; }

Property Value

int

HomeMc

Home machine coordinate. First reference position. The position may not equal to machine zero in real Fanuc controller.

public Vec3d HomeMc { get; set; }

Property Value

Vec3d

IsAxisAExisted

Gets whether the A axis exists in the machine configuration.

public bool IsAxisAExisted { get; }

Property Value

bool

IsAxisBExisted

Gets whether the B axis exists in the machine configuration.

public bool IsAxisBExisted { get; }

Property Value

bool

IsAxisCExisted

Gets whether the C axis exists in the machine configuration.

public bool IsAxisCExisted { get; }

Property Value

bool

IsIdealOffsetDependentOnToolHouse

Gets or sets whether the ideal offset depends on tool house position.

public bool IsIdealOffsetDependentOnToolHouse { get; set; }

Property Value

bool

IsoCoordinateTable

ISO coordinate table. i.e., CoordinateTable For G54 series.

public IsoCoordinateTable IsoCoordinateTable { get; set; }

Property Value

IsoCoordinateTable

MaxRotarySpeedABC_degds

For safety reason, internal use only. Maximum rotary speed in degds.

public Vec3d MaxRotarySpeedABC_degds { get; set; }

Property Value

Vec3d

MaxRotarySpeedABC_radds

Maximum rotary speed in rad/s.

public Vec3d MaxRotarySpeedABC_radds { get; set; }

Property Value

Vec3d

MaxSpindleSpeed_rpm

Gets or sets the maximum spindle speed in revolutions per minute.

public double MaxSpindleSpeed_rpm { get; set; }

Property Value

double

MillingToolOffsetTable

Gets or sets the milling tool offset table for tool compensation.

public MillingToolOffsetTable MillingToolOffsetTable { get; set; }

Property Value

MillingToolOffsetTable

RapidFeedrate_mmdmin

Rapid move speed in mm/min.

public double RapidFeedrate_mmdmin { get; set; }

Property Value

double

RapidFeedrate_mmds

Rapid move speed in mm/s.

public double RapidFeedrate_mmds { get; set; }

Property Value

double

RefNcLineOnInit

Gets or sets the reference NC line used during initialization.

public NcLine RefNcLineOnInit { get; set; }

Property Value

NcLine

SetToolHeightCompensationOnFeatureNormal

Gets or sets whether tool height compensation should be applied based on feature normal direction.

public bool SetToolHeightCompensationOnFeatureNormal { get; set; }

Property Value

bool

StrokeLimitABC_rad

Gets or sets the ABC axis stroke limits in radians.

public Box3d StrokeLimitABC_rad { get; set; }

Property Value

Box3d

StrokeLimitXYZ_mm

Gets or sets the XYZ axis stroke limits in millimeters.

public Box3d StrokeLimitXYZ_mm { get; set; }

Property Value

Box3d

ToolingMc

Gets or sets the machine coordinate for tooling operations. Defaults to HomeMc if not explicitly set.

public Vec3d ToolingMc { get; set; }

Property Value

Vec3d

ToolingTime

Tool changing duration in sec.

public TimeSpan ToolingTime { get; set; }

Property Value

TimeSpan

XName

Name for XML IO.

public static string XName { get; }

Property Value

string

Methods

IsAxisExisted(int)

Determines whether a specific rotary axis exists in the machine configuration.

public bool IsAxisExisted(int dir)

Parameters

dir int

The direction index (0=A, 1=B, 2=C).

Returns

bool

True if the specified axis exists; otherwise, false.

MakeXmlSource(string, string)

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)

Parameters

baseDirectory string

The base directory for resolving relative paths

relFile string

The relative file path for the XML source

Returns

XElement

An XML element representing the object's state