In all control texts that are used to configure the postprocessor you have access to a huge number of variables. Some of these come directly from the options dialogs of the CAM plug-in or the postprocessor, others are computed during export by the postprocessor and can subsequently be used for the output. All variables (if applicable) contain values in the currently specified unit of the postprocessor. The display of numbers (decimal separator, decimal places, etc.) of numerical variable content as well as the query and assignment of variables is realized by means of Statements in Texts.
The following list contains all variables that are provided by the CAM plug-in and the postprocessor to be used inside the control texts of the postprocessor.
General CAM Variables
The general variables remain unchanged during the whole export process, unless they are explicitly changed inside a control text, e.g. {=Q99 {#~Q99~+1}}. However, only changes of the Q/T-parameters are saved permanently. The general variables originate either from the dialog "General Parameters" of the CAM plug-in or are initialized as described here.
~ToolChangeCommands~
| This variable is for information only and a bitwise or-combination of the following values: |
| 0 = Tool changes are generally not exported, i.e. the control text for tool change is not called at all. |
| 1 = For each tool change the control text for tool change is called. Use the logical expression (~ToolChangeCommands~&1) to test for this value. |
| 2 = The export is sorted according to the position of the tool in the tool list (refer to Manage Tool List). This means that always all contours/cycles of the respective tool are exported before the next tool in the list is selected. Usually this requires fewer tool changes. However, this normally also results in a change of the export order. |
~MachinePosX~
~MachinePosY~
| These variables contain the coordinates of the current reference point (which can be entered manually at the machine/cutter) or the position of the tool / cutting head. The actual content depends on the corresponding query text in the "Edit Sending Parameters" dialog (for example "OR;" or "OA;"). The machine position is optionally queried from the machine using the serial interface before the NC data is directly sent to the machine (the query is not active if the NC data is only exported to a file). The machine position is usually given in machine/plotter units (refer to the manual of your machine/cutter). If the query is not active or the query wasn't successful the machine position always contains the coordinate (0,0). |
~HighVel~
~LibraryName~
~GlobalComment~
| Comment on current CAM project |
~CAMProjectName~
| Name of the active CAM project |
~CAMProjectPath~
| File name of the active CAM project including path |
~Q0~ to ~Q99~
| Values of Q-parameters 0 to 99 |
~Q0:~ to ~Q99:~
| Comments on Q-parameters 0 to 99 |
~T0~ to ~T9~
| Values of T-parameters 0 to 9 |
~T0:~ to ~T9:~
| Comments on T-parameters 0 to 9 |
Postprocessor Setting Variables
These postprocessor variables remain unchanged during the whole export process, unless they are explicitly changed inside a control text, e.g. {=Q199 {#~Q199~+1}}. However, only changes of the Q/T-parameters are saved permanently. The postprocessor variables originate from the "Edit Postprocessor" dialog.
~PrgName~
| Name of the NC program which is created by converting the file name (no path, no extension, only uppercase characters, numbers, and '-'). |
~FileName~
| File name of the NC program with path |
~Title~
| Title of the postprocessor |
~Info~
| Information text for the postprocessor |
~Units~
| Currently specified combination of units for coordinate/length, time, and speed specifications (for information only). Angles are always output in degrees (0°..+-360°). All unit conversions are completed by the postprocessor: |
| 0 = [mm], [sec], [mm/min]; (DIN-ISO, Heidenhain) |
| 1 = [mm], [min], [mm/min] |
| 2 = [inch], [sec], [inch/sec] |
| 3 = [inch], [min], [inch/min] |
| 5 = [foot], [min], [foot/min] |
| 6 = [µm=1/1000mm], [sec], [µm/sec] |
| 7 = [pu=1/40mm], [sec], [pu/sec]; (original HP-GL/2 plotter unit) |
| 8 = [1/100mm], [msec], [cm/sec]; (Zünd-Plotter) |
| 10 = [m], [sec], [m/sec]; |
| 11 = [µm=1/1000mm], [msec], [µm/sec]; (isel-Zwischenformat) |
| 12 = [mm], [sec], [mm/sec] |
| 13 = [mm], [msec], [cm/sec]; |
| 14 = [cm], [msec], [cm/sec]; |
| Material advance active (1) or not active (0), for example for large-scale cutters |
~MAWidth~
~MAHeight~
~MADirection~
| Direction of material advance (0 = along X-axis, 1 = along Y-axis) |
~MAOverlapping~
| Overlapping of the material after the advance |
~Comment~
~SingleQuadrant~
| If this variable is true (1) circular arcs are cut at their respective quadrant axes (90° axes relative to mid-point). That means that any circular arc always lies completely inside a single quadrant (this is for information only, the postprocessor cuts the circular arcs automatically if necessary). Otherwise (0) circular arcs are merely restricted to a maximum arc angle of 180° which means that they can extend over up to three quadrants. For example a full circle is either exported as four 90° circular arcs (each of which in its own quadrant) or as two 180° circular arcs (which can have any intersections with the quadrant axes). |
~Q100~ to ~Q199~
| Values of Q-parameters 100 to 199 |
~Q100:~ to ~Q199:~
| Comments on Q-parameters 100 to 199 |
~T10~ to ~T19~
| Values of T-parameters 10 to 19 |
~T10:~ to ~T19:~
| Comments on T-parameters 10 to 19 |
Postprocessor Chain Variables
The postprocessor chain variables are initialized before the execution of a Postprocessor Chain and remain unchanged during the entire execution of a postprocessor chain - i.e. over several export processes (exception ~PPChainIndex~). These variables can be used to reuse values determined by a postprocessor in a postprocessor following in the chain.
~PPChainIndex~
| Index of the current post processor during the execution of the post processor chain (starting with 0). This index results from the order of the postprocessors in the chain. When exporting a single file, ~PPChainIndex~ always contains the value 0. |
~PPChainP0X~ to ~PPChainP9X~
~PPChainP0Y~ to ~PPChainP9Y~
~PPChainValue0~ to ~PPChainValue9~
~PPChainCount0~ to ~PPChainCount9~
~PPChainFlag0~ to ~PPChainFlag9~
~PPChainText0~ to ~PPChainText9~
| (8) These postprocessor chain variables can be used to store values within any control text by means of an assignment statement {=PPChainFlag1 {1}}. They are initialized once before the execution of a postprocessor chain or before the start of a single export process with zero or empty text (~PPChainCmd1~ and ~PPChainCmd2~) and otherwise neither changed nor actively used by the postprocessor. |
Tool Variables
The tool variables change each time a tool change occurs (exception for ~MillingRadiusComp~ refer to (*)). They originate from "Tool List" dialog of the CAM plug-in. If a tool variable is used inside a control text for which it is not possible to retrieve a tool (for example the control text for program start) then the tool variables are initialized with the default tool or (if the user didn't define a default tool) with tool no. 0. You can change Q/T-parameters inside a control text explicitly, e.g. {=Q199 {#~Q199~+1}}. These changes of Q/T-parameters are saved permanently for the respective tool.
~ToolName~
~ToolIndex~
| Index of the logical tool in the tool list (setting this variable to -1 inside the control text for primary run, material advance or repeat will afterwards enforce the call of the control text for tool change) |
~ToolComment~
~MachineToolNo~
| Machine tool number of the physical tool (setting this variable to -1 inside the control text for primary run, material advance, or repeat will afterwards enforce the call of the control text for tool change) |
~ZClearance~
| Safety height / clearance distance (non-negative, may be used in all control texts explicitly) |
~ZEngage~
| Engage height (non-negative) |
~InfeedDepth~
| Infeed depth (e.g. milling cutter or drill, always positive or 0) / operation height (e.g. cutting blade or laser, always negative or 0). If ~ToolControl7~ contains 1, this variable is to be understood as operation height. In the case of the infeed depth, this value specifies how deep the tool penetrates the material (Z=<0). In the case of operation height, this value specifies how high above the workpiece surface (Z>=0) the tool operates. |
~InfeedOffset~
| Infeed offset / operation offset (~ToolControl7~ is 1) with respect to the workpiece surface (Z=0). A positive value causes the workpiece surface to be shifted in the infeed direction (sink). With a negative value, the workpiece surface is shifted in the opposite direction to the infeed direction (plateau). In the case of operation offset (~ToolControl7~ is 1), the same applies analogously, only with inverted signs. |
~InfeedNumberOfIncrements~
| Number of infeed increments (if ~InfeedDepth~ is 0 then this variable contains the number of circulations without change of Z-axis). Ignored for calculation of working variables if ~ToolControl7~ is 1. |
~InfeedIncrementValue~
| Infeed increment value (non-negative). Ignored for calculation of working variables if ~ToolControl7~ is 1. |
~ZEngage~ and the four ~Infeed[..]~ variables are used to calculate the working variables ~ZWorking~ and ~Z0~/~Z1~ (refer to ~SpecialMode~ and ~ToolControl7~).
You should explicitly use the four ~Infeed[..]~ variables only in the control texts of cycles (attributes) or points (markings).
~MovingVel~
~LoweringVel~
| Approaching speed / infeed rate (lowering speed) |
~AltMovingVel~
~Acceleration~
| Acceleration (unit undefined) |
~ToolRadius~
| Tool radius (non-negative) |
~ToolDiameter~
| Tool diameter (non-negative) |
~ToolLength~
| Tool length (non-negative) |
~SpecialMode~
| Two modes (bit-coded) are defined: |
| 0 = All points of the contour (as well as a possible auxiliary point) are located on ~Z1~. ~Z0~ and ~Z1~ are always equal in this case.
1 = Bevelled (Z-axis) approaching of the first point of the contour (starting at the active auxiliary point if radius compensation is active) and also bevelled leaving of the contour (starting at the last point of the contour and then moving back to the active auxiliary point if radius compensation is active) is switched on. If radius compensation is active the contour is engraved, i.e. the first and last point of the contour are located on ~Z0~ while all other points are located on ~Z1~. |
~UserControl~
| 32 bit control value (part of additional functions) |
~ToolControl0~
| Tool type. The following values are defined: |
| 1 = Milling / turning / drilling |
| 4 = Cutting / plotting / positioning |
| 5 = Custom tool (description text and unit text can be edited by the user) |
~ToolControl1~
| Indicates whether the coolant (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl2~
| Indicates whether the exhauster (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl3~
| Indicates whether the blower (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl4~
| Indicates whether options 1 (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl5~
| Indicates whether options 2 (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl6~
| Indicates whether options 3 (the option's text / meaning can be edited by the user) is to be switched on (1) or off (0) (part of additional functions) |
~ToolControl7~
| 0 = The Z-axis control depends solely on the ~Infeed[..]~ variables and ~SpecialMode~.
1 = The tool always operates at the same height exactly on (Z=0) or above (Z>0) the workpiece surface. This means that ~ZWorking~, ~Z0~ and ~Z1~ are then always identical and greater than or equal to zero (this behavior can change depending on ~InfeedOffset~). ~SpecialMode~ is always 0 in this case. This mode is active if the tool type "Waterjet cutting", "Laser cutting", or "Cutting / Plotting / Positioning" is selected or the user activated the "Always operate above or on material (Z>=0)" option in the custom tool. |
~MillingSpindleRate~
| Milling/Turning: spindle rotation |
~MillingSpindleDir~
| Milling/Turning: spindle rotation direction (0 = clockwise, 1 = counterclockwise) |
~MillingRadiusComp~
| (*) Milling/Turning: radius compensation: |
| 0 = No radius compensation active or cancel radius compensation (G40) |
| 1 = Tool moves outside of the closed contour. Contour clockwise (refer to ~ContourDirection~): Tool moves left (G41), Contour counterclockwise: Tool moves right (G42). |
| Or if the contour is open: |
| Tool moves left (G41) to the open contour (considering the direction of the object). |
| 2 = Tool moves inside of the closed contour. Contour clockwise (refer to ~ContourDirection~): Tool moves left (G42), Contour counterclockwise: Tool moves right (G41). |
| Or if the contour is open: |
| Tool moves right (G42) to the open contour (considering the direction of the object). |
| The tool center moves along the contour at a distance equal to the radius. “Right” or “left” are to be understood as based on the direction of tool movement along the workpiece contour. |
~MillingDelay1~
~MillingDelay2~
~MillingAllowanceDepth~
| Milling/Turning: allowance depth |
~MillingAllowanceSide~
| Milling/Turning: allowance side |
~MillingExtraParam1~
| Customizable extra parameter: value 1 |
~MillingExtraParam2~
| Customizable extra parameter: value 2 |
~WaterJetStartAbrasive~
| Water Jet Cutting: start abrasive |
~WaterJetStartPressure~
| Water Jet Cutting: start pressure |
~WaterJetStartTime~
| Water Jet Cutting: start time |
~WaterJetCuttingAbrasive~
| Water Jet Cutting: cutting abrasive |
~WaterJetCuttingPressure~
| Water Jet Cutting: cutting pressure |
~WaterJetCuttingAngleThreshold~
| Water Jet Cutting: angle threshold |
~WaterJetCuttingAngleDelay~
| Water Jet Cutting: angle delay |
~WaterJetCuttingOffDelay~
| Water Jet Cutting: switch-off delay |
~LaserStartPower~
| Laser Cutting: start power |
~LaserStartPulseFrequency~
| Laser Cutting: start pulse frequency |
~LaserStartPulseDuration~
| Laser Cutting: start pulse duration |
~LaserStartTime~
| Laser Cutting: start time |
~LaserCuttingPower~
| Laser Cutting: cutting power |
~LaserCuttingPulseFrequency~
| Laser Cutting: cutting pulse frequency |
~LaserCuttingPulseDuration~
| Laser Cutting: cutting pulse duration |
~LaserCuttingOffDelay~
| Laser Cutting: switch-off delay |
~CuttingPower~
| Cutting / Plotting / Positioning: dispensing power |
~CuttingCutterPressure~
| Cutting / Plotting / Positioning: cutter pressure |
~CuttingOffset~
| Cutting / Plotting / Positioning: offset (this variable is also actively used by the postprocessor in case a path compensation is enabled) |
~CuttingAngleThreshold~
| Cutting / Plotting / Positioning: angle threshold |
~CuttingOscillation~
| Cutting / Plotting / Positioning: oscillation |
~CuttingQuality~
| Cutting / Plotting / Positioning: quality |
~CuttingStartAngle~
| Cutting / Plotting / Positioning: start angle (this variable is also actively used by the postprocessor in case a path compensation is enabled) |
~CuttingDelay~
| Cutting / Plotting / Positioning: delay |
~ToolParam1~
| Editable parameter (part of custom tool): value 1 |
~ToolParam2~
| Editable parameter (part of custom tool): value 2 |
~ToolParam3~
| Editable parameter (part of custom tool): value 3 |
~ToolParam4~
| Editable parameter (part of custom tool): value 4 |
~ToolParam5~
| Editable parameter (part of custom tool): value 5 |
~ToolParam6~
| Editable parameter (part of custom tool): value 6 |
~ToolParam7~
| Editable parameter (part of custom tool): value 7 |
~ToolParam8~
| Editable parameter (part of custom tool): value 8 |
~Q200~ to ~Q399~
| Values of Q-parameters 200 to 399 |
~Q200:~ to ~Q399:~
| Comments on Q-parameters 200 to 399 |
~T20~ to ~T39~
| Values of T-parameters 20 to 39 |
~T20:~ to ~T39:~
| Comments on T-parameters 20 to 39 |
(*) | This variable changes each time the tool is changed. In addition to that it is initialized for each contour start if radius compensation is active (value unequal 0). That means whether the tool is to move inside (right) or outside (left) of the current closed (open) contour is automatically determined by the postprocessor using the position of the active auxiliary point (~AuxX~/~AuxY~). |
Working Variables
The working variables change at different times during the export or are only available (i.e. contain meaningful data) inside certain control texts respectively. Please pay attention to the green numbers in parentheses and the corresponding explanations at the end of this section.
When the control text for tool change is called the tool is always located at safety height (~ZClearance~). At the end of the control text for tool change the tool always has to be moved back at rapid speed to safety height.
If the the control text for contour start is called and ~UpdateXYPosition~ is true (1) then the tool is always located at safety height, otherwise it is located inside the material (or with distance ~ZEngage~ on top of it). When the control text for contour end is called and ~UpdateXYPosition~ is false (0) the tool is moved to safety height at rapid speed (before that it can optionally be retracted from the current infeed depth ~Z1~ to working height ~ZWorking~). If ~UpdateXYPosition~ is true (1) here, the tool is already at safety height.
~LineNumber~
| (1) Line (block) number that the postprocessor uses for the output of line (block) numbers (as specified in the "Edit Postprocessor" dialog). This variable has to be initialized in the first line of the control text "program start" by means of an assignment statement, for example {=LineNumber {#10}}. It is and incremented by the postprocessor for each line (block) as specified in the dialog "Edit Postprocessor". |
~MachineToolMode~
| (2) The tool change mode is a bitwise or-combination of the following values: |
| 0 = This is only a logical tool change (~ToolIndex~ has changed), i.e. the physical tool remains in place. In the control text for tool change you can also simply test for true/false: {?~MachineToolMode~{$Physical tool change}{$Logical tool change}}. |
| 1 = This is a physical tool change (~MachineToolNo~ has changed). In this case ~ToolIndex~ always has changed as well. |
| 2 = This is the very first physical tool change. |
| 4 = The current (~MachineToolNo~) physical tool has NOT been used before (otherwise it has been used at least once). |
| Please note that the control text for tool change is not called at all if neither ~MachineToolNo~ nor ~ToolIndex~ has changed or tool changes are generally not exported ((~ToolChangeCommands~&1) yields 0). |
~ZWorking~
| (3) Contains the current working height (positive if above material, negative if inside material). ~ZWorking~ is calculated using ~InfeedDepth~ (of previous Z increment), ~ZEngage~, and ~InfeedOffset~. Therefore the current working height is equal to engage height (~ZEngage~) if there is only one infeed increment and if the infeed offset (~InfeedOffset~) is zero. |
~Z0~
| (3) Contains the current infeed depth or operation height (if ~ToolControl7~ is 1) for the active auxiliary point (if radius compensation is active) or the start- and end-point of the current contour (positive if above material, negative if inside material). |
~Z1~
| (3) Contains the current infeed depth or operation height (if ~ToolControl7~ is 1) for all other points of the current contour (positive if above material, negative if inside material). |
~ZWorking~ and ~Z0~/~Z1~ are calculated using ~InfeedDepth~, ~InfeedOffset~, and ~InfeedNumberOfIncrements~/~InfeedIncrementValue~. In case of infeed depth (~ToolControl7~ is 0) ~InfeedDepth~ is subtracted from the working variables ~ZWorking~ and ~Z0~/~Z1~. In the case of operation height (~ToolControl7~ is 1), this happens analogously, but ~InfeedDepth~ and ~InfeedOffset~ have inverted signs here.
If ~SpecialMode~ contains zero or ~ToolControl7~ is 1 then ~Z0~ always equals ~Z1~.
~ZIncrementIndex~
| (3) Index of the current Z-infeed increment or the current circulation (if ~InfeedDepth~ is 0) respectively. If ~InfeedNumberOfIncrements~ equals 1 or if this is the first infeed increment then this variable contains the value of 0. With each additional infeed increment the value of this variable is incremented by 1. |
~UpdateXYPosition~
| (5) Indicates whether the current X/Y position of the tool must be changed (1) or not (0).
Contour start: If ~UpdateXYPosition~ is true (1) then the tool which already has been moved to clearance height (~ZClearance~) has now to be moved at rapid speed to the current contour start-point (~X1~/~X1~) and then lowered at rapid speed to the current working height ~ZWorking~. In any case (regardless whether ~UpdateXYPosition~ is true (1) or false (0)) the tool is finally lowered to the current infeed depth ~Z0~/~Z1~ (depending on ~SpecialMode~) using lowering speed. Use a conditional statement {?~UpdateXYPosition~ {$Text1}{$Text2}} in the control text of contour start to export the matching control commands.
Contour end: If ~UpdateXYPosition~ is true (1), then the tool is already at the clearance height (~ZClearance~) and is being moved at rapid speed to the current contour end-point (object variables ~X1~/~X1~). This case can only occur if the option "Avoid duplicate tool paths" in the "Tool path" dialog is enabled and if radius compensation and Z infeed increments are not active. If ~UpdateXYPosition~ is false (0), the tool is pulled out to clearance height (~ZClearance~) without changing the current X/Y position of the tool. |
~X1~/~Y1~
| (4) These variables contain the X/Y coordinates of the contour start point. Their contents are also copied to the variables ~X0~/~Y0~.
If ~UseAuxPoint~ is true (1) then the active auxiliary point (~AuxX~/~AuxY~) has to be used when moving to the contour. That means the tool is moved to the auxiliary point (~AuxX~/~AuxY~) as described above for ~UpdateXYPosition~. After lowering to the current infeed depth ~Z1~ the tool is moved to the actual contour start-point (~X1~/~X1~) at infeed rate with activated(!) radius compensation (G41/G42).
The variables ~X1~/~Y1~ and ~X0~/~Y0~ are also used as object variables in the control texts of the respective object types. The variables ~X1~/~Y1~ are also available in the control text for contour end and contain the current contour end point. |
~UpdateCutterRotationOnly~
| (5) Indicates whether only the rotation of the tangential cutter needs to be updated (1) or this is a normal contour start (0) or contour end (0) respectively. ~UpdateCutterRotationOnly~ is only true (1) if the tangential cutter path control (in the dialog "Edit Postprocessor") is active and the current cutter's angle threshold (as specified in the dialog "Tool list") is exceeded. In this case the control text for contour start/end is used to update the tangential cutter rotation although this actually is a "corner" within the current contour. The variables ~X1~/~Y1~ then contain the X/Y-coordinates of the current corner-point. The other relevant object variables also contain valid data for the current corner-point.
Before calling the control text for contour start always the control text for contour end is called. This makes sure that the tangential cutter has been moved to clearance height (~ZClearance~) before the rotation is applied. |
~CutterRotation~
| (6) Contains the current rotation angle of the tangential cutter in the contour or object start-point respectively and - if the tangential cutter path control is active and the angle threshold is exceeded - also for the corresponding corner-point (always for lines and circular arcs only). |
~ContourXYLength~
| (6) Contains the exact length of the current contour consisting of lines and circular arcs in the X/Y plane (Z-movements are ignored). The length of Bézier curves (which are only output if the corresponding option in the Object control tab of the "Edit Postprocessor" dialog is active) is merely approximated by means of the respective vertices. |
~FirstContourElement~
| (6) Indicates whether this is the first element of a contour (1) or not (0) |
~LastContourElement~
| (6) Indicates whether this is the last element of a contour (1) or not (0) |
~EngravingFirst~
| (6) Indicates whether this is the first element (1) of a contour which is to be engraved or not (0). The content of this variable is equal to the following logical expression:
!~ContourSubprogramActive~ && ~FirstContourElement~ && (~SpecialMode~&1) && !~UseAuxPoint~ && !~ZIncrementIndex~ |
~EngravingSecond~
| (6) Indicates whether this is the second element (1) of a contour which is to be engraved or not (0). The definition is analog to the first element of a contour which is to be engraved. |
~EngravingLast~
| (6) Indicates whether this is the last element (1) of a contour which is to be engraved or not (0). The content of this variable is equal to the following logical expression:
!~ContourSubprogramActive~ && ~LastContourElement~ && !~FirstContourElement~ && (~SpecialMode~&1) && !~UseAuxPoint~ && !~ZIncrementIndex~ |
~ClosedContour~
| (6) Indicates whether the current contour is closed (1) or not (0) |
~ContourIndex~
| (6) Index of the current contour. For standard objects (such as rectangle or circle) this variable is always 0. Only if the currently enumerated surface or curve has more than one contour then this variable is incremented accordingly. |
| If the currently enumerated object is a block instance from the active CAM library that contains an attribute named "CONTOUR-SUBPROGRAM" and the variable ~ContourIndex~ is located inside the control text for cycles (attributes) then this variable contains the number of contours (in subprograms) to be processed by this cycle. The first contour is always considered to be the outer contour (pocket) and the following contours have to be inner contours (islands). |
| For block instances from the active CAM library that do not contain the attribute named "CONTOUR-SUBPROGRAM" this variable always has a value of 0. |
~LastContour~
| (6) Indicates whether the current contour is the last or only (1) or not (0) |
~ContourDirection~
| (6) Direction of contour (0 = clockwise, 1 = counterclockwise). If the contour is not closed this variable always contains 0. |
~RealCircle~
| (6) Indicates for a circular arc whether the enumerated object is a real full circle with the object type "Circle" (1) or not (0). A real full circle is always output as two circular arcs (both 180°). Whether currently the first or second circular arc is being output can be determined using ~FirstContourElement~ or ~LastContourElement~ respectively. In the control text for circular arcs, for example, you can access the object variables for the circle center point (~XM~ and ~YM~) as well as the radius (~Radius~) in the case of a "real full circle". |
~MergeWithContour~
| (6) If the current end-point of a line, circular arc, or Bézier curve or the contour start-point respectively (~X1~/~X1~) is merged with a cycle this variable contains the value 1 or -1 otherwise 0 (for the object type point (marking) this variable also contains 0). In case of object type cycle (attribute) this variable indicates whether the current control text is used for melting (1 or -1) or not (0). That is to say whether the current CAM block instance contains a control attribute named "MERGE-WITH-CONTOUR" (please refer to chapter CAM Block Types and Cycle/Control Attributes) and the insertion point of the block instance lies exactly on a definition point of the subsequent contour. |
| If you only want to test in the control text of an object whether a point is melted with a cycle or not then you can use this variable like a boolean ({?~MergeWithContour~ .. }). If this variable in the control text of cycle (attribute) contains the value -1 then the current call is used only to initialize variables. A value of 1 indicates that the control text of cycle (attribute) is actually written to the NC file. |
~UseAuxPoint~
| (6) Indicates whether the active auxiliary point (~AuxX~/~AuxY~) is to be used to move to and to move away from the contour (1) or not (0). For that all of the following conditions must be fulfilled: |
| - The corresponding option in the dialog "Edit Postprocessor" on page "Tool path" is active. |
| - Radius compensation (G41/G42) for the current tool is active. |
| - The previously enumerated object (markings are completely ignored with regard to the auxiliary point handling) was a block instance from the active CAM library without a matching cycle attribute (refer to library "CAM Universal", block "Auxiliary Point for Radius Compensation"). This block instance is now used as an auxiliary point. |
| - The contour subprogram mode is not active, i.e. this contour is not copied to a subprogram. |
| In the control text for contour start the tool is moved to this auxiliary point as described above for ~UpdateXYPosition~ and ~X1~/~Y1~.
Of course, in case of a closed contour in the control text for contour end, the tool after it was moved to the actual contour start point ~X1~/~X1~ (also contour end point) has to be moved to this auxiliary point (~AuxX~/~AuxY~) using the current infeed depth ~Z0~ with deactivated(!) radius compensation (G40). If an open contour is directly followed by another auxiliary point then the content of the variables ~AuxX~/~AuxY~ is initialized with this auxiliary point before the control text for contour end is called. Only after moving away towards the auxiliary point the tool may be moved from the current infeed depth ~Z0~ to clearance height at rapid speed (~ZClearance~) (optionally it can be retracted to working height ~ZWorking~ before that). |
~MovingVelRequired~
| (7) Indicates whether the feed rate is to be set (1) or not (0). This is always required if at the time of calling the control text for objects the approaching/infeed rate is still active (modal) and the contour is not to be engraved. The content of this variable is equal to the following logical expression:
!~ContourSubprogramActive~ && ~FirstContourElement~ && (~ZIncrementIndex~ || (!~EngravingFirst~ && !~ZIncrementIndex~ && !~UseAuxPoint~) || (~UseAuxPoint~ && (~SpecialMode~&1))) |
| The variables ~EngravingFirst~,~EngravingSecond~,~EngravingLast~ and ~MovingVelRequired~ are mutually exclusive, i.e. at any time at most one of these variables can have a value of 1 (but they can all be 0 at the same time). |
~StartOfCycleSequence~
| (2+7) Indicates whether the current cycle (attribute) is the first (1) in a new sequence of cycles (attributes) of the same CAM block instance or if the control attribute ENFORCE-CYCLE-SEQUENCE exists respectively or not (0). |
~EndOfCycleSequence~
| (2+7) Indicates whether the current cycle (attribute) is the last (1) in the current sequence of cycles (attributes) of the same CAM block instance or if the control attribute ENFORCE-CYCLE-SEQUENCE exists respectively or not (0). |
| If a sequence consists only of a single cycle (attribute) then both variables contain the value of 1. If the current cycle (attribute) is neither the first nor the last in the current sequence of cycles (attributes) of the same CAM block instance or if the variable ~CycleCommands~ contains an empty text then both variables contain the value of 0. Outside the control text for tool change or cycle (attribute) both variables contain the value of 0 as well. |
| In case ~ContourSubprogramActive~ is true (1) then these variable indicate a sequence of CAM block instances which all include an attribute named "CONTOUR-SUBPROGRAM". |
~PrevCycleBlockName~
| (1) Name of the previously enumerated CAM block (refer to object variable ~CycleBlockName~). In case a contour object was previously enumerated or a point (marking) was exported this variable contains an empty text. If no matching (see below) block instance from the active CAM library has been enumerated yet this variable contains an empty text as well. If the enumerated block instance from the active CAM library has no matching cycle attribute (refer to library "CAM Universal", block "Auxiliary Point for Radius Compensation") or the matching cycle attribute contains an empty text (refer to library "CAM Universal", block "Dummy Point") then the content of this variable does not change. |
~StartOfPointSequence~
| (7) Indicates whether the current point (marking) is the first (1) in a new sequence of points (markings) or not (0). |
~EndOfPointSequence~
| (7) Indicates whether the current point (marking) is the last (1) in the current sequence of points (markings) or not (0). |
~MALength~
| (1) The current length of material advance is calculated using ~MAWidth~ or ~MAHeight~ and ~MAOverlapping~ (always less or equal to ~MAWidth~ or ~MAHeight~). |
~ContourSubprogramActive~
| (1) This variable is set to true (1) if a block instance from the active CAM library is enumerated that contains an attribute named "CONTOUR-SUBPROGRAM" (the attribute's content is ignored) and in addition to that the corresponding option in the dialog "Edit Postprocessor" on page "General" must be active. This variable is reset to false (0) after the enumeration of the following contour is completed. Other cycles (attributes) or points (markings) do not interfere with this variable. |
~CSLB~
| (1) This variable ("CSLB" stands for "Contour Subprogram LaBel") contains the label number (>=1) of the active contour subprogram. Each time ~ContourSubprogramActive~ is reset to false this variable is incremented by 1. The first contour subprogram always describes the outer contour (pocket) and the following contour subprograms always describe inner contours (islands). |
~FrameXMin~
| (1) Minimum X-coordinate of the surrounding cuboid of all objects |
~FrameYMin~
| (1) Minimum Y-coordinate of the surrounding cuboid of all objects |
~FrameZMin~
| (1) Minimum Z coordinate of the surrounding cuboid of all objects |
~FrameXMax~
| (1) Maximum X-coordinate of the surrounding cuboid of all objects |
~FrameYMax~
| (1) Maximum Y-coordinate of the surrounding cuboid of all objects |
~FrameZMax~
| (1) Maximum Z-coordinate of the surrounding cuboid of all objects |
~P0X~ to ~P5X~,
~P0Y~ to ~P5Y~,
~P0~ to ~P9~,
~Cmd1~ and ~Cmd2~,
~PStartX~ and ~PStartY~,
~PEndX~ and ~PEndY~,
~FlagStart~ and ~FlagEnd~,
~Flag0~ to ~Flag4~,
~Count0~ to ~Count4~,
~Value0~ to ~Value4~
| (1) These user-defined variables can be used to store temporary values within any control text by means of an assignment statement {=Flag1 {1}}. They are initialized with zero or empty text (~Cmd1~ and ~Cmd2~) once before the export starts and apart from that never changed nor actively used by the postprocessor. |
~ExportAbortCode~ und ~ExportAbortText~
(1) The variable ~ExportAbortCode~ is initialized with zero. If an integer other than zero is assigned to this variable in any control text (e.g. {=ExportAbortCode {#1}}), the export is stopped without creating a file. A message then appears that displays both the value of the variable ~ExportAbortCode~ and the text content of the variable ~ExportAbortText~ (this is initialized with an empty text). Therefore, the text content of the variable ~ExportAbortText~ should always be changed together with ~ExportAbortCode~ in the same control text (e.g. {=ExportAbortText {$Incorrect tool parameter}}). If required, the text to be displayed can contain line breaks. To do this, insert the character string \n at the desired positions (e.g. {=ExportAbortText {$Incorrect tool parameter.\nPlease check the tool list.}}).
~ExportNotification~
(1) The variable ~ExportNotification~ is initialzed with an empty text. If the variable contains a text after the export, this is briefly displayed as a notification on the CAD6 drawing area or is available via the Manage > Notifications command. The text content of the variable can be set in any control text (e.g. {=ExportNotification {$A cycle was exported.}}). The texts set in this way in a control text are automatically appended to one another and displayed together at the end. If only a single text is to be displayed as a notification at the end, it must begin with the character string \0 (e.g. {=ExportNotification {$\0There was at least one tool change.}}). The character string \n creates a line break.
(1) | This variable is available during the complete export process. |
(2) | This variable is defined during a tool change. |
(3) | This variable is always defined (especially in control text for objects), its value is updated on each contour start using parameters from the active tool. |
(4) | This variable is only defined during contour start (including contour subprogram). |
(5) | This variable is defined during contour start/end (including contour subprograms). |
(6) | This variable is defined during contour start/end (including contour subprograms) and in control texts of the relevant objects. |
(7) | This variable is defined in the corresponding object's the control text. |
(8) | This variable is available during the execution of a postprocessor chain - i.e. over several export processes. |
Object Variables
The object variables described here usually contain only meaningful data during the export of the respective object type, i.e., they can be only used inside the corresponding object control text. However, there are exceptions: The variables ~AuxX~ and ~AuxY~ possibly contain meaningful data also during contour start/end (refer to ~UseAuxPoint~), this is also true for the variables ~PrevX~/~PrevY~ and ~XIncr~/~YIncr~ (see below). In addition to that object property variables are also valid in the control text for tool change (see below). The variables ~X0~/~Y0~ and ~X1~/~Y1~ are also used as working variables during the contour start and contain in the control text for contour end the current contour end point.
If the control texts for the object types line, circular arc, and Bézier curve are called then the tool is always located at the current infeed depth ~Z0~/~Z1~ (i.e. already inside the material). The moving to the start-point at rapid speed and at clearance height (~ZClearance~) and the lowering or infeeding is done by the control text for contour start (at this time the tool is located at clearance height). In the same way the tool is lifted again and moved to clearance height by the control texts for contour end. So the control texts for the object types line, circular arc, and Bézier curve contain only infeed commands that always apply to the current infeed depth ~Z0~/~Z1~. Within these control texts a tool is never explicitly lifted or moved to clearance height.
That is NOT true for the object types cycle (attribute) and point (marking) because they are not related to the control texts for contour start/end (because they obviously are no contours). The following applies to control texts of the object types cycle (attribute) and point (marking): First of all the tool has to be moved to the respective insertion point at clearance height (at this time the tool is located at clearance height) at rapid speed, then the actual cycle or the corresponding section with blocks (lines) of the control text for point (marking) is carried out (lowering/infeeding, drilling, thread cutting, etc.), and in the end the tool always has to be moved back to clearance height.
Object Type Line:
~X0~
| X-coordinate of start-point |
~Y0~
| Y-coordinate of start-point |
~X1~
| X-coordinate of end-point |
~Y1~
| Y-coordinate of end-point |
~dX~
~dY~
~Len~
| Length (norm) of the vector from start-point to end-point |
~Angle0~
| Angle of start-point relative to origin |
~Angle1~
| Angle of end-point relative to origin |
~Angle2~
| Gradient of the vector from start-point to end-point |
~Angle3~
~Angle4~
~NoXMove~
| Indicates whether the X-axis with regard to the previous end-point (~PrevX~) is still unchanged (1) or not (0). |
~NoYMove~
| Indicates whether the Y-axis with regard to the previous end-point (~PrevY~) is still unchanged (1) or not (0). |
~DiagonalMove~
| Indicates whether the current movement is carried out on a 45° diagonal (1) or not (0). If one of the variables ~NoXMove~ or ~NoYMove~ has a value of 1 then this variable always contains the value of 0. |
Object Type Circular Arc:
~X0~
| X-coordinate of start-point |
~Y0~
| Y-coordinate of start-point |
~X1~
| X-coordinate of end-point |
~Y1~
| Y-coordinate of end-point |
~X2~
| X-coordinate of a third point on the circular arc |
~Y2~
| Y-coordinate of a third point on the circular arc |
~XM~
| X-coordinate of the circle's center-point |
~YM~
| Y-coordinate of the circle's center-point |
~XMRel~
| X-coordinate of the circle's center-point, relative to start-point |
~YMRel~
| Y-coordinate of the circle's center-point, relative to start-point |
~Radius~
~Angle0~
| Start-angle of circular arc |
~Angle1~
| End-angle of circular arc |
~Angle2~
| Arc-angle of circular arc (negative = clockwise, positive = counterclockwise) |
~Direction~
| Direction of circular arc (0 = clockwise, 1 = counterclockwise) |
~Len~
~Angle3~
| Gradient of circle tangent in start-point |
~Angle4~
| Gradient of circle tangent in end-point |
Object Type Bézier Curve:
~X0~
| X-coordinate of start-point |
~Y0~
| Y-coordinate of start-point |
~X1~
| X-coordinate of end-point |
~Y1~
| Y-coordinate of end-point |
~X2~
| X-coordinate of first control-point |
~Y2~
| Y-coordinate of first control-point |
~X3~
| X-coordinate of second control-point |
~Y3~
| Y-coordinate of second control-point |
~dX~
~dY~
~Len~
| Length (norm) of the vector from start-point to end-point |
~Angle0~
| Angle of start-point relative to origin |
~Angle1~
| Angle of end-point relative to origin |
~Angle2~
| Gradient of the vector from start-point to end-point |
~Angle3~
~Angle4~
Object Type Cycle (Attribute):
If the current CAM block instance contains a control attribute named "MERGE-WITH-CONTOUR" (please refer to chapter CAM Block Types and Cycle/Control Attributes) then the variables ~AuxX~ and ~AuxY~ are not changed and all other geometric variables remain unchanged as well. At the time of merging these geometric variables contain the current values the respective object type of the contour. In case the current CAM block instance contains a control attribute named "CONTOUR-SUBPROGRAM" all geometric variables are not updated as well.
~AuxX~
| X-coordinate of the auxiliary point (equal to insertion point) |
~AuxY~
| Y-coordinate of the auxiliary point (equal to insertion point) |
| The variables ~AuxX~ and ~AuxY~ are changed by this object type only. They are even updated if the corresponding export option in the "Edit Postprocessor" dialog is deactivated or if the current CAM block doesn't have a matching cycle attribute (refer to library "CAM Universal", block "Auxiliary Point for Radius Compensation"), i.e. the respective control text is not called at all. In this case it is sufficient that a block instance is selected and therefore is also enumerated.
This auxiliary point (refer to ~UseAuxPoint~) can be used to move to and away from the contour with activated/deactivated radius compensation. |
~X0~/~X1~
| X-coordinate of the cycle's insertion-point |
~Y0~/~Y1~
| Y-coordinate of the cycle's insertion-point |
~CycleCommands~
| Contains the concatenated text content of all matching cycle attributes of the current CAM block instance (usually with the NC commands for the actual cycle, such as drilling, thread cutting, etc.). This variable should be placed in a separate line inside the control text for cycles (attributes). If this variable contains an empty text that complete line is ignored during export (refer to library "CAM Universal", block "Dummy Point"). |
~CycleBlockName~
| Name of the current CAM block (refer to working variable ~PrevCycleBlockName~) |
~CycleURL~
| Contains the URL (file location) of a text file with the NC commands for the actual cycle (drilling, thread cutting, etc.). |
~Len~
| Length (norm) of the vector from origin to insertion-point |
~Angle0~
| Angle of insertion-point relative to origin |
~Angle1~
~dX~
| Horizontal scaling of the CAM block instance as displayed in the dialog of the command "Edit Properties" (button "Special"). |
~dY~
| Vertical scaling of the CAM block instance as displayed in the dialog of the command "Edit Properties" (button "Special"). |
~Angle2~
| Rotation of the CAM block instance as displayed in the dialog of the command "Edit Properties" (button "Special"). |
Object Type Point (Marking):
~X0~/~X1~
| X-coordinate of the insertion-point |
~Y0~/~Y1~
| Y-coordinate of the insertion-point |
~Len~
| Length (norm) of the vector from origin to insertion-point |
~Angle0~
| Angle of insertion-point relative to origin |
~Angle1~
Valid in Control Texts of All Object Types as well as control texts for contour start/end:
~PrevX~
| X-coordinate of the previous end-/start-point or the previous insertions-point respectively |
~PrevY~
| Y-coordinate of the previous end-/start-point or the previous insertions-point respectively |
| These variables are initialized at the appropriate point in time with the respective content of variables ~X1~ and ~Y1~. In case of the object types cycle (attribute) and point (marking) it is possible that the tool after the respective control text was processed is not located at position (~X1~/~Y1~) any more. Usually this is irrelevant. However, when exporting incremental (relative) coordinates the tool has to be moved afterwards to position (~X1~/~Y1~) at clearance height. This makes sure that the following incremental coordinates are correct. |
~XIncr~
| Incremental (relative) X-coordinate of previous end-/insertions-point. Actually the content is the following term (incl. enclosing parentheses): (~X1~-~PrevX~). |
~YIncr~
| Incremental (relative) Y-coordinate of previous end-/insertions-point. Actually the content is the following term (incl. enclosing parentheses): (~Y1~-~PrevY~). |
During contour start/end these variables contain the last valid end-/insertions-point or the resulting incremental coordinates respectively.
Valid in Control Texts of All Object Types as well as control text for contour start/end and tool change:
Each of the following variables contains a current object property (after resolving all transmissions for the export, refer to General Parameters and Layers, Pens, and Transmission). The content is a copy of the content of the corresponding member of the structure MKI_XPROPERTY. For names the corresponding index from this structure is used to retrieve the name of the line pattern, pen, or layer.
~LineWidth~
| Line width (use the conditional statement, refer to Statements in Texts) |
~LineTypeName~
| Line type name (use the text comparison statement, refer to Statements in Texts) |
~LineTypeScale~
| Line type scale (use the conditional statement, refer to Statements in Texts) |
~LineMode~
| Line cap, line join mode, polyline optimization, and line width display in model space (refer to bitwise AND in Term Evaluation) |
~LineColor~
| Line color (always color model "RGB", refer to MKI_COLORVALUE) |
~LineAlpha~
~FillMode~
| Filling mode (since only objects with a contour can be exported the filling modes MKI_FILLMODE_FILLED and MKI_FILLMODE_ERASER cannot occur). |
~FillColor~
| Filling color (always color model "RGB", refer to MKI_COLORVALUE) |
~FillAlpha~
~PenName~
~LayerName~
~PageIndex~
| Page index (refer to member "Page" of structure MKI_XPROPERTY) |
~UseFlag~
| Transmission flags (refer to member "Flag" of structure MKI_XPROPERTY) |
Database Variables and Drawing Variables
In case the current object has been assigned to the active database its record cells can be accessed by entering the corresponding column titles as variable names, for example ~ObjectComment~. Please make sure that there is no name conflict between the column titles and the variable names stated above. Database variables may be used inside control texts for contour start and contour end as well as inside all control text for objects. Database variables are only available if in the postprocessor settings in the dialog "Object Control" the option "Apply active database on export" is active.
Of course you can also state database requests as described in the CAD6 Reference (refer to Variables) in any control text. In addition to that you can use customizable drawing and fixed variables (refer to Variables) in all control texts, e.g. for the file name of the drawing (~%z0~) or the current date (~%d2~).
Local attributes, outline attributes, and point attributes
You can access local attributes as well as outline and point attributes of objects, e.g. lines, curves, surfaces or instances (except cycle or control attributes) in all relevant control texts by using the attribute name as the variable name, for example ~Z-Depth~. Please note that the maximum text length is limited to 500 characters per variable. So if an attribute contains longer text, it will be cut off automatically.
These variables are generated dynamically by the postprocessor for each object listed. This means that they only exist if the corresponding local attributes or contour and point attributes are actually defined in the respective object. Therefore, you should use the non-existence statement in control texts:
{!Z-Depth {$}
{$
G01 Z{+~Z-Depth~} F{#~LoweringVel~}{?~ToolControl1~{$ M08}}
}}
Otherwise, the text (***UNDEFINED***) appears in the exported NC file at the relevant point if the variable does not exist.
|