[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V14.00 E1 P0 T1232650364 M14.00 I0
# Post Name : Generic Fanuc 3X Mill.pst
# Product : Mill
# Machine Name : Generic
# Control Name : Fanuc
# Description : Generic 3 Axis Mill Post
# 4-axis/Axis subs. : No
# 5-axis : No
# Subprograms : Yes
# Executable : MP 14.0
#
# WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO
# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.
#
优秀员工推荐# THIS POST REQUIRES A VALID 3 AXIS MACHINE DEFINITION.
# YOU WILL RECEIVE AN ERROR MESSAGE IF A ROTARY AXIS IS DETECTED IN
# THE ACTIVE AXIS COMBINATION.
#
# Associated File List$
#
# GENERIC FANUC l-5
#
# Associated File List$
#
# --------------------------------------------------------------------------
# Revision log:
# --------------------------------------------------------------------------
# CNC 06/09/05 - Initial post tup for Mastercam X
# CNC 10/06/05 - Changed parameter read for min_speed, modified pspindle, pprep$ and pt_mach
# CNC 02/03/06 - Added logic for high-speed toolpath tool inspection (e prapidout & plinout)
# CNC 06/26/06 - Initial post tup for Mastercam X2
# CNC 02/26/07 - Modified pwcs
# CNC 11/02/07 - Added prv_shftdrl$ = zero
# CNC 04/08/08 - X3 relea - Removed check for write_ops
# CNC 01/26/09 - Initial post update for Mastercam X4
# CNC 06/09/09 - Updated MD parameters
# CNC 02/03/10 - Initial post update for Mastercam X5
# CNC 08/17/10 - Added fix for canned drill cycle incremental mode code output and Z output in incremental mode
# - Added fix for X coolant output
# - Added fix for stock to leave output in tool table
# - Removed CD_VAR variables
#
# --------------------------------------------------------------------------
# Features:
# --------------------------------------------------------------------------
# This post supports Generic Fanuc code for 3 axis milling.
# It is designed to support the features of Mastercam X Mill.
#
# NEW FEATURES FOR X:
# - Sub-program support
# - Machine definition, control definition and toolpath group parameter read ctions added.
# - Post ts min/max spindle speed and max feed rate from MD and CD.
# - Variable initialization with SET_BY_MD or SET_BY_CD are overwritten in this post by parameter or
# variable ttings from MD or CD.
# - Enhanced tool information - Added switch for tool comments only, tooltable in header with no tool
# comments at tool change or tooltable in header with tool comments at tool change (e tool_info)
# Tooltable output includes cutter compensation type and stock to leave information
# - Enhanced tool staging options - enable or disable in CD. Set stagetltype in post for output type:
# Do not stage 1st tool, stage 1st tool at last tool change or stage 1st tool at end of file
(peof)
# - Supports X comments including machine name, group name and group comment output (e pcomment2)
# - Additional date, time and data path output options (e pheader)
# - Additional rigid tapping cycle (parate from original tapping cycle) and initial custom drill
# cycle support (e pmisc2$ and pdrlcst$)
# - Support for 10 additional canned text options for X
# - Decimal support for quence number output (t "Increment quence number" in CD to a decimal value
# for output. I.E. "Increment quence number" = .5, "Start quence number" = 10 : N10, N10.5, N11, N11.5, )
# - Switch for output of M00 or M01 at tool change (3 position switch, off, M00, M01 - e prog_stop)
# - Support for perate XY, XZ and YZ plane/arc variables (e Arc page in CD)
# - Support for X style coolant. Allows up to 10 different coolants to be turned on/off before, with, or after like
# canned text. Coolant output is handled by "coolant" variable and string lector for V9 style coolant,
# "coolantx" variable and string lector for X style coolant.
#
# --------------------------------------------------------------------------
# Misc. Values:
# --------------------------------------------------------------------------
# Integers:
#
# mi1 - Work coordinate system
# 0 = Reference return is generated and G92 with the
# X, Y and Z home positions at file head.
# 1 = Reference return is generated and G92 with the
# X, Y and Z home positions at each tool.
# 2 = WCS of G54, bad on Mastercam ttings.
#
# mi2 - Absolute or Incremental positioning at top level
# 0 = absolute
# 1 = incremental
#
# mi3 - Select G28 or G30 reference point return.
# 0 = G28, 1 = G30
#
# mi4 - mi10 (NOT USED)
#
# Reals:
#
# mr1 - mr10 (NOT USED)
#
# --------------------------------------------------------------------------
#Canned text:
# Entering cantext on a contour point from within Mastercam allows the
# following functions to enable/disable.
# Cantext value:
# 1 = Program Stop = output the "M00" stop code
# 2 = Optional Stop = output the "M01" optional stop code
# 3 = Block Delete on = turn on block delete codes in NC lines
# 4 = Block Delete off = turn off block delete codes in NC lines
#
# --------------------------------------------------------------------------
#Additional Notes:
# 1) G54 calls are generated where the work offt entry of 0 = G54,
# 1 = G55, etc.
# 2) Metric is applied from the NCI met_tool variable.
# 3) Incremental mode calculates motion from home position at toolchanges.
# The home position is ud to define the last position of the tool
# for all toolchanges.
# 4) The variable 'absinc' is now pre-defined, t mi2 (Misc. Integer) for
# the 'top level' absolute/incremental program output. Subprograms are
# updated through the Mastercam dialog ttings for sub-pr
ograms.
# 5) Transform subprograms are intended for u with G54.. workshifts.
#
# END_HEADER$
#
# --------------------------------------------------------------------------
# Debugging and Factory Set Program Switches
# --------------------------------------------------------------------------
#Define Constants
m_one := -1
zero := 0
提高课堂效率
one := 1
two := 2
three := 3
four := 4
five := 5
c9k := 9999
bug4$ : 1 #Debug output with the tilde '~'.
#A value greater the zero applies the variable formatting with
#debug output (default is typically FS 1 but not a guarantee).
#A value of zero gets the value directly with NO formatting.
linktolvar$ : 0 #Associate X tolerance variables to V9- variable?
linkplnvar$ : 0 #Associate X plane specific variables to V9- variable?
skp_lead_flgs$ : 0 #Do NOT u v9 style contour flags
get_1004$ : 1 #Find gcode 1004 with getnextop?
rpd_typ_v7$ : 0 #U Version 7 style contour flags/processing?
strtool_v7$ : 2 #U Version 7+ toolname?
tlchng_aft$ : 2 #Delay call to toolchange until move line
cant_tlchng$ : 1 #Ignore cantext entry on move with tlchng_aft
newglobal$ : 1 #Error checking for global variables
getnextop$ : 1 #Build the next variable table
tooltable$ : 3 #Pre-read, call the pwrtt postblock
# --------------------------------------------------------------------------
# General Output Settings
# --------------------------------------------------------------------------
maxfeedpm : 500 #SET_BY_MD Limit for feed in inch/min
ltol_m : 0.05 #Length tolerance for arccheck, metric
vtol_m : 0.0025#System tolerance, metric
maxfeedpm_m : 10000 #SET_BY_MD Limit for feed in mm/min
force_wcs : yes$ #Force WCS output at every toolchange?
stagetool : 0 #SET_BY_CD 0 = Do not pre-stage tools, 1 = Stage tools
stagetltype : 1 #0 = Do not stage 1st tool
#1 = Stage 1st tool at last tool change寒衣节习俗
#2 = Stage 1st tool at end of file (peof)
u_gear : 0 #Output gear lection code, 0=no, 1=yes
min_speed : 50 #SET_BY_MD Minimum spindle speed
progname$ : 1 #U upperca for program name (sprogname)
prog_stop : 1 #Program stop at toolchange: 0=None, 1=M01, 2 = M00
tool_info : 2 #Output tooltable information?
#0 = Off - Do not output any tool comments or tooltable
#1 = Tool comments only
#2 = Tooltable in header - no tool comments at T/C
#3 = Tooltable in header - with tool comments at T/C
tlchg_home : no$ #Zero return X and Y axis prior to tool change?
# --------------------------------------------------------------------------
# Common Ur-defined Variable Initializations (not switches!
)
# --------------------------------------------------------------------------
xia : 0 #Formatted absolute value for X incremental calculations
yia : 0 #Formatted absolute value for Y incremental calculations
zia : 0 #Formatted absolute value for Z incremental calculations
bld : 0 #Block delete active
result : 0 #Return value for functions
sav_spc : 0 #Save spaces
sav_gcode : 0 #Gcode saved
sav_absinc : 0 #Absolute/Incremental Saved Value
sav_coolant : 0 #Coolant saved
sav_frc_wcs : 0 #Force work offt flag saved
toolchng : 1 #On a toolchange flag
spdir2 : 1 #Copy for safe spindle direction calculation
#Drill variables
drlgl : -1 #Drill Select Initialize
drillref : 0 #Select drill reference
drlgcode : 0 #Save Gcode in drill
sav_dgcode : 0 #Drill gcode saved
#Subprogram variables
mr_rt_actv : 0 #Flag to indicate if G51/G68 is active
#0=Off, 1=Toolchange, 2=Subprogram call/start, G68
#3=Absolute start, both
rt_csav : 0 #C saved value
end_sub_mny : 0 #Many tool tting captured at transform sub end
comp_type : 0 #Cutter compensation type - 0=computer, 1=control, 2=wear, 3=rever wear, 4=off
#Coolant variables for X style coolant
cant_pos : 0 #Read from current canned text (cant_pos1 - cant_pos20)
秋天的古诗coolant_bin : 0 #Binary value for current coolant command
coolant_on : 0 #Binary value holding the sum of all coolants currently on
coolantx : 0 #Selector variable for coolant string lector
local_int : 0 #Local variable for output of coolant off commands
result2 : 0 #Return value for functions
suppress : 0 #Flag ud to suppress redundant coolant on commands
all_cool_off : 0 #First coolant off command shuts off ALL coolant options
#Variables to capture parameter values - u to t post switches in pt_mach
rotaxerror : 0 #Error flag - Output error message if rotary axis is detected in active axis combination
rot_ax_cnt : 0 #Rotary axis counter
陆军装甲兵学院component_type : 0 #Component type: (See documentation for complete list - )
#0 = MACHINE
#1 = STOCK_COMPONENT
#2 = MISC_COMPONENT
#3 = MACHINE_BASE_COMPONENT
#4 = LINEAR_AXIS_COMPONENT
#5 = ROTARY_AXIS_COMPONENT
#6 = RECT_TABLE_COMPONENT
#12 = CHUCK_COMPONENT
#24 = TOOL_SPINDLE_COMPONENT
#23 = ATC_COMPONENT
ra_error : 0 #Flag for aggregate operation
# --------------------------------------------------------------------------
#String and string lector definitions for NC output
# --------------------------------
-
-----------------------------------------
#Address string definitions
strm : "M"
strn : "N"
stro : "O"
strp : "P"
srad : "R"
srminus : "R-"
sblank : ""
锻炼pc肌#Cantext string definitions (spaces must be padded here)
sm00 : "M00"
sm01 : "M01"
strtextno : ""
strcantext : ""
#Transform mirror and rotate codes
strns_mir_on : "G51.1" #Programmable mirror image code
strns_mir_off : "G50.1" #Programmable mirror image cancel code
strns_rot_on : "G68" #Coordinate System Rotation
strns_rot_off : "G69" #Coordinate System Rotation Cancel
#Misc. string definitions
sopen_prn : "(" #String for open parenthesis "("
sclo_prn : ")" #String for clo parenthesis ")"
sdelimiter : "|" #String for delimiter
sg94 : "G94" #Units per minute
sg95 : "G95" #Feed per rotation
sm29 : "M29" #Rigid tapping preperation support function
sg80 : "G80" #Cancel canned drilling cycle
sg43 : "G43" #Tool length compensation
sg49 : "G49" #Tool length compensation cancel
sg92 : "G92" #Set work piece coordinate system
sm06 : "M6" #Toolchange
# --------------------------------------------------------------------------
# Error messages
# --------------------------------------------------------------------------
shomerror : "ERROR - WORK OFFSET USAGE DOES NOT SUPPORT TRANSFORM SUBPROGRAM"
sprgnerror : "ERROR - SUBPROGRAM NUMBER MATCHES THE MAIN PROGRAM NUMBER"
sra_error : "ERROR - AGGREGATES NOT SUPPORTED IN THIS POST"
srotaxerror : "ERROR - ROTARY AXIS DETECTED IN SELECTED AXIS COMBINATION- POST DOES NOT SUPPORT ROTARY AXIS OUTPUT"
# --------------------------------------------------------------------------
# General G and M Code String lect tables
# --------------------------------------------------------------------------
# Motion G code lection
sg00 : "G0" #Rapid
sg01 : "G1" #Linear feed
sg02 : "G2" #Circular interpolation CW
sg03 : "G3" #Circular interpolation CCW
sg04 : "G4" #Dwell
sgcode : "" #Target string
fstrl sg00 gcode$ sgcode 5 -1
# --------------------------------------------------------------------------
# Select work plane G code
sg17 : "G17" #XY plane code
sg19 : "G19" #YZ plane code
sg18 : "G18" #XZ plane code
sgplane : "" #Target string
fstrl sg17 plane$ sgplane 3 -1
# --------------------------------------------------------------------------
#Select english/metric code
sg20 : "G20" #Inch code
sg21 : "G21" #Metric code
smetric : "" #Target string
fstrl sg20 met_tool$ smetric 2 -1
# --------------------------------------------------------------------------
#Select reference return code
sg28 : "G28" #First reference point return
sg30 : "G30" #Second reference point return
sg28ref : "" #
Target string
fstrl sg28 mi3$ sg28ref 2 -1
# --------------------------------------------------------------------------
# Cutter compensation G code lection
scc0 : "G40" #Cancel cutter compensation
scc1 : "G41" #Cutter compensation left
scc2 : "G42" #Cutter compensation right
sccomp : "" #Target string
fstrl scc0 cc_pos$ sccomp 3 -1
# --------------------------------------------------------------------------
# Canned drill cycle string lect
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 - right hand
sg84d : "G74" #tap - 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 : "G76" #fine bore - no dwell
sgm1d : "G76" #fine bore - with dwell
sgm2 : "G84" #rigid tap - right hand
秀美人生sgm2d : "G74" #rigid tap - left hand
sgdrill : "" #Target string
fstrl sg81 drlgl sgdrill 16 -1
# --------------------------------------------------------------------------
# Select incremental or absolute G code
sg90 : "G90" #Absolute code
sg91 : "G91" #Incremental code
sgabsinc : "" #Target string
fstrl sg90 absinc$ sgabsinc 2 -1
# --------------------------------------------------------------------------
#Canned drill cycle reference height
sg98 : "G98" #Reference at initht
sg99 : "G99" #Reference at refht
sgdrlref : "" #Target string
fstrl sg98 drillref sgdrlref 2 -1
# --------------------------------------------------------------------------
# Generate string for spindle
sm04 : "M4" #Spindle rever
sm05 : "M5" #Spindle off
sm03 : "M3" #Spindle forward
spindle : "" #Target string
fstrl sm04 spdir2 spindle 3 -1
# --------------------------------------------------------------------------
# Coolant M code lection for V9 style coolant
# Note: To enable V9 style coolant, click on the General Machine Parameters icon
# in the Machine Definition Manager, Coolant tab, enable first check box
# Output of V9 style coolant commands in this post is controlled by scoolant
sm09 : "M9" #Coolant Off
sm08 : "M8" #Coolant Flood
描写荷花的作文
sm08_1 : "M8" #Coolant Mist
sm08_2 : "M8" #Coolant Tool
scoolant : "" #Target string
fstrl sm09 coolant$ scoolant 4 -1
# --------------------------------------------------------------------------
# Coolant output code lection for X style coolant
# Note: To enable X style coolant, click on the General Machine Parameters icon
# in the Machine Definition Manager, Coolant tab, disable first c