NcstudioPC-BASED NUMERIC CONTROLLERPROGRAMMING MANUALWherethereismotioncontrolthereisWEIHONG
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.Specialized,Concentrated,FocusediThank youforchoosingourproducts!This manualwillhelpyouacquaintwithourproductsandlearntheinformationaboutprogrammingcommandsystem.This manualmakes adetailedintroductiontothethoughtofsystemsoftwareprogrammingandthecommandsystemofprogramming,as wellas tosystemsoftwaresupportofPLT,CAM,andDXF.Beforeusingtheproductsandrelativemachineequipment,carefullyreadthis manualtohaveabetteruseofthem.Becauseofcontinuous updateinhardwareandsoftware,itis possiblethatthesoftwareandthehardwareyouhavereceiveddifferfromthestatementinthis manual.Companyaddress,phonenumberandourwebsitearelistedhereforyourconvenience.Any questions,pleasefeelfreetocontactus.Wewillalways behereandwelcomeyou.CompanyName:WeihongElectronic TechnologyCo.,Ltd.CompanyAddress:No.29,2338DuhuiRd.,Minhang,ShanghaiZipCode:201108Tel:+86-21-33587550Fax:+86-21-33587519Website:http://en.weihong.com.cnE-mail:sales@weihong.com.cn
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.iiSpecialized,Concentrated,FocusedContents1NewFunctions...........................................................................................................................12SummarizationofCNCProgramming.....................................................................................22.1SummarizationofCNCProgramming....................................................................................22.2SummarizationofCNCMachineTool.....................................................................................23StructureofMachiningFile......................................................................................................53.1Address Symbols andFunctions............................................................................................53.2FormatofProgramBlock........................................................................................................63.3FormatofSubprogram............................................................................................................64ProgrammingInstructionSystem............................................................................................74.1SpindleFunction(S),FeedFunction(F)&ToolFunction(T)..................................................74.2Miscellaneous FunctionMCode.............................................................................................84.3PreparatoryFunctionGCode.................................................................................................84.4AdvancedFunctions..............................................................................................................514.5Expressions UsedinProgramInstructions...........................................................................554.6Comments inProgram..........................................................................................................564.7DemonstrationofMachiningFileProgramming...................................................................564.8GCommandAppendix..........................................................................................................615Named Parameters..................................................................................................................636CustomizeandExtendCommandM.....................................................................................687PLT Support..............................................................................................................................698DXF Support.............................................................................................................................70
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.Specialized,Concentrated,Focused11NewFunctions1)NewcommandM802P458752is usedforclearingtheexternaloffset.Fordetailedinformationpleaserefertochapter4.4.2)NewcommandG921is usedforspecifyingtheworkpiececoordinatesofcurrentpointinthecurrentcoordinatesystem.Fordetailedintroductionpleaseturntochapter4.3commands relatedtocoordinatesystemandcoordinates.3)NewcommandG922is usedforsettingthemachinecoordinateoftheoriginofthespecifiedworkpiececoordinatesystem.Fordetailedintroductionpleaserefertochapter4.3commands relatedtocoordinatesystemandcoordinates.4)Newsupportforcircle,bias andchessboarddrillingcyclecommand(G34,G35,G36,andG37).Fordetailedintroductionpleaserefertochapter4.3specialcannedcycle.5)Newrotationfunctioncommands G68/G69,fordetailedintroductionpleaserefertochapter4.3G68/G69coordinatesystemrotationfunctioncommands‖.6)Newmirrorimagefunctioncommands G50.1/G51.1,fordetailedintroductionpleaserefertochapter4.3G50.1/G51.1mirrorimagefunctioncommands‖.7)NewcommandG923is usedfordirecttooloffsetsetting,fordetailedintroductionpleaserefertochapter4.3G923directlysettooloffset.8)StrengthenedfunctionforcommandG906totestifthespecifiedportis timeout.Fordetailedintroductionpleaserefertochapter4.4.9)NewcommandM903is usedformodifyingthecurrenttoolnumber.FordetailedintroductionpleaserefertocommandMlistinchapter4.4.10)CommandG92is takenas invalidcommandinthearraymachining,andshouldbedeletedmanually.Fordetailedintroductionpleaserefertochapter4.3,commands relatedtocoordinatesystemandcoordinates.11)Refertochapter4.4fornewfunctionofnamingasubprogram.12)ImprovementofcommandG904:theusageofPLCaddress;keywords ofPX,PY,PZ arecompatiblewithPLCaddress andequalmark expression.13)ImprovementofM901andG906:theusageofPLCaddress;newkeywords PLCandLEVEL;andPLCkeywords arecompatiblewith[PLCaddress]andequalmark expression.14)NewcommandG992allows thetranslationofcoordinatesystem.FordetailedintroductionpleaserefertoG992temporarilysetWCSaccordingtotoolpositioninchapter4.3.15)NewcommandG28is usedforbackingtothereferencepoint.Fordetailedintroductionpleaserefertochapter4.3,G28autobacktoreferenceposition.16)Newcommands relatedwithencoder.Fordetails,refertoGcodes relatedwithencoderinchapter4.3.
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.2Specialized,Concentrated,Focused2SummarizationofCNCProgramming2.1SummarizationofCNCProgrammingDefinitionofMachiningFileComposedofaseries ofinstructions writteninaprogramminglanguagewhichis speciallyusedforCNCdevice,amachiningfilewillbetranslatedintomotionactions tocontrolthemachinetoolby CNCdevice.Themostcommonlyusedstoragemediums arepunchedtapeanddisk.CreationofMachining FileAs showninFig.2-1below,amachiningfilecanbecreatedbytraditionalmanualprogrammingorCAD/CAMapplication(Suchas thepopularMasterCAMapplication).Fig.2-1CreationofaMachiningFile2.2SummarizationofCNCMachineToolMachine Tool CoordinateAxesTosimplifyprogrammingandguaranteethegenerality ofprogram,this manualhas standardizedthenamingofcoordinateaxesandthedirectionofCNCmachinetool.Linearfeedingcoordinateaxes
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.Specialized,Concentrated,Focused3aredenotedbyX,YandZ,whicharenormallyreferredasbasic coordinateaxes.ThecorrelationofX,YandZ axes follows theRightHandRule,as showninFig.2-2.Thethumbpoints inthe+Xdirection,theindex fingerpoints inthe+Ydirection,andthemiddlefingerpoints inthe+Z direction.+Y+X+Z+Y+C+A+B+Z+X+Y+X+Z+X+Y+Z+A+B+CFig.2-2MachineToolCoordinateAxesCirclefeedcoordinateaxesswivelingaroundX,YandZarerespectivelydenotedbyA,B,andC.AccordingtotheRightHandScrewRule,thethumbpoints in+X,+Yand+Z direction,whiletheindexandmiddlefingerpoints in+A,+B,and+Cdirectionofcirclefeedmotion.ThefeedmotionofCNCmachinecanberealizedby spindledrivingthetoolortheworktabledrivingtheworkpiece.Thepositivedirections ofcoordinateaxes mentionedabovearedirections oftoolfeedingrelativetothesupposedlystationaryworkpiece.Iftheworkpieceiskinetic,thecoordinateaxesaremarkedwith.Accordingtorelativemotion,thepositivedirectionofworkpiecemovementis oppositetothatoftoolmovement,thatis:+X=-X,+Y=-Y,+Z =-Z+A=-A,+B=-B,+C=-CLikewise,theirnegativedirections arecontrarytoeachother.Thedirections ofmachinecoordinateaxes dependonthetypeofmachinetoolandthelayoutofeachcomponent.Foramillingmachine:Z: Z-axiscoincides withthemainspindleaxis,andthedirectionoftoolmovingawayfromworkpieceis thepositivedirection(+Z);X:X-axis is perpendiculartoZ-axis andparalleltotheclampedsurfaceofworkpiece.Forasinglecolumnverticalmill,iftheuserfaces thespindleandlooksinthecolumndirection,rightmovingdirectionis thepositivedirectionofX-axis (+X);Y:Y-axis,X-axis andZ-axis togetherconstituteacoordinatesystemabidingbyrighthandrule.
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.4Specialized,Concentrated,FocusedMachineOrigin(MO)andMachineReferencePoint(REFER)ofMachine Coordinate System(MCS)MCSis theintrinsic coordinatesystemofmachinetool.Knownas machineoriginormachinezeropoint,orhomeposition,theoriginofMCSis confirmedandfixedafterdesigning,manufacturingandtuningofmachine.TheCNCdevicedoesntknowwheremachineoriginiswhenpoweron,andthemechanicalstrokeofeachcoordinateaxis is limitedbymaximumandminimumlimitswitch.TocorrectlysetMCSatmachining,wenormallysetamachineREFERpoint(theinitialpointofmeasurement)withinthestrokerangeofeachcoordinateaxis.Afterstartingthemachine,itisnecessary toback toREFERpointmanually orautomaticallysoas tocreatetheMCS.TheREFERpointcancoincidewithMOornot.Ifnot,thedistancefrommachineREFERpointtoMOcanbesetby parametersetting.Afterthemachinereturns totheREFERpoint,themachineorigin,whichis thereferencepointofallcoordinateaxes,is confirmed,sotheMCSis established.ThestrokeofMCSis definedbythemachinetoolmanufacturer,whilethevalidstrokeofMCSis definedbysoftwarelimit.Therelationshipbetweenmachineorigin(OM),machineREFERpoint(Om),themechanicalstrokeandvalidstrokeofMCSisasshowninFig.2-3.MechanicalStrokealongX-axis (Limit)Valid Stroke along X-axisValid Stroke alongY-axisMechanical Stroke along Y-axisYO mOMXFig.2-3MachineOriginOMandMachineREFEROm
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.Specialized,Concentrated,Focused53StructureofMachiningFileAmachiningfileis agroupofinstructions anddatatransmittedtotheCNCdevice,anditiscomposedofprogramblocks whichfollowacertainstructure,syntax andformatrule,whileeachprogramblock is composedofcommandwords.SeeFig.3-1.N01G91G00X50Y60N10G01X100Y500F150S300M03NN200M02ProgramblockCommandwordFig.3-1ProgramStructure3.1AddressSymbolsand FunctionsAddress symbolsanddefinitionsareas showninForm3-1.Form3-1Address SymbolsAddressSymbolDescriptionB:BasicFunctionO:OptionalFunctionDCutterradius offsetnumberB,OFFeedratefunctionBGPreparatorycommandsB,OHToollengthoffsetBIArc centermodifierforXaxisB,OJArc centermodifierforYaxisB,OKArc centermodifierforZ axisBLRepetitioncountB,OMMiscellaneousfunctionBNSequenceno.orblock no.BOProgramno.BPDwelltimeinmilliseconds,subprogramno.call,custommacrono.call,block numberinmainprogramwhenusedwithM99O,BQDepthofpeck infixedcycles G73andG83ShiftamountinfixedcycleG76andG87ORRetractpointinfixedcyclesO,B
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.6Specialized,Concentrated,FocusedAddressSymbolDescriptionB:BasicFunctionO:OptionalFunctionArc radius designationSSpindlespeedinr/minBTToolfunctionBXXaxis coordinatevaluedesignationBYYaxis coordinatevaluedesignationBZZaxis coordinatevaluedesignationB3.2FormatofProgramBlockAprogramblockdefines alineofinstructionstobeexecutedbyCNCdevice.Theformatofprogramblockdefines thesyntax offunctionwordineachprogramblock,as showninFig.3-2.N..G..X..F..M..S..ProgramBlockNo.PreparatoryF.DimensionW.FeedF.W.MiscellaneousF.W.SpindleF.W.F.:FunctionW.:WordProgramBlockFig.3-2FormatofProgramBlock3.3FormatofSubprogramAsubprogramis asectionofmachiningcodeswhichcanbecalledrepeatedly.ItmustbeginwiththeaddresswordOandsubprogramno.as thefirstlineandendwithM17asthelastline.Onprinciple,commandslikeM30andM17arenotallowedtoappearamongthesubprogram,butnestedsubprogramis acceptable.
上海维宏电子科技股份有限公司WeihongElectronic TechnologyCo.,Ltd.Specialized,Concentrated,Focused74ProgrammingInstructionSystem4.1SpindleFunction(S),FeedFunction (F)&ToolFunction (T)Spindle Function SCommandFormat:S_Description:Scommandis usedtocontrolthespindlespeed.Its subsequentnumericalvaluedenotes therotatespeedofspindleinrpm.Sis amodalcommand,andSfunctionisvalidonlywhenthespindlespeedisadjustable.WhenoneScommandis specified,itwillbevaliduntilthenextScommandis specified.Note:eventhoughthespindleisoff,thevalueofSremains.Feed Speed(Feedrate)FCommandFormat:F_Description:CommandFindicatesthesynthetic feedspeedoftoolrelativetotheworkpiecebeingmachined.Its unitismm/min.Withthehelpoffeedrateoverrideswitchontheoperationpanel,F canbeadjustedbetweenfeedratepercent0%-120%.Ffunctions differentlywithdifferentcommands:G00command,specifyingtherapidtraversespeed,modalforthecurrentmachiningprocedure.G01~G03command,specifyingthefeedspeed,modalforthecurrentmachiningprocedure.ToolFunction(TFeature)CommandFormat:T_Description:Tis usedforselectingatool;thesubsequentvaluedenotes thetoolno.selected,andtherelationshipbetweenTcodeandatoolis stipulatedbymachinetoolmanufacturer.Whenamachiningcenterruns Tcode,toolmagazinewillrotatetoselecttherequiredtool,andwaituntilcommandM06comesintoeffecttofinishautomatic toolchange.Tcommandcalls intoolcompensationvalue(includinglengthandradius)fromthetool
    "