版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
#PostName:MPFAN
#Product:MILL
#MachineName:GENERICFANUC
#ControlName:GENERICFANUC
#Description:GENERICFANUCMILLPOST
#4-axis/Axissubs.:YES
#5-axis:NO
#Subprograms:YES
#Executable:MP
#
#WARNING:THISPOSTISGENERICANDISINTENDEDFORMODIFICATIONTO
#THEMACHINETOOLREQUIREMENTSANDPERSONALPREFERENCE.
#
#--------------------------------------------------------------------------
#Revisionlog:
#--------------------------------------------------------------------------
#ProgrammersNote:
#CNC01/12/01-Initialpostupdatefor
#CNC07/02/01-Addcantexttocanceldrillandtoolretract
#CNC01/09/02-Initialpostupdatefor
#CNC01/31/02-Setusecandrill,usecanpeck,force_wcstoYES
#CNC02/22/02-ForcesoutputofI,J,Karccenters(arcoutput:0)
#CNC04/12/02-Useoriginalpositionforinversefeedand4axpaths
#CNC05/01/02-Set"helix_arc:2",supporthelixarcoutputinXYplane
#CNC05/07/02-Donotupdatesav_revwithaxissubstitution
#CNC11/06/02-Altered'F'eedrateoutputformatwhentapping(G74/G84)
#CNC01/06/03-movedfeedassignmentbelowpcom_movebtoaddressbugw/feedin4axis
#CNC01/17/03-Addedflagstoallowreversalofaxisorientations
#CNC02/04/03-Initialpostupdatefor
#
#--------------------------------------------------------------------------
#Features:
#--------------------------------------------------------------------------
#ThispostsupportsGenericFanuccodeoutputfor3and4axismilling.
#ItisdesignedtosupportthefeaturesofMastercamMillV9.
#
#FollowingMisc.Integersareused:
#
#mi1-Workcoordinatesystem
#0=ReferencereturnisgeneratedandG92withthe
#X,YandZhomepositionsatfilehead.
#1=ReferencereturnisgeneratedandG92withthe
#X,YandZhomepositionsateachtool.
#2=WCSofG54,G55....basedonMastercamsettings.
#
#mi2-AbsoluteorIncrementalpositioningattoplevel
#0=absolute
#1=incremental
#
#mi3-SelectG28orG30referencepointreturn.
#0=G28,1=G30
#
#Cannedtext:
#EnteringcantextonacontourpointfromwithinMastercamallowsthe
#followingfunctionstoenable/disable.
#Cantextvalue:
#1=Stop=outputthe"M00"stopcode
#2=Ostop=outputthe"M01"optionalstopcode
#3=Bldon=turnonblockdeletecodesinNClines
#4=bLdoff=turnoffblockdeletecodesinNClines
#
#Millingtoolpaths(4axis)
#Layout:
#Theterm"ReferenceView"referstothecoordinatesystemassociated
#withtheTopview(Alt-F9,theuppergnomonofthethreedisplayed).
#Createthepartdrawingwiththeaxisofrotationabouttheaxis
#ofthe"ReferenceView"accordingtothesettingyouenteredfor
#'vmc'(verticalorhorizontal)and'rot_on_x'(machinerelative
#axisofrotation).
#vmc=1(verticalmachine)usesthetoptoolplaneasthebasemachine
#view.
#vmc=0(horizontalmachine)usesthefronttoolplaneasthebasemachine
#view.
#Relativetothemachinematrix-
#RotationzeropositionisontheZaxisforrotationonXaxis.
#RotationzeropositionisontheZaxisforrotationonYaxis.
#RotationzeropositionisontheXaxisforrotationonZaxis.
#Themachineviewrotatedabouttheselectedaxisasa"singleaxis
#rotation"aretheonlylegalviewsfor4axismilling.Rotation
#directionaroundthepartispositiveintheCCWdirectionwhen
#viewedfromtheplusdirectionoftherotatingaxis.Setthevariable
#'rot_ccw_pos'toindicatethesigneddirection.Alwayssetthework
#originatthecenterofrotation.
#
#ToolplanePositioning:
#CreatetheCplaneandTplaneastherotationofthemachineviewabout
#theselectedaxisofrotation.Thetoolplaneisusedtocalculate
#thepositionoftherotaryaxis.Thisisthedefaultsetting.
#
#3AxisRotary(Polar)
#PolarpositioningisofferedinMastercam3axistoolpathsthroughthe
#rotaryaxisoptionsdialog.Theselectedtoolpathisconvertedtoangle
#andradiusposition.Theaxisofrotationisforcedtozero.
#
#Axissubstitution:
#UsetheRotaryaxissubstitutionbydrawingthegeometryflattened
#fromthecylinder.Therotaryaxisbuttonmustbeactiveforaxis
#substitutioninformationtobeoutputtotheNCIfile.Theradiusof
#therotarydiameterisaddedtoalltheZpositionsatoutput.
#
#Simultaneous4Axis(11gcode):
#Full4axistoolpathscanbegeneratedfromvarioustoolpathsunderthe
#'multi-axis'selection.Rotary4axis).All5axispathsare
#convertedto4axispathswhereonlytheangleabouttherotationaxis
#isresolved.
#
#Drill:
#Alldrillmethodsaresupportedinthepost.SeeSimultaneous4Axis.
#
#AdditionalNotes:
#1)Disable4axisbysettingthenumberedquestion164.to'n'.
#2)G54callsaregeneratedwheretheworkoffsetentryof0=G54,
#1=G55,etc.
#3)MetricisappliedfromtheNCImet_toolvariable.
#4)Incrementalmodecalculatesmotionfromhomepositionattoolchanges.
#Thehomepositionisusedtodefinethelastpositionofthetool
#foralltoolchanges.
#5)Thevariable'absinc'isnowpre-defined,setmi2(Misc.Integer)for
#the'toplevel'absolute/incrementalprogramoutput.Subprogramsare
#updatedthroughtheMastercamdialogsettingsforsub-programs.
#6)Alwaysavoidmachiningtothecenterofrotationwithrotaryaxis!
#7)TransformsubprogramsareintendedforusewithG54..workshifts.
#
#END_HEADER$
#
#--------------------------------------------------------------------------
#DebuggingandFactorySetProgramSwitches
#--------------------------------------------------------------------------
m_one:-1#Defineconstant
zero:0#Defineconstant
one:1#Defineconstant
two:2#Defineconstant
three:3#Defineconstant
four:4#Defineconstant
five:5#Defineconstant
c9k:9999#Defineconstant
fastmode:yes#EnableQuickPostProcessing,(settonofordebug)
bug1:2#0=Nodisplay,1=Genericlistbox,2=Editor
bug2:40#Appendpostlinelabels,non-zeroiscolumnposition
bug3:0#AppendwhatlinenumbertoeachNCline
bug4:1#AppendNCIlinenumbertoeachNCline
whatno:yes#Donotperformwhatlinebranches(leaveasyes)
skp_lead_flgs:1#DoNOTusev9stylecontourflags
get_1004:1#Findgcode1004withgetnextop
rpd_typ_v7:0#UseVersion7stylecontourflags/processing
strtool_v7:2#UseVersion7+toolname
tlchng_aft:2#Delaycalltotoolchangeuntilmoveline
cant_tlchng:1#Ignorecantextentryonmovewithtlchng_aft
newglobal:1#Errorcheckingforglobalvariables
getnextop:0#Buildthenextvariabletable
#--------------------------------------------------------------------------
#GeneralOutputSettings
#--------------------------------------------------------------------------
sub_level:1#Enableautomaticsubprogramsupport
breakarcs:2#Breakarcs,0=no,1=quadrants,2=180deg.maxarcs
arcoutput:1#0=IJK,1=Rnosign,2=Rsignedneg.over180
arctype:2#Arccenter1=abs,2=St-Ctr,3=Ctr-St,4=unsignedinc.
do_full_arc:0#Allowfullcircleoutput0=no,1=yes
helix_arc:2#Supporthelixarcoutput,0=no,1=allplanes,2=XYplaneonly
arccheck:3#Checkforsmallarcs,converttolinear
atol:.01#Angularitytoleranceforarccheck=2
ltol:.002#Lengthtoleranceforarccheck=1
vtol:.0001#Systemtolerance
maxfeedpm:500#Limitforfeedininch/min
ltol_m:.05#Lengthtoleranceforarccheck=1,metric
vtol_m:.0025#Systemtolerance,metric
maxfeedpm_m:10000#Limitforfeedinmm/min
force_wcs:yes#ForceWCSoutputateverytoolchange
spaces:0#Numberofspacestoaddbetweenfields
omitseq:no#Omitsequencenumbers
seqmax:9999#Max.sequencenumber
stagetool:0#0=Donotpre-stagetools,1=Stagetools
use_gear:0#Outputgearselectioncode,0=no,1=no
max_speed:10000#Maximumspindlespeed
min_speed:50#Minimumspindlespeed
nobrk:no#Omitbreakupofx,y&zrapidmoves
progname:1#Useuppercaseforprogramname(sprogname)
xflip:no#ReverseXaxisorientation-eap1/17/03
yflip:no#ReverseYaxisorientation-eap1/17/03
zflip:no#ReverseZaxisorientation-eap1/17/03
#--------------------------------------------------------------------------
#RotaryAxisSettings
#--------------------------------------------------------------------------
vmc:1#0=HorizontalMachine,1=VerticalMill
rot_on_x:1#DefaultRotaryAxisOrientation,Seeques.164.
#0=Off,1=AboutX,2=AboutY,3=AboutZ
rot_ccw_pos:1#Axissigneddir,0=CWpositive,1=CCWpositive
index:0#Useindexpositioning,0=FullRotary,1=Indexonly
ctable:5#Degreesforeachindexstepwithindexingspindle
use_frinv:1#UseInverseTimeFeedratesin4Axis,(0=no,1=yes)
maxfrdeg:2000#Limitforfeedindeg/min
maxfrinv:#Limitforfeedinversetime
frc_cinit:1#ForceCaxisresetattoolchange
ctol:225#Toleranceindeg.beforerevflagchanges
ixtol:.01#Toleranceindeg.forindexerror
frdegstp:10#Steplimitforrotaryfeedindeg/min
#--------------------------------------------------------------------------
#EnableCannedDrillCycleSwitches
#--------------------------------------------------------------------------
usecandrill:yes#Usecannedcyclefordrill
usecanpeck:yes#UsecannedcycleforPeck
usecanchip:yes#UsecannedcycleforChipBreak
usecantap:yes#UsecannedcycleforTap
usecanbore1:yes#UsecannedcycleforBore1
usecanbore2:yes#UsecannedcycleforBore2
usecanmisc1:yes#UsecannedcycleforMisc1
usecanmisc2:yes#UsecannedcycleforMisc2
#--------------------------------------------------------------------------
#CommonUser-definedVariableInitializations(notswitches!)
#--------------------------------------------------------------------------
xia:0#FormatedabsolutevalueforXincrementalcalculations
yia:0#FormatedabsolutevalueforYincrementalcalculations
zia:0#FormatedabsolutevalueforZincrementalcalculations
cia:0#FormatedabsolutevalueforCincrementalcalculations
cuttype:0#Cuttypeflag
#0=ToolPlane,1=AxisSubs,2=Polar,3=4/5axis
bld:0#Blockdeleteactive
result:0#Returnvalueforfunctions
sav_spc:0#Savespaces
sav_gcode:0#Gcodesaved
sav_absinc:0#Absolute/IncrementalSavedValue
sav_coolant:0#Coolantsaved
sav_frc_wcs:0#Forceworkoffsetflagsaved
toolchng:1#Onatoolchangeflag
spdir2:1#Copyforsafespindledirectioncalculation
#Drillvariables
drlgsel:-1#DrillSelectInitialize
drillref:0#Selectdrillreference
peckacel:0#Fractionalpercenttoreducepeck2whenusecan..:no
drlgcode:0#SaveGcodeindrill
sav_dgcode:0#Drillgcodesaved
#Subprogramvariables
mr_rt_actv:0#FlagtoindicateifG51/G68isactive
#0=Off,1=Toolchange,2=Subprogramcall/start,G68
#3=Absolutestart,both
rt_csav:0#Csavedvalue
end_sub_mny:0#Manytoolsettingcapturedattransformsubend
#Rotary/Indexvariables
csav:0#Csavedvalue
prvcabs:0#Savedcabsfrompe_inc_calc,
#Usedforrotaryfeedanddirectioncalculations
cdelta:0#Calculationforanglechange
rev:0#Calculationfordeg/min
sav_rev:0#Savedrevolutioncounter
indx_out:c9k#Rotationdirectioncalculation
fmt16indx_mc#Rotationdirectioncalculation
#VectorConstantsforRotataryCalculations
aaxisx:1#Aaxisrotationvectorconstant
aaxisy:0#Aaxisrotationvectorconstant
aaxisz:0#Aaxisrotationvectorconstant
baxisx:0#Baxisrotationvectorconstant
baxisy:1#Baxisrotationvectorconstant
baxisz:0#Baxisrotationvectorconstant
caxisx:0#Caxisrotationvectorconstant
caxisy:0#Caxisrotationvectorconstant
caxisz:1#Caxisrotationvectorconstant
#Feedratecalculationvariables
frdelta:0#Calculationfordeg/min
frinv:0#Feedrateinversetime
frdeg:0#Feedratedeg/minactual
prvfrdeg:0#Feedratedeg/minactual
ldelta:0#Calculationfordeg/min,linear
cldelta:0#Calculationfordeg/min,linearandrotary
circum:0#Calculationfordeg/min
ipr_type:0#FeedrateforRotary,0=UPM,1=DPM,2=Inverse
#--------------------------------------------------------------------------
#Formatstatements-n=nonmodal,l=leading,t=trailing,i=inc,d=delta
#--------------------------------------------------------------------------
#Defaultenglish/metricpositionformatstatements
fs21#Decimal,absolute,7place,defaultforinitialize(:)
fs22#Decimal,absolute,4/3place
fs23#Decimal,delta,4/3place
#Commonformatstatements
fs241010#Integer,notleading
fs252020l#Integer,forcetwoleading
fs263030l#Integer,forcethreeleading
fs274040l#Integer,forcefourleading
fs29#Decimal,absolute,1place
fs210#Decimal,absolute,2place
fs211#Decimal,absolute,3place
fs212#Decimal,absolute,4place
fs213#Decimal,absolute,5place
fs214#Decimal,delta,3place
fs215#Decimal,absolute,2/1place(feedrate)
fs2161010n#Integer,forcedoutput
fs217#Decimal,absolute,2/3place(tappingfeedrate)
#--------------------------------------------------------------------------
#StringandstringselectordefinitionsforNCoutput
#--------------------------------------------------------------------------
#Numberedquestion164.stringtodetectRotaryaxisy/n
sq164
#Addressstringdefinitions
strm"M"
strn"N"
stro"O"
strp"P"
srad"R"
srminus"R-"
sblank
#Cantextstringdefinitions(spacesmustbepaddedhere)
sm00"M00"
sm01"M01"
strtextno
strcantext
#Transformmirrorandrotatecodes
strns_mir_on""#Programmablemirrorimagecode
strns_mir_off""#Programmablemirrorimagecancelcode
strns_rot_on"G68"#CoordinateSystemRotation
strns_rot_off"G69"#CoordinateSystemRotationCancel
#--------------------------------------------------------------------------
#Errormessages
#--------------------------------------------------------------------------
saxiswarn"WARNING-POSTROTARYAXISASSIGNMENT('rot_on_x')OVERWRITTENBYOPERATION"
saxisoff"ERROR-POSTROTARYAXISASSIGNMENT('rot_on_x')ISDISABLED"
saxiserror"ERROR-INVALIDROTARYAXISASSIGNMENT('rot_on_x')FORCURRENTOPERATION"
sindxerror"WARNING-INDEXANGLEDOESNOTMATCHPOSTSETTING('ctable')"
stlorgerr"ERROR-TOOLORIGINDOESNOTMATCHCENTEROFROTATIONINPOLARMILLING"
shomeserror"ERROR-G92WORKOFFSET('mi1')DOESNOTSUPPORTTRANSFORMSUBPROGRAM"
sprgnerror"ERROR-SUBPROGRAMNUMBERMATCHESTHEMAINPROGRAMNUMBER"
#--------------------------------------------------------------------------
#GeneralGandMCodeStringselecttables
#--------------------------------------------------------------------------
#MotionGcodeselection
sg00G0#Rapid
sg01G1#Linearfeed
sg02G2#CircularinterpolationCW
sg03G3#CircularinterpolationCCW
sg04G4#Dwell
sgcode#Targetforstring
fstrselsg00gcodesgcode
#--------------------------------------------------------------------------
#SelectworkplaneGcode
sg17G17#XYplanecode
sg19G19#YZplanecode
sg18G18#XZplanecode
sgplane#Targetstring
fstrselsg17planesgplane
#--------------------------------------------------------------------------
#Selectenglish/metriccode
sg20G20#Inchcode
sg21G21#Metriccode
smetric#Targetstring
fstrselsg20met_toolsmetric
#--------------------------------------------------------------------------
#Selectreferencereturncode
sg28G28#Firstreferencepointreturn
sg30G30#Secondreferencepointreturn
sg28ref#Targetstring
fstrselsg28mi3sg28ref
#--------------------------------------------------------------------------
#CuttercompensationGcodeselection
scc0G40#Cancelcuttercompensation
scc1G41#Cuttercompensationleft
scc2G42#Cuttercompensationright
sccomp#Targetforstring
fstrselscc0cc_possccomp
#--------------------------------------------------------------------------
#Canneddrillcyclestringselect
sg81G81#drill-nodwell
sg81dG82#drill-withdwell
sg83G83#peckdrill-nodwell
sg83dG83#peckdrill-withdwell
sg73G73#chipbreak-nodwell
sg73dG73#chipbreak-withdwell
sg84G84#tap-righthand
sg84dG74#tap-lefthand
sg85G85#bore#1-nodwell
sg85dG89#bore#1-withdwell
sg86G86#bore#2-nodwell
sg86dG86#bore#2-withdwell
sgm1G76#misc#1-nodwell
sgm1dG76#misc#1-withdwell
sgm2G81#misc#2-nodwell
sgm2dG82#misc#2-withdwell
sgdrill#Targetforstring
fstrselsg81drlgselsgdrill
#--------------------------------------------------------------------------
#SelectincrementalorabsoluteGcode
sg90G90#Absolutecode
sg91G91#Incrementalcode
sgabsinc#Targetstring
fstrselsg90absincsgabsinc
#--------------------------------------------------------------------------
#FeedmodeGcodeselection
sg94G94#UPM
sg94dG94#DPM,Seepfcalc_degifyouuseanothergcode
sg93G93#Inverse
sgfeed#Targetforstring
fstrselsg94ipr_typesgfeed
#--------------------------------------------------------------------------
#Canneddrillcyclereferenceheight
sg98G98#Referenceatinitht
sg99G99#Referenceatrefht
sgdrlref#Targetforstring
fstrselsg98drillrefsgdrlref#DrillcycleGstringselect
#--------------------------------------------------------------------------
#Generatestringforspindle
sm04M4#Spindlereverse
sm05M5#Spindleoff
sm03M3#Spindleforward
spindle#Targetforstring
fstrselsm04spdir2spindle
#--------------------------------------------------------------------------
#CoolantMcodeselection
sm09M9#CoolantOff
sm08M8#CoolantFlood
sm08_1M8#CoolantMist
sm08_2M8#CoolantTool
scoolant#Targetforstring
fstrselsm09coolantscoolant
#--------------------------------------------------------------------------
#Tablerotationdirection
#Tablerotationdirection,index
sindx_cwM22#RotateCWcode
sindx_ccwM21#RotateCCWcode
sindx_mc#Targetforstring
fstrselsindx_cwindx_mcsindx_mc
#--------------------------------------------------------------------------
#Definethegearselectioncode
flktbl13#Lookuptabledefinition-tableno.-no.entries
400#Lowgearrange
41400#Medgearrange
422250#Higearrange
#--------------------------------------------------------------------------
#Toolchange/NCoutputVariableFormats
#--------------------------------------------------------------------------
fmtT4t#ToolNumber
fmtT4first_tool#FirstToolUsed
fmtT4next_tool#NextToolUsed
fmtD4tloffno#DiameterOffsetNumber
fmtH4tlngno#LengthOffsetNumber
fmtG4g_wcs#WCSGaddress
fmtP4p_wcs#WCSPaddress
fmtS4speed#SpindleSpeed
fmtM4gear#Gearrange
#--------------------------------------------------------------------------
fmtN4n#Sequencenumber
fmtX2xabs#Xpositionoutput
fmtY2yabs#Ypositionoutput
fmtZ2zabs#Zpositionoutput
fmtX3xinc#Xpositionoutput
fmtY3yinc#Ypositionoutput
fmtZ3zinc#Zpositionoutput
fmtC11cabs#Caxisposition
fmtC14cinc#Caxisposition
fmtC4indx_out#Indexposition
fmtR14rt_cinc#Caxisposition,G68
fmtI3i#ArccenterdescriptioninX
fmtJ3j#ArccenterdescriptioninY
fmtK3k#ArccenterdescriptioninZ
fmtR2arcrad#ArcRadius
fmtF15feed#Feedrate
fmtP11dwell#Dwell
fmtM5cantext#Cannedtext
#--------------------------------------------------------------------------
#Movecomment(pound)tooutputcolonwithprogramnumbers
fmtO7progno#Programnumber
#fmt":"7progno#Programnumber
fmtO7main_prg_no#Programnumber
#fmt":"7main_prg_no#Programnumber
fmtO7sub_prg_no#Programnumber
#fmt":"7sub_prg_no#Programnumber
fmtX2sub_trnsx#Rotationpoint
fmtY2sub_trnsy#Rotationpoint
fmtZ2sub_trnsz#Rotationpoint
#--------------------------------------------------------------------------
fmtQ2peck1#Firstpeckincrement(positive)
fmtQ2shftdrl#Fineboretoolshift
fmtR2refht_a#Referenceheight
fmtR2refht_i#Referenceheight
#--------------------------------------------------------------------------
fmt"TOOL-"4tnote#Noteformat
fmt"DIA.OFF.-"4toffnote#Noteformat
fmt"LEN.-"4tlngnote#Noteformat
fmt"DIA.-"1tldia#Noteformat
#--------------------------------------------------------------------------
#ToolComment/ManualEntrySection
#--------------------------------------------------------------------------
ptoolcomment#Commentfortool
tnote=t
toffnote=tloffno
tlngnote=tlngno
"(",pstrtool,*tnote,*toffnote,*tlngnote,*tldia,")",e
pstrtool#Commentfortool
ifstrtool<>sblank,
[
strtool=ucase(strtool)
strtool,""
]
pcomment#Commentfrommanualentry(mustcallpcomment2ifbooleans)
pcomment2
pcomment2#Commentfrommanualentry
scomm=ucase(scomm)
ifgcode=1007,"(",scomm,")"
else,"(",scomm,")",e
#--------------------------------------------------------------------------
#StartofFileandToolchangeSetup
#--------------------------------------------------------------------------
psof0#Startoffilefortoolzero
psof
psof#Startoffilefornon-zerotoolnumber
pcuttype
toolchng=one
ifntools=one,
[
#skipsingletooloutputs,stagetoolmustbeon
stagetool=m_one
!next_tool
]
"%",e
progno,e
"(PROGRAMNAME-",sprogname,")",e
"(DATE=DD-MM-YY-",date,"TIME=HH:MM-",time,")",e
pbld,n,*smetric,e
pbld,n,*sgcode,*sgplane,"G40","G49","G80",*sgabsinc,e
pbld,n,"",e
pbld,n,"M10",e
pbld,n,"M51",e
sav_absinc=absinc
ifmi1<=one,#Workcoordinatesystem
[
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#Multipletoolsubprogramcall
ptoolcomment
comment
pcan
ifstagetool>=zero,pbld,n,*t,"M6",e
pindex
ifmi1>one,absinc=zero
pcan1,pbld,n,*sgcode,*sgabsinc,pwcs,pfxout,pfyout,
speed,*spindle,pgear,strcantext,e
pbld,n,"G43",*tlngno,pfzout,e
pbld,n,"M51",e
pbld,n,"G0",pfcout,e
pbld,n,"M50",e
pbld,n,scoolant,next_tool,e
absinc=sav_absinc
pcom_movea
toolchng=zero
c_msng#Singletoolsubprogramcall
ptlchg0#CallfromNCInulltoolchange(toolnumberrepeats)
pcuttype
pcom_moveb
c_mmlt#Multipletoolsubprogramcall
comment
pcan
result=newfs(15,feed)#Resettheoutputformatfor'feed'
pbld,n,sgplane,e
pspindchng
pbld,n,scoolant,e
ifmi1>one&workofs<>prv_workofs,
[
sav_absinc=absinc
absinc=zero
pbld,n,sgabsinc,pwcs,pfxout,pfyout,pfzout,e
pbld,n,"M51",e
pbld,n,"G0",pfcout,e
pbld,n,"M50",e
pe_inc_calc
ps_inc_calc
absinc=sav_absinc
]
ifcuttype=zero,ppos_cax_lin
ifgcode=one,plinout
else,prapidout
pcom_movea
c_msng#Singletoolsubprogramcall
ptlchg#Toolchange
pcuttype
toolchng=one
ifmi1=one,#Workcoordinatesystem
[
pfbld,n,*sg28ref,"X0.","Y0.",e
pfbld,n,"G92",*xh,*yh,*zh,e
]
pbld,n,"M01",e
pcom_moveb
c_mmlt#Multipletoolsubprogramcall
ptoolcomment
comment
pcan
result=newfs(15,feed)#Resettheoutputformatfor'feed'
pbld,n,*t,"M6",e
pindex
sav_absinc=absinc
ifmi1>one,absinc=zero
pcan1,pbld,n,*sgcode,*sgabsinc,pwcs,pfxout,pfyout,
speed,*spindle,pgear,strcantext,e
pbld,n,"G43",*tlngno,pfzout,scoolant,next_tool,e
pbld,n,"M51",e
pbld,n,"G0",pfcout,e
pbld,n,"M50",e
absinc=sav_absinc
pcom_movea
toolchng=zero
c_msng#Singletoolsubprogramcall
pretract#Endoftoolpath,toolchange
sav_absinc=absinc
absinc=one
sav_coolant=coolant
coolant=zero
#cc_posisresetinthetoolchangehere
cc_pos=zero
gcode=zero
pcan
pbld,n,sccomp,*sm05,psub_end_mny,e
pcan1,pbld,n,sgabsinc,sgcode,*sg28ref,"Z0.",scoolant,strcantext,e
pbld,n,*sg28ref,"X0.","Y0.",protretinc,e
pcan2
absinc=sav_absinc
coolant=sav_coolant
protretinc#ResettheCaxisrevolutioncounter
iffrc_cinit&rot_on_x,
[
rev=zero
sav_rev=zero
cabs=zero
csav=zero
indx_out=zero
ifindex,e,pindxcalc,pindex
else,*cabs
prvcabs=zero
!csav,!cabs
]
peof0#Endoffilefortoolzero
peof
peof#Endoffilefornon-zerotool
pretract
comment
#Removepoundcharactertooutputfirsttoolwithstagedtools
#ifstagetool=one,pbld,n,*first_tool,e
n,"M30",e
mergesub
clearsub
mergeaux
clearaux
"%",e
pwcs#G54+coordinatesettingattoolchange
ifmi1>one,
[
sav_frc_wcs=force_wcs
ifsub_level,force_wcs=zero
ifworkofs<>prv_workofs|(force_wcs&toolchng),
[
ifworkofs<6,
[
g_wcs=0+54
g_wcs
]
else,
[
p_wcs=0
"G54",*p_wcs
]
]
force_wcs=sav_frc_wcs
!workofs
]
pgear#Findspindlegearfromlookuptable
ifuse_gea
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 淮阴师范学院《通信原理》2023-2024学年第一学期期末试卷
- 淮阴师范学院《朗诵艺术》2022-2023学年第一学期期末试卷
- 淮阴师范学院《教师职业道德与教育政策法规》2022-2023学年第一学期期末试卷
- 淮阴师范学院《综合自然地理学》2021-2022学年第一学期期末试卷
- 淮阴师范学院《中学地理课程标准与教材分析》2021-2022学年第一学期期末试卷
- 淮阴师范学院《微电影创作》2022-2023学年期末试卷
- 淮阴工学院《数学建模与实验3》2021-2022学年第一学期期末试卷
- 淮阴工学院《制药分离工程》2022-2023学年第一学期期末试卷
- DB4117-T+417-2024兽药散剂生产技术要求
- 学前教育的思维能力培养考核试卷
- 喵喵老师制作 电子百拼的黑白电路图
- DB34-T 4010-2021 水利工程外观质量评定规程-高清现行
- 《整改报告》模板
- 送达地址确认书(样本)
- 江苏省历届中学生与社会作文大赛决赛试题及获奖范文(完整版)资料
- 六年级数学上册教案-分数乘法整理与练习 苏教版
- 《民航服务礼仪》项目五 地面服务礼仪
- 营业执照借用免责协议
- 小学道德与法治人教三年级上册第三单元安全护我成长-《遭遇陌生人》教案
- 三年级上册数学教案-数学好玩-2 搭配中的学问(12)-北师大版
- 2022年湖北省武汉市江岸区育才第二小学六上期中数学试卷
评论
0/150
提交评论