版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
#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. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2024年建筑安裝工程承包合同
- 2024年度新能源發(fā)電EPC施工合同
- 股票課件教學(xué)課件
- 2024年城市規(guī)劃地形測繪專項(xiàng)協(xié)議
- 2024年度旅游景區(qū)開發(fā)合同
- 2024年企業(yè)信息安全服務(wù)合同
- 2024年度CRM系統(tǒng)服務(wù)合同:提供銷售合同管理專業(yè)支持
- 2024年亞太地區(qū)進(jìn)出口合作協(xié)議
- 2024基于物聯(lián)網(wǎng)技術(shù)的服務(wù)合同研究
- 2024年度煤炭供應(yīng)合同
- 閱讀指導(dǎo)《我爸爸》導(dǎo)讀課件
- 保安部崗位設(shè)置圖
- DB31T 1295-2021 立體花壇技術(shù)規(guī)程
- 部編版《道德與法治》五年級上冊第10課《傳統(tǒng)美德 源遠(yuǎn)流長》優(yōu)質(zhì)課件
- 消防工程施工驗(yàn)收單樣板
- 中央空調(diào)人員培訓(xùn)內(nèi)容表
- 發(fā)現(xiàn)生活中的美-完整版PPT
- 小學(xué)道德與法治人教三年級上冊第三單元安全護(hù)我成長-《遭遇陌生人》教案
- CAMDS操作方法及使用技巧
- 平狄克《微觀經(jīng)濟(jì)學(xué)》(第8版)筆記和課后習(xí)題詳解
- 最優(yōu)化理論與算法課程教學(xué)大綱
評論
0/150
提交評論