CGT Word Reference by Category

The following presents a categorized list of CGT words.

This section contains a list of CGT words divided into categories, which are arranged alphabetically. To find information about a specific CGT word, first consider what type of information it is (such as tool change information or fixed cycle information), and then look through the alphabetical listing of categories to find the one you want. Each list has a CGT word on the left and a definition of how the CGT word is used on the right.

Arcs - @ARC

#ARAD - Arc radius
#CTRLOC - Center location
#EANG - End angle of arc (all angles in degrees)
#FDADJ - Feed adjust
#INDXA - Tool index angle (Advanced Fab only)
#LNLEN - Arc length
#MOV - Arc move code lookup
#OVANG - Offset vector angle
#PLANE - Arc plane designation
#STANG - Start angle of arc
#TANG - Total angle of arc
#[XYZ]CTR - Center position of arc
#[XYZ]OV - Offset vectors
#[XYZ]POS - End position of arc
#[XYZ]ST - Start position of arc

Block Numbering

#BDSTR - Delete block string variable
#BLK - Current block number
#BLKDEL - Turns block delete on or off
#GETBLK() - The start or end block number of a canned process, 0=start, 1=end
#OFFBLK - Turns block numbers off
#ONBLK - Turns block numbers on
#SAFBLK - Safe start block number
#SETBLK() - Sets the start or end block number of a canned process, 0=start, 1=end

Control Words

#ABSI - Set absolute or incremental mode.
#AND - Logical AND combination of two expressions in a conditional.
#CALL() - Call another CGT section
#ELSE - Process segment for false conditional.
#EXC - Exclude remainder of conditional from output evaluation.
#EXIT - Exit CGT processing for current move.
#EXITC - Exit processing of current #CALLed @Section.
#EXITR - Exit processing of current #REPEAT() or #STEP_LIST().
#FINVAL() - Output final value when coding is done.
#GOTO() - Transfer processing to an @SECTION.
#IF - Conditional test of numeric expression.
#IFCHG - Conditional test for output status of CGT variable.
#IFSTR - Conditional test of string expression.
#INCLUDE() - Read in the contents of a text files.
#INCLUDESTR() - Read in demarked text from a job notes field.
#NEXTPT - Stop processing current move and re-enter with the next move.
#OFFBLK - Turn off block numbering.
#ONBLK - Turn on block numbering.
#OR - Logical OR combination of two expressions in a conditional.
#PCAN - Punch mode cancel. Fab only.
#REPEAT() - A repeat loop.
#RESET() - Force next occurnce of words in () to be output.
#SAFBLK - Output safe start block number.
#SPOFF - Spindle off command.
#STEP_LIST() - Specialized repeat loop for step information.
#TLCHG() - Delays setting tool change vars in @TOOLCH.
#UPDATE() - Update a CGT word's conditional status as if it had been output.

Data Types and Data Assignments

CGT Variables - CGT variables discussion.
CGT math funcs - discussion of CGT math functions and examples.
System Math Functions - System math functions available for use in the CGT.
#CALCDEC - declare an autocalc variable with default decimal format.
#CALCFMT() - declare an autocalc numeric variable with a user specified format.
#CALCINT - declare an autocalc variable with default integer format.
#CALCSTR - declare an autocalc string variable.
#DEC - declare numeric variables and arrays with default decimal format.
#EVAL() - assign expression result to numeric or string variable.
#EVMD() - assign expression result to macro decimal variable.
#EVMI() - assign expression result to macro integer variable.
#EVMS() - assign expression result to macro string variable.
#FMT() - declare numeric variables with a user specified format.
#INT - declare numeric variables and arrays with default integer format.
#LAST() - return the last value of a numeric variable to a numeric expression.
#MSE() - return the result of a macro string operation to a string expression.
#RCNT - return the current #REPEAT() counter to a numeric expression.
#RETNUM() - return a numeric value from a calc @Section to its matching #CALCDEC, #CALCINT, or #CALCFMT variable.
#RETSTR() - return a string value from a calc @Section to its matching #CALCSTR variable.
#STR - declare string variables and arrays.
#SO-#S19 or #S[] - predeclared string variables.
#TABLE() - returns a value out of a table for output or to an expression.
#TBL - declare a table lookup variable.
#UO-#U19 or #U[] - predeclared numeric variables default formatted as integers.
#VO-#V19 or #V[] - predeclared numeric variables default formatted as decimals.
#vname[] - returns the array size to a numeric expression.

