Sei sulla pagina 1di 44

**************************************************************************

* Machine independant Code Generator include file


*
* Filename: mill-initialise.cgi
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle
* 27/02/06 RHA DEV00016236 Spindle control fixes
* 10/03/06 RHA DEV00016621 Add TNC movement code token
* 16/03/06 RHA DEV00016660 Change to IF tokens for TNC Datum Shifting
* Version 10.75
* 11/05/06 RHA DEV00017093 Variables in user tokens USER11 onwards
* 16/05/06 RHA DEV00017213 Correct index handling for no rotation cases
* Version 11.0
* 01/08/06 RHA DEV00017818 Hole cycle clearance and level options IF token
* 01/08/06 RHA DEV00017490 Make spindle start warning optional
* 04/08/06 RHA DEV00017771 Number of turns token for ISO
* Version 11.5
* 20/09/06 RHA DEV00017909 Expand trace options
* 26/10/06 RHA DEV00018471 HPCC improvements
* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable
* 08/01/07 RHA DEV00018930 Make ZSAFE value available as a token for hole cycles
* Version 11.75
* 30/04/07 RHA DEV00019883 Tokens etc for Euler angles in Index output
* 14/05/07 RHA DEV00019985 Tokens for XINC etc., improve XABSORIGIN Description
* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange
* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls
* Version 12.00
* 10/08/07 RHA DEV00020285 Add new ISO Datum Shift Tokens
* 25/09/07 RHA DEV00021119 Add setvars and tokens for pivot mode control
* 27/09/07 RHA DEV00021119 Give pivot code its own format entry
* Version 12.25
* 18/10/07 RHA DEV00021382 Correct use of #TMP - #COMPTEMP
* 04/12/07 RHA DEV00021534 Enable longhand tapping
* Version 12.50
* 17/01/08 RHA DEV00022021 Incremental option for Z Clear
* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings
* 22/01/08 RHA DEV00022142 Clearance options applied to all clearance tokens
* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL
* Version 2009.1
* 14/04/08 RHA DEV00018979 Correct BNUM reset
* 07/07/08 RHA DEV00023548 Implement NC Code Suppression
* 06/08/08 RHA DEV00024310 Back bore and face in milling
* 06/08/08 RHA DEV00023786 Add tool group and ID tokens
* 11/08/08 RHA DEV00024364 Implement helical hole cycles
* 21/08/08 RHA DEV00024504 Probing tokens for ISO machines
* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction
* 10/09/08 RHA DEV00024504 Probe token corrections
* 24/09/08 RHA DEV00024855 Correct spindle direction in back bore longhand
* 07/10/08 RHA DEV00025129 Longhand back bore cutting in M5 spindle stop mode
* Version 2009.2
* 24/10/08 RHA DEV00025000 Allow Rapid after tool change with null move
* 05/11/08 RHA DEV00024851 Cycle DEf 204 for TNC

* 05/11/08 RHA DEV00023525 Fix CYCL DEF numbers and descriptions as tokens
* 07/11/08 RHA DEV00025098 Make tool angle available in setup & core tool change
* 12/11/08 RHA DEV00024851 CYCLE DEF 204 fixes
* 14/11/08 RHA DEV00024851 Counter bore depth token corrections
* 21/11/08 RHA DEV00025098 Use new system variable for Included tool angle
* 07/01/09 RHA DEV00025831 Add token for holdertype
* 09/01/09 RHA DEV00024568 Make Tool Unit available in toolchange. Set variable
on token
* 06/03/09 RHA DEV00026198 Use Job data instead of ASK questions
* Version 2010.1
* 05/06/09 RHA WI32294 Create Siemens adaptive mill template
* 05/06/09 RHA WI32294 Siemens datum set tokens
* 16/06/09 RHA WI32294 Siemens Subroutine End tokens and Cycle return feed facto
r
* 18/06/09 RHA WI31681 Siemens Thread Mill tokens
* 19/06/09 RHA WI31681 Siemens Angle tokens for toolchange and index
* 22/06/09 RHA WI31681 Tokens and variables for Siemens Hermle variant
* 25/06/09 RHA WI34681 Correction to Home and ToolChange tokens
* 07/07/09 RHA WI32294 Initial feedback from GST
* 09/07/09 RHA WI34873 New Thread Mill - Add new code options
* 15/07/09 RHA WI34873 Fix Thread Mill Cycle Level
* 27/07/09 RHA WI31681 Tokens and logic for thread ID & OD settings
* 05/08/09 RHA WI35305 Add Probing mode control tokens etc
* 06/08/09 RHA WI35307 Add code con and option for manual toolchange
* 19/08/09 RHA W35537 Add Lead and Starts tokens for thread mill
* 20/08/09 RHA W35450 Add tokens for coordinate rotation to sub call
* 09/09/09 RHA W35307 Manual toolchange and tokens for angled head
* 15/09/09 RHA W35307 Set values for tool angle (angled head) tokens etc
* 17/09/09 RHA W35307 System variables renamed HEADANGLE MOUNTANGLE
* 23/09/09 RHA W35563 Thread mill bottom to top formatting & suppress points cal
l
**************************************************************************
*
***************************************************************************
***************************************************************************
* SPLINE OUTPUT
*
* For Polynomial Interpolation End points EX,EY,EZ Coeffs AX,BX etc
***************************************************************************
*
* NC Output control for PCIs (ECS2700)
*
Block Numbering
*
G (preparatory) codes
*
Circular Interpolation
*
Spindle / Gears
*
General Coordinate Systems
*
Rapid Traverse
*
Hole Cycles
*
Toolchange / Tooling
*
Subroutines
*
Cutter Radius Compensation
*
*
Datum Shifting
* #RECORD
*
Multi-plane / Rotary
*
M-FUNCTIONS
*Thread Mill
* Variables for Thread Mill canned cycle
*
*Extra Variables for TNC

************ Check useage and remove if not required


