PLC編程規(guī)范范本_第1頁
PLC編程規(guī)范范本_第2頁
PLC編程規(guī)范范本_第3頁
PLC編程規(guī)范范本_第4頁
PLC編程規(guī)范范本_第5頁
已閱讀5頁,還剩12頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

CATLWORKINGMANUAL工作手冊FormNo.:QF-T-WM-AAuthor/Dept.:HongZhiWang/MDEDocument#:WM-S8-013Rev:1.0Title:TheStandardOfPLCProgrammingPLC編程規(guī)范1INDEX目錄1INDEX目錄2PURPOSE目的3SCOPE適用范圍4DEFINITIONSANDABBREVIATIONS定義與縮寫5REFERENCEDOCUMENTS參考文件6RESPONSIBILITY職責(zé)7DESCRIPTION細(xì)則/描述8RECORDSHEET記錄表單9REVISIONRECORD修改記錄10APPENDIX附件2PURPOSE目的StandardizetheelectricalcontrolcontentofCATLautomationequipmentinthestagesofbidding,design,procurement,manufacturing,installation,commissioning,acceptance,etc.,inordertofacilitatethemaintenanceandmanagementofsubsequentproductionlineequipment;規(guī)范CATL自動(dòng)化設(shè)備PLC控制器編程方法,以利于后續(xù)產(chǎn)線設(shè)備的維護(hù)與管理。3SCOPE適用范圍ThisspecificationisapplicabletothenecessarylinksthatNingdeTimesTechnologyCo.,Ltd.anditssubsidiaries,holdingcompaniesandequipmentmanufacturersshouldfollowduringthemanufacturing,installation,commissioninganddeliveryofautomationequipment.本規(guī)范適用于寧德時(shí)代科技股份有限公司及其下屬分公司、控股公司、設(shè)備制造商在自動(dòng)化設(shè)備程序設(shè)計(jì)階段應(yīng)遵守的必要環(huán)節(jié)。4DEFINITIONSANDABBREVIATIONS定義與縮寫4.1Definitions定義4.1.1TotalRequirementsser總體要求Theprogramstructure,variabledefinition,functionobject,startupprocessandotherrelatedcontentsinvolvedinthePLCcontrollerprogrammingaredescribedfortheproductionlineautomationequipment.針對產(chǎn)線自動(dòng)化設(shè)備在PLC控制器程序設(shè)計(jì)時(shí)所涉及的程序結(jié)構(gòu)、變量定義、功能對象、啟動(dòng)流程等相關(guān)內(nèi)容進(jìn)行表述。4.1.2TotalRequirements程序結(jié)構(gòu)MakeclearprovisionsforthePLCprogramstructure;針對PLC程序結(jié)構(gòu)做出明確規(guī)定;4.1.3VariableDefinition變量定義ThedefinitionmethodofPLCprogramvariablesisclearlydefined;明確規(guī)定了PLC程序變量的定義方法;4.1.4FunctionalObjects功能對象Thespecificationoftheestablishmentoffunctionalobjectsandtheuseoffunctionalobjectsisspecified;規(guī)定了功能對象建立及功能對象的使用規(guī)范;4.1.5StartupProcess啟動(dòng)流程規(guī)范Aunifiedrequirementismadefortheproductionstart-upcontrolprocessoftheproductionlineequipment.針對產(chǎn)線設(shè)備的生產(chǎn)啟動(dòng)控制流程做出統(tǒng)一要求。4.2Abbreviations縮寫NA無5REFERENCEDOCUMENTS參考文件Anyreferencedocumentbelowwhichdoesnothaveaversionnumber,itslatesteditionshouldbeappliedtothisprocedure.凡是未注版本的參考文件,其最新版本適用于本程序。Note:Thereferencedocumentsshouldbesortedaccordingtothedocumenttype,followedbypropersequenceasinternationalstandards,regionalstandards,nationalstandards,industrystandards,communitystandards,localstandards,corporatestandards,corporatedocuments,whichthesamecategoryofdocumentsshouldbefirstalphabetical,andthennumericalrankingfromsmalltolarge.參考文件應(yīng)按文件類別進(jìn)行排序,依次為國際標(biāo)準(zhǔn)、區(qū)域標(biāo)準(zhǔn)、國家標(biāo)準(zhǔn)、行業(yè)標(biāo)準(zhǔn)、團(tuán)體標(biāo)準(zhǔn)、地方標(biāo)準(zhǔn)、企業(yè)標(biāo)準(zhǔn)、公司文件,其中同一類別文件應(yīng)先按字母,再按數(shù)字從小到大依次排序。ReferenceDoc.Number參考文件號(hào)Doc.Source文件來源Title標(biāo)題IEC6113-3Internationalstandard國際標(biāo)準(zhǔn)Programmablecontrolprogrammingstandard可編程控制器編程標(biāo)準(zhǔn)6RESPONSIBILITY職責(zé)6.1MDE設(shè)備開發(fā)部Responsiblefortheintroductionofthisspecificationasaguidancedocumentforequipmentdevelopmentduringtheequipmentdevelopmenttechnicalspecificationreleasephase,andrequiresequipmentsupplierstoalwaysfollowthisspecificationduringtheprogrammingphase.負(fù)責(zé)在設(shè)備開發(fā)技術(shù)規(guī)格書發(fā)行階段,導(dǎo)入本規(guī)范作為設(shè)備開發(fā)的指導(dǎo)文件,并要求設(shè)備供應(yīng)商在程序設(shè)計(jì)階段始終以本規(guī)范為指導(dǎo)。6.2ME制造工程部Duringtheentirelifecycleoftheequipment,withtheguidanceofthisspecification,implementequipmentacceptanceandupgradeofsubsequentequipment,andmakereasonablesuggestionsfortheproductionandupdateofthisspecification.在設(shè)備的整個(gè)生命周期中,以本規(guī)范為指導(dǎo),落實(shí)設(shè)備驗(yàn)收和后續(xù)設(shè)備的升級(jí)改造,同時(shí)對本規(guī)范的制作與更新提出合理建議。7DESCRIPTION細(xì)則/描述7.1ProgramStructure程序結(jié)構(gòu)7.1.1ProgramCallMethod程序調(diào)用方式Themainfunction(FC)/logicprogramforallfunctionsneedstobecalledinthestartupprogramormainprogramprogram.Functionsofdifferentfunctionsarenotcalledfromeachother,butonlyrelevantdatablockvariablesareusedfordataexchangeandlogicoperations.Subroutinesandfunctionsthatneedtobesubdividedcanbecalledbythemainfunction/programoftherelevantfunction.Inprinciple,thefunctionprogramcalllogicshouldbesimpleandintuitive,andindependentoffunctions.AsshowninFigure1.所有功能的主要函數(shù)(FC)/邏輯程序需要在啟動(dòng)程序或主流程程序中進(jìn)行調(diào)用。不同功能的函數(shù)之間不進(jìn)行互相調(diào)用,而只使用相關(guān)數(shù)據(jù)塊變量進(jìn)行數(shù)據(jù)交換和邏輯運(yùn)算。需要細(xì)分的子程序和函數(shù),可以由相關(guān)功能的主要函數(shù)/程序進(jìn)行調(diào)用。原則上函數(shù)程序調(diào)用邏輯應(yīng)該簡潔直觀,按照功能進(jìn)行獨(dú)立。如圖1所示FBshouldhavedetailedfunctiondescription,andcancorrectlyrealizethecontrolofeachobject,itscontrollogic,alarmprocessing,signalexchange,etc.shouldbeconciseandclear,easytoread.Toensurethatequipmentmaintenancepersonnelcanmasterthefunctionalstructureoftheseblocks.FB應(yīng)具有詳細(xì)的功能說明,且能正確實(shí)現(xiàn)每一個(gè)對象的控制,其控制邏輯、報(bào)警處理、信號(hào)交換等應(yīng)簡潔明朗,便于閱讀。以確保設(shè)備維護(hù)人員能掌握這些塊的功能結(jié)構(gòu)。7.1.2ProgramTreeContent程序樹內(nèi)容Theprogramprojecttreeneedstobeclearlygrouped,groupedaccordingtothespecificfunctionsoftheprogramgroupprogramming.Themainprogramtreeshouldincludebutnotlimitedtothefollowing.Simpledevicesandsinglefunctionprogramscanleaveunusedmodulesinthem,butgroupitemsshouldbekepttoensurefunctionaldifferentiation.程序項(xiàng)目樹需要進(jìn)行明確分組,分組依據(jù)為程序組編程的具體功能。主程序樹應(yīng)包含但不局限于以下內(nèi)容,簡易設(shè)備及單一功能程序可對其中未使用的模塊留空,但是應(yīng)保留組項(xiàng)以保證功能區(qū)分的統(tǒng)一。a)MasterCopies程序結(jié)構(gòu)模板TheMasterCopiestemplateisusedtosavetheinitialsampleoftheprogram.Itisusedasaprogrammingstructureoutline.Thecorecontrolprogramsampleisalsosavedinthisprogramgroupforretrievalandmodification.MasterCopies模板用于保存程序初始樣例,作為編程結(jié)構(gòu)大綱使用,核心控制程序樣例同樣保存于此程序組中,以便調(diào)取和修改使用。b)TypePLC關(guān)鍵功能塊TheTypePLCprogramgroupisusedtowritecoretechnologyfunctionblocks.Thespecificationstipulatesthatcommonprocessesneedtobeprogrammedasmuchaspossiblebyusingpackagefunctionblocks.Eachfunctionprogramgroupwillhaveadifferentnumberoffunctionblockstobewritten,sointheTypePLCprogramgroup,itisnecessarytofinelygroupagain,groupstructurebasisandmainprogramtree.thesame.TypePLC程序組用于編寫核心工藝功能塊。規(guī)范規(guī)定常用工藝需要盡可能使用封裝功能塊的方式編程,每個(gè)功能程序組會(huì)有不同數(shù)量的功能塊需要編寫,所以在TypePLC程序組中需要再次細(xì)分組別,分組結(jié)構(gòu)依據(jù)與主程序樹相同。c)OrganizationBlocks主啟動(dòng)程序Starttheprogram,writetheOrganizationBlocksfortheunifiedcallofeachfunctionmodulesubroutine,onlycallfunction,andstrivetobesimpleandefficient,withoutlogicaljudgmentandadditionalfunctionprogramming.啟動(dòng)程序,編寫OrganizationBlocks用于統(tǒng)一調(diào)用各功能模塊子程序,僅作調(diào)用功能,力求簡潔高效,不進(jìn)行邏輯判斷及額外功能編程。d)Safety安全功能WhenusingaPLCwithsafetyfunctions,safety-relatedlogicprogramsshouldbeprogrammedintheSafetyprogramgroup.IfthePLCdoesnotintegratethesafetyfunction,thesystemsafetyinterlock,emergencystopandotherrelatedfunctionsshouldalsobewrittenintheSafetygroup.當(dāng)使用帶安全功能的PLC時(shí),應(yīng)在Safety程序組中編寫安全相關(guān)邏輯程序。若PLC未集成安全功能,則也應(yīng)將系統(tǒng)安全聯(lián)鎖、急停等相關(guān)功能編寫在Safety組內(nèi)。e)Initialization初始化Calltheinitializationprogramfunctionblock,restoretheprogramandrelatedparameterstotheinitialstate,andcheckifthealarminformationisnormal.Allowthenextstep.調(diào)用初始化程序功能塊,恢復(fù)程序和相關(guān)參數(shù)至初始狀態(tài),檢查報(bào)警信息是否正常。允許進(jìn)行下一步操作。f)HMIOpModeConfig人機(jī)界面管理Thehuman-machineinterfacemanagementprogramgroupisusedtoimplementoperationmodemanagement,callofscreenfunctions,andswitchingoperationmodesonthefixeddisplayscreenandthemobileoperationpanel.人機(jī)界面管理程序組用于在固定顯示屏與移動(dòng)操作面板上實(shí)現(xiàn)操作模式管理,畫面功能的調(diào)用,以及切換操作模式等。g)OpMode運(yùn)行模式管理TheRunModeprogramgroupisusedtowritecallcommandsfortheoperationmodeandtoinitiatesequenceandfunctionsshouldbestoredinthesubroutinegroupcorrespondingtotheoperationmodenameaccordingtodifferentoperationmodes.運(yùn)行模式程序組用于編寫操作模式的調(diào)用指令,并且啟動(dòng)不同模式下的順序控制指令。順控相關(guān)功能塊與函數(shù)應(yīng)該根據(jù)不同操作模式,分別存放于操作模式名稱相對應(yīng)的子程序組中。h)ProductionData生產(chǎn)信息Theproductioninformationprogramgroupisusedtocallproduction-relateddatafunctionblocksanddatablocks.ThedataismatchedwiththeHMIsetting,andtheproductioninformationisdisplayedonthehuman-machineinterfacesidewithoutanyerrors.生產(chǎn)信息程序組用于調(diào)用生產(chǎn)相關(guān)數(shù)據(jù)功能塊和數(shù)據(jù)塊。數(shù)據(jù)配合HMI設(shè)置,將生產(chǎn)信息完整無誤得顯示于人機(jī)界面端。i)Diagnostic診斷信息Thediagnosticinformationprogramgroupisusedtocallthesystemdiagnosticrelatedfunctionfunctiontocompilethedatablocksrequiredfordiagnosisintogroups.Forproductionlinesthatrequiremorediagnosticsub-devices,thediagnosticdatablocksneedtobegrouped,suchassubdivision:診斷信息程序組用于調(diào)用系統(tǒng)診斷相關(guān)功能函數(shù),將診斷所需的數(shù)據(jù)塊編制在組內(nèi)。對于需要診斷子設(shè)備較多的產(chǎn)線,需要對診斷數(shù)據(jù)塊進(jìn)行分組,如細(xì)分:1)Sub-devicediagnosticdatablock:子設(shè)備診斷數(shù)據(jù)塊;2)PLCdiagnosticdatablock;PLC診斷數(shù)據(jù)塊;3)Profinetdiagnosticdatablock;Profinet診斷數(shù)據(jù)塊;f)ProDiag狀態(tài)診斷工具IfyouusetheProDiagdiagnostictool,youcanperformdiagnosticsmonitoringoftheprogramandPLCstatuswithoutanyprogramming,andpushittotheoperationscreenforquicktroubleshootingandpositioning.若使用ProDiag診斷工具,無需編程,簡單設(shè)置即可對程序及PLC狀態(tài)進(jìn)行診斷監(jiān)控,并推送至操作畫面,用于快速排查和定位問題。Whenprogrammingineachprogramgroupneedstoinvolvedifferentfunctiongroups,itisalsonecessarytogroup,andthegroupdirectoryisdividedaccordingtothereferencemainprogramtree.Forexample,ifakeyfunctionblockofadifferentfunctioniswrittenintheTypePLCprogramgroup,thedirectoryofthefinemolecularprogramtreeinthegroupisconsistentwiththehomedirectory.在各程序組內(nèi)編程時(shí)需要涉及到不同功能組別時(shí),同樣需要進(jìn)行分組,分組目錄依據(jù)參照主程序樹進(jìn)行劃分。如TypePLC程序組中編寫不同功能的關(guān)鍵功能塊,則組內(nèi)細(xì)分子程序樹目錄與主目錄保持一致。7.1.3FunctionBlockProgramming功能塊編程a)Programminglanguage編程語言TheprogramminglanguageoftheIEC6113-3standardisusedforPLCprogramming.TheLADshouldbetheprogramminglanguageoftheblock,becausetheprogramminglanguageLADcanprovidemaintenancepersonnelwitheasierdiagnosisandfastermodification.采用復(fù)合IEC6113-3標(biāo)準(zhǔn)的編程語言進(jìn)行PLC程序設(shè)計(jì),應(yīng)首選LAD作為塊的編程語言,因?yàn)榫幊陶Z言LAD可為維護(hù)人員提供更輕松的診斷和更快速的修改。b)Programmingrules編程規(guī)則1)Functionblockprogramsavoidaccessingglobalconstants.Otherwise,themodulewillnolongerbemodular.功能塊程序避免訪問全局常量。否則,該模塊將無法再模塊化使用。2)ThedatablockisalwaysstoredintheRAMoftheCPU.Itisonlyallowedtousetheloadmemorytostoredatablocksinspecialcases.數(shù)據(jù)塊始終存儲(chǔ)在CPU的RAM中。僅在特殊情況下才允許使用裝載存儲(chǔ)器存儲(chǔ)數(shù)據(jù)塊。3)Itispreferabletousemultipleinstancesinsteadofsingleinstances.優(yōu)選使用多實(shí)例代替單實(shí)例。4)Dataaccessbetweenfunctionblocksisaccessedthroughtheinputandoutputinterfaces.功能塊之間數(shù)據(jù)訪問通過輸入輸出接口訪問。c)Notes注釋1)Blockcomments塊注釋Blockcommentsmustbeplacedoneormorelinesinfrontofthecorrespondingcodesegment.Eachblockcommentcontentformatcontainsthefollowingitems.塊注釋必須以一行或幾行的形式放在相應(yīng)代碼段的前面。每個(gè)塊注釋內(nèi)容格式包含以下各項(xiàng)。-Company公司名稱-Library庫名稱-AfirmwareversionofthetestedPLC(egS7-1511V1.6)已測試固件版本的PLC(例如S7-1511V1.6)-Softwareversionatthetimeofcreation創(chuàng)建時(shí)的軟件版本-Userestrictions(suchascertainOBtypes)使用限制(例如某些OB類型)-Requirements(forexample,otherhardware)要求(例如,其他硬件)-FunctionDescription功能說明-Tileversionwithauthoranddate帶有作者和日期的圖塊版本AsshowninFig2如圖2所示2)Linenotes線路注釋Ifpossible,youmustaddalinecommentattheendofthelineofcode,oryoushouldaddacommentinfrontofthelineofcode.如果可能的話,必須在代碼行的末尾添加行注釋,或者,應(yīng)在相應(yīng)代碼行的前面添加注釋。d)Functionblockpin功能塊引腳1)Inputandoutputwithoutprefix;輸入輸出沒有前綴;2)Dataexchangeviablockinterface;通過塊接口進(jìn)行數(shù)據(jù)交換;3)IfdataisrequiredinmultipleFBsorFCs,thedataexchangeishandledviatheblockinterfaces(input,outputandInOutinterface).DirectaccesstostaticvariablesoutsideFBisprohibited;如果多個(gè)FB或FC中需要數(shù)據(jù),則通過塊接口(輸入,輸出和InOut接口)處理數(shù)據(jù)交換。禁止直接訪問FB外部的靜態(tài)變量;4)Forbasicdatatypes(egWORD,DWORD,REAL,INT,TIMEtypes),theinputoroutputinterfacetypeshouldbeused;對于基本數(shù)據(jù)類型(例如WORD,DWORD,REAL,INT,TIME類型),應(yīng)使用輸入或輸出接口類型;5)Forbasicdatatypes,usetheInOutinterfacetypeonlywhenwritingexternallyandinternallytotheblock;對于基本數(shù)據(jù)類型,僅當(dāng)在塊的外部和內(nèi)部寫入時(shí)才使用InOut接口類型;6)Ifmanyparametersaretransferred,trytopackagetheminthePLCdatatype.ThisPLCdatatypeshouldthenbedeclaredasanInOuttag;如果傳輸了許多參數(shù),則應(yīng)嘗試將它們封裝在PLC數(shù)據(jù)類型中。然后,應(yīng)將此PLC數(shù)據(jù)類型聲明為InOut標(biāo)記;7)Forstructuredtags(egARRAY,STRING,etc.)andPLCdatatypes,theInOutinterfacetypeshouldnormallybeused.對于結(jié)構(gòu)化標(biāo)簽(例如,ARRAY,STRING等類型)和PLC數(shù)據(jù)類型,通常應(yīng)使用InOut接口類型;e)Labelstatement標(biāo)簽聲明1)Staticandtemporary靜態(tài)和臨時(shí)Inordertobeabletoclearlyseparatestaticandtemporarytagsfromthetransmissionandoutputparametersinthecode,thetagprefixisused.Prefixstatictag:stat;temporarytag:temp;為了能夠從代碼中的傳輸和輸出參數(shù)中清楚地分離出靜態(tài)和臨時(shí)標(biāo)簽,使用標(biāo)簽前綴。前綴靜態(tài)標(biāo)簽:stat;臨時(shí)標(biāo)簽:temp;f) Blockwithexecution具有執(zhí)行的塊Theprocessstartsfromtherisingedgeoftheexecuteparameterandtakesthependingvaluefromtheinputparameters.流程從execute參數(shù)的上升沿開始,并采用輸入?yún)?shù)中的未決值。InputandoutputsignaltimingdiagramasshownbelowinFig3輸入輸出信號(hào)時(shí)序圖如下圖3。Fig.3InputAndOutputTimingDiagram圖3輸入輸出時(shí)序圖l)ResetErrorandCommandabortedusingtheDececutefallingedge.使用Execute下降沿重置Error和Commandaborted。2)Whenexecuted,thefunctionoftheFBdoesnotendwiththefallingedgeofExecute.執(zhí)行時(shí),F(xiàn)B的功能不會(huì)隨著Execute下降沿而終止。3)IfExecuteisalreadyFALSEandBusyisFalse,onlyErrorandCommandabortedwaitforonecycle.如果Execute已經(jīng)為FALSE,并且Busy為False,僅Error和Commandaborted等待一個(gè)周期。4)Whentheblockisstillexecuting,requestanewjobwitharisingedgewhenexecuting.當(dāng)塊仍在執(zhí)行時(shí),請求執(zhí)行時(shí)具有上升沿的新作業(yè)。5)Iftheprocessingjobisinterruptedbyahigherpriorityorequivalentpriorityjob(aninterruptofanotherblock/instance),Commandabortedissetbytheblock.Itimmediatelyinterruptstheremainingjobprocessing.如果處理作業(yè)被更高優(yōu)先級(jí)或同等優(yōu)先級(jí)的作業(yè)(另一個(gè)塊/實(shí)例的中斷)中斷,則Commandaborted由該塊設(shè)置。它立即中斷剩余的作業(yè)處理。g)Enableblock啟用塊Settingtheenableparameterwillstartthejob.Jobprocessingisactiveaslongasthesettingsareenabled,andnewvaluescanbetakenandprocessedcontinuously.Resettingtheenableparameterwillterminatethejob.Ifanewjobisstarted,theblockwillenteritsinitialstateandcanbecompletelyswitchedandconfiguredasshowninthefollowingfigure4andfigure5.設(shè)置啟用參數(shù)將啟動(dòng)作業(yè)。只要保持啟用設(shè)置,作業(yè)處理就處于活動(dòng)狀態(tài),并且可以采用新值并連續(xù)對其進(jìn)行處理。重置enable參數(shù)將終止作業(yè)。如果啟動(dòng)了新作業(yè),則該塊將進(jìn)入其初始狀態(tài),并且可以全新地進(jìn)行切換和配置,如下圖4,5所示。1)ErrorisTruetoresetandstopallfunctionsoftheFB.BusyisstillTrueifFBcanberesetautomaticallyError為True復(fù)位并停止FB的所有功能。如果FB能夠自動(dòng)復(fù)位,Busy仍為True2)Aftertheerroriseliminated,theFBstatusisrestored.消除錯(cuò)誤后,F(xiàn)B狀態(tài)恢復(fù)3)Theerrormustbehandledbytheuser.TheFBfunctionneedstobestoppedandtheBusystateisreset.錯(cuò)誤必須由用戶處理的錯(cuò)誤,需停止FB功能,同時(shí)復(fù)位Busy狀態(tài)。4)ErrorisstoppedwhentheenableisFalse.使能為False時(shí)Error停止輸出。5)ValidisTRUEindicatingthattheblockisactivated,therearenopendingerrors,andtherefore,theoutputoftheFBisvalid.Valid為TRUE表示該塊已激活,沒有待處理的錯(cuò)誤,并且因此,F(xiàn)B的輸出有效。6)EnableisFalse,resettingalloutputsofFB.Enable為False,復(fù)位FB所有輸出。7.2namingDefinitionSpecification命名定義規(guī)范Alluser-definednamesarespecifiedandmustbeexpressedinEnglishorEnglishabbreviationsasanoun,includingbutnotlimitedtothecontentinthissection.Theprincipleofvariabledefinitionistomakeitself-explanatory.規(guī)定所有用戶自定義名稱,必須使用英語或英語縮寫作為名詞表達(dá),包含且不僅限于本章節(jié)涉及內(nèi)容。變量定義原則是使其具有自我解釋功能。7.2.1ProjectnamingConvention項(xiàng)目命名規(guī)范Inordertofacilitatebackupandprogramsearch,youneedtonametheprojectaccordingtothefollowingstandards,andthenjudgethelatestbackupdataaccordingtothedate.Theprojectcode,equipmentsuppliercode,productioncablecode,andprocesscodeareallpresent.TheworkstationcodeisthesameastheIPstationnumberofthePLC.AsshowninFig6Forexample:LCCM203L39020-001.為了方便備份和程序查找需要按照如下標(biāo)準(zhǔn)命名項(xiàng)目,再根據(jù)日期來判斷最新的備份數(shù)據(jù)。項(xiàng)目代號(hào),設(shè)備供應(yīng)商代號(hào),生產(chǎn)線代號(hào),工序代號(hào)都已經(jīng)存在。工作站代號(hào)與PLC的IP站號(hào)一致,如圖6所示。例如:LCCM203L39020-001。7.2.2VariableSeparator變量分割符ThenamingrulesforvariablesofPLCprogrammingsoftwareandtouchscreenprograms,manysymbolsareforbiddenorriskyinuse.Forexample:/,<,-1,+,etc.can'tbeusedbasically.Thevariableseparatorusestheunderscore"".綜合PLC程序編程軟件和觸摸屏程序的變量的命名規(guī)則,很多符號(hào)是禁止使用或者使用中有風(fēng)險(xiǎn)的。比如:/,<,>,!,+等基本都不能使用。變量分割符統(tǒng)一使用下劃線“”。7.2.3IODefinitionIO定義Nameingprinciple:Inordertoenabletheuseroftheprogramtolocatethecontactpositionandfunctioninashorttime.AsshowninFig7(Sample:DICleaner01)命名原則:為使得程序的使用者可以在短時(shí)間內(nèi)定位到觸點(diǎn)位置和功能,如圖7所示。(Sample:DICleaner01)7.2.4ConstantDefinition常量定義Constantsaredefinedusinguppercaselettersandunderscores.Constantnamesarealwayswritteninuppercaseletters.Todetectasinglewordorabbreviation,underscoresshouldbeusedbetweenindividualwordsorabbreviations.Forexample:MAXVELOCITY.Toensurethattheseblocksareusedlaterinthelibrary,onlylocalconstantsareusedintheseblocks.Thisensuresthatcompilingintheuserprogramdoesnotresultinerrorsduetomissingprogramparts.AsshowninFig8.常量的定義使用大寫字母和下劃線,常量的名稱總是以大寫字母書寫要檢測單個(gè)單詞或縮寫,應(yīng)在單個(gè)單詞或縮寫之間使用下劃線。比如:MAXVELOCITY。為了保證以后在庫中使用這些塊,在這些塊中僅使用局部常量。這樣可以保證在用戶程序中編譯不會(huì)由于缺少程序部件而導(dǎo)致錯(cuò)誤。如圖8所示。7.2.5IntermediateVariableDefinition中間變量定義Thenamingprinciple:eachnamingpartisseparatedbyalowerhorizontalline,thefirstpartofthefirstletteriscapitalizedtoindicatethefunction,andthesecondpartofthefirstletteriscapitalizedtoindicatetheattribute.Ifthefunctionissimpleandunification,onlyapartofitcanbeused.Whenthefunctiondescriptioniscomplicated,theseparationpartisaddedasneeded,andthefirstletteriscapitalized.AsshowninFig9.命名原則:用下橫線分隔各個(gè)命名部分,第一部分首字母大寫表明功能,第二部分首字母大寫表明屬性。如果功能簡答統(tǒng)一,可只使用一部分,當(dāng)功能描述復(fù)雜,則按需增加分隔部分,規(guī)定首字母大寫。如圖9所示。示例:TimerOperation。7.2.6CycleFactorDefinition循環(huán)因子定義Priorityuse:i,j,k,l,m,n.優(yōu)先使用:i,j,k,l,m,n。7.2.7Functionblockdefinition功能塊定義a)Namingprinciple命名原則Theprocessfunctionisthefirst,thecapitallettersarecapitalized,assimpleaspossibleorusetheeasy-to-understandabbreviation,separatedbythelowerhorizontalline,thesecondpartrepresentsthefunctionblockattributeinuppercaseletters,separatedbythelowerhorizontalline,andthethirdpartisterminatedbytheFBfunction.BlockID.AsshowninFig10.以工藝功能為首,字母大寫,盡可能簡略或使用通俗易懂的簡稱,使用下橫線分隔,第二部分以大寫字母表示功能塊屬性,使用下橫線分隔,第三部分以FB結(jié)尾作為功能塊標(biāo)識(shí)。如圖10所示。Example:POSDEV1S2D2PFB(singleelectroniccontrol,two-waytwo-positionvalve).示例:POSDEV1S2D2PFB(單電控,二通二位閥)。b)Supplement補(bǔ)充Functionblockpinnamedefinitions,allusinguppercaseinitials,preferreduse:function/objectattribute,XxxXxxform.Accordingtotheneedsofcomplexmeaning,theseparationcanbeaddedasneeded,inordertobesimpleandunderstandable.功能塊引腳名稱定義,全部使用大寫首字母,優(yōu)先使用:功能/對象屬性,XxxXxx的形式。根據(jù)復(fù)雜意義的需求,可按需增加分隔,以簡潔易懂為原則。示例:AlarmMode7.2.8User-DefinedStructureDefinition用戶自定義結(jié)構(gòu)定義Thedefinitionofthedatastructureisveryimportant,andtrytounifythesestructures,donotworryaboutstoragespace,today'sPLCmemoryisenoughtoholdalargeamountofdata.Thepointistotrynottodefinethedatastructure(UDT)outsidetheclass,buttodefineitintheclass.Althoughitwillresultintherepetitivedefinitionofthesamestructureindifferentclasses,itwillimprovetheindependenceoftheclass.數(shù)據(jù)結(jié)構(gòu)的定義相當(dāng)重要,并盡量統(tǒng)一這些結(jié)構(gòu),不要顧慮存儲(chǔ)空間,當(dāng)今的PLC內(nèi)存足以容納大量的數(shù)據(jù)。說明一點(diǎn)的是盡量不要在類的外部定義數(shù)據(jù)結(jié)構(gòu)(UDT),而是在類里面定義,雖然會(huì)造成不同類中同一結(jié)構(gòu)的重復(fù)性定義,但卻提高了類的獨(dú)立性。a)Outerstructurename外層結(jié)構(gòu)名稱Thenamingprinciple:theprocessfunctionisthefirst,thecapitallettersarecapitalized,assimpleaspossibleorusetheeasy-to-understandabbreviation,separatedbythelowerhorizontalline,thesecondpartistheuppercaselettertorepresentthestructuralattributes,separatedbythelowerhorizontalline,andthethirdpartendswiththeUDT.Asafunctionblockidentifier.AsshowninFig11.命名原則:以工藝功能為首,字母大寫,盡可能簡略或使用通俗易懂的簡稱,使用下橫線分隔,第二部分以大寫字母表示結(jié)構(gòu)屬性,使用下橫線分隔,第三部分以UDT結(jié)尾作為功能塊標(biāo)識(shí)。如圖11所示。示例:OPMODEUDTb)Internalnamingofthestructure結(jié)構(gòu)內(nèi)部命名Thenamingprinciple:eachnamingpartisseparatedbyalowerhorizontalline,thefirstpartofthefirstletteriscapitalizedtoindicatethefunction,andthesecondpartofthefirstletteriscapitalizedtoindicatetheattribute.Ifthefunctionissimpleanduniform,youcanuseonlyapart.Whenthefunctiondescriptioniscomplicated,addtheseparationpartasneeded,andtheruleiscapitalizedwiththefirstletter.AsshowninFig12.命名原則:用下橫線分隔各個(gè)命名部分,第一部分首字母大寫表明功能,第二部分首字母大寫表明屬性。如果功能簡單統(tǒng)一,可只使用一部分,當(dāng)功能描述復(fù)雜,則按需增加分隔部分,規(guī)則同首字母大寫,如圖12所示。示例:PlantIdentifier7.2.9Array數(shù)組Thearrayindexstartswith0andendswithaconstant.數(shù)組索引以0開頭,以常數(shù)結(jié)尾。7.3DeviceControlProcess設(shè)備控制流程7.3.1StartupProcess啟動(dòng)流程Thecompletestartupprocessshouldinclude,butisnotlimitedto:完整的啟動(dòng)流程應(yīng)該包含,但不僅限于:a)Programinitialization:Thedevicerestoresthedefaultpower-onstate,theparametersarerestoredbuttheproduction-relatedsettingsarenotreset.程序初始化:設(shè)備恢復(fù)默認(rèn)開機(jī)狀態(tài),參數(shù)復(fù)原但不重置生產(chǎn)相關(guān)設(shè)定。b)Self-testofeachstationequipment:Confirmthesensorsignalbeforeoperation,andconfirmthediagnosticstatusofthePLCandrelatedsub-devices.Ensurethattheproductionlineissmooth.各站設(shè)備自檢:對傳感器信號(hào)進(jìn)行運(yùn)行前確認(rèn),PLC及相關(guān)子設(shè)備診斷狀態(tài)確認(rèn)。保證產(chǎn)線通暢。c)Safetycircuitconfirmation:Confirmthatthereisnoabnormalityinthesafetyinterlockfunction,emergencystopcircuitandintegratedsafetyfunctionintheprogram.安全回路確認(rèn):確認(rèn)程序內(nèi)安全聯(lián)鎖功能、急停回路、集成安全功能無異常。d)Equipmentenable:Theequipmentpowercircuitisturnedon,startingoperationaccordingtothefunctionsetting,waitingformaterials.設(shè)備使能:設(shè)備動(dòng)力回路接通,根據(jù)功能設(shè)定開始運(yùn)轉(zhuǎn),等待物料。Eachstartupstepandrunningstateshouldincludeacompletestartupfailureandreturnoperation,givingcorrespondingprompts,anddifferentlevelsoferrorreportingaccordingtodifferentsecuritylevels.每個(gè)啟動(dòng)步驟與運(yùn)行狀態(tài),都應(yīng)該包含完整的啟動(dòng)失敗后退回操作,給出相應(yīng)提示,根據(jù)安全級(jí)別不同進(jìn)行不同等級(jí)的報(bào)錯(cuò)。7.3.2InitiatingSafetyRegulations啟動(dòng)安全規(guī)定Afterthebootprocessisstarted,thedelaytimeis3secondstoremindthetime.Within3seconds,thebuzzer/speakerplaysthepowertoremindthemusic,andthethree-colorlightflashes.Ifthereisasafety-relatedfaultmessagesuchasasafetyalarmoranemergencystopduringtheprocess,thedeviceterminatesandreturnstothepre-bootstate.Ifthereisnoalarm,themachinewillstartsuccessfullyafter3seconds,andthedevicewillenterthenormalproductionprocess.啟動(dòng)開機(jī)過程后,延時(shí)3秒提醒時(shí)間,3秒內(nèi)蜂鳴器/揚(yáng)聲器播放開機(jī)提醒音樂,三色燈黃燈閃爍。過程中如出現(xiàn)安全報(bào)警、急停等安全相關(guān)故障信息,設(shè)備終止啟動(dòng),退回開機(jī)前狀態(tài)。如無報(bào)警則3秒后開機(jī)成功,設(shè)備進(jìn)入正常生產(chǎn)流程。7.3.3ProductionInterruptionProcess生產(chǎn)中斷流程Productioninterruptionscanbecausedbyavarietyofreasons,suchasmanualoperationstop,equipmenterrorstop,productionerrorstop,andsoon.Allproductionprocessesrequirestatememory,specialkeylocationssuchasroboticblankingpositions,andtheneedtoadddetectiondevicesanddevicememoryinterlockprocessing.Aftereliminatingthecauseofthestop,theproductionisresumedbytheproductionstepatthestop,andglobalinitializationisavoidedasmuchaspossibletoensureproductionefficiencyandmaterialsaving.生產(chǎn)中斷可能由多方面原因造成,如人工操作停止、設(shè)備報(bào)錯(cuò)停止、生產(chǎn)錯(cuò)誤停止等。所有生產(chǎn)流程需進(jìn)行狀態(tài)記憶,特殊關(guān)鍵位置比如機(jī)械手上下料位置,需要添加檢測裝置與設(shè)備記憶互鎖處理。在排除停止原因后,由停止時(shí)的生產(chǎn)步驟恢復(fù)生產(chǎn),盡可能避免全局初始化,保證生產(chǎn)效率和物料節(jié)約。7.3.4SafetyRegulationsForShutdown停機(jī)安全規(guī)定a)Emergencystop/faultstop:Themotionactuatorstopsimmediately,andthecylinderandmotoraremaintainedatthecurrentposition.急停/故障停:運(yùn)動(dòng)執(zhí)行機(jī)構(gòu)立即停止,氣缸,電機(jī)維持在當(dāng)前位置保持。b)Normalstop:Stopaftercompletingthecurrentmaterialprocessing.Priorityshouldbegiventoensuringthatduringalongperiodofequipmentdowntime,poweriscutoffandgasisnotdamaged.正常停止:完成當(dāng)前一個(gè)物料加工后停止。應(yīng)該優(yōu)先保證在設(shè)備長時(shí)間停機(jī)期間,斷電,斷氣不會(huì)對產(chǎn)品造成損害。c)Thesafetyloopoftheequipmentpassesthroughthesafetyrelayanditisforbiddentoshieldthesafetycircuitbyanymeans.設(shè)備安全回路通過安全繼電器,禁止通過任何方式,屏蔽安全回路。7.4ProgramSupplementalRequirements程序補(bǔ)充要求7.4.1PLCandthird-partyequipmentorsoftware(includingbutnotlimitedtoHMI,hostcomputer,robot)needindependentblocksforsignalexchange,convenientsignaltroubleshootingPLC與第三方設(shè)備或軟件(包括但不僅限于HMI、上位機(jī)、機(jī)械手)交互信號(hào)需要獨(dú)立的程序塊,方便信號(hào)排查7.4.2FunctionblockandmainprogramIOcommentsshouldbeclearandconcise,easytocheck功能塊及主程序IO注釋要清晰簡潔明了,方便排查7.4.3Theinitializationprocessrequirestheadditionofaxes,cylinders,andthird-partydevicestatesandprocessesandpushestotheHMIdisplayinitializationprocess.Preventtroubleshootingwhenasilentstopoccursduringinitialization初始化程序需要增加軸、氣缸及第三方設(shè)備狀態(tài)及流程并且推送到HMI顯示初始化流程。防止初始化過程中出現(xiàn)默停時(shí)排查原因a)Duringtheinitializationprocess,thesafetydoorisopenedandtheshaft,cylinderandthird-partyequipmentoftheequipmentmuststopmoving.初始化過程中,打開安全門禁,設(shè)備的軸、氣缸及第三方設(shè)備必須停止運(yùn)動(dòng)。b)Initializationneedstoincreasetheself-alarmfunctionofeachcommunicationstation.(Whenasitefails,thereisanalarm)初始化需要增加各通訊站點(diǎn)的自報(bào)警功能。(單某一個(gè)站點(diǎn)故障時(shí),有報(bào)警提示)7.4.4Self-DiagnosticFunction設(shè)備自診斷功能CATLequipmentisbecomingmoreandmoreautomated,andtheequipmentoperationprocessisbecomingmoreandmorecomplicated.Therearemanyactuatorssuchascylinders,motors,servos,androbots.Itisnecessarytohaveasetofequipmentself-diagnosissystem.Thecoreisthedecompositionoperationofeachstepofthemonitoringequipment.Ifthedecompositionactionexceedstheregulations.Time,youcanimmediatelystopthealarmandquicklylocatetheabnormalpointoftheequipment.Therearethefollowingrequirementsforthissystem:CATL設(shè)備自動(dòng)化程度越來越高、設(shè)備動(dòng)作流程日趨復(fù)雜,氣缸、電機(jī)、伺服、機(jī)器人等執(zhí)行機(jī)構(gòu)多,需有一套設(shè)備自診斷系統(tǒng),核心是監(jiān)控設(shè)備每一步分解動(dòng)作,如果分解動(dòng)作超過了規(guī)定時(shí)間,馬上可以停機(jī)報(bào)警,對設(shè)備異常點(diǎn)快速定位。對于該系統(tǒng)有如下要求:a)ThesystemneedstobedisplayedontheHMIinterfacesuchastouchscreen,display,textterminalandsoon.該系統(tǒng)需展示在觸摸屏,顯示器,文本終端等HMI界面上人員方便觀察。b)Diagnosticmaininterface診斷主界面Thereareoneorseveralinterfaces,thepurposeofwhichistoexplainthemainprocessofdeviceactions,andthemainprocessmaycontainseveralprocesses.CanrefertobutnotlimitedtotheformoftheinterfaceasshowninFigure13:有一個(gè)或若干個(gè)界面,其目的在于闡述設(shè)備動(dòng)作的主流程,主流程內(nèi)可能包含若干個(gè)流程??蓞⒖嫉幌抻谌鐖D13界面的形式:Page15of17 DOC.NO.:WM-S8-013-1.0成品下料極耳下料電芯上料焊接工位頂蓋上料貼膠Fig.13DiagnosticMainInterface圖13診斷主頁面1)Thebackgroundcolorisdefinedasfollows:對于背景色定義如下:White:notactivated白色:未啟動(dòng)Green:Theprocessisbeingexecuted綠色:正在執(zhí)行該流程Red:Abnormal,indicatingthatthereisanexceptioninasmallprocessbelowthemainprocess.紅色:異常,表示主流程下面的某小流程有異常c)Diagnosticsecondaryinterface診斷次級(jí)界面Thereareoneorseveralinterfacesfordisplayingthesub-processesinthemainprocess.Thereference,butnotlimitedtothefollowingforms,isusedtodisplaythesub-processesintheflowchartform.TheexecutionmechanismorexecutionconditionsoftheprocessdisplayedintheprocessboxareshowninFigure14.有一個(gè)或若干界面用于顯示主流程中的子流程,參考但不限于如下形式,用流程圖形式,將子流程用動(dòng)作流程展示。流程框內(nèi)顯示該流程的執(zhí)行機(jī)構(gòu)或執(zhí)行條件如圖14所示。貼膠工位流程圖NEM-121240M-121250BM-121260EM-12127.0EM-12128.0BM-12129.0貼膠18軸破真空18軸58/6857/6759/69貼膠決策判定取款轉(zhuǎn)安啟動(dòng)貼膠位1/2過渡位氣缸縮氣缸縮氣缸縮完成N決策判定完成信號(hào)BM-121000EM-121070EM-121120EM-121150EM-12116.0日M-12123.053/6359/6918軸54/64真空吸53/63氣缸伸氣缸縮取膠位氣缸縮2氣缸伸↑EM-12101.0M-12106.0EM-121090EM-121140EM-121170EM-12122.052/6270#真空吸7056/6657/67氣缸伸氣缸伸1氣缸縮氣缸伸氣缸伸B4-121020EM-121050EM12100BM-121130EM-12118.0BM-12121051/6150/6054/64紅色18軸54/6459/69氣缸閉氣缸下綠色氣缸伸代表整膠位氣缸伸氣缸伸代表該流動(dòng)作程卡BM-121030EM-1210

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評(píng)論

0/150

提交評(píng)論