机械类外文翻译可视化的PLC程序使用XML.docx
《机械类外文翻译可视化的PLC程序使用XML.docx》由会员分享,可在线阅读,更多相关《机械类外文翻译可视化的PLC程序使用XML.docx(16页珍藏版)》请在冰豆网上搜索。
机械类外文翻译可视化的PLC程序使用XML
VisualizationofPLCProgramsusingXML
Abstract-DuetothegrowingcomplexityofPLCprogramsthereisanincreasinginterestintheapplicationofformalmethodsinthisarea.Formalmethodsallowrigidprovingofsystempropertiesinverificationandvalidation.OnewaytoapplyformalmethodsistoutilizeaformaldesignapproachinPLCprogramming.However,forexistingsoftwarethathastobeoptimized,changed,orportedtonewsystems.ThereistheneedforanapproachthatcanstartfromagivenPLCprogram.Therefore,formalizationofPLCprogramsisatopicofcurrentresearch.Thepaperoutlinesare-engineeringapproachbasedontheformalizationofPLCprograms.ThetransformationintoavendorindependentformatandthevisualizationofthestructureofPLCprogramsisidentifiedasanimportantintermediatestepinthisprocess.ItisshownhowXMLandcorrespondingtechnologiescanbeusedfortheformalizationandvisualizationofanexistingPLCprogram.
I.INTRODUCTION
ProgrammableLogicControllers(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,ReverseEngineeringissupposedtoreceiveincreasedimportanceinthecomingyearsespeciallyifexitinghardwarehastobereplacedbynewhardwarewithdifferentprogrammingenvironments
VisualizationofexistingPLCprogramsisanimportantintermediatestepofReverseEngineering.ThepaperprovidesanapproachtowardsthevisualizationofPLCprogramsusingXMLwhichisanimportantapproachfortheorientationandbetterunderstandingforengineersworkingwithPLCprograms.
Thepaperisstructuredasfollows.First,ashortintroductiontoPLCsandthecorrespondingprogrammingtechniquesaccordingtotheIEC61131-3standardisgiven.InSectionⅢanapproachforRe-engineeringbasedonformalizationofPLCprogramsisintroduced.ThetransformationofthePLCcodeintoavendorindependentformatisidentifiedasanimportantfirststepinthisprocess.XMLandcorrespondingtechnologiessuchasXSLandXSLTthatcanbeusedinthistransformationarepresentedinSectionIV.SectionVpresentstheapplicationofXMLforthevisualizationofPLCprogramsandillustratestheapproachwithanexample.ThefinalSectionsummarizestheresultsandgivesanoutlookonfutureworkinthisongoingproject.
ⅡPLCANDIEC61131
Sinceitsinceptionintheearly‘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(seehttp:
//www.plcopen.org)startedaTechnicalCommitteetodefineanXMLbasedformatforprojectsaccordingtoIEC61131-3.ThisnewformatwilleasetheaccessofformalizationtoolstoallrelevantinformationofaPLCproject.
Ⅲ.RE-ENGINEERINGAPPROACH
Thepresentedapproachtowardsre-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.XMLASATOOLFORVISUALIZATION
XML(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)followedbyaparserthat
checksthegrammaticalstructureofthecodeandgeneratesanobjectnet.Intheobjectnettheinternalstructureoftheprogramisrepresentedbyidentifiedobjectsandtherelationsbetweenthem.Boththescannerandtheparsertobeusedinthismethodaredocumentorientedwhichimpliesthatanalysisofdifferenttypesofdocumentsrequiresrewritingthegeneratedcodeforthescannerandtheparser.Anexampleofanapplicationofthismethodcanbefoundin[8].
ThemostpromisingaspectofusingXMLinsteadisthatXMLanditscomplementaryapplicationsfortransformationsarestandardizedsoastoprovidemaximumflexibilitytoitsuser.
TheXMLbasedmethodisadvantageous,sincethelexicalspecificationisaninvariantcomponentofXML;therefore