Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

post Processor Tiger 5


Recommended Posts

hello, I'm french and I do not speak good English. 

I use a post processor is not adpater to my CNC (tiger4) 

I am trying to change the post processor for CNC "SHARNOA" (tiger5). 

I still use MASTERCAM V9, I managed to make some changes, but I'm stuck on actuelement the tool "G41 / G42) correction. 

Actually psot processor generates a gcode like this: 

G41 Y-37. F300 

================ 

G42 X-8. F200 

but for my CNC I would need a code like this: 

G41 

G-1 Y-37. F300 

=============== 

G42 

G 1-X-8. F200 

 

Here is a link where I left on the post processor I use. 

 


Thank you for your help 

 

PS: if a person possesses the post processor for 5 tiger I'd be happy.

Link to comment
Share on other sites

It's a relatively easy modification, but I can't see the post you linked. It leads to a page that's all in French and It seems as if it want's me to download something, and that isn't happening. So I'll just use a standard post as an example.

 

Inside your post you'll find a table of strings that define your G codes. It will look like this:

 

# Motion G code selection
sg00    : "G0"       #Rapid
sg01    : "G1"       #Linear feed
sg02    : "G2"       #Circular interpolation CW
sg03    : "G3"       #Circular interpolation CCW
sg04    : "G4"       #Dwell
sgcode  : ""         #Target string

 

All you have to do is modify the code in between the quotes. So you will want to change yours to look like this:

 

sg01    : "G-1"       #Linear feed

 

Change it for every g code you need modified.

 

To break up the cutter comp line, you need to find a block called plinout

It should look like this:

 

plinout         #Output to NC of linear movement - feed   
                   
      pcan1, pbld, n$, sgplane, `sgcode, sgabsinc, pccdia,
        pxout, pyout, pzout, feed, strcantext, scoolant, e$

 

Modify it to look like this:

 

     pccdia, e$

     pcan1, pbld, n$, sgplane, `sgcode, sgabsinc,
        pxout, pyout, pzout, feed, strcantext, scoolant, e$

 

 

