Class TPostprocessor
Abstract blank postprocessor of SprutCAM. When developing your postprocessor, you must inherit it from this class.
This class declares basic virtual methods that must be present in the postprocessor. However, most of the declared methods have empty implementation.
A significant number of methods are SprutCAM's CLData command handlers, for example
- OnGoto,
- OnCircle,
- OnSpindle,
- OnLoadTool,
- OnCoolant
- etc.
Inheritance
Implements
Namespace: SprutCAMTech.SCPostprocessor
Assembly: SprutCAMTech.SCPostprocessor.dll
Syntax
public class TPostprocessor : Object, INCFileOwner
Constructors
TPostprocessor()
Constructor for the postprocessor. Initializes it's properties.
Declaration
public TPostprocessor()
Fields
Settings
An object containing a set of basic properties and settings for the processor, which are described in the separate Settings.xml file inside the folder of the postprocessor.
For example
- Comments - any text comments to the postprocessor for customers.
- CNCSystem - the CNC system the postprocessor was developed for.
- MachineName - the name of a machine or robot for which the postprocessor is intended.
- BreakArcs - whether the system should automatically split circular arcs into halves, quarters, or cuts.
- BreakHelix - whether the system should automatically split helix into cuts.
- etc.
A separate important part is the UserDefinedParameters section. Inside it, the postprocessor developer can add any properties of his choice, which the user will have to specify before starting the process of generating the output G-code files. This can be, for example,
- the name of the output file,
- program number,
- textual description for the machine operator,
- etc.
nc.OutputFileName = Settings.Params.Str["OutFiles.NCFileName"];
Declaration
public PostprocessorSettings Settings
Field Value
Type | Description |
---|---|
PostprocessorSettings |
Properties
CLDProject
The current translating CLData project (SprutCAM project). It's main content is a list of files each of which contains the list of CLData commands.
Declaration
public ICLDProject CLDProject { get; }
Property Value
Type | Description |
---|---|
ICLDProject |
CLDSub
The list of CLD-subroutines of the current project.
Declaration
public ICLDSubList CLDSub { get; }
Property Value
Type | Description |
---|---|
ICLDSubList |
CLDTranslator
CLDTranslator is a base working object of the postprocessing system. It opens SprutCAM's project and starts translation of CLData files and commands placed inside this project. It also opens the exact postprocessor and sends all the CLData commands to the corresponding command handlers of the postprocessor.
Declaration
public ICLDTranslator CLDTranslator { get; }
Property Value
Type | Description |
---|---|
ICLDTranslator |
CurrentCmd
The current translating CLData command. You can check the CmdType to define exact type of the command and the cast this object to the corresponding command using "as" keyword. For example:
var gotoCmd = CurrentCmd as ICLDGotoCommand
Declaration
public ICLDCommand CurrentCmd { get; }
Property Value
Type | Description |
---|---|
ICLDCommand |
CurrentFile
The current translating CLDFile. It contains the list of CLData commands.
Declaration
public ICLDFile CurrentFile { get; }
Property Value
Type | Description |
---|---|
ICLDFile |
CurrentOperation
The current translating technological operation. You can get some additional information about the operation using this object.
Declaration
public ICLDTechOperation CurrentOperation { get; }
Property Value
Type | Description |
---|---|
ICLDTechOperation |
IsBreakedTranslation
An auxiliary boolean flag that symbolizes whether the translation was interrupted early by calling the BreakTranslation() method.
Declaration
public bool IsBreakedTranslation { get; }
Property Value
Type | Description |
---|---|
bool |
NCFiles
The list of the resulting output files formed by the postprocessor.
If you use an ancestors of TTextNCFile class then when you create a new instance, it is automatically added to the list.
You can also use AddExternalFile(string) method to add any other file to the list of output files.Declaration
public TNCFilesManager NCFiles { get; }
Property Value
Type | Description |
---|---|
TNCFilesManager |
Methods
BreakTranslation()
This method allows you to prematurely terminate the CLData translation process, for example, if you find any errors in the input data, or if the user tries to use operations that are not supported by the controller. You can additionally indicate the reason for the interruption using the syntax for outputting information to the Log report like following.
Log.Error($"The cycle {cycleNumber} doesn't supported by the controller.");
Declaration
public void BreakTranslation()
Cross()
Determines how two consecutive segments (current and next) connected
Declaration
public int Cross()
Returns
Type | Description |
---|---|
int |
|
FilterString(ref string, TNCFile, INCLabel)
This method is used by the postprocessing system to call the OnFilterString handler, which can be used for additional processing of the string just before it is written to the output file. You usually don't need to call this method yourself. It is called automatically when you write text to the output file.
Declaration
public void FilterString(ref string s, TNCFile ncFile, INCLabel label)
Parameters
Type | Name | Description |
---|---|---|
string | s | The text that we are going to write to the output file. |
TNCFile | ncFile | Reference to the output file to which we want to write the given text. |
INCLabel | label | An additional label is a link to the position in the file where we want to insert the given text. It can be "null" if we write to the default position, such as the end of the file. |
FlagIn()
Determines the type of angle between two consecutive moves - current and next
Declaration
public int FlagIn()
Returns
Type | Description |
---|---|
int |
|
NextToolNum()
Returns the next tool number.
Declaration
public int NextToolNum()
Returns
Type | Description |
---|---|
int |
NextToolNum(bool)
Returns the next tool number. if getFirstToolAtFinish is "true" then it will return the first tool number after the last, otherwise "-1"
Declaration
public int NextToolNum(bool getFirstToolAtFinish)
Parameters
Type | Name | Description |
---|---|---|
bool | getFirstToolAtFinish |
Returns
Type | Description |
---|---|
int |
OnAfterCommandHandle(ICLDCommand, CLDArray)
This handler performs after each CLData command.
Declaration
public virtual void OnAfterCommandHandle(ICLDCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCommand | cmd | The CLData command whose translation is finishing. |
CLDArray | cld | The cld array of the command. |
OnAfterMovement(ICLDMotionCommand, CLDArray)
This handler performs after the each movement command like Goto, Circle, MultiGoto, MultiArc, PhysicGoto, From, Origin, EdmMove.
Declaration
public virtual void OnAfterMovement(ICLDMotionCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDMotionCommand | cmd | The CLData command whose translation is finishing. |
CLDArray | cld | The cld array of the command. |
OnAxesBrake(ICLDAxesBrakeCommand, CLDArray)
This handler performs on AXESBRAKE CLData command which means switching on-off for brakes of machine's axes.
Declaration
public virtual void OnAxesBrake(ICLDAxesBrakeCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDAxesBrakeCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnBeforeCommandHandle(ICLDCommand, CLDArray)
This handler performs before each CLData command.
Declaration
public virtual void OnBeforeCommandHandle(ICLDCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCommand | cmd | The CLData command whose translation is starting. |
CLDArray | cld | The cld array of the command. |
OnBeforeMovement(ICLDMotionCommand, CLDArray)
This handler performs before the each movement command like Goto, Circle, MultiGoto, MultiArc, PhysicGoto, From, Origin, EdmMove.
Declaration
public virtual void OnBeforeMovement(ICLDMotionCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDMotionCommand | cmd | The CLData command whose translation is starting. |
CLDArray | cld | The cld array of the command. |
OnCallNCSub(ICLDSub, ICLDPPFunCommand, CLDArray)
This handler performs at the calling of CLD subroutine on PPFun CallSub command.
Declaration
public virtual void OnCallNCSub(ICLDSub cldSub, ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSub | cldSub | The CLD subroutine whose calling is performed. |
ICLDPPFunCommand | cmd | PPFun CallSub command. |
CLDArray | cld | The cld array of the PPFun CallSub command. |
OnCircle(ICLDCircleCommand, CLDArray)
This handler performs on CIRCLE CLData command which means tool movement by planar circular arc.
Declaration
public virtual void OnCircle(ICLDCircleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCircleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnClamp(ICLDClampCommand, CLDArray)
This handler performs on CLAMP CLData command which is used to clamp and unclamp different kind of machine devices.
Declaration
public virtual void OnClamp(ICLDClampCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDClampCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnComment(ICLDCommentCommand, CLDArray)
This handler performs on COMMENT CLData command which should write some auxiliary textual comments to an output file.
Declaration
public virtual void OnComment(ICLDCommentCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCommentCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnCoolant(ICLDCoolantCommand, CLDArray)
This handler performs on COOLANT CLData command which means switching on-off for the cooling system of machine (like M8-M9).
Declaration
public virtual void OnCoolant(ICLDCoolantCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCoolantCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnCutCom(ICLDCutComCommand, CLDArray)
This handler performs on CUTCOM CLData command which means the enabling-disabling of tool length or radius compensation modes. You can also use OnLengthCompensation(ICLDCutComCommand, CLDArray) or OnRadiusCompensation(ICLDCutComCommand, CLDArray) handlers instead of this one to narrow down the applicability to the length or radius compensation case.
Declaration
public virtual void OnCutCom(ICLDCutComCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCutComCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnCycle(ICLDCycleCommand, CLDArray)
This handler performs on CYCLE CLData command which means the hole machining cycles (like G80-G89). But SprutCAM will generates this command for the projects created in very old versions of SprutCAM only. For the modern project it is enough to implement OnExtCycle(ICLDExtCycleCommand, CLDArray) or OnHoleExtCycle(ICLDExtCycleCommand, CLDArray) handlers.
Declaration
public virtual void OnCycle(ICLDCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnDelay(ICLDDelayCommand, CLDArray)
This handler performs on DELAY CLData command which should write the command of a pause in the execution of a program of a given duration (like G04 on Fanuc).
Declaration
public virtual void OnDelay(ICLDDelayCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDDelayCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnEDMMove(ICLDEDMMoveCommand, CLDArray)
This handler performs on EDMMOVE CLData command which means the movement of a wire guides of EDM machines.
Declaration
public virtual void OnEDMMove(ICLDEDMMoveCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDEDMMoveCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnEffector(ICLDEffectorCommand, CLDArray)
This handler performs on EFFECTOR CLData command which activates-deactivates end effector (laser, jet nozzle, arc welder etc.).
Declaration
public virtual void OnEffector(ICLDEffectorCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDEffectorCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnException(Exception)
OnException handler can be used for additional processing and quick finding of errors. You can override it inside you postprocessor and set breakpoint there. It will be called automatically each time when any unhandled exception occur in the process of CLData commands handling.
Declaration
public virtual void OnException(Exception e)
Parameters
Type | Name | Description |
---|---|---|
System.Exception | e | The reference to the Exception object you can explore. |
OnExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command which should write the call of different kind of canned cycles (like G70-G89 for lathe and hole machinig cycles of Fanuc or various probing cycles). Optionally you can also use OnTurnExtCycle(ICLDExtCycleCommand, CLDArray) or OnHoleExtCycle(ICLDExtCycleCommand, CLDArray) handlers instead of this one to narrow down the applicability to the exact cycles' group.
Declaration
public virtual void OnExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnFeedrate(ICLDFeedrateCommand, CLDArray)
This handler performs on FEDRAT CLData command which defines the velocity of the movement, a type of the movement (working, approach, return, plunge, etc.) and turns off the rapid (G0, point to point) interpolation mode.
Declaration
public virtual void OnFeedrate(ICLDFeedrateCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDFeedrateCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnFilterString(ref string, TNCFile, INCLabel)
OnFilterString handler can be used for additional processing of the string just before it is written to the output file. You usually don't need to call this method yourself. It is called automatically when you write text to the output file.
Declaration
public virtual void OnFilterString(ref string s, TNCFile ncFile, INCLabel label)
Parameters
Type | Name | Description |
---|---|---|
string | s | The text that we are going to write to the output file. |
TNCFile | ncFile | Reference to the output file to which we want to write the given text. |
INCLabel | label | An additional label is a link to the position in the file where we want to insert the given text. It can be "null" if we write to the default position, such as the end of the file. |
OnFinalizeNCFiles(TNCFilesManager)
This handler performs after the finish of translation of the all CLData commands in the project and even after the OnFinishProject(ICLDProject). At this moment the all output files already written to their final location and you no longer have to add anything inside these files. But you can use this handler to make additional actions on files.
For example you can start any external util and transfer the list of output files to it.
One more case - you can copy the resulting files to another location or to CNC controller directly.
Declaration
public virtual void OnFinalizeNCFiles(TNCFilesManager ncFiles)
Parameters
Type | Name | Description |
---|---|---|
TNCFilesManager | ncFiles | The list of output files, formed by the postprocessor. |
OnFini(ICLDFiniCommand, CLDArray)
This handler performs on FINI CLData command which is always the last in the project. We recomment to use OnFinishProject(ICLDProject) instead. This handler is left only for ideological compatibility with the Postprocessors generator.
Declaration
public virtual void OnFini(ICLDFiniCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDFiniCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnFinishNCSub(ICLDSub, ICLDPPFunCommand, CLDArray)
This handler performs after finish of CLD subroutine translation on PPFUN EndSub command.
Declaration
public virtual void OnFinishNCSub(ICLDSub cldSub, ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSub | cldSub | The CLD subroutine whose translation is finishing. |
ICLDPPFunCommand | cmd | PPFun EndSub command. |
CLDArray | cld | The cld array of the PPFun EndSub command. |
OnFinishProject(ICLDProject)
This is the final handler which performs at the finish of translation after the last CLData command in the project (like a FINI command inside Postprocessors generator).
Declaration
public virtual void OnFinishProject(ICLDProject prj)
Parameters
Type | Name | Description |
---|---|---|
ICLDProject | prj | The project of SprutCAM's CLData. |
OnFinishTechOperation(ICLDTechOperation, ICLDPPFunCommand, CLDArray)
This handler performs after translation of the each technological operation on PPFUN EndTechInfo(59) CLData command.
Declaration
public virtual void OnFinishTechOperation(ICLDTechOperation op, ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDTechOperation | op | The operation whose translation is finishing. |
ICLDPPFunCommand | cmd | PPFun EndTechInfo(59) command. |
CLDArray | cld | The cld array of the PPFun EndTechInfo(59) command. |
OnFrom(ICLDFromCommand, CLDArray)
This handler performs on FROM CLData command which defines the start position for a toolpath of technological operation.
Declaration
public virtual void OnFrom(ICLDFromCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDFromCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnGoHome(ICLDGoHomeCommand, CLDArray)
This handler performs on GOHOME CLData command which means the movement to a home position of machine or robot.
Declaration
public virtual void OnGoHome(ICLDGoHomeCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDGoHomeCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnGoto(ICLDGotoCommand, CLDArray)
This handler performs on GOTO CLData command which means the linear movement to the position defined by the point (X, Y, Z) in 3D cartesian space.
Declaration
public virtual void OnGoto(ICLDGotoCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDGotoCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnHoleExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command for the hole machining cycles case (like G80-G89 of Fanuc).
Declaration
public virtual void OnHoleExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnInsert(ICLDInsertCommand, CLDArray)
This handler performs on INSERT CLData command which should write the specified textual string to the output file directly without significant modifications.
Declaration
public virtual void OnInsert(ICLDInsertCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDInsertCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnInterp5x(ICLDInterpolationCommand, CLDArray)
This handler performs on INTERPOLATION MultiAxis CLData command which means enabling or disabling of TCPM (tool center point management, Heidenhain - M128/M129, Sinumerik TRAORI, Fanuc - G43.4).
Declaration
public virtual void OnInterp5x(ICLDInterpolationCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDInterpolationCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnInterpCylindrical(ICLDInterpolationCommand, CLDArray)
This handler performs on INTERPOLATION Cylindrical CLData command which means enabling or disabling of cylindrical interpolation mode.
Declaration
public virtual void OnInterpCylindrical(ICLDInterpolationCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDInterpolationCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnInterpolation(ICLDInterpolationCommand, CLDArray)
This handler performs on INTERPOLATION CLData command which means switching on-off of different kind of interpolation modes like polar, cylindrical, TCPM (5-axis) mode etc. Optionally you can also use OnInterpPolar(ICLDInterpolationCommand, CLDArray), OnInterpCylindrical(ICLDInterpolationCommand, CLDArray) or OnInterp5x(ICLDInterpolationCommand, CLDArray) handlers instead of this one to narrow down the range of interpolation types under consideration.
Declaration
public virtual void OnInterpolation(ICLDInterpolationCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDInterpolationCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnInterpPolar(ICLDInterpolationCommand, CLDArray)
This handler performs on INTERPOLATION Polar CLData command which means enabling or disabling of polar interpolation mode.
Declaration
public virtual void OnInterpPolar(ICLDInterpolationCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDInterpolationCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnLengthCompensation(ICLDCutComCommand, CLDArray)
This handler performs on CUTCOM Length CLData command which means enabling or disabling a tool length compensation.
Declaration
public virtual void OnLengthCompensation(ICLDCutComCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCutComCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnLoadTool(ICLDLoadToolCommand, CLDArray)
This handler performs on LOADTL CLData command which means the loading of the exact working tool (mill, drill, lathe cutter etc.) to the active position of a tool changer (like loading to spindle from tools magazine or rotation of a turret head to exact position).
Declaration
public virtual void OnLoadTool(ICLDLoadToolCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDLoadToolCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnLocalCS(ICLDOriginCommand, CLDArray)
This handler performs on ORIGIN Local CS CLData command which means activation or deactivation of LCS (local coordinate system, like Heidenhain - PLANE SPATIAL or Sinumerik - CYCLE800 or Fanuc - G68.2 etc.).
Declaration
public virtual void OnLocalCS(ICLDOriginCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDOriginCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnMoveVelocity(ICLDMoveVelocityCommand, CLDArray)
This handler performs on RAPID and on FEEDRATE CLData commands and defines the velocity of movements and the type of movements (approach, working, return, etc.).
Declaration
public virtual void OnMoveVelocity(ICLDMoveVelocityCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDMoveVelocityCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnMultiArc(ICLDMultiArcCommand, CLDArray)
This handler performs on MULTIARC CLData command which means the circular arc movement at arbitrary plane in 3D cartesian space. Here, the arc is defined by three points in space - the first point is the current tool position, the second and third points specified in parameters of the command with additional information about the changed physical axes coordinates of machine or robot.
Declaration
public virtual void OnMultiArc(ICLDMultiArcCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDMultiArcCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnMultiGoto(ICLDMultiGotoCommand, CLDArray)
This handler performs on MULTIGOTO CLData command which means the linear movement in 3D cartesian space. Here, the movement is defined by two points in space - the first point is the current tool position, the second point specified in parameters of the command with additional information about the changed physical axes coordinates of machine or robot.
Declaration
public virtual void OnMultiGoto(ICLDMultiGotoCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDMultiGotoCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnOpStop(ICLDOpStopCommand, CLDArray)
This handler performs on OPSTOP CLData command which means the optional stop of the programm execution (like M1 in ISO G-codes of CNC machines). The optional word means that the actual execution of the stop depends on an additional switch on the equipment control panel.
Declaration
public virtual void OnOpStop(ICLDOpStopCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDOpStopCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnOrigin(ICLDOriginCommand, CLDArray)
This handler performs on ORIGIN CLData command which means the activation of a coordinate system (CS, base, frame) that be used for the following points of movements and some additional data of toolpath. There are two types of CS which can be activated using this command: standard workpiece CS selection by it's number (like G54-G59 on CNC machines) or the local CS definition using translation and rotation by specified values (like G68.2, PLANE SPATIAL or CYCLE800 on CNC machines).
Optionally you can also use OnWorkpieceCS(ICLDOriginCommand, CLDArray) or OnLocalCS(ICLDOriginCommand, CLDArray) handlers instead of this one to narrow down the range of coordinate system types under consideration.
Declaration
public virtual void OnOrigin(ICLDOriginCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDOriginCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPartNo(ICLDPartNoCommand, CLDArray)
This handler performs on PARTNO CLData command which is always the first in the project. We recomment to use OnStartProject(ICLDProject) handler instead. PARTNO handler is left only for ideological compatibility with the Postprocessors generator.
Declaration
public virtual void OnPartNo(ICLDPartNoCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPartNoCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPhysicGoto(ICLDPhysicGotoCommand, CLDArray)
This handler performs on PHYSICGOTO CLData command which is the movement of physical axes. It contains the physical coordinate values relative to machine zeros for each axis, and the base axes interpolation does not perform control of the intermediate points of the toolpath, and checked only the reachability of the endpoint. In the ISO codes, it corresponds to the G53 move command (SUPA in Sinumerik, M91 in HEIDENHAIN). In the robot control system it corresponds to the movement type Joint move (J, MOVEJ), Point-to-point (PTP) motion.
Declaration
public virtual void OnPhysicGoto(ICLDPhysicGotoCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPhysicGotoCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPickAndPlaceExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command for the pickand place cycles case (which SubCode is 600 or 601).
Declaration
public virtual void OnPickAndPlaceExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPlane(ICLDPlaneCommand, CLDArray)
This handler performs on PLANE CLData command which is used to define the active machining plane. Commonly this command is processed into G17, G18, G19 G-codes. Active plane is used in circular interpolation (it defines plane of arcs), to implement tool radius offset, to define hole machining cycles etc.
Declaration
public virtual void OnPlane(ICLDPlaneCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPlaneCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPower(ICLDPowerCommand, CLDArray)
This handler performs on POWER CLData command which specifies the percent of a nominal power (defined in the operation parameters of SprutCAM) for the exact active effector (laser, jet nozzle, arc welder etc.) that should be used for the following movements.
Declaration
public virtual void OnPower(ICLDPowerCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPowerCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPPFun(ICLDPPFunCommand, CLDArray)
This handler performs on PPFUN CLData command which can be used to transfer various kinds of data to the postprocessor. To determine the exact type of transfered data, use the cld[1] or cmd.SubCode (SubCode) parameter.
For example, SprutCAM use this command to transfer the rich set of the technological operation parameters (PPFun StartTechInfo SubCode=58 and PPFun EndTechInfo SubCode=59). We recommend you to use OnStartTechOperation(ICLDTechOperation, ICLDPPFunCommand, CLDArray) and OnFinishTechOperation(ICLDTechOperation, ICLDPPFunCommand, CLDArray) handlers for this exact purpose instead of this one.
SprutCAM also use this command to mark the beginning, end or call of subroutines which should be written to ouput files (PPFun StartSub SubCode=50, PPFun EndSub SubCode=51 and PPFun CallSub SubCode=52). We recommend you to use OnStartNCSub(ICLDSub, ICLDPPFunCommand, CLDArray), OnFinishNCSub(ICLDSub, ICLDPPFunCommand, CLDArray) and OnCallNCSub(ICLDSub, ICLDPPFunCommand, CLDArray) handlers for this exact purpose instead of this one.
It is also possible to specify in SprutCAM the PPFun command with an arbitrary SubCode value to transfer any user defined data to the postprocessor. See the "Toolpath template" feature of SprutCAM to get an additional information.
Declaration
public virtual void OnPPFun(ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPPFunCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnPrint(ICLDPrintCommand, CLDArray)
This handler performs on PRINT CLData command which transfers a textual data to postprocessor.
Declaration
public virtual void OnPrint(ICLDPrintCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDPrintCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnProbeExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command for the probing cycles case (which SubCode is 500).
Declaration
public virtual void OnProbeExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnRadiusCompensation(ICLDCutComCommand, CLDArray)
This handler performs on CUTCOM Radius CLData command which means enabling or disabling a tool radius compensation.
Declaration
public virtual void OnRadiusCompensation(ICLDCutComCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDCutComCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnRapid(ICLDRapidCommand, CLDArray)
This handler performs on RAPID CLData command which activates a rapid motion mode (G-code G00). All further movements are done in rapid mode until FEEDRATE command is received.
Declaration
public virtual void OnRapid(ICLDRapidCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDRapidCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnSelWorkpiece(ICLDSelWorkpieceCommand, CLDArray)
This handler performs on SELWORKPIECE CLData command which is used to specify the active workpiece connector. The workpiece connector is a machine unit that is used to fix the workpiece. For the multi-spindle lathe machines this command specifies the active spindle. For the milling machines the workpiece connector can be the pallet for example. All machining commands will relate to the workpiece fixed in the active connector.
Declaration
public virtual void OnSelWorkpiece(ICLDSelWorkpieceCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSelWorkpieceCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnSinglePassThread(ICLDSinglePassThreadCommand, CLDArray)
This handler performs on SINGLETHREAD CLData command which is used in continuous cylindrical or conical thread cutting with constant step by a lathe tool. Commonly this is the G32 or G33 G-codes in NC-programs.
Declaration
public virtual void OnSinglePassThread(ICLDSinglePassThreadCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSinglePassThreadCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnSpindle(ICLDSpindleCommand, CLDArray)
This handler performs on SPINDLE CLData command which is used to define the spindle switching on-off, rotation velocity, surface speed, gear range etc.
Declaration
public virtual void OnSpindle(ICLDSpindleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSpindleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnStartNCSub(ICLDSub, ICLDPPFunCommand, CLDArray)
This handler performs before start of CLD subroutine translation on PPFUN StartSub command.
Declaration
public virtual void OnStartNCSub(ICLDSub cldSub, ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSub | cldSub | The CLD subroutine whose translation is starting. |
ICLDPPFunCommand | cmd | PPFun StartSub command. |
CLDArray | cld | The cld array of the PPFun StartSub command. |
OnStartProject(ICLDProject)
This is the first handler which performs at the start of translation before the all CLData commands in the project (like a PARTNO command inside Postprocessors generator). You can implement initial actions here like an output files initializaion.
Declaration
public virtual void OnStartProject(ICLDProject prj)
Parameters
Type | Name | Description |
---|---|---|
ICLDProject | prj | The project of SprutCAM's CLData. |
OnStartTechOperation(ICLDTechOperation, ICLDPPFunCommand, CLDArray)
This handler performs before translation of the each technological operation on PPFUN TechInfo(58) CLData command.
Declaration
public virtual void OnStartTechOperation(ICLDTechOperation op, ICLDPPFunCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDTechOperation | op | The operation whose translation is starting. |
ICLDPPFunCommand | cmd | PPFun TechInfo(58) command. |
CLDArray | cld | The cld array of the PPFun TechInfo(58) command. |
OnStop(ICLDStopCommand, CLDArray)
This handler performs on STOP CLData command which means the stop of the programm execution (like M0 in ISO G-codes of CNC machines).
Declaration
public virtual void OnStop(ICLDStopCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDStopCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnStructure(ICLDStructureCommand, CLDArray)
This handler performs on STRUCTURE CLData command which is used to combine individual CLData commands into groups. All commands that are placed between the pair of STRUCTURE ON(71) ... STRUCTURE OFF(72) commands belong to the same group. Groups can be nested within each other.
Declaration
public virtual void OnStructure(ICLDStructureCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDStructureCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnSyncAxes(ICLDSyncAxesCommand, CLDArray)
This handler performs on SYNCAXES CLData command which activates-deactivates the synchronous mode of movements between two different axes of machine. For example you can use this command for multi-spindle lathe or lathe-milling machines to syncronize the speed of rotation of main and counter spindles or synchronize the movements of Z1 and Z2 axes when the workpiece fixed in both axes at the same time.
Declaration
public virtual void OnSyncAxes(ICLDSyncAxesCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSyncAxesCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnSyncWait(ICLDSyncWaitCommand, CLDArray)
This handler performs on WAIT CLData command which is used to synchronize multiple concurrent threads of control (several NC-programs, each of which can control a separate working element of the machine). To achieve this you should write frames (labels) to the output files, implementing the suspension of the program until the achievement of a similar label in another (concurrent) program.
Declaration
public virtual void OnSyncWait(ICLDSyncWaitCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDSyncWaitCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnTakeover(ICLDTakeoverCommand, CLDArray)
This handler performs on TAKEOVER CLData command which is used to take workpiece over from the active connector into the connector specified in the command parameter. The active workpiece connector is specified by the SELWORKPIECE command. The workpiece connector is a machine unit that is used to fix the workpiece. Use this command for multi-spindle lathe or lathe-milling machines to perform workpiece takeover from one spindle into another.
Declaration
public virtual void OnTakeover(ICLDTakeoverCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDTakeoverCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnTLContact(ICLDTLContactCommand, CLDArray)
This handler performs on TLCONTACT CLData command which provides information about the normal to the machining surface at the point of contact of the tool with this surface. This is used to calculate 5D correction. In fact, this information determines in which direction (along which vector) the tool needs to be shifted in space by the amount of correction (the difference between the radius of the theoretical and actual tool).
Declaration
public virtual void OnTLContact(ICLDTLContactCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDTLContactCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnTurnExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command for the lathe cycles case (like G70-G76 of Fanuc).
Declaration
public virtual void OnTurnExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnWeldingExtCycle(ICLDExtCycleCommand, CLDArray)
This handler performs on EXTCYCLE CLData command for the welding cycles case (SubCode with 550).
Declaration
public virtual void OnWeldingExtCycle(ICLDExtCycleCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDExtCycleCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
OnWorkpieceCS(ICLDOriginCommand, CLDArray)
This handler performs on ORIGIN Standard WCS CLData command which means activation or deactivation of WCS (workpiece coordinate system, like G54-G59) by it's number.
Declaration
public virtual void OnWorkpieceCS(ICLDOriginCommand cmd, CLDArray cld)
Parameters
Type | Name | Description |
---|---|---|
ICLDOriginCommand | cmd | The current CLData command. |
CLDArray | cld | The cld array of the command. |
SetCLDTranslator(ICLDTranslator)
Assigns the instance of ICLDTranslator to the postprocessor. Usually you don't need to call it manually. The system calls it automatically on the start of translation.
Declaration
public void SetCLDTranslator(ICLDTranslator cldTranslator)
Parameters
Type | Name | Description |
---|---|---|
ICLDTranslator | cldTranslator | The instance of ICLDTranslator. |
StopOnCLData()
The method does nothing but you can override it inside exact postprocessor to be possible to use CLData breakpoints.
Declaration
public virtual void StopOnCLData()
Remarks
The steps to use CLData breakpoints.
- Override the "StopOnCLData" method (if it is not still exists).
- You should add the "Function breakpoint" to the breakpoints list of Visual Studio Code. Specify the name "StopOnCLData" for it.
- Go to CLData Viewer, open the CLData tab and select the command you want to break on. Click to the left field next to the line of this command.
- Go back to Visual Studio Code and start debugging using "Run and debug" button or just press "F5".
- When the translation process will reach the desired command it will be stopped inside the "StopOnCLData" method of your postprocessor.
- After that you can start to press "F10" to continue debugging.
ToolChange()
Indicates the status of a tool change
Declaration
public int ToolChange()
Returns
Type | Description |
---|---|
int |
|
Transliterate(string, TransliterationTable)
Transliterates the specified string using defined transliteration table TransliterationTable.
Declaration
public string Transliterate(string source, TransliterationTable table)
Parameters
Type | Name | Description |
---|---|---|
string | source | The string to transliterate. |
TransliterationTable | table | Transliteration table to convert the string (TransliterationTable). |
Returns
Type | Description |
---|---|
string |
Transliterate(string)
Transliterates the specified string using a default transliteration table Default.
Declaration
public string Transliterate(string source)
Parameters
Type | Name | Description |
---|---|---|
string | source | The string to transliterate. |
Returns
Type | Description |
---|---|
string | Returns a transliterated string. |