romi discovery 760 fanuc21i 4 eixos

Upload: renato-simoes

Post on 03-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    1/39

    *************************************************************************** Machine independant Code Generator include file** Filename: mill-initialise.cgi* Author: RHA* Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template **************************************************************************** Change History* Version 10.5* FIRST ISSUE* 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle* 27/02/06 RHA DEV00016236 Spindle control fixes* 10/03/06 RHA DEV00016621 Add TNC movement code token* 16/03/06 RHA DEV00016660 Change to IF tokens for TNC Datum Shifting* Version 10.75* 11/05/06 RHA DEV00017093 Variables in user tokens USER11 onwards* 16/05/06 RHA DEV00017213 Correct index handling for no rotation cases* Version 11.0* 01/08/06 RHA DEV00017818 Hole cycle clearance and level options IF token* 01/08/06 RHA DEV00017490 Make spindle start warning optional* 04/08/06 RHA DEV00017771 Number of turns token for ISO

    * Version 11.5* 20/09/06 RHA DEV00017909 Expand trace options* 26/10/06 RHA DEV00018471 HPCC improvements* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable* 08/01/07 RHA DEV00018930 Make ZSAFE value available as a token for hole cycles* Version 11.75* 30/04/07 RHA DEV00019883 Tokens etc for Euler angles in Index output* 14/05/07 RHA DEV00019985 Tokens for XINC etc., improve XABSORIGIN Description* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls* Version 12.00* 10/08/07 RHA DEV00020285 Add new ISO Datum Shift Tokens* 25/09/07 RHA DEV00021119 Add setvars and tokens for pivot mode control

    * 27/09/07 RHA DEV00021119 Give pivot code its own format entry* Version 12.25* 18/10/07 RHA DEV00021382 Correct use of #TMP - #COMPTEMP* 04/12/07 RHA DEV00021534 Enable longhand tapping* Version 12.50* 17/01/08 RHA DEV00022021 Incremental option for Z Clear* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings* 22/01/08 RHA DEV00022142 Clearance options applied to all clearance tokens* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL* Version 2009.1* 14/04/08 RHA DEV00018979 Correct BNUM reset* 07/07/08 RHA DEV00023548 Implement NC Code Suppression* 06/08/08 RHA DEV00024310 Back bore and face in milling

    * 06/08/08 RHA DEV00023786 Add tool group and ID tokens* 11/08/08 RHA DEV00024364 Implement helical hole cycles* 21/08/08 RHA DEV00024504 Probing tokens for ISO machines* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction* 10/09/08 RHA DEV00024504 Probe token corrections* 24/09/08 RHA DEV00024855 Correct spindle direction in back bore longhand* 07/10/08 RHA DEV00025129 Longhand back bore cutting in M5 spindle stop mode******************************************************************************************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    2/39

    **************************************************************************** SPLINE OUTPUT***************************************************************************** NC Output control for PCIs (ECS2700)* Block Numbering* G (preparatory) codes* Circular Interpolation* Spindle / Gears* General Coordinate Systems* Rapid Traverse* Hole Cycles* Toolchange / Tooling* Subroutines* Cutter Radius Compensation** Datum Shifting* #RECORD* Multi-plane / Rotary* M-FUNCTIONS*Thread Mill* Variables for Thread Mill canned cycle*Extra Variables for TNC************ Check useage and remove if not required

    *User variables for** Constants for start of G function in DATA1 & M function in DATA2 statements***** ********************************** Tokens - Use in Code Constructor* ***********************************

    * G-Codes* M Codes* General* Toolchange / Tooling* Rapid to Home or ToolChange* Cutter Radius Compensation* Circular Interpolation* Hole Cycles* Added for Sinumerik840 & Fadal cycles* Datum Shift : Translate / Index* Origin shift for TNC** Datum shift for ISO

    * Tooling Sheet / Program Information* Subroutines* By block number* Position : Before, after, in-line with main NC Program* Datums* Rotary Axes / Milling* 5 Axis IKJ* Pivot options* Spline Output* Fanuc specific

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    3/39

    * Heidenhain specific* Tap cycle tokens for different addresses* Thread Mill Canned Cycle************************************************************ Job Record Tokens*********************************************************************************************************************** User tokens for************************************************************ Heidenhain TNC Only* modal lines in Drill Cycle Modify* Euler angles for Workplane* Tokens for back bore cycles* Tokens for Helical cycles* Tokens for tool group and ID* Tokens for Probing* One token for depth #BOREBOSSZDEPTH #WEBPOCKETZDEPTH #4THAXISZDEPTH************************************************************ M-Functions (Used to create default Code Constructor)************************************************************************************************************************************** Machine independant Code Generator include file** Filename: mill-iso-mach-mm.cgi

    * Author: RHA* Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template **************************************************************************** Change History* Version 10.5* FIRST ISSUE* 16/12/05 RHA DEV00015566 Spline output enabled* 20/02/06 RHA DEV00016344 New MM line switch for 5 axis IJK* 02/03/06 RHA DEV00016506 Change default Home and Tool Change locations* 07/03/06 RHA DEV00015555 High Speed mode tolerance

    * Version 11.0* 18/07/06 RHA DEV00017692 Tidy Code Generator options in hole macros* 28/07/06 RHA DEV00017797 New MM and MT line switches* 07/08/06 RHA DEV00012241 Add High speed and coolant controls to Tool Change** 08/08/06 RHA DEV00017341 Correct Tool Length Offset setting* 13/09/06 RHA DEV00018145 Correct High Speed Mode Q var macro setting* Version 12.00* 03/04/07 RHA DEV00020278 Allow Macro15 access to USERVAR2* Version 12.50* 06/02/08 RHA DEV00022190 Set default helical interpolation* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL* Version 2009* 06/08/08 RHA DEV00024310 Back Bore Cycles Q205

    * 13/08/08 RHA DEV00024364 Helical Hole Cycles Q205************************************************************************************************************************* Setting up spindle defaults*********************************************** Code Generator Options* Tapping Modifiers* Longhand^No^Yes* CRC Register* Work Datum Override

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    4/39

    * Tap Cycle Type^Floating^Rigid* Tap CycleTap Cycle^Right Hand^Left Hand*Chord Enter chord length for arc splitting*Full Canned Cycle* High speed tolerance* High Speed Mode^Off^On* Coolant^Off^Flood^Mist* Tool Length Offset******************************************************************************************************** Gcodes 20

    30 35 40 45* Mcodes**************************************************************************** Machine independant Code Generator include file** Filename: mill-default-kt.cgi* Author: RHA* Date: 11 November 2005** New file for adaptive milling templates**************************************************************************

    * Change History* Version 10.5* FIRST ISSUE* 13/03/06 RHA DEV00016683 Alter horizontal machine width* Version 11.75* 23/04/07 RHA Change gantry default size*************************************************************************** Base=Height, Width, Length, Thickness* Mount=Length,Width,Height would be used in case of trunnion table*lower mount would be used as the default mount*side mount is for machines with a vertical mount*saddle mount is for machines with a saddle* Table=Length, Width, Height, Lead, Angle, Radius

    * the line below is used for table in case of horizontal machines with B primaryaxis* Head=Type,Length, Width, Height,Lead, Angle,Protrusion Length,Protrusion Width,Protrusion Ht,SpindleLocation* Head=Type,Length, Width, Height,Protrusion Length,Protrusion Width,ProtrusionHt* KTTILTTABLE Length, Width, Height, Lead, Angle, Radius* cylinder KTROTUNIT Length, Radius* KTSADDLE Length, Radius,thickness,width,height* KT Chuck Type, Length,Diameter,Bore,JawLength,JawHeight,JawWidth,Protrusion,NoJaws,NoSteps*KT ATC - Length Width Depth Lead Angle Diameter Protrusion*

    *************************************************************************** Machine independant Code Generator include file** Filename: mill-iso.cgi* Author: RHA* Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template ***************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    5/39

    * Change History* Version 10.5* FIRST ISSUE* 16/12/05 RHA DEV00015647 Add R in XY Only Option* 31/01/06 RHA DEV00012212 Align code constructor trace text* 06/02/06 RHA DEV00007742 Single helix option for Thread Mill* 10/02/06 RHA DEV00016236 Spindle control fixes* 14/02/06 RHA DEV00016311 Change index defaults* 15/02/06 RHA DEV00016297 Incremental datum shift* 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle* 24/02/06 RHA DEV00016420 Dwell token in peck drill codecon* 27/02/06 RHA DEV00016236 Spindle control fixes* 28/02/06 RHA DEV00016369 Fix Convert rapid to feed* 01/03/06 RHA DEV00016487 Set modality of inex direction M code* 02/03/06 RHA DEV00016511 G54 default format to be 2.2* 07/03/06 RHA DEV00015555 High Speed mode tolerance, Reposition ZMOVE in Rapidcodecon* 07/03/06 RHA DEV00014230 Rotation axes range correction* 14/03/06 RHA DEV00016367 Spindle control - add spindir to rapid codecon* 15/03/06 RHA DEV00015533 Add format table entries for toolstore tokens* 15/03/06 RHA DEV00015655 Add GEARMCODE token to hole cycles* 21/03/06 RHA DEV00007321 Correct Datum setting - limits* Version 10.75* 12/04/06 RHA DEV00010822 Designate logical tokens by colour

    * 12/04/06 RHA DEV00016781 Document use of UARRAY1 in template* 12/04/06 RHA DEV00016809 Colour code tokens* 20/04/06 RHA DEV00016925 Add PLANEGCODE to Rapid After ToolChange* 22/05/06 RHA DEV00017232 Add FEEDMODEGCODE for Inverse Time Feeds* Version 11.0* 25/07/06 RHA DEV00016799 Remove force output in Rapid After ToolChange* 26/07/06 RHA DEV00017767 Correct g98g99 terminology - all amachines* 01/08/06 RHA DEV00017818 Hole cycle clearance and level options* 01/08/06 RHA DEV00017490 Make spindle start warning optional* 03/08/06 RHA DEV00017814 Add WORKGCODE token to Rapid Home & Rapid TC* 04/08/06 RHA DEV00017771 Number of turns token for ISO* 24/08/06 RHA DEV00017771 Suppress P0 in helix* Version 11.5

    * 20/09/06 RHA DEV00017909 Expand trace options* 26/10/06 RHA DEV00018471 HPCC improvements* 03/11/06 RHA DEV00018471 ToolChange HPCC call should only be via a token* 21/12/06 RHA DEV00018873 Call 5 axis off at end if still active* 04/01/07 RHA DEV00018873 5 Axis cancel, correct for 3 axis machines* 08/01/07 RHA DEV00018930 Make ZSAFE value available as a token for hole cycles* 07/02/07 RHA DEV00018471 Correct Highspeed output in CORE TC* 07/02/07 RHA DEV00018873 try again* Version 11.75* 30/04/07 RHA DEV00019883 Tokens etc for Euler angles in Index output* 14/05/07 RHA DEV00019985 Tokens for XINC etc.* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls* 29/05/07 RHA DEV00019981 Force longhand holes in mc coords

    * Version 12.00* 09/08/07 RHA DEV00020648 Implement pitch suppression in ISO mill* 10/08/07 RHA DEV00020285 Add new ISO Datum Shift Tokens* 25/09/07 RHA DEV00021119 Add setvars and tokens for pivot mode control* 27/09/07 RHA DEV00021119 Give pivot code its own format entry* Version 12.25* 03/12/07 RHA DEV00021534 Enable longhand tapping* Version 12.50* 17/01/08 RHA DEV00022021 Incremental option for Z Clear* 04/02/08 RHA DEV00016982 Make tool user tokens available in tool set up

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    6/39

    * 18/02/08 RHA DEV00022063 Fix single helix and tidy call structure* Version 2009.1* 14/04/08 RHA DEV00023113 Feed after ToolChange code constructor added* 08/05/08 RHA DEV00020490 Add new hole depth option. Incremental from Retract* 06/08/08 RHA DEV00024310 Back bore and face in milling* 06/08/08 RHA DEV00023786 Add tool group and ID tokens* 07/08/08 RHA DEV00023786 Format table entries for Tooling tokens* 11/08/08 RHA DEV00024364 Implement helical hole cycles* 20/08/08 RHA DEV00024474 Add Feed Type setting to toolchange* 26/08/08 GST DEV00022751 Thread mill depth in canned cycle, RHA-added set variables* 26/08/08 RHA DEV00021410 Thread mill token values* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction* 11/09/08 RHA DEV00024662 Fix ASIN error in thread mill canned cycle* 11/09/08 RHA DEV00024504 Probing format table* 16/09/08 RHA DEV00024824 Format helical tokens with decimal part* 16/09/08 RHA DEV00024845 Remove duplicate token from back bore* 24/09/08 RHA DEV00024504 Format table changes requested* 24/09/08 RHA DEV00024855 Correct spindle direction in back bore longhand* 01/10/08 RHA DEV00024310 Add format Table entries for back bore*************************************************************************** ************************** * Template Notes Area ** *************************

    * Notes must be defined outside of all procedures using the following syntax* Text is displayed in the machine NOTES area of the CGD* Length limit** ************************************************************** * Template Dependant Language extensions for Code Wizard ** *************************************************************************************************************** Tab Name : General G-Codes*************************************************

    ************************************************** Tab Name : Hole Cycle G-Codes*************************************************************************************************** Tab Name : Datum G-Codes************************************************** Setvar^DATA1(25)^54^Datum G-Codes^REAL^Work Coord System 1* Setvar^DATA1(26)^55^Datum G-Codes^REAL^Work Coord System 2* Setvar^DATA1(27)^56^Datum G-Codes^REAL^Work Coord System 3* Setvar^DATA1(28)^57^Datum G-Codes^REAL^Work Coord System 4* Setvar^DATA1(29)^58^Datum G-Codes^REAL^Work Coord System 5* Setvar^DATA1(30)^59^Datum G-Codes^REAL^Work Coord System 6********************************************

    * Tab Name : M-Codes************************************************************************************************ Tab Name : More Hole Cycle G-Codes*************************************************************************************************** Tab Name : Coolant Control*************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    7/39

    ************************************************** Tab Name : New Datum Setting*************************************************************************************************** Tab Name : NC File General ******************************************************************************************************************* Tab Name : Setup Sheet****************************************************************************************************************** Tab Name : Block Numbers*************************************************************************************************** Tab Name : Rapid Traverse************************************************** Setvar^#RAPIDFEEDRATE^5000^Rapid Traverse^REAL^Highfeed (units/min.)************************************************** Tab Name : Circular Interpolation*************************************************************************************************** Tab Name : Cutter Compensation*************************************************************************************************** Tab Name : Hole Cycles

    ************************************************** Setvar^#ORTHCYCLES^0^Hole Cycles^YESNO^Allow Canned Cycle On Orthogonal Planes************************************************** Tab Name : Thread Mill Cycle************************************************** Setvar^#ORTHMILLCYCLES^0^Thread Mill Cycle^YESNO^Allow Canned Cycle On Orthogonal Planes************************************************** Tab Name : Subroutines*************************************************************************************************** Tab Name : Tool Change*************************************************

    ************************************************************ Tab Name : Multi-plane / Rotary Milling************************************************************ Setvar^#AXISTYPE1^2^First Rotary Axis^LIST^Axis Mounted In^1^Head^Table************************************************************ Workplane definition*********************************************************************************************************************** Tab Name : 4-5 Axis Machining****************************************************************************************************************************************************** Modal Variables

    ***************************************************************** Tab Name : Debug********************************************************************************************************************************* G Code 5 Axis** ****************************************** * Tab Name : Program Start ** ******************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    8/39

    * Note ! Cannot be a procedure because %SUBROUTINE must be defined in theSTART or END macros** Rotary Axes set to zero for start of program*$DEBUG=Y****************************************************************************************************************** Note ! Cannot be a procedure because %SUBROUTINE must be defined in theSTART or END macros* ************************************************** Code constructors* ************************************************** ************************************************** * Tab Name : Set-Up / Tooling Sheet ** ***************************************************** Setup sheet header if requested (not in loop)** Remove duplicate tools from Tool Sheet** Setup sheet trailer if requested (not in loop)*

    ** ************************************************** * Tab Name : Set Tooling Data** **************************************************** ****************************************** * Tab Name : Rapid Move ** ******************************************* Output speed block ?*

    * ********************************************** * Tab Name : Linear Interpolation ** *********************************************** Output speed block ?** ************************************************** * Tab Name : Circular Interpolation ** *************************************************** 2D only, blank unwanted values* Output speed block ?* Enables control of multi-helix block for TNC

    * Call to get number of turns* Output speed block ?* Suppress number of turns if 0** ****************************************** * Tab Name : Dwell ** ******************************************** *****************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    9/39

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

    * Output speed block ?** ************************************************** * Tab Name : Peck Drill Cycle** **************************************************** Output speed block ?** ************************************************** * Tab Name : Tapping Cycle*

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

    * Output speed block ?** ************************************************** * Tab Name : Bore Cycle** **************************************************** Output speed block ?*

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    10/39

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

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

    ** ************************************************** * Tab Name : Thread Mill Cycles ** **************************************************** Number of turns* Output speed block ?* Set values direct from macro* Set mode flags* Climb or Upcut** *************************************************

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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    11/39

    * ***************************************************** ****************************************** * Tab Name : First Toolchange ** ******************************************* Output speed block ?** ****************************************** * Tab Name : General Toolchange ** ******************************************* Output speed block ?** ****************************************** * Tab Name : Last Toolchange ** ******************************************* Output speed block ?** ****************************************** * Tab Name : Core Toolchange *

    * ******************************************** ****************************************** * Tab Name : 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 ** *****************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    12/39

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

    ** ****************************************** * Tab Name : Rapid To Toolchange ** ******************************************* Output speed block ?** ********************************************** * Tab Name : Feed After Toolchange ** *********************************************** Output speed block ?*

    * ********************************************** * Tab Name : Rapid After Toolchange ** *********************************************** Output speed block ?** ****************************************** * Tab Name : Rapid To Home ** ******************************************* Output speed block ?**

    * ************************************************** * Tab Name : Set Work Datums** ***************************************************** ************************************************** * Tab Name : Select Work Datums*

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    13/39

    * **************************************************** Datum Shift- no rotary motion* Called from Datum Shift and Index Pallet commands for Absolute Datum setting* Index Pallet with Rotary output via Index Pallet Code Constructor.*** Datum Shift- no rotary motion* Called from Datum Shift and Index Pallet commands for Incremental Datum setting* Index Pallet with Rotary output via Index Pallet Code Constructor.*** ************************************************** * Tab Name : Subroutine Start** **************************************************** ************************************************** * Tab Name : Subroutine Call** *************************************************

    *** ************************************************** * Tab Name : Subroutine End** *************************************************** ************************************************** * Tab Name : Translate** ***************************************************

    ** ************************************************** * Tab Name : Spline Parameter** *************************************************** Following code constructors for MPL support only** ************************************************** * Tab Name : 5 axis mode ** ***************************************************

    * ************************************************** * Tab Name : Index Table ** **************************************************** ************************************************** * Tab Name : Index Head ** *************************************************** Sequence Definition^Index Head^-1^Multi-Axis (Rotary)

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    14/39

    * Use Tokens^DELETE^BLKNUM^PRESETGCODE^WORKGCODE^XABSORIGIN^YABSORIGIN^ZABSORIGIN^CPLNAME* Use Tokens^REAR_ANGLE^FRONT_ANGLE^WORKREGISTER^ROTATE CLW/CCLW^T-CLAMP-ON^T-CLAMP-OFF* Use Tokens^USER-STRING^USER-STRING-1^USER-STRING-2^USER-STRING-3^USER-STRING-4^USER-STRING-5* Use Tokens^USER-1^USER-2^USER-3^USER-4^USER-5^USER-6^USER-7^USER-8^USER-9^USER-10* Use Tokens^USER-11^USER-12^USER-13^USER-14^USER-15^USER-16^USER-17^USER-18^USER-19^USER-20* Default Sequence^[DELETE]^[BLKNUM]^[T-CLAMP-OFF]* ENDIF* IF TEMPLATE=4AXMILL* Default Sequence^[DELETE]^[BLKNUM]^[WORKGCODE]^[REAR_ANGLE]^(^[CPLNAME]^)* ENDIF* IF TEMPLATE=MPLMILL^5AXMILL* Default Sequence^[DELETE]^[BLKNUM]^[WORKGCODE]^[REAR_ANGLE]^[FRONT_ANGLE]^(^[CPLNAME]^)* ENDIF* IF TEMPLATE=MPLMILL^4AXMILL^5AXMILL* Default Sequence^[DELETE]^[BLKNUM]^[T-CLAMP-ON]** ************************************************** * Tab Name : Select Rotary / Planar Mode *

    * *************************************************** ************************************************** * Tab Name : Reset Rotary Datum** *************************************************** ************************************************** * Tab Name : Wrap Height** *************************************************** Dummy procedures

    *** Format table* Note token numbers 0-14 should not be changed* 10 is null output for initialisation of variables.* FT_SECONDARYROT2, A,3,2,640,4,2,640, 50 Head - Secondary Setting*************************************************************************** Machine independant Code Generator include file** Filename: mill-Iso-Probing.cgi* Author: Sam Haslar / RHA* Date: 22 August 20085** New file for adaptive milling templates derived from earlier multiplane template *

    *************************************************************************** Change History* Version 2009.1* FIRST ISSUE* Change output procedures to code constructors* Change macro numbers to 301 series after discussion with SJO* Remove command details* 26/08/08 RHA Update logic to latest received mac file* 11/09/08 RHA Update logic to latest received mac file* 16/09/08 RHA Trailing comma - macro 304 definition

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    15/39

    * 18/09/08 RHA Incorporate latest logic changes from Sam Hasler* 24/09/08 RHA DEV00024504 Code constructor formatting changes* 01/10/08 RHA DEV00025060 Force distance positive on 4th axis probe cycles* Version 2009.1 SP* 01/10/08 RHA DEV00025318 Correct datum setting for probe cycles************************************************************************************** prototype probing macros*************************************************************************************** This file implements the following cycles:** Feed:* 1 Move probe* Bore/Boss:* 2 Bore 3 Point* 3 Boss 3 Point* 4 Bore 4 Point* 5 Boss 4 Point* Surface:* 6 Probe Surface* 7 Angled Single surface* Web/Pocket

    * 8 Probe Web/Pocket* 9 Angled Web / Pocket* Internal/External Corner:* 10 Internal Corners* 11 External Corners* 4th Axis:* 12 4th Axis X* 13 4th Axis Y** Modifier 250 mapped to system variable 62 (PATHTRACE) will be set to oneof the above cycle numbers*********************************************************************************

    ****** Notes*************************************************************************************** Find and count (possible) format table references* grep -E "=[0-9]+\]" ..\ext\VAB-probe.mxt |sed 's/^.*=\([0-9]\+\)\].*$/\1/g' | C:\cygwin\bin\sort -n | uniq -c** machdef\error.mpp** Probing entries in Format Table start at Line 3455 of VAB-probe.mxt********************************************************************************

    ****** Internal Variables - NOT exposed to Code Wizard users************************************************************************************** All Cycles (except cycle 1)* Cycles 2, 3, 4 & 5* Cycle 6* Cycle 8*************************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    16/39

    * Tokens for Code Wizard:************************************************************************************** %DECLARE=#BOREBOSSZDEPTH* %DECLARE=#WEBPOCKETZDEPTH* Cycles the Token is output for.Below are the Renishaw Inspection Plus definitions of these inputs.* #FEEDX 1 X = The target positions for the probe positioning move.* #FEEDY 1 Y = Thetarget positions for the probe positioning move.* #FEEDZ 1 Z = Thetarget positions for the probe positioning move.* #TRX 6 | | | X = The surfaceposition or size.* 8 | | X = Nominal size of feature when measured in the X-axis.* 10 11 X = c.* #TRY 6 | | | Y = The surfaceposition or size.* 8 | | Y = Nominal size of feature when measured in the Y-axis.* 10 11 Y = Nominal corner position Y-axis.

    * #TRY 6 Z = The surfaceposition or size.* #FEEDRATE 1 * * * * * * * * * * * * F = The modal feedrate for all protected positioning moves. The feedrate will be modal to this macro and subsequent feedrate calls are unnecessary unless a change of feedrate is required. The maximum safe fast feedrate established during installation should not be exceeded.*(Note: Cycle 1 is called before and after all the other cycles to perform linking moves)** Feedrate passed to all cycles for TNC support* #AngleA 2 3 A = The

    first angle for vector measurement, measured from the X+ axis direction.* #ANGLE 7 | A = Direction ofprobe measurement measured from the X+ axis direction.* 9A = Angle of the surface to be measured from the X+ axis direction.* #AngleB 2 3 B = Thesecond angle for vector measurement, measured from the X+ axis direction.* #AngleC 2 3 C = Thethird angle for vector measurement, measured from the X+ axis direction.* #DIAMETER 2 3 4 5 D = Nominal sizeof the feature.* #DISTANCE 7 | D = Nominal distance to the surface (radial).

    * 9 D = Nominal size of the feature.* #?????X 12 X = The X-axis distance between Z1 and Z2 measurement positions.* #?????Y 13 Y = The Y axis distance between Z1 and Z2 measurement positions.* #BOREBOSSZDEPTH 2 3 4 5 Z = The absolute Z-axisposition when measuring a boss feature. If this is omitted a bore cycle is assumed.* #WEBPOCKETZDEPTH 8 9 Z = The absolute Z axis

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    17/39

    position when measuring a web feature. If this is omitted a pocket cycle is assumed.* #4THAXISZDEPTH 12 13 Z = The Z-axis expectedsurface position.* #RADCLEAR 2 3 4 5 8 9 R = This is an incremental dimension that is used in external features, e.g. bosses and webs, to give a radial clearance from the nominal target surface prior to a Z-axis move. Default = 5 mm(0.200 in).* 2 3 4 5 | | -R= This is similar to Rr, except that the clearance is applied in the opposite direction to force an internal boss cycle. Default = 5 mm (0.200 in).* 8 9 -R= Thisis similar to Rr, except that the clearance is applied in the opposite direction to force an internal web cycle. Default = 5 mm (0.200 in).* #SecondX 10 11 I = Incrementaldistance to the second probe position along the X-axis (positive value is assumed). Default = no move.* #SecondY 10 11 J = Incrementaldistance to the second probe position along the Y-axis (positive value is assumed). Default = no move.* #DATUM 2 3 4 5 6 7 8 9 10 11 12 13 S = The work offset number which will be set.*The work offset number will be updated.

    *S1 to S6 (G54 to G59)*S0 (external work offset).*S101 to S148 (G54.1 P1 to G54.1 P48) additional offsets option.*New work offset = active work offset + error.*New external offset = external offset + error.* #OVERTRAVEL 2 3 4 5 6 7 8 9 10 11 | | Q = The probe overtraveldistance for use when the default values are unsuitable. The probe will then travel beyond the expected position when it searches for a surface. Default = 4 mm

    (0.16 in) in the Z-axis, and 10 mm (0.394 in) in the X and Y axes.* 12 13 Q = The probe overtraveldistance for use when the default values are unsuitable. The probe then travelsbeyond the expected position when it searches for a surface. Default = 10 mm (0.4 in).* #TOLERANCE 2 3 4 5 6 7 8 9 H = Tolerance value of afeature dimension being measured.*Example: For dimension 50.0 mm +0.4 mm 0 mm, the nominal*tolerance is 50.2 mm with H.2.*(For dimension 1.968 in +0.016 in 0 in, the nominal tolerance is 1.976 in

    *with H.008.)*(Guy Brown's Description: Size Tolerance Alarm if incorrect size)* #POSITIONTOLERANCE 2 3 4 5 6 7 8 9 10 11 M = True position tolerance of a feature. A cylindrical zone about the theoretical position.* #UPPERTOLERANCE 2 3 4 5 6 7 8 9 10 11 U = Upper tolerance limit. If this value is exceeded there is no work offset updated and the cycle is stopped with an alarm. This tolerance is applied to both size and position where applicable. Example: U2. to set the upper tolerance limit to 2 mm.

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    18/39

    * #ANGULARTOLERANCE 10 11 | | B = Angle tolerance. This applies to both X and Y surfaces. It is equal to half the total tolerance, e.g. 0.25 degrees = B.25 tolerance.* 12 13 B = Seta tolerance on the angular position of the feature. It is equal to half the total tolerances, e.g. component dimension 45 degrees (0.25 degrees) the 4th axis would be positioned to 45 degrees and B.25 tolerance.* TODO - for Marpos / m&h* PROBETYPE* OBSTRUCTION* CORNER QUADRANT (top left, top right, bottom left, bottom right)* Macro allocation* 301 Probe_Surface* 302 Probe_Bore/Boss* 303 Probe_Feed* 304 Probe_Web/Pocket* 305 Probe_Corner* 306 Probe_4th_Axis************************************************************************************** *TODO check outut is minimal (i.e. variables only output if changed) See %OUTPUT-IF-CHANGED*

    ************************************************************************************** Move to start position for measuring moves*************************************************************************************************************************************************************************** Move to clearance plane after measuring moves*************************************************************************************************************************************************************************** Dialog: Probe Bore/Boss

    **************************************************************************************NB FEEDRATE Unused with Fanuc, included for possible TNC support* See also token mappings for each cycle*************************************%CALL=ARRAY-DUMP*%CALL=VAR-DUMP*Bore without obsticle starts at ZDEPTH (fanuc)*Bore without obsticle doesn't need ZDEPTH in gauging NC Code (fanuc)************************************************************************************** Dialog: Probe Surface********************************************************************************

    ******NB FEEDRATE Unused with Fanuc, included for possible TNC support*%CALL=ARRAY-DUMP************************************************************************************** Dialog: Probe Web/Pocket**************************************************************************************NB FEEDRATE Unused with Fanuc, included for possible TNC support* See also token mappings for each cycle

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    19/39

    *************************************%CALL=ARRAY-DUMP*%CALL=VAR-DUMP************************************************************************************** Dialog: Probe Internal/External Corner*************************************************************************************************************************************************************************** Dialog: Probe 4th Axis*************************************************************************************************************************************************************************** prototype probing code constructors*************************************************************************************************************************************************************************** CYCLE 1: Probe Feed**************************************************************************************

    ************************************************************************************** CYCLE 2: |_| - Three Point Bore*************************************************************************************************************************************************************************** CYCLE 3: || - Three Point Boss**************************************************************************************************************************************************************************************************************

    * CYCLE 4: |_| - Four Point Bore*************************************************************************************************************************************************************************** CYCLE 5: || - Four Point Boss*************************************************************************************************************************************************************************** CYCLE 6: Single Surface*************************************************************************************

    ************************************************************************************** CYCLE 7: Angled Single Surface*************************************************************************************************************************************************************************** CYCLE 8: Web/Pocket*************************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    20/39

    ************************************************************************************** CYCLE 9: Angled Web/Pocket*************************************************************************************************************************************************************************** CYCLE 10: Internal Corner*************************************************************************************************************************************************************************** CYCLE 11: External Corner*************************************************************************************************************************************************************************** CYCLE 12: 4th Axis X*************************************************************************************************************************************************************************** CYCLE 13: 4th Axis Y********************************************************************************

    ******************************************************************************** Machine independant Code Generator include file** Filename: Whiteboard.cgi* Author: RHA* Date: 09 December 2005** New file for all adaptive template*************************************************************************** Change History* Version 10.5* FIRST ISSUE

    * 14/02/05 RHA DEV00016309 Fix long lines for codecon.txt* Version 12.5* 19/02/08 RHA DEV00022469 Add note prohibiting duplicate macros and procedures*************************************************************************** ****************************************** * Tab Name : Hackers Corner ** ********************************************************************************************************************* Machine independant Code Generator include file** Filename: mill-iso-macros.cgi* Author: RHA

    * Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template **************************************************************************** Change History* Version 10.5* FIRST ISSUE* 06/02/06 RHA DEV00007742 Single helix option for Thread Mill* 28/02/06 RHA DEV00016465 Remove macro 101 - old spindle control

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    21/39

    * 03/03/06 RHA DEV00016525 Correct longhand drill output* 07/03/06 RHA DEV00015555 High Speed mode tolerance* 08/03/06 RHA DEV00016567 Use system var for work datum name override* Version 11.0* 18/07/06 RHA DEV00017692 Tidy Code Generator options in hole macros* 01/08/06 RHA DEV00017489 #Macro not set for hole cycles* 07/08/06 RHA DEV00012241 Add High speed and coolant controls to Tool Change** 08/08/06 RHA DEV00017341 Correct Tool Length Offset setting* Version 11.5* 18/07/06 RHA DEV00012692 Correct drill sub output for 1 location* 26/10/06 RHA DEV00018471 HPCC improvements* 13/12/06 RHA DEV00018738 Correction for profile start* Version 11.75* 03/04/07 RHA DEV00017611 Implement 21 flag in rotary rotate* 18/05/07 RHA DEV00017611 Change withdrawn, pending other fixes* Version 12.00* 03/04/07 RHA DEV00020278 Allow Macro15 access to USERVAR2* Version 12.25* 03/12/07 RHA DEV00021534 Enable longhand tapping* Version 12.50* 04/02/08 RHA DEV00006310 Allow canned cycles in Rotary Rotate* Version 2009.1* 07/07/08 RHA DEV00023548 Implement NC Code Suppression* 06/08/08 RHA DEV00024310 Back bore and face in milling

    * 11/08/08 RHA DEV00024364 Implement helical hole cycles* 26/08/08 GST DEV00022751 Thread mill depth in canned cycle* 16/09/08 RHA DEV00024818 Back Bore and Helical parameters - level retract etc.**************************************************************************** Force #TOOLCHANGE=#FALSE to prevent SPEEDS lookahead* Suppress CRC calls until Subfunct is set* * #ROTVALS controls use of ROT1/ROT2 values for rotary positioning* #ROTVALS=#FALSE* Only applies to Subprogram style NOT inline bloc

    k number reference.*Set HOLD values* SF201 Reverse spindle in longhand tapping************************************************************** Miscellaneous "User Defined" Macros : Reserved ** ============================================== ***************************************************************** 101 Spindle Stop/ CLW/ CCLW/ CLW+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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    22/39

    * 114 Reserved* 115 Reserved* 116 Length Offset Tool Length Offset* 117 Reserved* 118 Reserved* 119 Reserved* 120 Reserved* 121 Reserved* 122 Reserved* 123 Reserved* 124 NC Code Output Suspension On/Off* This macro allows the user to suspend NC code via a misc function* Note that it relies on MASK being reset by Code Generator for each macro call* In each macro - %IF #NCSUPPRESS=1 %THEN MASK=1* Suspend NC Code Output****************************** Rotary Milling Macros ******************************* #ROTVALS=#TRUE* Processes Radial Arcs* Processes Radial Arcs*************************************************************************** Machine independant Code Generator include file*

    * Filename: mill-procedures-basic.cgi* Author: RHA* Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template*************************************************************************** Change History* Version 10.5* FIRST ISSUE* 16/12/05 RHA DEV00014907 TLO setting* 16/12/05 RHA DEV00015647 Add R in XY Only Option* 02/02/06 RHA DEV00012705 Set radius for thread milling

    * 06/02/06 RHA DEV00007742 Single helix option for Thread Mill* 06/02/06 RHA DEV00015578 Thread mill - G40 if G01 followed by G00* 10/02/06 RHA DEV00016236 Spindle control fixes* 10/02/06 RHA DEV00016273 Fix G2/3 swap for G18/19* 10/02/06 RHA DEV00016282 Thread mill move correction* 15/02/06 RHA DEV00016297 Incremental datum shift* 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle* 27/02/06 RHA DEV00016236 Spindle control fixes* 27/02/06 RHA DEV00016320 Rapid after toolchange with thread mill canned cycle* 27/02/06 RHA DEV00016464 Force spindle code out if stop* 28/02/06 RHA DEV00016465 Correct 2D arc output in thread mill* 28/02/06 RHA DEV00016369 Fix Convert rapid to feed* 01/03/06 RHA DEV00016464 Add warning for feed moves at Spindle Stop

    * 03/03/06 RHA DEV00016525 Correct longhand drill output* 08/03/06 RHA DEV00016567 Use system var for work datum name override* 14/03/06 RHA DEV00016367 Correct spindle control* 14/03/06 RHA DEV00016464 Correction* 16/03/06 RHA DEV00016662 Suppress unwanted CRC warning* 21/03/06 RHA DEV00007321 Correct Datum setting - limits* 21/03/06 RHA DEV00012705 Correct radius in helix output for thread mill* 22/03/06 RHA DEV00016714 Remove diagnostic output line for #DATUMMAX* 24/03/06 RHA DEV00016742 Correct index codecon calls for 4 axis, #AXISTYPE2=#AXISTYPE1

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    23/39

    * 28/03/06 RHA DEV00016749 Correct subroutines processing for hole cycles* Version 10.75* 16/05/06 RHA DEV00017213 Correct index handling for no rotation cases* 18/05/06 RHA DEV00017213 Fine tune* 23/05/06 RHA DEV00017233 Correction for always use radius* 24/05/06 RHA DEV00017039 Fix spindle directions in tapping* 06/06/06 RHA DEV00017232 5 Axis check in Nomotion as well at PT_Rotary_Axes* 13/06/06 RHA DEV00017523 Prevent output of longhand tapping cycles* Version 11.0* 12/07/06 RHA DEV00017700 Set #SPEED=NEXTSPEED if SPEED unset* 25/07/06 RHA DEV00016799 Initialise tool position at toolchange and index* 26/07/06 RHA Correct NEXTZMOVE setting for reversed axes* 28/07/06 RHA DEV00017797 New MM and MT line switches* 01/08/06 RHA DEV00017818 Hole cycle clearance and level options* 01/08/06 RHA DEV00016703 Only process speed and gears if there is a change* 01/08/06 RHA DEV00017490 Make spindle start warning optional* 04/08/06 RHA DEV00017771 Number of turns token for ISO, trap and fix exact 360deg helix count* 07/08/06 RHA DEV00012241 Add High speed and coolant controls to Tool Change* 09/08/06 RHA DEV00017902 Correct thread mill helix for TNC* 11/08/06 RHA DEV00012241 Remove diagnostic line, Correct thread mill for reversed axes* 13/09/06 RHA DEV00018171 Correct initialisation of tool position after datum shift

    * Version 11.5* 25/09/06 RHA DEV00017909 Expand trace options* 12/10/06 RHA DEV00012692 Correct drill sub output for 1 location* 13/10/06 RHA DEV00018390 PT_CONVERT_COORDS* 17/10/06 RHA DEV00018409 Fix Duplicate angle reversal by Rapid to ToolChange* 03/11/06 RHA DEV00018471 ToolChange HPCC call should only be via a token* 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable* 05/12/06 RHA DEV00018738 Fix CRC calls to cancel on arc* 08/12/06 RHA DEV00018738 Correct calls in circle and intialise variables* 19/12/06 RHA DEV00018593 Set #PLANEGCODE in Thread Milling* 21/12/06 RHA DEV00018869 Remove diagnostic code* 02/01/07 RHA DEV00017909 Remove old thread mill array dump* 25/01/07 RHA DEV00019078 Correct datum over ride setting

    * 15/02/07 RHA DEV00017338 Correction to CPL name in Rapid after TC* Version 11.75* 19/03/07 RHA DEV00019554 Correct precision of XCP YCPL ZCPL in use* 13/04/07 RHA DEV00019730 Correct wrapped drill cycle approach move* 30/04/07 RHA Post processing speed up* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls* 29/05/07 RHA DEV00019987 Reverse coordinate after array axis swap* 30/05/07 RHA DEV00019987 Limit fix to 5 axis rotary* 01/06/07 RHA DEV00019987 Leave array axis swap but remove sign reversal.* 01/06/07 RHA DEV00020208 Fix Index after TC (Head Head)* Version 12.00* 23/07/07 RHA DEV00020524 Avoid spurious CRC warnings

    * 24/07/07 RHA DEV00020524 Comp Fix, Plan B. Set $COMPOUT only when state changed* 03/08/07 RHA DEV00020524 Fix comp problem in CIRCLE procedure* 10/08/07 RHA DEV00020285 Add new ISO Datum Shift Tokens* 28/08/07 RHA DEV00020760 DEV00020742 DEV00019720 Fix approach coordinates* 29/08/07 RHA DEV00020760 DEV00020742 DEV00019720 Fix axis reversals in toolchange* 27/09/07 RHA DEV00021172 Correct datum output when index not maintained* Version 12.25* 18/10/07 RHA DEV00021382 Correct use of #TMP, Use #COMPTEMP

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    24/39

    * 07/11/07 RHA DEV00019365 Additional debug output for holes and thread mill* 03/12/07 RHA DEV00021534 Enable longhand tapping* 17/12/07 RHA DEV00021869 Correct Rapid after TC for longhand hole cycles* Version 12.5* 21/12/07 RHA DEV00021292 ASIN fails on taper thread* 24/12/07 RHA DEV00021372 Trap hole cycle level change* 17/01/08 RHA DEV00022021 Incremental option for Z Clear* 18/01/08 RHA DEV00021841, DEV00021908 New optional warnings* 18/02/08 RHA DEV00022063 Fix single helix and tidy call structure* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL* Version 2009.1* 07/04/08 RHA DEV00013774 Correct arc centres and streamline arc calculations* 14/04/08 RHA DEV00023113 Feed after ToolChange code constructor added* 14/04/08 RHA DEV00018979 Correct BNUM reset* 22/04/08 RHA DEV00022820 Correct angle at toolchange logic PMACRO-15* 22/04/08 RHA DEV00022820 Set hold values to #FUNNY in PMACRO-15* 01/05/08 RHA DEV00023246 Adjust rotary initialisation according to machine type* 07/05/08 RHA DEV00023285 Set angle output vars at toolchange* 08/05/08 RHA DEV00020490 Add new hole depth option. Incremental from Retract* 22/07/08 RHA DEV00024069 Correction to spindle reverse with coolant* 06/08/08 RHA DEV00024310 Back bore and face in milling* 11/08/08 RHA DEV00024364 Implement helical hole cycles* 20/08/08 RHA DEV00024474 Add Feed Type setting to toolchange

    * 26/08/08 GST DEV00023989 Helical approach number of turns corrected* 26/08/08 GST DEV00023205 Correct TLO application if NOMOTION* 28/08/08 GST DEV00024586 Apply TLO correction to XY arcs* 28/08/08 RHA DEV00023797 Add tool token and remove chamfer angle restriction* 08/09/08 RHA DEV00024603 Correct angle setting for Rapid after ToolChange e=pt

    _output_rapid* 11/09/08 RHA DEV00024584 ASIN error on helical profile* 18/09/08 RHA DEV00024886 Call feed type code constructor from toolchange*************************************************************************** ******************** Initialisation procedures* ********************* Initialisation system and user defined variables

    * Axis Reversal Multipliers* Automatic Datum Setting** Retrieve from MM & MT lines* Coolant code output* 1 rotary axis, set second type as first* Multi-plane (3axis + Index)* Rotary milling (4axis)* 5 axis IJK machining* Rotary Axes offset e.g. zero programmed as 90 degrees* Subroutine numbering* Block numbers*PRECISION=#INCR-(#INCR/100)

    * Head operation mode variables********************************************************************************************* Select abs/inc at post run time* Note #incrxyz is current abs/inc setting* #incrxyzhold is main program setting* #incrsubs is subroutine setting********************************************************************************************* Called by all START macros to set initial position etc.

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    25/39

    * Current CPL output values* %CALL=PT_SET_PRECISION might need functionality here* Machine Datum output values* %CALL=PT_SET_PRECISION might need functionality here* Reset HOLD with reversals if not incremental* Set CPL offset for moves to Home and TC********************************************************************************************* Canned cycle capability checks, Longhand if canned cycle not available*Drill* Check tool orientation conditions* DB12120 Rotary Rotate outputs cycle and expanded equivalent. Suppress cycle to prevent duplicate moves* Entry feed set - longhand output only********************************************************************************************* ******************** Macro support procedures* ********************** * %IF #EXPANDG82=1 %THEN %NOCYCLE* Counter bore cycle* Peck Cycle

    * Drill Cycle********************************************************************************************************************************************************************************************************************************************************************************************************* Back Face****************************************************************************************************************************************************** Check and reset direction* Right hand threads* Left hand threads*

    *************************************************************************** Set CRC output control for profile lead in/out*************************************************************************** %IF #G550 %THEN $WARNING="Warning - Workshift in Toolchange not valid withDatum Shift - Option ignored":%CALL=CODECON_WARNING:%GOTO @NOTOOL_WORKSHIFT** AutoCoolant* ToolChange Coolant control* 1 - No Change* Spindle controls* Through tool coolant* Feedtype* Position not move, therefore never incremental

    * Set to Initial CPL - head rotation only* Check correct position* No Rapid_to_ToolChange call* Check Z position only, allow for axis reversal* Reset Orientation - Maintain Index* Head rotations assumed 0 for toolchnage* Table rotations unchanged* Allow for ToolChange at 0 angles, head axes only* Head-head machine* Tool at angles 0 for toolchange

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    26/39

    * Output initial position after TC and Index only*************************************************************************** Cutter compensation will* 1. Only be active during feedrate moves - not rapid* 2. Will not be active during a Z move. (NOTE! G17=> Z/G18 => Y/G19=> X - but edgeCAM doesn't allow tool normal to these planes)* Only Feed Code Constructor has Cutter comp Tokens available.** NOTE! All output is processed is produced from a cut move : feed, clw, 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

    *************************************************************************** * * * * First pass only - Initialise start point* First pass through translate is second call of subroutine.** Rapid to position of next move* Incremental Subroutines* Absolute approach* prevent output of null effect G92 block* Apply translation - G92 will reset registers

    * Call Subroutine****************************************************************************************************************************************************************************************************************************************** Diagnostic printout************* Full canned cycle USERVAR8=1. #THREADCANNED=2* Canned cycle preparation* Canned cycle output* True canned cycle only*************************************************************************** Check tool orientation conditions*If no comp requested ensure output flag is true

    * Check for helical interpolation* %IF PATHTRACE=1 %THEN %NOCYCLE*Check for array data.* #TMP=XPOINT(#LOOP):#TMP1=YPOINT(#LOOP):#TMP2=RADIUS(#LOOP)* *look for lift out on NEXT move* * * Look for last leg and cancel compensation**************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    27/39

    * Through Tool Coolant* Adjust tool/home position to current CPL if required*************************************************************************** Through Tool Coolant* Adjust tool/home position to current CPL if required*************************************************************************** * * * * 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)** Final G92 position.* Update Keep values*************************************************************************** Find Gear* Spindle control* Reset old values if stopped*************************************************************************** *******************

    * Debug Trace Procedures* ******************** Called from token TOOLTYPE* ******************** Program Defaults* ********************* 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** %IF #TOOLCHANGE=1 @COMP* Set Rotary directions* %IF #ROTVALS=0 @SKIP_ROT_SET

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    28/39

    *Set CPL Parameters*** procedure to set and check spindle speed whenever the token is used.* Look ahead at ToolChange or Rapid*Look ahead* Only process if speed changed* Spindle Stop* Warning Output* Warn for feed moves only*** Fix for thread mill lead out* Comp On* Comp Off* Fix for thread mill lead out, Thread mill always sets SUBFUNCT to 1* Set Rotary directions* %IF #ROTVALS=0 @SKIP_ROT_SET* Checks for CRC* Output Feed move* Cancel cutter compensation via CodeCon_cancel-cutter-comp* Code Constructor must be empty if output is with move otherwise blank block will be produced*

    * Handles cutter compensation in all situations* #COMPON signals the state requested by EdgeCAM cycle* Subfunct signals state for this move* $COMPOUTPUT signals whether it has been output****************************** Profile Cycle ******************************* IF SUBFUNCT=0 @END********************************************** Handles apply compensation in all cases *********************************************** Retrieve original compensation Gcode* Retrieve current compensation Dcode (register)

    ************************************************** Handles cancel compensation in all cases *************************************************** Set Cancel GCode* Output is from motion procedure since is either with or after move* Call codecon for machines needing separate G40 block** Reverse G41/G42 if processing mirror image longhand** After Mirror, Compensation may be cancelled due to final Rapid. Need toretrieve 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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    29/39

    * Suppress COMPDCODE if no COMPGCODE* Suppress too small moves in single quad case only* Radial Rotary Arcs output via Procedure=Radial_circle* Process planar arc*** Reset CRC Register* Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3Always* Use rads if XY plane only* Check CRC lead conditions* Lead Out* Lead in* Adjust Feedrate if required* Set plane G code* Set angles in rotary* Set IJK* ZEND set for G17 helical arcs. G18/9 not set because of DEV00011313* * Set radius precision* Set radius precision and check arc centre - Bulge check* Always use radius* Check for full circle (0 or 360)*

    * Set Radius Sign* Check centre accuracy and correct* XYPLANE is set as 0, 1 and 2 for XY, ZX and ZY respectively* Check accuracy of centre point* * Force IJK if calculated centre out of position* *****************************************************************************Set up parameters and call standard procedure to*calculate angle bearings for TNC helical arc moves

    * DEV00012570 undo previous change to correct thread mill regression* Set arc parameter system variables* Multiple turns, Note that complete circle can have included angle of 0 or 360* Thread Mill, multiple turn arc has only 0-360 included angle, derive from pitch and Z move* ZSTART ZEND are not available in thread milling* Check for last helix full 360 degrees* #TURNS=0* Round result of division* #TURNS=#TURNS*100+0.5* #TURNS=INT(#TURNS)* #TURNS=#TURNS/100* %IF #TURNS=#TMP %THEN #TURNS=#TURNS-1

    * Still needed for thread milling************** NEED TO USE XINC.YINC IN ASIN_BEARING*Double check for 360 case* Full circle* ************************************************** Compensate feedrates for arcs if option selected* *************************************************** #TMP=ABS(RADIUS):%IF #TMP=TOOLRAD @END

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    30/39

    * 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 theloop expand and thus output-if-changed* will, typically, produce the XY points list previously separated 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************* Diagnostic printout************* Status Flags in use* Option flags in use* #XREVERSE,#YREVERSE,#ZREVERSE Axis reversals* $OUTPUTSUBS* #ROTARYTYPE=2 1 for* MILLMODE 0 for rotary, 1 for planar* #TOOLCHANGE =1 if previous instruction was toolchange

    * #PREPOSITION: 0 never* Set wrap radius* Keep move parameters* Rapid to first XY position then to Zclear with Tool Length Offset. Callprocedure for single Code Constructor* Could put this on a switch e.g. Call Rapid After toolchange ?** Necessary for rotary machining.* Lift to clearance* Approach to first point - Rapid in XY********************************************************************* Branch on $OUTPUTSUBS. =null if PATHTRACE expansion* Set HOLD values for incremental calculations in subroutines*Include first position in expansion

    * Processing loop for cycle points**:%CANCEL=#XMOVE,#YMOVE*Check for Zdepth/level change and respecify cycle*** Each cycle will use a different output line but needs to be hereto 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.**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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    31/39

    ************************************************************* #HOLECYCLE2 is now used to suppress sub call approach moves* Set 0 if not using drill subroutines* Blank null values - not required* Incremental variations* * Set absolute baseline positions for XSHIFT etc* Remove duplicate tools from NC Code tool list* Initialise array for datum IDs* * Loop to get SYSID from list and store in uarray in order* * * * Unused array element* * Option to output first Datum (G54) as XYZHOME location* Initialise rotary setting at zero* Reset to first datum position* Set CPL offset for moves to Home and TC* Absolute datum selected* Next line removed to allow modality to interpret initialisation. DEV18171* %CANCEL=#XMOVE,#YMOVE,#ZMOVE* Incremental datum offset

    * Save CPL ID* * Datum not found* $WARNING="ERROR - SYSID for CPL not found in Datum List":%CALL=CODECON_WARNING* * Speed** Rot1/Rot2 are not set from drill array**** Calculate vector distance from current to next coordinate* Use to determine if rapid move should be converted to feedrate move

    ** XY distance* 3D distance i.e. incorporate Z axis* If move is smaller than the specified amount then convert to a feedrateat highfeed.* #TOOLSHEET 1=Output with Main NC program 2=Output as seperate file 3=None******************************************************** * ******************************************************** Check 5 axis mode here and in PT_Rotary_Axes* 5 Axis mode off

    * 5 Axis mode on* Set Precision********************************************* Check move content* 5 axis only, assume all angles could be moving* HOLD vars have unmodified EdgeCAM values*********************************************** Make incremental* Set Move for XYZ*******************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    32/39

    ********************************************************* Procedure trace is ON. Additional trace options* #TRTHREAD,#TRHOLE control array dumps in CY procedure* #TRX,#TRY,#TRZ,#TRC1,#TRC2,#TRB temporary output vars* Not Drill, ToolChange, Index or Thread Mill* Output EdgeCAM End Points* Output Current Mode Settings* Determines the method of fixing arc centre* NOTE! Thread Milling uses %PROCEDURE=PT_THRD_ARC_CENTRE for simplicity** Setvar^#ARCTYPE* Signed Start to Centre 1* Signed Centre to start 2* Unsigned Start / Centre 3* Centre4** Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3Always* %IF XYPLANE=2 @YY* %IF XYPLANE=1 @ZZ* %IF XYPLANE=0 @TYPE*

    * ********************** * Thread Milling** ************************ Full canned cycle* * Preposition after toolchange* Next Z for first move* Set canned cycle variables**

    * %IF #ZMOVE

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    33/39

    ** 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* Centre4* Setvar^#USERADS^Use Radius: 0 Never, 1 When Possible, 2 When Possible (XY), 3Always* IJK method of arc output** 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* ******************************** 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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    34/39

    * If using incremental subroutines only, it is necessary to hardcode a G91on 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*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 necessary to hardcode a G90on extra Sequence definition line* Store HOLECYCLE2 flag for this subroutine*** Procedure only applicable to Rotary Table configurations.* Must be in Procmill.cgi since called from within Set Work Datums*

    ************************************************************** Purpose : To set number of moves in Lead out sequence ** Called : when processing a Feed or Arc move which is ** the first move of the Lead out sequence** Subfunct=2******************************************************************************************************* Lead Out permutations**************************************

    *** Check FIELD12 lies in range 1-3************************************************** 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

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    35/39

    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 orientationthe 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** 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* * Call CYCL DEF for each cycle type** 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* Called by Attribute macro to reverse spindle when longhand tapping** Modified for adaptive templates to have a procedure for first leg* and a second procedure called by a token for the second leg** Handles Rapid to Home strategies e.g. Xfirst, Zfirst* No automation depending on tool type i.e. User must program Xfirst** Axis Fixed* FIELD 1 = 1 = X FIXED (remain at current location )* FIELD 3 = 1 = Z FIXED ( " " "

    )** Axis Priority* FIELD 4 = 0 = None* 1 = XFIRST* 2 = YFIRST* 3 = ZFIRST* Fixed coords** Angular position is inherited - do not process again

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    36/39

    * %CALL=PT_ROTARY_AXES* Called via token to create second leg of move** Calculates number of pecks/chipbreaks in cycle* Called from Token* Nothing specified, use defaults* Check speed* Get machine maximum speed from highest gear* Check speed in range for spindle* Get details for first gear* Check speed in range for spindle*Reset to current gear* * Warn if Gear Range selected greater than defined in Spindle Tab* Check speed in range for gear* GEARMAXRPM,GEARMINRPM limits for this gear on this spindle* Called by Attribute macro to reverse spindle when longhand tapping* Called by token to calculate clearance value* Control procendure for centre position checking* Set temporary variables according to plane of arc* * * *

    * * * * * * Reset Output Variables according to plane of arc*** Shifts centre by +- Precision alternately to improve fit* Output message if in Con Debug mode*** Set centre back to original position *** Checks distances from start to centre and from end to centre against radius

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

    *************************************************************************** Machine independant Code Generator include file** Filename: mill-procedures-rotary* Author: RHA* Date: 11 November 2005** New file for adaptive milling templates derived from earlier multiplane template ***************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    37/39

    * Change History* Version 10.5* FIRST ISSUE* 23/01/06 RHA DEV00016067 Correct angle output modality in PT_ROTARY_AXES* 08/02/06 RHA DEV00016222 Make 360 to 0 angle reset optional* 14/02/06 RHA DEV00016310 Axis sign reversal not working*************************************************************************** 20/02/06 RHA DEV00016344 Implement IJK vector for 5 axis cycle* 24/02/06 RHA DEV00016422 4 Axis fails to compile* 14/03/06 RHA DEV00014577 Correct blanking of angles (sign=direction)* 22/03/06 RHA DEV00016723 Fix angle processing in line with EdgeCAM signed angles* New PT_WHICH_WAY procedure* 24/03/06 RHA DEV00016743 Datum shift output for index in incremental mode.* 27/03/06 RHA DEV00016723 Set 0-360 for sign=direction when indexing table* 16/05/06 RHA DEV00017213 Correct index handling for no rotation cases* 18/05/06 RHA DEV00017213 Fine tune* Version 11.0* 11/07/06 RHA DEV00017691 Correct use of angle reversal flags* 25/07/06 RHA DEV00016799 Initialise tool position at toolchange and index* 13/09/06 RHA DEV00018171 Correct initialisation of tool position after datum shift* Version 11.5* 25/09/06 RHA DEV00017909 Expand trace options

    * 24/11/06 RHA DEV00017338 Move CPLNAME to a template variable* Version 11.75* 19/03/07 RHA DEV00019554 Correct precision of XCP YCPL ZCPL in use* 11/05/07 RHA DEV00019987 Allow for axis assignment for negative rot1 angle* 21/05/07 RHA DEV00020096 Implement Maintain Index Option at ToolChange* 24/05/07 RHA DEV00019981 Orthogonal plane cycle controls* 01/06/07 RHA DEV00020208 Fix Index after TC (Head Head)* Version 12.00* 26/07/07 RHA DEV00020560 Make +-180 setting more robust, allow for wind up.* Version 12.50* 04/02/08 RHA DEV00006310 Allow canned cycles in Rotary Rotate* 19/03/08 RHA DEV00022891 Allow concecutive coincident indexes to CPL* Version 2009.01

    * 22/04/08 RHA DEV00022820 Protect PT_WHICH_WAY from #FUNNY hold values* 21/07/08 RHA DEV00024066 Correct setting of $LINEARAXIS for AC machines* 27/08/08 RHA DEV00024207 Fix G43 Z move after Index****************************** Rotary Procedures ******************************* #ROTVALS controls use of ROT1/ROT2 values for rotary positioning* #ROTVALS=#FALSE* %IF $PLANAR=NO %THEN #ROTVALS=#TRUE* Check for incremental*Set For incremental in rotary* Reset incremental*

    * Purpose : Process Radial Arc moves** Called from Macros ANGCLW and ANGCCLW** If Clockwise process via Clockwise Code Constructor otherwise via the CounterClockwise Code Constructor.* Purpose : To determine whether Orientation is Axial or Radial** Called from Index when Rotation has occurred*

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    38/39

    * 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* %IF #MACRO=38 %THEN #ROT2=ROT2+ANGLE* Set CPL offset for moves to Home and TC* Initialise tool position*Check for datum reset only* Only datum shift, angles unchanged* No rotation* Rotary moves****************************************************************** Trap null moves with differing direction sign DB10885/11016******************************************************************** Incremental datum*Set ROT Hold values* Output initial position after TC and Index only************************************************** PT_ROTARY_AXES*************************************************

    ************************************************** Five axis movement control* 5 Axis mode off* 5 Axis mode on* Set IJK if needed* IJK instead of angles**************************************************PRIMARY AXIS* If Sign=direction set 0-360 range for INDEX only* Apply angular offsets* Set Increment* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2* Reverse direction of 0 -> 360 if required

    * Reset Primary within 0-360 again* Reset primary within range +/-180* Accommodate -0 by setting zero angle to 0.0000001 and calculating sign* This will truncate to 0 on output with correct +/- sign* Note that #ROT-HOLD vars are set from ROT1 ROT2 not #ROT1 #ROT2* Incremental - Check null move* User reverse if wanted************************************************** PT_WHICH_WAY************************************************** Protect against #FUNNY* Set directions of rotation* Angular Moves - based on angles received

    * Indexing* Shortest, based on end position* Controlling direction - first rotary* Asssign Mcode for direction of rotation* Sign = direction* Controlling direction - second rotary* Asssign Mcode for direction of rotation* Sign = direction******************************************************************************************

  • 7/28/2019 Romi Discovery 760 Fanuc21i 4 Eixos

    39/39

    * PT_WRAP_RADIUS******************************************************************************************* Purpose : Output Wrap Radius for M/cs such as Bostomatic* Called from all machining macros when rotary first initialised* NB Fadal is different, see CODECON_WRAP_HEIGHT******************************************************************************************* PT_INDEX_CONTROL*******************************************************************************************Call Head First* Now Call Table************************************************** Head angle settings**************************************************** Procedure to set head angles. To be developed as required* Procedure to set head angles. To be developed as required******************************************************************************************* PT_CUBIC******************************************************************************************* Set TNC Tool Alignment, called from TOOL CALL code constructor