Operational Data From Step

#CHKD - Check distance above prof top.
#COOLNT - @COOLNT table lookup value.
#CYCLE - @CYCLE table lookup value.
#DOFF - Diameter offset register.
#DWELL - Canned hole cycle dwell value.
#FDMODE - @FDMODE feed mode table lookup.
#FEED - Feedrate.
#LEN_PSET - Length preset value.
#LOFF - Length offset register.
#LSPNDLNUM - Last spindle value.
#LTOOL - Last tool code.
#LTUROP - Last turret operation code.
#NTOOL - Next tool code.
#OPTYPE - Operation code.
#PECK - Peck increment.
#SPEED - Spindle speed.
#SPMODE - @SPMODE speed mode table lookup value.
#SPNDL - @SPNDL direction table lookup value.
#SPNDLNUM - Flag for main or subspindle.
#TDESC - Tool description.
#TLDIA - Tool diameter.
#TLEN - Tool length.
#TLGRAPHIC - Tool graphic file.
#TLUDSC - Tool user description.
#TLUDSCN - Tool user description for the next tool.
#TLWD - Tool width.
#TOFF - Tool and offset combo word.
#TOOL - Tool code.

Canned Hole Cycles

#CYCLE - @@CYCLE table lookup value.
#DWELL - Canned hole cycle dwell value.
#PECK - Peck increment.
#RTNLVL - @RTNLVL code table lookup.
#[XY]POS - XY position of hole.
#ZCHK - Z check position above hole.
#ZDPTH - Hole depth.

Groove Cycle (Turning) - @OP_GRV (OD/ID groove), @OP_FGRV (face groove)

(See .smf questions 200-204)
#GRV_CrnrRad - Corner Radius.
#GRV_MaxWid - Maximum width of cut.
#XOV - Depth (or width for face groove).
#XPASS - Bottom (or X side for face groove).
#XST - Start corner X position
#ZOV - Width (or depth for face groove)
#ZPASS - Side (or Z bottom for face groove)
#ZST - Start corner Z position

Peck Drill Cycle (Turning Fixed Tool) - @OP_PDRL

#PECK - Peck depth, set in .smf question 150 or updated with user command
#ZPASS - Bottom or end of peck cycle
#ZPOS - Top or beginning of peck cycle

Tapping Cycle (Turning Fixed Tool) - @OP_TAP

#ZPASS - Bottom or end of tapping cycle
#ZPOS - Top or beginning of tapping cycle

Threading Cycle (Turning) - @OP_THD

(See .smf questions 185-195) The meanings of some thread CGT words depend upon the setting of .smf question 185.

Q. 185=0 For thread cycles (such as G33) where rapid moves must be included.

#FTHRD - Thread lead
#THD_Crest (deprecated #V0) - Value of thread crest X dimension
#THD_CurrDpth (deprecated #V1) - Current depth of thread. Absolute value, updated for each pass
#THD_PassDpth (deprecated #V2) - Incremental depth move for each pass.
#THD_AccPassDpth (deprecated #V3) - Accumulated pass depth including clearance. Updated for each pass
#THD_MinPasses (deprecated #V4) - Number of passes at first pass depth that will fit.
#[XZ]CTR - Start position for LAST thread pass of cycle
#[XZ]OV - Change in position (delta) between start and end of LAST thread pass
#[XZ]PASS - End position for LAST thread pass of cycle
#[XZ]POS - End position for each thread pass of cycle
#[XZ]ST - Start position for each thread pass of cycle

