feedrate mode dpm G代码多少?? NXug6.0后处理下载中!

 下载
 收藏
该文档贡献者很忙,什么也没留下。
 下载此文档
正在努力加载中...
mpfan后处理
下载积分:900
内容提示:
文档格式:TXT|
浏览次数:0|
上传日期: 12:32:05|
文档星级:
该用户还上传了这些文档
下载文档:mpfan后处理.TXT
官方公共微信[POST_VERSION] #DO NOT MOVE OR ALTER THIS LINE# V14.00 E1 P0 T M14.00 I0
# Post Name
: MPFAN
# Product
: MILL
# Machine Name
: GENERIC FANUC
# Control Name
: GENERIC FANUC
# Description
: GENERIC FANUC MILL POST
# 4-axis/Axis subs.
: YES
# 5-axis
: NO
# Subprograms
: YES
# Executable
#
# WARNING: THIS POST IS GENERIC AND IS INTENDED FOR MODIFICATION TO
# THE MACHINE TOOL REQUIREMENTS AND PERSONAL PREFERENCE.
#
# Associated File List$
#
# Associated File List$
#
# --------------------------------------------------------------------------
# Revision log:
# --------------------------------------------------------------------------
# Programmers Note:
# CNC 07/11/05
Initial post update for Mastercam X
# CNC 06/26/06
Initial post setup for Mastercam X2
# CNC 02/26/07
Modified pwcs
# CNC 11/02/07
Added prv_shftdrl$ = zero
# CNC 04/08/08
X3 release - no changes made
#
# --------------------------------------------------------------------------
# Features:
# --------------------------------------------------------------------------
# This post supports Generic Fanuc code output for 3 and 4 axis milling.
# It is designed to support some of the features of Mastercam X.
This post DOES NOT
# support reading of the Machine Definition.
For Machine Definition support use
# Generic Fanuc 4X Mill.pst.
#
# - Supports X comments including machine name, group name and group comment output (see pcomment2)
# - Variable initialization with CD_VAR are read directly from CD.
Changing these initial values
#
in the post will not effect output.
These values are only processed during the update post routine.
# - Support for 10 additional canned text and new coolant options for X.
Coolant supportted through
#
existing canned text logic.
# - Support for seperate XY, XZ and YZ plane/arc variables (see Arc page in CD)
# - Additional functionality added to Generic Fanuc 4X Mill.PST - Use this post for more enhanced output.
#
# Following 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 = Reference return is generated and G92 with the
X, Y and Z home positions at each tool.
#
2 = WCS of G54, G55.... based on Mastercam settings.
#
# mi2 - Absolute or Incremental positioning at top level
#
0 = absolute
#
1 = incremental
#
# mi3 - Select G28 or G30 reference point return.
#
0 = G28, 1 = G30
#
#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 &M0& stop code
#
2 = Optional Stop =
output the &M1& 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
#
#Milling toolpaths (4 axis)
#Layout:
# The term &Reference View& refers to the coordinate system associated
# with the Top view (Alt-F9, the upper gnomon of the three displayed).
# Create the part drawing with the axis of rotation about the axis
# of the &Reference View& according to the setting you entered for
# 'vmc' (vertical or horizontal) and 'rot_on_x' (machine relative
# axis of rotation).
# vmc = 1 (vertical machine) uses the top toolplane as the base machine
# view.
# vmc = 0 (horizontal machine) uses the front toolplane as the base machine
# view.
# Relative to the machine matrix -
# Rotation zero position is on the Z axis for rotation on X axis.
# Rotation zero position is on the Z axis for rotation on Y axis.
# Rotation zero position is on the X axis for rotation on Z axis.
# The machine view rotated about the selected axis as a &single axis
# rotation& are the only legal views for 4 axis milling.
Rotation
# direction around the part is positive in the CCW direction when
# viewed from the plus direction of the rotating axis.
Set the variable
# 'rot_ccw_pos' to indicate the signed direction.
Always set the work
# origin at the center of rotation.
#
#Toolplane Positioning:
# Create the Cplane and Tplane as the rotation of the machine view about
# the selected axis of rotation.
The toolplane is used to calculate
# the position of the rotary axis.
This is the default setting.
#
#3 Axis Rotary (Polar)
# Polar positioning is offered in Mastercam 3 axis toolpaths through the
# rotary axis options dialog.
The selected toolpath is converted to angle
# and radius position.
The axis of rotation is forced to zero.
#
#Axis substitution:
# Use the Rotary axis substitution by drawing the geometry flattened
# from the cylinder.
The rotary axis button must be active for axis
# substitution information to be output to the NCI file. The radius of
# the rotary diameter is added to all the Z positions at output.
#
#Simultaneous 4 Axis (11 gcode):
# Full 4 axis toolpaths can be generated from various toolpaths under the
# 'multi-axis' selection (i.e. Rotary 4 axis). All 5 axis paths are
# converted to 4 axis paths where only the angle about the rotation axis
# is resolved.
#
#Drill:
# All drill methods are supported in the post.
See Simultaneous 4 Axis.
#
#Additional Notes:
# 1) Disable 4 axis by setting the numbered question 164. to 'n'.
# 2) G54 calls are generated where the work offset entry of 0 = G54,
#
1 = G55, etc.
# 3) Metric is applied from the NCI met_tool variable.
# 4) Incremental mode calculates motion from home position at toolchanges.
#
The home position is used to define the last position of the tool
#
for all toolchanges.
# 5) The variable 'absinc' is now pre-defined, set mi2 (Misc. Integer) for
#
the 'top level' absolute/incremental program output.
Subprograms are
#
updated through the Mastercam dialog settings for sub-programs.
# 6) Always avoid machining to the center of rotation with rotary axis!
# 7) Transform subprograms are intended for use with G54.. workshifts.
#
# END_HEADER$
#
# --------------------------------------------------------------------------
# Debugging and Factory Set Program Switches
# --------------------------------------------------------------------------
m_one
#Define constant
zero
#Define constant
one
#Define constant
two
#Define constant
three
#Define constant
#Define constant
#Define constant
c9k
#Define constant
#CD_VAR Enable Quick Post Processing, (set to no for debug)
bug1$
#0=No display, 1=Generic list box, 2=Editor
bug2$
#Append postline labels, non-zero is column position?
#Append whatline number to each NC line?
bug4$
#Append NCI line number to each NC line?
whatno$
#Do not perform whatline branches? (leave as yes)
linktolvar$
#Associate X tolerance variables to V9- variable?
linkplnvar$
#Associate X plane specific variables to V9- variable?
linklvar$
#Associate X lathe specific variables to V9- variable?
skp_lead_flgs$ : 0
#Do NOT use v9 style contour flags
get_1004$
#Find gcode 1004 with getnextop?
rpd_typ_v7$
#Use Version 7 style contour flags/processing?
strtool_v7$
#Use Version 7+ toolname?
tlchng_aft$
#Delay call to toolchange until move line
cant_tlchng$ : 1
#Ignore cantext entry on move with tlchng_aft
newglobal$
#Error checking for global variables
getnextop$
#Build the next variable table
# --------------------------------------------------------------------------
# General Output Settings
# --------------------------------------------------------------------------
sub_level$
#CD_VAR Enable automatic subprogram support
breakarcs$
#CD_VAR Break arcs, 0 = no, 1 = quadrants, 2 = 180deg. max arcs
arctype$
#CD_VAR Arc center 1=abs, 2=St-Ctr, 3=Ctr-St, 4=unsigned inc.,
#5 = R no sign, 6 = R signed neg. over 180
do_full_arc$ : 0
#CD_VAR Allow full circle output? 0=no, 1=yes
helix_arc$
#CD_VAR Support helix arc output, 0=no, 1=all planes, 2=XY plane only
arccheck$
#CD_VAR Check for small arcs, convert to linear
atol$
#CD_VAR Angularity tolerance for arccheck
ltol$
: 0.002 #CD_VAR Length tolerance for arccheck
maxfeedpm
#Limit for feed in inch/min
maxfeedpm_m : 10000
#Limit for feed in mm/min
force_wcs
#Force WCS output at every toolchange?
spaces$
#CD_VAR Number of spaces to add between fields
omitseq$
#CD_VAR Omit sequence numbers?
seqmax$
#CD_VAR Max. sequence number
stagetool
#SET_BY_CD 0 = Do not pre-stage tools, 1 = Stage tools
use_gear
#Output gear selection code, 0=no, 1=no
#Maximum spindle speed
min_speed
#Minimum spindle speed
nobrk$
#Omit breakup of x, y & z rapid moves
progname$
#Use uppercase for program name (sprogname)
# --------------------------------------------------------------------------
# Rotary Axis Settings
# --------------------------------------------------------------------------
vmc
#0 = Horizontal Machine, 1 = Vertical Mill
#Default Rotary Axis Orientation, See ques. 164.
#0 = Off, 1 = About X, 2 = About Y, 3 = About Z
rot_ccw_pos : 1
#Axis signed dir, 0 = CW positive, 1 = CCW positive
index
#Use index positioning, 0 = Full Rotary, 1 = Index only
ctable
#Degrees for each index step with indexing spindle
use_frinv
#Use Inverse Time Feedrates in 4 Axis, (0 = no, 1 = yes )
maxfrdeg
#Limit for feed in deg/min
maxfrinv
: 999.99#Limit for feed inverse time
frc_cinit
#Force C axis reset at toolchange
ctol
#Tolerance in deg. before rev flag changes
ixtol
#Tolerance in deg. for index error
frdegstp
#Step limit for rotary feed in deg/min
# --------------------------------------------------------------------------
# Enable Canned Drill Cycle Switches
# --------------------------------------------------------------------------
usecandrill$ : yes$
#CD_VAR Use canned cycle for drill
usecanpeck$
#CD_VAR Use canned cycle for Peck
usecanchip$
#CD_VAR Use canned cycle for Chip Break
usecantap$
#CD_VAR Use canned cycle for Tap
usecanbore1$ : yes$
#CD_VAR Use canned cycle for Bore1
usecanbore2$ : yes$
#CD_VAR Use canned cycle for Bore2
usecanmisc1$ : yes$
#CD_VAR Use canned cycle for Misc1
usecanmisc2$ : yes$
#CD_VAR Use canned cycle for Misc2
# --------------------------------------------------------------------------
# Common User-defined Variable Initializations (not switches!)
# --------------------------------------------------------------------------
xia
#Formated absolute value for X incremental calculations
yia
#Formated absolute value for Y incremental calculations
zia
#Formated absolute value for Z incremental calculations
cia
#Formated absolute value for C incremental calculations
#Cut type flag
#0 = Tool Plane, 1 = Axis Subs,
2 = Polar, 3 = 4/5 axis
bld
#Block delete active
result
#Return value for functions
sav_spc
#Save spaces
sav_gcode
#Gcode saved
sav_absinc
#Absolute/Incremental Saved Value
sav_coolant : 0
#Coolant saved
sav_frc_wcs : 0
#Force work offset flag saved
toolchng
#On a toolchange flag
#Copy for safe spindle direction calculation
#Drill variables
drlgsel
#Drill Select Initialize
drillref
#Select drill reference
peckacel$
#CD_VAR Fractional percent to reduce peck2 when usecan.. : no
drlgcode
#Save Gcode in drill
sav_dgcode
#Drill gcode saved
#Subprogram variables
mr_rt_actv
#Flag to indicate if G51/G68 is active
#0=Off, 1=Toolchange, 2=Subprogram call/start, G68
#3=Absolute start, both
rt_csav
#C saved value
end_sub_mny : 0
#Many tool setting captured at transform sub end
#Rotary/Index variables
csav
#C saved value
prvcabs
#Saved cabs from pe_inc_calc,
#Used for rotary feed and direction calculations
cdelta
#Calculation for angle change
rev
#Calculation for deg/min
sav_rev
#Saved revolution counter
indx_out
#Rotation direction calculation
fmt
indx_mc #Rotation direction calculation
#Vector Constants for Rotatary Calculations
aaxisx
#A axis rotation vector constant
aaxisy
#A axis rotation vector constant
aaxisz
#A axis rotation vector constant
baxisx
#B axis rotation vector constant
baxisy
#B axis rotation vector constant
baxisz
#B axis rotation vector constant
caxisx
#C axis rotation vector constant
caxisy
#C axis rotation vector constant
caxisz
#C axis rotation vector constant
#Feedrate calculation variables
frdelta
#Calculation for deg/min
frinv
#Feedrate inverse time
frdeg
#Feedrate deg/min actual
prvfrdeg
#Feedrate deg/min actual
ldelta
#Calculation for deg/min, linear
cldelta
#Calculation for deg/min, linear and rotary
circum
#Calculation for deg/min
ipr_type
#Feedrate for Rotary, 0 = UPM, 1 = DPM, 2 = Inverse
# --------------------------------------------------------------------------
#String and string selector definitions for NC output
# --------------------------------------------------------------------------
#Numbered question 164. string to detect Rotary axis y/n
sq164 : &&
#Default paren strings
sopen_prn
: &(&
sclose_prn
#Address string definitions
strm
: &M&
strn
: &N&
stro
: &O&
strp
: &P&
srad
: &R&
srminus
: &R-&
sblank : &&
#Cantext string definitions (spaces must be padded here)
sm00
: &M0&
sm01
: &M1&
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
#Coordinate System Rotation
strns_rot_off
#Coordinate System Rotation Cancel
# --------------------------------------------------------------------------
# Error messages
# --------------------------------------------------------------------------
saxiswarn
: &WARNING-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') OVERWRITTEN BY OPERATION&
saxisoff
: &ERROR-POST ROTARY AXIS ASSIGNMENT ('rot_on_x') IS DISABLED&
saxiserror
: &ERROR-INVALID ROTARY AXIS ASSIGNMENT ('rot_on_x') FOR CURRENT OPERATION&
sindxerror
: &WARNING-INDEX ANGLE DOES NOT MATCH POST SETTING ('ctable')&
stlorgerr
: &ERROR-TOOL ORIGIN DOES NOT MATCH CENTER OF ROTATION IN POLAR MILLING&
shomeserror : &ERROR-G92 WORK OFFSET ('mi1') DOES NOT SUPPORT TRANSFORM SUBPROGRAM&
sprgnerror
: &ERROR-SUBPROGRAM NUMBER MATCHES THE MAIN PROGRAM NUMBER&
# --------------------------------------------------------------------------
# General G and M Code String select tables
# --------------------------------------------------------------------------
# Motion G code selection
sg00
#Rapid
sg01
#Linear feed
sg02
#Circular interpolation CW
#Circular interpolation CCW
#Dwell
sgcode : &&
#Target for string
fstrsel sg00 gcode$ sgcode 5 -1
# --------------------------------------------------------------------------
# Select work plane G code
sg17
#XY plane code
#YZ plane code
#XZ plane code
sgplane : &&
#Target string
fstrsel sg17 plane$ sgplane 3 -1
# --------------------------------------------------------------------------
#Select english/metric code
#Inch code
sg21
#Metric code
smetric : &&
#Target string
fstrsel sg20 met_tool$ smetric 2 -1
# --------------------------------------------------------------------------
#Select reference return code
#First reference point return
sg30
#Second reference point return
sg28ref : &&
#Target string
fstrsel sg28 mi3$ sg28ref 2 -1
# --------------------------------------------------------------------------
# Cutter compensation G code selection
scc0
#Cancel cutter compensation
scc1
#Cutter compensation left
scc2
#Cutter compensation right
sccomp : &&
#Target for string
fstrsel scc0 cc_pos$ sccomp 3 -1
# --------------------------------------------------------------------------
# Canned drill cycle string select
sg81
- no dwell
- with dwell
#peck drill - no dwell
#peck drill - with dwell
#chip break - no dwell
#chip break - with dwell
- right hand
sg84d
- left hand
sg85
- no dwell
- with dwell
- no dwell
- with dwell
- no dwell
sgm1d
- with dwell
sgm2
- no dwell
sgm2d
- with dwell
sgdrill : &&
#Target for string
fstrsel sg81 drlgsel sgdrill 16 -1
# --------------------------------------------------------------------------
# Select incremental or absolute G code
#Absolute code
sg91
#Incremental code
sgabsinc : &&
#Target string
fstrsel sg90 absinc$ sgabsinc 2 -1
# --------------------------------------------------------------------------
# Feed mode G code selection
sg94
#UPM
sg94d
#DPM, See pfcalc_deg if you use another gcode
sg93
#Inverse
sgfeed : &&
#Target for string
fstrsel sg94 ipr_type sgfeed 3 -1
# --------------------------------------------------------------------------
#Canned drill cycle reference height
sg98
#Reference at initht
sg99
#Reference at refht
sgdrlref : &&
#Target for string
fstrsel sg98 drillref sgdrlref 2 -1
# Drill cycle G string select
# --------------------------------------------------------------------------
# Generate string for spindle
#Spindle reverse
#Spindle off
#Spindle forward
spindle : &&
#Target for string
fstrsel sm04 spdir2 spindle 3 -1
# --------------------------------------------------------------------------
# Coolant M code selection
sm09
#Coolant Off
sm08
#Coolant Flood
#Coolant Mist
sm08_2
#Coolant Tool
scoolant : &&
#Target for string
fstrsel sm09 coolant$ scoolant 4 -1
# --------------------------------------------------------------------------
# Table rotation direction
# Table rotation direction, index
#Rotate CW code
#Rotate CCW code
sindx_mc : &&
#Target for string
fstrsel sindx_cw indx_mc sindx_mc 2 -1
# --------------------------------------------------------------------------
# Define the gear selection code
flktbl
#Lookup table definition - table no. - no. entries
#Low gear range
#Med gear range
#Hi gear range
# --------------------------------------------------------------------------
# Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta
# --------------------------------------------------------------------------
#Default english/metric position format statements
fs2 1
#Decimal, absolute, 7 place, default for initialize (:)
fs2 2
#Decimal, absolute, 4/3 place
fs2 3
#Decimal, delta, 4/3 place
#Common format statements
fs2 4
#Integer, not leading
fs2 5
#Integer, force two leading
fs2 6
#Integer, force three leading
fs2 7
#Integer, force four leading
fs2 9
#Decimal, absolute, 1 place
fs2 10
#Decimal, absolute, 2 place
fs2 11
#Decimal, absolute, 3 place
fs2 12
#Decimal, absolute, 4 place
fs2 13
#Decimal, absolute, 5 place
fs2 14
#Decimal, delta, 3 place
fs2 15
#Decimal, absolute, 2/1 place (feedrate)
fs2 16
#Integer, forced output
fs2 17
#Decimal, absolute, 2/3 place (tapping feedrate)
# This format statement is used for sequence number output
# Number of places output is determined by value for &Increment Sequence Number& in CD
# Max depth to the right of the decimal point is set in the fs statement below
fs2 21
#Decimal, 7 place, omit decimal if integer value
fs2 22
#Decimal, 3 place, omit decimal if integer value
# --------------------------------------------------------------------------
# Toolchange / NC output Variable Formats
# --------------------------------------------------------------------------
fmt
#Tool Number
fmt
first_tool$
#First Tool Used
next_tool$
#Next Tool Used
#Diameter Offset Number
fmt
#Length Offset Number
fmt
#WCS G address
fmt
#WCS P address
fmt
#Spindle Speed
fmt
#Gear range
# --------------------------------------------------------------------------
fmt
#Sequence number
fmt
#X position output
fmt
#Y position output
fmt
#Z position output
fmt
#X position output
fmt
#Y position output
fmt
#Z position output
fmt
#C axis position
fmt
#C axis position
fmt
#Index position
fmt
#C axis position, G68
fmt
#Arc center description in X
fmt
#Arc center description in Y
fmt
#Arc center description in Z
fmt
#Arc Radius
fmt
#Feedrate
fmt
#Dwell
fmt
#Canned text
# --------------------------------------------------------------------------
#Move comment (pound) to output colon with program numbers
fmt
#Program number
#fmt &:& 7
#Program number
fmt
main_prg_no$ #Program number
#fmt &:& 7
main_prg_no$ #Program number
fmt
sub_prg_no$
#Program number
#fmt &:& 7
sub_prg_no$
#Program number
fmt
sub_trnsx$
#Rotation point
fmt
sub_trnsy$
#Rotation point
fmt
sub_trnsz$
#Rotation point
# --------------------------------------------------------------------------
fmt
#First peck increment (positive)
fmt
#Fine bore tool shift
fmt
#Reference height
fmt
#Reference height
# --------------------------------------------------------------------------
fmt &TOOL - &
# Note format
fmt & DIA. OFF. - & 4
# Note format
fmt & LEN. - &
# Note format
fmt & DIA. - &
# Note format
# --------------------------------------------------------------------------
# Tool Comment / Manual Entry Section
# --------------------------------------------------------------------------
ptoolcomment
#Comment for tool
tnote = t$
toffnote = tloffno$
tlngnote = tlngno$
&(&, pstrtool, *tnote, *toffnote, *tlngnote, *tldia$, &)&, e$
#Comment for tool
if strtool$ && sblank,
strtool$ = ucase(strtool$)
*strtool$, & &
#Comment from manual entry (must call pcomment2)
pcomment2 #Required if doing boolean 'if' logic testing!
#Output Comment from manual entry
scomm$ = ucase (scomm$)
if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$
#Manual entry - as comment
if gcode$ = 1006, scomm$, e$
#Manual entry - as code
if gcode$ = 1007, sopen_prn, scomm$, sclose_prn
#Manual entry - as comment with move NO e$
if gcode$ = 1026, scomm$
#Manual entry - as code with move NO e$
if gcode$ = 1008, sopen_prn, scomm$, sclose_prn, e$
#Operation comment
if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$
#Machine name
if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$
#Group comment
if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$
#Group name
if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$
#File Descriptor
# --------------------------------------------------------------------------
# Start of File and Toolchange Setup
# --------------------------------------------------------------------------
psof0$
#Start of file for tool zero
#Start of file for non-zero tool number
toolchng = one
if ntools$ = one,
#skip single tool outputs, stagetool must be on
stagetool = m_one
!next_tool$
*progno$, e$
&(PROGR NAME= &,sprogname$, &
WORK=&pwcs &)&, e$
&(DATE=&, date$, & TIME=&,time$, &)&, e$
&(DAIRUYU TEL= E-MAIL= QQ=)&, e$
*smetric, *sgplane,&G80&, &G40&,&M5&, e$
&G91& *sg28ref, &Z0.&, &M9&, e$
sav_absinc = absinc$
n$, *t$, if mi1$ &= one, #Work coordinate system
absinc$ = one
pfbld, n$, sgabsinc, *sg28ref, &Z0.&, e$
pfbld, n$, *sg28ref, &X0.&, &Y0.&, e$
pfbld, n$, &G92&, *xh$, *yh$, *zh$, e$
absinc$ = sav_absinc
pcom_moveb
c_mmlt$ #Multiple tool subprogram call
ptoolcomment
if stagetool &= zero, pbld
if mi1$ & one, absinc$ = zero
pwcs, *sgabsinc, *sgcode, pfxout, pfyout,
pfcout, *spindle, *speed, pgear, strcantext, e$
&G43&, *tlngno$, pfzout, scoolant, next_tool$, e$
absinc$ = sav_absinc
pcom_movea
toolchng = zero
c_msng$ #Single tool subprogram call
#Call from NCI null tool change (tool number repeats)
pcom_moveb
c_mmlt$ #Multiple tool subprogram call
result = newfs(15, feed)
#Reset the output format for 'feed'
sgplane, e$
pspindchng
scoolant, e$
if mi1$ & one & workofs$ && prv_workofs$,
sav_absinc = absinc$
absinc$ = zero
sgabsinc, pwcs, pfxout, pfyout, pfzout, pfcout, e$
pe_inc_calc
ps_inc_calc
absinc$ = sav_absinc
if cuttype = zero, ppos_cax_lin
if gcode$ = one, plinout
else, prapidout
pcom_movea
c_msng$ #Single tool subprogram call
#Tool change
toolchng = one
if mi1$ = one, #Work coordinate system
pfbld, n$, *sg28ref, &X0.&, &Y0.&, e$
pfbld, n$, &G92&, *xh$, *yh$, *zh$, e$
pcom_moveb
pbld, n$,*t$,c_mmlt$ #Multiple tool subprogram call
ptoolcomment
result = newfs(15, feed)
#Reset the output format for 'feed'
sav_absinc = absinc$
if mi1$ & one, absinc$ = zero
pcan1, pwcs, *sgabsinc, *sgcode, pfxout, pfyout,
pfcout, *spindle, *speed, pgear, strcantext, e$
&G43&, *tlngno$, pfzout, scoolant, next_tool$, e$
absinc$ = sav_absinc
pcom_movea
toolchng = zero
c_msng$ #Single tool subprogram call
#End of tool path, toolchange
sav_absinc = absinc$
absinc$ = one
sav_coolant = coolant$
coolant$ = zero
#cc_pos is reset in the toolchange here
cc_pos$ = zero
gcode$ = zero
sccomp, *sm05, psub_end_mny, e$
sgabsinc, sgcode, *sg28ref, &Z0.&, scoolant, e$
absinc$ = sav_absinc
coolant$ = sav_coolant
protretinc
#Reset the C axis revolution counter
if frc_cinit & rot_on_x,
rev = zero
sav_rev = zero
cabs = zero
csav = zero
indx_out = zero
if index, e$, pindxcalc, pindex
else, *cabs
prvcabs = zero
!csav, !cabs
#End of file for tool zero
#End of file for non-zero tool
#Remove pound character to output first tool with staged tools
#if stagetool = one, pbld, n, *first_tool, e
*sg28ref, &Y0.&,&M19&, protretinc, e$
&G90&,&M5&,&S600&, e$
#G54+ coordinate setting at toolchange
if mi1$ & one,
sav_frc_wcs = force_wcs
if sub_level$ & 0, force_wcs = zero
if workofs$ && prv_workofs$ | (force_wcs & toolchng),
if workofs$ & 6,
g_wcs = workofs$ + 54
p_wcs = workofs$ - five
&G54.1&, *p_wcs
force_wcs = sav_frc_wcs
#Find spindle gear from lookup table
if use_gear = one,
gear = frange (one, speed)
#Toolchange setup
pspindchng
#Spindle speed change
if prv_spdir2 && spdir2 & prv_speed && zero,
if prv_speed && speed | prv_spdir2 && spdir2,
*speed, *spindle, pgear, e$
!speed, !spdir2
#Spindle speed calculations for RPM
speed = abs(ss$)
if maxss$ = zero | maxss$ & max_speed, maxss$ = max_speed
#zero indicates spindle off (not a mistake)
if speed & max_speed, speed = maxss$
if speed & min_speed, speed = min_speed
spdir2 = fsg3(spdir$)
#Setup post based on switch settings
if stagetool = one, bldnxtool$ = one
#Rotaxtyp = 1 sets initial matrix to top
#Rotaxtyp = -2 sets initial matrix to front
if vmc, rotaxtyp$ = one
else, rotaxtyp$ =
#Shut off rotary axis if, Q164. Enable Rotary Axis button? n
if ucase(sq164) = strn, rot_on_x = zero
#Call before start of file
if met_tool$ = one, #Metric constants and variable adjustments
maxfeedpm = maxfeedpm_m
#End of tool path, before reading new tool data
!speed, !spdir2
ptlchg1002$
#Call at actual toolchange, end last path here
if cuttype && one, sav_rev = rev #Axis Sub does not update to rev
whatline$ = four #Required for vector toolpaths
if gcode$ = 1000,
#Null toolchange
#Toolchange and Start of file
if gcode$ = 1002,
#Actual toolchange
if stagetool = one, prv_next_tool$ = m_one
prv_xia = vequ(xh$)
prv_feed = c9k
# --------------------------------------------------------------------------
# Motion NC output
# --------------------------------------------------------------------------
#The variables for absolute output are xabs, yabs, zabs.
#The variables for incremental output are xinc, yinc, zinc.
# --------------------------------------------------------------------------
prapidout
#Output to NC of linear movement - rapid
sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, pcout, strcantext, scoolant, e$
#Output to NC of linear movement - feed
sgfeed, sgplane, `sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, pcout, feed, strcantext, scoolant, e$
#Output to NC of circular interpolation
`sgfeed, sgplane, sgcode, sgabsinc, pccdia,
pxout, pyout, pzout, pcout, parc, feed, strcantext, scoolant, e$
pcom_moveb
#Common motion preparation routines, before
ps_inc_calc
#Movement output
pcom_moveb
if cuttype = zero, ppos_cax_lin #Toolplane rotary positioning
if gcode$ = zero, prapidout
if gcode$ = one, plinout
if gcode$ & one & gcode$ & four, pcirout
if mr_rt_actv, #Restore absolute/incremental for G51/G68
absinc$ = sav_absinc
mr_rt_actv = zero
pcom_movea
pcom_movea
#Common motion preparation routines, after
pe_inc_calc
#Call from NCI gcode 4
pspindchng
if fmtrnd(dwell$), pcan1,
*sgcode, *dwell$, strcantext, e$
else, pcan1,
strcantext, e$
#Output to NC of linear movement - rapid
#Output to NC of linear movement - rapid Z only
#Output to NC of linear movement - feed
#Output to NC of linear movement - feed Z only
#Output to NC of vector NCI
#Output to NC of circular interpolation
#Pre-process rotary motion control flags
pmx0$
#5 axis gcode setup
if drillcur$ = zero,
-2,gcode$ = zero
else, gcode$ = one
#Linear movement, mill motion test
pmotion_su
#Circular interpolation, mill arc motion test
pmotion_su
# --------------------------------------------------------------------------
# Motion output components
# --------------------------------------------------------------------------
pbld
#Canned text - block delete
if bld, '/'
#Force - block delete
#Cutter Compensation
#Force Dxx#
if prv_cc_pos$ && cc_pos$ & cc_pos$, prv_tloffno$ = c9k
if cc_pos$, tloffno$
#Force X axis output
if absinc$ = zero, *xabs, !xinc
else, *xinc, !xabs
if absinc$ = zero, xabs, !xinc
else, xinc, !xabs
#Force Y axis output
if absinc$ = zero, *yabs, !yinc
else, *yinc, !yabs
if absinc$ = zero, yabs, !yinc
else, yinc, !yabs
#Force Z axis output
if absinc$ = zero, *zabs, !zinc
else, *zinc, !zabs
if absinc$ = zero, zabs, !zinc
else, zinc, !zabs
#Force C axis output
if index = zero & rot_on_x,
if absinc$ = zero, *cabs, !cinc
else, *cinc, !cabs
#C axis output
if index = zero & rot_on_x,
if absinc$ = zero, cabs, !cinc
else, cinc, !cabs
#Index output
if index & rot_on_x,
`sindx_mc, indx_out, e$
!cabs, !cinc
#Select the arc output
if (plane$ = zero & (arctype$ = one | arctype$ = four)) |
(plane$ = one & (arctypeyz$ = one | arctypeyz$ = four)) | #YZ Plane
(plane$ = two & (arctypexz$ = one | arctypexz$ = four)),
result = newfs(two, iout)
result = newfs(two, jout)
result = newfs(two, kout)
result = newfs(three, iout)
result = newfs(three, jout)
result = newfs(three, kout)
if (plane$ = 0 & arctype$ & five) | (plane$ = 1 & arctypeyz$ & five) |
(plane$ = 2 & arctypexz$ & five) | full_arc_flg$ | arc_pitch$,
#Arc output for IJK
# If you do NOT want to force out the I,J,K values,
# remove the &*& asterisks on the *i, *j, *k 's below...
if plane$ = zero, *iout, *jout, kout #XY plane code - G17
if plane$ = one, iout, *jout, *kout
#YZ plane code - G19
if plane$ = two, *iout, jout, *kout
#XZ plane code - G18
!i$, !j$, !k$
#Arc output for R
if abs(sweep$)&=180 | (plane$ = 0 & arctype$ = five) | (plane$ = 1 & arctypeyz$ = five) |
(plane$ = 2 & arctypexz$ = five), result = nwadrs(srad, arcrad$)
else, result = nwadrs(srminus, arcrad$)
ppos_cax_lin
#Position the rotary axis before move - rapid
if index, pindex
if fmtrnd(prv_cabs) && fmtrnd(cabs) & rot_on_x,
sav_gcode = gcode$
gcode$ = zero
sgcode, pcout, e$
ps_cinc_calc
gcode$ = sav_gcode
# --------------------------------------------------------------------------
# Drilling
# --------------------------------------------------------------------------
pdrill0$
#Pre-process before drill call
sav_dgcode = gcode$ #Capture gcode for 5 axis drill
pdrlcommonb
#Canned Drill Cycle common call, before
if sav_dgcode = 81,
result = newfs (two, zinc)
if drillcyc$ = three, drlgsel = fsg1(-ss$) + drillcyc$ * two
else, drlgsel = fsg2(dwell$) + drillcyc$ * two
if initht$ && refht$, drillref = zero
else, drillref = one
prv_refht_a = c9k
prv_refht_i = c9k
prv_dwell$ = zero
prv_shftdrl$ = zero
if cuttype = three, sav_dgcode = gcode$
else, z$ = depth$
if cuttype = one, prv_zia = initht$ + (rotdia$/two)
else, prv_zia = initht$
pcom_moveb
feed = fr_pos$
#5 axis must map the true Z, correct Z calculation here
if cuttype = three,
prv_zia = zabs + (-depth$) + initht$
zia = fmtrnd(zabs)
zinc = zia - prv_zia
#R drill position
if cuttype = one, refht_a = refht$ + (rotdia$ / two)
else, refht_a = refht$
refht_i = refht$ - initht$
if cuttype = three, refht_a = w$
if absinc$ = zero, refht_a, !refht_i
else, refht_i, !refht_a
#Canned Drill Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, dwell$, *feed, strcantext, e$
pcom_movea
#Canned Peck Drill Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, *peck1$, *feed, strcantext, e$
pcom_movea
#Canned Chip Break Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, *peck1$, *feed, strcantext, e$
pcom_movea
#Canned Tap Cycle
pdrlcommonb
result = newfs(17, feed)
# Set for tapping Feedrate format
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, *feed, strcantext, e$
pcom_movea
#Canned Bore #1 Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, dwell$, *feed, strcantext, e$
pcom_movea
#Canned Bore #2 Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, *feed, strcantext, e$
pcom_movea
#Canned Misc #1 Cycle
pdrlcommonb
*sgdrlref, *sgdrill, pxout, pyout, pfzout, pcout,
prdrlout, shftdrl$, dwell$, *feed, strcantext, e$
pcom_movea
#Canned Misc #2 Cycle (User Option)
#Canned Drill Cycle, additional points
pdrlcommonb
pxout, pyout, pzout, pcout, prdrlout, dwell$,
feed, strcantext, e$
pcom_movea
#Canned Peck Drill Cycle
pchpbrk_2$
#Canned Chip Break Cycle
#Canned Tap Cycle
#Canned Bore #1 Cycle
#Canned Bore #2 Cycle
#Canned Misc #1 Cycle
#Canned Misc #2 Cycle
#Custom drill cycles 8 - 19 (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
&CUSTOMIZABLE DRILL CYCLE &, pfxout, pfyout, pfzout, pfcout, e$
pcom_movea
pdrlcst_2$
#Custom drill cycles 8 - 19, additional points (user option)
#Use this postblock to customize drilling cycles 8 - 19
pdrlcommonb
&CUSTOMIZABLE DRILL CYCLE &, pfxout, pfyout, pfzout, pfcout, e$
pcom_movea
pcanceldc$
#Cancel canned drill cycle
result = newfs (three, zinc)
z$ = initht$
if cuttype = one, prv_zia = initht$ + (rotdia$/two)
else, prv_zia = initht$
!zabs, !zinc
prv_gcode$ = zero
&G80&, strcantext, e$
# --------------------------------------------------------------------------
#Subprogram postblocks
#sub_trnstyp - 0=mirror, 1=rotate, 2=scale, 3=translate
#sub_trnmthd (mirror) - 0=X axis, 1=Y axis, 2=line
#sub_trnmthd (rotate) - 0=tplane, 1=tplane origin only, 2=coordinates
# --------------------------------------------------------------------------
psub_call_m$
#Call to main level, single tool
psub_call_trans
psub_call_mm$
#Call to main level, multiple tools
psub_call_trans
psub_call_trans #Translate level calls from toolchange, user
if mi1$ &= one, result = mprint(shomeserror)
sav_absinc = absinc$
#Mirror or Rotate Coord's
if sub_trnstyp$ = zero | (sub_trnstyp$ = one & mr_rt_actv),
#The original pattern is not mirrored or rotated
if sub_sec_no$,
absinc$ = zero
if sub_trnstyp$, psub_rotate
else, psub_mirror
mr_rt_actv = three
else, #Translate
if sub_mny_t$,
if mi1$ & one, absinc$ = zero
*sgcode, *sgabsinc, pwcs, pfxout, pfyout, pfzout,
pfcout, e$
pe_inc_calc
ps_inc_calc
absinc$ = sav_absinc
result = nwadrs(strp, main_prg_no$)
if progno$ = main_prg_no$, result = mprint(sprgnerror)
&M98&, *main_prg_no$, e$
prv_feed = c9k #Force feed in sub
psub_mirror
#Mirror start code, user
#Mirror Y axis
if sub_trnmthd$,
*sgabsinc, strns_mir_on, *sub_trnsx$, e$
#Mirror X axis
*sgabsinc, strns_mir_on, *sub_trnsy$, e$
psub_rotate
#Rotate start code, user
*sgcode, *sgabsinc, strns_rot_on, *sub_trnsx$, *sub_trnsy$,
[absinc$ = one], *sgabsinc, *rt_cinc, e$
psub_st_m$
#Header in main level
result = nwadrs(stro, main_prg_no$)
*main_prg_no$, e$
#G51/G68 requires absolute position on first move
if mr_rt_actv & absinc$ = one,
sav_absinc = absinc$
absinc$ = zero
prv_absinc$ = m_one
prv_xabs = m_one
prv_yabs = m_one
sgabsinc, e$
psub_end_m$
#End in main level
n$, &M99&, e$
prv_absinc$ =
#Reset update variables for subs at main level
#Mirror or Rotate cancel, output is forced
if (sub_trnstyp$ = zero & esub_sec_no$ & zero)
| (sub_trnstyp$ = one & esub_sec_no$ = esub_totl_no$-one
& sub_trnmthd$ = two),
subout$ = zero
no_nc_out$ = m_one
sav_absinc = absinc$
#Mirror cancel
if sub_trnstyp$ = zero,
absinc$ = zero
*sgabsinc, strns_mir_off, *sub_trnsx$, *sub_trnsy$, e$
else, #Rotate cancel
strns_rot_off, e$
absinc$ = sav_absinc
no_nc_out$ = zero
end_sub_mny = sub_mny_t$
psub_end_mny
#End in main level for many tools sub, user
#Check for coming out of xform with stage tool.
if end_sub_mny & stagetool = one,
end_sub_mny = zero
psub_call_s$
#Call to sub level
result = nwadrs(strp, sub_prg_no$)
sub_prg_no$ = sub_prg_no$ + 1000 #Add sub number offset
if progno$ = sub_prg_no$, result = mprint(sprgnerror)
&M98&, *sub_prg_no$, e$
psub_st_s$
#Header in sub leveln
result = nwadrs(stro, sub_prg_no$)
*sub_prg_no$, e$
sgabsinc, e$
psub_end_s$
#End in sub level
n$, &M99&, e$
prv_absinc$ =
# --------------------------------------------------------------------------
# Canned Text
# --------------------------------------------------------------------------
pcan
#Canned text - before output call
strcantext = sblank
if cant_no$ & zero,
if cant_pos1$ = zero | cant_pos1$ = three, pcant_1
if cant_pos2$ = zero | cant_pos2$ = three, pcant_2
if cant_pos3$ = zero | cant_pos3$ = three, pcant_3
if cant_pos4$ = zero | cant_pos4$ = three, pcant_4
if cant_pos5$ = zero | cant_pos5$ = three, pcant_5
if cant_pos6$ = zero | cant_pos6$ = three, pcant_6
if cant_pos7$ = zero | cant_pos7$ = three, pcant_7
if cant_pos8$ = zero | cant_pos8$ = three, pcant_8
if cant_pos9$ = zero | cant_pos9$ = three, pcant_9
if cant_pos10$ = zero | cant_pos10$ = three, pcant_10
if cant_pos11$ = zero | cant_pos11$ = three, pcant_11
if cant_pos12$ = zero | cant_pos12$ = three, pcant_12
if cant_pos13$ = zero | cant_pos13$ = three, pcant_13
if cant_pos14$ = zero | cant_pos14$ = three, pcant_14
if cant_pos15$ = zero | cant_pos15$ = three, pcant_15
if cant_pos16$ = zero | cant_pos16$ = three, pcant_16
if cant_pos17$ = zero | cant_pos17$ = three, pcant_17
if cant_pos18$ = zero | cant_pos18$ = three, pcant_18
if cant_pos19$ = zero | cant_pos19$ = three, pcant_19
if cant_pos20$ = zero | cant_pos20$ = three, pcant_20
strcantext, e$
strcantext = sblank
#Canned text - with move
strcantext = sblank
if cant_no$ & zero,
if cant_pos1$ = one | cant_pos1$ = four, pcant_1
if cant_pos2$ = one | cant_pos2$ = four, pcant_2
if cant_pos3$ = one | cant_pos3$ = four, pcant_3
if cant_pos4$ = one | cant_pos4$ = four, pcant_4
if cant_pos5$ = one | cant_pos5$ = four, pcant_5
if cant_pos6$ = one | cant_pos6$ = four, pcant_6
if cant_pos7$ = one | cant_pos7$ = four, pcant_7
if cant_pos8$ = one | cant_pos8$ = four, pcant_8
if cant_pos9$ = one | cant_pos9$ = four, pcant_9
if cant_pos10$ = one | cant_pos10$ = four, pcant_10
if cant_pos11$ = one | cant_pos11$ = four, pcant_11
if cant_pos12$ = one | cant_pos12$ = four, pcant_12
if cant_pos13$ = one | cant_pos13$ = four, pcant_13
if cant_pos14$ = one | cant_pos14$ = four, pcant_14
if cant_pos15$ = one | cant_pos15$ = four, pcant_15
if cant_pos16$ = one | cant_pos16$ = four, pcant_16
if cant_pos17$ = one | cant_pos17$ = four, pcant_17
if cant_pos18$ = one | cant_pos18$ = four, pcant_18
if cant_pos19$ = one | cant_pos19$ = four, pcant_19
if cant_pos20$ = one | cant_pos20$ = four, pcant_20
if cstop$, strcantext = strcantext + sm00
if cgstop$, strcantext = strcantext + sm01
#Output of strcantext occurs at the end of the output line
#Canned text - after output call
strcantext = sblank
if cant_no$ & zero,
if cant_pos1$ = two | cant_pos1$ = five, pcant_1
if cant_pos2$ = two | cant_pos2$ = five, pcant_2
if cant_pos3$ = two | cant_pos3$ = five, pcant_3
if cant_pos4$ = two | cant_pos4$ = five, pcant_4
if cant_pos5$ = two | cant_pos5$ = five, pcant_5
if cant_pos6$ = two | cant_pos6$ = five, pcant_6
if cant_pos7$ = two | cant_pos7$ = five, pcant_7
if cant_pos8$ = two | cant_pos8$ = five, pcant_8
if cant_pos9$ = two | cant_pos9$ = five, pcant_9
if cant_pos10$ = two | cant_pos10$ = five, pcant_10
if cant_pos11$ = two | cant_pos11$ = five, pcant_11
if cant_pos12$ = two | cant_pos12$ = five, pcant_12
if cant_pos13$ = two | cant_pos13$ = five, pcant_13
if cant_pos14$ = two | cant_pos14$ = five, pcant_14
if cant_pos15$ = two | cant_pos15$ = five, pcant_15
if cant_pos16$ = two | cant_pos16$ = five, pcant_16
if cant_pos17$ = two | cant_pos17$ = five, pcant_17
if cant_pos18$ = two | cant_pos18$ = five, pcant_18
if cant_pos19$ = two | cant_pos19$ = five, pcant_19
if cant_pos20$ = two | cant_pos20$ = five, pcant_20
strcantext, e$
strcantext = sblank
#Canned text - output call
cantext$ = cant_val1$
#Canned text - output call
cantext$ = cant_val2$
#Canned text - output call
cantext$ = cant_val3$
#Canned text - output call
cantext$ = cant_val4$
#Canned text - output call
cantext$ = cant_val5$
#Canned text - output call
cantext$ = cant_val6$
#Canned text - output call
cantext$ = cant_val7$
#Canned text - output call
cantext$ = cant_val8$
#Canned text - output call
cantext$ = cant_val9$
#Canned text - output call
cantext$ = cant_val10$
#Canned text - output call
cantext$ = cant_val11$
#Canned text - output call
cantext$ = cant_val12$
#Canned text - output call
cantext$ = cant_val13$
#Canned text - output call
cantext$ = cant_val14$
#Canned text - output call
cantext$ = cant_val15$
#Canned text - output call
cantext$ = cant_val16$
#Canned text - output call
cantext$ = cant_val17$
#Canned text - output call
cantext$ = cant_val18$
#Canned text - output call
cantext$ = cant_val19$
#Canned text - output call
cantext$ = cant_val20$
#Canned text - build the string for output
#Assign string select type outputs
if cantext$ = three, bld = one
if cantext$ = four, bld = zero
#Build the cantext string
if cantext$ = one, strcantext = strcantext + sm00
if cantext$ = two, strcantext = strcantext + sm01
if cantext$ & four,
strtextno = no2str(cantext$)
strcantext = strcantext + strm + strtextno
# --------------------------------------------------------------------------
# Position calculations, generally these do not need to be modified
# --------------------------------------------------------------------------
pmiscint$
#Capture the top level absinc for subprograms
if sub_level$ &= zero, absinc$ = mi2$
#Disable cutpos2 if not 4 axis, saves time
if rot_on_x = zero, cutpos2$ = m_one
pmotion_su
#Motion Setup (Set brklinestype & linarc)
brklinestype$ = zero
linarc$ = zero
if rot_on_x,
if cuttype = one, linarc$ = one
#Axis subs
if cuttype = two, #Polar
brklinestype$ = rotary_axis$ + three
linarc$ = one
#Determine the cut type
#cuttype (0 = Tool Plane, 1 = Axis Subs,
2 = Polar, 3 = 4/5 axis)
cuttype = rotary_type$
if cuttype = three, cuttype = zero
if mill5$,
if rot_on_x = zero, result = mprint(saxisoff)
cuttype = three
if rotary_axis$,
if rotary_axis$ && rot_on_x, result = mprint(saxiswarn)
rot_on_x = rotary_axis$
#Check for Tool Origin in Polar Milling
if cuttype = two & (tox$ | toy$ | toz$), result = mprint(stlorgerr)
#Transform Rotate, set mr_rt_actv if user selected 'coordinates'
if sub_trnstyp$ = one & sub_trnmthd$ = two,
#Calculate the rotation incremental angle for G68
rt_csav = atan2(sub_m2$, sub_m1$)
rt_cinc = prv_rt_csav - rt_csav
while rt_cinc & 180, rt_cinc = rt_cinc - 360
while rt_cinc &
-180,rt_cinc = rt_cinc + 360
if rot_ccw_pos = one, rt_cinc = -rt_cinc
if sub_sec_no$, mr_rt_actv = two
else, mr_rt_actv = one
else, mr_rt_actv = zero
pfcalc_u_min
pmotion_su
#Map coordinates
if rot_on_x,
if cuttype = zero, pxyzcout0
#Toolplane Positioning
if cuttype = one, pxyzcout1
#Axis Substitution
if cuttype = two, pxyzcout2
#Polar Conversion
if cuttype = three, pxyzcout3
#Simulatneous 4 axis (Multi-axis)
if rot_ccw_pos = one, csav = -csav
if mr_rt_actv && two,
if index, pindxcalc
else, feed = fr_pos$
xabs = vequ (x$)
iout = vequ(i$)
feed = fr_pos$
#Toolplane Positioning
xabs = vequ (x$)
iout = vequ(i$)
if rot_on_x = two, csav = -c$
else, csav = c$
#Axis substitution
if rot_on_x = one, #X axis substitution
yabs = zero
zabs = z$ + (rotdia$ / two)
y$ * (360 / (pi$ * rotdia$))
else, #Y axis substitution
xabs = zero
zabs = z$ + (rotdia$ / two)
x$ * (360 / (pi$ * rotdia$))
#polar interpolation
#Drill polar is toolplane drilling toward center
#if not a coincident axis
#Also, Capture initial index position for Polar Milling
if (opcode$ = three & rot_on_x && three), pxyzcout0
if rot_on_x = one, #X axis rotation
csav = atan2(y$, z$)
axisx$ = vequ(aaxisx)
xabs = rotp(csav, x$)
if rot_on_x = two, #Y axis rotation
csav = atan2(-x$, z$)
axisx$ = vequ(baxisx)
xabs = rotp(csav, x$)
if rot_on_x = three, #Z axis rotation
csav = atan2(-y$, x$)
axisx$ = vequ(caxisx)
xabs = rotp(csav, x$)
csav = csav + c$
#Multisurf rotary axis motion
if rot_on_x = one, #Multisurf Rotary about X
csav = atan2 (vtooly$, vtoolz$)
axisx$ = vequ (aaxisx)
if rot_on_x = two, #Multisurf Rotary about Y
csav = atan2 (-vtoolx$, vtoolz$)
axisx$ = vequ (baxisx)
xabs = rotp (csav, x$)
u$ = rotp (csav, u$)
csav = csav + c$
#Rotary axis revolution calculation (Modify for wind-up)
cdelta = csav - prv_csav
while abs(cdelta) & ctol, #If motion exceeds ctol, add wind-up
if cdelta & zero,
rev = rev - one
cdelta = cdelta - 360
rev = rev + one
cdelta = cdelta + 360
if cuttype && one, cabs = rev * 360 + csav
else, cabs = sav_rev * 360 + csav
#Index move calculations, direction is shortest
#Check if in tolerance
cdelta = frac(abs(csav)/ctable)
if cdelta & ixtol & cdelta & 1-ixtol,
result = mprint(sindxerror)
cdelta = prvcabs - cabs
#Phase shift delta 10 revolutions, check odd/even
if frac(int((cdelta + )/two), indx_mc = one
else, indx_mc = zero
#Set range 0-360
indx_out = csav
while indx_out & 0, indx_out = indx_out + 360
while indx_out & 360, indx_out = indx_out - 360
#Feedrate calculations
pfcalc
#Feedrate calculations, gcode 0 does not evaluate
if gcode$ && zero,
if fmtrnd(cabs) = prvcabs | index, pfcalc_u_min
if cuttype = one & (cutpos2$ &= one | cutpos2$ = four),
pfcalc_u_min
else, pfclc_deg_inv
if ipr_type && prv_ipr_type, prv_feed = c9k
pfcalc_u_min
#Feedrate unit/min
ipr_type = zero
feed = fr_pos$
if feed & maxfeedpm, feed = maxfeedpm
prvfrdeg = feed
pfclc_deg_inv
#Feedrate deg/min
circum = zabs * two * pi$
if circum = zero, circum = c9k
#Don't allow Zero
ldelta = sqrt((xabs-prv_xabs)^2+(yabs-prv_yabs)^2+(zabs-prv_zabs)^2)
cdelta = ((abs(cabs - prvcabs))/360)*circum
if ldelta = zero, cldelta = cdelta
else, cldelta = sqrt(cdelta^two + ldelta^two)
if cldelta = zero, cldelta = c9k
if use_frinv,
#Feedrate inverse calculation
ipr_type = two
prv_feed = c9k #Always force feed
if cuttype = three, cldelta = sqrt((x$-prv_x$)^2+(y$-prv_y$)^2+(z$-prv_z$)^2)
frinv = fr_pos$/cldelta
if frinv & maxfrinv, frinv = maxfrinv
feed = frinv
#Feedrate deg/min control and calculation
ipr_type = zero
#Change to ipr_type = one to force new DPM
frdeg = abs(cdelta/cldelta) * abs(fr_pos$ * (360/circum))
if abs(frdeg - prvfrdeg) & frdegstp | ipr_type && prv_ipr_type,
#Control output of frdeg
prvfrdeg = frdeg
feed = frdeg
if frdeg & maxfrdeg, feed = maxfrdeg
#Incremental calculations
ps_inc_calc
#Incremental calculations, start
xia = fmtrnd(xabs)
yia = fmtrnd(yabs)
zia = fmtrnd(zabs)
xinc = vsub (xia, prv_xia)
ps_cinc_calc
ps_cinc_calc
#Incremental calculations, start rotary
cia = fmtrnd(cabs)
cinc = cia - prv_cia
pe_inc_calc
#Incremental calculations, end
prvcabs = fmtrnd(cabs) #Avoid updating until called explicitly
!xia, !yia, !zia, !cia
!x$, !y$, !z$, !cc_pos$, !cutpos2$
# 01/22/04
# --------------------------------------------------------------------------
# Numbered questions for Mastercam Mill - Read during post update only
# --------------------------------------------------------------------------
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,00,,)? 9600
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? RPFAN
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? y
163. Enable Misc. Values button? y
164. Enable Rotary Axis button? y
165. Enable Tool Plane button? y
166. Enable Construction Plane button? y
167. Enable Tool Display button? y
168. Check tplane during automatic work origin creation? y
# --------------------------------------------------------------------------
# Default Miscellaneous Real Values - Read during post update only - Set in CD
# --------------------------------------------------------------------------
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) - Read during post update only - Set in CD
# --------------------------------------------------------------------------
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 - Read during post update only - Set in CD
# --------------------------------------------------------------------------
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 - Read during post update only - Set in CD
# --------------------------------------------------------------------------
301. Work Coordinates [0-1=G92, 2=G54's] (mi1)? 2
302. Absolute or Incremental [0=ABS, 1=INC] (mi2)? 0
303. Reference Return [0=G28, 1=G30] (mi3)? 0
304. Default miscellaneous integer variable 4 (mi4)? 0
305. Default miscellaneous integer variable 5 (mi5)? 0
306. Default miscellaneous integer variable 6 (mi6)? 0
307. Default miscellaneous integer variable 7 (mi7)? 0
308. Default miscellaneous integer variable 8 (mi8)? 0
309. Default miscellaneous integer variable 9 (mi9)? 0
310. Default miscellaneous integer variable 10 (mi10)? 0
# --------------------------------------------------------------------------
# Enable/Disable Miscellaneous Integer Variable switches - Read during post update only - Set in CD
# --------------------------------------------------------------------------
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&) - Read during post update only - Set in CD
# --------------------------------------------------------------------------
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
# --------------------------------------------------------------------------
# POST TEXT
# --------------------------------------------------------------------------
[CTRL_MILL|MPFAN]
[misc integers]
1. &Work Coordinates [0-1=G92, 2=G54's]&//2
2. &Absolute/Incremental, top level [0=ABS, 1=INC]&
3. &Reference Return [0=G28, 1=G30]&
[simple drill]
1. &Drill/Counterbore&
7. &&
8. &&
9. &&
10. &&
11. &&
[peck drill]
7. &Peck&
8. &&
9. &&
10. &&
11. &&
[chip break]
7. &Peck&
8. &&
9. &&
10. &&
11. &&
[tap]
7. &&
8. &&
9. &&
10. &&
11. &&
[bore1]
1. &Bore #1 (feed-out)&
7. &&
8. &&
9. &&
10. &&
11. &&
[bore2]
1. &Bore #2 (stop spindle, rapid out)&
7. &&
8. &&
9. &&
10. &&
11. &&
[misc1]
1. &Fine bore (shift)&
7. &&
8. &&
9. &&
10. &&
[canned text]
1. &Program Stop&
2. &Optional Stop&
3. &Block Delete On&
4. &Block Delete Off&
5. &M5&
6. &M6&
7. &M7&
8. &M8&
9. &M9&
10. &M10&
[CTRL_MILL|DEFAULT]
[misc integers]
1. &Work Coordinates [0-1=G92, 2=G54's]&//2
2. &Absolute/Incremental, top level [0=ABS, 1=INC]&
3. &Reference Return [0=G28, 1=G30]&
[simple drill]
1. &Drill/Counterbore&
7. &&
8. &&
9. &&
10. &&
11. &&
[peck drill]
7. &Peck&
8. &&
9. &&
10. &&
11. &&
[chip break]
7. &Peck&
8. &&
9. &&
10. &&
11. &&
[tap]
7. &&
8. &&
9. &&
10. &&
11. &&
[bore1]
1. &Bore #1 (feed-out)&
7. &&
8. &&
9. &&
10. &&
11. &&
[bore2]
1. &Bore #2 (stop spindle, rapid out)&
7. &&
8. &&
9. &&
10. &&
11. &&
[misc1]
1. &Fine bore (shift)&
7. &&
8. &&
9. &&
10. &&
[canned text]
1. &Program Stop&
2. &Optional Stop&
3. &Block Delete On&
4. &Block Delete Off&
5. &M5&
6. &M6&
7. &M7&
8. &M8&
9. &M9&
10. &M10&
[CTRL_TEXT_END]
mastercam X5后处理文件——为大家提供各种日常写作指导,同时提供范文参考。主要栏目有:范文大全、个人简历、教案下载、课件中心、 优秀作文、考试辅导、试题库、诗词鉴赏。
相关文档:
下载文档:
搜索更多:
All rights reserved Powered by
copyright &copyright 。甜梦文库内容来自网络,如有侵犯请联系客服。|

我要回帖

更多关于 mastercam后处理下载 的文章

 

随机推荐