$---------------------------- [POST HELP FILE] ------------------------------ Each system (Mill, Lathe, Flame/Laser) has the Post Editor option on its main menu with the appropriate extension so that each one will default to access the correct Posts. You can change the default by selecting from the F4-Format pull-down menu, so you can easily make changes to any Post in your system even though you have selected the Post Editor from, say, the Mill main menu. F4-Format also has an option to allow you to set the DEFAULT Post - this is the Post which will be used by APS if you do not select another one. Note that the F1-File menu in the Post Editor is slightly different from the File menu in the normal Text editor - Load and Save refer to Posts, NOT NC code. If you want to load an NC program into a second window to look at NC code while you are editing your Post, use the Input NC Code option in the File menu (ALT + I works as a `fast key' for this). Do not use the Post Editor to create NC code, since you will not be able to save it as NC code - it may look like NC code, but APS will think it is a Post and will reject it as an INVALID POST. NOTE: Don't try to create a new post from scratch - modify an existing Post. You will find a PROTOTYPE POST for each of the Post types appropriate for your APS system which you can use as a model. -------------------------------- GENERAL ----------------------------------- $ is a special character which identifies the format for each part of the NC code, which is described by an NC CODE TEMPLATE - see list below. $ followed by anything OTHER THAN a number or LET, IF, ELSE etc will be taken as the start of a remark - which can use more than one line if required. A $ anywhere on a line except the start will be considered literally as a $, and be included in the NC code, but if a line of the NC code must START with a $ then put $$ as the start of the line - eg $$[SN] to mark the start of a subroutine. The $ numbers are fixed - do not change or add any. If you are sure that a $ number is not relevant you can delete it but it is safer to leave it in, with no entry on the next line - you can have nothing at all, or put $ as the first character plus a remark, but not a blank line, since a blank line in a template will produce a blank line in the NC code. If you use MM or INCH on a machine at different times, you must have two Posts - one for each case - so that decimal point and feed values will be correct. To avoid asking for the units used each time you program a part, APS assumes that your geometry, feed and speed units are the same as the units for the tools used and any necessary conversions are done automatically. This means that ALL the tools for a job must have the same units. ***************************************************************************** --------------------- LIST of ALL $NUMBERS for NC CODE TEMPLTES ------------- Most apply to all machine types, but some do not. For example Laser, Flame and Wire cannot make holes with drills, so $200 to $245 do not apply. $numbers that apply only to LATHE and AGIE Wire-EDM are marked and indented. Refer to a typical Post to see examples of NC Code Templates for each $number. ------------------------- PROGRAM LEADING/TRAILING LINES ------------------- $5 $STORE, $RUN and $RECALL See manual Appendix A for details $10 File LEADING lines $12 Main Program LEADING lines $15 Main Program TRAILING lines $17 File TRAILING Lines ---------------------------- RAPID MOVES ----------------------------------- $20 Rapid Move in XY (MILL/ROUTER/FLAME/LASER) or XZ (LATHE) only $21 3D Rapid Move in XYZ (MILL/ROUTER ONLY) $25 Rapid Move in Z only (MILL etc) $27 Rapid move in C-axis X Z and/or C (LATHE) $30 Lines BEFORE a rapid move if Z levels are not used eg Laser or Geometry $35 Lines AFTER a rapid move if Z levels are not used eg Laser or Geometry ----------------------- MACHINING FEED MOVES ------------------------------- $40 Machining FEED lines $50 Feed CW arc (APS will automatically limit arcs to 180 degrees maximum) $60 Feed CCW arc (APS will automatically limit arcs to 180 degrees maximum) -- For LATHE only ------ $42 Thread Cutting (single pass) $47 Feed Line in C-axis $57 Feed CW arc in C-axis $67 Feed CCW arc in C-axis -- For PUNCH only ------ $45 Nibble along a line $55 Nibble around a CW Arc $65 Nibble around a CCW Arc ------------------------ TOOL CHANGES -------------------------------------- $70 Cancel current tool. Use [T] for current tool number if required. -- For LATHE only ----- $71 Code for Constant SURFACE speed - entered into variable [CS] $72 Code for Constant SPINDLE speed - entered into variable [CS] $73 Code for Feed per MINUTE - entered into variable [FP] $74 Code for Feed per REVOLUTION - entered into variable [FP] $75 Code for CLOCKWISE spindle rotation - entered into variable ROT (or RT) $76 Code for COUNTER-CLOCKWISE spindle rotation - entered into variable ROT (or RT) $80 Select new tool. Use [T] for new tool number, [S] for spindle speed. -- For LATHE only ----- $82 Change $84 Select C-axis tool ------------------------ WORK PLANES -------------------------------------- $88 Select Work Plane (eg for Horizontal Machining Centre) -------------------------- SUBROUTINES ------------------------------------ $90 CALL subroutine. Use [SN] for subroutine number. $100 BEGIN subroutine. Use [SN] for subroutine number. $110 END subroutine $120 Origin shift. Use [OX] and [OY] for values to shift by. $130 Cancel Origin shift. [OX] and [OY] are values by which origin was shifted) -- For PUNCH only ------ $132 Move Sheet $133 Move Clamps -- For WIRE only ------ $135 Code for Unconditional Stop (to leave a tag at end of cut) ----------------------- MACHINE TOOL COMPENSATION -------------------------- Codes given in $140 to $142 are assigned to TC by APS as required $140 Code to CANCEL Machine Tool Compensation $141 Code for LEFT Machine Tool Compensation $142 Code for RIGHT Machine Tool Compensation $145 Percentage increase in blend radius for sharp internal corners $146 Adjust G41/42 code at internal corners for tool radius (1=Yes 0=No) $147 Compensation can be applied on Rapid Approach (1=Yes 0=No) ----------------------- MACHINE TOOL COMPENSATION -------------------------- Codes given in $150 to $153 are assigned to CLT by APS at start of each path. $150 Code for Coolant OFF $151 Code for MIST Coolant $152 Code for FLOOD Coolant $153 Code for Coolant THROUGH TOOL ------------------------ DRILLING/TAPPING CYCLES --------------------------- [ZR] = Retract level, the Z level to rapid down to before feed down begins. [ZB] = Z value of the bottom of the hole, [ZP] = peck DISTANCE. [ZS] = Safe Rapid level, [ZM] = Material top. All values are ABSOLUTE. $200 CANCEL drill/tapping cycle ---------------------------------------------------------------------------- DRILL cycle - traverse to next hole at SAFE RAPID level [ZS] $210 First Hole $211 Next holes ---------------------------------------------------------------------------- DRILL cycle - traverse to next hole at RETRACT level [ZR] $214 First Hole $215 Next holes ---------------------------------------------------------------------------- PECKING cycle - traverse to next hole at SAFE RAPID level [ZS] $220 First hole $221 Next holes ---------------------------------------------------------------------------- PECKING cycle - traverse to next hole at RETRACT level [ZR] $224 First hole $225 Next holes ---------------------------------------------------------------------------- TAPPING cycle - traverse to next hole at SAFE RAPID level [ZS] $230 First hole $231 Next holes ---------------------------------------------------------------------------- TAPPING cycle - traverse to next hole at RETRACT level [ZR] $234 First hole $235 Next holes --------------------------------------------------------------------------- BORING/REAMING/FACE etc - traverse to next hole at SAFE RAPID level [ZS] $240 First Hole $241 Next holes ---------------------------------------------------------------------------- BORING/REAMING/FACE etc - traverse to next hole at RETRACT level [ZR] $244 First Hole $245 Next holes -------------------------- GENERAL FORMATS --------------------------------- Separate modal values with spaces. More than one letter is OK eg X VX VY $500 Modal Text (Will not be repeated in following lines) $502 Modal ABSOLUTE Values (Will not be repeated if the VALUE is the same) $504 Modal INCREMENTAL Values (Will not be in NC code if VALUE is ZERO) $510 X Y Z I J K values must have + as well as - signs (1=Yes, 0=No) $515 Use point <.> as decimal separator (1=Yes, 0 = use comma <,>) $520 Put sub-routines at end of main program (1=Yes, 0 = put at start) $525 Quadrant Limit arcs (1=Yes, 0 = Standard APS 180 degree limit) $530 Output arcs as straight line segments (1=Yes, 0=No) $531 Maximum arc radius - Arcs will be output as straight lines if rad > (0 = No limit) $532 Chord error if arcs are output as lines. Also for Lathe C-Axis end milling. $540 Suppress Operations List, START and Comments in NC code (1=Yes, 0=No) -- For LATHE only ------ $533 Output C-AXIS Arcs and Lines as straight line segments (1=Yes, 0=No) $550 AX is Diameter or Radius NC code (1 = Diameter, 0 = Radius) $555 Edge/Tip or Tip Centre compensation (1 = Edge/Tip, 0 = Tip Centre) -- For PUNCH only ------ $535 Machine cannot AUTOMATICALLY Auto-Index around an arc (1=True, 0=False) If set to 1, single hits with correct indexing angle will be used $537 All lines and arcs to be done with single hits (1=Yes, 0=No) If set to 1, leave all $nums for canned cycles empty (eg $220 for Bolt Hole Circles) ----------------------------------------------------------------------------- - For 4 AND 5 AXIS MACHINES only ------ Set $560 - $582 all to 0 if machine is 3-axis. $560 4/5 axis Programming point: (1 = pivot, 0 = tool tip) $562 4/5 axis Tool C/L offset from pivot point in X $563 4/5 axis Tool C/L offset from pivot point in Y $565 4/5 axis Tool holder length $570 4/5 axis Max angle (degrees). Set to 0 to indicate 3 - axis machine. $580 Is this a Horizontal Machining Centre (1 = Yes, 0 = No) $582 Horizontal M/C: Set Work Plane BEFORE selecting Tool (1 = Yes, 0 = No) -- For LATHE only ------ $590 Turret below C/L: X Diameter or Radius values are +ve (1=Yes, 0=No) 'If Yes, CW arcs will use $60 (G3), CCW arcs will use $50 (G2) -------------------------- NUMBER FORMATS ---------------------------------- $700 SUBROUTINE Number format $701 Leading figures $702 Figures after point $705 Subroutine start number ---------------------------------------------------------------------------- $710 LINE NUMBER format $711 Leading figures $712 Figures after point $715 Line start number $716 Line number increment ---------------------------------------------------------------------------- $720 X Y Z values format $721 Leading figures $722 Figures after point ---------------------------------------------------------------------------- $730 ARC centre/radius format $731 Leading figures $732 Figures after point ---------------------------------------------------------------------------- $740 SPINDLE SPEED format $741 Leading figures $742 Figures after point $743 Maximum Spindle Speed $744 Fixed Speeds (eg 100, 200, 1000, 2000 ... 0 = speed is variable) $NOTE: Fixed speeds can use more than one line. 80 chars per line maximum APS will select the nearest lower value to the calculated value. $745 below only applies if $744 is 0 - ie variable speed range. $745 Round Speed Up/Down to Nearest: (.1 or 1 or 10 ... 0 = don't round) ---------------------------------------------------------------------------- $750 MACHINING FEED format $751 Leading figures $752 Figures after point $753 Maximum Feed Rate (Use mm/min or in/min as appropriate for this Post) $755 Round Feed Up/Down to Nearest: (.1 or 1 or 10 ... 0 = don't round) ---------------------------------------------------------------------------- $760 TOOL NUMBER format $761 Leading figures $762 Figures after point -- For AGIE Wire EDM only ---- $770 AGIE ANGLES format $771 Leading figures $772 Figures after point ------------------------ RAPIDS and TOOL CHANGE TIMES ---------------------- Use mm/min or in/min as appropriate for this Post. $900 XY Rapid Speed $901 Z Rapid Speed $902 Time to change tool (seconds) $--------------------------- USER VARIABLES --------------------------------- $1000 VARIABLE (format) "Prompt " '' Remark for your info. $-------------------------- USER DEFINED CODE ------------------------------- $1100 - $1119 can be used, one for each User Defined Code item. eg $1100 First line is text to be shown in dialog box. Followed by User Variables required. $ ------------------------ NC lines to be entered into program (including assignments and calculations) $ ends $1100 user defined code $-------------------------- USER DEFINED COMMANDS --------------------------- $1200 - $1219 can be used, one for each User Defined Command. eg $1200 First line is Command Name to be shown in dialog box Followed by macro lines to create NC code required. $ ends $1200 User Defined Command. -------------------------- NC CODE TEMPLATES -------------------------------- All variables and calculated values in lines in the Post template which produce NC code must be inside [ ] brackets. Anything that is not in [ ] brackets is taken as text. In all other cases the rules are as in BASIC and [ ] brackets must not be used in expressions or assignments. For example : N[N] G01 X[AX] Y[AY] NC code template with [] around the variables. N[N] G00 Z[ZM + ZB/2] NC code template including an expression - note that [] are NOT put around variables INSIDE an expression. $LET Z_LETTER = "E" is an assignment for variable Z_LETTER - [] NOT used. $LET HEAD = OLD_HEAD + 1 will evaluate the expression and assign it to HEAD Variable values are taken as numerical unless the value is inside " " quotes, when it is assumed to be text, but note that even if it is inside quotes (or typed in by the user) if the value looks like a number it can be used as a number in assignments. For example: If the NC code template is Z[Z_UP] then $LET Z_UP = "R" will put ZR into the code and $LET Z_UP = "5" will put Z5 into the code, but this could be followed by $LET Z_UP = Z_UP * 2.5 and the code produced will be Z12.5 ---------------------- RESERVED APS POST VARIABLES -------------------------- Do NOT change these APS variable names, and do not use them as names for your own variables. APS variable names use up to 3 letters - to avoid problems, use more than 3 letters or numbers for your own variable names. All Systems (including C-Axis machining in Lathe): AX AY AZ = Absolute values of next X Y or Z IX IY IZ = Incremental change in X Y or Z CX CY CZ = Current (absolute) values of X Y or Z AI AJ AK = Absolute arc centres for next machining feed move II IJ IK = Incremental arc centres for next machining feed move -------------------- Lathe only (Conventional machining and C-Axis): AD = Absolute value of Diameter ID = Incremental change in Diameter CD = Current (absolute) value of Diameter ------------------- See also NX NY, NZ and ND NY, NZ in Mill and Lathe sections below. AA AB AC = Absolute Angle for A-Axis, B-Axis and C-Axis IA IB IC = Incremental Angle for A-Axis, B-Axis and C-Axis CA CB CC = Current Angle for A-Axis, B-Axis and C-Axis For information: A-Axis = Rotation about X axis in YZ plane B-Axis = Rotation about Y axis in XZ plane C-Axis = Rotation about Z axis in XY plane ------------------------------- WORK PLANE ANGLES -------------------------- WAA and WTA, WAB and WTB, WAC and WTC must be used in the pairs indicated. (See also WVF (Work Volume Face), recommended for use with simple 4-axis Horizontal Machining Centres that can only rotate in 90 deg intervals instead of these variables). WAA, WAB are the angles of plane rotation between the LOCAL Z axis and the GLOBAL Z axis. WAC is the angle of plane rotation around the Z axis, measured from the global X axis. To determine whether the angle is +ve or -ve, think of Xyz, Yzx, Zxy (the order of the letters is always the same - XYZ). If you look down the axis shown below as a CAPITAL letter, the angle is +ve in the direction given by the next letters. eg Xyz - Look down X, angle from Y to Z is +ve. Zxy - Look down Z, angle from X to Y is +ve (Conventional 2D view) WAA = Angle about GLOBAL X axis ie looking down the X axis (think Xyz for +/-) WAB = Angle about GLOBAL Y axis ie looking down the Y axis (think Yzx for +/-) WAC = Angle about GLOBAL Z axis ie looking down the Z axis (think Zxy for +/-) WTA, WTB and WTC are the angles of TILT required to achieve the correct direction for a sloping Work Plane after WAA or WAB or WAC have been applied. For example if the work plane is sloping in a particular way, WAA will give the angle of plane rotation around the Global X axis and WTA is the plane tilt angle around the new local X. ------------------------------- POLAR ANGLES -------------------------------- PAR = Polar Absolute Radius value = SQR(AX^2 + AY^2) = AD/2 PIR = Polar Incremental Radius value PCR = Polar Current Radius value Polar values are LOCAL values on the Current Work Plane. In Lathe C-Axis, these are the same as the GLOBAL values. ----------------------- ORIGIN SHIFTS FOR SUBROUTINES --------------------- OX OY = Difference between location of original and location of copy. Machine will add OX OY to all AX AY values automatically. eg Put G52 X[OX] Y[OY] in $120 and G52 X0.0 Y0.0 in $130 to cancel. APS will put these lines before and after the subroutine call. GX GY = Absolute coordinates of start of subroutine to be copied. APS will put a rapid to the start of the copy before calling the subroutine, and the machine will think it is at the start of the shape described in the subroutine, but it is in fact at the copy position. Use $100 eg $100 BEGIN Subroutine :[SN] G92 X[GX] Y[GY] When the copy is finished, GX and GY are the coordinates of where APS thinks the tool is (ie end point of the subroutine + displacement). So to cancel the displacement, put G92 X[GX] Y[GY] in $130 to restore the X Y origin to the previous values before the subroutine was called. -------------------------------- GENERAL ---------------------------------- R = Radius of arc in a machining feed move AIA = Arc Included Angle (measured from centre of arc between start and end) ASA = Arc Start Angle (Angle measured from centre of arc to start of arc) T = Tool number - for this operation OFS = Tool Offset Number (Not cutting offset - see OFF below) NT = Next Tool - to be used in next operation TC = Tool Compensation Code - Cancel, Right or Left eg G40/G41/G42 CLT = Coolant code - None/Mist/Flood/Through Tool eg M09/M07/M08 etc OFF = Offset = TR (Tool Radius) + Stock for Mill, Beam Offset for Flame/Laser HD = Hole Diameter S = Spindle speed MS = Maximum Spindle Speed F = Machining Feed speed N = Next NC line number - auto incremented except if in $IF $LET etc. SN = Sub-routine number - auto incremented by APS ROT = Code for CW or CCW spindle rotation (eg M03 M04) TIM = Total machining time in seconds DAT = Current DATE + TIME found in computer - format as printed with NC code AR = AREA (Total or Parts) found from Utils `Estimate Area' (Not LATHE) NSH = Total Number of Sheets needed for NESTING SHN = Sheet Number in sequence of sheets for NESTING PAC = Path Angle Change. +ve if to left, -ve if to right OPN = Operation Number CWP = Current Work Plane (Values are 0 to 5) 1 = XY, 2 = XZ, 3 = YZ, 4 = 3D For C-Axis Lathe: 0 = Conventional Turning, 5 = Developed Diameter FNM = File Name (File Name of NC program on disk) OPD = Operation Description (eg ROUGHING, POCKETING etc) TNM = Tool Name (File Name in Tool Library) TNT = Tool Note (Note entered when defining the tool) MNM = Material Name (File Name in Material Library) MC = 1 if Machine Tool (G41/42) Compensation applies to path, 0 if not IN = 1 if Line or Arc is a `Tool Lead In' move OUT = 1 if Line or Arc is a `Tool Lead Out' move FF = 1 if Line or Arc is First Feed cut move (may be Lead-In line or arc) LF = 1 if Line or Arc is Last Feed cut move (may be Lead-Out line or arc) FFP = 1 if this is First Feed cut in the Path (after Lead-In lines / arcs) LFP = 1 if this is Last Feed cut in the Path (before Lead-Out lines /arcs) LRB = 1 if rapid is Last Rapid Before cutting, 0 if not (test in $25 / $27) FRA = 1 if rapid is First Rapid After cutting, 0 if not (test in $25 / $27) SUB = 1 if Line or Arc is inside a Subroutine FTC = 1 if Rapid move is From Tool Change position TTC = 1 if Rapid move is To Tool Change position OPT = Operation Type: = 1 for Mill/Turn = 2 for Drilling/Tapping etc LP = 1 if current arc is part of a Loop at an external corner, 0 if not GLX,GLY,GLZ = Distances from Global to Local Origin in Local X,Y,Z coordinates LDX,LDY,LDZ = Distances from the Old to the New Local Origin in Local coords. LXW, LYW, LZW = Lowest X Y Z Global coordinates of Work Volume HXW, HYW, HZW = Highest X Y Z Global coordinates of Work Volume See also VARIABLES for User Defined Cycles at end of this file. For MILL only: TT = Tool Type as in Define Tool icons: 1=Flat 2=Bull 3=Ball 4=Drill 5=Tap TR = Tool Radius (Used for Tip Radius in Lathe) TD = Tool Diameter TL = Tool Length THP = Thread Pitch for tapped hole NX and NY = Next X and Y values. Only available in $80 - Tool Change. WLX, WLY, WLZ = Lowest X Y Z coordinates of material used. WHX, WHY, WHZ = Highest X Y Z coordinates of material used. For MILL (and C-Axis Lathe) Drill/Tapped holes: ZS = Z value for traversing at a SAFE level. eg to avoid clamps or islands ZR = Z value to RAPID down to before feeding to drill or tap for example ZM = Z value of the MATERIAL TOP ZB = Z value of the BOTTOM of the hole to be drilled/tapped ZP = Z value of the PECK DISTANCE if a hole is to be peck drilled DW = Dwell at bottom of bored hole. Applies only for boring For 3D MILL (4 or 5 axis) only: TAX,TAY,TAZ = X Y Z components of unit vector along the tool axis YZA or AA = Y Z plane rotation Angle (about X axis) ZXA or AB = Z X plane rotation Angle (about Y axis) XYA or AC = X Y plane rotation Angle (about Z axis) SNX,SNY,SNZ = X Y Z components of unit vector along line normal to the surface at the current tool contact point For LATHE only: THD = Thread Diameter (Conventional Turning, Thread is on Centre-Line) TR = Tool Tip Radius (Used for Tool Radius in MILL) NX and NZ = Next X and Z values. Only available in $80 - Tool Change. HN = Head or Turret Number FP = Code for Feed/min or Feed/Revolution CS = Code for Constant Spindle or Surface speed TOX = Turret Offset in X - from tool programming point to turret reference X TOZ = Turret Offset in Z - from tool programming point to turret reference Z DDP = Diameter of Developed Part (for C-Axis) For WIRE EDM only: ETA = Taper angle of wire - for single shape only, NOT 4-axis EU = Difference between X on Auxiliary surface and X on Programming surface EV = Difference between Y on Auxiliary surface and Y on Programming surface EK = Difference between Arc Centre X on Aux. and Arc Centre X on Prog. surface EL = Difference between Arc Centre Y on Aux. and Arc Centre Y on Prog. surface EZP = Z value of Programming surface EZA = Z value of Auxiliary surface AGQ = AGIE Q Angle for Lines and Corners: Iso or Conic or Programmed Radius AGR = AGIE R Angle for Lines (Never used for Corners) AGC = AGIE Corner: 1 = Conic, 2 = Iso Radius, 3 = Programmed radius For PUNCH only: See AIA and ASA in general list above - used by some punch controllers PNI = Punch/Nibble Interval TLA = Tool Angle (only applies to Auto-Index station - see ATI) ATI = 1 if station can Auto-Index, = 0 if not NHT = Number of Hits to produce a slot or holes etc PIX = Punch Interval in X for a rectangular grid array PIY = Punch Interval in Y for a rectangular grid array NHX = Number of Hits along X axis for rectangular grid array NHY = Number of Hits along Y axis for rectangular grid array SHX = Sheet Size in X direction SHY = Sheet Size in Y direction SHZ = Sheet Thickness WIM = Work Area Incremental Move from LAST position WAX = Work Area Lower Left Corner X position. Screen X0 is datum WAY = Work Area Lower Left Corner Y position. Screen Y0 is datum RAX = Rams Centre Point X position. Screen X0 is datum RAY = Rams Centre Point Y position. Screen Y0 is datum C1X, C2X, C3X ... C9X = Clamp Reference X position. Screen X0 is datum C1Y, C2Y, C3Y ... C9Y = Clamp Reference Y position. Screen Y0 is datum NCL = Number of Clamps ------------------------ NOTES about APS VARIABLES ------------------------* Simple APS variables (X Y Z N etc) mean the NEXT value of X Y Z or N. eg [AX] = Absolute value of next X. [IZ] = Incremental value to next Z so that N[N] G01 X[AX] Y[AY] might produce N20 G01 X12.35 Y7.85 CX CY CZ etc mean the CURRENT value and these must be ABSOLUTE values only, so for example G0 Z[CZ+IZ/2] means rapid half-way to the next Z level. Modal values will not be put into the NC code if the value has not changed and $502 includes the value (and $MODAL OFF does not precede the NC code template) so feed move lines should include ALL possible word addresses - for example G1 X[AX] Y[AY] Z[AZ] F[F] might produce just G1 X12.12 Y2.5 if the Z and F values are modal and have not changed. You can use any mathematical expression inside [ ] brackets. For example G4 R[R] C[ATAN2((CY-AJ),(CX-AI))] I[AI] J[AJ] is a valid NC code template. Valid expressions can include: + - * / SIN() COS() TAN() ATAN() ATAN2(,) SQR() ABS() ----------------- ASSIGNMENTS and CONDITIONALS etc ------------------------- The $ starting these commands must be the first character on the line. $MODAL ON - Turns modal codes ON (Modal ON is the default if not specified). $MODAL OFF - Turns modal codes OFF. Applies only for the $number that defines the NC code template, then modal is switched ON again automatically eg $50 Feed CW arc (for Heidenhain - needs both X and Y for all arc centres) $MODAL OFF ''All values will be set to non-modal. See below. [N] CC X[AI] Y[AJ] [N] C X[AX] Y[AY] DR- R[TC] F[F] M ''All values will be reset to modal at the end of the $num $MODAL ON and $MODAL OFF can apply to only some of the values set in $500-504 so the above could be: $MODAL OFF, X Y ''Only X and Y will be set to non-modal. [N] CC X[AI] Y[AJ] [N] C X[AX] Y[AY] DR- R[TC] F[F] M $-------------------------------------------------------------- $LET - Begins a line that assigns a value to a user variable. $IF - Begins a conditional statement. $ELSE - Optional, to allow alternative if first condition is not true. $ELSEIF - Optional, allows another condition if previous is not true. $ENDIF - Ends conditional lines. Normally followed by the NC template. The + - * / < = > operators are used in conditional statements with the normal arithmetic meanings - `plus' `minus' etc. This allows a simple way of making very flexible conditional statements: eg Normal OR : $IF MC + FF > 0 If MC=1 or FF=1 or both = 1 Exclusive OR : $IF MC + FF = 1 If either MC=1 or FF=1, but not both AND : $IF MC + FF = 2 means if MC=1 and FF=1 NOT EQUAL to : $IF HEAD <> OLD_HEAD Examples of conditionals - these 3 versions produce the same NC code: Version 1 Version 2 Version 3 $IF AX > 2000 $LET Z_DOWN = "Z" $IF AX <= 2000 $LET Z_DOWN = "E" $IF AX > 2000 G1 Z[AZ] F[F] $ELSE $LET Z_DOWN = "E" $ELSE $LET Z_DOWN = "Z" $ENDIF G1 E[AZ] F[F] $ENDIF G1 [Z_DOWN][AZ] F[F] G1 [Z_DOWN][AZ] F[F] --------------------------- NUMBER FORMATS ---------------------------------- Number formats can be: Examples:- 1 = Normal Decimal 12 becomes 12.0 2 = Decimal, no trailing zero if integer 12 12. 3 = Decimal, no point or zero if integer 12 12 4 = Leading Figures (eg 3 lead, 3 trail) 12.1234 012123 5 = Trailing Figures (eg 3 lead, 3 trail) 12.1234 _12123 6 = Normal Integer, no lead or trail spaces 12 12 7 = Integer with leading zeros (eg 4 lead figs) 12 0012 8 = Integer with leading spaces (eg 4 lead figs) 12 __12 9 = Integer with trailing spaces (eg 4 lead figs) 12 12__ 10= Decimal, Fixed Lead & Trail (eg 3 lead, 3 trail) 12 012.000 Whether a point (.) or comma (,) is the decimal separator is set by $515 Normally, use format 1 2 or 3 for X Y Z R I J K values, format 6 for Feed and Speed, and format 7 for Tool Numbers and Subroutines. The answer to `Leading figures' has several useful effects: ALL formats : If set to 0, the figures before the point will be as many as required, with no leading zeros or spaces. Format 4 and 7 : Number is preceded by zeros to give the correct field Format 5 and 8 : Number is preceded by spaces to give the correct field Format 9 : Number is followed by spaces to give the correct field The answer to `Figures after point' is needed for DECIMAL formats (1,2,3). Although LEADING/TRAILING formats (4 and 5) do not use a decimal point, the value given is used to set the calculation accuracy for rounding if format 4 is selected, and the number of trailing numbers if format 5 has been selected. It is ignored and can be 0 for INTEGER formats (6,7,8) for line numbers and feed speeds for example. NOTE: The `Figures after point' value for X Y (Z) moves is used by APS to determine if very small moves are to be discarded, and MUST be set to a sensible value for this purpose (normally 3 or 4), even if the machine moves are to be output as integers. RAPIDS and TOOL CHANGE TIMES: Enter typical values for the machine. Use MM/min or IN/min as appropriate for the Post. Remember - you must use inch tools for a job dimensioned in inches, and metric tools for one in millimetres. Time to change tool should be a typical value in seconds - even if manual tool changing is required. ---------------------------- USER VARIABLES -------------------------------- ALL user variables (as many as required) MUST be declared at $1000 - see below. Take care not to use APS reserved variables (see above). A variable MUST start with a letter, and the value can be either text or a number. A format must be set for the variable in $1000. If the variable is a number, the calculation accuracy will always be to maximum precision, but when the value is put into the NC code it will be output with the format set for X Y (Z) values unless another format is set inside ( ) brackets when the variable is declared at $1000. For example MY_VAR (7,2,0) means that when MY_VAR is put into the NC code it will be an integer with leading zeros to make a field width of 2 so that 03 would be output if the calculated value was 3.123. Any text in the Post Template (which defines the NC code to be produced) that is not inside [ ] brackets will be taken to be literally text. When the variable VALUE (number or text) is required it must be inside [ ] brackets eg G0 Z[Z_UP] or G0 Z[Z_UP + 3]. Note: No [] around variables INSIDE an expression to be evaluated. If a prompt is not required - eg if the variable is just to be used in an expression - only the variable name and format should be declared. The prompt is displayed in the bottom prompt line, unless the value is asked for as part of a User Defined Code dialog box ($1100 - $1119) - in that case the prompt appears in the second dialog box. If a variable is declared in $1000 with = "Text in quotes" no prompt will be shown - each time the variable is found in the template the text will be entered in to the NC program, unless it is assigned another value with a $LET statement somewhere in the Post. Apart from assigning an initial value as text to a variable in this way, complex assignments of values to variables cannot be done in $1000 - use $LET for this in the Post. The value of a user variable will be asked for when it is FIRST found in the Post template as NC code is produced. If there is no prompt, make sure that you either assign text in $1000 as the initial value, or use a $LET statement to assign a value before it is to be used in the Post - a $LET statement in $10 will ensure this. A user variable retains its value for all subsequent occurences unless it is reset by one of the following: 1. Each time it is asked for in a User Defined Code section ($1100-$1119). 2. Each time it is found in a $LET statement. eg $LET Z_UP= ZM + 5. 3. $LET VARIABLE_NAME = "" will clear the current value. 4. $LET VARIABLE_NAME = "?" will force the prompt (if there is one) to be displayed again next time it is found in the template. All user variables are cleared if all the toolpaths are deleted (leaving only geometries in APS) or if a Post is selected - including the current Post. This allows you start with a `clean sheet' if you have made mistakes. --------------------- DECLARATION of USER VARIABLES at $1000 ---------------- ALL user variable NAMES and FORMATS must be declared. A PROMPT with a default value can be declared if one is required. Variable NAMES must start with a letter, and can have up to 20 characters. Names must not have spaces - use UNDERLINE (SHIFT -) to separate parts for clarity eg X_ZERO. PROMPTS can be up to 50 characters and can include a default in < >. The FORMAT of a variable is declared inside ( ) brackets. This sets the format used when the variable is output in the NC code. For a TEXT variable: (" ") or ("") means the text is to be output exactly as typed or assigned. ("8") means that only the first 8 characters are output. ("_8") means leading spaces will be added if necessary to make a field of 8. ("8_") means trailing spaces will be added if necessary to make a field of 8. For a NUMBER, put ( ) if the output format is to be the same as the X Y (Z) moves, or if it is only used for calculations and is not output. For a number with a different format, put (Format, Lead figs, Trail figs). Regardless of the output format, numbers used in calculations or assignments are always used to maximum precision. Some examples: $1000 PROGNUM (" ") "Enter Program Number" ''Text, and will be output as typed PROGNAME ("8_") "Program Name ''Text, 8 chars inc. trail spaces if necessary. MY_NAME (" ") "Programmer " SAFE_Z ( ) "Enter Safe Z Level <5>" ''Will be output in X Y (Z) format HEAD (6,0,0) "Enter Head Number" ''Will be output as an integer WEIGHT ( ) ''No prompt - only used for calculations DENSITY ( ) "Density (kg/cu M) <7800>" THICK ( ) "Material Thickness (mm)" OPMSG1 (" ") = "(Adjust clamps)" ''Note the = sign - see below NOTES: 2 single apostrophes '' precede a local remark anywhere in the Post. HEAD (6,0,0) means output as integer, no leading or trailing spaces. WEIGHT No prompt, so this variable is for use in calculations only. OPMSG1 The = means that this is text to be inserted just as shown unless it is assigned a new value in the Post. --------------------------- USER DEFINED CODE ------------------------------- When the option User Defined Code is selected from the MACHINE menu, a dialog box appears showing all of the first lines following each $number in the range $1100 - $1119. When one of these is selected, a second dialog box appears with the prompts declared at $1000 for the variables. Lines showing the variables to be asked for must be followed by a line with $ as the first character, then the template for the NC code to be added or inserted into the NC program at the place selected. Each time User Defined Code is selected, the variables assume the new values entered. Some examples :- Explanation: $1100 Select new head ''This is only a remark for information Change Head ''This appears in the first dialog box HEAD ''See $1000 for prompt to be displayed SAFE_Z ''As above - prompts appear in 2nd box $ -------------- NC lines to be entered into program follow N[N] G0 Z[SAFE_Z] N[N] G82[HEAD] 'Head is [HEAD] ''Remark after single ' appears in code $ -------------- ends $1100 user defined code $1101 Change Program Number New Program Number PROGNUM $ -------------------- NC lines to be entered into program follow :[PROGNUM] $ --------------------- ends $1101 user defined code $1102 Calculate Parts Weight Weight of Parts DENSITY THICK $ -------------------- NC lines to be entered into program follow $LET WEIGHT = (THICK*AR*DENSITY)/1e9 '' AR is APS variable for area N[N] ( Parts Weight is [WEIGHT] kg) $ -------------------- ends $1102 user defined code $1103 Enter fixed message to operator without a prompt Op Msg (Clamps) $ -------------------- NC lines to be entered into program follow N[N] [OPMSG1] ''This is text only but [ ] are still required $ -------------------- ends $1103 user defined code --------------------------- DIRECT INPUT OF NC CODE ------------------------- This is not a part of the Post Processor - this note is for your information. Regardless of the Post you are using, if you select User Defined from the MACHINE menu then select Direct Input from the first dialog box, you can enter up to four lines of text anywhere you wish in the NC code. $--------------------------- USER DEFINED CYCLES --------------------------- You must read the manual - this is a brief summary only: NC templates are pre-defined in the Post at $1200 to $1249, with one $number used for each section. Each entry must begin with the title for that section. All the first lines following each $number will be shown in a 2nd dialog box. VARIABLES (Apply to this section only): XP and YP = X,Y coordinates of point picked X1 and Y1 = Start X,Y of the element (arc or line) picked X2 and Y2 = End X,Y of the element (arc or line) picked XC and YC = X,Y of arc or circle centre LEN = Length of line or arc picked RAD = Radius of arc or circle picked DA1 = Direction Angle of the tangent at the start of an arc or line DA2 = Direction Angle of the tangent at the end of an arc (for line, DA1=DA2) INA = Included Angle of arc (always +ve ie CCW, regardless of arc direction) CW = 1 if arc or circle is CW, = 0 if CCW L_R = 1 if Ghost Tool is on left, 0 if centre, -1 if on right I_O = 1 if Ghost Tool is inside, 0 if centre, -1 if outside, -2 if open geometry FUNCTIONS: Programming functions eg $GOTO, $LL, $LET, $IF, $ELSE etc and $MSG can be used plus commands that apply only to this section: $PICK_POINT / S, $PICK_LINE / S, $PICK_ARC / S, $PICK_CIRCLE / S, $END_PICK EXAMPLE: $1200 This asks for one hole only ''Remark for info only Single Hole Drill + Dwell ''This title (and all 1st lines ''following each $number) ''is in the first dialog box. SAFE_Z '') These variables HOLE_DEPTH '') will be asked for DRILL_FEED '') in the second DWELL '') dialog box. DRILL_DIAM '') All must be declared TOOL_NUM '') in $1000 - see above. $ ------------------------- NC lines to be entered into program follow $PICK_CIRCLE Pick One Circle '' Pick One Circle will appear on bottom line N[N] (DRILL WITH DWELL: DRILL DIAM = [drill_diam] DWELL = [dwell]) N[N] T[TOOL_NUM] $let drill_speed = 2000/drill_diam N[N] S[drill_speed] N[N] G0 Z[SAFE_Z] N[N] X[XC] Y[YC] N[N] G1 Z[HOLE_DEPTH] F[drill_feed] N[N] G4 X[DWELL] N[N] G0 Z[SAFE_Z] $ ------------------------- ends $1200 user defined cycle $-------------------------- MACRO ATTRIBUTES $3000 Attributes from the API (via eg VB macros) can be assigned to array PAT(N) PAT = Path Attribute, and N can be any number linked to an attribute name. Eg $3000 1 = LicomUKDWMultiDrillMasterSlave 2 = LicomUKDWMultiDrillSlaveNumbers See UTILS | VBA Macros | AlphaCAM API Help for more details