505,963 active members
3,187 visitors online
Register for free
Login
Results 1 to 3 of 3
  1. #1
    Registered
    Join Date
    Apr 2010
    Posts
    0

    need help editing post

    we have alot of old mastercam version 7 parts that we need posted for one of our new machines. It is a five axis with a c axis that rotates in the xy plane and a A axis that rotates in the xz plane.

    we have severel old post for version 7 but am unable to figure out how to change the way the machine figures the angles.

    i thing this line is what is needing changed, but not sure to what

    pgetab # Get A and B axis angles
    b=90-atan2(vtoolz,vtoolx)
    a=atan(-vtooly/(sqrt(vtoolx^2+vtoolz^2)))
    pchkab


    whole post:


    # ---------------------------------
    #| MASTERCAM MP POST PROCESSOR |
    #| CNC Software, Inc. |
    #| Control Model: Cincinnati |
    #| Machine Model: v30 |
    #| PST File Name: MPCINC.PST/TXT |
    #| Executable : MP.EXE 3.06 |
    # ---------------------------------
    #
    # ---------------
    #| REVISION LOG |
    # ------------------------------------------------------------------------
    # Programmers Note:
    # CNC 5/12/94 - Initial post setup for Mill5
    # 1.0 Jph 08/19/94 Initial source control check-in
    # 1.1 jph 08/24/94 Correct coolant text
    # 1.2 jph 09/02/94 Ques. 86. was 0.2 delay
    # 1.3 pdr 09/06/94 Updated and corrected numbered questions
    # 1.4 pdr 09/07/94 Updated reverse post name (q 93.)
    # 1.5 bkr 10/02/95 fixed drill 5axis problem
    # 1.6 BPH MODIFIED TO RAMB PST
    #
    # ---------------
    #| FEATURES: |
    # ------------------------------------------------------------------------
    # Users Note:
    #
    # --------------------------------------------------------------------------
    # DEBUG/PROGRAM SWITCHES, debugging and program switches
    # --------------------------------------------------------------------------
    bug1 : 1 # 1 = Output post to screen, 2 = output leader to screen
    bug2 : 0 # Append postline labels, non-zero is column position?
    bug3 : 0 # Append whatline no. to each NC line?
    bug4 : 0 # Append NCI line no. to each NC line?
    whatno : 0 # Do not perform whatline branches?

    rpd_typ_v7 : 1 #Use Version 7 style contour flags?
    strtool_v7 : 2 # Use Version 7 toolname, 1= path components, 2=string
    get_1004 : 1 # Find gcode 1004 with getnextop?

    # --------------------------------------------------------------------------
    # FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta
    # --------------------------------------------------------------------------
    fs 1 0.3 #Decimal, absolute, 4 place
    fs 2 0.4d #Decimal, delta
    fs 3 1 0 #Integer, not leading
    fs 4 2 0l #Integer, two leading
    fs 5 3 0l #Integer, three leading
    fs 6 4 0l #Integer, four leading
    fs 7 0.1 #Decimal, absolute, 1 place
    fs 8 0.2 #Decimal, absolute, 2 place
    fs 9 0.3 #Decimal, absolute, 3 place
    fs 10 0 4t #No decimal, absolute, four trailing
    fs 11 0.4t #Decimal, absolute, four trailing

    # --------------------------------------------------------------------------
    # FORMAT ASSIGNMENTS
    # --------------------------------------------------------------------------
    # Axis output formats - Linear
    # --------------------------------------------------------------------------
    fmt X 1 xd # X delta axis position x+(vtoolx*(gauge+pivot))
    fmt Y 1 yd # Y delta axis position y+(vtooly*(gauge+pivot))
    fmt Z 1 zd # Z delta axis position z-(vtoolz*(gauge+pivot))-(gauge+pivot)
    fmt X 1 xdd # X axis position feed in and out of part along tool axis
    fmt Y 1 ydd # Y axis position " "
    fmt Z 1 zdd # Z axis position " "
    fmt X 1 xrd # X delta rapid position from tc xr+(vtoolx*(gauge+pivot))
    fmt Y 1 yrd # Y delta rapid position from tc yr+(vtooly*(gauge+pivot))
    fmt Z 1 zrd # Z delta rapid position from tc zr+(vtoolz*(gauge+pivot))
    fmt X 1 xfd # X delta feedto position
    fmt Y 1 yfd # Y delta feedto position
    fmt Z 1 zfd # Z delta feedto position
    fmt X 1 x # X axis position
    fmt Y 1 y # Y axis position
    fmt Z 1 z # Z axis position
    fmt X 1 xr # X rapid position from tool change
    fmt Y 1 yr # Y rapid position from tool change
    fmt Z 1 zr # Z rapid position from tool change
    fmt X 1 xh # X home position
    fmt Y 1 yh # Y home position
    fmt Z 1 zh # Z home position

    # --------------------------------------------------------------------------
    # Axis output formats - Circular
    # --------------------------------------------------------------------------
    fmt I 2 i # Arc center description in X
    fmt J 2 j # Arc center description in Y
    fmt K 2 k # Arc center description in Z
    fmt R 1 arcrad # Arc Radius
    fmt R- 1 arcradm # Arc Radius over 180 degree sweep

    # --------------------------------------------------------------------------
    # Axis output formats - 5 axis ( 2 tilting heads )
    # --------------------------------------------------------------------------
    fmt A 9 a # A axis mounted on b ( A axis rotation about x axis )
    fmt B 9 b # B axis rotation ( B axis rotation about y axis)
    fmt A 9 aa # A axis mounted on b ( A axis rotation about x axis )
    fmt B 9 bb # B axis rotation ( B axis rotation about y axis)
    fmt A 9 atv # A axis mounted on b ( A axis rotation about x axis )
    fmt B 9 btv # B axis rotation ( B axis rotation about y axis)
    fmt 9 xangle
    fmt 9 yangle

    # --------------------------------------------------------------------------
    # Program & Sequence number format
    # --------------------------------------------------------------------------
    fmt "O" 6 progno # Program number
    fmt N 3 n # Sequence nos.

    # --------------------------------------------------------------------------
    # Tool format
    # --------------------------------------------------------------------------
    fmt T 3 t # Tool No
    fmt T 3 first_tool# First Tool Used (bldnxtool: yes)
    fmt T 3 next_tool # Next Tool Used (bldnxtool: yes)
    fmt D 3 diacomp # Diameter Offset No
    fmt H 3 tlngno # Length Offset No

    fmt "TOOL " 4 tnote # Note format
    fmt "DIA. OFF. - " 4 toffnote # Note format
    fmt "LENGTH - " 4 tlngnote # Note format
    fmt 11 tldia # Note format
    fmt "MSG, GAUGE LENGTH = " 11 gauge # Note format
    fmt "MSG, PIVOT DISTANCE = " 11 pivot # Note format
    fmt 3 awarn # Note format
    fmt 3 bwarn # Note format


    # --------------------------------------------------------------------------
    # Spindle Speeds & Feedrate output formats
    # --------------------------------------------------------------------------
    fmt S 6 speed # Spindle Speed
    fmt F 7 fr # Feedrate
    fmt F 7 frx # Tool tip Feedrate 5 axis
    fmt F 7 rapidfr # Rapid Feedrate
    fmt F 7 frdeg # Feedrate for rotary
    fmt M 3 gear # Gear range
    fmt 3 chrdif # character count differance

    # --------------------------------------------------------------------------
    # Drill variable formats
    # --------------------------------------------------------------------------
    fmt G 3 drillref # Initial / Reference Toggle (G98/G99)
    fmt P 1 dwell # Dwell
    fmt X 1 initx # Initial Height X Point ( 5 - axis drill )
    fmt Y 1 inity # Initial Height Y Point ( 5 - axis drill )
    fmt Z 1 initz # Initial Height Z Point ( 5 - axis drill )
    fmt Z 1 initht # Initial Height
    fmt X 1 refx # Reference Height X Point ( 5 - axis drill )
    fmt Y 1 refy # Reference Height Y Point ( 5 - axis drill )
    fmt Z 1 refz # Reference Height Z Point ( 5 - axis drill )
    fmt R 1 refht # Reference Height
    fmt X 1 depthx # Depth X Point ( 5 - axis drill )
    fmt Y 1 depthy # Depth Y Point ( 5 - axis drill )
    fmt Z 1 depthz # Depth Z Point ( 5 - axis drill )
    fmt Z 1 depth # Depth
    fmt K 1 peck1 # First peck increment (positive)
    fmt 1 peck2 # Second or last peck (positive)
    fmt 1 peckclr # Safety distance
    fmt 1 retr # Retract height
    fmt F 8 frplunge # Plunge feedrate in drill cycles

    # --------------------------------------------------------------------------
    # Miscellaneous output formats
    # --------------------------------------------------------------------------
    fmt M 5 ssrange # Spindle Speed Range

    # --------------------------------------------------------------------------
    # INITIALIZE - initialize system variables and define user variables
    # --------------------------------------------------------------------------
    andflag : 0 # boolean
    modalflg : 0 # Molal Flag for coolant
    ask : 0 # Flag whether to ask question #1
    arcoutput : 0 # 0 = IJK, 1 = R no sign, 2 = R signed neg. over 180
    breakarcs : 1 #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs

    stagetool : 0 # 0 = Do not pre-stage tools, 1 = Stage tools
    use_gear : no # Set to yes to output gear range codes
    getnextop : yes # Get next OP code in NEXTOP? yes/no
    rotaxtyp : 4 # 5-axis toolplane rotation (not tombstone)
    omitround : yes # Omit initial rounding of -.NCI data? yes/no
    linarc : no # Linearize arcs? yes/no
    qtoolpln : no # MP386 - Enable tool plane option
    qtoolopt : no # MP386 - Enable tool optimization
    arctype : 1 # Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.
    do_full_arc : 0 #Allow full circle output? 0=no, 1=yes
    helix_arc : 0 #Support helix arc output, 0=no, 1=all planes, 2=XY plane only
    bldnxtool : no # Build next tool table (**** WARNING ****)
    #(*** DO NOT SET TO YES IF DOING FIXED AXIS SURFACE CONTOURING ***)

    ldrcode : 65 # Leader character dec. equiv. (fleader outputs code)
    ncldr : 20 # No. of leader characters (fleader outputs code)
    nobrk : no # Omit breakup of x/y & z rapid moves
    omitcrlf : no # Omit CR/LF
    omitrefht : no # Don't use reference height on first non-canned Z move
    omitseq : no # Omit sequence no.
    omitz : no # Omit first Z movement for non-canned-cycles
    progname : 1 # Use uppercase for program name
    scalex : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k
    scaley : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k
    scalez : 1.0 # Scaling of .NCI at input - x,y,z,i,j,k
    seqmax : 9999 # Max. sequence no.
    skipmotest: no # Skip motion test in linear
    spaces : 0 # No. of spaces to add between fields
    tooltable : 0 # Read for tool table and pwrtt (**** WARNING ****)
    #(*** DO NOT SET TO YES IF DOING FIXED AXIS SURFACE CONTOURING ***)

    absswp : 0 # Absolute sweep
    drlgsel : -1 # Drill Select Initialize
    maxfrdeg : 999 # Limit for feed in deg/min
    absinc : 0 # Absolute/Incremental toggle for modality
    tcnt : 0 # Count the number of tool changes
    adelta : 0 # Calculation for deg/min
    ldelta : 0 # Calculation for deg/min
    zdelta : 0 # Calculation for deg/min
    alzdelta : 0 # Calculation for deg/min
    frdelta : 0 # Calculation for deg/min
    frdegcalc : 0 # Calculation for deg/min
    circum : 0 # Calculation for deg/min
    rotstrt : 1 # Flag for first rotary position
    rapidfr : 300 # Rapid feedrate
    tpln : 0 # 1=Tool Plane used 0=Tool plane not used
    atv : 0 # Tool angle from tool plane
    btv : 0 # Tool angle from tool plane
    xa : 0 #
    ya : 0 #
    za : 0 #
    lx : 0 #
    ly : 0 #
    lz : 0 #
    lxd : 0 #
    lyd : 0 #
    lzd : 0 #
    len1 : 0 #
    len2 : 0 #
    frx : 0 # 5-axis calculated feedrate
    frxnci : 0 # 5-axis nci feedrate
    xdd : 0 # 5-axis x value
    ydd : 0 # 5-axis y value
    zdd : 0 # 5-axis z value
    rpnlxdd : 0 # 5-axis rapid z plane x value
    rplnydd : 0 # 5-axis rapid z plane y value
    rplnzdd : 0 # 5-axis rapid z plane z value
    rl : 0 # retract to clearance plane length
    typ : 0 # 5-axis cut type
    prvx : 0
    prvy : 0
    prvz : 0
    prvxd : 0
    prvyd : 0
    prvzd : 0
    fedratmin : 0 # minimize feedrate chances
    gauge : 0 # tool gauge length
    chrexced : 3200000# Total number of charaters
    chrdif : 0 # difference between nchar and current char count
    aaxexced : 20 # A axis max angle
    baxexced : 20 # B axis max angle
    chka : 0 # A axis check variable
    chkb : 0 # B axis check variable
    atc : 0 # Tool change toggle
    d : 0 # A AXIS + or -
    arcerror : 0 # ERROR FLAG FOR ARCS OVER 650 RADIUS
    awarn : 0 # FLAG FOR A AXIS OVERTRAVEL
    bwarn : 0 # FLAG FOR B AXIS OVERTRAVEL
    vtlngx : 0 # vector tool length (used when 1014 line is used)
    vtlngy : 0 # vector tool length (used when 1014 line is used)
    vtlngz : 0 # vector tool length (used when 1014 line is used)
    pivot : 5. # Machine Pivot Distance

    # Parameters for lead-in and lead-out - 5 axis only
    # See LEADIN.MAN
    # ************************************************** ************
    # ** DOT NOT CHANGE ANY OF THE LEAD-IN OR LEAD-OUT VALUES **
    # ************************************************** ************
    ldinl1 : .0000001 #lead-in 1 length (no output if zero)
    ldina1 : 90 #lead-in 1 angle (90 = along tool axis)
    ldinl2 : 0 #lead-in 2 length (no output if zero)
    ldina2 : 90 #lead-in 2 angle (90 = along tool axis)
    ldoutl1 : .0000001 #lead-out 1 length (no output if zero)
    ldouta1 : 90 #lead-out 1 angle (90 = along tool axis)
    ldoutl2 : 0 #lead-out 2 length (no output if zero)
    ldouta2 : 90 #lead-out 2 angle (90 = along tool axis)

    # --------------------------------------------------------------------------
    # FORMULAS - global formulas
    # --------------------------------------------------------------------------
    ssrange = mi3 # Gear Range Select
    speed = abs ( ss ) # Absolute spindle speed
    arcradm = arcrad # Negative arcrad
    spdlsel = fsg3(ss) # Spindle on selector based on pos. or neg. ss
    diacomp = tloffno+20 # Tool dia offset Number

    # --------------------------------------------------------------------------
    # CANNED CYCLES - select long or short code
    # --------------------------------------------------------------------------
    usecandrill : yes # Use canned cycle for drill
    usecanpeck : yes # Use canned cycle for Peck
    usecanchip : yes # Use canned cycle for Chip Break
    usecantap : yes # Use canned cycle for Tap
    usecanbore1 : yes # Use canned cycle for Bore1
    usecanbore2 : yes # Use canned cycle for Bore2
    usecanmisc1 : yes # Use canned cycle for Misc1
    usecanmisc2 : yes # Use canned cycle for Misc2

    # --------------------------------------------------------------------------
    # Lookup table definitions - for math functions FLOOK and FRANGE
    # --------------------------------------------------------------------------
    flktbl 1 3 # Lookup table definitions - table no. - no. entries
    40 1000 # Low gear range
    41 2500 # Med gear range
    42 5000 # Hi gear range

    # --------------------------------------------------------------------------
    # Strings - String labels must start with 's' - they are not pre-assigned
    # --------------------------------------------------------------------------
    #Select operation note
    sop00 NULL # String definition
    sop01 2D-CONTOUR # " "
    sop02 3D-CONTOUR # " "
    sop03 DRILL/MISC # " "
    sop04 POCKET # " "
    sop05 RULED # " "
    sop06 2D-SWEPT # " "
    sop07 3D-SWEPT # " "
    sop08 REVOLVED # " "
    sop09 LOFT # " "
    sop10 COONS # " "
    sop11 TRIM # " "
    sop12 FILLET # " "
    sop13 ROUGH # " "
    sop14 OP14 # " "
    sop15 OP15 # " "

    sopnote # Target string

    fstrsel sop00 opcode sopnote

    # --------------------------------------------------------------------------
    # Select motion G code
    sg00 G0 # Linear movement at rapid feedrate
    sg01 G1 # Linear movement at feedrate
    sg02 G2 # Circular interpolation CW
    sg03 G3 # Circular interpolation CCW
    sg04 # *
    sg05 # *
    sg06 # *
    sg07 # fillers
    sg08 # *
    sg09 # *
    sg10 # *
    sg11 G1 # 5 axis linear move

    sgcode # Target string

    fstrsel sg00 gcode sgcode

    # --------------------------------------------------------------------------
    # Select incremental or absolute G code
    sg90 G90 # Absolute G code
    sg91 G91 # Incremental G code

    sgabsinc # Target string

    fstrsel sg90 absinc sgabsinc

    # --------------------------------------------------------------------------
    # Select spindle start
    sm04 M4 # Spindle reverse
    sm05 M5 # Spindle off
    sm03 M3 # Spindle forward

    spdlon # Target string

    fstrsel sm04 spdlsel spdlon

    # --------------------------------------------------------------------------
    # Cutter compensation code
    scc0 "" # Cutter compensation state not changed
    sg40 G40 # Cancel cutter compensation
    sg41 G41 # Cutter compensation left
    sg42 G42 # Cutter compensation right
    sg140 G40 # Last linear move cancel cutter comp (see note)
    # Note: to cancel comp after last move, remove G40 string
    # with sg140 and remove "#" at the postline call "pcancelcc"

    sccomp # Target string

    fstrsel scc0 ccomp sccomp

    # --------------------------------------------------------------------------
    # Select work plane G code
    sg17 G17 # XY plane code
    sg19 G19 # XZ plane code
    sg18 G18 # YZ plane code

    sgplane # Target string

    fstrsel sg17 plane sgplane

    # --------------------------------------------------------------------------
    # Work coordinate system
    sg50 G92 # Work coordinate system G code
    sg51 G92 # " " " " "
    sg52 G92 # " " " " "
    sg53 G92 # " " " " "
    sg54 G54 # " " " " "
    sg55 G55 # " " " " "
    sg56 G56 # " " " " "
    sg57 G57 # " " " " "
    sg58 G58 # " " " " "
    sg59 G59 # " " " " "

    sgwcs # Target string

    fstrsel sg50 mi1 sgwcs

    # --------------------------------------------------------------------------
    # Canned drill cycle string select
    sg81 G81 # drill - no dwell
    sg81d G82 # drill - with dwell
    sg83 G83 # peck drill - no dwell
    sg83d G83 # peck drill - with dwell
    sg73 G73 # chip break - no dwell
    sg73d G73 # chip break - with dwell
    sg84 G84 # tap - no dwell
    sg84d G74 # tap - with dwell (selects left hand)
    sg85 G85 # bore #1 - no dwell
    sg85d G89 # bore #1 - with dwell
    sg86 G86 # bore #2 - no dwell
    sg86d G86 # bore #2 - with dwell
    sgm1 G81 # misc #1 - no dwell
    sgm1d G82 # misc #1 - with dwell
    sgm2 G81 # misc #2 - no dwell
    sgm2d G82 # misc #2 - with dwell

    sgdrill # Target string

    drlgsel = drillcyc * 2 + fsg2 ( dwell ) # 16 possible combinations:
    # drillcyc = 0..7
    # dwell = 0 or non-zero (2 states)
    fstrsel sg81 drlgsel sgdrill

    # --------------------------------------------------------------------------
    # Generate 'sgear' string
    # --------------------------------------------------------------------------
    sgear0 M** # auto gear range
    sgear1 M41 # Low gear range
    sgear2 M42 # Med gear range
    sgear3 M43 # High gear range - selected in parameters by mi3
    sgear

    fstrsel sgear0 gear sgear

    # --------------------------------------------------------------------------
    # Generate 5 axis cut type string
    # --------------------------------------------------------------------------
    styp0 UNKNOWN # Unknown tool path
    styp1 ZIG-ZAG # zig-zag tool path
    styp2 ONE-WAY # one-way tool path
    styp3 CIRCULAR # Circular tool path
    styp4 SWARF # Swarf tool path

    scutyp # Target String

    fstrsel styp0 cuttyp scutyp

    # --------------------------------------------------------------------------
    # Question Definitions - set up questions to be posed during postprocessing
    # --------------------------------------------------------------------------
    fq 1 gauge Enter gauge length for 5-axis tool path:
    fq 2 omitseq Omit line numbers (0=no, 1=yes):

    # --------------------------------------------------------------------------
    # POSTLINES, USER-DEFINED - Postline labels start with 'p'.
    # End a line with ',' to continue on the next line.
    # End a line with ', e' to generate carriage return and linefeed.
    # --------------------------------------------------------------------------
    # Program general output control, user defined
    # --------------------------------------------------------------------------
    pinit # Initialize Vars
    prv_fr = 999.999
    prv_frdeg = 999.999
    prv_frplunge = 999.999
    prv_x = 0
    prv_y = 0
    prv_z = 0
    a = 0.00
    b = 0.00
    linarc = 0
    rotstrt = 1
    whatline = 0

    pchkab # CHECK A & B AXIS FOR OVERTRAVEL
    chka = abs(a)
    chkb = abs(b)
    if chka > aaxexced , awarn = awarn+1
    if chkb > baxexced , bwarn = bwarn+1


    pgetab # Get A and B axis angles
    b=90-atan2(vtoolz,vtoolx)
    a=atan(-vtooly/(sqrt(vtoolx^2+vtoolz^2)))
    pchkab

    p5engage0 # 5 axis engage parameters NO TOOL CHANGE
    pgetab

    p5engage1 # 5 axis engage parameters at tool change
    gauge=t
    q1
    ask = 1
    n,"(",*gauge,")",e
    n,"(",~pivot,")",e
    n,"(",*scutyp," TOOL PATH)",e
    fr = 22.9

    p5engage # 5 axis select engage type
    !xr,!yr
    andflag = 0
    if atc = 0 , andflag = 1 # psof
    if ask = 0, andflag = andflag+1
    if ask = 1, andflag = andflag+2
    if atc = 1, andflag = andflag+4 # ptlchg0
    if atc = 2, andflag = andflag+8 # ptlchg
    if andflag = 2, p5engage1 # ask for gauge length
    if andflag = 5, p5engage1 # ask for gauge length
    if andflag = 9, p5engage1 # ask for gauge length
    if andflag = 3, p5engage0 # don't ask for gauge length
    if andflag = 6, p5engage0 # don't ask for gauge length
    if andflag = 10, p5engage0 # don't ask for gauge length

    pcooloff # Coolant off "M" code output
    "M09"
    modalflg = 0

    pcoolon # Coolant "M" code output
    andflag = 0
    if coolant >= 1 , andflag = 1
    if modalflg = 0, andflag = andflag+1
    if andflag = 2, "M08" # Flood
    modalflg = 1

    pcomment # Manual Entry - COMMENTS (on a block by itself) 1005,1006
    n, "(MSG,", scomm, ")"

    presetab # Reset A and B axis to 0.00
    if a <> 0, "A0."
    if b <> 0, "B0."

    presetab1 # Reset A and B axis to 0.00
    andflag = gcode
    gcode = 0
    if a <> 0, a = 0
    if b <> 0, b = 0
    n, sgcode, a, b, e
    gcode = andflag

    presetab0 # Reset A and B axis to 0.00 (at tool change / no tool change)
    andflag = 0
    if prv_a <> 0 , andflag = 1
    if prv_b <> 0 , andflag = andflag+1
    if andflag > 0, presetab1


    ptoolaxis # Get tool axis from tool plane
    if tpln = 1, p5engage

    andflag = 0
    if tpln = 0 , andflag = 1
    if nextop <> 11 , andflag = andflag+1
    if andflag = 2, presetab0

    andflag = 0
    if atc = 0 , andflag = 1
    if atc = 1 , andflag = 1
    if atc = 2 , andflag = 1
    if tpln = 0 , andflag = andflag+1
    if nextop = 11 , andflag = andflag+1
    if andflag = 3, p5engage


    pfixedax # FIXED AXIS CONTOURING CODE
    rl = (1/vtoolz)*(zh-zr) # retract to clearance plane lngth
    xd = xr+(vtoolx*(gauge+pivot+rl)) # 5 axis x rapid position
    yd = yr+(vtooly*(gauge+pivot+rl)) # 5 axis y rapid position
    n,xd,yd,e

    ptllnth # Output correct tool length comp codes
    if tpln = 0, n,xr,yr,e
    if nextop = 11, ptoolaxis,e
    if tpln = 1, ptoolaxis,e
    if tpln = 1, pfixedax

    andflag = 0
    if tpln = 0 , andflag = 1 # no tool plane used
    if tpln = 1, andflag = 2 # tool plane used
    if nextop = 11, andflag = andflag+2 # 5-axis tool path
    if nextop < 11, andflag = andflag+4 # not 5-axis
    if andflag = 3, n, *zh, pcoolon,e
    if andflag = 5, n, *zr, pcoolon
    if andflag = 6, n, *zh, pcoolon,e
    if andflag = 4, "*** Cant use tool plane with 5-axis tool path ***"

    pabs # Absolute G code output
    absinc = 0
    sgabsinc

    pinc # Incremental G code output
    absinc = 1
    sgabsinc


    pfr # Feedrate W/O Negative Feedrates and
    if fr > 0, fr

    pfrx # Calculate Feedrate Changes on 5 -axis moves (tip speed)
    lx = x-prvx
    ly = y-prvy
    lz = z-prvz
    !x,!y,!z
    lxd = xd-prvxd
    lyd = yd-prvyd
    lzd = zd-prvzd
    len1 = sqrt((lx*lx)+(ly*ly)+(lz*lz))
    len2 = sqrt((lxd*lxd)+(lyd*lyd)+(lzd*lzd))
    frx = 10/(int(10*((fr*len2)/len1)))
    fedratmin = int(frx-prv_frx)
    if fedratmin = 0 , frx = prv_frx
    if frx > 0, fr = frx
    if whatline = 2 , fr = rapidfr
    #if whatline = 3 , *frx
    fr

    pcan # Canned text - cantext = 0, 1, 2, 3
    if cantext = 1, "M01" #optional stop
    if cantext = 2, " " #user option
    if cantext = 3, " " #user option

    pentry # Feed to part from rapid z plane along tool axis
    pgetab
    gcode = 0
    xrd = x+(vtoolx*(gauge+pivot+rl)) # 5 axis x rapid position
    yrd = y+(vtooly*(gauge+pivot+rl)) # 5 axis y rapid position
    zrd = zh+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z rapid pos
    n,sgcode,xrd,yrd,zrd,e
    n,sgcode,a,b,e
    gcode = 11
    prv_xfd = xrd
    prv_yfd = yrd
    prv_zfd = zrd
    xfd = xd #x+(prv_vtoolx*(gauge+pivot)) # 5 axis x feedin position
    yfd = yd #y+(prv_vtooly*(gauge+pivot)) # 5 axis y feedin position
    zfd = zd #z+(prv_vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z feedin position
    fr = 60
    n,sgcode,xfd,yfd,zfd,pfr
    prv_xd = xfd
    prv_yd = yfd
    prv_zd = zfd

    p5retract # 5 axis retract parameters
    a = 0
    b = 0
    n,sgcode,x,y,zh,a,b,fr

    pstZig # Start of 5 - axis Zig-zag
    "5-AXIS ZIG-ZAG START"

    pstOne # Start of 5 - axis One-way
    "5-AXIS ONE-WAY"

    pstCir # Start of 5 - axis Circular
    "5-AXIS CIRCULAR"

    pstSwf # Start of 5 - axis Swarf
    frxnci = fr
    pchkab
    pentry
    fr = frxnci
    !x,!y,!z

    pmidZig # Middle of 5 - axis Zig-zag (THERE IS NO MIDDLE ON ZIG-ZAG)

    pmidOne # Middle of 5 - axis One-way

    pmidCir # Middle of 5 - axis Circular

    pmidSwf # Middle of 5 - axis Swarf
    pgetab
    pchkab
    n,sgcode,xd,yd,zd,a,b,pfrx

    pendZig # end of 5 - axis Zig-zag
    "ZIG-ZAG END"

    pendOne # end of 5 - axis One-way
    "ONE-WAY END"

    pendCir # end of 5 - axis Circular
    "CIRCULAR END"

    pendSwf # end of 5 - axis Swarf
    pgetab
    pchkab
    n,sgcode,xd,yd,zd,a,b,pfrx,e
    fr = 100
    #!rl
    prv_xrd = xd
    prv_yrd = yd
    prv_zrd = zd
    xrd = x+(vtoolx*(gauge+pivot+rl)) # 5 axis x rapid position
    yrd = y+(vtooly*(gauge+pivot+rl)) # 5 axis y rapid position
    zrd = zh+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z rapid pos
    n,sgcode,xrd,yrd,zrd,a,b,pfr

    pseltyp # Select type of cut (5 - axis)
    rl = (1/vtoolz)*(zh-z) # retract to clearance plane lngth
    xd = x+(vtoolx*(gauge+pivot)) # 5 axis x position
    yd = y+(vtooly*(gauge+pivot)) # 5 axis y position
    zd = z+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z position
    typ = 0
    if cutpos = 1 , typ = typ + 10
    if cutpos = 2 , typ = typ + 20
    if cutpos = 3 , typ = typ + 30
    if cuttyp = 1 , typ = typ + 1
    if cuttyp = 2 , typ = typ + 2
    if cuttyp = 3 , typ = typ + 3
    if cuttyp = 4 , typ = typ + 4
    if typ = 11 , gauge = t
    if typ = 11 , q1
    if typ = 11 , pstZig # Start of 5 - axis Zig-zag
    if typ = 12 , pstOne # Start of 5 - axis One-way
    if typ = 13 , pstCir # Start of 5 - axis Circular
    if typ = 14 , pstSwf # Start of 5 - axis Swarf
    if typ = 21 , pmidZig # Middle of 5 - axis Zig-zag
    if typ = 22 , pmidOne # Middle of 5 - axis One-way
    if typ = 23 , pmidCir # Middle of 5 - axis Circular
    if typ = 24 , pmidSwf # Middle of 5 - axis Swarf
    if typ = 31 , pendZig # end of 5 - axis Zig-zag
    if typ = 32 , pendOne # end of 5 - axis One-way
    if typ = 33 , pendCir # end of 5 - axis Cricular
    if typ = 34 , pendSwf # end of 5 - axis Swarf

    # --------------------------------------------------------------------------
    # Work coordinate output, user defined
    # --------------------------------------------------------------------------

    pwcs # G54+ coordinate setting
    if mi1 >= 4, *sgwcs

    # --------------------------------------------------------------------------
    # Gear selection control, user defined
    # --------------------------------------------------------------------------
    pgear # Find spindle range
    gear = frange ( 1, speed )
    *gear

    prange # Find spindle range
    if use_gear = 1, pgear

    # --------------------------------------------------------------------------
    # Cutter comp. output control, user defined
    # --------------------------------------------------------------------------
    pccdia2 # Cutter Compensation2
    # if ccomp <> 4, *diacomp

    pccdia # Cutter Compensation
    # if ccomp <> 0, pccdia2

    # --------------------------------------------------------------------------
    # Axis substitution motion, user defined
    # --------------------------------------------------------------------------
    pdrlxyrot # Substitute Axis X/Y with Rotary axis w/ drilling
    xangle = xs
    yangle = ys
    if rotaxis = 0, x, y
    if rotaxis = 1, y, xangle
    if rotaxis = 2, x, yangle

    pfrd # Feedrate W/O Negative Feedrates (deg/min)
    if frdeg > maxfrdeg, frdeg = maxfrdeg
    if frdelta > .5, *frdeg #Value to exceed to output frdeg


    # --------------------------------------------------------------------------
    # Axis linear/circular motion, user defined
    # --------------------------------------------------------------------------
    parctyp2 # Arc output for R w/ sign over 180 degree sweep
    absswp = abs ( sweep )
    if absswp <= 180, *arcrad
    if absswp > 180.0001, *arcradm
    if arcrad > 650, arcerror = 1

    parctyp1 # Arc output for R w/ no sign
    *arcrad

    parctyp0 # Arc output for IJK
    if plane = 0, *i, *j, k
    if plane = 1, i, *j, *k
    if plane = 2, *i, j, *k

    parctyp # Select the arc output
    if arcoutput = 0, parctyp0
    if arcoutput = 1, parctyp1
    if arcoutput = 2, parctyp2

    prapidm # Linear line movement - at rapid feedrate
    n, sgplane, sccomp, pccdia, sgcode, x, y, z, pcan

    plinm # Linear line movement - at feedrate
    !coolant
    n, sccomp, pccdia, sgcode, x, y, z, pfr, pcan

    plin5ax # 5 - axis toolplane Linear line movement - at feedrate
    !coolant,!x,!y,!z
    xd = x+(vtoolx*(gauge+pivot)) # 5 axis x position
    yd = y+(vtooly*(gauge+pivot)) # 5 axis y position
    zd = z+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z position
    n, sgcode, xd, yd, zd, a, b, pfr

    plin5ax1 # 5 - axis toolplane Linear line movement - at zhome plane
    !coolant,!x,!y,!z
    rl = (1/vtoolz)*(zh-zr) # retract to clearance plane lngth
    xd = x+(vtoolx*(gauge+pivot+rl)) # 5 axis x position
    yd = y+(vtooly*(gauge+pivot+rl)) # 5 axis y position
    zd = zh+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z position
    n, sgcode, a, b, pfr

    pcirm # Circular interpolation
    n, sgplane, sccomp, pccdia, sgcode, x, y, z, parctyp, pfr, pcan

    # --------------------------------------------------------------------------
    # Drilling, user defined
    # --------------------------------------------------------------------------

    pdrillref # Determine G98 or G99
    if initht <> refht, drillref = 98
    if initht = refht, drillref = 99
    if initht = zr, n, *initht, ptoolaxis, pcoolon,e
    if initht <> zr, n, *zr, ptoolaxis, pcoolon,e

    pdwell # Determine whether to output dwell
    if dwell <> 0, *dwell

    ptlchg0dr3 # Null tool change for drilling
    gcode = 6
    if zr < prv_zr, n, sgcode, *xr, *yr, e
    if zr < prv_zr, n, sgcode, *zr, e

    ptlchg0dr2 # Null tool change for drilling
    if zr <> prv_zr, ptlchg0dr3

    ptlchg0drl # Null tool change for drilling
    if prv_opcode = 3, ptlchg0dr2

    # --------------------------------------------------------------------------
    # POSTLINES, PRE-DEFINED - Postline names are pre-assigned.
    # Lines do not need to end with ', e' for carriage return and linefeed.
    # --------------------------------------------------------------------------
    pq # get initial values
    q2

    pheader # File header
    if progno = 0 ,progno = 1
    ":", e
    "(MSG, PROGRAM NAME ", progname, ")"
    "(MSG, POSTED FOR CINCINNATI-3)"
    "(MSG,PROGRAMMER - DJA)"
    "(MSG, ", time,", ",month,"-",day,"-",year,")"

    psof0 # Start of file for tool zero
    psof

    psof # Start of file for non-zero tool number
    pinit
    atc = 0
    !opcode
    if tcnt = 1, stagetool = 2
    comment
    gcode = 0
    n, *sgcode,"G70G90G94"
    ":", *t, "M06"
    n, *speed, *spdlon
    n, *sgcode, pabs, pwcs, *xh, *yh, speed, spdlon
    ptllnth
    # !coolant

    ptlchg0 # Null tool change
    atc = 1
    whatline = 0
    if opcode = 3, ptlchg0drl
    if prv_speed <> speed, n, speed
    if coolant <> prv_coolant, n, pcoolon
    !opcode, !zr
    ptoolaxis

    ptlchg # Tool change
    pinit
    gcode = 0
    ask = 0
    atc = 2
    !opcode
    n, pcooloff
    presetab0
    n, "G98", "Z24."
    n, "G90M05"
    ":", *t, "M06"
    comment
    n, *speed, *spdlon
    n, *sgcode, pabs, pwcs, *xr, *yr, speed, spdlon
    ptllnth

    pmx0 # Calculate tool axis
    # b=90-atan2(vtoolz,vtoolx)
    # a=atan(-vtooly/(sqrt(vtoolx^2+vtoolz^2)))

    pmx1 # Retract - first point of cut (reads leadin length and adjusts)
    if whatline = 2, pseltyp

    pmx2 # Rapid to start of cut at retract height

    pmx # 5-Axis tool path
    pseltyp

    peof0 # End of file for tool zero
    peof

    peof # End of file for non-zero tool
    n, pcooloff
    n, "G98", "Z24."
    n, "G90", "M5"
    n, "G0", "X0.", "Y0.", "A0.", "B0."
    n, pabs
    n, "M2"
    if nchar > chrexced , chrdif = nchar-chrexced
    if nchar > chrexced , "(** WARNING! **)","(number or characters ","exceeded by ",chrdif,")"
    if awarn > 0 , "** WARNING **"," EXCEEDED A TRAVEL",awarn,"TIMES"
    if bwarn > 0 , "** WARNING **"," EXCEEDED B TRAVEL",bwarn,"TIMES"
    if arcerror = 1 , "** WARNING **","(exceeded max radius of 650 R)"

    # --------------------------------------------------------------------------
    # Axis motion
    # --------------------------------------------------------------------------
    prot0 # Toolplane postline - Custom post required
    tpln = 0

    prot # Toolplane postline - Custom post required
    prot0

    prapid # Linear line movement - at rapid feedrate
    if tpln = 0, prapidm

    pzrapid3 # 3-axis Linear movement in Z axis only - at rapid feedrate
    n, sgcode, z

    pzrapid5 # 5-axis using tool plane return to clearance plane
    !coolant,!x,!y
    rl = (1/vtoolz)*(zh-prv_z) # retract to clearance plane lngth
    xd = x+(vtoolx*(gauge+pivot+rl)) # 5 axis x position
    yd = y+(vtooly*(gauge+pivot+rl)) # 5 axis y position
    zd = zh+(vtoolz*(gauge+pivot))-(gauge+pivot) # 5 axis z position
    n, sgcode, xd, yd, zd, pfr

    pzrapid # Linear movement in Z axis only - at rapid feedrate
    if tpln = 0, pzrapid3
    if tpln = 1, pzrapid5

    plin1 # First linear movement after SOF/toolchg, whatno must be set
    if tpln = 0, plinm
    if tpln = 1, plin5ax1

    plin2 # Second linear movement after SOF, whatno must be set
    plin

    plin # Linear line movement - at feedrate
    if tpln = 0, plinm
    if tpln = 1, plin5ax

    pz # Linear movement in Z axis only - at feedrate
    n, sgcode, z, pfr

    pcir1 # First circular movement after SOF, whatno must be set
    pcir

    pcir2 # Second circular movement after SOF, whatno must be set
    pcir

    pcir # Circular interpolation
    if rotaxis = 0, pcirm

    # --------------------------------------------------------------------------
    # Drilling
    # --------------------------------------------------------------------------
    pdrill3 # 3 - axis drilling
    # pdrillref
    !coolant
    n, pdrlxyrot
    z = refht - depth
    n, *sgdrill, pdrlxyrot, z, *refht, pdwell, *frplunge

    pdrill5 # 5 - axis drilling
    !depth,!refht,!initht,!fr
    gauge = t
    q1
    n,"(",*gauge,")",e
    n,"(",*pivot,")",e
    n,"(MSG, 5-AXIS DRILL TOOL PATH)",e
    n, *zh, pcoolon,e
    initx = u+(vtoolx*(gauge+pivot+initht-refht))
    inity = v+(vtooly*(gauge+pivot+initht-refht))
    initz = w+(vtoolz*(gauge+pivot+initht-refht))-(gauge+pivot)
    refx = u+(vtoolx*(gauge+pivot))
    refy = v+(vtooly*(gauge+pivot))
    refz = w+(vtoolz*(gauge+pivot))-(gauge+pivot)
    depthx = u+(vtoolx*(gauge+pivot+depth-refht))
    depthy = v+(vtooly*(gauge+pivot+depth-refht))
    depthz = w+(vtoolz*(gauge+pivot+depth-refht))-(gauge+pivot)
    b=90-atan2(vtoolz,vtooly)
    a=atan(-vtoolx/(sqrt(vtooly^2+vtoolz^2)))
    pchkab
    frxnci = fr
    gcode = 0
    n,sgcode,initx,inity
    n,sgcode,a,b
    gcode = 11
    fr = 100
    n,sgcode,*initx,*inity,*initz,fr,e
    n,sgcode,*refx,*refy,*refz,fr,e
    fr = frxnci
    n,sgcode,*depthx,*depthy,*depthz,fr,e
    n,sgcode,*refx,*refy,*refz,fr,e
    fr = 100
    n,sgcode,*initx,*inity,*initz,fr,e
    fr = frxnci

    pdrill # Canned Drill Cycle
    if drill5 = 0, pdrill3
    if drill5 > 0, pdrill5

    ppeck # Canned Peck Drill Cycle
    # pdrillref
    n, pdrlxyrot
    z = refht - depth
    n, *sgdrill, pdrlxyrot, z, *refht, *peck1, "J1", *frplunge

    pchpbrk # Canned Chip Break Cycle
    # pdrillref
    n, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplunge

    ptap # Canned Tap Cycle
    # pdrillref
    n, pdrlxyrot
    z = refht - depth
    n, *sgdrill, pdrlxyrot, z, *refht, *frplunge

    pbore1 # Canned Bore #1 Cycle
    # pdrillref
    z = refht - depth
    n, *sgdrill, pdrlxyrot, z, *refht, pdwell, *frplunge

    pbore2 # Canned Bore #2 Cycle
    # pdrillref
    z = refht - depth
    n, *sgdrill, pdrlxyrot, z, *refht, *frplunge

    pmisc1 # Canned Misc #1 Cycle (User Option)
    pdrill

    pmisc2 # Canned Misc #2 Cycle (User Option)
    pdrill

    pdrill_25 # Canned Drill Cycle 5-axis
    initx = u+(vtoolx*(gauge+pivot+initht-refht))
    inity = v+(vtooly*(gauge+pivot+initht-refht))
    initz = w+(vtoolz*(gauge+pivot+initht-refht))-(gauge+pivot)
    refx = u+(vtoolx*(gauge+pivot))
    refy = v+(vtooly*(gauge+pivot))
    refz = w+(vtoolz*(gauge+pivot))-(gauge+pivot)
    depthx = u+(vtoolx*(gauge+pivot+depth-refht))
    depthy = v+(vtooly*(gauge+pivot+depth-refht))
    depthz = w+(vtoolz*(gauge+pivot+depth-refht))-(gauge+pivot)
    b=90-atan2(vtoolz,vtoolx)
    a=atan(-vtooly/(sqrt(vtoolx^2+vtoolz^2)))
    pchkab
    frxnci = fr
    gcode = 0
    n,sgcode,a,b,e
    gcode = 11
    fr = 100
    n,sgcode,*initx,*inity,*initz,fr,e
    n,sgcode,*refx,*refy,*refz,fr,e
    fr = frxnci
    n,sgcode,*depthx,*depthy,*depthz,fr,e
    n,sgcode,*refx,*refy,*refz,fr,e
    fr = 100
    n,sgcode,*initx,*inity,*initz,fr,e
    fr = frxnci

    pdrill_23 # Canned Drill Cycle 3-axis
    n,x,y,refht

    pdrill_2 # Canned Drill Cycle
    if drill5 = 0, pdrill_23
    if drill5 > 0, pdrill_25

    ppeck_2 # Canned Peck Drill Cycle
    pdrill_2

    pchpbrk_2 # Canned Chip Break Cycle
    pdrill_2

    ptap_2 # Canned Tap Cycle
    pdrill_2

    pbore1_2 # Canned Bore #1 Cycle
    pdrill_2

    pbore2_2 # Canned Bore #2 Cycle
    pdrill_2

    pmisc1_2 # Canned Misc #1 Cycle
    pdrill_2

    pmisc2_2 # Canned Misc #2 Cycle
    pdrill_2

    pcandc3 # Cancel canned drill cycle 3-axis
    n,"G80"

    pcandc5 # Cancel canned drill cycle 5-axis
    !gcode
    gcode = 0
    a = 0
    b = 0
    n,sgcode,a,b,zfd

    pcanceldc # Cancel canned drill cycle
    if drill5 = 0, pcandc3
    if drill5 > 0, pcandc5

    pcancelcc # Cancel cutter comp.
    #n, "G40"

    pwrtt # Write tool table, scans entire file, null tools are negative
    tnote = t
    toffnote = tloffno
    tlngnote = tlngno
    if t >= 0, "(", *tnote," ", *tldia, " DIA. ", *sopnote, ")"
    if t >= 0, tcnt = tcnt + 1

    # --------------------------------------------------------------------------
    # Numbered questions for Mastercam -- Used by Mill 5
    # --------------------------------------------------------------------------
    38. Rapid feedrate? 300.0
    1538. Rapid feedrate (metric)? 10000.0

    70. Chaining tolerance? 0.0002
    74. Minimum arc length? 0.0002
    #76. Startup configuration file? MILL5
    78. Name of startup C-Hook program? NONE
    79. Name of exit C-Hook program? NONE
    80. Communications port number for receive and transmit (1 or 2) ? 1
    81. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,3 8400)? 4800
    82. Parity (E/O/N)? E
    83. Data bits (7 or 8)? 7
    84. Stop bits (1 or 2)? 2
    85. Strip line feeds? y
    86. Delay after end of line (seconds)? 0.1
    87. Ascii, Eia, or Binary (A/E/B)? A
    88. Echo keyboard to screen in terminal emulation? n
    89. Strip carriage returns? N
    90. Drive and subdirectory for NC files?C:\ANTONIO'S\mill7\NC
    91. Name of executable post processor? MP
    92. Name of reverse post processor? RP
    93. Reverse post PST file name? RPFAN
    97. Number of places after decimal for analyze (2-6)? 5
    98. Number of places after decimal for NCI files (3-7)? 7
    99. System tolerance? 0.000005
    100. Number of places BEFORE the decimal point for sequence numbers? 3
    101. Number of places AFTER the decimal point for sequence numbers? 0
    103. Maximum spindle speed? 3500
    104. Default starting sequence number? 1
    105. Default sequence number increment? 1
    107. Average time for tool change (seconds)? 2.0
    #110. Default tool library? TOOLS.MTL
    111. Maximum number of tools? 100
    161. Enable Home Position button? y
    162. Enable Reference Point button? n
    163. Enable Misc. Values button? y
    164. Enable Rotary Axis button? n
    165. Enable Tool Plane button? n
    166. Enable Construction Plane button? n
    167. Enable Tool Display button? y
    168. Check tplane during automatic work origin creation? n

    190. Display the tool? y
    191. Display the toolpath? y
    192. Default tool display: 1 = animated, 2 = static? 2
    193. Default tool display: 1 = interpolate, 2 = endpoints? 2
    194. Default tool display: 1 = run, 2 = step? 1
    195. Default tool display step size? 0.1
    196. Default tool display delay? 0.0
    197. Repaint the toolpath? Y
    201. Default Misc. Real [1]?
    301. Default Misc. Int. [1]? 0


    9999. General NC parameters
    1001. Display solid toolpath (y = solid, n = striped)? y
    1002. Cutter compensation in computer (L, R or blank)? L
    1003. Compensate to tip? Y
    1004. Amount of stock to leave? 0.0
    1005. Cutter compensation in control (L, R or blank)?L
    1006. Default tool plane (0 = none, 1 = T, 2 = F, 5 = S)? 0
    1007. Tool origin: X? 0.0
    1008. Tool origin: Y? 0.0
    1009. Tool origin: Z? 0.0
    1010. Rotary axis (X, Y or blank)?N
    1011. Rotary axis diameter? 2.0
    1012. Rapid depth? 0.0
    1014. Roll cutter around (0 = no, 1 = sharp, 2 = all) corners? 2
    1015. Coolant on? Y
    1016. Number of times to step and repeat in X? 1
    1017. Amount to step and repeat in X? 0.0
    1018. Number of times to step and repeat in Y? 1
    1019. Amount to step and repeat in Y? 0.0
    1020. Number roughing depth cuts? 0
    1021. Amount of roughing depth cut? 0.0
    1022. Number of finishing depth cuts? 0
    1023. Amount of finishing depth cut? 0.0
    1024. Entry line length? 0.05
    1025. Entry arc radius? 0.0
    1026. Entry arc angle? 90.0
    1027. Use "infinite" look-ahead in cutter compensation? y
    1028. Entry line direction (1 = perpendicular, 0 = parallel)? 1

    9999. Contour
    1040. Number of roughing cuts? 0
    1041. Rough cut amount? 0.0
    1042. Number of finish cuts? 1
    1043. Finish cut amount? 0.0

    9999. Drilling
    1050. Drilling cycle (0=drill,1=peck,2=c.b.,3=tap,4=b1,5=b2,6=m1,7=m2)? 0
    1051. Dwell? 0.0
    1052. Initial height? 6.0
    1053. Reference height? 0.05
    1054. Use incremental depth? n
    1055. Incremental drill depth? 0.0
    1056. First peck increment? 0.1
    1057. Subsequent peck increment? 0.1
    1058. Peck clearance? 0.01
    1059. Retraction amount? 0.0

    9999. Pocket
    1070. Cutting method (0 = zig-zag, 1 = spiral out, 2 = spiral in)? 0
    1071. Find multiple collapse points for spiral pocket? y
    1072. Roughing angle for zig-zag pocketing? 0.0
    1073. Roughing step over? 0.1
    1074. Number of finish passes? 0
    1075. Finish pass step over? 0.0

    9999. Ruled surface
    1080. Cutting method (0 = zig-zag, 1 = one way, 2 = circ., 3 = EDM)? 0
    1081. Across cut distance? 0.05
    1082. Taper angle for Wire EDM cutting? 0.0
    1083. Constant z cutting? n
    1084. Initial z for constant z cutting? 0.0
    1085. Final z for constant z cutting? -1.0
    1086. Z increment for constant z cutting? -0.25

    9999. Swept surface
    1095. Translate the across contour for 3d swept? n
    1096. Along cut distance? 0.1
    1097. Across cut distance? 0.1
    1098. Cutting method (0=zig,1=one w.,2=circ.,3=5 zig,4=5 one,5= 5 cir)? 0
    1099. Cutting direction (0 = along, 1 = across)? 0

    9999. Surface of revolution
    1110. Step over? 0.1
    1111. Concave (y/n)? y
    1112. Retract to the reference height? n
    1113. Reference height for surface of revolution? 0.1

    9999. Projection
    1120. Minimum step size? 0.001
    1121. Maximum step size? 100.0
    1122. Maximum error? 0.0002
    1123. Step over for project onto surface? 0.02
    1124. Does the toolpath lie partially off the surface? n

    9999. Lofted surface
    1130. Along cut distance? 0.1
    1131. Across cut distance? 0.1
    1132. Cutting method (0=zig,1=one w.,2=circ,3=zig5,4=one5,5=circ5)? 0
    1133. Cutting direction (0 = along, 1 = across)? 0

    9999. Coons
    1140. Along cut distance? 0.1
    1141. Across cut distance? 0.1
    1142. Blending (0 = lin, 1 = par, 2 = cubic, 3 = cubic w. slope match)? 0
    1143. Cutting method (0=zig,1=one w.,2=circ,3=zig5,4=one5,5=circ5)? 0
    1144. Cutting direction (0 = along, 1 = across)? 0
    1145. Number of along patches? 1
    1146. Number of across patches? 1

    9999. NURBS surface
    1160. File options (1 = surface, 2 = ofs, 3 = both, 4 = nci, 5 = ofs & nci)? 4
    1161. Stepping method (1 = distance, 2 = chord. dev and scallop height)? 2
    1162. Step distance in along direction? 0.05
    1163. Step distance in across direction? 0.05
    1164. Maximum chordal deviation? 0.001
    1165. Maximum scallop height? 0.001
    1166. Cutting method (0 = zig zag, 1 = one way, 2 = circular)? 0
    1167. Cutting direction (0 = along, 1 = across)? 0

    9999. Fillet
    1180. Starting fillet radius? 0.1
    1181. End fillet radius? 1.0
    1182. Surface selection (1=lFf,2=lF,3=fF,4=F,5=l,6=f)? 1
    1183. Cutting method (0 = one way, 1 = zig zag)? 1

    9999. Roughing
    1190. Cutting direction (-1 = CCW, 1 = CW)? -1
    1191. 1 = Pocket at each level, 2 = contour only? 2
    1192. 1 = mountain, -1 = cavity? 1
    1193. Cut top down (y/n)? y
    1194. Z step increment? 0.1
    1195. Top clearance? 0.01
    1196. Stock to leave on bottom? 0.05

    9999. Recomp
    1200. Write the NCI file? y
    1201. Cutting method (0=zig,1=one w.,2=circ.,3=5 zig,4=5 one,5= 5 cir)? 0
    1202. Cutting direction (0 = along, 1 = across)? 0

    9999. Reverse surface
    1210. Surfaces to reverse (1 = surf and ofs, 2 = surf, 3 = ofs)? 1
    1211. Write the NCI file (y/n)? y
    1212. Cutting method (0=zig,1=one w.,2=circ.,3=5 zig,4=5 one,5= 5 cir)? 0

    9999. Gouge checking
    1220. Perform gouge check in the along direction (y/n)? y
    1221. Method for gouge elimination (1 = closest approach, 2 = proj. plane)? 1

    1500. Chook to execute from 'Misc. values' button?
    1501. Insert parameter information in the ascii NCI? n
    1502. Write operation information to binary file (.ops)? n

    1520. Display a warning when cutter compensation in control simulation finds an error? n

    # Do NOT manually change the answer for Q.1999 !
    1999. Product major version number that post supports? 9

    3001. Machine acceleration? 2
    3002. timing size? .1


    # --------------------------------------------------------------------------
    # Default Miscellaneous Real Values
    # --------------------------------------------------------------------------
    201. Default miscellaneous real variable 1 (mr1)? 0.0
    202. Default miscellaneous real variable 2 (mr2)? 0.0
    203. Default miscellaneous real variable 3 (mr3)? 0.0
    204. Default miscellaneous real variable 4 (mr4)? 0.0
    205. Default miscellaneous real variable 5 (mr5)? 0.0
    206. Default miscellaneous real variable 6 (mr6)? 0.0
    207. Default miscellaneous real variable 7 (mr7)? 0.0
    208. Default miscellaneous real variable 8 (mr8)? 0.0
    209. Default miscellaneous real variable 9 (mr9)? 0.0
    210. Default miscellaneous real variable 10 (mr10)? 0.0

    # --------------------------------------------------------------------------
    # Default Miscellaneous Real Values (METRIC)
    # --------------------------------------------------------------------------
    1601. Default miscellaneous real variable 1 (mr1) (metric)? 0.0
    1602. Default miscellaneous real variable 2 (mr2) (metric)? 0.0
    1603. Default miscellaneous real variable 3 (mr3) (metric)? 0.0
    1604. Default miscellaneous real variable 4 (mr4) (metric)? 0.0
    1605. Default miscellaneous real variable 5 (mr5) (metric)? 0.0
    1606. Default miscellaneous real variable 6 (mr6) (metric)? 0.0
    1607. Default miscellaneous real variable 7 (mr7) (metric)? 0.0
    1608. Default miscellaneous real variable 8 (mr8) (metric)? 0.0
    1609. Default miscellaneous real variable 9 (mr9) (metric)? 0.0
    1610. Default miscellaneous real variable 10 (mr10) (metric)? 0.0

    # --------------------------------------------------------------------------
    # Enable/Disable Miscellaneous Real Variable switches
    # --------------------------------------------------------------------------
    1611. Enable miscellaneous real variable 1? y
    1612. Enable miscellaneous real variable 2? y
    1613. Enable miscellaneous real variable 3? y
    1614. Enable miscellaneous real variable 4? y
    1615. Enable miscellaneous real variable 5? y
    1616. Enable miscellaneous real variable 6? y
    1617. Enable miscellaneous real variable 7? y
    1618. Enable miscellaneous real variable 8? y
    1619. Enable miscellaneous real variable 9? y
    1620. Enable miscellaneous real variable 10? y


    # --------------------------------------------------------------------------
    # Default Miscellaneous Integer Values
    # --------------------------------------------------------------------------
    301. Default Work Coordinate System (0 thru 3=G92, 4 thru 9=G54-G59)? 1
    302. Miscellaneous integer variable 2 (mi2)? 0
    303. Miscellaneous integer variable 3 (mi3)? 0
    304. Miscellaneous integer variable 4 (mi4)? 0
    305. Miscellaneous integer variable 5 (mi5)? 0
    306. Miscellaneous integer variable 6 (mi6)? 0
    307. Miscellaneous integer variable 7 (mi7)? 0
    308. Miscellaneous integer variable 8 (mi8)? 0
    309. Miscellaneous integer variable 9 (mi9)? 0
    310. Miscellaneous integer variable 10 (mi10)? 0

    # --------------------------------------------------------------------------
    # Enable/Disable Miscellaneous Integer Variable switches
    # --------------------------------------------------------------------------
    1621. Enable miscellaneous integer variable 1? y
    1622. Enable miscellaneous integer variable 2? y
    1623. Enable miscellaneous integer variable 3? y
    1624. Enable miscellaneous integer variable 4? y
    1625. Enable miscellaneous integer variable 5? y
    1626. Enable miscellaneous integer variable 6? y
    1627. Enable miscellaneous integer variable 7? y
    1628. Enable miscellaneous integer variable 8? y
    1629. Enable miscellaneous integer variable 9? y
    1630. Enable miscellaneous integer variable 10? y


    # --------------------------------------------------------------------------
    # Configuration File association parameters (default is "y")
    # --------------------------------------------------------------------------
    #400. Name of associated cfg file?
    401. Read SYSTEM COLORS section? y
    402. Read ALLOCATIONS section? y
    403. Read TOLERANCES section? y
    404. Read DATA PATHS section? y
    405. Read COMMUNICATIONS section? y
    406. Read DRAFT SETTINGS section? y
    407. Read MISCELLANEOUS section? y
    408. Read NC SETTINGS section? y
    409. Read DIALOG SCRIPTS section? y
    410. Read DESIGN SETTINGS section? y
    411. Read PLOTTER SETTINGS section? y
    412. Read ALT-KEY ASSIGNMENTS section? y
    413. Read CAD section? y
    414. Read START/EXIT section? y
    415. Read SCREEN section? y
    416. Read FILE NAMES section? y

  2. #2
    Registered
    Join Date
    Mar 2005
    Posts
    988
    A couple questions...

    1) Are you still using Version 7 to create programs?
    2) What exactly is wrong with the output that you need to change the way the angles are calculated?
    It's just a part..... cutter still goes round and round....

  3. #3
    Registered
    Join Date
    Apr 2010
    Posts
    0
    No longer using version 7, just have bunch of old programs we would still like to make use of. The post i posted is for a machine with a A and B axis with limits set to 25 degrees and are about the x and y plane. I need one to calculate it with the c axis about the z.


Similar Threads

  1. Need help editing post
    By bugzpulverizer in forum Post Processors for MC
    Replies: 5
    Last Post: 08-25-2008, 05:35 PM
  2. Editing post
    By WingNutz in forum Mastercam
    Replies: 1
    Last Post: 08-15-2008, 03:43 AM
  3. Post Editing Help!
    By jeffliu2 in forum GibbsCAM
    Replies: 4
    Last Post: 02-26-2008, 02:24 AM
  4. Help with Editing a Post
    By Chris Rand in forum Post Processor Files
    Replies: 6
    Last Post: 06-05-2006, 09:07 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •