材料分拣机控制系统设计_第1页
材料分拣机控制系统设计_第2页
材料分拣机控制系统设计_第3页
材料分拣机控制系统设计_第4页
材料分拣机控制系统设计_第5页
已阅读5页,还剩25页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

摘要:本论文介绍了樱桃西红柿分拣机的工作机理及其简单的工艺流程,主要针对其控制系统做详细说明。本文对该分拣机进行了总体方案设计,采用PC与PLC相结合的技术实现了樱桃西红柿的自动分选。根据实际生产需求以及设计生产效率,合理选择各动力及控制元件。并且编制控制程序。关键词:自动分拣机;控制系统;可编程逻辑控制器;PC;继电器。Abstract:Withtherapiddevelopmentofthemicroelectrictechniqueandcomputertechnology,PLC(namelyprogrammablecontroller)getswidelyapplicationveryintheindustrycontrolledfield.PLCisonekindonthebasisoftechnologyofdigitalcomputer,electroniccontroldevicedesignedtouseundertheenvironmentofindustryspecially,adoptitbymemorythatcanprogrammer,itislastuserordernottousedfor,throughfigureorintroductionsofsimulationexport,finishsuchfunctionsconfirmedasaseriesoflogic,order,timing,counting,operation,etc.,tocontrolallkindsofintegratedequipmentofelectromechanicsandproductionprocess.Keywords:Automaticsortingsystem;Controlsystem;Programmablelogicalcontroller;PC;SolidStateRely目录1、前言错误!未找到引用源。光电耦合隔离和R-C滤波器,有效地防止了干扰信号的进入。内部采用电磁屏蔽,防止辐射干扰。采用优良的开关电源,防止电源线引入的干扰。具有良好的自诊断功能可对CPU等内部电路进行检测,一旦出错,立即报警。对程序及有关数据有电池供电进行后备,一旦断电或运行停止,有关状态及信息不会丧失。对采用的器件都进行了严格的筛选和简化,排除了因器件问题而造成的故障。采用了冗余技术进行一步增强了可靠性。对某些大型PLC还采用了双CPU构成冗余系统,或三CPU构成表决式系统。随着构成PLC的元器件性能的提高,PLC的可靠性也在相应的提高。一般PLC的平均无故障时间可到达几万小时以上。某些PLC的生产厂家甚至宣布,今后生产PLC不再标明可靠性这一指标,因为对PCL来讲这一指标已毫无意义了。经过大量时间人们发现PLC系统在使用中发生的故障大是是由于PLC的外部开关,传感器,执行机构引起的,而不是PLC本身发生的。另外,PLC程序设计简单,易学易懂易维护,更适合于工程技术人员。因此,PLC在工业控制方面获得了极大成功,成为工业控制中的主流。但是必须指出的是:计算机在信息处理方面还是优于PLC,所以在一些自动化控制系统中,常常将两者结合起来,PLC做下位机进行现在控制,计算机做上位机信息处理。计算机与PLC之间通过通信线路实现信息的转换和交换。这样相辅相成,构成一个功能较强的完整的控制系统。4.1.3PLC控制系统的硬件组成PLC控制系统的硬件是由PLC,输入/输出〔I/O〕电路及外围设备等组成的。系统规模可根据实际应用的需要而定,可大可小。下面对构成控制系统的主要局部简要介绍。PLC系统〔1〕主控模块CPU:CPU是PLC的控制中枢,它由控制器和运算器组成。PLC在CPU的控制下使整个机器有条不紊的协调工作,以实现对现场各个设备的控制。CPU的具体作用如下:执行接受,存储用户程序的操作指令。用以扫描方式来自输入单元的数据和状态信息,并存入相应的数据存储区。执行监控程序和用户程序。完成数据和信息的处理,产生相应的内部控制信号,完成用户指令规定的各种操作。响应外部设备〔如编程器,打印机〕的请求。存储器:PLC系统中的存储器主要用于存放系统程序,用户程序和工作状态数据。系统程序存储区:采用PROM或EPROM芯片存储器。它是由生产厂家直接存放的,永久存储的程序和指令,称为监控程序。监控程序和PLC的硬件组成与专用部件的特性有关,用户不能随意访问和修改这局部存储器的程序。存储器区:工作数据是PLC运行过程中经常变化的,需要随机存取的一些数据。这些数据一般不需要长久保存,因此采用随机存储器RAM。数据存储区包括输入,输出数据映象区,定时器/计数器预置和当前数值的数据。用户程序存储区:用于存放用户经编程器或计算机输入的应用程序。一般采用EPROM或EEPROM存储器,用户可檫写重新编程。用户程序存储器的容量一般就代表PLC的标称容量。通常,小型机小于8KB,中型机小于50KB,而大型机可以在50KB以上。通信接口:主控模块通常有一个或一个以上的通信接口〔简称通信口〕,用以与计算机,编程器相连,实现编程,调试,运行,监视等功能。〔2〕输入/输出模块PLC的控制对象是工业生产过程,它与工业生产过程的联系是通过I/O模块实现的。生产过程有许多控制变量,如温度,压力,液位,速度,电压,开关量,继电器状态等,因此,需要有相应的I/O模块作为CPU与工业生产现场的桥梁。且这些模块应具有较好的抗干扰能力。目前,生产厂家已开发出各种型号的模块供用户选择。对于输入/输出模块有:数字量输入/输出模块,开关量输入/输出模块,模拟量输入/输出模块,交流新号输入/输出模块,220V交流输入/输出模块。还有智能模块,它本身带CPU,存储器和监控系统,可独立完成各种运算。智能模块的种类很多,如高速计数模块,PID调节的模拟量控制模块,阀门控制模块,智能存储模块和智能I/O模块。〔3〕电源模块该模块将交流电源转换成供CPU存储器所需的直流电源,是整个PLC系统的能源供给中心。它的好坏直接影响到PLC的功能和可靠性。目前,大多数PLC采用高质量的开关式稳压电源,与普通电源相比,PLC的电源工作稳定性好,抗干扰能力也强。有些机器的电源除了供内部电路使用外,还向外提供24VDC的稳压电源,用于外部传感器的需要,这样就防止了因外部电源不合格而引起的外部故障。I/O电路PLC的根本功能就是控制,它采集被控对象的各种信号。经过PLC处理后,通过执行装置实现控制。输入电路就是被控对象〔需要进行控制的机器,设备和生产过程〕进行检测,采集,转换和输入。另外,安装在控制台上的按钮,开关等也可以向PLC送控制指令。输出电路的功能就是接受PLC输出的控制信号,对被孔对象执行控制任务。4.1.4PLC控制系统的软件组成PLC控制系统的软件主要是系统软件,应用软件,编程语言及编程支持工具软件几个局部组成。PLC系统软件与工作过程PLC系统软件是PLC工作所必须的软件。在系统软件的支持下,PLC对用户程序进行逐条的解释,并加以执行,直到用户程序结束,然后返回到程序的起始又开始新的一轮扫描。PLC的这种工作方式就称之为循环扫描。现以OMRONP型机为例来说明PLC扫描的工作过程:如下列图在没有扫描之前,PLC首先应保证自身的完好性。接通电源之后,为消除各元件状态的随机性,进行清零或复位处理,检查I/O单元连接是否正确,再执行一段程序。它涉及到各种指令和内存单元,如果执行的时间不超过规定的时间范围,那么证明自身完好,否那么系统关闭。上述操作完成后,将时间监视定时复位,才允许扫描用户程序。公共操作是在每次扫描程序前又一次自检,假设发现故障,除了报警显示灯亮之外,还判断故障性质。一般性故障,只报警不停机,等待处理;对于严重故障,那么停止运行用户程序,此时PLC切断一切输出。上述操作完成后,将时间监视定时复位,才允许扫描用户程序。数据输入/输出操作有的称为I/O状态刷新。它包括两种操作:一是采样输入信号〔即刷新输入状态的内容〕;二是送出处理结果〔即按输出状态表的内容刷新输出电路〕。PLC数据I/O示意图如下:输入映象存储器及刷新。由上图所示可知送入PLC端子上的输入信号,经过电隔离,电平转换,滤波处理后,进入缓冲器内CPU的采样。。在PLC的存储器有一个专门存放I/O数据区,其中对应输入端子的数据区,称之为输入映象存储器。当CPU采样时,输入信号由缓冲区进入映象区。接着就是数据输入或输出状态刷新。只有在采样刷新的时刻,输入映象存储器中的内容才与输入信号〔不考虑电路固有的惯性和滤波滞后影响〕一致,其他时间范围输入信号变化是不会影响映象存储器的内容的。由于PLC扫描周期一般只有几十毫秒,所以两次采样时间很短,对一般开关量来说,可以认为没有因间断采样引起的误差。即认为输入信号一旦变化,就能立即进入输入映象的存储器内。输出映象存储器及输出状态刷新。同样道理,CPU不能直接驱动负载。按用户程序要求及当前输入状态,要保持到下次刷新为止。同样,对于变化较慢的控制过程来说,因为两次刷新的时间间隔和输出电路的惯性时间常数一般才几十毫秒,可以认为输出信号是及时的。应用软件PLC控制系统的应用软件是指为完成PLC实际控制任务而编制的各种软件。随着PLC应用领域范围的不断扩大,应用水平的提高,PLC应用软件也大大丰富起来了。PLC应用软件与一般计算机信息处理软件相比,有很大不同,PLC应用软件有以下几个特点:应用软件设计必须与生产工艺紧密结合。应用软件与硬件紧密相关。软件设计人员不能抛开硬件配置和系统孤立地考虑软件设计。设计必须根据硬件系统,接口的实际情况进行相应的程序设计。PLC应用软件的设计需要计算机,自动控制技术甚至网络通信技术等多种知识。特别是PLC网络的出现,PLC控制系统不再是一个单独的装置。编程语言及编程支持工具软件PLC有多种编程语言:梯形图语言,助记符语言,逻辑功能图语言,布尔代数语言和某些高级语言〔Basic,C语言等〕。但使用广泛的还是梯形图语言和助记符语言。现在世界上各个PLC生产厂家都研制了自己的PLC编程支持工具软件和监控组态软件。用户可以根据自己的需要利用这些软件来改善软件的开发环境,提高编程效率。4.2PLC选择根据分拣机功能要求,并考虑到本钱等,整体集中式小型的PLC就可以满足系统使用要求。因此选用西门子S7-200型号的PLC,CPU224.该PLC适用于各行各业,各种场合中的检测、监测及控制的自动化。S7-200系列的强大功能使其无论在独立运行中,或相连成网络皆能实现复杂控制功能。因此S7-200系列具有极高的性能/价格比。S7-200系列出色表现在以下几个方面:*极高的可靠性*极丰富的指令集*易于掌握*便捷的操作*丰富的内置集成功能*实时特性*强劲的通讯能力*丰富的扩展模块CPU224集成14输入/10输出共24个数字量I/O点。可连接7个扩展模块。6K字节程序和数据存储空间。4个独立的30kHz高速计数器,2路独立的20kHz高速脉冲输出。1个RS485通讯/编程口,具有PPI通讯协议、MPI通讯协议和自由方式通讯能力。非常适合于小点数控制的微型控制器。以下为该PLC的性能参数:存储器用户存储器类型:EEPROM程序:4096字用户数据:2560字本机I/O14入10出,并有7个扩展模块。通讯通讯口数量:1〔RS-485〕支持协议:0号口:PPI,DP/T,自由口总结经过两个多月的学习、研究,以及在指导老师的悉心指导下,终于完成了本论文。在这里,首先要感谢刘老师,对于我的设计,刘老师不管是在总体方向还是具体的实施方面都给予了很大的帮助,并且在论文后期帮助我不断改善。正是在刘老师的耐心指导下,本论文才可以如此顺利的完成。本自动分拣机实现了高可靠高效率的设计要求,并且具有一定的代表性,完全可以把本控制系统应用于其他的自动分拣系统中。这次做论文的经历也会使我终身受益,我感受到做论文是要真真正正用心去做的一件事情,是真正的自己学习的过程和研究的过程,没有学习就不可能有研究的能力,没有自己的研究,就不会有所突破,那也就不叫论文了。希望这次的经历能让我在以后学习中鼓励我继续进步。不积跬步何以至千里,本设计能够顺利的完成,也归功于各位任课老师的认真负责,使我能够很好的掌握和运用专业知识,并在设计中得以表达。正是有了他们的悉心帮助和支持,才使我的毕业论文工作顺利完成,在此向江西农业大学工学院的全体老师表示由衷的谢意。感谢你们四年来的辛勤栽培。6、参考文献陈立定,吴玉香,苏开才编.电气控制与可编程控制器.华南理工大学出版社.200l西门子公司.SIMATICs7—200可编程序控制器系统手册.2000西门子自动化设备公司.STEP7-Miert/WIN32V3.1sPl编程帮助手册.2000周万珍、高鸿斌·PLC分析与设计应用·北京:电子工业出版社,2004年张建军等.《自动化立体仓库控制系统设计与实现》.《工业自动化仪表与装置》,2001,第三期:P6-9D.R.伍德利.《物料搬运》,北京,机械工业出版社,1975,P21-29黄亦公.《机械工业杂志》,1993,12期:P206-216赵利民.《微型计算机控制系统》,北京,机械工业出版社,1994,P29-34徐履冰.《非标准机械设计》,北京,机械工业出版社,1995,P172-176秦曾煌主编.《电工学〔电子技术〕》〔上〕第六版。高等教育出版社。2004.1施平主编。《机械工程专业英语》第八版。哈尔滨工业大学出版社。2007.8邓星钟主编,朱承高主审。《机电传动控制》第三版。华中科技大学出版社。2001.3张中夫主编。《机电传动与控制》。机械工业出版社。2004.1周祖德陈幼平主编《机电一体化控制技术与系统》。华中科技大学出版社杨叔子杨克冲等编著《机械工程控制根底》〔第五版〕。华中科技大学出版社附录一:外文文献原文VisualizationofPLCProgramsusingXMLM.BaniYounisandG.FreyJuniorprofessorshipAgentenbasedAutomationUniversityofKaiserslautemAbstract-DuetothegrowingcomplexityofPLCprogramsthereisanincreasinginterestintheapplicationofformalmethodsinthisarea.Formalmethodsallowrigidprovingofsystempropertiesinverificationandvalidation.OnewaytoapplyformalmethodsistoutilizeaformaldesignapproachinPLCprogramming.However,forexistingsoftwarethathastobeoptimized,changed,orportedtonewsystems.ThereistheneedforanapproachthatcanstartfromagivenPLCprogram.Therefore,formalizationofPLCprogramsisatopicofcurrentresearch.Thepaperoutlinesare-engineeringapproachbasedontheformalizationofPLCprograms.ThetransformationintoavendorindependentformatandthevisualizationofthestructureofPLCprogramsisidentifiedasanimportantintermediatestepinthisprocess.ItisshownhowXMLandcorrespondingtechnologiescanbeusedfortheformalizationandvisualizationofanexistingPLCprogram.I.INTRODUCTIONProgrammableLogicControllers(PLCs)areaspecialtypeofcomputersthatareusedinindustrialandsafetycriticalapplications.ThepurposeofaPLCistocontrolaparticularprocess,oracollectionofprocesses,byproducingelectricalcontrolsignalsinresponsetoelectricalprocess-relatedinputssignals.ThesystemscontrolledbyPLCsvarytremendously,withapplicationsinmanufacturing,chemicalprocesscontrol,machining,transportation,powerdistribution,andmanyotherfields.Automationapplicationscanrangeincomplexityfromasimplepaneltooperatethelightsandmotorizedwindowshadesinaconferenceroomtocompletelyautomatedmanufacturinglines.Withthewideningoftheirapplicationhorizon,PLCprogramsarebeingsubjecttoincreasedcomplexityandhighqualitydemandsespeciallyforsafety-criticalapplications.ThegrowingcomplexityoftheapplicationswithinthecomplianceoflimiteddevelopmenttimeaswellasthereusabilityofexistingsoftwareorPLCmodulesrequiresaformalapproachtobedeveloped[I].Ensuringthehighqualitydemandsrequiresverificationandvalidationproceduresaswellasanalysisandsimulationofexistingsystemstobecarriedout[2].OneoftheimportantfieldsfortheformalizationofPLCprogramsthathavebeengrowingupinrecenttimeisReverse-engineering[3].ReverseEngineeringisaprocessofevaluatingsomethingtounderstandhowitworksinordertoduplicateorenhanceit.WhilethereuseofPLCcodesisbeingestablishedasatoolforcombatingthecomplexityofPLCprograms,ReverseEngineeringissupposedtoreceiveincreasedimportanceinthecomingyearsespeciallyifexitinghardwarehastobereplacedbynewhardwarewithdifferentprogrammingenvironmentsVisualizationofexistingPLCprogramsisanimportantintermediatestepofReverseEngineering.ThepaperprovidesanapproachtowardsthevisualizationofPLCprogramsusingXMLwhichisanimportantapproachfortheorientationandbetterunderstandingforengineersworkingwithPLCprograms.Thepaperisstructuredasfollows.First,ashortintroductiontoPLCsandthecorrespondingprogrammingtechniquesaccordingtotheIEC61131-3standardisgiven.InSectionⅢanapproachforRe-engineeringbasedonformalizationofPLCprogramsisintroduced.ThetransformationofthePLCcodeintoavendorindependentformatisidentifiedasanimportantfirststepinthisprocess.XMLandcorrespondingtechnologiessuchasXSLandXSLTthatcanbeusedinthistransformationarepresentedinSectionIV.SectionVpresentstheapplicationofXMLforthevisualizationofPLCprogramsandillustratestheapproachwithanexample.ThefinalSectionsummarizestheresultsandgivesanoutlookonfutureworkinthisongoingproject.ⅡPLCANDIEC61131Sinceitsinceptionintheearly‘70sthePLCreceivedincreasingattentionduetoitssuccessinfulfillingtheobjectiveofreplacinghard-wiredcontrolequipmentsatmachines.Eventuallyitgrewupasadistinctfieldofapplication,researchanddevelopment,mainlyforControlEngineering.IEC61131isthefirstrealendeavourtostandardizePLCprogramminglanguagesforindustrialautomation.InI993theInternationalElectrotechnicalCommission[4]publishedtheIEC61131IntemationalStandardforProgrammableControllers.BeforethestandardizationPLCprogramminglanguageswerebeingdevelopedasproprietaryprogramminglanguagesusabletoPLCsofaspecialvendor.Butinordertoenhancecompatibility,opennessandinteroperabilityamongdifferentproductsaswellastopromotethedevelopmentoftoolsandmethodologieswithrespecttoafixedsetofnotationstheIEC61131standardevolved.Thethirdpartofthisstandarddefinesasuitoffiveprogramminglanguages:InstructionList(IL)isalow-leveltextuallanguagewithastructuresimilartoassembler.OriginatedinEuropeILisconsideredtobethePLClanguageinwhichallotherIEC61131-3languagescanbetranslated.LadderDiagram(LO)isagraphicallanguagethathasitsrootsintheUSA.LDsconformtoaprogrammingstyleborrowedfromelectronicandelectricalcircuitsforimplementingcontrollogics.StructuredText(STJisaverypowerfulhigh-levellanguage.STborrowsitssyntaxfromPascal,augmentingitwithsomefeaturesfromAda.STcontainsalltheessentialelementsofamodemprogramminglanguage.FunctionBlockDiagram(FBD)isagraphicallanguageanditisverycommontotheprocessindustry.Inthislanguagecontrollersaremodelledassignalanddataflowsthroughfunctionblocks.FBDtransformstextualprogrammingintoconnectingfunctionblocksandthusimprovesmodularityandsoftwarereuse.SequentialFunctionChart(SFC)isagraphicallanguage.SFCelementsaredefinedforstructuringtheorganizationofprogrammablecontrollerprograms.OneproblemwithIEC61131-3isthatthereisnostandardizedformatfortheprojectinformationinaPLCprogrammingtool.Atthemomentthereareonlyvendorspecificformats.Thisisalsoonereasonfortherestrictionofformalizationapproachestosingleprogramsoralgorithms.However,recentlythePLCusers’organizationPLCopen(see://)startedaTechnicalCommitteetodefineanXMLbasedformatforprojectsaccordingtoIEC61131-3.ThisnewformatwilleasetheaccessofformalizationtoolstoallrelevantinformationofaPLCproject.Ⅲ.RE-ENGINEERINGAPPROACHThepresentedapproachtowardsre-engineering(cf.Fig.1)isbasedupontheconceptionthatXMLcanbeusedasamediuminwhichPLCcodeswillbetransformed.Thistransformationofferstheadvantageofobtainingavendorindependentspecificationcode.(EvenifthePLCopensucceedsindefiningastandardizedformatforPLCapplications,therewillremainalotofexistingprogramsthatdonotconformtothisstandard.)Basedonthiscodeastep-wisetransformationtoaformalmodel(automata)isplanned.Thismodelcanthenbeusedforanalysis,simulation,formalverificationandvalidation,andfinallyforthere-implementationoftheoptimizedalgorithmonthesameoranotherPLC.Sincere-engineeringofcompleteprogramswill,inmostcases,beonlyasemi-automaticprocess,intermediatevisualizationofthecodeisanimportantpoint.Atdifferentstagesoftheprocessdifferentaspectsofthecodeand/orformalmodelhavetobevisualizedinawaythatadesignercanguidethefurtherwork.XMLwithitspowerfulvisualizationandtransformationtoolsisanidealtoolforsolvingthistask.IV.XMLASATOOLFORVISUALIZATIONXML(extensibleMarkupLanguage)isasimpleandflexiblemeta-language,i.e,alanguagefordescribingotherlanguages.TailoredbytheWorldWideWebConsortium(W3C)asadialectofSGML[S],XMLremovestwoconstraintswhichwereholdingbackWebdevelopments[6].Thedependenceonasingle,inflexibledocumenttype(HTML)whichwasbeingmuchabusedfortasksitwasneverdesignedforononeside;andthecomplexityoffullSGML,whosesyntaxallowsmanypowerfulbuthard-to-programoptionsontheotherside.WhileHTMLdescribeshowdatashouldbepresented,XMLdescribesthedataitself.Anumberofindustriesandscientificdisciplines-medicalrecordsandnewspaperpublishingamongthem-arealreadyusingXMLtoexchangeinformationacrossplatformsandapplications.XMLcanbetailoredtodescribevirtuallyanykindofinformationinaformthattherecipientoftheinformationcanuseinavarietyofways.Itisspecificallydesignedtosupportinformationexchangebetweensystemsthatusefundamentallydifferentformsofdatarepresentation,asforexamplebetweenCADandschedulingapplications.UsingXMLwithitspowerfulparsersandinherentrobustnessintermsofsyntacticandsemanticgrammarismoreadvantageousthantheconventionalmethodofusingalexicalanalyzerandavalidatingparser(cf.Fig.2,[7]).Theconventionalmethodofanalysisofprogramcoderequiresascanner(lexicalanalyser)whichgeneratesasetofterminalsymbols(tokens)followedbyaparserthatchecksthegrammaticalstructureofthecodeandgeneratesanobjectnet.Intheobjectnettheinternalstructureoftheprogramisrepresentedbyidentifiedobjectsandtherelationsbetweenthem.Boththescannerandtheparsertobeusedinthismethodaredocumentorientedwhichimpliesthatanalysisofdifferenttypesofdocumentsrequiresrewritingthegeneratedcodeforthescannerandtheparser.Anexampleofanapplicationofthismethodcanbefoundin[8].ThemostpromisingaspectofusingXMLinsteadisthatXMLanditscomplementaryapplicationsfortransformationsarestandardizedsoastoprovidemaximumflexibilitytoitsuser.TheXMLbasedmethodisadvantageous,sincethelexicalspecificationisaninvariantcomponentofXML;thereforethewell-formednessisindependentfromtherespectiveindividualapplication.Hence,anXML-Parseralsocantransferwell-shapedXMLdocumentsinanabstractrepresentationcalledDocumentObjectModel(DOM)withoutusingagrammar.DOMisanapplicationprogramminginterface(APII)forvalidHTMLandwell-formedXMLdocuments.Itdefinesthelogicalstructureofdocumentsandthewayadocumentisaccessedandmanipulated.IntheDOMspecification,theterm"document"isusedinabroadsenseincreasingly.XMLisusedasawayofrepresentingmanydifferentkindofinformationthatmaybestoredindiversesystems,andmuchofthiswouldtraditionallybeseenasdataratherthanasdocuments.Nevertheless,XMLpresentsthisdataasdocuments,andtheDOMcanbeusedtomanagethisdata[5].XSLT,thetransformationlanguageforXMLiscapableoftransformingXMLnotonlytoanotherXMLorHTMLbuttomanyotheruser-friendlyformats.BeforetheadventofXSLT,thetransformationofXMLtoanyotherformatwasonlypossiblethroughcustomapplicationsdevelopedinaprocedurallanguagesuchasC++,VisualBasicor,Java.ThisprocedurelackedthegeneralitywithrespecttothestructuralvariationofXMLdocuments.Capitalizingontheconceptthatthecustomapplicationsforthetransformationsareallverysimilar,XSLTevolvedasahigh-leveldeclarativelanguage[9].XSLTfunctionsintwosteps.Inthefirststep,itperformsastructuraltransformationsoastoconverttheXMLintoastructurethatreflectsthedesiredoutput.Thesecondstageisformattingthenewstructureintotherequiredformat,suchasHTMLorPDF(cf.Fig.3).Themostimportantadvantageofthistransformationisthatitallowsasimpleandeasily-conceivablerepresentationofthedocumentordatastructureembeddedinsidethewell-structuredbuthard-to-understandXMLtobeproduced.WhenHTMLischosenastheformatofthetransformedproduceitispossibletousetheextensiveabilityofHTMLtoproduceaneasily-conceivableandattractivevisualizationofaprogram.EveryXMLdocumenthasitsownsyntaxandvocabulary.Therefore,inadditiontobeingwell-formed,theXMLdocumentneedstoconformtoasetofrules.AccordingtoW3CrecommendationsthissetofruleshastobedefinedeitherthroughaDocumentTypeDefinition(DTD)oranXMLSchema.TherulesdefinedinaDTDoranXMLSchemastatethehierarchicalandstructuralconstraintsoftheXMLdocument.TheDTDisfordefiningthedocumentgrammars;morerecentlyanumberofalternativelanguageshavebeenproposed.TheW3CXMLSchemalanguagereplicatestheessentialfunctionalityofDTDs,andaddsanumberoffeatures:theuseofXMLinstancesyntaxratherthananadhocnotation,clearrelationshipsbetweenschemasandnamespaces,asystematicdistinctionbetweenelementtypesanddatatypes,andasingle-inheritanceformoftypederivation.InotherwordsschemasofferaricherandmorepowerfulwayofdescribinginformationthanwhatispossiblewithDTDs.Fig.4showstheXMLtechnologiesdiscussedaboveandtheconnectionbetweenthem.V.ANAPPROACHFORTHEVISUALIZATIONOFPLCPROGRAMSA.OverviewSinceInstructionList(IL)isthemostcommonlyusedPLClanguageinEurope,thepresentedapproachisbasedonthislanguage.TheproprietaryILdialectSiemensSTEP5andthestandardizedversionaccordingtoIEC61131-3areconsidered.ThegenerationofXMLdocumentsshowingdifferentaspectsofaPLCprogramisrealizedinthefollowingthreesteps(cf.Fig.5):1.TransformationofthePLCprogramtoanXMLdocument2.ValidationoftheXMLagainsttheXMLSchemawhichsetsthesyntaxoftheXML3.IdentificationoftheInstructionelementsofthetransformedXMLaccordingtotheinstructionsetofthesourcePLCThesethreestepsarediscussedinsub-sectionsBtoDrespectively.Sub-sectionEexplainsthevisualizationofthedifferentXMLsobtainedduringtheprecedingsteps.ThroughoutthisSectionanexampleisusedtoillustratethepresentedconcepts.Fig.6showsaPLCcodewritteninInstructionListSiemensS5.ThePLCcodeiswritteninatabularformwhereeachrowelementiseitheradelimitedlistconsistingofaddress,label,instruction,operandanddescriptionoracomment.Kommentar:AutorErstellt:15.07.2003Geaendertam:B1B:ONETZWERK1EMPFANGENSLAVE3VONMASTERNAME:EMPE'MAST0005:UM98.7ABFRAGEOBEMPFANGMOEGLICH00060007:SPB=MOOl00080009:ADB140EMPFANGSFACHISTDB140OOOA:LKF+20LAENGEDESDATENPAKETSoooc:TDLOOOOD:LKF+OZIELNUMMERO=MASTEROOOF:TDRO00100011:UNM98.7FANGENWIEDERERLAUBEN0012:SM98.70013MOOl:NOP000140015:BEBAUSTEINENDEFig.6APLCprogramwritteninSiemensS5InstructionListB.ConversionofaPLCPrograminioawell-formedXMLGivenaPLCprograminASCIIformatandinatabularstructurewithseparatecolumnsforaddresses,labels,instructions,operandsanddescriptionsdelimitedbywhitespaces,XSLTcanconvertitintoawell-formedXMLdocument.TheXMLdocumentobtainedthroughthistransformationisahierarchicallystructureddocument.Fig.7showstheXMLdocumentobtainedthroughthetransformationofthePLCcodeofFig.6.TheXMLdocumentisstructuredinahierarchyinwhichtherootelementistheILCodeBlockrepresentingthewholePLCcode.EachoftherowsofthePLCcodeiscontainedwithinacorrespondingILRowelementwhichisMersmtcturedintochildelements.Note:ThestructurechosenfortheXMLrepresentationofIL-CodeisorientedattheworkingproposalofthePLCopen.C.XMLValidationagainsttheXMLSchemaTheXMLobtainedasaresultofthepreviousprocessingcanbevalidatedusingavalidatingparserthatconfirmsthattheXMLdocumentinadditiontobeingwell-formedconformstothesetofsyntacticrulesdefinedincontextofthePLCprogramminglanguage.D.rdenhpcationofinstructionsThisstepintheprocessofvisualizationofPLCprogramsusingXMLensuresthattheXMLdocumenttobeusedforvisualizationcontainsonlyvalidinstructions.XSLTcanbeusedtotransformthewell-formedandvalidXh4LtoanotherXMLwhichasaresultofidentificationoninstructionshasanadditionalattributeappendedtotheinstructiontags.Thisattributenotifieswhethertheinstructionisavalidinstructionoftheconcernedinstructionset.Thistransformationprocedureisalsocapableofattachingattributestotheinstructiontagsthatdeclaresaclassificationoftheinstructionsintopredefinedclasses.TheinstructionidentificationofthetransformedXMLproofsthesemanticoftheXMLinaccordancewiththeoperationtypesofthePLCprogramminglanguage.Intheexampleofthissection,(cf.Fig.8),thenewXMLcontainsadditionalattributeswhichclassifytheinstructionsaccordingtothetypeofoperationitrepresents.TheSTEPSinstructionsarecategorizedintoelevendifferenttypesofoperationse.g.logical,jump,loadortransferoperationassignment,etc.<?xmlversion="l.O"encOding="ISO-8859-1"?><ILCodeBlock><ILRow>(InstructioninstructionId='LogicalOperation")U</Instruction></ILROW>-.<ILRow><InstructioninstructionId="JumpOperation">SPB-</Instruction><InstructioninstructionId="specialOperation">BE</Instruction></ILROW></ILRow>Fig.8AnewtransformedXMLshowingonlytheinslructionsandthecorrespondinginstructionID</ILCodeBlack>E.VisualizationofXMLBothoftheXMLdocumentsgeneratedabovecanbetransformedintoHTMLorotherreadabledocumentswiththehelpofXSL.AningeniousXSLcanbedesignedsoastoproduceanHTMLwhichcanconveythelogicalandotherfeaturesofthePLCprograminaneasilyconceivableform.Moreover,theDOMstructureembeddedintheXML(cf.Fig.9),alsoenablestheusertonavigatethroughthePLCprogramsinaneasyway.FortheexamplethevisualizationisdoneinHTML.ThisvisualizationisdoneforthetransformedXMLafterthevalidationofit'ssyntaxasatablewherethechildelementsoftheILRowarethecolumnsofthistable.TheXMLaftertheinstructionidentificationistransformedusingtheXSL,wheretheinstructionandtheinstructionId,obtainedafterextractingtheXMLaccordingtothetypeofoperationsarevisualizedinatablecontainingtwocolumns(Instruction,InstructionId)inHTML.TheHTMLstructuressuggestedherearenottheonlypossibilities,withwhichtheXMLcanbevisualized,buttheygiveaveryeasypracticaloptionfortheuser'sgraspofthePLCcode.Fig.IOshowsthesamePLCcodeasshowninFig.4asaHTMLdocumentconverted&omtheXMLdocumentshowninFig.7usingXSL.ThisvisualizationenablesabetterunderstandingofthePLCprogram.Fig.11showsthespecialvisualizationofinstructionidsgivenintheXMLofFig.6.VI.CONCLUSIONSANDOUTLOOKRe-engineeringofPLCprogramsneedsaformalapproachtobedeveloped.Inthispaperonewaytosolvethistaskisintroduced.BasedonagivenPLCprogramwritteninInstructionListastep-wisetransformationtoaformalrepresentationisproposed.Sincethisprocesswillnotbefullyautomatic,theneedforflexiblevisualizationofintermediatestepsisderived.XMLispresentedasaflexible,standardizedmeanstoserveasdataformatforthedescriptionofthePLCcode.ThecorrespondingtechnologyofXSLtransformationsandtheDocumentObjectModelarepresentedastoolsforthevarietyofcustomizedvisualizationtasksduringthere-engineeringprocess.BasedontheXMLdescriptionofPLCprogramsfurthertransformationswillbeappliedtofinallyderiveacompletelyformalizeddescriptionoftheoriginalPLCcode.Thiswillbeintheformofafiniteautomaton.DuringthisprocessitisplannedtoidentifycommonILstructuresandformalizethemviaalibrary.GainingtheBenefitoftheXMLMetadataInterchange(XMI)asanopenindustrystandardthatappliesXMLtoabstractsystemssuchasUMLandreferringtotheclassificationoftheinstructionsofILintotheelevencategoriesmentionedabove.WecanextractUMLclassesfromthisclassification,asitresemblestheactionsemanticsofUML.VII.AKNOWLDGMENTWewouldliketoexpressgratitudetothe“StiAungRheinland-PfalzfirInnovation”forsponsoringourworkunderprojectnumber616.VIII.REFERENCES1.L.Baresi,M.Mauri,A.Monti,andM.Pezze,“PLCTools:Design,FormalValidation,andCodeGenerationforProgrammableControllers”,in.IEEEConferenceonSystems,Man,andCybernefics(SMCZOOO),Nashville,USA,Oct.2000,pp.2437-2442.2.G.FreyandL.Litz,“FormalmethodsinPLCprogramming”,inIEEECononSystems,ManandCybernetics(SMC’ZOOO),Nashville,USA,Oct.2000,pp.2431-2436.3.M.BaniYounisandG.Frey,“FormalizationofExistingPLCPrograms:ASurvey.“,inCESA2003,Lille(France),PaperNo.S2-R-00-0239,July2003.4.InternationalElectrotechnicalCommission,IECInternationalStandard1131-3,Pr

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论