You are on page 1of 39

*** Start of include file MTOKEN.

CGI ***
*************************************************************************
* Machine independant Code Generator include file *
* *
* Filename: MTOKEN.CGI *
* Author: ADM (Derived from 3AXM-FAN.CGS -r1.41 *
* and 3AXM-HH.CGS -r1.25) *
* Date: 6th December 1996 *
* *
*************************************************************************
* Change History *
* Initial Version - Included fixes for db9831 *
* 03/02/97 ADM - Support incremental & absolute datum shifts (9008) *
* and moved NEXTTOOL logic to the toolchange macro *
* 05/02/97 ADM - implemented token for absolute/incremental coords *
* 21/04/97 ADM - db10098 - remove speed from toolchange macro *
* 26/09/97 ADM - db10378 - LOOPNUMBER now set to #HEADER not #LOOP *
* (used for Heidenhain tool definitions *
* 05/11/97 ADM - db10539 - FIRSTTOOL token should use #FIRSTTOOL *
* variable not POSITION *
* db10541 - should use USERDEFINEDSTRING if tool not *
* loaded from tool library *
* 06/11/97 ADM - db10245 - change PROGDESCR token so that it does not*
* ask a question each time token used *
* 18/11/97 ADM - Allow seperate code constructor for hole cycle *
* points for Fanuc template (db10455 & db9616) *
* 21/11/97 ADM - Axis Reverse option now affects home and toolchange *
* positions (spotted when fixing db10578) *
* 02/03/98 ADM - Implement TNC400 Q parameter hole cycles (db10347) *
* Implement TNC400 rigid tapping (db10329) *
* 09/03/98 ADM - Implement spline output for Fanuc and TNC400 (C1&C2)*
* 23/03/98 ADM - Added RETRACTMCODE token for Okuma template (QA C4) *
* 30/03/98 ADM - Added WARNING token for new warning code constructor*
* 18/05/98 ADM - Prevent 2 line output from rapid to home/toolchange *
* code constructor when using literals (db10858) *
* 17/08/98 ADM - SMOOTHMCODE token now uses #EXACTGCODE (db10822) *
* 22/09/98 RHA - Add call to set_comp_to_string to token *
* Add MAXFEED token for Heidenhain & TNC (DB11008) *
* 28/09/98 RHA - Tokens added for Sinumerik840 Cycles & Polynomials *
* 08/10/98 RHA - Independant HOME tokens for Siemens *
* 22/10/98 RHA - Correction to MAXFEED token for Heidenhain *
* 20/10/98 RHA - Token LASTDEPTH added for Fadal *
* 04/01/98 RHA - Tokens for G28 blocks added (Mori Seiki) *
* ABS-INC - %CANCEL removed from token *
* 07/01/99 RHA - Format table references changed for 840 Spline tokens*
* 14/01/99 RHA - OPNUM & OFFSETID tokens added for Mori Seiki *
* 07/01/00 RHA DB11788 Remove length restriction on tool description *
* 24/01/00 RHA DB11691 Z Reverse for Intial plane & Zclear tokens added *
* 10/02/00 RHA DB11879 Tokens added for Home/Tool Change Position
* Use of existing tokens for move to Home/Tool Change
clarified
* 10/02/00 RHA DB11963 User Tokens Added
* 26/05/00 RHA DB12281 Extend max number of gear ranges to 6 for Siemens 840
* 12/06/00 RHA Modify MAXFEED token to output via #FEED for modality purposes
* 23/10/00 RHA DEV00001648 Speed setting for token moved to PT_SPEED_SET and
corrected
* 07/11/00 RHA DEV00001691 - Increase number of user tokens
* 13/12/00 RHA Semicolon token moved to mtoken.cgi
* 19/12/00 RHA Call SET_TOOL_TYPE from TOOLTYPE token
* 15/01/01 RHA DEV00002142 Place %ASK for tokens PROGVERSION & PROGRAMMER in
procedures
* 25/06/01 RHA DEV00003177 Set #XMOVE etc for Home & Tool Change Position tokens
* 06/09/01 RHA Added tokens for ECS27xx, Define !SMOOTHGCODE
* 26/09/01 RHA DEV00002377 - Siemens840 Cycles, changes and additions
* 25/09/01 RHA DEV00002996 Add tokens for Job Record data.
* 30/10/01 RHA DEV00003699 Change variables in borestandoff-X & Y
* 11/08/03 RHA Various New Tokens SPINDLE OFF, FLUTE
* 13/08/03 RHA DEV00000377 New procedure to set #HCODE
* 26/08/03 RHA DEV00008539 Add warning counter
* 27/08/03 RHA DEV00007609 ToolChange & Home setting Option
* 03/12/03 RHA DEV00009395 Correct TLO with HPCC
* 05/12/03 RHA DEV00007045 Table clamp codes and tokens
* 15/12/03 RHA DEV00009612 Add new date tokens
* Version 950
* 01/12/04 RHA DEV00011681 Additional mill tool tokens
* 10/01/05 RHA DEV00012570 Correct TNC Helix
* Version 10.50
* 11/11/05 RHA DEV00015555 Set value in #HIGHSPEEDTOL
* Version 11.5
* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable
* 04/12/07 RHA DEV00021534 Enable longhand tapping
*************************************************************************
*
* Constants for start of G function in DATA1 & M function in DATA2 statements
*
*
*
*
* *********************************
* Tokens - Use in Code Constructor
* *********************************
*
*
* G-Codes
* M Codes
* General
* Toolchange / Tooling
* Cutter Radius Compensation
* Heidenhain & Anilam Only
* Circular Interpolation
* Hole Cycles
* Added for Sinumerik840 & Fadal cycles
* Heidenhain Only
*
* Datum Shift : Translate / Index
*
* Tooling Sheet / Program Information
* Subroutines
* By block number
* Position : Before, after, in-line with main NC Program
* Datums
* Rotary Axes / Milling
* Spline Output
* Fanuc specific
* Heidenhain specific
*Siemens Spline (Polynomial)
*Siemens Home (For null addresses)
* M-Functions (Used to create default Code Constructor)
* Machine Specific Tokens
* Deckel
*
* G28 blocks Mori Seiki & Fanuc types
* Formatting tokens, ECS27xx (Semi colon without training spaces)
***********************************************************
* Job Record Tokens
***********************************************************
***********************************************************
* User tokens for
***********************************************************
*
*** End of include file B:\Pams\cam\machdef\template\MTOKEN.CGI ***
*** Start of include file MDECLARE.CGI ***
*************************************************************************
* Machine independant Code Generator include file *
* *
* Filename: MDECLARE.CGI *
* Author: ADM (Derived from 3AXM-FAN.CGS -r1.41 *
* and 3AXM-HH.CGS -r1.25) *
* Date: 6th December 1996 *
* *
*************************************************************************
* Change History *
* Initial Version - Included fixes for db9831 *
* 16/12/96 ADM - implemented swapping of CLW/CCLW codes for YZ *
* and XZ planes (db9725) *
* 27/01/97 ADM - use NEXTZMOVE instead of ZMOVE in *
* RAPID_AFTER_TOOLCHANGE (db9822) *
* 03/02/97 ADM - support incremental & absolute datum shift (db9008) *
* 05/02/97 ADM - implemented token for absolute/incremental coords *
* 21/04/97 ADM - db10043 - allow cutter comp on thread milling *
* 26/06/97 ADM - New variable used in calculation of radius sign for *
* rotary radial arcs *
* 11/11/97 ADM - Variable used to determine whether Indexing or *
* Rotary, so that Reverse Axis and Start At settings *
* affect Rotary moves (db10246 and db10358) *
* 13/11/97 ADM - Add option for CRC register as Maxtools + tool *
* count (db9633) *
* 18/11/97 ADM - Allow seperate code constructor for hole cycle *
* points for Fanuc template (db10455 & db9616) *
* 28/11/97 ADM - Warn if no Rapid to Toolchange prior to Toolchange *
* (db10589) *
* 16/12/97 SME - #HOLECYCLE declared *
* 23/02/98 ADM - Add option to allow combined rotary/multiplane *
* angular output to prevent additional moves (db10683)*
* 02/03/98 ADM - Implement TNC400 Q parameter hole cycles (db10347) *
* Implement TNC400 rigid tapping (db10329) *
* 09/03/98 ADM - Implement spline output for Fanuc and TNC400 (C1&C2)*
* 30/03/98 ADM - changes for new Warning code constructor *
* 18/05/98 ADM - Prevent 2 line output from rapid to home/toolchange *
* code constructor when using literals (db10858) *
* 24/09/98 RHA - Spline declarations moved to machine specific files *
* #highspeedtol *
* (To allieviate variables limit problem) *
* 25/09/98 RHA _ $G45,$A0,$G60,$M62 moved to Deckel 3m-mach.dek *
* *
* 14/10/98 RHA - Removed disused variables (MPLM) *
* #ROTDIR #ROTREVERSE #INDEX #ROTINDEX *
* 20/10/98 RHA - #EMULATION flag added for G98/9 emulation in Cycles *
* 10/12/98 RHA - #ROTVALS added - Used to flag index & rot rotate modes*
* 10/05/99 RHA - #HIGHSPEED #RECORD & #TEMP removed to save var names *
* 17/06/99 RHA Removed $MACRO, $DEBUG, #CONDEBUG, #ROTHOLD *
* Added #PROCTRACE, $SPC, $PROCEDURE for procedure trace*
* Unused vars (previously commented out) removed *
* $PROGUNIT, $COMP, moved to m/c file(s) *
* #USER1,#USER2,#USER3,$USER added for CODE command *
* 21/06/99 RHA DB11095 Corrected RESET processing, remove #TRANSFLAG *
* 22/09/99 RHA DB11654 #LIMIT360 declaration added *
* 07/03/00 RHA DB11941 - Remove variable #WARNCRC90, add #CRCONZ *
* 03/11/00 RHA DEV00001690 Add more user variables
* 09/11/00 RHA DEV00001683 Add
#SUPPORTMDEPTH,#ZDEPTHHOLD,#CYCLEGCODESAVE,#DEPTHCHANGE
* 21/11/00 RHA DEV00001864 Add #ZLEVELHOLD,#ZCLEARINC for TNC426
* 13/12/00 RHA #TEMP, $TEMP declared
* 14/12/00 RHA DEV00002151 - Add #TOOLRAPWARN & #TOOLZWARN for toolchange position
checks.
* 25/01/01 RHA DEV00002157 Additional variables for thread mill single block cycle
* 06/09/01 RHA Declarations for ECS27xx
* 25/09/01 RHA Declare #NCPROCESS
* 26/09/01 RHA DEV00002377 - Siemens840 Cycles, changes and additions
* 11/10/01 RHA DEV00002359 Add #WARNCRCARC
* 30/10/01 RHA DEV00003699 Add more variables for ECS2700
* 01/03/02 RHA DEV00004755 Add #FORCEXYZ
* 01/03/02 RHA DEV00004482 Add #SETUPHEAD
* 30/04/02 RHA DEV00005006 Add #HIGHSPEEDTOL
* 15/05/02 RHA DEV00005454 Add #ROTINCR
* 16/05/02 RHA DEV00005448 Add #LIMIT180
* 30/05/02 RHA DEV00003830 Add control for incremental in rotary mode
* 27/11/02 RHA DEV00006442 Add expand controls for hole cycles
* 02/12/02 RHA DEV00006698 Add #CURRENTCPL
* 21/02/03 RHA DEV00007249 Add hole cycle control switches
* 12/08/03 RHA DEV00007046 Add #DIRHOLD
* 13/08/03 RHA DEV00007955 Force feedrate at start of subroutine #FORCEFEED
* 13/08/03 RHA DEV00007537 TLO options as for CRC
* 10/08/03 RHA DEV00008012 Correct Z reverse - Heidenhain hole cycles
* 22/08/03 RHA DEV00008536 Improve CRC warnings
* 26/08/03 RHA DEV00008539 Add warning counter
* 27/08/03 RHA DEV00007609 Add #REFSHIFT and #TEMPREF variables
* 28/11/03 RHA DEV00008695 Improve processing speed for surface milling
* 05/12/03 RHA DEV00007400 Option to force XYZ on full circle
* 05/12/03 RHA DEV00007045 Table clamp codes and tokens
* 05/12/03 RHA DEV00007835 Allow R word on 360 arcs (TNC426 only)
* 16/06/04 RHA DEV00010879 Thread Mill Cycle parameters
* 19/07/04 RHA DEV00011202 Removed #ARCTOL
* Version 9.5
* 18/11/04 RHA DEV00012253 Make workshift warning optional
* 22/11/04 RHA DEV00012250 Option to suppress move to Retract before cycles
* 10/01/05 RHA DEV00012570 Correct TNC Helix
* Version 10
* 08/07/05 RHA DEV00014063 Add #MAXTMP for max block setting
* Version 10.5
* 08/07/05 RHA DEV00015560 Declare #COUNT
* Version 12.25
* 03/12/07 RHA DEV00021534 Enable longhand tapping
* Version 12.50
* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings
*************************************************************************
*
*
* Startup / Initialisation / General
*
* 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
*User variables for
* Variables for ECS2700
*Variables for expanded datum setting (ECS2700)
* Variables for Thread Mill canned cycle
*** End of include file B:\Pams\cam\machdef\template\MDECLARE.CGI ***
*** Start of include file MMSIE840.CGI ***
*************************************************************************
* Machine independant Code Generator include file *
* *
* Filename: MMACRO.CGI *
* Author: ADM (Derived from 3AXM-FAN.CGS -r1.41 *
* and 3AXM-HH.CGS -r1.25) *
* Date: 6th December 1996 *
* *
*************************************************************************
* Change History *
* Initial Version - Included fixes for db9831 and db9843 *
* 16/12/96 ADM - Allow user to specify workshift user var if 3AXMILL *
* only (db9739) *
* 27/01/97 ADM - use NEXTZMOVE instead of ZMOVE in *
* RAPID_AFTER_TOOLCHANGE (db9822) *
* fix logic problems with X_REVERSE and option repeat *
* machining (db8921 & db8923) *
* 03/02/97 ADM - Moved NEXTTOOL logic from token to the toolchange *
* macro *
* 05/02/97 ADM - fixed incorrect block numbers and comp code on *
* mirror. Also fixed reseting of incremental datum *
* shifts. *
* 10/02/97 ADM - added logic to set NEXTTOOL token to the first tool *
* if last toolchange *
* 11/02/97 ADM - added logic to prevent workshift override on TL *
* when DS has been used (db9739:1) *
* 21/04/97 ADM - db10043 - allow cutter comp on thread milling *
* db10098 - remove speed modifier from toolchange *
* 03/06/97 ADM - db10191 - redirect drill macro via nocycle if *
* rotary rotate used *
* 06/10/97 SME - FEED system variable used instead on XYFEED ZFEED *
* See \\sprog\projects\plc\surfmach\fspec\
fsfeedrate.doc
* 03/11/97 ADM - Suppress 3 axis rapid move when using Transform - *
* Repeat (db10323) *
* 04/11/97 ADM - Prevent output of Z values in sub-routine for *
* Heidenhain template (db10328). *
* 07/11/97 ADM - allow DWELL token in Heidenhain hole cycles(db10327)*
* 13/11/97 ADM - Add option for CRC register as Maxtools + tool *
* count (db9633) *
* 18/11/97 ADM - Allow seperate code constructor for hole cycle *
* points for Fanuc template (db10455 & db9616) *
* 21/11/97 ADM - Axis Reverse option now affects home and toolchange *
* positions (spotted when fixing db10578) *
* 28/11/97 ADM - Warn if no Rapid to Toolchange prior to Toolchange *
* (db10589) *
* 02/03/98 ADM - Implement TNC400 Q parameter hole cycles (db10347) *
* Implement TNC400 rigid tapping (db10329) *
* Fixed feedrate output for angular moves (db10684) *
* 09/03/98 ADM - Implement spline output for Fanuc and TNC400 (C1&C2)*
* 23/03/98 ADM - Move to Toolchange/Home now obeys setting of *
* First/Fixed modifiers (db10770) *
* 23/03/98 ADM - Properly fixed feedrate for angular moves (db10684) *
* 30/03/98 ADM - Changes to warning messages for new Warning codecon *
* 17/06/98 ADM db10854/db10857 implement language independance *
* 17/08/98 ADM - Heidenhain now uses #EXACTGCODE not #EXACTSTOP *
* (db10822) *
* 22/09/98 RHA - $COMP settings removed from macro 29 - new procedure*
* Spline procedures renamed (and now in m/c specific files)
* Deckel specific comp settings removed *
* $CONTINUE made local to TNC400 *
* 19/10/98 RHA - Corrections to Subroutine call positioning in *
* Macros 32/59. NB does not apply to Heidenhain *
* Force #TOOLCHANGE=#FALSE in macros 2/3/4/5 *
* (corrects speeds problem if no rapid after toolchange)
* 21/10/98 RHA - Macro 59 modified to allow subcall in cycles to work*
* (Moved @END above %CALL=PT......) *
* 08/12/98 RHA _ Remove #TOOLCHANGE=#FALSE in macros 4/5 *
* Set #ROT angles in macros 1/2/3 only if not planar *
* set #ROT angles in macro 38 *
* 10/12/98 RHA Use of #ROTVALS for INDEX ROT-ROTATE differentiation*
* see note/comment in macro 15 *
* 18/12/98 RHA - DB11147 DB11151 DB11154 (Non-Heidenhain types) *
* Use of MASK in Subroutine macros corrected *
* Use of MASK in HOLD corrected *
* G92 datum resets corrected for abs subroutines *
*************************************************************************
* 17/06/99 RHA Processing moved to Mproceed.cgi for long macros *
* PMACRO-2 PMACRO-15 PMACRO-29 PMACRO-32 PMACRO-35 PMACRO-RESET*
* Hole cycle procedures moved to mproceed.cgi *
* Mmacro file copied to create m/c specific files *
* Macro specific debug removed, Proc trace reset added*
* Hole cycle macros moved in from m/c file *
* 03/09/99 RHA DB11325 - Thread mill macro modifiers corrected *
* 07/01/00 RHA DB11691 - Order of procedure calls standardised, macros 40/1 &
Spline
* 11/07/00 RHA DEV00000290 Ensure #MACRO is set by all standard macros
* 08/02/01 RHA DEV00002467 Suppress CRC in macro=5 until subfunct is set
* 25/05/01 RHA DEV00003177 Set #XTOOL etc correctly for fixed axes. Macros 40/41
* 20/02/03 RHA DEV00007049 Make Exact stop properly switchable
* 21/02/03 RHA DEV00007249 Suppress hole cycle subroutine with no points
*************************************************************************
* 27/08/03 RHA DEV00007609 Add PMACRO calls to Macros 40 and 41
* 03/12/03 RHA DEV00009395 Correct TLO with HPCC
* 11/08/04 RHA DEV00011656 Set #HOLECYCLE2=0 in macro 55 for subroutine appraoach
control
* Version 10.5
* 11/11/05 RHA DEV00011656 Activate planar rotate with subroutines
* Version 12.25
* 03/12/07 RHA DEV00021534 Enable longhand tapping
* Force #TOOLCHANGE=#FALSE to prevent SPEEDS lookahead
* Suppress CRC calls until Subfunct is set
***********************************************************************************
* COPY DRILL MACROS HERE $SPC=" "
***********************************************************************************
* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning
* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning
* Only applies to Subprogram style NOT inline block number
reference.
*Set HOLD values
* SF201 Reverse spindle in longhand tapping
*%IF $MACHINE="HEIDENHAIN" %THEN %CALL=TNCSPLINE %ELSE %CALL=FANUCSPLINE
* procedure is now always called SPLINE and is in machine specific .cgi
*************************************************************
* Miscellaneous "User Defined" Macros : Reserved *
* ============================================== *
*
*
*************************************************************
* 101 Spindle Stop/ CLW/ CCLW/ CLW+Coolant/
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 Reserved
*
*
*
*** End of include file B:\Pams\cam\machdef\template\MMSIE840.CGI ***
*** Start of include file MPROCEED.CGI ***
**************************************************************************
* Machine independant Code Generator include file *
* *
* Filename: MPROCEED.CGI *
* Author: ADM (Derived from 3AXM-FAN.CGS -r1.41 *
* and 3AXM-HH.CGS -r1.25) *
* Date: 6th December 1996 *
* *
**************************************************************************
* Change History *
* Initial Version - Included fixes for db9831 *
* 16/12/96 ADM - implemented swapping of CLW/CCLW codes for YZ *
* and XZ planes (db9725) *
* 27/01/97 ADM - use NEXTZMOVE instead of ZMOVE in *
* RAPID_AFTER_TOOLCHANGE (db9822) *
* fix logic problems with X_REVERSE and option repeat *
* machining (db8921 & db8923)
*
* 03/02/97 ADM - fix compensation applied on Z move-Heidenhain (9935) *
* support incremental/absolute datum shift (9008) *
* fix calling nomotion to late *
* 05/02/97 ADM - fixed incorrect block numbers and comp code on *
* mirror. Also fixed reseting of incremental datum *
* shifts. *
* 10/02/97 ADM - fixed calling nomotion to early *
* 11/02/97 ADM - worshift reset on exit from SET_WORK_DATUMS *
* 03/04/97 ADM - logic for reverse ZX arcs corrected *
* 21/04/97 ADM - db9954 - fix adjust feedrate on mirrored arcs *
* db10043 - allow cutter comp on thread milling *
* 16/06/97 ADM - db10165 - IJK values for Thread Milling corrected *
* Also - Compensate for TLO bug fixed and axis reverse *
* now works correctly for absolute arc centre, and *
* has been implemented for thread milling *
* 19/06/97 ADM - db10232 - radius now signed correctly and radius *
* now calculated correctly for rotary machined arcs *
* 26/06/97 ADM - db10240 - adjusted feedrate now handles case of *
* external arc radius less than tool radius. Also now *
* handles Pathtrace and Controller output correctly *
* 06/10/97 SME - FEED system variable used instead on XYFEED ZFEED *
* See \\sprog\projects\plc\surfmach\fspec\
fsfeedrate.doc
* 04/11/97 ADM - Prevent output of Z values in sub-routine for *
* Heidenhain template (db10328). Cycle Z Depths option *
* now affects output of the ZDEPTH token (db10340) *
* 04/11/97 ADM - prevent output of static axis tokens for plane *
* switched arcs (db10457) *
* 06/11/97 ADM - Deckel specific logic added to CRC_HANDLER so that *
* cutter compensation is correctly applied (db10245) *
* 07/11/97 ADM - Allow DWELL token on Heidenhain hole cycles (db10327)*
* 11/11/97 ADM - Call PT_ROTARY_AXES and associated procedures *
* so that Reverse Axis and Start At settings affect *
* Rotary moves (db10246 and db10358) *
* 14/11/97 ADM - Do not force output of rotary axes on first hole *
* position when rotary drilling (db10542) *
* 18/11/97 ADM - Allow seperate code constructor for hole cycle *
* points for Fanuc template (db10455 & db9616) *
* 21/11/97 ADM - Prevent X,Y, and Z from being reversed twice before *
* hole cycledef when Axis Reverse option used (db10578)*
* 08/12/97 ADM - Call PT_ROTARY_AXES in PT_CONVERT_COORDS for rotary *
* and multiplane drilling *
* 11/12/97 ADM - Prevent PT_CONVERT_COORDS from changing #ROT1 when *
* axial drilling using the secondary rotary axis *
* 16/12/97 SME - #HOLECYCLE flag used to skip rotary assignment in *
* PT_OUTPUT_RAPID *
* 19/12/97 ADM - Skip calls to PT_CONVERT_COORDS if not MPLMILL *
* 13/02/98 ADM - If #WORKGCODE is not changed then do not set to *
* #FUNNY in SELECT_WORK_DATUMS (db10652) *
* 18/02/98 ADM - Set #BNUMVAR to 0 if run through MASK else set to *
* #BNUMINC in PT_OUTPUT_SUBSTART. Do not skip *
* assignment of ENDSUB during MASK run (db10673) *
* 23/02/98 ADM - Add option to allow combined rotary/multiplane *
* angular output to prevent additional moves (db10683) *
* 02/03/98 ADM - Implement TNC400 Q parameter hole cycles (db10347) *
* Implement TNC400 rigid tapping (db10329) *
* 09/03/98 ADM - Implement spline output for Fanuc and TNC400 (C1&C2) *
* 20/03/98 ADM - Fixed incorrect radius output in ZX plane (db10764) *
* 23/03/98 ADM - Move to Toolchange/Home now obeys setting of *
* First/Fixed modifiers (db10770) *
* 30/03/98 ADM - Changes to warning messages for new Warning codecon *
* 18/05/98 ADM - Prevent 2 line output from rapid to home/toolchange *
* code constructor when using literals (db10858) *
* 15/06/98 ADM - IK values now calculated correctly for G18 (XZ) arcs *
* (db10891) *
* 17/06/98 ADM - db10854/db10857 implement language independance *
* 18/06/98 ADM - Corrected error in invalid gear selected warning *
* 22/06/98 ADM - Change test for complete arcs to <=0.000001 (B264) *
* 09/07/98 SME - Added check in PT_OUTPUT_RAPID for first move after *
* toolchange when drilling (db10824) *
* 09/07/98 SME - Indone change made for db10891. Nothing seems to be *
* needed. *
* 22/09/98 RHA _ Settings of $COMP removed from procedures *
* set by machine specific procedure SET_COMP_TO_STRING *
* Spline procedures moved to machine specific files *
* Deckel specific comp settings removed *
* 28/09/98 RHA - DWELL=#FUNNY removed from G83 processing (Siemens) *
* 08/10/98 RHA - Recalculation of tapping ZFEED removed (db11030) *
* 09/10/98 RHA - Call hole-cycle-points added for CINCINNATI (db11017)*
* *
* 23/10/98 RHA - Unwanted words suppressed, Cincinnati holes in subroutines *
* *
* 29/10/98 RHA - Changes resulting from Siemens840 testing *
* Always set up IJK modes, even if R preferred *
* #G18SWAP & #G19SWAP processing made independant *
* 05/11/98 RHA - Corrections to G98/9 emulation *
* 1. Jump emulation if constant height pattern *
* 2. Call cycle codecon for each point if emulating G98/9
* 3. Retract moves now call codecon_Rapid direct. *
* 4. FADAL added to hole cycle point processing options*
* Use of #INDEX variable removed *
* Changes to PT_CONVERT_COORDS (db11079) *
* 1. Debug calls corrected (Procedure name) *
* 2. Stationary axis set to 0 instead of FUNNY *
* 3. Explanatory notes added at start *
* 4. %ENDM directive moved out of
* 17/11/98 RHA ROT_HOLD vars set to ROT1 ROT2 instead of #ROT1 #ROT2*
* 08/12/98 RHA Correction to PT_CONVERT_COORDS to call PT_ROTARY_AXES*
* Correction to HOLD var checking in NOMOTION *
* Remove #rot angles setting from PT_ROTARY_AXES calls *
* 10/12/98 RHA Calls to PT_ROTARY_AXES controlled by #ROTVALS *
* 18/12/98 RHA DB11151 DB11147 DB11154 *
* Use of MASK corrected in HOLD & Subroutine procedures*
* #ZHOLD corrected for holes in HOLD *
* 08/01/99 RHA DB11027 - Suppress nomotion arcs (single quads only) *
* DB10886 - Set #HOLECYCLE in PT_HOLE_CYCLE_HH to *
* control #ZHOLD setting in HOLD *
* 11/03/99 RHA Changes for controller compensation
*
* Setting and use of #LEADOUTCOUNT changed for EC4.00 *
* Range check of FIELD12 variable added
*
* 10/05/99 RHA Use of #TEMP removed to save var name *
* #RECORD *
* 14/05/99 RHA DB11332 $DESCR initialised "", ensures token requests value
* (Replaces previous (lost) change under DB10931) *
* 14/06/99 RHA DB11219 - Skip points when calling sub-prog corrected*
* & removed redundant @GOTO (PT_HOLE_CYCLES_HH) *
* 17/06/99 RHA New procedures added to contain logic from macros *
* PMACRO-2 PMACRO-15 PMACRO-29 PMACRO-32 PMACRO-35 PMACRO-RESET *
* (Generic macro file copied to m/c specific files) *
* Procedure trace mechanism installed *
* 21/06/99 RHA DB11095 Correct RESET processing Procedure=PMACRO-32 *
* Var content comments PMACRO-32 & PMACRO-RESET *
* 24/06/99 RHA DB11377 Set HOLD values for hole cycles PT_HOLE_CYCLES *
* 25/06/99 RHA DB11377 Set #ZMOVE to #ZDEPTH after incr calcs PT_HOLE_CYCLES *
* 25/06/99 RHA DB11374 Removed angle precision calcs from NOMOTION *
* (Prevented -0.0 output) *
* 29/06/99 RHA DB11458 %CALL=CODECON_CUTTER-COMPENSATION added for cancel comp
* 01/07/99 RHA DB11377 Branch on $OUTPUTSUBS corrected to allow for null *
* 06/07/99 RHA DB11261 3D Rapid to Home/Toolchange corrected *
* 20/07/99 RHA DB11141 Block number reset added - PT_BINC *
* 23/07/99 RHA Modified PT_HOLE_CYCLES for Grundig532 *
* 09/08/99 RHA DB11551 Check for thread mill data added to PMACRO-37 *
* Array debug added to PMACRO-37 (& Commented out) *
* 10/08/99 RHA DB11566 Tool text data retrieval added, set_tooling_data *
* 22/09/99 RHA DB11657 Use of MASK in Procedure=HOLD corrected *
* 12/10/99 RHA DB11697 XYZ Rounding added to PT_INCREMENTAL_XYZ for increased
incremental accuracy *
* 07/01/00 RHA DB11774 Corrections to PT_CONVERT_COORDS
* Make inactive rotary axis =#funny
* Correct #hold values for axial orientation
* Redundant
* Some simplification of procedure structure
* 07/01/00 RHA DB11691 Call order of COMP_TLO, INCXYZ, REVERSE standardised
throughout
* Precision rounding moved to PT_SET_PRECISION
* NOMOTION check moved from CIRCLE to PT_OUTPUT_ARC
* Stationary axis reset in Procedure=CIRCLE
* 24/01/00 RHA DB11691 Hole Cycle parameters Z Reverse added
* Thread milling Z reversal corrected.
* 09/02/00 RHA DB11930 Skip P-RESET processing if next macro is datum shift
* Prevent "null" G92 output from P-MACRO32
* 14/02/00 RHA DB11745 Use of absinc etc in SUBSTART corrected
* 07/03/00 RHA DB11941 All CRC warnings now controlled by #WARNCRC
* Cancel CRC allowed on Z move if required, #CRCONZ
* 08/03/00 RHA DB11952 Remove unwanted Z moves from single level hole cycles
* Add safety Z check to Rapid approach to cycles.
* 15/03/00 RHA Further correction to P-RESET processing if next macro
* is datum shift to allow shifts to accumulate.
* 16/03/00 RHA DB12104 Correct NOMOTION check in incremental. Move to
PT_INCREMENTAL_XYZ.
* 16/03/00 RHA DB12053 PT_CYCLE_DEPTHS - make R word abs/inc with Z depth
* 23/03/00 RHA Correction to fixed axis in single block
PT_RAPID_TO_HOME_TOOLCHANGE
* 16/05/00 RHA DB12120 DB10191 "fix" applied to all hole cycles to prevent output
of cycle in rotary rotate.
* 19/05/00 RHA DB12190 Feed token set to nextfeed for rapid moves instead of #Funny
PT_OUTPUT_RAPID
* 22/05/00 RHA DB11887 Change loop expansion in Hole_Cycle_Points for Maho/Grundig
style
* 23/05/00 RHA DB12129 Removed #ZCLEAR=#FUNNY from suppression lines in
PT_HOLE_CYCLE.
* 23/05/00 RHA DB10448 Implement Heidenhain bore cycle - remove restriction from
REAM-CYCLE & BORE-CYCLE
* 24/05/00 RHA DB12073 Correct XY modality on arcs, remove force output from
procedure CIRCLE
* 24/05/00 RHA DB11019/DB11341 Add PT_ARC_TURN_BRG_HH for TNC helical moves.
* 12/06/00 RHA Correct codecon calls for loop=1 in pt_hole_cycles
* 10/07/00 RHA Correct debug name for PROCEDURE=CIRCLE
* DEV00000276 Correct null axis setting in CIRCLE to HOLD values
* 16/10/00 RHA DEV00000907 Suppress null legs on return to home & tool change
* 16/10/00 RHA DEV00000156 Set #ZHOLD at end of hole cycle
* 17/10/00 RHA DEV00001619 Correct M13/14 processing by tapping cycle
* Remove PT_TAPPING_TYPE, modify TAP-CYCLE
* DEV00001101 Arc feed adjustment, incorrect divide by zero test
removed
* DEV00001024 Reset processing corrected P-RESET
* DEV00001617 Correct direction for rapid/feed angular moves
* 23/10/00 RHA DEV00001648 Speed setting for token moved to PT_SPEED_SET and
corrected
* 07/11/00 RHA DEV00000907 PT_RAPID_TO_HOME_TOOLCHANGE Reverse storeabs position if
needed
* 09/11/00 RHA DEV00001683 Add multidepth drilling
* 13/11/00 RHA DEV00001683 modify PT_MULTI_LEVEL to read MRPLANE(#LOOP)
* 20/11/00 RHA DEV00001864 New procedures for TNC hole positions, multilevel/depth
* TNC426 has $MODEL set to "TNC426"
* 22/11/00 RHA DEV00001683 Suppress G98/9 emulation reset when multidepth not
supported
* 23/11/00 RHA DEV00001864 Minor corrections PT_HOLE_CYCLES_TNC
* 14/12/00 RHA DEV00002128 Procedure=CIRCLE, Use #XSTOREABS etc for old position
instead of #XHOLD etc
* 14/12/00 RHA DEV00002151 Toolchange position warnings expanded
* 19/12/00 RHA DEV00002154 Remove coolant from hole cycle points suppression list
* 19/12/00 RHA DEV00002152 Add SET_TOOL_TYPE procedure
* 11/01/01 RHA DEV00002249 Correct selection of Rigid tapping for Heidenhain,
Procedure=Tap-Cycle
* 12/01/01 RHA DEV00002212 Correct XY modality for hole cycle definition following
a tool change
* 15/01/01 RHA DEV00002142 Place %ASK for tokens PROGVERSION & PROGRAMMER in
procedures
* 22/01/01 RHA DEV00002303 Correct call to CODECON_CANCEL-CUTTER-COMP for lead out
in CRC Handler
* 23/01/01 RHA DEV00002321 Additional check for 360deg circle added in
PT_ARC_TURN_BRG
* 25/01/01 RHA DEV00002157 Single helical block option added for thread mill
* Thread mill array printout added to PMACRO-
37
* 26/01/01 RHA DEV00002212 Additional correction to hole cycle procedures for XY
modality
* 29/01/01 RHA DEV00000702 Corrections to CRC processing for feed moves
* DEV00001790 Corrections to CRC cancel in thread mill
* 30/01/01 RHA Correct CRC call for lead out in procedure=CIRCLE
* 31/01/01 RHA Correct CRC call, thread mill lead in and warn for Z
move CRC
* 08/02/01 RHA DEV00002467 Call PT_Check_lead from CRC handler, lead in
* Set $COMPOUTPUT=FALSE for subfunct settings 1&2 in
PMACRO-2
* 13/02/01 RHA Skip CRC checks if no CRC, PT_OUTPUT_FEED
* 27/02/01 RHA DEV00001790 Remove unwanted G40 when comp not used
* 01/03/01 RHA Further CRC corrections, PT_OUTPUT_FEED & CIRCLE
* 08/03/01 RHA DEV00001790 further fix for thread mill lead out in pt_output_feed
* 30/05/01 RHA DEV00002318 *-1 removed from RETRACT calcs in PT_HOLE_CYCLES_HH
* 22/06/01 RHA DEV00003172 Set rotary values for SET_WORK_DATUMS
* 25/06/01 RHA DEV00003177 Correct HOLD calls, Rapid to Home / TC.
* Nested IFs removed from PT_RAPID_TO_HOME_TOOLCHANGE
* 28/06/01 RHA DEV00003177 Initialise rotary angles at zero for first datum setting
* 12/09/01 RHA DEV00003014 Dword only output with G41/2 PT_OUTPUT_FEED
* 12/09/01 RHA DEV00003693 Correct NOMOTION for angular moves
* 24/09/01 RHA DEV00003699 Add "ECS2700" options to hole cycles
* 26/09/01 RHA DEV00002377 Add PT_COUNT_PECKS
* 26/09/01 RHA DEV00003754 Correct rotary HOLD for Hole Positions
* 10/10/01 RHA Set HOLD values from hole data array
* 11/10/01 RHA DEV00002359 Add switchable arc check to PT_CHECK_LEAD
* 29/10/01 RHA DEV00003699 Add 20 datum settings procedures for ECS2700
* 30/10/01 RHA DEV00003388 Implement longhand hole cycle option
* 18/03/02 RHA DEV00004875 Correct liftout position for peck Clear PMACRO-35
* 19/03/02 RHA DEV00004819 Output CRC codes for multiple thread mill cycles
* 16/04/02 RHA DEV00005368 hole cycles, Longhand test made "=2" instead of "<>1"
for safety
* 29/04/02 RHA DEV00005285 Suppress unwanted COMPDCODEs in Arcs
* 15/05/02 RHA DEV00005443 Set #HOLECYCLE=1 in PT_HOLE_POSITION_HH
* 23/05/02 RHA DEV00005526 Prevent divide by zero in PT_COMP_ARC_FEED
* 18/06/02 RHA DEV00005640 Improve G01 processing, streamline code, reduce number
of %IFs
* 02/09/02 RHA DEV00006218 Changes to subroutine start points in line with EdgeCAM
graphics changes
* 14/11/02 RHA DEV00006176 Correction to drill first hole in cycle array
* 18/11/02 RHA DEV00006587 Correct S Code spindle control (PT_SPINDLE)
* 21/11/02 RHA DEV00006690 Prevent Subcall approach move for repeat machining
* 27/11/02 RHA DEV00006442 Add switchable %NOCYCLE to hole cycle procedures
* 02/12/02 RHA DEV00006698 Save CPL name for use in Rapid after ToolChange
* 05/12/02 RHA DEV00006799 Feed approach move in Subcall
* 07/01/03 RHA DEV00007000 Improve divide by zero check in PT_COMP_ARC_FEED
* 21/02/03 RHA DEV00007249 Add hole cycle control switches
* 25/02/03 RHA DEV00006881 PT_COMP_ARC_FEED - remove feedrate integer conversion
* 07/03/03 RHA DEV00007249 Correct blanking of unwanted points parameters in hole
cycles
* 13/03/03 RHA DEV00007462 Correct subroutine approach avoidance for holes
* 19/06/03 RHA DEV00007915 (&7983) Prevent output of uninitialised move at start of
sequence (Nomotion)
* 19/06/03 RHA DEV00007757 Protect Scode from divide by zero
* 20/06/03 RHA DEV00008003 Switch thread mill cycles on PATHTRACE variable.
* 12/08/03 RHA DEV00008391 Over-ride DRILLSUB if only one hole when setting
#HOLECYCLE
* 13/08/03 RHA DEV00000377 New procedure to set #HCODE
* 13/08/03 RHA DEV00007955 Force feedrate at start of subroutine #FORCEFEED
* 13/08/03 RHA DEV00007537 TLO options as for CRC
* 15/08/03 RHA DEV00008196 Correct Z Gauge adjustment for arcs
* 10/08/03 RHA DEV00008012 Correct Z reverse - Heidenhain hole cycles
* 22/08/03 RHA DEV00008536 Improve CRC warnings
* 26/08/03 RHA DEV00008539 Add warning counter
* 27/08/03 RHA DEV00007609 ToolChange & Home setting Option
* 17/09/03 RHA DEV00008761 Corrections to CRC Cancel
* 24/09/03 RHA DEV00008897 TNC Regressions - knock on from various other fixes.
* #ZHOLD=#ZMOVE
* 02/10/03 RHA DEV00008897 Remove Z set where ZMOVE=#FUNNY
* Fix to multilevel - PT_GET_NEXT_HOLE
* 09/10/03 RHA DEV00008984 Lift to clearance for drill cycle
* Allow for reversed Z in moves to ZCLEAR (PT_HOLE_CYCLES)
* Correct output with Z reversal
* 21/10/03 RHA DEV00009158 Correct CRC output for multi-pass profiles
* 28/11/03 RHA DEV00008695 Improve processing speed for surface milling
* 02/12/03 RHA DEV00009316 Corrections to Hole Cycle Subroutine calls
* 03/12/03 RHA DEV00009396 Corrections to Thread Mill CRC
* 05/12/03 RHA DEV00007400 Option to force XYZ on full circle
* Version 8.75
* 03/03/04 RHA DEV00009979 Helical arc implementation, Procedure CIRCLE
* 25/03/04 RHA DEV00010662 Correct single block speed call
* 30/03/04 RHA DEV00010662 Call spindle if direction changes
* Version 9.0
* 14/06/04 RHA DEV00011132 Correct datum for first tool, G54 setting forced in
SET_WORK_DATUMS to compensate
* 16/06/04 RHA DEV00010879 Thread Mill Cycle parameters
* 17/06/04 RHA DEV00011068 Correct hole cycle flag settings, use #HOLECYCLE2
* 29/06/04 RHA DEV00010879 Hole cycle processing for TNC430
* 02/07/04 RHA DEV00011313 Work round for incorrect YEND on G18 arc
Procedure=Circle
* 28/07/04 RHA DEV00011203 Correct helical parameters for TNC
* 11/08/04 RHA DEV00011656 Use UARRAY1 to store hole cycle flag settings
(DEV00011068)
* Version 9.5
* 18/11/04 RHA DEV00012253 Make workshift warning optional
* 18/11/04 RHA DEV00011306 Correct PT_HOLE_POSITION_HH to allow rapid after
toolchange
* 22/11/04 RHA DEV00012250 Option to suppress move to Retract before cycles
* 02/12/04 RHA DEV00012570 Correct thread mill regression (linked to DEV00011203
above)
* 23/12/04 RHA DEV00012565 Remove duplicate CRC cancel
* 05/01/05 RHA DEV00012613 Correct TNC Helix
* 05/01/05 RHA DEV00012845 Add new tool types
* 10/01/05 RHA DEV00012971 Procedure CIRCLE, tidy subfunct branching and add
optional pitch suppression
* 12/01/05 RHA DEV00013014 CRC processing correction in CIRCLE
* 12/01/05 RHA DEV00012616 Correct rapid after toolchange. #ZTEMPREF setting
* 17/01/05 RHA DEV00012616 Corrections
* 17/01/05 RHA DEV00012616 Corrections for incremental moves
* 20/01/05 RHA DEV00012290 Helical arc processing
* 21/01/05 RHA DEV00012290 TNC Thread mill arc INCANGLE fix
* Version 9.75
* 25/01/05 RHA DEV00011662 Correct thread plunge point extraction
* 16/02/05 RHA DEV00013267 Use SUBROUTINE (not #SUBROUTINE) as array index
* 16/02/05 RHA DEV00010860 Remove unwanted G40 PT_OUTPUT_FEED
* 17/02/05 RHA DEV00010860 Correction for thread milling
* 17/02/05 RHA DEV00013267 Correct #SUBROUTINE setting at end of sub.
* 18/02/05 RHA DEV00010860 Correct plunge move identification in thread mill
* 18/02/05 RHA DEV00011662 Correct thread mill cycle diameter with helical leads
* 25/02/05 RHA DEV00013132 Correct output of angular move with rotary arcs
* 28/02/05 RHA DEV00010643 Improve subroutine approach moves
* 03/03/05 RHA DEV00007742 Correct full canned cycle, multiple locations.
* 04/03/05 RHA DEV00011310 Set sign of R for 180degrees to +ve
* 09/03/05 RHA DEV00012923 Correct position initialisation for offset initial CPL
* 10/03/05 RHA DEV00012923 Do not use XSUB etc for tool change position offset
* 11/03/05 RHA DEV00012923 Set HOLD vars to HOME in START macro so remove IF
FIRST...
* 11/03/05 RHA DEV00013387 Circle centre accuracy improvements
* 11/03/05 RHA DEV00013251 Calculate IJK after precision rounding
* 14/03/05 RHA DEV00013387 Correct for Heidenhain TNC.
* 21/03/05 RHA DEV00013554 Correct TNC thread mill, regression caused by 13387, re-
instate PT_TURN_ARC_BRG
* 21/03/05 RHA DEV00013586 Reset planar/rotary mode for hole cycle subroutines
* 29/03/05 RHA DEV00010643 Correct subroutine approach for incremental subs
* 30/03/05 RHA DEV00012923 Corrections
* 30/03/05 RHA DEV00011662 Thread mill cycle, position corrections
* 01/04/05 RHA DEV00010643 Force GCode at start of subroutine
* 06/04/05 RHA DEV00012923 Move to home & toolchnage positions fix
* 06/04/05 RHA DEV00013251 Correct arc centre point rounding
* 06/04/05 RHA DEV00013132 Angular output with radial arcs
* 06/04/05 RHA DEV00013721 Fix 3axm compilation error, CALL=PT_ROTARY_AXES
* 07/04/05 RHA DEV00013387 Correction to end point calcs
* 07/04/05 RHA DEV00013732 Correct TNC arc included angle and start angle
* 11/04/05 RHA DEV00011662 Thread mill cycle, position corrections
* Version 10
* 27/05/05 RHA DEV00014108 Correct direction evaluation for rotary rapid
* 28/06/05 RHA DEV00014268 Correct for TRUEARCOP in
%PROCEDURE=RADIUS_ROUNDED_CENTRE
* Do not check arcs less than 300 degrees
* 29/06/05 RHA DEV00014268 Fix #OUTPUTRADS setting in RADIUS_ROUNDED_CENTRE
* 08/07/05 RHA DEV00014070 Correct rotary angles for arcs, use #ROTVALS
* 08/07/05 RHA DEV00014429 Correct #ZTEMPREF etc for moves after toolchange
* 09/08/05 RHA DEV00014699 Correct full arc output - force XY
* 15/09/05 RHA DEV00014670 GETCPL in first move after toolchange even if Feed
* 04/10/05 RHA DEV00012923 Correct rapid after toolchange setting
* Correct initial position setting PT_INIT_POSITION
* Version 10
* 11/11/05 RHA DEV00015560 Reset #COUNT for planar rotate
* Version 10.5
* 15/02/06 RHA DEV00015578 Thread mill - G40 if G01 followed by G00
* 15/02/06 RHA DEV00014781 Set NEXTZMOVE in Thread Mill
* Version 10.75
* 11/04/06 RHA DEV00016863 Correct I value in thread mill for X reverse
* Fix planar lead arc reversals
* Version 11.5
* 13/10/06 RHA DEV00018390 PT_CONVERT_COORDS
* 17/11/06 RHA DEV00014536 remove spurious comp warning from arcs
* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable
* 19/12/06 RHA DEV00018593 Set #PLANEGCODE in Thread Milling
* 15/02/07 RHA DEV00017338 Correction to CPL name in Rapid after TC
* Version 11.75
* 13/04/07 RHA DEV00019720 Correct wrapped drill cycle approach
* Version 12.00
* 24/08/07 RHA DEV00020760 DEV00020742 DEV00019720 Fix approach coordinates
* Version 12.25
* 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
* 14/01/07 RHA DEV00021646 Correct multilevel drilling TNC
* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings
* 30/01/08 RHA DEV00021531 Remove Z0 from hole approach moves
* Version 2009R1
* 25/07/08 RHA DEV00023625 Fix the force longhnad drill option
* 28/07/08 RHA DEV00023625 Correct confusion between subroutines and canned cycle,
drill only
**************************************************************************
*
*************************************************************************
*** INITIALISATION
*************************************************************************
* Called by all START macros to set initial position etc.
* Current CPL output values
* Machine Datum output values
* Reset HOLD with reversals if not incremental
* Set CPL offset for moves to Home and TC
* *******************
* Macro support procedures
* ********************
*
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to
prevent duplicate moves
*Longhand if canned cycle not available
*Set NOCYCLE if longhand selected with pathtrace subroutines
* Pathrace=0 for Controller subroutines
* USERVAR1=2 for Longhand selected
*
* NOTE! Re-instatement of the following variables is deemed good practice.
* Not possible for the user to apply to the cycle line only via the Code Wizard
i.e. Cancel since
* this would be in the points expansion loop and would be applied to every
location.
*
* #XMOVE,#YMOVE,#ZMOVE removed from following line to restore modality control
**************************************************************************
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to
prevent duplicate moves
*Longhand if canned cycle not available
*Set NOCYCLE if longhand selected with pathtrace subroutines
* #XMOVE,#YMOVE,#ZMOVE removed from following line to restore modality control
**************************************************************************
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to
prevent duplicate moves
*Longhand if canned cycle not available
*Set NOCYCLE if longhand selected with pathtrace subroutines
* %IF $MODEL="TNC400" @CANNED
* %IF $MACHINE="HEIDENHAIN" %THEN %NOCYCLE
* #XMOVE,#YMOVE,#ZMOVE removed from following line to restore modality control
**************************************************************************
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to
prevent duplicate moves
*Longhand if canned cycle not available
* Set NOCYCLE if longhand selected with pathtrace subroutines
* Not applied with bore offset
* %IF $MODEL="TNC400" @CANNED
* %IF $MACHINE="HEIDENHAIN" %THEN %NOCYCLE
* #XMOVE,#YMOVE,#ZMOVE removed from following line to restore modality control
*%IF PATHTRACE=1 %THEN %NOCYCLE
**************************************************************************
* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to
prevent duplicate moves
*Set NOCYCLE if longhand selected with pathtrace subroutines
*
* Check and reset direction
* Right hand threads
* Left hand threads
*
* #XMOVE,#YMOVE,#ZMOVE removed from following line to restore modality control
**************************************************************************
* Set CPL if first move after ToolChange
* Force #TOOLCHANGE=#FALSE to prevent SPEEDS lookahead
* Set CRC output control for profile lead in/out
**************************************************************************
* Set #SPEEDUP to improve surface milling
* Hold values are not reversed in incremental mode
*New variable #ROTVAL introduced Dec98. RHA
* Used to control rotary angle setting in Feed and Rapid macros because the
* system vars ROT1 and ROT2 are not always set correctly by EdgeCAM in Index mode.
* #ROTVALS set #FALSE by the INDEX macro so ROT1 ROT2 will be ignored in Feed &
Rapid
* #ROTVALS set #TRUE by the ROTARY-ROTATE macro so ROT1/ROT2 will be used.
* #ROTVALS set according to mode by ROTARY/PLANAR macro (#FALSE for PLANAR Mode).
* If ROT1/ROT2 are ignored then reprocessing of angles through PT_ROTARY_AXES is
skipped
* Initialise #ROTVALS if not already set. Done here to ensure setting before use
for all templates.
*
* The Token Speed calls the procedure PT_SPINDLE to determine Gear (if auto)
and Spindle speed / Spindle Code
* Position not move, therefore never incremental
* %IF #INCRXYZ=#TRUE %THEN %CALL=PT_INCREMENTAL_XYZ
* Check correct position
* No Rapid_to_ToolChange call
* Check Z position only, allow for axis reversal
**************************************************************************
* 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, cclw
*
* 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 dependant 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
**************************************************************************
**************************************************************************
*If no comp requested ensure output flag is true
* Check for helical interpolation
* %IF PATHTRACE=1 %THEN %NOCYCLE
*Check for array data.
************ Diagnostic printout
************
* #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
**************************************************************************
* Adjust tool/home position to current CPL if required
**************************************************************************
* 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
setting
* Update stored end point (XINC etc in Reset are TOTAL increments for this level)
*<*HOLD2 [#XHOLD=0] [#YHOLD=1] [#ZHOLD=2] >
* Final G92 position.
* Heidenhain type machines
**************************************************************************
* *******************
* Debug Trace Procedures
* *******************
* Called from token TOOLTYPE
* *******************
* Program Defaults
* *******************
*
* Used in rotary but tested in procedure hence must be declared for 3axis also.
*
* Processes the Program Defaults Tab to allow spindle direction, coolant etc.
to be set by the user.
* Spindle Direction
* Coolant
* Handle User Input when Token PROGDESCR used
* Handle User Input when Token PROGDESCR used
* Handle User Input when Token PROGID used
* Handle User Input when Token PROGDESCR used
* *****************************************
* * 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
*$COMP=0
*Set CPL Parameters
* First Rapid move after Toolchange - Called from Hole cycles
*
*
* procedure to set and check spindle speed whenever the token is used.
* Only process when speed changes for efficiency
* #SPEEDHOLD=#SPEED99
*
*
* 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
* Checks for CRC
* Next line commented out for DEV00010860 - check before final removal
* #COMPGCODE=#FUNNY
* Output Feed move
* Cancel cutter compensation via CodeCon_cancel-cutter-comp
* Code Constructor must be empty if output is with move otherwise blank block
will be produced
* Next line removed to prevent duplicate calls DEV00012565
* %IF #LEADOUTCOUNT=1 %THEN %CALL=CODECON_CANCEL-CUTTER-COMP
*
* Handles the applying and cancellation of cutter compensation in all
situations *
*****************************
* Profile Cycle *
*****************************
*********************************************
* 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 move
* Call codecon for machines needing separate G40 block
* #COMPON=0
*
* 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
* Check CRC lead conditions
* 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]>
* Check arc centre accuracy. Set precision before radius checks
* Set arc type - Radius or IJK
* <Inc [#INCANGLE=0]>
* Check for full circle (0 or 360)
* <AA PITCH [PITCH=2]>
* Set Radius Sign
* Always Centre and Radius output
* Set Radius and precision
* XYPLANE is set as 0, 1 and 2 for XY, ZX and ZY respectively
* Cancel cutter compensation via CodeCon_cancel-cutter-comp
* Code Constructor must be empty if output is with move otherwise blank block
will be produced
***************************************************************************
***************************************************************************
* Set Radius and precision
* 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
[#TEMPXCENTRE=0] ROUNDED CENTRE [#XROUNDCENTRE=0]>
*<****** RADIUS AXIS CENTRE ERROR [#YCENTREERROR=1] - TRUE CENTRE
[#TEMPYCENTRE=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
* Multiple turns
* Note that complete circle can have included angle of 0 or 360
* Note that multiple turn arc has only 0-360 included angle, derive from pitch and
Z move
* Round result of division
* 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 seperated into
PROCEDURE=LOOPEXPAND
* If called from CYCLSUB, points are expanded from 2nd point (Loop=2)- cycle line
is outside subroutine.
* This inhibits the ability to support the format whereby the cycle parameters
are variables e.g. Seimens
*
* %IF #ZREVERSE=1 %THEN #ZMOVE=ZCLEAR*-1 %ELSE #ZMOVE=ZCLEAR
* 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. Planar will always be NO for non rotary
situations.
*<* Planar =[$PLANAR]>
* Siemens 840 drills at current location. Rapid to first position before calling
cycle
* Not Rapid After TC
* %IF #ZREVERSE=1 %THEN #ZMOVE=ZCLEAR*-1 %ELSE #ZMOVE=ZCLEAR
* Output move to first position (Rapid after tool change)
* %CANCEL=#XMOVE,#YMOVE - Removed to correct XY modality in cycle definition
*%IF #CYCLEGCODE=DATA1(39) %THEN #FEED=SPEED*PITCH %ELSE
* Branch on $OUTPUTSUBS. =null if PATHTRACE expansion
* Set HOLD values for incremental calculations in subroutines
*Include first position in expansion
*<* #LOOP =[#LOOP=23] LAST =[LAST=23]>
*<* Xpoint =[#XMOVE=24] #Ypoint =[#YMOVE=24]>:%CANCEL=#XMOVE,#YMOVE
*Check for Zdepth change and respecify cycle
*
*
* Each cycle will use a different output line but needs to be here to
centralise loop expansion. Could
* be in each macro but G81, G82 and G83 all use macro 9 and subroutines
use same array.
* Must present different Code Constructors for each cycle otherwise user
will be confused - will have
* to understand that some parameters are not used e.g. DWELL,DEPTH + ALL
GCODETYPES i.e G81, G82 etc in one line etc.
*
* This loop has "growed" and really needs a total restructure. That would take
time and carry a high risk
* of regression problems. Maybe once more strenuous regression testing is in
place?
* In the meantime I have made it even more spaghetti-like by adding the %IF
#EMulation...
* lines to get G98 emulation working for Fanuc etc. Richard Halton Oct98
*
* DB12129 Removed #ZCLEAR=#FUNNY from following suppression lines.
* DEV00002154 #COOL also removed
* DEV00007249 - Next lines considered redundant - remove ?
*%IF $MACHINE="FANUC" %THEN
#CYCLEGCODE=#FUNNY:#GCODE=#FUNNY:#FEED=#FUNNY:#FEEDMODEGCODE=#FUNNY:#HCODE=#FUNNY:#
SPEED=#FUNNY:#DIRECTION=#FUNNY:DWELL=#FUNNY:#DEPTH=#FUNNY:#DEGR=#FUNNY:PITCH=#FUNNY
:#BOREOFFSET=#FUNNY
*%IF $MACHINE="SIEMENS840" %THEN
#CYCLEGCODE=#FUNNY:#GCODE=#FUNNY:#FEED=#FUNNY:#FEEDMODEGCODE=#FUNNY:#HCODE=#FUNNY:#
SPEED=#FUNNY:#DIRECTION=#FUNNY:DWELL=#FUNNY:#DEPTH=#FUNNY:#DEGR=#FUNNY:PITCH=#FUNNY
:#BOREOFFSET=#FUNNY
*%IF $MACHINE="CINCINNATI" %THEN
#CYCLEGCODE=#FUNNY:#GCODE=#FUNNY:#FEED=#FUNNY:#FEEDMODEGCODE=#FUNNY:#HCODE=#FUNNY:#
SPEED=#FUNNY:#DIRECTION=#FUNNY:DWELL=#FUNNY:#DEPTH=#FUNNY:#DEGR=#FUNNY:PITCH=#FUNNY
:#BOREOFFSET=#FUNNY
*%IF $MACHINE="FADAL" %THEN
#CYCLEGCODE=#FUNNY:#GCODE=#FUNNY:#FEED=#FUNNY:#FEEDMODEGCODE=#FUNNY:#HCODE=#FUNNY:#
SPEED=#FUNNY:#DIRECTION=#FUNNY:DWELL=#FUNNY:#DEPTH=#FUNNY:#DEGR=#FUNNY:PITCH=#FUNNY
:#BOREOFFSET=#FUNNY
* G81 Drill Cycle
*First point only
* G82 CounterBore (Dwell) Cycle
*First point only
* G83 Peck Drill Cycle
*First point only
* G84 Tapping Cycle
*First point only
* G85 Ream / Bore Cycle
*First point only
* G86 Bore Cycle (note #BOREOFFSET is entered in machine's default units)
*First point only
* G73 Chipbreak Drill Cycle
*First point only
* Emulate return to Initial level : G98/G99 not supported
* Cancel Canned Cycle
* Rapid to clearance height
* 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
* To calculate Incremental & Unsigned Incremental Z Depth
* Incremental is measured from the Rplane
* Remove duplicate tools from NC Code tool list
* ECS27xx uses 20 settings
* Option to output first Datum (G54) as XYZHOME location
*#INDEX=#TRUE
* Initialise rotary setting at zero
*#INDEX=#FALSE
* This procedure will capture all Absolute datum shifts and assign them
* against the standard work coord codes. Adapted from standard procedure for 20
settings
* <Coordnum [#COORDNUM=0]>
* Option to output first Datum (G54) as XYZHOME location
*#INDEX=#TRUE
* Initialise rotary setting at zero
*#INDEX=#FALSE
* Set CPL offset for moves to Home and TC
* Save CPL ID
* ECS27xx uses 20 settings
* %IF MASK=1 @END
* Rot1/Rot2 are not set from drill array
* Set Move for XYZ
*
*
*
* Round XYZ here for true storeabs position
* Do not adjust XY arcs, Z is unchanged from previous move
*
*
* 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 file 3=None
* Precision calcs moved to PT_SET_PRECISION
* HOLD vars have unmodified EdgeCAM values
*<* #PRECISION=[#PRECISION=!FT_DEBUGREAL] PRECISION=[PRECISION=!FT_DEBUGREAL]
#INCR=[#INCR=!FT_DEBUGREAL]>
* 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 when possible
* TRUE / FALSE Sets #OUTPUTRADS=#TRUE
as default, re-assigned FALSE if I&J forced by logic e.g. 360 degrees move
* This removed to set IJK for instances when R cannot be used
*%IF #OUTPUTRADS=#TRUE @END
* procedure is used when a large arc needs to be ignored. output move to end of
* arc
*
* *********************
* * Thread Milling *
* *********************
*
*
* Next Z for first move
* Set canned cycle variables
*
* <Vertical Move>
* %IF #ZMOVE<#ZHOLD %THEN <PLUNGE> %ELSE <LIFT>
* <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
* Cutting Down
* <INOUT #PLUNGERAD=[#PLUNGERAD=0] #STARTRAD=[#STARTRAD=0]>
*
* Canned cycle output
* 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 when possible
* TRUE / FALSE Sets #OUTPUTRADS=#TRUE
as default, re-assigned FALSE if I&J forced by logic e.g. 360 degrees move
*
* This procedure is called when an unknown move type is detected and
* the record is skipped.
* #RECORD=XPOINT(#LOOP)
*
* *******************
* Block No. Increment
* *******************
*
*
* Check top limit, reset if exceeded
*
*
* ******************************
* Safe Start Block No. Increment
* ******************************
*
*If #ONLYSBNUM=#TRUE then increment SBNUM only, NOT BNUM - update SBNUM with
current if both
* Output Block Number same as Tool Number (POSITION)
*
* ********************************
* Set Tooling data
* ********************************
*
*
*
* *************************************
* Subroutine 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 & increment
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
* Default holecycle flag to zero
*
*
* ********************************
* Subroutine Call
* ********************************
*
* If Increment Subroutines by ... is not set then start at Progid & increment
by one else use the increment.
*Check for hole cyclesub, retrieve stored value
*Suppress single location cycle, xcept for Heidenhain
*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
*
*
* ********************************
* Subroutine End
* ********************************
*
* If Increment Subroutines by ... is not set then start at Progid & increment
by one else use the increment.
* If using incremental subroutines only, it is nescessary to hardcode a G90 on
extra Sequence definition line
* Store HOLECYCLE2 flag for this subroutine
*
*
* ********************************
* Determine spindle speed and gear
* ********************************
*
* The method used allows for range overlap for S-Code type machines by
searching through all the gears
* to determine the closest match rather than testing if the programmed speed is
within the min/max of the gear
* If a Gear has been specified explicitly then the search is restricted to that
gear.
*
* Uses DATA3 for numgears, minrpm, maxrpm, usermax and DATA4 for scode steps,
min-scode, max-scode....
*
* Test if programmed speed is outside the total range of the machine
* Less than Minimum speed so set as minimum
* Greater than the maximum so set as maximum and selet the highest gear
* Speed is within machine's range
* If Gear has not been specified then loop thro' all gears (seperate loop for
simplicity)
* Spindle Code type machine
* Gear has been specified
* Retrieve No. of scodes (Steps), Min_rpm, Max_rpm,
User_max_Rpm for each range
* Found correct S code in this gear range
* Warn if Gear Range selected greater than defined in Spindle Tab
* Assign correct Gear M-Code
* 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
**************************************
* Following notes apply to pre EC4, may not be correct now
* Angle + Rad = 1 move
* Length = 1 move
* Length + Angle = 1 move
* Length + Angle + Rad = 2 moves
* All plus one if 90 compensation cancel set i.e. Radius Compensation Factor in
MM line
* %IF #COMPFACTOR<>0 %THEN #LEADOUTCOUNT=1 %ELSE #LEADOUTCOUNT=0
* %IF FIELD5<>0 %THEN #LEADOUTCOUNT=#LEADOUTCOUNT+1
* %IF FIELD6<>0 %THEN #LEADOUTCOUNT=#LEADOUTCOUNT+1
*
*
* Check FIELD12 lies in range 1-3
*************************************************
* Necessary for Rotary Machining only *
*************************************************
*
* This procedure is called when EdgeCAM outputs a rotary canned cycle with single
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 for
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
* Output all positioning move for Hole cycles
* Lift to ZCLEAR
* Rapid to first XY position then to Zclear with Tool Length Offset. Call
procedure for single Code Constructor
* #ZMOVE=#FUNNY
* #ZHOLD=#ZMOVE
*<zlevel = [ZLEVEL=24] rplane = [RPLANE=24] zdepth = [ZDEPTH=24]>
*<#zlevel = [#ZLEVEL=24]>
* Determine actual Rplane level
* TNC426 requires modified action for multi-level/depth holes
*
* 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
* Relevant CYCLE DEF called for each cycle
* expands XY points via Code Constructor CYCLEPOINTS
*
*#ZMOVE=ZCLEAR
* 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 ?
* Reset #ZMOVE
* Load next point Label
* Force M99 on last hole XY if multilevel is false else will be output on
Zrplane line
* %IF #LOOP<>1 @NOT_FIRST_POINT
* %IF $OUTPUTSUBS=FALSE @LOOPEXPAND
* @NOT_FIRST_POINT
* If subroutines are in use but not being defined/output now, skip point output
(RHA June99)
*
* Each cycle will use a different output line but needs to be here to
centralise loop expansion. Could
* be in each macro but G81, G82 and G83 all use macro 9 and subroutines
use same array.
* Must present different Code Constructors for each cycle otherwise user
will be confused - will have
* to understand that some parameters are not used e.g. DWELL,DEPTH + ALL
GCODETYPES i.e G81, G82 etc in one line etc.
*
* %IF #RPLANE=ZCLEAR %THEN %CANCEL=#MODALCYCLE
* G81 Drill Cycle
* G82 CounterBore (Dwell) Cycle
* G83 Peck Drill Cycle
* G84 Tapping Cycle
* G85 Ream / Bore Cycle
* G86 Bore Cycle (note #BOREOFFSET is entered in machine's default units)
* G73 Chipbreak Drill Cycle
* %IF DRILLSUB<>1 @NEXTPOINT
* %IF $OUTPUTSUBS=TRUE @NEXTPOINT
* %GOTO @END
* @NEXTPOINT
* Rapid to Rplane and execute cycle if Multi-level processing.
*<* Rapid to Retract & Cycle Call *>
* Retract to Clear for next hole
*<* Rapid to Clear *>
* G80 Cancel Canned Cycle
* #HOLECYCLE2 is now used to suppress sub call approach moves
* Always set 0 if cyclesub macro (after sub call)
* Set 0 if not using drill subroutines
*
* Call CYCL DEF for each cycle type
*
*%IF #ZRABSINCR=2 %THEN #RPLANE=#RPLANE*-1
* Load next hole position to determine
* If Multi level output M99, if constant output M98
* If M99 rapid to Clearance, move to next hole, Zrplane M99
* If next Zlevel is different then select M99 (non modal) else select M89
(modal)
* Check Multi-depth for TNC426
*
* 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
* Relevant CYCLE DEF called for each cycle
* expands XY points via Code Constructor CYCLEPOINTS
*
*#ZMOVE=ZCLEAR
* 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 ?
* Set values for constant Level/Depth
* If multilevel, pick up values from array
* Load next point Label
* Force M99 on last hole XY
*%IF #MULTILEVEL=#FALSE %THEN #MODALCYCLE=DATA2(48):%CANCEL=#MODALCYCLE
* Force cycle redefinition if depth or level change
*Check for Zdepth change and respecify cycle
* %IF #LOOP<>1 @NOT_FIRST_POINT
* %IF $OUTPUTSUBS=FALSE @LOOPEXPAND
* @NOT_FIRST_POINT
* If subroutines are in use but not being defined/output now, skip point output
(RHA June99)
*
* G81 Drill Cycle
* G80 Cancel Canned Cycle
* #HOLECYCLE2 is now used to suppress sub call approach moves
* Always set 0 if cyclesub macro (after sub call)
* Set 0 if not using drill subroutines
*
*
* #USER1=MZDEPTH(#LOOP)
*
* Reverse stored absolutes if needed
* Check for no First move needed, already there
*
* Reset stored absolutes if needed
* Calculates number of pecks/chipbreaks in cycle
* Called from Token
* Nothing specified, use defaults
* Called by Attribute macro to reverse spindle when longhand tapping
*** End of include file B:\Pams\cam\machdef\template\MPROCEED.CGI ***
*** Start of include file M-SIE840.CGI ***
*************************************************************************
* Machine specific Code Generator include file *
* *
* Filename: M-SIE840.CGI *
* Machine: SIEMENS 840 *
* Author: RHA *
* Date: September 1998 *
* *
*************************************************************************
* Change History *
* *
* 18/11/98 RHA - Reverse Sign text clarified *
* #MACHTYPE added, set from MM sw9 *
* #REVANGDIR - reverse direction of 0-360 switch added *
* #ROTARYINDEX setting and use removed *
* 15/12/98 RHA Polynomial format corrected. output of [ & ] *
* (NB This gives warning when reading .cgi) *
* 07/01/99 RHA Format table refs added for Polynomial tokens *
* Default sequences changed to avoid load time warning *
* Spline enabled as default for MPLM templates *
* 03/03/99 RHA - Precision calculation now #INCR/2 task Ref A567 *
* 11/03/99 RHA - EC4 controller comp enabled, MM(SW8) help expanded *
* 09/04/99 RHA - Task A Polynomial format correction *
* Null move elimination. Task A *
* Variable $SPLINESTART removed. *
* 10/05/99 RHA _ Polynomial format modified to allow for missing *
* parameters when polynomial lies along an axis. *
* X1 etc values forced out at Program start & End *
* 17/06/99 RHA New procedure trace control added, old DEBUG removed *
* 20/07/99 RHA DB11141 - Block number reset added *
* DB11497 - List NC Code controlled by Setvar *
* 10/08/99 RHA DB11566 - Tool tokens made more widely available *
* 22/09/99 RHA DB11654 - Rotary limit 0-360 made switchable *
* 07/01/00 RHA DB11691 Call order of COMP_TLO, INCXYZ, REVERSE standardised, Macros
START, END
* 11/01/00 RHA DB11758 Add tokens to hole cycles for "technology block".
* 10/02/00 RHA DB11963 - Add user tokens, all code constructors
* 10/02/00 RHA DB11879 - Add Tool position tokens - Rapid to ToolChange
* 10/02/00 RHA DB11745 - Extend token availablity
* 10/02/00 RHA DB11746 - Add Safeblk token to Rapid After Toolchange
* 14/02/00 RHA DB11745 - Changes to method of abs/inc switching
* #incrxyz is set to #incrxyzhold in main prog and #incrsubs in subroutines
* 07/03/00 RHA DB11941 All CRC warnings now controlled by #WARNCRC
* Cancel CRC allowed on Z move if required, #CRCONZ
* 19/05/00 RHA DB11177 Implement option for abs/inc runtime switch
* 25/05/00 RHA DB12281 Add Gear token to ToolChange & Rapid_After_Toolchange
* 07/06/00 RHA Modify data2 array to allow 6 gear ranges
* 17/10/00 RHA DEV00000433 Add TURRETNO token to Rapid to Home/ToolChange
* 09/11/00 RHA DEV00001691 Add more user tokens
* DEV00001683 Add Multi-depth drilling
* 15/11/00 RHA DEV00001682 Add warning notes to Start Code Constructor
* 13/12/00 RHA DEV00000268 Semicolon token added to start & end codeconstructors
* 13/12/00 RHA Improve $CONDEBUG setting
* 13/12/00 RHA DEV00001886 - Replace text Imperial with Inch
* 14/12/00 RHA DEV00002151 Better toolchange position warning control
* 19/12/00 RHA DEV00002152 TOOLTYPE token added to ToolChange and to Tooling Data
* 15/01/01 RHA DEV00002142 Add admin tokens to Program End code constructor
* 20/09/01 RHA DEV00002377 Additions to Hole Cycles
* 11/10/01 RHA DEV00002359 Add switch for Arc move check to CRC tab
* 25/10/01 RHA DEV00002996 Add Job Record Tokens to START and END constructors
* 30/10/01 RHA DEV00003388 Longhand cycle options, Q67
* 01/03/02 RHA DEV00004755 Add switch for force XYZ after index
* 01/03/02 RHA DEV00004482 Set up sheet header/trailer added
* 13/11/02 RHA DEV00006432 Nexttool token in first/gen toolchange, Firsttool in
last toolchange
* 13/11/02 RHA DEV00006176 XYZ move tokens in hole cycles. $Machine changed to
SIEMENS840
* 22/11/02 RHA DEV00006698 Add CPLNAME token to Rapid after ToolChange
* 27/11/02 RHA DEV00006442 Make hole cycle expansion switchable
* 27/11/02 RHA DEV00006251 Automate subroutine abs/inc code output
* 27/11/02 RHA DEV00006476 Duplicate tools checkbox moved to set up tab
* 02/12/02 RHA DEV00006563 Change default Rapid and High Feed values
* 20/02/03 RHA DEV00007049 Make Exact stop properly switchable
* 21/02/03 RHA DEV00007249 Add hole cycle control switches
* 12/03/03 RHA Correct default settings for above
* 02/07/03 RHA DEV00008021 Add text case switch
* 11/08/03 RHA Various Make additional tokens available
* 13/08/03 RHA DEV00007955 Force feedrate at start of subroutine #FORCEFEED
* 13/08/03 RHA DEV00007537 TLO options as for CRC
* 22/08/03 RHA DEV00008536 Improve CRC warnings
* 26/08/03 RHA DEV00008539 Add warning counter
* 27/08/03 RHA DEV00007609 ToolChange & Home setting Option
* 04/12/03 RHA DEV00007048 Add Rigid Tapping Option
* 05/12/03 RHA DEV00007400 Option to force XYZ on full circle
* 05/12/03 RHA DEV00007045 Table clamp codes and tokens
* 15/12/03 RHA DEV00009612 Add new date tokens
* 10/02/04 RHA DEV00007045 Reposition setvars into macro
* Version 9
* 19/07/04 RHA DEV00011202 Set bulge check parameters in START
* Version 9.5
* 18/11/04 RHA DEV00011790 Document double call for Rapid to ToolChange
* 01/12/04 RHA DEV00011681 Additional mill tool tokens
* 08/12/04 RHA DEV00012640 Make max block number subserviant to Use Block Numbers
* 05/01/05 RHA DEV00012845 Remove duplicate tooltype setting
* 19/01/05 RHA DEV00012616 Correct HOLD setting for initial home position
* Version 9.75
* 03/03/05 RHA DEV00007742 Add stub for CODECON_THREAD_CYCLE
* 10/03/05 RHA DEV00012923 Set #XTOOLREF etc. for tool change position offset
* 11/03/05 RHA DEV00012923 Set HOLD vars to HOME in START macro
* 14/03/05 RHA DEV00012923 Correct axis reversal of Home setting
* 30/03/05 RHA DEV00012923 Corrections
* Version 10.0
* 15/06/05 RHA DEV00012923 Correct use of ZSUB etc
* 08/07/05 RHA DEV00014063 Correct max block setting
* 04/10/05 RHA DEV00012923 Move initial position setting to PT_INIT_POSITION and
fix
* Version 11.0
* 03/08/06 RHA DEV00017814 Add WORKGCODE token to Rapid Home & Rapid TC
* Version 12.25
* 03/12/07 RHA DEV00021534 Enable longhand tapping
*************************************************************************
* Machine Specific variables
*
* For Polynomial Interpolation End points EX,EY,EZ Coeffs AX,BX etc
* %DECLARE=$SPLINESTART
*
* Tokens for Polynomials - Trailng brackets
*< Siemens Spline : Subfunct Value [SUBFUNCT=29]>
* Set end positions
* Set X Y Z coords for HOLD
* Check for zero length move
* Set X Coefficients
* Set Y Coefficients
* Set Z Coefficients
* %IF $SPLINESTART=1 %THEN %CALL=CODECON_SPLINE_START:$SPLINESTART=0:%GOTO @END
* %CALL=CODECON_SPLINE
*** Machine parameters
*
*
***********************************************************************************
*******************
* Gcodes 20
30 35 40 45
* Mcodes
*
*********************************
* Gears and Spindle speeds
*********************************
*
* numgears,min_rpm1,maxrpm1,usermax1,min_rpm2,max_rpm2,usermax2,....
*Scodes - steps,smin1,smax1,smin2,smax2,.....
*** Start/End macros
*
* *************************************************************
* * Template Dependant Language extensions for Code Wizard *
* *************************************************************
*
*************************************************
* Tab Name : General G-Codes
*************************************************
*************************************************
* Tab Name : Hole Cycle G-Codes
*************************************************
*************************************************
* Tab Name : Datum G-Codes
*************************************************
********************************************
* Tab Name : M-Codes
********************************************
* Software imposes limit of 5 ranges at present
* Setvar^DATA2(40)^44^M-Codes^REAL^Gear 5
* Setvar^DATA2(41)^45^M-Codes^REAL^Gear 6
* Initialisation system and user defined variables
*
*
* Retrieve from MM & MT lines
*
* To avoid call in Procmill.cgi
*
********************************************
* Tab Name : Program Defaults
********************************************
*
*************************************************
* Tab Name : NC File General *
*************************************************
****************************************************************
* Tab Name : Setup Sheet
****************************************************************
*************************************************
* Tab Name : Block Numbers
*************************************************
*************************************************
* Tab Name : Rapid Traverse
*************************************************
*************************************************
* Tab Name : Circular Interpolation
*************************************************
*************************************************
* Tab Name : Cutter Compensation
*************************************************
*************************************************
* Tab Name : Hole Cycles
*************************************************
*************************************************
* Tab Name : Subroutines
*************************************************
*************************************************
* Tab Name : Tool Change
*************************************************
***********************************************************
* Tab Name : Multi-plane / Rotary Milling
***********************************************************
*Setvar^#WRAPTYPE^1^Multi-Axis (Rotary)^LIST^Program Wrap Distance
as^1^Radius^Diameter
***********************************************************************************
********
* Modal Variables
* Multi-plane (3axis + Index)
* Rotary milling (4axis)
*
* Not configurable by the Code Wizard
*
***********************************************************************************
**********
***********************************************************************************
*********
*
*PRECISION=#INCR-(#INCR/100)
* Rotary Axes offset e.g. zero programmed as 90 degrees
* Note #incrxyz is current abs/inc setting
* #incrxyzhold is main program setting
* #incrsubs is subroutine setting
*
*
*
* *****************************************
* * Tab Name : Program Start *
* *****************************************
*
* Note ! Cannot be a procedure because %SUBROUTINE must be defined in the START
or END macros
*
* Set initial value for spline control
* $SPLINESTART=1
* Rotary Axes set to zero for start of program
**#ROTHOLD=0
* 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 *
* *****************************************
*
*%CANCEL=#XMOVE,#YMOVE,#ZMOVE,#FEED,#COOL
*
* *********************************************
* * Tab Name : Linear Interpolation *
* *********************************************
*
*
* *************************************************
* * Tab Name : Circular Interpolation Clw *
* *************************************************
*
*
* *************************************************
* * Tab Name : Circular Interpolation CClw *
* *************************************************
*
*
* *************************************************
* * Tab Name : Polynomial Interpolation start *
* *************************************************
*
* No GCode in POLY block
* Set trailing brackets null if coefficients not output
*Force G code in next block
*
* *************************************************
* * Tab Name : Polynomial Interpolation continue *
* *************************************************
*
*****
*
** NOTE - [ ] in Default sequence gives load time errors but compiles correctly
*
*****
* No GCode in POLY block
* Set trailing brackets null if coefficients not output
*Force G code in next block
**
* *****************************************
* * Tab Name : Dwell *
* *****************************************
*
*
* *****************************************
* * Tab Name : Cutter Compensation *
* *****************************************
*
*
*
* *************************************************
* * Tab Name : Cancel Cutter Compensation *
* *************************************************
*
*
* *************************************************
* * Tab Name : Drill Cycle *
* *************************************************
*
*
*
* *************************************************
* * Tab Name : Counterbore Cycle *
* *************************************************
*
*
*
* *************************************************
* * Tab Name : Peck Drill Cycle *
* *************************************************
*
*
*<Peck codecon DWELL [DWELL=0] >
*
* *************************************************
* * Tab Name : Tapping Cycle *
* *************************************************
*
*
* Rigid or floating
*
* *************************************************
* * Tab Name : Ream / Bore Cycle *
* *************************************************
*
*
*
* *************************************************
* * Tab Name : Bore Cycle *
* *************************************************
*
*
*
* *************************************************
* * Tab Name : Chipbreak Cycle *
* *************************************************
*
*
*
* *************************************************
* * Tab Name : Hole Cycle Points *
* *************************************************
*
*
*Check for multi level cycle points
*
* *************************************************
* * Tab Name : Cancel Canned Cycle *
* *************************************************
*
*
*
* *****************************************
* * Tab Name : First Toolchange *
* *****************************************
*
*
* *****************************************
* * Tab Name : General Toolchange *
* *****************************************
*
*
* *****************************************
* * Tab Name : Last Toolchange *
* *****************************************
*
*
* *****************************************
* * 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 : Rapid To Toolchange *
* *****************************************
*
*
* *********************************************
* * Tab Name : Rapid After Toolchange *
* *********************************************
*
*
* *****************************************
* * Tab Name : Rapid To Home *
* *****************************************
*
*
* *************************************************
* * Tab Name : Translate *
* *************************************************
*
*^[DELETE]^[BLKNUM]^[PRESETGCODE]^[XINC]^[YINC]
*
*
* *************************************************
* * Tab Name : Set Work Datums *
* *************************************************
*
*[DELETE]^[BLKNUM]^[WORKREGISTER]^[XABSORIGIN]^[YABSORIGIN]^[ZABSORIGIN]^
*
*
* *************************************************
* * Tab Name : Select Work Datums *
* *************************************************
*
*
* Datum Shift- no rotary motion, called from Datum Shift and Index Pallet
commands
* Assumes exclusive use of Absolute OR Incremental i.e. Tokens used
accordingly.
* Index Pallet with Rotary output via Index table Code Constructor.
*
*
* *************************************************
* * Tab Name : Subroutine Start *
* *************************************************
*
*
* *************************************************
* * Tab Name : Subroutine Call *
* *************************************************
*
*
* *************************************************
* * Tab Name : Subroutine End *
* *************************************************
*
*
* *************************************************
* * Tab Name : Warnings *
* *************************************************
*
* Following code constructors for MPL support only
*
* *************************************************
* * Tab Name : Index Table *
* *************************************************
*
*
* *************************************************
* * Tab Name : Select Rotary / Planar Mode *
* *************************************************
*
* *************************************************
* * Tab Name : Reset Rotary Datum *
* *************************************************
*
* *************************************************
* * Tab Name : Wrap Height *
* *************************************************
*
*** Format table
*** End of include file B:\Pams\cam\machdef\template\M-SIE840.CGI ***
*** Start of include file MPLPROC.CGI ***
*************************************************************************
* Machine independant Code Generator include file *
* *
* Filename: MPLPROC.CGI *
* Author: ADM (Derived from 3AXM-FAN.CGS -r1.41 *
* and 3AXM-HH.CGS -r1.25) *
* Date: 6th December 1996 *
* *
*************************************************************************
* Change History *
* 11/11/97 ADM - Rewrite PT_ROTARY_AXES and associated procedures *
* so that Reverse Axis and Start At settings affect *
* Rotary moves (db10246 and db10358) *
* 23/02/98 ADM - Add option to allow combined rotary/multiplane *
* angular output to prevent additional moves (db10683)*
* *
* Oct 98 RHA Mods to sort out indexing (DB 10885, 11016 ) *
* Rot_hold now uses rot1 rot2 instead of #rot1 #rot2 *
* #rotindex no longer used *
* #index no longer used to jump direction sorting *
* PT_ROTARY_AXES procedure restructured *
* Procedures merged, #ROT, #ROTHOLD, #ROTDIR not used *
* New flag : #REVANGDIR - reverse direction of 0-360 *
* New flag : #MACHTYPE - No of axes (sw9) indicator *
* Remove WRAPHOLD=#FUNNY setting - Macro 44 *
* 21/10/98 RHA Wrapheight calculation for FADAL made local *
* WRAPHOLD setting moved to before codecon call *
* 11/11/98 RHA Debug text <*** NEITHER ***> removed. (db11091) *
* (%PROCEDURE=PT_CHECK_AXIAL_RADIAL) *
* 12/11/98 RHA Correction to #ROT1HOLD,#ROT2HOLD & Direction *
* 17/11/98 RHA Correction to Rotary Angle processing *
* (duplicate angles pass through modification process)*
* 23/11/98 RHA DB10885 - Added further test for duplicate angles *
* (PT_INDEX_HANDLER) *
* 25/11/98 RHA DB10885 - Safety setting of #ROT1 #ROT2 added to *
* PT_ROTARY_AXES in case of direct calls *
* Needed for HH and H4X templates *
* + Out of date Debug comment removed (PT_ROTARY_AXES)*
* & Commented-out lines now removed (PT_ROTARY_AXES) *
* Addition to PT_ROTARY_AXES for -0.0 angular output *
* 08/12/98 RHA #ROT1 #ROT2 settings removed from PT_ROTARY_AXES *
* 10/12/98 RHA Use of #ROTVALS for INDEX ROT ROTATE differentiation*
* See descriptive notes in Macro 15 (Toolchange) *
* 18/06/99 RHA Procedure trace installed, old debug removed *
* 25/06/99 RHA DB11374 Reset rotary directions after processing *
* 22/09/99 RHA DB11654 Rotary angle limit 0-360 made switchable *
* 27/09/99 RHA Remove setting of ROT-HOLD to ABS value in PT_ROTARY_AXES
* 19/05/00 RHA Skip secondary rot calcs if only one. PT__ROTARY_AXES
* 20/11/00 RHA DEV00001617 Correct shortest direction calculation PT__ROTARY_AXES
* 22/06/01 RHA DEV00003171 Correct Index angle Processing
* and procedure termination PT_Rotary_Axes
* 12/09/01 RHA DEV00003687 Unused lines removed from PT_ROTARY_AXES
* 12/09/01 RHA DEV00003686 Set #ROTVALS=1 in macro45 (Move angular)
* 01/03/02 RHA DEV00004755 Make cancel XYZ move switchable in PT_INDEX_HANDLER
* 15/05/02 RHA DEV00005448 Add angular range option - +/-180
* 15/05/02 RHA DEV00005454 Allow incremental angular moves
* 30/05/02 RHA DEV00003830 Add Incremental in Rotary option
* 02/12/02 RHA DEV00006698 Save CPL name for use in Rapid after ToolChange
* 24/06/03 RHA DEV00008005 Correct incremental rotary angles
* Version 9.75
* 25/02/05 RHA DEV00013132 Add #MACRO settings to rotary macros
* 10/03/05 RHA DEV00012923 Do not use XSUB etc for tool change position offset
* 15/07/05 RHA DEV00014446 Correct angle processing for Index (datum shift)
* Version 11.5
* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable
*************************************************************************
*****************************
* Rotary Milling Macros *
*****************************
* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning
* Check for incremental
*Set For incremental in rotary
* Reset incremental
* <*49 ROT1= [#ROT1=24] >
* <*49 ROT1= [#ROT1=24] >
*Check for angular move
*#MOVE=0
*%IF ROT1<>#ROT1HOLD %THEN #MOVE=#MOVE+1
*%IF ROT2<>#ROT2HOLD %THEN #MOVE=#MOVE+1
*%IF #MOVE<>0 %THEN
* Processes Radial Arcs
* Processes Radial Arcs
*****************************
* Rotary Procedures *
*****************************
*
* Purpose : Process Radial Arc moves
*
* Called from Macros ANGCLW and ANGCCLW
*
* If Clockwise process via Clockwise Code Constructor otherwise via the
CounterClockwise Code Constructor.
* Purpose : To determine whether Orientation is Axial or Radial
*
* Called from Index when Ortation has occurred
*
* Purpose : To determine whether X or Y is the Linear axis
*
* Used when assigning XYPOINT() for Drilling : See %Procedure=Pt_Convert_Coords
*
* Save CPL ID
* Set absolute values
*Set rotation variables
* Set CPL offset for moves to Home and TC
*Check for datum reset only
* Rotary moves
* Only datum shift, angles unchanged
*****************************************************************
* Trap null moves with differing direction sign DB10885/11016
******************************************************************
*Set ROT Hold values
* If range is +/-180, trap unset condition
*Check Compatibility - in case both check boxes selected.
*Initially process as unsigned absolute
* If Sign indicates direction then force angle in 0-360 range
*PRIMARY AXIS
* Set Increment
* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2
* Reset Primary within 0-360
* Check for no rotation
*Calculate the direction of rotation
* Asssign Mcode for direction of rotation
* Apply angular offsets
* Reset Primary within 0-360 again
* Reverse direction of 0 -> 360 if required
* 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 directions
*Counter Clockwise
* Set sign and reverse if required
*SECONDARY AXIS
* Set Increment
* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2
* Reset secondary within 0-360
* Check for no rotation
*Calculate the direction of rotation
* Asssign Mcode for direction of rotation
* Apply angular offsets
* Reset secondary within 0-360 again
* Reverse direction of 0 -> 360 if required
* Reset seondary 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 directions
*Counter Clockwise
* Set sign and reverse if required
*Reset directions to #Funny
* 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
*** End of include file B:\Pams\cam\machdef\template\MPLPROC.CGI ***

You might also like