*User variables for
*
*
Constants for start of G function in DATA1 & M function in DATA2 stateme
nts
*
*
*
*
*
*********************************
*
Tokens - Use in Code Constructor
*
*********************************
*
*
*
G-Codes
*
M Codes
*
General
*
Toolchange / Tooling
* Rapid to Home or ToolChange
*
Cutter Radius Compensation
*
Circular Interpolation
*
Hole Cycles
* Added for Sinumerik840 & Fadal cycles
*
Datum Shift : Translate / Index
* Origin shift for TNC
*
* Datum shift for ISO
* Datum Tokens For Siemens
*
Tooling Sheet / Program Information
*
Subroutines
*
By block number
*
Position : Before, after, in-line with main NC Program
*
Datums
*
Rotary Axes / Milling
* Token^TOOL-ANGLE-1^[#TOOLR1=!FT_PRIMARY2]^Tool Angle - First Axis
* Token^TOOL-ANGLE-2^[#TOOLR2=!FT_SECONDARY2]^Tool Angle - Second Axis
* 5 Axis IKJ
* Pivot options
* Spline Output
* Fanuc specific
* Heidenhain specific
* Also in Siemens
* Siemens Polynomial
* Tokens for Polynomials - Trailng brackets
* Tap cycle tokens for different addresses
* Thread Mill Canned Cycle
* Added for Siemens
***********************************************************
* Job Record Tokens
***********************************************************
***********************************************************
* User tokens for
***********************************************************
*
Heidenhain TNC Only
* modal lines in Drill Cycle Modify
* Euler angles for Workplane
* Tokens for back bore cycles
* Tokens for Helical cycles
* Tokens for tool group and ID
* Tokens for Probing

* One token for depth #BOREBOSSZDEPTH #WEBPOCKETZDEPTH #4THAXISZDEPTH


***********************************************************
*
M-Functions (Used to create default Code Constructor)
***********************************************************
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-iso-mach-mm.cgi
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 16/12/05 RHA DEV00015566 Spline output enabled
* 20/02/06 RHA DEV00016344 New MM line switch for 5 axis IJK
* 02/03/06 RHA DEV00016506 Change default Home and Tool Change locations
* 07/03/06 RHA DEV00015555 High Speed mode tolerance
* Version 11.0
* 18/07/06 RHA DEV00017692 Tidy Code Generator options in hole macros
* 28/07/06 RHA DEV00017797 New MM and MT line switches
* 07/08/06 RHA DEV00012241 Add High speed and coolant controls to Tool Change*
* 08/08/06 RHA DEV00017341 Correct Tool Length Offset setting
* 13/09/06 RHA DEV00018145 Correct High Speed Mode Q var macro setting
* Version 12.00
* 03/04/07 RHA DEV00020278 Allow Macro15 access to USERVAR2
* Version 12.50
* 06/02/08 RHA DEV00022190 Set default helical interpolation
* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL
* Version 2009
* 06/08/08 RHA DEV00024310 Back Bore Cycles Q205
* 13/08/08 RHA DEV00024364 Helical Hole Cycles Q205
* Version 2009.2
* 19/12/08 RHA DEV00025797 Comment new MT fields
* Version 2010.1
* 18/06/09 RHA WI34606 Set SPLINE_OUTPUT for Siemens. Add comment to MM details
for all adaptive mill
* 25/09/09 RHA W36130 Set CRC factor to 1.1
**************************************************************************
*
Note that SPLINE_OUTPUT must also be set to the same value in this file.
**********************************************
* Setting up spindle defaults
**********************************************
* Code Generator Options
* Tapping Modifiers
* Longhand^No^Yes
* CRC Register
* Work Datum Override
* Tap Cycle Type^Floating^Rigid
* Tap CycleTap Cycle^Right Hand^Left Hand
*Chord
Enter chord length for arc splitting
*Full Canned Cycle
* High speed tolerance
* High Speed Mode^Off^On
* Coolant^Off^Flood^Mist
* Tool Length Offset
*

********************************************************************************
**********************
*
Gcodes
20
30
35
40
45
*
Mcodes
*
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-default-kt.cgi
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 13/03/06 RHA DEV00016683 Alter horizontal machine width
* Version 11.75
* 23/04/07 RHA
Change gantry default size
**************************************************************************
* Base=Height, Width, Length, Thickness
* Mount=Length,Width,Height would be used in case of trunnion table
*lower mount would be used as the default mount
*side mount is for machines with a vertical mount
*saddle mount is for machines with a saddle
* Table=Length, Width, Height, Lead, Angle, Radius
* the line below is used for table in case of horizontal machines with B primary
axis
* Head=Type,Length, Width, Height,Lead, Angle,Protrusion Length,Protrusion Width
,Protrusion Ht,SpindleLocation
* Head=Type,Length, Width, Height,Protrusion Length,Protrusion Width,Protrusion
Ht
* KTTILTTABLE Length, Width, Height, Lead, Angle, Radius
* cylinder KTROTUNIT Length, Radius
* KTSADDLE Length, Radius,thickness,width,height
* KT Chuck Type, Length,Diameter,Bore,JawLength,JawHeight,JawWidth,Protrusion,No
Jaws,NoSteps
*KT ATC - Length Width Depth Lead Angle Diameter Protrusion
*
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-iso.cgi
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 16/12/05 RHA DEV00015647 Add R in XY Only Option
* 31/01/06 RHA DEV00012212 Align code constructor trace text
* 06/02/06 RHA DEV00007742 Single helix option for Thread Mill
* 10/02/06 RHA DEV00016236 Spindle control fixes
* 14/02/06 RHA DEV00016311 Change index defaults
* 15/02/06 RHA DEV00016297 Incremental datum shift

* 20/02/06 RHA DEV00016344


* 24/02/06 RHA DEV00016420
* 27/02/06 RHA DEV00016236
* 28/02/06 RHA DEV00016369
* 01/03/06 RHA DEV00016487
* 02/03/06 RHA DEV00016511
* 07/03/06 RHA DEV00015555
codecon
* 07/03/06 RHA DEV00014230
* 14/03/06 RHA DEV00016367
* 15/03/06 RHA DEV00015533
* 15/03/06 RHA DEV00015655
* 21/03/06 RHA DEV00007321
* Version 10.75
* 12/04/06 RHA DEV00010822
* 12/04/06 RHA DEV00016781
* 12/04/06 RHA DEV00016809
* 20/04/06 RHA DEV00016925
* 22/05/06 RHA DEV00017232
* Version 11.0
* 25/07/06 RHA DEV00016799
* 26/07/06 RHA DEV00017767
* 01/08/06 RHA DEV00017818
* 01/08/06 RHA DEV00017490
* 03/08/06 RHA DEV00017814
* 04/08/06 RHA DEV00017771
* 24/08/06 RHA DEV00017771
* Version 11.5
* 20/09/06 RHA DEV00017909
* 26/10/06 RHA DEV00018471
* 03/11/06 RHA DEV00018471
* 21/12/06 RHA DEV00018873
* 04/01/07 RHA DEV00018873
* 08/01/07 RHA DEV00018930
* 07/02/07 RHA DEV00018471
* 07/02/07 RHA DEV00018873
* Version 11.75
* 30/04/07 RHA DEV00019883
* 14/05/07 RHA DEV00019985
* 24/05/07 RHA DEV00019981
* 29/05/07 RHA DEV00019981
* Version 12.00
* 09/08/07 RHA DEV00020648
* 10/08/07 RHA DEV00020285
* 25/09/07 RHA DEV00021119
* 27/09/07 RHA DEV00021119
* Version 12.25
* 03/12/07 RHA DEV00021534
* Version 12.50
* 17/01/08 RHA DEV00022021
* 04/02/08 RHA DEV00016982
* 18/02/08 RHA DEV00022063
* Version 2009.1
* 14/04/08 RHA DEV00023113
* 08/05/08 RHA DEV00020490
* 06/08/08 RHA DEV00024310
* 06/08/08 RHA DEV00023786
* 07/08/08 RHA DEV00023786
* 11/08/08 RHA DEV00024364
* 20/08/08 RHA DEV00024474

Implement IJK vector for 5 axis cycle


Dwell token in peck drill codecon
Spindle control fixes
Fix Convert rapid to feed
Set modality of inex direction M code
G54 default format to be 2.2
High Speed mode tolerance, Reposition ZMOVE in Rapid
Rotation axes range correction
Spindle control - add spindir to rapid codecon
Add format table entries for toolstore tokens
Add GEARMCODE token to hole cycles
Correct Datum setting - limits
Designate logical tokens by colour
Document use of UARRAY1 in template
Colour code tokens
Add PLANEGCODE to Rapid After ToolChange
Add FEEDMODEGCODE for Inverse Time Feeds
Remove force output in Rapid After ToolChange
Correct g98g99 terminology - all amachines
Hole cycle clearance and level options
Make spindle start warning optional
Add WORKGCODE token to Rapid Home & Rapid TC
Number of turns token for ISO
Suppress P0 in helix
Expand trace options
HPCC improvements
ToolChange HPCC call should only be via a token
Call 5 axis off at end if still active
5 Axis cancel, correct for 3 axis machines
Make ZSAFE value available as a token for hole cycles
Correct Highspeed output in CORE TC
try again
Tokens etc for Euler angles in Index output
Tokens for XINC etc.
Orthogonal plane cycle controls
Force longhand holes in mc coords
Implement pitch suppression in ISO mill
Add new ISO Datum Shift Tokens
Add setvars and tokens for pivot mode control
Give pivot code its own format entry
Enable longhand tapping
Incremental option for Z Clear
Make tool user tokens available in tool set up
Fix single helix and tidy call structure
Feed after ToolChange code constructor added
Add new hole depth option. Incremental from Retract
Back bore and face in milling
Add tool group and ID tokens
Format table entries for Tooling tokens
Implement helical hole cycles
Add Feed Type setting to toolchange

* 26/08/08 GST DEV00022751 Thread mill depth in canned cycle, RHA-added set vari
ables
* 26/08/08 RHA DEV00021410 Thread mill token values
* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction
* 11/09/08 RHA DEV00024662 Fix ASIN error in thread mill canned cycle
* 11/09/08 RHA DEV00024504 Probing format table
* 16/09/08 RHA DEV00024824 Format helical tokens with decimal part
* 16/09/08 RHA DEV00024845 Remove duplicate token from back bore
* 24/09/08 RHA DEV00024504 Format table changes requested
* 24/09/08 RHA DEV00024855 Correct spindle direction in back bore longhand
* 01/10/08 RHA DEV00024310 Add format Table entries for back bore
* Version 2009.2
* 24/10/08 RHA DEV00025000 Allow Rapid after tool change with null move
* 07/11/08 RHA DEV00025098 Make tool angle available in setup & core tool change
* 14/11/08 RHA DEV00024851 Counter bore depth token corrections
* 07/01/09 RHA DEV00025831 Add token for holdertype
* 09/01/09 RHA DEV00024568 Make Tool Unit available in toolchange. Set variable
on token
* 06/03/09 RHA DEV00026198 Use Job data instead of ASK questions
* 17/03/09 RHA DEV00026452 Changes for 3D Z with TLO application
* Version 2010.1
* 25/06/09 RHA WI34681 Correction to Home and ToolChange tokens
* 08/07/09 RHA WI34873 New Thread Mill - Restructure existing canned cycle
* 09/07/09 RHA WI34873 New Thread Mill - Add new code options
* 15/07/09 RHA WI34964 5 Axis IJK vectors should have format default 1.6
* 20/07/09 RHA WI34873 Fix Internal/External codes
* 22/07/09 RHA WI34873 Add Thread Mill token format refs
* 23/07/09 RHA WI34873 Clarify option for Threaded Depth Sign
* 23/07/09 RHA WI35139 Remove duplicate variable declarations
* 29/07/09 RHA WI34873 Add signed absolute option for depth
* 05/08/09 RHA WI35305 Add Probing mode control tokens etc
* 05/08/09 RHA WI34754 Make call to Feed Type code constructor optional in toolc
hange
* 06/08/09 RHA WI35307 Add code con and option for manual toolchange, tidy safe
block
* 07/08/09 RHA WI34873 Fix Format entry for T-MILL-MODE
* 19/08/09 RHA W35537 Add Lead and Starts tokens for thread mill
* 20/08/09 RHA W35450 Add tokens for coordinate rotation to sub call
* 25/08/09 RHA W35537 Add TEXT for Starts in old cycle
* 09/09/09 RHA W35307 Manual toolchange and tokens for angled head
* 15/09/09 RHA W35307 Set values for tool angle (angled head) tokens etc
* 17/09/09 RHA W35307 System variables renamed HEADANGLE MOUNTANGLE
* 17/09/09 RHA W35307 Improve token availability
* Version 2010.1 SP1
* 13/10/09 RHA W36119 Remove [RELIEFDIR] [RELIEFDIST] from back face cycle
* 13/10/09 RHA W36121 [RELIEFDIR] token has no value
* 13/10/09 RHA W33257 Make Through Coolant token more widely available
* 13/10/09 RHA W36415 Allow TNC TOOLCALL when #MOVE=0 PT_INDEX_HANDLER
* 14/10/09 RHA W33489 Default coords, feeds, speeds etc to 5 digits before decim
al
* 15/10/09 RHA W33119 Correct ZLEVEL modality setting
**************************************************************************
*
*************************
*
*
Template Notes Area
*
*
*************************
* Notes must be defined outside of all procedures using the following syntax
* Text is displayed in the machine NOTES area of the CGD
* Length limit
*
*
********************************

*****************************
*
*
Template Dependant Langu
age extensions for Code Wizard *
*
********************************
*****************************
*************************************************
*
Tab Name
:
General G-Codes
*************************************************
*************************************************
*
Tab Name
:
Hole Cycle G-Codes
*************************************************
*************************************************
*
Tab Name
:
Datum G-Codes
*************************************************
* Setvar^DATA1(25)^54^Datum G-Codes^REAL^Work Coord System 1
* Setvar^DATA1(26)^55^Datum G-Codes^REAL^Work Coord System 2
* Setvar^DATA1(27)^56^Datum G-Codes^REAL^Work Coord System 3
* Setvar^DATA1(28)^57^Datum G-Codes^REAL^Work Coord System 4
* Setvar^DATA1(29)^58^Datum G-Codes^REAL^Work Coord System 5
* Setvar^DATA1(30)^59^Datum G-Codes^REAL^Work Coord System 6
********************************************
*
Tab Name
:
M-Codes
********************************************
*
*
*************************************************
*
Tab Name
:
More Hole Cycle G-Codes
*************************************************
*************************************************
*
Tab Name
:
Coolant Control
*************************************************
*************************************************
*
Tab Name
:
New Datum Setting
*************************************************
*************************************************
*
Tab Name
:
NC File General
*
*************************************************
****************************************************************
* Tab Name
:
Setup Sheet
****************************************************************
*************************************************
*
Tab Name
:
Block Numbers
*************************************************
*************************************************
*
Tab Name
:
Rapid Traverse
*************************************************
* Setvar^#RAPIDFEEDRATE^5000^Rapid Traverse^REAL^Highfeed (units/min.)
*************************************************
*
Tab Name
:
Circular Interpolation
*************************************************
*************************************************
*
Tab Name
:
Cutter Compensation
*************************************************
*************************************************
*
Tab Name
:
Hole Cycles
*************************************************
* Setvar^#ORTHCYCLES^0^Hole Cycles^YESNO^Allow Canned Cycle On Orthogonal Planes
*************************************************
*
Tab Name
:
Thread Mill Cycle
*************************************************

* Setvar^#ORTHMILLCYCLES^0^Thread Mill Cycle^YESNO^Allow Canned Cycle On Orthogo


nal Planes
*************************************************
*
Tab Name
:
Subroutines
*************************************************
*************************************************
*
Tab Name
:
Tool Change
*************************************************
***********************************************************
*
Tab Name
:
Multi-plane / Rotary Milling
***********************************************************
* Setvar^#AXISTYPE1^2^First Rotary Axis^LIST^Axis Mounted In^1^Head^Table
***********************************************************
* Workplane definition
***********************************************************
***********************************************************
*
Tab Name
:
4-5 Axis Machining
***********************************************************
********************************************************************************
**********
*
Modal Variables
****************************************************************
* Tab Name
:
Debug
****************************************************************
****************************************************************
* G Code 5 Axis
*
*
*****************************************
*
*
Tab Name
:
Program Start
*
*
*****************************************
*
*
Note ! Cannot be a procedure because %SUBROUTINE must be defined in the
START or END macros
*
*
Rotary Axes set to zero for start of program
*$DEBUG=Y
********************************************************************************
*********************************
*
Note ! Cannot be a procedure because %SUBROUTINE must be defined in the
START or END macros
* *************************************************
*
Code constructors
* *************************************************
* *************************************************
*
*
Tab Name
:
Set-Up / Tooling Sheet
*
*
*************************************************
*
*
*
* Setup sheet header if requested (not in loop)
*
*
Remove duplicate tools from Tool Sheet
*
* Setup sheet trailer if requested (not in loop)
*
*
*
*************************************************
*
*
Tab Name
:
Set Tooling Data
*
*
*************************************************

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

*****************************************
*
Tab Name
:
Rapid Move
*****************************************

Output speed block ?


*********************************************
*
Tab Name
:
Linear Interpolation
*********************************************

Output speed block ?


*************************************************
*
Tab Name
:
Circular Interpolation
*************************************************

2D only, blank unwanted values


Output speed block ?
Enables control of multi-helix block for TNC
Call to get number of turns
Output speed block ?
Suppress number of turns if 0
*****************************************
*
Tab Name
:
Dwell
*****************************************
*****************************************
*
Tab Name
:
Cutter Compensation
*****************************************

*************************************************
*
Tab Name
:
Cancel Cutter Compensation
*************************************************
*************************************************
*
Tab Name
:
Drill Cycle
*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Counterbore Cycle
*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Peck Drill Cycle

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Tapping Cycle
*************************************************
Rigid or floating
Output speed block ?
Output speed block ?
*************************************************
*
Tab Name
:
Ream / Bore Cycle
*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Bore Cycle
*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Chipbreak Cycle
*************************************************
Output speed block ?
*********************************************
*
Tab Name
:
Back Bore Cycle
*********************************************

Set Relief token values


Output speed block ?
**********************************
* Tab Name : Back Bore Longhand *
**********************************
*********************************************
*
Tab Name
:
Back Face Cycle
*********************************************
Output speed block ?
***********************************
* Tab Name : Back Face Longhand *

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

***********************************

*************************************************
*
Tab Name
:
Helical Cycle
*************************************************

*************************************************
*
Tab Name
:
Thread Mill Cycles
*************************************************

Output speed block ?


*************************************************
*
Tab Name
:
Hole Cycle Points
*************************************************
Output speed block ?
*************************************************
*
Tab Name
:
Cancel Canned Cycle
*************************************************

*****************************************
*
Tab Name
:
First Toolchange
*****************************************

Output speed block ?


*****************************************
*
Tab Name
:
General Toolchange
*****************************************

Output speed block ?


*****************************************
*
Tab Name
:
Last Toolchange
*****************************************

Output speed block ?


*****************************************
*
Tab Name
:
Core Toolchange *
*****************************************
*****************************************
*
Tab Name
:
Manual Toolchange
*****************************************
Move to Manual TC Position

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

Move to ATC Position, Z First


Sequence - All Stop
Sequence - Unload ATC
Sequence - Move to Manual TC Position
Sequence - Unload Manual
Sequence - Move to ATC Position
Sequence - Load Manual
Sequence - Re-Start
*****************************************
*
Tab Name
:
Spindle
*****************************************
*****************************************
*
Tab Name
:
Program Stop
*****************************************

*****************************************
*
Tab Name
:
Coolant
*****************************************

*****************************************
*
Tab Name
:
Exact Stop
*****************************************

*****************************************
*
Tab Name
:
Feed / min / rev
*****************************************

*****************************************
*
Tab Name
:
Comment
*****************************************
*****************************************
*
Tab Name
:
Insert NC Code
*****************************************

*****************************************************
*
Tab Name
:
Re-Select Tool Length Offset
*****************************************************
*****************************************************
*
Tab Name
:
High Speed M/c - ON
*****************************************************
*****************************************************
*
Tab Name
:
High Speed M/c - OFF
*****************************************************

*
*
*************************************************
*
*
Tab Name
:
Warnings
*
*
*************************************************
*
*
*
*****************************************
*
*
Tab Name
:
Rapid To Toolchange
*
*
*****************************************
*
* Output speed block ?
*
*
*********************************************
*
*
Tab Name
:
Feed After Toolchange *
*
*********************************************
*
* Output speed block ?
* Output speed block ?
*
*
*********************************************
*
*
Tab Name
:
Rapid After Toolchange *
*
*********************************************
*
* Output speed block ?
* Output speed block ?
*
*
*****************************************
*
*
Tab Name
:
Rapid To Home
*
*
*****************************************
*
* Output speed block ?
*
*
*
*************************************************
*
*
Tab Name
:
Set Work Datums
*
*
*************************************************
*
*
*
*
*************************************************
*
*
Tab Name
:
Select Work Datums
*
*
*************************************************
*
*
*
Datum Shift- no rotary motion
* Called from Datum Shift and Index Pallet commands for Absolute Datum setting
*
Index Pallet with Rotary output via Index Pallet Code Constructor.
*
*
*
Datum Shift- no rotary motion
* Called from Datum Shift and Index Pallet commands for Incremental Datum sett
ing
*
Index Pallet with Rotary output via Index Pallet Code Constructor.
*
*
*
*************************************************
*
*
Tab Name
:
Subroutine Start

*
*
*************************************************
*
* Output mode change for subroutines if different
*
*
*************************************************
*
*
Tab Name
:
Subroutine Call
*
*
*************************************************
*
*
*
*************************************************
*
*
Tab Name
:
Subroutine End
*
*
*************************************************
*
* Output mode change for subroutines if different
*
*************************************************
*
*
Tab Name
:
Translate
*
*
*************************************************
*
*
*
*
*************************************************
*
*
Tab Name
:
Spline Parameter
*
*
*************************************************
*
* Following code constructors for MPL support only
*
*
*************************************************
*
*
Tab Name
:
5 axis mode
*
*
*************************************************
*
*
*
*************************************************
*
*
Tab Name
:
Index Table
*
*
*************************************************
*
*
*
*************************************************
*
*
Tab Name
:
Index Head
*
*
*************************************************
*
* Sequence Definition^Index Head^-1^Multi-Axis (Rotary)
* Use Tokens^DELETE^BLKNUM^PRESETGCODE^WORKGCODE^XABSORIGIN^YABSORIGIN^ZABSORIGI
N^CPLNAME
* Use Tokens^REAR_ANGLE^FRONT_ANGLE^WORKREGISTER^ROTATE CLW/CCLW^T-CLAMP-ON^T-CL
AMP-OFF
* Use Tokens^USER-STRING^USER-STRING-1^USER-STRING-2^USER-STRING-3^USER-STRING-4
^USER-STRING-5
* Use Tokens^USER-1^USER-2^USER-3^USER-4^USER-5^USER-6^USER-7^USER-8^USER-9^USER
-10
* Use Tokens^USER-11^USER-12^USER-13^USER-14^USER-15^USER-16^USER-17^USER-18^USE
R-19^USER-20
* Default Sequence^[DELETE]^[BLKNUM]^[T-CLAMP-OFF]
* ENDIF
* IF TEMPLATE=4AXMILL
* Default Sequence^[DELETE]^[BLKNUM]^[WORKGCODE]^[<C>REAR_ANGLE]^(^[CPLNAME]^)

* ENDIF
* IF TEMPLATE=MPLMILL^5AXMILL
* Default Sequence^[DELETE]^[BLKNUM]^[WORKGCODE]^[<C>REAR_ANGLE]^[<C>FRONT_ANGLE
]^(^[CPLNAME]^)
* ENDIF
* IF TEMPLATE=MPLMILL^4AXMILL^5AXMILL
* Default Sequence^[DELETE]^[BLKNUM]^[T-CLAMP-ON]
*
*
*************************************************
*
*
Tab Name
:
Select Rotary / Planar Mode
*
*
*************************************************
*
*
*************************************************
*
*
Tab Name
:
Reset Rotary Datum
*
*
*************************************************
*
*
*************************************************
*
*
Tab Name
:
Wrap Height
*
*
*************************************************
*
* Dummy procedures
*** Format table
* Note token numbers 0-14 should not be changed
* 10 is null output for initialisation of variables.
* FT_SECONDARYROT2, A,3,2,640,4,2,640, 50
Head - Secondary Setting
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-Iso-Probing.cgi
*
Author:
Sam Haslar / RHA
* Date:
22 August 20085
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 2009.1
*
FIRST ISSUE
* Change output procedures to code constructors
* Change macro numbers to 301 series after discussion with SJO
* Remove command details
* 26/08/08 RHA Update logic to latest received mac file
* 11/09/08 RHA Update logic to latest received mac file
* 16/09/08 RHA Trailing comma - macro 304 definition
* 18/09/08 RHA Incorporate latest logic changes from Sam Hasler
* 24/09/08 RHA DEV00024504 Code constructor formatting changes
* 01/10/08 RHA DEV00025060 Force distance positive on 4th axis probe cycles
* Version 2009.1 SP
* 01/10/08 RHA DEV00025318 Correct datum setting for probe cycles
* Version 2010.1
* 05/08/09 RHA WI33007 Fix S word for datum Over-ride
* 05/08/09 RHA WI35305 Add Probing mode control tokens etc
********************************************************************************
*****
*
prototype probing macros
********************************************************************************
*****
*

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

This file implements the following cycles:


Feed:
1
Move probe
Bore/Boss:
2
Bore 3 Point
3
Boss 3 Point
4
Bore 4 Point
5
Boss 4 Point
Surface:
6
Probe Surface
7
Angled Single surface
Web/Pocket
8
Probe Web/Pocket
9
Angled Web / Pocket
Internal/External Corner:
10
Internal Corners
11
External Corners
4th Axis:
12
4th Axis X
13
4th Axis Y
Modifier 250 mapped to system variable 62 (PATHTRACE) will be set to one
of the above cycle numbers

*
********************************************************************************
*****
* Notes
********************************************************************************
*****
*
*
Find and count (possible) format table references
*
grep -E "=[0-9]+\]" ..\ext\VAB-probe.mxt |sed 's/^.*=\([0-9]\+\)\].*$/\1
/g' | C:\cygwin\bin\sort -n | uniq -c
*
*
machdef\error.mpp
*
*
Probing entries in Format Table start at Line 3455 of VAB-probe.mxt
********************************************************************************
*****
* Internal Variables - NOT exposed to Code Wizard users
********************************************************************************
*****
* All Cycles (except cycle 1)
* Cycles 2, 3, 4 & 5
* Cycle 6
* Cycle 8
********************************************************************************
*****
* Tokens for Code Wizard:
********************************************************************************
*****
* %DECLARE=#BOREBOSSZDEPTH
* %DECLARE=#WEBPOCKETZDEPTH
*
Cycles the Token is output for.
Below are the Renishaw Inspection Plus definitions of these inputs.
* #FEEDX
1
X = The target p
ositions for the probe positioning move.
* #FEEDY
1
Y = The
target positions for the probe positioning move.

* #FEEDZ
1
Z = The
target positions for the probe positioning move.
* #TRX
6 | | |
X = The surface
position or size.
*
8 | |
X = Nomi
nal size of feature when measured in the X-axis.
*
10 11
X = c.
* #TRY
6 | | |
Y = The surface
position or size.
*
8 | |
Y = Nomi
nal size of feature when measured in the Y-axis.
*
10 11
Y = Nomi
nal corner position Y-axis.
* #TRY
6
Z = The surface
position or size.
* #FEEDRATE
1 * * * * * * * * * * * *
F = The modal fe
edrate for all protected positioning moves. The feedrate will be modal to this m
acro and subsequent feedrate calls are unnecessary unless a change of feedrate i
s required. The maximum safe fast feedrate established during installation shoul
d not be exceeded.
*
(Note: Cycle 1 is called before and after all the other cycles to perform linkin
g moves)
*
* Feedrate passed to all cycles for TNC support
* #AngleA
2 3
A = The
first angle for vector measurement, measured from the X+ axis direction.
* #ANGLE
7 |
A = Direction of
probe measurement measured from the X+ axis direction.
*
9
A = Angle of the surface to be measured from the X+ axis direction.
* #AngleB
2 3
B = The
second angle for vector measurement, measured from the X+ axis direction.
* #AngleC
2 3
C = The
third angle for vector measurement, measured from the X+ axis direction.
* #DIAMETER
2 3 4 5
D = Nominal size
of the feature.
* #DISTANCE
7 |
D = Nominal dist
ance to the surface (radial).
*
9
D = Nomi
nal size of the feature.
* #?????X
12
X = The X-axis d
istance between Z1 and Z2 measurement positions.
* #?????Y
13 Y = The Y axis d
istance between Z1 and Z2 measurement positions.
* #BOREBOSSZDEPTH
2 3 4 5
Z = The absolute Z-axis
position when measuring a boss feature. If this is omitted a bore cycle is assum
ed.
* #WEBPOCKETZDEPTH
8 9
Z = The absolute Z axis
position when measuring a web feature. If this is omitted a pocket cycle is assu
med.
* #4THAXISZDEPTH
12 13 Z = The Z-axis expected
surface position.
* #RADCLEAR
2 3 4 5
8 9
R = This is an incremental dimen
sion that is used in external features, e.g. bosses and webs, to give a radial c
learance from the nominal target surface prior to a Z-axis move. Default = 5 mm
(0.200 in).
*
2 3 4 5
| |
-R= This is similar to R
r, except that the clearance is applied in the opposite direction to force an in
ternal boss cycle. Default = 5 mm (0.200 in).

8 9
-R= This
is similar to Rr, except that the clearance is applied in the opposite directio
n to force an internal web cycle. Default = 5 mm (0.200 in).
* #SecondX
10 11
I = Incremental
distance to the second probe position along the X-axis (positive value is assume
d). Default = no move.
* #SecondY
10 11
J = Incremental
distance to the second probe position along the Y-axis (positive value is assume
d). Default = no move.
* #DATUM
2 3 4 5 6 7 8 9 10 11 12 13 S = The work off
set number which will be set.
*
The work offset number will be updated.
*
S1 to S6 (G54 to G59)
*
S0 (external work offset).
*
S101 to S148 (G54.1 P1 to G54.1 P48) additional offsets option.
*
New work offset = active work offset + error.
*
New external offset = external offset + error.
* #OVERTRAVEL
2 3 4 5 6 7 8 9 10 11 | |
Q = The probe overtravel
distance for use when the default values are unsuitable. The probe will then tr
avel beyond the expected position when it searches for a surface. Default = 4 mm
(0.16 in) in the Z-axis, and 10 mm (0.394 in) in the X and Y axes.
*
12 13
Q = The probe overtravel
distance for use when the default values are unsuitable. The probe then travels
beyond the expected position when it searches for a surface. Default = 10 mm (0
.4 in).
* #TOLERANCE
2 3 4 5 6 7 8 9
H = Tolerance value of a
feature dimension being measured.
*
Example: For dimension 50.0 mm +0.4 mm 0 mm, the nominal
*
tolerance is 50.2 mm with H.2.
*
(For dimension 1.968 in +0.016 in 0 in, the nominal tolerance is 1.976 in
*
with H.008.)
*
(Guy Brown's Description: Size Tolerance
Alarm if incorrect size)
* #POSITIONTOLERANCE 2 3 4 5 6 7 8 9 10 11
M = True position tolera
nce of a feature. A cylindrical zone about the theoretical position.
* #UPPERTOLERANCE
2 3 4 5 6 7 8 9 10 11
U = Upper tolerance limi
t. If this value is exceeded there is no work offset updated and the cycle is st
opped with an alarm. This tolerance is applied to both size and position where a
pplicable. Example: U2. to set the upper tolerance limit to 2 mm.
* #ANGULARTOLERANCE
10 11 | |
B = Angle tolerance. Thi
s applies to both X and Y surfaces. It is equal to half the total tolerance, e.g
. 0.25 degrees = B.25 tolerance.
*
12 13 B = Set
a tolerance on the angular position of the feature. It is equal to half the tota
l tolerances, e.g. component dimension 45 degrees (0.25 degrees) the 4th axis wou
ld be positioned to 45 degrees and B.25 tolerance.
* TODO - for Marpos / m&h
* PROBETYPE
* OBSTRUCTION
* CORNER QUADRANT
(top left, top right, bottom left, bottom right)

* Macro allocation
* 301 Probe_Surface
* 302 Probe_Bore/Boss
* 303 Probe_Feed
* 304 Probe_Web/Pocket
* 305 Probe_Corner
* 306 Probe_4th_Axis
********************************************************************************
*****
* <Check [LAST=0] [#FEEDX=0][#FEEDY=1][#FEEDZ=2]>
*TODO check outut is minimal (i.e. variables only output if changed) See %OUTPUT
-IF-CHANGED
*<* End of Array>
********************************************************************************
*****
* Move to start position for measuring moves
********************************************************************************
*****
********************************************************************************
*****
* Move to clearance plane after measuring moves
********************************************************************************
*****
********************************************************************************
*****
* Dialog: Probe Bore/Boss
********************************************************************************
*****
*NB FEEDRATE Unused with Fanuc, included for possible TNC support
* See also token mappings for each cycle
************************************
*%CALL=ARRAY-DUMP
*%CALL=VAR-DUMP
*Bore without obsticle starts at ZDEPTH (fanuc)
*Bore without obsticle doesn't need ZDEPTH in gauging NC Code (fanuc)
********************************************************************************
*****
* Dialog: Probe Surface
********************************************************************************
*****
*NB FEEDRATE Unused with Fanuc, included for possible TNC support
*%CALL=ARRAY-DUMP
********************************************************************************
*****
* Dialog: Probe Web/Pocket
********************************************************************************
*****
*NB FEEDRATE Unused with Fanuc, included for possible TNC support
* See also token mappings for each cycle
************************************
*%CALL=ARRAY-DUMP
*%CALL=VAR-DUMP
********************************************************************************
*****
* Dialog: Probe Internal/External Corner
********************************************************************************
*****
********************************************************************************
*****
* Dialog: Probe 4th Axis

********************************************************************************
*****
********************************************************************************
*****
* Support procedures - mode control
********************************************************************************
*****
* Called only from token PROBE_MODE (Tool Change)
* Called from token PROBE_ON & PT_PROBE_MODE
* Called from token PROBE_OFF & PT_PROBE_MODE
********************************************************************************
*****
*
prototype probing code constructors
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 1: Probe Feed
********************************************************************************
*****
*
********************************************************************************
*****
* CYCLE 2: |_| - Three Point Bore
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 3: || - Three Point Boss
********************************************************************************
*****
************************************
********************************************************************************
*****
* CYCLE 4: |_| - Four Point Bore
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 5: || - Four Point Boss
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 6: Single Surface
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 7: Angled Single Surface
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 8: Web/Pocket
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 9: Angled Web/Pocket

********************************************************************************
*****
********************************************************************************
*****
* CYCLE 10: Internal Corner
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 11: External Corner
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 12: 4th Axis X
********************************************************************************
*****
********************************************************************************
*****
* CYCLE 13: 4th Axis Y
********************************************************************************
*****
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: Whiteboard.cgi
*
Author:
RHA
* Date:
09 December 2005
*
* New file for all adaptive template
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 14/02/05 RHA DEV00016309 Fix long lines for codecon.txt
* Version 12.5
* 19/02/08 RHA DEV00022469 Add note prohibiting duplicate macros and procedures
* Version 2009.2
* 26/01/09 RHA DEV00025914 Add attribute_extension to macros and whiteboard
* 27/01/09 RHA DEV00025914 Put new procedure in new code constructor - allows CG
D compilation
* 17/02/09 RHA DEV00025914 Prevent user deletion of new procedure
**************************************************************************
*
*****************************************
*
*
Tab Name
:
Hackers Corner *
*
*****************************************
*
* Procedure for additional attribute function in connection with PDI customisati
on
* Terminate the procedure defining the code_constructor
* Dummy procedure for customised function
* Example declaration
* Dummy procedure for customised function
* %ENDM for the last procedure is contained within the code_constructor
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-iso-macros.cgi
*
Author:
RHA
* Date:
11 November 2005

*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 06/02/06 RHA DEV00007742 Single helix option for Thread Mill
* 28/02/06 RHA DEV00016465 Remove macro 101 - old spindle control
* 03/03/06 RHA DEV00016525 Correct longhand drill output
* 07/03/06 RHA DEV00015555 High Speed mode tolerance
* 08/03/06 RHA DEV00016567 Use system var for work datum name override
* Version 11.0
* 18/07/06 RHA DEV00017692 Tidy Code Generator options in hole macros
* 01/08/06 RHA DEV00017489 #Macro not set for hole cycles
* 07/08/06 RHA DEV00012241 Add High speed and coolant controls to Tool Change*
* 08/08/06 RHA DEV00017341 Correct Tool Length Offset setting
* Version 11.5
* 18/07/06 RHA DEV00012692 Correct drill sub output for 1 location
* 26/10/06 RHA DEV00018471 HPCC improvements
* 13/12/06 RHA DEV00018738 Correction for profile start
* Version 11.75
* 03/04/07 RHA DEV00017611 Implement 21 flag in rotary rotate
* 18/05/07 RHA DEV00017611 Change withdrawn, pending other fixes
* Version 12.00
* 03/04/07 RHA DEV00020278 Allow Macro15 access to USERVAR2
* Version 12.25
* 03/12/07 RHA DEV00021534 Enable longhand tapping
* Version 12.50
* 04/02/08 RHA DEV00006310 Allow canned cycles in Rotary Rotate
* Version 2009.1
* 07/07/08 RHA DEV00023548 Implement NC Code Suppression
* 06/08/08 RHA DEV00024310 Back bore and face in milling
* 11/08/08 RHA DEV00024364 Implement helical hole cycles
* 26/08/08 GST DEV00022751 Thread mill depth in canned cycle
* 16/09/08 RHA DEV00024818 Back Bore and Helical parameters - level retract etc.
* Version 2009.2
* 07/11/08 RHA DEV00025098 Make tool angle available in setup & core tool change
* 26/01/09 RHA DEV00025914 Add attribute_extension to macros and whiteboard
* 02/04/09 RHA DEV00023944 Fix unwanted angles from rotary rotate (head/table)
* 14/07/09 RHA WI34873 New Thread Mill - Add new macro and processing
* 17/07/09 RHA WI34873 New Thread Mill - Use Hole cycle point processing
* 18/04/09 RHA W34873 Initialise CRC controls in Macro 675
* Version 2010.1 SP1
* 13/10/09 RHA W32420 Correct setting of stationary angle in rotary rotate
**************************************************************************
* Force #TOOLCHANGE=#FALSE to prevent SPEEDS lookahead
* Suppress CRC calls until Subfunct is set
* <HOLEDIAM [HOLEDIAM=0] CHAMFERWIDTH [CHAMFERWIDTH=0] CHAMFERANGLE [CHAMFERANGL
E=0] PITCH1 [PITCH1=0] PITCH2 [PITCH2=0] BOTTOMFINISH [BOTTOMFINISH=0] MACHDIR [
MACHDIR=0]>
* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning
* #ROTVALS=#FALSE
*
Only applies to Subprogram style NOT inline bloc
k number reference.
*Set HOLD values
* SF201 Reverse spindle in longhand tapping
*************************************************************
*
Miscellaneous "User Defined" Macros : Reserved
*
*
==============================================
*

*
*
*************************************************************
*
101
Spindle
Stop/ CLW/ CCLW/ CLW+Coo
lant/ CCLW+Coolant
*
102
Reserved (Used by software?)
*
103
Stop Type
Program/ Optional
*
104
Coolant
Flood/ Mist/ Off
*
105
Block Skip
Off/ On
*
106
Exact Stop/Smooth
Off/On
*
107
Reserved (Used by software?)
*
108
Comment
Text string input
*
109
Insert NC Code
NC code literal input
*
110
High Speed M/C
Off/On
*
111
Reserved
*
112
Reserved
*
113
Reserved
*
114
Reserved
*
115
Reserved
*
116
Length Offset
Tool Length Offset
*
117
Reserved
*
118
Reserved
*
119
Reserved
*
120
Reserved
*
121
Reserved
*
122
Reserved
*
123
Reserved
*
124
NC Code Output Suspension On/Off
* This macro allows the user to suspend NC code via a misc function
* Note that it relies on MASK being reset by Code Generator for each macro call
* In each macro - %IF #NCSUPPRESS=1 %THEN MASK=1
* Suspend NC Code Output
* Suppress CRC calls until Subfunct is set
* Canned cycle requested
* %CALL=PT_THRD_CANNED675
*****************************
*
Rotary Milling Macros *
*****************************
* #ROTVALS=#TRUE
*
Processes Radial Arcs
*
Processes Radial Arcs
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-procedures-basic.cgi
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 16/12/05 RHA DEV00014907 TLO setting
* 16/12/05 RHA DEV00015647 Add R in XY Only Option
* 02/02/06 RHA DEV00012705 Set radius for thread milling
* 06/02/06 RHA DEV00007742 Single helix option for Thread Mill
* 06/02/06 RHA DEV00015578 Thread mill - G40 if G01 followed by G00
* 10/02/06 RHA DEV00016236 Spindle control fixes

* 10/02/06 RHA DEV00016273


* 10/02/06 RHA DEV00016282
* 15/02/06 RHA DEV00016297
* 20/02/06 RHA DEV00016344
* 27/02/06 RHA DEV00016236
* 27/02/06 RHA DEV00016320
* 27/02/06 RHA DEV00016464
* 28/02/06 RHA DEV00016465
* 28/02/06 RHA DEV00016369
* 01/03/06 RHA DEV00016464
* 03/03/06 RHA DEV00016525
* 08/03/06 RHA DEV00016567
* 14/03/06 RHA DEV00016367
* 14/03/06 RHA DEV00016464
* 16/03/06 RHA DEV00016662
* 21/03/06 RHA DEV00007321
* 21/03/06 RHA DEV00012705
* 22/03/06 RHA DEV00016714
* 24/03/06 RHA DEV00016742
XISTYPE1
* 28/03/06 RHA DEV00016749
* Version 10.75
* 16/05/06 RHA DEV00017213
* 18/05/06 RHA DEV00017213
* 23/05/06 RHA DEV00017233
* 24/05/06 RHA DEV00017039
* 06/06/06 RHA DEV00017232
* 13/06/06 RHA DEV00017523
* Version 11.0
* 12/07/06 RHA DEV00017700
* 25/07/06 RHA DEV00016799
* 26/07/06 RHA
* 28/07/06 RHA DEV00017797
* 01/08/06 RHA DEV00017818
* 01/08/06 RHA DEV00016703
* 01/08/06 RHA DEV00017490
* 04/08/06 RHA DEV00017771
deg helix count
* 07/08/06 RHA DEV00012241
* 09/08/06 RHA DEV00017902
* 11/08/06 RHA DEV00012241
sed axes
* 13/09/06 RHA DEV00018171
hift
* Version 11.5
* 25/09/06 RHA DEV00017909
* 12/10/06 RHA DEV00012692
* 13/10/06 RHA DEV00018390
* 17/10/06 RHA DEV00018409
* 03/11/06 RHA DEV00018471
* 24/11/06 RHA DEV00017338
* 05/12/06 RHA DEV00018738
* 08/12/06 RHA DEV00018738
* 19/12/06 RHA DEV00018593
* 21/12/06 RHA DEV00018869
* 02/01/07 RHA DEV00017909
* 25/01/07 RHA DEV00019078
* 15/02/07 RHA DEV00017338
* Version 11.75
* 19/03/07 RHA DEV00019554

Fix G2/3 swap for G18/19


Thread mill move correction
Incremental datum shift
Implement IJK vector for 5 axis cycle
Spindle control fixes
Rapid after toolchange with thread mill canned cycle
Force spindle code out if stop
Correct 2D arc output in thread mill
Fix Convert rapid to feed
Add warning for feed moves at Spindle Stop
Correct longhand drill output
Use system var for work datum name override
Correct spindle control
Correction
Suppress unwanted CRC warning
Correct Datum setting - limits
Correct radius in helix output for thread mill
Remove diagnostic output line for #DATUMMAX
Correct index codecon calls for 4 axis, #AXISTYPE2=#A
Correct subroutines processing for hole cycles
Correct index handling for no rotation cases
Fine tune
Correction for always use radius
Fix spindle directions in tapping
5 Axis check in Nomotion as well at PT_Rotary_Axes
Prevent output of longhand tapping cycles
Set #SPEED=NEXTSPEED if SPEED unset
Initialise tool position at toolchange and index
Correct NEXTZMOVE setting for reversed axes
New MM and MT line switches
Hole cycle clearance and level options
Only process speed and gears if there is a change
Make spindle start warning optional
Number of turns token for ISO, trap and fix exact 360
Add High speed and coolant controls to Tool Change
Correct thread mill helix for TNC
Remove diagnostic line, Correct thread mill for rever
Correct initialisation of tool position after datum s
Expand trace options
Correct drill sub output for 1 location
PT_CONVERT_COORDS
Fix Duplicate angle reversal by Rapid to ToolChange
ToolChange HPCC call should only be via a token
Move CPLNAME to a template variable
Fix CRC calls to cancel on arc
Correct calls in circle and intialise variables
Set #PLANEGCODE in Thread Milling
Remove diagnostic code
Remove old thread mill array dump
Correct datum over ride setting
Correction to CPL name in Rapid after TC
Correct precision of XCP YCPL ZCPL in use

* 13/04/07 RHA DEV00019730 Correct wrapped drill cycle approach move


* 30/04/07 RHA
Post processing speed up
* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange
* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls
* 29/05/07 RHA DEV00019987 Reverse coordinate after array axis swap
* 30/05/07 RHA DEV00019987 Limit fix to 5 axis rotary
* 01/06/07 RHA DEV00019987 Leave array axis swap but remove sign reversal.
* 01/06/07 RHA DEV00020208 Fix Index after TC (Head Head)
* Version 12.00
* 23/07/07 RHA DEV00020524 Avoid spurious CRC warnings
* 24/07/07 RHA DEV00020524 Comp Fix, Plan B. Set $COMPOUT only when state change
d
* 03/08/07 RHA DEV00020524 Fix comp problem in CIRCLE procedure
* 10/08/07 RHA DEV00020285 Add new ISO Datum Shift Tokens
* 28/08/07 RHA DEV00020760 DEV00020742 DEV00019720 Fix approach coordinates
* 29/08/07 RHA DEV00020760 DEV00020742 DEV00019720 Fix axis reversals in toolcha
nge
* 27/09/07 RHA DEV00021172 Correct datum output when index not maintained
* Version 12.25
* 18/10/07 RHA DEV00021382 Correct use of #TMP, Use #COMPTEMP
* 07/11/07 RHA DEV00019365 Additional debug output for holes and thread mill
* 03/12/07 RHA DEV00021534 Enable longhand tapping
* 17/12/07 RHA DEV00021869 Correct Rapid after TC for longhand hole cycles
* Version 12.5
* 21/12/07 RHA DEV00021292 ASIN fails on taper thread
* 24/12/07 RHA DEV00021372 Trap hole cycle level change
* 17/01/08 RHA DEV00022021 Incremental option for Z Clear
* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings
* 18/02/08 RHA DEV00022063 Fix single helix and tidy call structure
* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL
* Version 2009.1
* 07/04/08 RHA DEV00013774 Correct arc centres and streamline arc calculations
* 14/04/08 RHA DEV00023113 Feed after ToolChange code constructor added
* 14/04/08 RHA DEV00018979 Correct BNUM reset
* 22/04/08 RHA DEV00022820 Correct angle at toolchange logic PMACRO-15
* 22/04/08 RHA DEV00022820 Set hold values to #FUNNY in PMACRO-15
* 01/05/08 RHA DEV00023246 Adjust rotary initialisation according to machine typ
e
* 07/05/08 RHA DEV00023285 Set angle output vars at toolchange
* 08/05/08 RHA DEV00020490 Add new hole depth option. Incremental from Retract
* 22/07/08 RHA DEV00024069 Correction to spindle reverse with coolant
* 06/08/08 RHA DEV00024310 Back bore and face in milling
* 11/08/08 RHA DEV00024364 Implement helical hole cycles
* 20/08/08 RHA DEV00024474 Add Feed Type setting to toolchange
* 26/08/08 GST DEV00023989 Helical approach number of turns corrected
* 26/08/08 GST DEV00023205 Correct TLO application if NOMOTION
* 28/08/08 GST DEV00024586 Apply TLO correction to XY arcs
* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction
* 08/09/08 RHA DEV00024603 Correct angle setting for Rapid after ToolChange e=pt
_output_rapid
* 11/09/08 RHA DEV00024584 ASIN error on helical profile
* 18/09/08 RHA DEV00024886 Call feed type code constructor from toolchange
* Version 2009.2
* 24/10/08 RHA DEV00025195 Plunge to cycle clearance if needed
* 24/10/08 RHA DEV00025000 Allow Rapid after tool change with null move
* 29/10/08 RHA DEV00025195 Suppress call if already at clearance
* 31/10/08 RHA DEV00025264 Do not reset centre if adjustment fails
* 05/11/08 RHA DEV00025093 Correct spindle with coolant in tapping cycle
* 16/02/09 RHA DEV00026148 Correct first hole location in rotary mode
* 17/02/09 RHA
Correct 3 Axis compilation

* 06/03/09 RHA DEV00026198 Use Job data instead of ASK questions


* 09/03/09 RHA DEV00026198 Fix PROGDESCR with PARTNAME default
* 09/03/09 RHA DEV00026183 Fix radius value in adjust arc centre procedure
* 10/03/09 RHA DEV00026183 Remove rounding of comparitive radius
* 13/03/09 RHA DEV00025238 #TMPCLEAR is wrongly handled in PT_ZCLEAR (Threadmill
)
* 13/03/09 RHA DEV00026452 Changes for 3D Z with TLO application
* 18/03/09 RHA DEV00026539 3D approach for hole cycles
* 19/03/09 RHA DEV00026198 Correct PROGID default
* 20/03/09 RHA DEV00026198 Change ASK default behaviour, Programmer & Version
* 02/04/09 RHA DEV00026928 Correct subroutine processing for hole cycles
* 03/04/09 RHA DEV00026928 Correction to subcall logic, for non-hole calls
* Version 2010.1
* 27/05/09 RHA DEV00022849 Lookahead for Rapid move speed set
* 11/06/09 RHA WI33874 Fix Lookahead, use SPEED if NEXTSPEED=#FUNNY
* 15/06/09 RHA WI33580 Move M89/99 setting to TNC.cgi and fix
* 16/06/09 RHA WI32294 Siemens - allow 0 datum increment
* 08/07/09 RHA WI34873 New Thread Mill - Restructure existing canned cycle
* 09/07/09 RHA WI34873 New Thread Mill - Add new code options
* 14/07/09 RHA WI34873 New Thread Mill - Add new macro and processing
* 16/07/09 RHA WI34873 Remove temporary diagnostics
* 17/07/09 RHA WI34873 New Thread Mill - Use Hole cycle point processing
* 22/07/09 RHA WI34814 Correct Z lift when emulating multi-level cycles pt_hole_
cycles
* 23/07/09 RHA WI35048 Z lift - adjust for last hole and for subroutines
* 23/07/09 RHA WI34873 New Thread Mill More variables and cycle parameters
* 27/07/09 RHA WI31681 Axis Reversals
* 29/07/09 RHA WI34873 Add signed absolute option for depth
* 05/08/09 RHA WI34754 Make call to Feed Type code constructor optional in toolc
hange
* 07/08/09 RHA WI24873 Fix thread depth sign options
* 10/08/09 RHA WI31681 Siemens thread mill, remove diagnostic
* 10/08/09 RHA WI31163 Output angles for rotary rotate, Fix nomotion check
* 12/08/09 RHA WI34580 Fix subroutines when #CYCLEPOINTS=3
* 13/08/09 RHA WI34873 Adjust for changed system variables
* 18/08/09 RHA W35155 Adjust arc feeds only if not adjusted by cycle (Thread Mil
l)
* 19/08/09 RHA W35537 Add Lead and Starts tokens for thread mill
* 20/08/09 RHA W35048 Warn if multi-level holes use subroutines
* 20/08/09 RHA W35450 Add tokens for coordinate rotation to sub call
* 27/08/09 RHA W34873 Move #THREADLEAD calculation up in CANNED675
* 28/08/09 RHA W34873 Fix to above change. Reset #THREADLEAD with sign
* 07/09/09 RHA W35780 Multi depth cycle should be detected using ZLEVEL variable
* 14/09/09 RHA W35898 Correct angle setting for planar rotate - PMACRO-33
* 15/09/09 RHA W35307 Set values for tool angle (angled head) tokens etc
* 17/09/09 RHA W35307 System variables renamed HEADANGLE MOUNTANGLE
* 23/09/09 RHA W35563 Thread mill bottom to top formatting & suppress points cal
l
* 24/09/09 RHA W36102 MCALL cycle definitions for Macro37 thread milling
* 24/09/09 RHA W35563 Force canned cycle every time for thread mill
* 01/10/09 RHA W35498 Use LEADFEED for thread mill approach (675 canned cycle)
* Version 2010.1 SP1
* 13/10/09 RHA W35934 Suppress spindle stop warning at Toolchange
* 23/10/09 RHA W36513 Ask only one time for same variable when not set
* 30/10/09 RHA W35934 Detect spindle stop in sequence
**************************************************************************
*
*******************
*
Initialisation procedures
*
********************
* ASK variables

*
Initialisation system and user defined variables
* Axis Reversal Multipliers
* Automatic Datum Setting
*
*
Retrieve from MM & MT lines
* Coolant code output
* 1 rotary axis, set second type as first
*
Multi-plane
(3axis + Index)
*
Rotary milling (4axis)
* 5 axis IJK machining
*
Rotary Axes offset e.g. zero programmed as 90 degrees
* Subroutine numbering
* Block numbers
*PRECISION=#INCR-(#INCR/100)
* Head operation mode variables
********************************************************************************
************
* Select abs/inc at post run time
* Note #incrxyz is current abs/inc setting
*
#incrxyzhold is main program setting
*
#incrsubs is subroutine setting
********************************************************************************
************
* Called by all START macros to set initial position etc.
* Current CPL output values
* %CALL=PT_SET_PRECISION might need functionality here
* Machine Datum output values
* %CALL=PT_SET_PRECISION might need functionality here
* Reset HOLD with reversals if not incremental
* Set CPL offset for moves to Home and TC
********************************************************************************
************
* Canned cycle capability checks, Longhand if canned cycle not available
*Drill
* Check tool orientation conditions
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle t
o prevent duplicate moves
* Entry feed set - longhand output only
********************************************************************************
************
*
*******************
*
Macro support procedures
*
********************
*
* <DRILL-CYCLE Peck [DEPTH=0] Dwell [DWELL=0]>
* %IF #EXPANDG82=1 %THEN %NOCYCLE
* Counter bore cycle
* Peck Cycle
* Drill Cycle
**************************************************************************
**************************************************************************
**************************************************************************
**************************************************************************
* Back Face
**************************************************************************
**************************************************************************
*
* Check and reset direction
* Right hand threads
* Left hand threads

*
**************************************************************************
* Set CRC output control for profile lead in/out
**************************************************************************
* %IF #G55<>0 %THEN $WARNING="Warning - Workshift in Toolchange not valid with
Datum Shift - Option ignored":%CALL=CODECON_WARNING:%GOTO @NOTOOL_WORKSHIFT
*
* AutoCoolant
* ToolChange Coolant control
* 1 - No Change
* Spindle controls
* Through tool coolant
* Feedtype
* Position not move, therefore never incremental
* Set to Initial CPL - head rotation only
* Check correct position
* No Rapid_to_ToolChange call
* Check Z position only, allow for axis reversal
* Reset Orientation - Maintain Index
* Head rotations assumed 0 for toolchnage
* Table rotations unchanged
* Allow for ToolChange at 0 angles, head axes only
* Head-head machine
* Tool at angles 0 for toolchange
* Output initial position after TC and Index only
**************************************************************************
*
Cutter compensation will
*
1.
Only be active during feedrate moves - not rapid
*
2.
Will not be active during a Z move. (NOTE! G17=> Z/G18 => Y/G19
=> X - but edgeCAM doesn't allow tool normal to these planes)
*
Only Feed Code Constructor has Cutter comp Tokens available.
*
*
NOTE! All output is processed is produced from a cut move : feed, clw, c
clw
*
*
Subfunct 1=off, 2=left, 3=right
* #WarnCRC = 1 CRC Warn if Used
* #WARNCRC90 = 1 CRC warn if not 90
* #CRCONZ2 =1 Warn if applied with Z move
* #CRCONZ1 =1 Warn if removed with Z move
*
*
Register number - If Uservar67 set then use else determine depen
dant on #AUTOREG
*
*
*
If mirror is active then need to reverse cutter comp
*
*
Hold original settings
**************************************************************************
* <*Move [XMOVE=0] [YMOVE=1] [Zmove=2] >
* <*Inc [XINC=0] [YINC=1] [ZINC=2] >
* <*Sub [XSUB=0] [YSUB=1] [ZSUB=2] >
* <*Hold [#XHOLD=0] [#YHOLD=1] [#ZHOLD=2] >
* First pass only - Initialise start point
* First pass through translate is second call of subroutine.
*
*
Rapid to position of next move
* Incremental Subroutines
* Absolute approach
* prevent output of null effect G92 block

*
Apply translation - G92 will reset registers
*
Call Subroutine
**************************************************************************
**************************************************************************
**************************************************************************
************ Diagnostic printout
************
* Full canned cycle USERVAR8=1. #THREADCANNED=2
* Canned cycle preparation
* Canned cycle output
* True canned cycle only
**************************************************************************
* Check tool orientation conditions
*If no comp requested ensure output flag is true
* Check for helical interpolation
* %IF PATHTRACE=1 %THEN %NOCYCLE
*Check for array data.
* #TMP=XPOINT(#LOOP):#TMP1=YPOINT(#LOOP):#TMP2=RADIUS(#LOOP)
* <Loop [#LOOP=0] . [#TMP=0] [#TMP1=1] [#TMP2=2] >
*look for lift out on NEXT move
* <* Loop [#LOOP=0] Next [#NEXTLOOP=0]>
* <Lift Next From [#TMP1=2] To [#TMP2=2]>
* Look for last leg and cancel compensation
**************************************************************************
* Through Tool Coolant
* Adjust tool/home position to current CPL if required
**************************************************************************
* Through Tool Coolant
* Adjust tool/home position to current CPL if required
**************************************************************************
* <*Move [XMOVE=0] [YMOVE=1] [Zmove=2] >
* <*Inc [XINC=0] [YINC=1] [ZINC=2] >
* <*Sub [XSUB=0] [YSUB=1] [ZSUB=2] >
* <*Hold [#XHOLD=0] [#YHOLD=1] [#ZHOLD=2] >
*
Translate Reset
* Reset is only needed if absolute subroutines have been used with G92 datum set
ting
* Update stored end point (XINC etc in Reset are TOTAL increments for this level
)
*<*HOLD2 [#XHOLD=0] [#YHOLD=1] [#ZHOLD=2] >
* Final G92 position.
* Update Keep values
**************************************************************************
* Find Gear
* Spindle control
* Reset old values if stopped
**************************************************************************
*
*******************
*
Debug Trace Procedures
*
*******************
* Called from token TOOLTYPE
*
*******************
*
Program Runtime Questi
ons
*
*******************
*
* Handle User Input, Token PROGVERSION
* #QUESTION Options - Always Ask (1), Ask if Not Set (2), Never Ask (3)
*
**********************************
* Handle User Input, Token PROGRAMMER

*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*

#QUESTION Options - Always Ask (1), Ask if Not Set (2), Never Ask (3)
**********************************
Handle User Input, Token PROGDESCR
Options - Always Ask, Ask if Not Set, Never Ask
**********************************
Handle User Input, Token PROGID
Options - Always Ask, Ask if Not Set, Never Ask
*****************************************
*
Test Profile Lead conditions
*
*****************************************
Check for arc move
Thread Milling
#WarnCRC = 0 No warnings
1 CRC Warn if Used only
2 CRC warn if not 90 only
3 Both above warnings
Warn for CRC application on Z move
Warn for CRC cancellation on Z move
Global output Rapids as high feedrates if #FEEDRAPIDS set to Yes
- use #FEED to force re-instate of cut feed

*
* #FIRSTRAPIDZ=#FIRSTRAPIDZ+#ZTOOLSUB
* if the first move after is in xy only then z should be next z
* Don't use NEXTZ if FEED move follows
*
* Set Rotary directions
* %IF #ROTVALS=0 @SKIP_ROT_SET
*Set CPL Parameters
* Output G43 on first Z
* Z Component in move
*
*
* procedure to set and check spindle speed
* Look ahead at ToolChange or Rapid
*Look ahead
* Only process if speed changed or not running
* Warning Output
* Warn for feed moves only
*
*
* Fix for thread mill lead out
* Comp On
* Comp Off
* Fix for thread mill lead out, Thread mill always sets SUBFUNCT to 1
* Set Rotary directions
* %IF #ROTVALS=0 @SKIP_ROT_SET
* Checks for CRC
*
Output Feed move
* Output G43 on first Z
* Z Component in move
*
Cancel cutter compensation via CodeCon_cancel-cutter-comp
*
Code Constructor must be empty if output is with move otherwise blank bl
ock will be produced
*
* Handles cutter compensation in all situations
* #COMPON signals the state requested by EdgeCAM cycle

* Subfunct signals state for this move


* $COMPOUTPUT signals whether it has been output
*****************************
*
Profile Cycle
*
*****************************
* IF SUBFUNCT=0 @END
*********************************************
*
Handles apply compensation in all cases *
*********************************************
*
Retrieve original compensation Gcode
*
Retrieve current compensation Dcode (register)
*************************************************
*
Handles cancel compensation in all cases
*
*************************************************
*
Set Cancel GCode
*
Output is from motion procedure since is either with or after mo
ve
* Call codecon for machines needing separate G40 block
*
*
Reverse G41/G42 if processing mirror image longhand
*
*
After Mirror, Compensation may be cancelled due to final Rapid. Need to
retrieve last
*
active Comp GCode.
*
reverse G41/G42 is processing mirror image
*
* This procedure is to trap variables which when formatted are output as -0
* Suppress COMPDCODE if no COMPGCODE
* Suppress too small moves in single quad case only
*
Radial Rotary Arcs output via Procedure=Radial_circle
*
Process planar arc
*
*
* Reset CRC Register
* Suppress COMPDCODE if no COMPGCODE
* Suppress too small moves in single quad case only
*
Radial Rotary Arcs output via Procedure=Radial_circle
*
Process planar arc
*
*
* Reset CRC Register
* Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3
Always
* Use rads if XY plane only
* Check CRC lead conditions
* Lead Out
* Lead in
* Adjust Feedrate if required
* Set plane G code
* Set angles in rotary
* Set IJK
* ZEND set for G17 helical arcs. G18/9 not set because of DEV00011313
* <XYPLANE= [XYPLANE=0]>
* Set radius precision
*
* Set radius precision and check arc centre - Bulge check
* Always use radius
* Check for full circle (0 or 360)
* <AA PITCH [PITCH=2]>
* Set Radius Sign

* Check centre accuracy and correct


* XYPLANE is set as 0, 1 and 2 for XY, ZX and ZY respectively
* Check accuracy of centre point
* <* 1/2CHORD = [#CHORD=0] Rad [#RADIUS=0]>
* Force IJK if calculated centre out of position
* <****** RADIUS AXIS CENTRE ERROR [#XCENTREERROR=0] - TRUE CENTRE [#TEMPXCEN
TRE=0] ROUNDED CENTRE [#XROUNDCENTRE=0]>
*<****** RADIUS AXIS CENTRE ERROR [#YCENTREERROR=1] - TRUE CENTRE [#TEMPYCENT
RE=1] ROUNDED CENTRE [#YROUNDCENTRE=1]>
***************************************************************************
*Set up parameters and call standard procedure to
*calculate angle bearings for TNC helical arc moves
* DEV00012570 undo previous change to correct thread mill regression
* Set arc parameter system variables
* Multiple turns, Note that complete circle can have included angle of 0 or 360
* Thread Mill, multiple turn arc has only 0-360 included angle, derive from pitc
h and Z move
* ZSTART ZEND are not available in thread milling
* Check for last helix full 360 degrees
* #TURNS=0
* Round result of division
* #TURNS=#TURNS*100+0.5
* #TURNS=INT(#TURNS)
* #TURNS=#TURNS/100
* %IF #TURNS=#TMP %THEN #TURNS=#TURNS-1
* Still needed for thread milling
*
************* NEED TO USE XINC.YINC IN ASIN_BEARING
*Double check for 360 case
* Full circle
*
*************************************************
*
Compensate feedrates for arcs if option selected
*
*************************************************
*
* #TMP=ABS(RADIUS):%IF #TMP=TOOLRAD @END
*
External Corners
* Following check safer in two lines because of precision checking
*
Internal Corners
*
Output all Hole cycles Drill, Chipbreak, Ream and Bore as Canned Cycles
- coords are held in the XYZPOINT array
* Called from each cycle macro and cyclsub for subroutines
*
Code Wizard will present the cycle definition line which will be in the
loop expand and thus output-if-changed
*
will, typically, produce the XY points list previously separated into PR
OCEDURE=LOOPEXPAND
* If called from CYCLSUB, points are expanded from 2nd point (Loop=2)- cycle l
ine is outside subroutine.
*
This inhibits the ability to support the format whereby the cycle parame
ters are variables e.g. Seimens
*
************ Diagnostic printout
************
* Status Flags in use
* Option flags in use
* #XREVERSE,#YREVERSE,#ZREVERSE Axis reversals
* $OUTPUTSUBS
* #ROTARYTYPE=2 1 for
* MILLMODE 0 for rotary, 1 for planar
* #TOOLCHANGE =1 if previous instruction was toolchange
* #PREPOSITION: 0 never

* Set wrap radius


* Keep move parameters
*
Rapid to first XY position then to Zclear with Tool Length Offset. Call
procedure for single Code Constructor
*
Could put this on a switch e.g. Call Rapid After toolchange ?
**
Necessary for rotary machining.
*************************************************
* Approach Moves
*************************************************
* Lift to clearance
* Approach to first point - Rapid in XY
* Plunge to Clearance
*************************************************
* DEFINE CYCLE
*************************************************
* Branch on $OUTPUTSUBS. =null if PATHTRACE expansion
* Set HOLD values for incremental calculations in subroutines
*Include first position in expansion
*
*
* <******** LOOP START ********* #LOOP=[#LOOP=23] LAST=[LAST=23]
*
*************************************************
* Processing loop for cycle point 2 onwards
*************************************************
*
*<*
Xpoint =[#XMOVE=24]
#Ypoint =[#YMOVE=24]>:%CANCEL=#XMOVE,#YMOVE
*Check for Zdepth/level change and respecify cycle
*
Emulate return to Initial level : G98/G99 not supported
*
Cancel Canned Cycle
*
Rapid to clearance height
*
*
*
* First point or depth change
*
* Normal cycle point output
* <@LOOPEXPAND Last=[LAST=0] DSUB=[DRILLSUB=0] $OUTPUTSUBS=[$OUTPUTSUBS]>
************************************************************
*
G80 Cancel Canned Cycle
*Cycle finishes at ZCLEAR
************************************************************
* #HOLECYCLE2 is now used to suppress sub call approach moves
* Set 0 if not using drill subroutines
* Blank null values - not required
* Incremental variations
* <Hold [STYPE=13]>
* Set absolute baseline positions for XSHIFT etc
*
Remove duplicate tools from NC Code tool list
* Initialise array for datum IDs
* <LOOP[#LOOP=1]>
* Loop to get SYSID from list and store in uarray in order
* <Loop [#LOOP=0]>
* <ID [SYSID=1] Stype= [STYPE=1]>
* <Pointer [#POINTER=1]>
* Unused array element
* <Pointer [#POINTER=1]>
* Option to output first Datum (G54) as XYZHOME location
* Initialise rotary setting at zero
* Reset to first datum position

* Set CPL offset for moves to Home and TC


* Absolute datum selected
* Next line removed to allow modality to interpret initialisation. DEV18171
* %CANCEL=#XMOVE,#YMOVE,#ZMOVE
* Incremental datum offset
* Save CPL ID
* <Loop [#LOOP=0] [#POINTER=1]>
* Datum not found
* $WARNING="ERROR - SYSID for CPL not found in Datum List":%CALL=CODECON_WARNING
* <WDM [WORKDATUMID=0]>
* Speed
*
* Rot1/Rot2 are not set from drill array
*
*
*
*
Calculate vector distance from current to next coordinate
* Use to determine if rapid move should be converted to feedrate move
*
*
XY distance
*
3D distance i.e. incorporate Z axis
*
If move is smaller than the specified amount then convert to a feedrate
at highfeed.
*
#TOOLSHEET
1=Output with Main NC program 2=Output as seperate fil
e
3=None
*******************************************************
* <EdgeCAM End Point [XMOVE=0][YMOVE=1][ZMOVE=2]>
* <#..KEEP End Point [#XKEEP=0][#YKEEP=1][#ZKEEP=2]>
*******************************************************
* Check 5 axis mode here and in PT_Rotary_Axes
* 5 Axis mode off
* 5 Axis mode on
* Set Precision
********************************************
* Check move content
* 5 axis only, assume all angles could be moving
* HOLD vars have unmodified EdgeCAM values
**********************************************
* Make incremental
* Set Move for XYZ
*******************************************************
*<#Move= [#MOVE=0]>
*******************************************************
* Procedure trace is ON. Additional trace options
* #TRTHREAD,#TRHOLE control array dumps in CY procedure
* #TRX,#TRY,#TRZ,#TRC1,#TRC2,#TRB temporary output vars
* Not Drill, ToolChange, Index or Thread Mill
* Output EdgeCAM End Points
* Output Current Mode Settings
*
Determines the method of fixing arc centre
*
NOTE! Thread Milling uses %PROCEDURE=PT_THRD_ARC_CENTRE for simplicity
*
*
Setvar^#ARCTYPE
*
Signed Start to Centre 1
*
Signed Centre to start 2
*
Unsigned Start / Centre 3
*
Centre
4
*
* Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3

Always
* %IF XYPLANE=2 @YY
* %IF XYPLANE=1 @ZZ
* %IF XYPLANE=0 @TYPE
*
*
*********************
*
*
Thread Milling
*
*
*********************
*
*
* Full canned cycle
* <BC [#BEFORECYCLE=0]>
* Preposition after toolchange
* Next Z for first move
* Set canned cycle variables
*
* <Vertical Move>
* %IF #ZMOVE<#ZHOLD %THEN <PLUNGE> %ELSE <LIFT>
* #BEFORECYCLE=0
* <Not PL>
* %IF USERVAR8=1 @NOBLOCK
* <Rapid XY>
* <Feed Move XY>
*
*
* Are all helical blocks required
* Output leads & one main helical block only, Find last main helix block
* ZMOVE = Total Movement, KVALUE = Lead
* Suppress first main helix, uless it is also the last
* Canned Cycles only
* <Not First>
* <Next [#NEXTTYPE=1]>
* Only 1 helix
* #THRDLEAD=#KVALSAVE
* Helix inaccurate for Taper thread
*
* Extract canned cycle parameters
* Cutting upwards
* %IF #THRDENDZ=#FUNNY %THEN #THRDENDZ=#ZHOLD
* Cutting Down
* <INOUT #PLUNGERAD=[#PLUNGERAD=0] #STARTRAD=[#STARTRAD=0]>
*
* Canned cycle output
* #MODALCYCLE=DATA2(48)
* %CANCEL=#MODALCYCLE
* Always output cycle definition, not hole point
* Count arc blocks skipped
*Suppress intermediate helical blocks if instructed. Maintain #ZHOLD
*Set K word to full circle pitch for multi-pass block
* reset helical block count
*
Handle Arc centre for Thread milling - force I&J output
*
Setvar^#ARCTYPE
*
Signed Start to Centre 1
*
Signed Centre to start 2
*
Unsigned Start / Centre 3
*
Centre
4
* Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3
Always

* IJK method of arc output


*
* This procedure is called when an unknown move type is detected and
* the record is skipped.
* #RECORD=XPOINT(#LOOP)
* Sets remaining token variables for old (Macro37) cycle and calls code construc
tor
* Some vars are set with helical processing from thread mill array values
* Number of turns
* Set values direct from macro
* <Field 1 Clearance [FIELD1=2]>
* <Field 2 Retract [FIELD2=2]>
* <Field 3 Diameter [FIELD3=0]>
* <Field 4 Level
[FIELD4=0]>
* <Field 5 D of T
[FIELD5=0]>
* <Field 6 Pitch
[FIELD6=2]>
* <Field 7 Depth
[FIELD7=2]>
* <* Retract [#RTYPE=1]>
* <Retract= [#THRDPLUNGE=2]>
*%IF DIRECTION=1 %THEN #DIRECTION=DATA2(4)
*%IF DIRECTION=2 %THEN #DIRECTION=DATA2(5)
*%IF DIRECTION=3 %THEN #DIRECTION=DATA2(6)
*%IF DIRECTION=4 %THEN #DIRECTION=DATA2(14)
*%IF DIRECTION=5 %THEN #DIRECTION=DATA2(15)
*
* Arc Direction plus Climb or Upcut
* CLW
* <CLW>
* CLW and Downward
* <CLW DOWN>
* CLW and Upward
* <CLW UP [#THRDLEAD=2]>
* <CCLW>
* CCLW and Downward
* <CCLW DOWN>
* CCLW and Upward
* <CCLW UP>
* Reverse climb/conventional for external thread
* <EXTERNAL>
* <[$THRDHAND]>
* <MILLMODE=
[MILLMODE=13] 0=climb 1=conventional>
************ Diagnostic printout
* %IF ZDEPTH=#FUNNY %THEN <* Multi-Depth>
************
* Set token vars
* Feed adjust here
* #MINFEEDADJ Adjust Feedrate Maximum Decrease (%)
* #MAXFEEDADJ Adjust Feedrate Maximum Increase (%)
* Depth
* Number of Turns
* Retract
* Hand of Thread
* Climb or Upcut
* Arc Direction
* Spindle reversed
* Reverse Internal
* Reverse External
* Spindle Forward
* Forward Internal
* Forward External

* Ascending/Descending
* New variable settings, LEFTRIGHT and PITCH2 with +-sign
* Cut from top
* Cut from bottom
* Internal/External
*Axis reversals
* Depth also reversed by setting up/down direction signs
*
*
*******************
*
Block No. Increment
*
*******************
*
*
* Check top limit, reset if exceeded
*
*
*
************************
******
*
Safe Start Block No. Inc
rement
*
************************
******
*
*
Output Block Number same as Tool Number (POSITION)
*
*
************************
********
*
Set Tool
ing data
*
************************
********
*
*
*
*
*************************************
*
Subrouti
ne Start / Header
*
************************
*************
*
* Note #incrxyz is current abs/inc setting
*
#incrxyzhold is main program setting
*
#incrsubs is subroutine setting
*
If Increment Subroutines by ... is not set then start at Progid & increm
ent by one else use the increment.
* Force feedrate if required
*Reset HOLD values for incremental first move
*
If using incremental subroutines only, it is necessary to hardcode a G91
on extra Sequence definition line
* Force GCode on next move
*
*
*
********************************
*
Subrouti
ne Call
*
************************
********
*
*
If Increment Subroutines by ... is not set then start at Progid & increm
ent by one else use the increment.

*Check for hole cyclesub, retrieve stored value


*Output approach move for first call, not translated calls
* Force output if coordinate has changed
* Found to be necessary for some templates, inculding S840
* Inserted move, only for incremental subroutines
*
*
*
********************************
*
Subrouti
ne End
*
************************
********
*
*
If Increment Subroutines by ... is not set then start at Progid & increm
ent by one else use the increment.
*
If using incremental subroutines only, it is necessary to hardcode a G90
on extra Sequence definition line
* Store HOLECYCLE2 flag for this subroutine
*
*
*
Procedure only applicable to Rotary Table configurations.
*
Must be in Procmill.cgi since called from within Set Work Datums
*
*************************************************************
*************************************************************
*
Purpose :
To set number of moves in Lead out sequence
*
*
Called :
when processing a Feed or Arc move which is
*
*
the first move of the Lead out sequence
*
*
Subfunct=2
*
*
*
*************************************************************
**************************************
*
Lead Out permutations
**************************************
*
*
* Check FIELD12 lies in range 1-3
*************************************************************
* Called from Core Toolchange, Manual Toolchange and Index
*************************************************
*
Necessary for Rotary Machining only
*
*************************************************
*
* This procedure is called when EdgeCAM outputs a rotary canned cycle with singl
e linear
* axis moves and rotary axis angles in an array. In the loop, XPOINT is used for
the linear move,
* whether it is X or Y, and YPOINT is always used for the rotary angle.
*
* The procedure sorts out the actual #XMOVE #YMOVE and #ROT values for output fo
r both RADIAL
* and AXIAL orientations.
*
* Note that one linear axis, X or Y, is always set to zero. In AXIAL orientation
the other linear
* move is then calculated as total offset from axis of rotation.
* Axial Orientation

*
Calculate Angle of Point location
*
Set active axis, cater for Caxis configuration.
*Set Y coord on axis
*
Axis reversal etc
* Hold See procedure=hold
* %IF $ACTIVEROTAXIS=$ROT1 %THEN #ROT1HOLD=#ROT %ELSE #ROT2HOLD=#ROT
*<radial>
*
Processes Radial Drilling cycles
*
*
Xpoint = X or Y co-ordinate depending on machine rotary axes.
*
Ypoint = angle around which the drilling occurrs.
*
*
If 4axis m/c then active rotary axis is #ROT1, if 5axis then is #ROT2
*Set Y coord on axis
*
Assign Linear and rotary axes
*
Axis reversal etc
* Hold See procedure=hold
* %IF $ACTIVEROTAXIS=$ROT1 %THEN #ROT1HOLD=YPOINT(#LOOP) %ELSE #ROT2HOLD=YPOINT
(#LOOP):#ROT1HOLD=ROT1
* <Type [$CYCLETYPE]>
*
Call CYCL DEF for each cycle type
* Called by Attribute macro to reverse spindle when longhand tapping
*
* Modified for adaptive templates to have a procedure for first leg
* and a second procedure called by a token for the second leg
*
*
Handles Rapid to Home strategies e.g. Xfirst, Zfirst
*
No automation depending on tool type i.e. User must program Xfirst
*
* Axis Fixed
* FIELD 1 = 1 = X FIXED (remain at current location
)
* FIELD 3 = 1 = Z FIXED (
"
"
"
)
*
* Axis Priority
* FIELD 4 = 0 = None
*
1 = XFIRST
*
2 = YFIRST
*
3 = ZFIRST
* Fixed coords
*
* Angular position is inherited - do not process again
* %CALL=PT_ROTARY_AXES
* Called via token to create second leg of move
*
* Calculates number of pecks/chipbreaks in cycle
* Called from Token
* Nothing specified, use defaults
* Check speed
* Get machine maximum speed from highest gear
* Check speed in range for spindle
* Get details for first gear
* Check speed in range for spindle
*Reset to current gear
* <NUMGEARS [NUMGEARS=0] GEARMINRPM [GEARMINRPM=0]>
*
Warn if Gear Range selected greater than defined in Spindle Tab
* Check speed in range for gear
* GEARMAXRPM,GEARMINRPM limits for this gear on this spindle
* Called by Attribute macro to reverse spindle when longhand tapping
* Called by token to calculate clearance value

* Hole cycles
* Threadmill has different system variables
* Control procendure for centre position checking
* Set temporary variables according to plane of arc
* <G19 Start [#XTEMP1=0][#YTEMP1=1]>
* <End [#XTEMP2=0][#YTEMP2=1]>
* <Centre [#TEMPXCENTRE=0][#TEMPYCENTRE=1] Radius=[#RADIUS=13]>
* <G18 Start [#XTEMP1=0][#YTEMP1=1]>
* <End [#XTEMP2=0][#YTEMP2=1]>
* <Centre [#TEMPXCENTRE=0][#TEMPYCENTRE=1] Radius=[#RADIUS=13]>
* <G17 Start [#XTEMP1=0][#YTEMP1=1]>
* <End [#XTEMP2=0][#YTEMP2=1]>
* <Centre [#TEMPXCENTRE=0][#TEMPYCENTRE=1] Radius=[#RADIUS=13]>
* Reset Output Variables according to plane of arc
*
*
* Shifts centre by +- Precision alternately to improve fit
* Output message if in Con Debug mode
*
** Set centre back to original position **
* Checks distances from start to centre and from end to centre against radius
* <Centre [#TEMPXCENTRE=0][#TEMPYCENTRE=1]>
* <CHECK_CENTRE_START>
* <DIST1= [#DIST=0]>
* <* WARNING - ROUNDED START RAD ERROR =[#RADERROR=5] - RETRY......>
* <* CC [XCENTRE=3] [YCENTRE=4]>
* <* C [XEND=3] [YEND=4]>
*
* <CHECK_CENTRE_END>
* <DIST2= [#DIST=0]>
* <* WARNING - ROUNDED END RAD ERROR =[#RADERROR=5] - RETRY......>
* <* CC2 [XCENTRE=3] [YCENTRE=4]>
* <* C [XEND=3] [YEND=4]>
* Set angle for coordinate rotation, Called from token
**************************************************************************
* Machine independant Code Generator include file
*
* Filename: mill-procedures-rotary
*
Author:
RHA
* Date:
11 November 2005
*
* New file for adaptive milling templates derived from earlier multiplane templa
te
*
**************************************************************************
* Change History
* Version 10.5
*
FIRST ISSUE
* 23/01/06 RHA DEV00016067 Correct angle output modality in PT_ROTARY_AXES
* 08/02/06 RHA DEV00016222 Make 360 to 0 angle reset optional
* 14/02/06 RHA DEV00016310 Axis sign reversal not working***********************
***************************************************
* 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle
* 24/02/06 RHA DEV00016422 4 Axis fails to compile
* 14/03/06 RHA DEV00014577 Correct blanking of angles (sign=direction)
* 22/03/06 RHA DEV00016723 Fix angle processing in line with EdgeCAM signed angl
es
*
New PT_WHICH_WAY procedure
* 24/03/06 RHA DEV00016743 Datum shift output for index in incremental mode.
* 27/03/06 RHA DEV00016723 Set 0-360 for sign=direction when indexing table
* 16/05/06 RHA DEV00017213 Correct index handling for no rotation cases

* 18/05/06 RHA DEV00017213 Fine tune


* Version 11.0
* 11/07/06 RHA DEV00017691 Correct use of angle reversal flags
* 25/07/06 RHA DEV00016799 Initialise tool position at toolchange and index
* 13/09/06 RHA DEV00018171 Correct initialisation of tool position after datum s
hift
* Version 11.5
* 25/09/06 RHA DEV00017909 Expand trace options
* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable
* Version 11.75
* 19/03/07 RHA DEV00019554 Correct precision of XCP YCPL ZCPL in use
* 11/05/07 RHA DEV00019987 Allow for axis assignment for negative rot1 angle
* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange
* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls
* 01/06/07 RHA DEV00020208 Fix Index after TC (Head Head)
* Version 12.00
* 26/07/07 RHA DEV00020560 Make +-180 setting more robust, allow for wind up.
* Version 12.50
* 04/02/08 RHA DEV00006310 Allow canned cycles in Rotary Rotate
* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL
* Version 2009.01
* 22/04/08 RHA DEV00022820 Protect PT_WHICH_WAY from #FUNNY hold values
* 21/07/08 RHA DEV00024066 Correct setting of $LINEARAXIS for AC machines
* 27/08/08 RHA DEV00024207 Fix G43 Z move after Index
* Version 2010.01
* 29/05/09 RHA DEV00026156 Angular direction processing for hole positions
*
DEV00023454 Angular direction processing for Index
* 02/06/09 RHA
Changed PT_WHICH_WAY to use ROTARYAXIS instead of
* Version 2010.01 SP1
* 13/10/09 RHA W36415 Allow TOOLCALL when #MOVE=0 PT_INDEX_HANDLER
*
*****************************
*
Rotary Procedures
*
*****************************
* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning
* #ROTVALS=#FALSE
* %IF $PLANAR=NO %THEN #ROTVALS=#TRUE
* Check for incremental
*Set For incremental in rotary
* Reset incremental
*
*
Purpose :
Process Radial Arc moves
*
*
Called from Macros ANGCLW and ANGCCLW
*
*
If Clockwise process via Clockwise Code Constructor otherwise via the Co
unterClockwise Code Constructor.
*
Purpose :
To determine whether Orientation is Axial or Radial
*
*
Called from Index when Rotation has occurred
*
*
Purpose :
To determine whether X or Y is the Linear axis
*
*
Used when assigning XYPOINT() for Drilling : See %Procedure=Pt_Convert_C
oords *
* Save CPL ID
* Set absolute values
*Set rotation variables
* %IF #MACRO=38 %THEN #ROT2=ROT2+ANGLE
* Set CPL offset for moves to Home and TC

* Initialise tool position


*Check for datum reset only
* Only datum shift, angles unchanged
* No rotation
* Delayed TOOL CALL for TNC
* Rotary moves
*****************************************************************
* Trap null moves with differing direction sign DB10885/11016
******************************************************************
*
* Incremental datum
*Set ROT Hold values
* Output initial position after TC and Index only
*************************************************
*
PT_ROTARY_AXES
*************************************************
*************************************************
* Five axis movement control
* 5 Axis mode off
* 5 Axis mode on
* Set IJK if needed
* IJK instead of angles
*************************************************
*PRIMARY AXIS
* If Sign=direction set 0-360 range for INDEX only
* Apply angular offsets
* Set Increment
* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2
* Reverse direction of 0 -> 360 if required
* Reset Primary within 0-360 again
* Reset primary within range +/-180
* Accommodate -0 by setting zero angle to 0.0000001 and calculating sign
* This will truncate to 0 on output with correct +/- sign
* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2
* Incremental - Check null move
* User reverse if wanted
*************************************************
*
PT_WHICH_WAY
*************************************************
* Protect against #FUNNY
* Set directions of rotation
* Angular Moves - based on angles received
* Indexing
* Shortest, based on end position
* Controlling direction - first rotary
*
Asssign Mcode for direction of rotation
* Sign = direction
* Shortest, based on end position
* Controlling direction - second rotary
*
Asssign Mcode for direction of rotation
* Sign = direction
********************************************************************************
**********
*
PT_WRAP_RADIUS
********************************************************************************
**********
*
Purpose :
Output Wrap Radius for M/cs such as Bostomatic
*
Called from all machining macros when rotary first initialised
* NB Fadal is different, see CODECON_WRAP_HEIGHT
********************************************************************************

**********
*
PT_INDEX_CONTROL
********************************************************************************
**********
*Call Head First
* Now Call Table
*************************************************
*
Head angle settings**
*************************************************
* Procedure to set head angles. To be developed as required
* Procedure to set head angles. To be developed as required
********************************************************************************
**********
*
PT_CUBIC
********************************************************************************
**********
* Set TNC Tool Alignment, called from TOOL CALL code constructor