And if you need the g code to output on every line, change the ` to an *  in the prapidout, plinout, and pcirout post blocks.

 

ALWAYS SAVE A COPY OF YOUR POST BEFORE YOU MAKE ANY CHANGES

Link to comment
Share on other sites

Since is a Sharnoa speciality, I would do this:

 

Define this postblock

pApproach	# Sharnoa non-tangent approach
		if cc_pos$ > zero & cstart$ = two, "G-1"

Modify this postblocks:

plinm   # Linear line movement - at feedrate                    
	pcan
        pcan1, n, sccomp, sgcode, pApproach, x, y, z, pfr, strcantext, e
        pcan2

pcirm   # Circular interpolation                                
	pcan
        pcan1, n,  sgplane, sccomp, sgcode, pApproach, x, y, z, parctyp, pfr, strcantext, e
	pcan2
;)
Link to comment
Share on other sites
# Post Name           : MPTIGER4

# Product             : MILL

# Machine Name        : SHARNOA TIGER 4  

# Control Name        : TIGER 4

# Description         : SHARNOA TIGER 4 MILL POST

# 4-axis/Axis subs.   : NO

# 5-axis              : NO

# Subprograms      : NO

# Executable          : MP v9.10

#

# WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO

# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.

#

# --------------- 

#| REVISION LOG: |

# ------------------------------------------------------------------------

# Programmers Note:

# CNC  01/12/01 - Updated for Mill Version 8.1

# CNC  01/09/02 - Initial post update for V9.0

# CNC  02/04/03 - Initial post update for V9.1

#

# --------------- 

#| FEATURES:     |

# ------------------------------------------------------------------------

# Users Note:

#

# Following Misc_Reals & Misc_Integers are used:

#

# mi1 - Work coordinate system 

#        0 = Reference return is generated and G92 with the 

#            X, Y and Z home positions at file head.

#        1 thru 3 = Reference return is generated and G92 with the 

#                   X, Y and Z home positions at each tool.

#        4 thru 9 = The WCS of G54 thru G59 respectively at each tool.

#

#

#Canned text:

#    Entering cantext on a contour point from within Mastercam allows the

#    following functions to enable/disable.

#    Cantext value:

#    1 = Stop = output the "M00" stop code

#    2 = Ostop =  output the "M01" optional stop code

#

#

# Options / Usage:

# It is recommended to start and end cutter compensation on a linear move.

# Rotary axis assumes a "Z" plunge at feed into part, position of the

# substituted axis at absolute zero position and the retraction from path 

# by the post call to the G28 machine Z home position.

#

# END_HEADER$

#

 

# --------------------------------------------------------------------------

# DEBUG/PROGRAM SWITCHES, debugging and program switches

# --------------------------------------------------------------------------

fastmode  : yes  # Optimize processing time (set to no for debugging)

bug1   : 1       # 0=No display, 1=Generic list box, 2=Editor

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 : yes     # Do not perform whatline branches? (leave as yes)

 

skp_lead_flgs : 1# Do NOT use v9 style contour flags

get_1004   : 1   # Find gcode 1004 with getnextop?

rpd_typ_v7 : 1   # Use Version 7 style contour flags?

strtool_v7 : 2   # Use Version 7 toolname?

 

stagetool : 0    # 0 = Do not pre-stage tools, 1 = Stage tools

use_gear  : no   # Set to yes to output gear range codes

 

# --------------------------------------------------------------------------

# FORMAT STATEMENTS - n=nonmodal, l=leading, t=trailing, i=inc, d=delta

# --------------------------------------------------------------------------

fs  1  0.4      #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 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 - Rotary substitution

# --------------------------------------------------------------------------

fmt  A 9 xangle    # Linear to rotary calculation of X

fmt  B 9 yangle    # Linear to rotary calculation of Y

 

# --------------------------------------------------------------------------

# 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 tloffno   # Diameter Offset No

fmt  H 3 tlngno    # Length Offset No

 

fmt  "OUTIL:" 4 tnote        # Note format

fmt  "" 4 toffnote    # Note format

fmt  "" 4 tlngnote   # Note format

fmt  "DIAMETRE:" 11 tldia           # Note format

 

# --------------------------------------------------------------------------

# Spindle Speeds & Feedrate output formats

# --------------------------------------------------------------------------

fmt  S 6 speed      # Spindle Speed

fmt  F 8 fr         # Feedrate

fmt  F 7 frdeg      # Feedrate for rotary

fmt  M 3 gear       # Gear range

 

# --------------------------------------------------------------------------

# Drill variable formats

# --------------------------------------------------------------------------

fmt  G 3 drillref   # Initial / Reference Toggle (G98/G99)

fmt  P 10 dwell     # Dwell

fmt  Z 1 initht     # Initial Height

fmt  P 1 refht      # Reference Height

fmt  Q 1 depth      # Depth

fmt  E 1 peck1      # First peck increment (positive)   #JQ was Q 10

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

fmt  C 4 coolant    # Coolant

fmt  M 4 cantext    #canned text

# --------------------------------------------------------------------------

# INITIALIZE - initialize system variables and define user variables

# --------------------------------------------------------------------------

arcoutput : 1      # 0 = IJK, 1 = R no sign, 2 = R signed neg. over 180

breakarcs : 0      #Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs

arctype   : 2      # 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

arccheck  : 1      # Check for small arcs, convert to linear

ltol      : .002   # Length tolerance for arccheck

bldnxtool : yes    # Build next tool table

omitseq   : no     # Omit sequence numbers?

progname  : 1      # Use uppercase for program name (sprogname)

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 number

skipmotest: no     # Skip motion test in linear

spaces    : 1      # No. of spaces to add between fields

tooltable : 1      # Read for tool table and pwrtt 

 

absswp    : 0      # Absolute sweep

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

 

#Cantext string definitions (spaces must be padded here)

sm00        "M00"

sm01        "M01"

strm "M"

strtextno

strcantext

sblank

 

 

# --------------------------------------------------------------------------

# 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

 

# --------------------------------------------------------------------------

# 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   CONTOURNAGE....          #    "       "

sop02   CONTOURNAGE....          #    "       "

sop03   FORET PERCAGE..          #    "       "

sop04   POCHE..........          #    "       "

sop05   RULED..........          #    "       "

sop06   2D-SWEPT.......          #    "       "

sop07   3D-SWEPT.......          #    "       "

sop08   REVOLVED.......          #    "       "

sop09   LOFT...........          #    "       "

sop10   COONS..........          #    "       "

sop11   FILLET.........          #    "       "

sop12   FLOWLINE.......          #    "       "

sop13   M.FINISH.......          #    "       "

sop14   M.ROUGH........          #    "       "

sop15   POINT..........          #    "       "

sop16   DRILL5AX.......          #    "       "

sop17   CURVE5AX.......          #    "       "

sop18   OP18...........          #    "       "

sop19   OP19...........          #    "       "

sop20   OP20...........          #    "       "

 

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 

 

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      - sans temporisation 

sg81d    G82  #  drill      - avec temporisation 

sg83     G81  #  peck drill - sans temporisation       #JQ made G81 - was G83

sg83d    G83  #  peck drill - avec temporisation 

sg73     G73  #  chip break - sans temporisation 

sg73d    G73  #  chip break - avec temporisation 

sg84     G84  #  tap        - sans temporisation

sg84d    G74  #  tap        - avec temporisation  (selects left hand)

sg85     G85  #  bore #1    - sans temporisation 

sg85d    G89  #  bore #1    - avec temporisation  

sg86     G86  #  bore #2    - sans temporisation 

sg86d    G86  #  bore #2    - avec temporisation 

sgm1     G81  #  misc #1    - sans temporisation

sgm1d    G82  #  misc #1    - avec temporisation 

sgm2     G81  #  misc #2    - sans temporisation

sgm2d    G82  #  misc #2    - avec temporisation 

 

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

 

# --------------------------------------------------------------------------

# 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   

             linarc = 0

             rotstrt = 1

 

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

             "/", scomm

 

pabs       # Absolute G code output

             absinc = 0

             sgabsinc

 

pinc       # Incremental G code output

             absinc = 1

             sgabsinc

 

pcooloff   # Coolant off "M" code output

             if prv_coolant > 0, "M9"

             if prv_coolant > 0, prv_coolant = 0

 

pcoolon    # Coolant off "M" code output

             if coolant = 1, "M7"     # Flood

             if coolant = 2, "M7"     # Mist

             if coolant = 3, "M7"     # Tool

             if prv_coolant > 0, !coolant

 

pcoolnl    # Coolant off "M" code output

             if coolant = 0, "M9"     # Off

             if coolant = 1, "M7"     # Flood

             if coolant = 2, "M7"     # Mist

             if coolant = 3, "M7"     # Tool

             if prv_coolant > 0, !coolant

 

pfr        # Feedrate W/O Negative Feedrates

             if fr > 0, fr

 

# --------------------------------------------------------------------------

# Canned Text 

# --------------------------------------------------------------------------

pcan            #Canned text - before output call

      strcantext = sblank

      if cant_no > 0,

        [

        if cant_pos1 = 0, pcant_1

        if cant_pos2 = 0, pcant_2

        if cant_pos3 = 0, pcant_3

        if cant_pos4 = 0, pcant_4

        if cant_pos5 = 0, pcant_5

        if cant_pos6 = 0, pcant_6

        if cant_pos7 = 0, pcant_7

        if cant_pos8 = 0, pcant_8

        if cant_pos9 = 0, pcant_9

        if cant_pos10 = 0, pcant_10

        n, strcantext, e

        strcantext = sblank

        ]

 

pcan1           #Canned text - with move

      strcantext = sblank

      if cant_no > 0,

        [

        if cant_pos1 = 1, pcant_1

        if cant_pos2 = 1, pcant_2

        if cant_pos3 = 1, pcant_3

        if cant_pos4 = 1, pcant_4

        if cant_pos5 = 1, pcant_5

        if cant_pos6 = 1, pcant_6

        if cant_pos7 = 1, pcant_7

        if cant_pos8 = 1, pcant_8

        if cant_pos9 = 1, pcant_9

        if cant_pos10 = 1, pcant_10

        ]

      if cstop, strcantext = strcantext + sm00

      if cgstop, strcantext = strcantext + sm01

      #Output of strcantext occurs at the end of the output line 

 

pcan2           #Canned text - after output call

      strcantext = sblank

      if cant_no > 0,

        [

        if cant_pos1 = 2, pcant_1

        if cant_pos2 = 2, pcant_2

        if cant_pos3 = 2, pcant_3

        if cant_pos4 = 2, pcant_4

        if cant_pos5 = 2, pcant_5

        if cant_pos6 = 2, pcant_6

        if cant_pos7 = 2, pcant_7

        if cant_pos8 = 2, pcant_8

        if cant_pos9 = 2, pcant_9

        if cant_pos10 = 2, pcant_10

        n, strcantext, e

        strcantext = sblank

        ]

 

pcant_1         #Canned text - output call

      cantext = cant_val1

      pcant_out

 

pcant_2         #Canned text - output call

      cantext = cant_val2

      pcant_out

 

pcant_3         #Canned text - output call

      cantext = cant_val3

      pcant_out

 

pcant_4         #Canned text - output call

      cantext = cant_val4

      pcant_out

 

pcant_5         #Canned text - output call

      cantext = cant_val5

      pcant_out

 

pcant_6         #Canned text - output call

      cantext = cant_val6

      pcant_out

 

pcant_7         #Canned text - output call

      cantext = cant_val7

      pcant_out

 

pcant_8         #Canned text - output call

      cantext = cant_val8

      pcant_out

 

pcant_9         #Canned text - output call

      cantext = cant_val9

      pcant_out

 

pcant_10        #Canned text - output call

      cantext = cant_val10

      pcant_out

 

pcant_out       #Canned text - build the string for output

      #Build the cantext string

      if cantext = 1, strcantext = strcantext + sm00

      if cantext = 2, strcantext = strcantext + sm01

      if cantext > 2,

        [

        strtextno = no2str(cantext)

        strcantext = strcantext + strm + strtextno

        ] 

 

 

# --------------------------------------------------------------------------

# Work coordinate output, user defined 

# --------------------------------------------------------------------------

pg92_sof   # G92 coordinate setting at start

             "/", n, pinc, "G28", "Z0.", e

             "/", n, "G28", "X0.", "Y0.", e

             "/", n, *sgwcs, *xh, *yh, *zh, e

 

pg92_out   # G92 coordinate setting at tool change

             "/", n, "G28", "X0.", "Y0.", e

             if gcode <> 1003, "/", n, *sgwcs, *xh, *yh, *zh, e

 

pg92_tst   # G92 coordinate test for output 

             if mi1 > 0, pg92_out

 

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, tloffno

 

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         

 

protaxis1a # Substitute Axis X/Y with Rotary axis 

           if rotstrt = 0, pcan1, n, sgcode, y, z, *xangle, pfrd, strcantext, e

           if rotstrt = 1, n, xangle, e

           if rotstrt = 1, pcan1, n, sgcode, y, z, pfrd, strcantext, e

           

protaxis1  # Substitute Axis X/Y with Rotary axis 

  pcan

           if gcode = 0, pcan1, n, sgcode, y, z, *xangle, strcantext, e

           if gcode = 1, protaxis1a

  pcan2

           

protaxis2a # Substitute Axis X/Y with Rotary axis 

           if rotstrt = 0, pcan1, n, sgcode, x, z, *yangle, pfrd, strcantext, e

           if rotstrt = 1, n, yangle, e

           if rotstrt = 1, pcan1, n, sgcode, x, z, pfrd, strcantext, e

 

protaxis2  # Substitute Axis X/Y with Rotary axis 

  pcan

           if gcode = 0, pcan1, n, sgcode, x, z, *yangle, strcantext, e

           if gcode = 1, protaxis2a

  pcan2

 

protaxis   # Substitute Axis X/Y with Rotary axis 

           xangle = xs

           yangle = ys

           if rotstrt = 1, !fr

           if fr < 0, fr = prv_fr

           !fr

           if rotaxis = 1, ldelta = abs ( y - prv_y )

           if rotaxis = 2, ldelta = abs ( x - prv_x )

           zdelta = abs ( z - prv_z )

 if rotaxis = 1, adelta = ( ( abs ( xangle - prv_xangle ) ) / 360 ) * circum

 if rotaxis = 2, adelta = ( ( abs ( yangle - prv_yangle ) ) / 360 ) * circum

           alzdelta = sqrt ( adelta^2 + ldelta ^2 + zdelta^2 )

           frdegcalc =  fr * ( 360 / circum )

 if alzdelta <> 0, frdeg = ( adelta / alzdelta ) * frdegcalc

           if adelta = 0, frdeg = fr

           frdelta = abs ( frdeg - prv_frdeg )

           if rotaxis = 1, protaxis1

           if rotaxis = 2, protaxis2

           if gcode = 1, rotstrt = 0

           !x, !y, !z

 

protary    # Rotary Move

             if rotaxis = 1, xr = 0  #Force X to zero

             if rotaxis = 2, yr = 0  #Force Y to zero

             if rotaxis > 0, linarc = 1

             circum = rotdia * pi

 

# --------------------------------------------------------------------------

# Axis linear/circular motion, user defined 

# --------------------------------------------------------------------------

parctyp2   # Arc output for R w/ sign over 180 degree sweep

             absswp = abs ( sweep )

             @absswp

             if absswp <= 180, *arcrad

             if absswp > 180, *arcradm

 

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 | full_arc_flg | arc_pitch, parctyp0

             else,

              [

              if arcoutput = 1, parctyp1

              if arcoutput = 2, parctyp2

              ]

 

prapidm    # Linear line movement - at rapid feedrate 

pcan

             pcan1, n, sgplane, sccomp, sgcode, x, y, z, strcantext, e

pcan2

 

 

plinm      # Linear line movement - at feedrate                    

               pcan

             pcan1, n, sccomp, sgcode, pApproach, x, y, z, pfr, strcantext, e

                        pcan2

 

pcirm     # Circular interpolation                                

               pcan

            pcan1, n,  sgplane, sccomp, sgcode, pApproach, x, y, z, parctyp, pfr, strcantext, e

              pcan2

 

 

 

 

#plinm      # Linear line movement - at feedrate                   

# pcan

#             pcan1,n, sccomp, sgcode, x, y, z, pfr, strcantext, e

# pcan2

 

#pcirm      # Circular interpolation                                

# pcan

#             pcan1, n, sgplane, sccomp, sgcode, x, y, z, parctyp , pfr, strcantext, e

# pcan2

 

# --------------------------------------------------------------------------

# Drilling, user defined 

# --------------------------------------------------------------------------

 

pdrillref  # Determine G98 or G99

             if initht <> refht, drillref = 98

             if initht = refht, drillref = 99

 

pdwell     # Determine whether to output dwell

             if dwell <> 0, *dwell

 

ptlchg0dr3 # Null tool change for drilling

             gcode = 0

             if zr < prv_zr, n, sgcode, *xr, *yr, e                             

             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.

# --------------------------------------------------------------------------

pheader    # File header

             " ", e

             n, "/ NOM DU PROGRAMME -", sprogname

             n, "/ DATE: ", date, " HEURE:", time

 

psof0      # Start of file for tool zero                        

             psof

 

psof       # Start of file for non-zero tool number             

             pinit

             !opcode, !coolant

             if tcnt = 1, stagetool = 1  #####################

             ##*progno     ###################################

             comment

             if mi1 <= 3, #pg92_sof #########################

             n, "G99"       #################################

             n, "/----------------------------------------------------"

             n, "/----------------------------------------------------"

             n, "G99"########################################

             if stagetool = 0, n, "G40", *t, "M6"

             if stagetool = 1, n, "G40", *next_tool, "M6"

             protary

             n, "G4", *speed, *spdlon

pcan

             pcan1, n, "G0", pabs, *xr, *yr, strcantext, e

             n, *zr, pcoolon

pcan2

 

ptlchg0    # Null tool change                                   

             if opcode = 3, ptlchg0drl

             if prv_speed <> speed, n, speed

             if coolant <> prv_coolant, n, pcoolnl

             !opcode, !coolant

    pcan

 

ptlchg     # Tool change                                        

             pinit

             !opcode

             #n, "/POSITION CHANGEMENT OUTIL"    

             #n, "G0", *xh, *yh, *zh

             n, "G40 T0"        #JQ

             n, "/ARRET ARROSAGE"

             n, "M9"

             n, "/ARRET BROCHE"

             n, "M5"

             n, "/ARRET MACHINE

             n, "M00"

             n, "/----------------------------------------------------"

             n, "/----------------------------------------------------"

             n, "/"

             if mi1 <= 3, pg92_tst

             if stagetool = 0, n, "G40", *t, "M6"

             if stagetool = 1, n, "G40", *next_tool, "M6"

             n, "G4", *speed, *spdlon

             comment

             protary

pcan

             pcan1, n, "G0", pabs, *xr, *yr, strcantext, e

pcan2

             n, *zr, pcoolon                  

             !coolant

 

peof0      # End of file for tool zero                          

             peof

 

peof       # End of file for non-zero tool  

              #n, "/POSITION CHANGEMENT OUTIL"    

              #n, "G0", *xh, *yh, *zh

              n, "G40 T0"

              n, "/ARRET ARROSAGE"

              n, "M9"

              n, "/ARRET BROCHE"

              n, "M5"

              n, "/FIN DE PROGRAMME"

              n, "M2"

 

# --------------------------------------------------------------------------

# Axis motion 

# --------------------------------------------------------------------------

prot0      # Toolplane postline - Custom post required

 

prot       # Toolplane postline - Custom post required

 

prapid     # Linear line movement - at rapid feedrate              

             if rotaxis <> 0, protaxis

             if rotaxis = 0, prapidm

 

pzrapid    # Linear movement in Z axis only - at rapid feedrate    

             n, sgcode, z

 

plin       # Linear line movement - at feedrate                    

             if rotaxis <> 0, protaxis

             if rotaxis = 0, plinm

 

pz         # Linear movement in Z axis only - at feedrate          

             n, sgcode, z, pfr

 

pcir       # Circular interpolation                                

             if rotaxis <> 0, protaxis

             if rotaxis = 0, pcirm

 

# --------------------------------------------------------------------------

# Drilling 

# --------------------------------------------------------------------------

pdrill     # Canned Drill Cycle

             pdrillref

       n, *sgdrill, pdrlxyrot, *refht, *depth, *initht, pdwell, *frplunge

 

ppeck      # Canned Peck Drill Cycle

             pdrillref

       n, *sgdrill, pdrlxyrot, *refht, *depth, *peck1, *frplunge

 

pchpbrk    # Canned Chip Break Cycle

             pdrillref

       n, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *peck1, *frplunge

 

ptap       # Canned Tap Cycle

             pdrillref

       n, *sgdrill, pdrlxyrot, *refht, *depth, *initht, *frplunge

 

pbore1     # Canned Bore #1 Cycle

             pdrillref

       n, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, pdwell, *frplunge

 

pbore2     # Canned Bore #2 Cycle

             pdrillref

       n, *drillref, *sgdrill, pdrlxyrot, *depth, *refht, *frplunge

 

pmisc1     # Canned Misc #1 Cycle (User Option)

             pdrill

 

pmisc2     # Canned Misc #2 Cycle (User Option)

             pdrill

 

pdrill_2   # Canned Drill Cycle

           n, pdrlxyrot, refht, depth, *peck1

             

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

 

pcanceldc  # Cancel canned drill cycle

             !gcode

             n, "G0", *zr     #JQ G0 was G80

             prv_z = initht

 

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, n, "/", *tnote, " ", *tldia, " ",

            *sopnote, ")"

             if t >= 0, tcnt = tcnt + 1

 

# --------------------------------------------------------------------------

# Numbered questions for Mastercam Mill

# --------------------------------------------------------------------------

38. Rapid feedrate? 300.0

1538. Rapid feedrate (metric)? 10000.0

 

80. Communications port number for receive and transmit (1 or 2) ? 2

81. Data rate (110,150,300,600,1200,2400,4800,9600,14400,19200,38400)? 300 

82. Parity (E/O/N)? E

83. Data bits (7 or 8)? 7

84. Stop bits (1 or 2)? 2

85. Strip line feeds? N

86. Delay after end of line (seconds)? 0

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?

91. Name of executable post processor? MP

92. Name of reverse post processor? RP

93. Reverse post PST file name? 

 

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? 5000

107. Average time for tool change (seconds)? 2.0

 

159. Show first and last position as fully compensated in simulation? n

 

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 

 

# --------------------------------------------------------------------------

# 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)? 4

302. Miscellaneous integer variable 2 (mi4)? 0

303. Miscellaneous integer variable 3 (mi4)? 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

 

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 

1503. Write transform operations (0=transform ops, 1=source ops, 2=both)? 1

 

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

1521. Number of controller look-ahead blocks for CDC in control? 2

 

1530. Ignore work offset numbers when processing subprograms? y

1531. Ignore contour flags when processing subprograms? y

 

# 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

 

 

pApproach # Sharnoa non-tangent approach

if cc_poss$ > 0 & cstart$ = 2, "G-1"
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...