Q.185=1 For thread cycles (such as G38) where each thread pass must be output, but where rapid moves do not need to be output with each pass.

#FTHRD - Thread lead
#THD_Crest (deprecated #V0) - Value of thread crest X dimension
#THD_CurrDpth (deprecated #V1) - Current depth of thread. Absolute value, updated for each pass
#THD_PassDpth (deprecated #V2) - Incremental depth move for each pass.
#THD_AccPassDpth (deprecated #V3) - Accumulated pass depth including clearance. Updated for each pass
#THD_MinPasses (deprecated #V4) - Number of passes at first pass depth that will fit.
#[XZ]CTR - Start position for EACH thread pass of cycle
#[XZ]OV - Change in position (delta) between start and end of LAST thread pass
#[XZ]PASS - End position for EACH thread pass of cycle
#XPOS - ????
#ZPOS - ????
#XST - Start X of thread. Actual value, updated for each pass
#ZST - ?????

Q.185=2 For thread cycles (such as G76) where the entire thread cycle is generated based on a single set of parameters.

#FTHRD - Thread Lead
#THD_Crest (deprecated #V0) - Value of thread crest X dimension
#THD_TotDpth (deprecated #V1) - Depth of LAST thread pass
#THD_1stPassDpth (deprecated #V2) - Depth of FIRST thread pass
#THD_AccPassDpth (deprecated #V3) - Accumulated pass depth including clearance for first pass.
#THD_MinPasses (deprecated #V4) - Number of passes at first pass depth that will fit.
#[XZ]CTR - Start position for LAST thread pass of cycle
#[XZ]OV - Change in position (delta) between start and end of LAST thread pass
#[XZ]PASS - End position for LAST thread pass of cycle
#XPOS - ????
#ZPOS - ????
#ZST - Start X of FIRST thread pass (includes rapid clear value)
#ZST - ?????

Turning Cycle (Turning) - @OP_TURN

See .smf questions 180-184
#[XZ]XPASS - Ending positin of pass
#XPOS - Start Rapid Clear X position for first pass and any subsequent passes if desired
#ZPOS - Start Rapid Clear Z position for first pass and any subsequent passes if desired

Cycle Time Calculation

#CYTIME - Total cycle time so far
#STTIME - Cycle time for previous step
#TIME - Value to add to total cycle time
#TLTIME - Cycle time for previous tool

Debugging

#OUTERR - Output error information to the code file. @DECLARE section only
#OUTLIN - Output CGT line numbers to the code file. @DECLARE section only
#OUTSEC - Output CGT @Section names to the code file. @DECLARE section only
#OUTSECWCGT - Output CGT @Section names with CGT name to the code file. @DECLARE section only
#OUTSECWPTH - Output CGT @Section names with CGT path to the code file. @DECLARE section only
#SECNAME - Section name to be called. @CYCCHG section only
#SECNUM - Section number to be called. @CYCCHG section only

Feed Control

#FDADJ - @FDADJ arc feed adjust table lookup.
#FDMODE - @FDMODE feed mode table lookup.
#FEED - Feed rate.
#FTHRD - Thread lead.

Lines - @LINE

#LNANG - Line angle.
#LNLEN - Line length.
#OVANG - Offset vector angle.
#[XYZ]OV - Offset vector.
#[XYZ]POS - Line end position.
#[XYZ]ST - Line start position.

Nurbs output

#CRVDEG - Degree or order of the curve
#GETKNOT - fills #KNOTVAL with the next knot value
#GETNODE - fills #[XYZ]NODE and #NODEWGT with values of the next control point of the curve
#KNOTVAL - Current knot value of the NURBS
#NODEWGT - Weight of current control point
#NUMKNOT - The number of knot values with the NURBS
#NUMNODE - The number of control points (knots) in a curve

Spindle Control

#SPEED - Spindle speed
#SPMODE - Speed mode for RPM or CSS
#SPNDL - Spindle On direction
#SPNDLNUM - Holds the corresponding spindle value based on whether the current move is with a main or sub-spindle