【机械类毕业论文中英文对照文献翻译】使用XML进行PLC程序可视化
【机械类毕业论文中英文对照文献翻译】使用XML进行PLC程序可视化,机械类毕业论文中英文对照文献翻译,机械类,毕业论文,中英文,对照,对比,比照,文献,翻译,使用,xml,进行,plc,程序,可视化
附录 外文文献翻译使用XML进行PLC程序可视化M. Bani Younis 和G. Frey摘要:由于PLC程序日益复杂,在PLC应用方面有越来越多的兴趣爱好者。形式化方法,让僵化的证明系统属性被核查和验证。一个传统思路的方法就是在PLC编程中设立一个正式的设计方法。不过,现有的软件已被优化,改变,或移植到新系统.有需要找到从某一PLC程序开始的方法。因此,规范PLC程序是一个现在研究的热点。该文章概述了基于形式化的PLC程序基础上重新启动的方法。转型成为一个独立的格式和可视化的结构,在这个过程中,PLC程序的确定是作为这项措施的重要中间步骤。这表明XML和相应的技术怎样用于形式化和可视化现有的PLC程序。一 导言 可编程逻辑控制器(PLC )是一种特殊类型的计算机,它应用于工业和安全关键的地方。应用PLC的目的是控制某一特定的或可选择的过程,它是通过产生的电控制信号回应电器中相关的输出信号来实现的。应用在制造业和化工过程控制,机械加工,交通,电力分配,以及其他许多领域。PLC控制有着极大的不同,自动化应用范围的复杂性从一个简单的小组运作到控制一个会议室的的灯光和自动窗成为一个全自动化的生产线。 随着他们应用PLC知识的增加,他们把PLC应用到复杂性和品质要求高的地方,特别是对安全性要求特别严格的地方。由于在有限的时间里PLC的发展应用日益复杂,现有的软件或PLC的模块也在迅速发展,以此,需要一个正式的办法加以规范。为了确保高品质的要求,我们需要检查和验证程序,以及分析和模拟现有系统。其中一个重要的领域就是已经在最近的时间成长在规范化的PLC程序是逆向工程。逆向工程是通过评估达到了解它的运转过程,以达到重复或加强的目的。而重用的PLC守则正在建立,作为一种打击复杂PLC程序的工具,逆向工程在今后几年将得到越来越多的重要性,特别是如果现有的硬件被适用于各种不同程序环境的新硬件所取代的情况下。 现有的PLC程序的可视化是逆向工程一个重要的中间步骤。本文章提供了一个方法,使用XML使PLC程序可视化,让PLC程序工程师更容易把握方向和更好地了解。 该文件的结构如下。首先,简单的介绍了PLC(根据国际电工委员会61131-3的标准是给予)和相应的编程技巧,。在第三部分,在现有基础上用形式化PLC程序重新设计方法的介绍。PLC代码转型成为一个独立的格式被确定为在这个过程中重要的第一步。XML和相应的技术,例如XSL和XSLT(第四节可以使用的这种转变)。第五部分提出了应用XML的使PLC程序可视化的方法并用一个例子做出说明。最后一节总结了结果,并就今后的工作在这方面正在进行的项目做了一个前景的展望。 二 PLC和IEC 61131 自从七十年代初期公布于世,由于它的成功的完成目的,取代了机器上的硬连线控制设备,PLC日益受到重视,。最终它作为一个独特的应用领域成长起来,它的研究和开发,主要是为控制工程。 IEC61131是为工业自动化第一次真正的努力来规范PLC的编程语言。在1993国际电工委员会上公布了IEC 61131作为可编程控制器标准。在标准化PLC的编程语言之前,正在制定为了个别PLC实用的专有编程语言。为了提高不同产品的兼容性,开放性和互操作性以及为了促进工具和方法的发展,国际电工委员会61131标准设立固定的一套符号。第三部分,定义了一个适合5种编程语言标准:Originated (IL)语言是一种低层次的文本语言,其结构类似于汇编语言。Originated(IL)语言被视为PLC的在所有其他IEC61 131-3语言都可以翻译语言。梯形图(LD)是一种被认为起源于于美国的图形语言。LD符合从电子及电器电路实施控制逻辑的编程风格。 结构化文本( ST)是一个非常强大的高层次的语言。ST从Ada(一种表现能力很强的通用程序设计语言)借用了语法,充实它的一些特点。ST包含一个现在编程语言多要求的所有要素。 功能块图(FBD)是一种图形语言,在工业流程里是非常常见的。在这种语言中,控制器被认为是可在功能块之间流动的信号和数据。FBD把文本编程转变为功能块编程,因而提高了模块化和软件重用性。 顺序功能图(SFC)是一个图形化的语言。SFC要素的定义是为了构建可编程序控制器程序的组织。 其中在IEC 61 131-3中出现的一个问题就是在PLC的编程工具的工程信息中没有一个标准化的格式。目前,每个厂商都在运用他们各自的具体的不同格式。这亦是其中一个原因就是被限制了的形式化的做法,以单一的程序或算法。不过,最近的PLC用户组织PLCopen (见http:/www.plcopen.org )阻止了一个技术委员会,以确定一个基于IEC 61131-3的XML项目 。这种新格式将缓解形式化的工具,将影响 PLC的所有相关的项目。 三 重新设计的方法 对于重新设计所提出的态度,(参见图1 )是基于认为XML可作为一种中间媒体语言用来改造PLC的代码。 这种转变提供了取得独立规格代码优势。(即使PLCopen成功地确定了一种标准化的格式为PLC所应用,仍将有很多现有的程序不符合这个标准。) 在此代码基础上逐步转变到一个正式的模型(自动控制)正在计划之中。这个模型可以用来进行分析,模拟仿真,正式的检查和检验,最终对同一PLC或其他产品重新执行该优化算法。 很多情况下,由于这种重组是一个半自动的过程,中间可视化的代码是最重要的一点。在过程中的不同阶段,代码或形式化模型不同方面的都必须是可视化的设计方式,只有这样设计者才可以进一步的指导工作。XML以其强大的可视化和改造工具,成为解决这方面的工作的一种理想的工具。 四 作为一种可视化工具的XML XML (可扩展标记语言)是一种简单而灵活的转换语言,即一种描述其他语言的语言。由万维网协会( W3C )裁定作为SGML的一种分支语言, XML的克服了两个阻碍网络发展的因素。依赖于一个单一的,一成不变的文件类型( HTML ),这种文件类型中大部分被滥用于各种工作中,从来没有从不同的方面进行设计。充满了SGML的复杂性,其语法功能很强大但另一方面方案又难以选择。 当HTML描述了数据本身是怎样显现的同时, XML描述了数据本身。一些行业和学科、医疗记录及报纸出版,其中已使用XML交换信息,可以跨多个平台来应用。在一个信息获取人可以使用各种不同的方式形式下,XML可简单描述几乎任何种类的信息。它是专门设计用于支持从根本上使用不同形式的数据的系统之间的信息交流,例如民航处及调度之间的应用。使用拥有强大的解析器和固有的简单性的XML句法和语义语法比常规词汇分析器和验证分析器的使用更有利(参见图2 .7 ) 。 常规的程序代码分析方法需要一个扫描仪(词法分析仪)由剖析器检查语法结构的代码产生了一套终端符号(令牌),并生成一个对象网。在该对象的内部结构的程序代表的确定对象和两者之间的关系。双方扫描器和分析器将使用的这种方法是面向文件的,这就意味着,分析不同类型的文件,需要重新生成扫描仪和分析器代码。一个应用这种方法的方法的例子可以在8发现 。 使用XML的最有前途的方面,就是XML及其应用的互补性转变为标准化,以便给它的用户提供最大的灵活性。基于该XML的方法是十分有利的,因为词汇的规格是不变的组成部分,因此XML良好的形式从各自的个别申请是独立的。因此, XML的解析器还可以把XML文件在一个抽象的代表性换成以所谓的文档对象模型( DOM ) ,不需使用语法。 DOM的是一个应用程序编程接口( APII)对HTML和格式良好的XML文件有效。它定义的逻辑结构文件和文件的方式访问和操纵。在DOM中的规范中,术语“文档”被越来越广泛的使用。 XML被看作一种代表许多不同种类的信息可能在不同的系统中存储,这将被看作是数据而不是作为文件。不过, XML介绍了此数据文件,并且DOM可以用来管理这方面的数据 。 XSLT中,XML的转型语言不仅能够转换XML到另一个XML或HTML ,还能够转换到许多其他友好的用户格式。前XSLT的来临以前 ,改造XML成为任何其他格式只有通过在一个程序语言如C + + , Visual Basic或 Java定制开发的应用程序来实现。这个过程普遍缺乏关于XML文档的结构变异。XSLT的演变,作为一个高层次的宣示性的语言,对 9 利用的观念,都是十分相似的。 XSLT的功能分为两个步骤。在第一步,它执行的结构性转型,以便为转换成XML的结构,反映了所需的输出。第二阶段是格式化所需的格式,如HTML或PDF (参见图3 ) 。这个转变最重要的优势是它允许的文件简单或数据结构简单,能良好地嵌入内部结构,但难以用XML来制作。当HTML被选择作为格式转化的产生的时候,是有可能使用HTML的广泛能力来产生出可想象的和有吸引力的可视化程序。 每一个XML文件都有自己的语法和词汇。因此,除了作为良好的形式, XML文件需要遵守一套规则。根据W3C建议,规定必须通过文件型态定义( DTD )或一个XML架构加以界定。这是一个DTD或一个XML架构的XML文档状态的层次和结构上的限制定义的规则。 最近,一些人主张,DTD是用以界定文件的文法。W3C XML Schema的语言复制了DTD的功能 ,并增加了一些新的功能。使用XML的语法,例如,明确之间的关系架构和命名空间,一个有系统的区分元素的种类和数据类型,和单继承的形式,类型的推导。换句话说就是DTD比架构更有可能提供了更丰富和更强大的方式来描述信息 。图 4显示了以上讨论的XML技术和它们之间的联系。 五 可视化的PLC程序A.概况 由于Instruction List (IL)是在欧洲最常用的PLC编程语言,现在所介绍的做法是在此基础上的语言。西门子STEP5和IEC 61131-3标准版正在被考虑。 XML显示生成不同方面的PLC程序,实现了在以下三个步骤(参见图5 ) : 1.PLC程序到XML文件的转换; 2. XML的可行性和XML语法和架构的确定, 3. 根据该指令集的来源,对转换后的XML定义 这三个步骤是讨论分别分节B至D。小组E节说明了在前一阶段期间所获得的不同XMLS可视化成绩。 在整个这一节的一个例子是用来说明所提出的概念。图 6显示了在西门子S5中PLC代码的书面指示。PLC代码是由板块的形式写成,组成的元素,可以是地址,标签,指示,操作和说明或结构上的分隔。Kommentar :AutorErstellt :15.07.2003 Geaendert am: B1B:ONETZWERK 1 EMPFANGEN SLAVE 3 VON MASTERNAME :EMPEMAST0005 :U M98.7 ABFRAGE OB EMPFANG MOEGLICH00060007 :SPB= MOOl00080009 :A DB140 EMPFANGSFACH IST DB 140OOOA :L KF+20 LAENGE DES DATENPAKETSoooc :T DLOOOOD :L KF+O ZIELNUMMER O=MASTEROOOF :T DRO00100011 :UNM98.7 FANGEN WIEDER ERLAUBEN0012 :S M98.70013 MOOl :NOP 000140015 :BE BAUSTEIN ENDEFig. 6 A PLC program written in Siemens S5 Instruction ListB PLC程序转换成为格式良好的XML 由于ASCII格式PLC程序加上一个结构与单独列地址,标签,指示,运算和说明划定的表格,XSLT就可以把它转换为格式良好的XML文件。通过这种转变获得的XML文件是一个分层结构的文件。图 7显示通过XML文件获得改造的PLC。XML文件在结构上,其中元素最根本的代表是PLC的代码。每行的PLC代码是包含相应的ILROW元素,这是Mr的子元素。注:结构选择的XML代表性的IL代码是面向PLC工作的。C. XML验证和XML架构 由于前期处理,除了正在完善被确认XML文件,可以使用验证解析器取得的XML,形成符合一套句法规则所界定的背景下的PLC编程语言。 D. 认可介绍 这一步,可视化的PLC程序在这个过程中使用XML确保XML文件将用于只包含有效可视化,可以用来变换,以及形成有效的另一个XML ,这是由于对鉴定指示拥有一个额外的属性附加到指示标记。此属性通知是一个有效的指示,指示是否是有关的指令集。这个转变的程序,也能指示附加属性的标记,宣布一项分类的指示到预定义类。 转换的XML的指示识别的证明了XML的语义是与PLC的编程语言的操作类型相一致的。 在本节中的例子中(参见图8 ) ,新的XML包含额外的根据它所代表的类型分类指示的运作属性。步骤指示分为11不同类型的操作如合乎逻辑的,跳转,负载或转让的运作转让等等。(Instruction instructionId=Logical Operation)U-.SPB- BEFig. 8 A new transformed XML showing only the inslructions and thecorresponding instruction IDE. 可视化的XML上述所产生的两种XML文件可转化为HTML或在XSL的帮助下转换为其他可读的文件。一个巧XSL可以巧妙地被设计用来产生一个可以容易想象的PLC程序的逻辑或者其他特征的HTML文件。此外, DOM结构中嵌入的XML (参见图9 ) ,也可使用户通过一个简单的方式浏览PLC程序。例如在HTML中做的可视化程序 。这可视化已经完成XML的转换,他作为一个表中的子元素去验证的语法。指示鉴定后的XML被转化成XSL,取得那里的指示和身份指示后,根据该行动的类型提取的XML在 HTML表载列了两栏(指示,指令编号)是可视化的。根据HTML结构的思路,这不是唯一的可能性,其中的XML可以可视化,但他们提供一个很容易的切实可行的方案,那就是用户掌握PLC代码。图 10显示了相同的PLC的代码,图 4作为 HTML文档转换XML文档,显示了图 7使用的XSL 。这更好地了解PLC程序可视成为可能。图 11显示的特殊可视化教学正如图6所给定的XML。六 结论和展望 重新设计的PLC程序需要一个正式的办法加以发展。在本文章中,是来解决这个任务一个方法的介绍。基于给出了指令表的PLC程序,对其进行一步一步的转换。由于这个过程不是完全自动,有必要采取灵活的可视化中间步骤。XML是作为一种灵活的,标准化的手段来充当数据格式来描述的PLC代码。相应的XSL转换和文档对象模型的技术是作为工具,在重整过程中完成工作可视化任务。基于XML的描述PLC程序的进一步转变,将适用于最后得出一个完全形式化描述原PLC的代码。这是一个有限自动机的形式。在这个计划过程中,他们通过一个知识库确定共同的元素的结构。 赢得效益的XML元数据交换(XMI)作为一个开放的行业标准,适用于XML的抽象系统,如UML所指的分类的就是上述11个类别正如UML指令一样。我们可以从这个分类推导出UML的分类,它类似于UML的语义行动。附录 外文文献原文Visualization of PLC Programs using XMLM. Bani Younis and G. FreyJuniorprofessorship Agentenbased AutomationUniversity of KaiserslautemP. 0. Box 3049, D-67653 Kaiserslautem, Germany Abstract - Due to the growing complexity of PLC programs there is an increasing interest in the application of formal methods in this area. Formal methods allow rigid proving of system properties in verification and validation. One way to apply formal methods is to utilize a formal design approach in PLC programming. However, for existing software that has to be optimized, changed, or ported to new systems .There is the need for an approach that can start from a given PLC program. Therefore, formalization of PLC programs is a topic of current research. The paper outlines a re-engineering approach based on the formalization of PLC programs. The transformation into a vendor independent format and the visualization of the structure of PLC programs is identified as an important intermediate step in this process. It is shown how XML and corresponding technologies can be used for the formalization and visualization of an existing PLC program. I. INTRODUCTIONProgrammable Logic Controllers (PLCs) are a special type of computers that are used in industrial and safety critical applications. The purpose of a PLC is to control a particular process, or a collection of processes, by producing electrical control signals in response to electrical process- related inputs signals. The systems controlled by PLCs vary tremendously, with applications in manufacturing, chemical process control, machining, transportation, power distribution, and many other fields. Automation applications can range in complexity from a simple panel to operate the lights and motorized window shades in a conference room to completely automated manufacturing lines.With the widening of their application horizon, PLC programs are being subject to increased complexity and high quality demands especially for safety-critical applications. The growing complexity of the applications within the compliance of limited development time as well as the reusability of existing software or PLC modules requires a formal approach to be developed I. Ensuring the high quality demands requires verification and validation procedures as well as analysis and simulation of existing systems to be carried out 2. One of the important fields for the formalization of PLC programs that have been growing up in recent time is Reverse-engineering 3. Reverse Engineering is a process of evaluating something to understand how it works in order to duplicate or enhance it. While the reuse of PLC codes is being established as a tool for combating the complexity of PLC programs, Reverse Engineering is supposed to receive increased importance in the coming years especially if exiting hardware has to be replaced by new hardware with different programming environmentsVisualization of existing PLC programs is an important intermediate step of Reverse Engineering. The paper provides an approach towards the visualization of PLC programs using XML which is an important approach for the orientation and better understanding for engineers working with PLC programs. The paper is structured as follows. First, a short introduction to PLCs and the corresponding programming techniques according to the IEC 61131-3 standard is given. In Section an approach for Re-engineering based on formalization of PLC programs is introduced. The transformation of the PLC code into a vendor independent format is identified as an important first step in this process. XML and corresponding technologies such as XSL and XSLT that can be used in this transformation are presented in Section IV. Section V presents the application of XML for the visualization of PLC programs and illustrates the approach with an example. The final Section summarizes the results and gives an outlook on future work in this ongoing project. PLC AND IEC 61131Since its inception in the early 70s the PLC received increasing attention due to its success in fulfilling the objective of replacing hard-wired control equipments at machines. Eventually it grew up as a distinct field of application, research and development, mainly for Control Engineering. IEC 61 131 is the first real endeavour to standardize PLC programming languages for industrial automation. In I993 the International Electrotechnical Commission 4 published the IEC 61131 Intemational Standard for Programmable Controllers. Before the standardization PLC programming languages were being developed as proprietary programming languages usable to PLCs of a special vendor. But in order to enhance compatibility, openness and interoperability among different products as well as to promote the development of tools and methodologies with respect to a fixed set of notations the IEC 61131 standard evolved. The third part of this standard defines a suit of five programming languages:Instruction List (IL) is a low-level textual language with a structure similar to assembler. Originated in Europe IL is considered to be the PLC language in which all other IEC61 131-3 languages can be translated.Ladder Diagram (LO) is a graphical language that has its roots in the USA. LDs conform to a programming style borrowed from electronic and electrical circuits for implementing control logics.Structured Text (STJ is a very powerful high-level language. ST borrows its syntax from Pascal, augmenting it with some features from Ada. ST contains all the essential elements of a modem programming language.Function Block Diagram (FBD) is a graphical language and it is very common to the process industry. In this language controllers are modelled as signal and data flows through function blocks. FBD transforms textual programming into connecting function blocks and thus improves modularity and software reuse.Sequential Function Chart (SFC) is a graphical language. SFC elements are defined for structuring the organization of programmable controller programs.One problem with IEC 61 131-3 is that there is no standardized format for the project information in a PLC programming tool. At the moment there are only vendor specific formats. This is also one reason for the restriction of formalization approaches to single programs or algorithms. However, recently the PLC users organization PLCopen (see http:/www.plcopen.org) started a Technical Committee to define an XML based format for projects according to IEC 61131-3. This new format will ease the access of formalization tools to all relevant information of a PLC project. RE-ENGINEERING APPROACHThe presented approach towards re-engineering (cf. Fig.1) is based upon the conception that XML can be used as a medium in which PLC codes will be transformed.This transformation offers the advantage of obtaining avendor independent specification code. (Even if the PLCopen succeeds in defining a standardized format for PLC applications, there will remain a lot of existing programs that do not conform to this standard.) Based on this code a step-wise transformation to a formal model (automata) is planned. This model can then be used for analysis, simulation, formal verification and validation, and finally for the re-implementation of the optimized algorithm on the same or another PLC.Since re-engineering of complete programs will, in most cases, be only a semi-automatic process, intermediate visualization of the code is an important point. At different stages of the process different aspects of the code and/or formal model have to be visualized in a way that a designer can guide the further work. XML with its powerful visualization and transformation tools is an ideal tool for solving this task.IV. XML AS A TOOL FOR VISUALIZATIONXML (extensible Markup Language) is a simple and flexible meta-language, i.e, a language for describing other languages. Tailored by the World Wide Web Consortium (W3C) as a dialect of SGML S, XML removes two constraints which were holding back Web developments 6. The dependence on a single, inflexible document type (HTML) which was being much abused for tasks it was never designed for on one side; and the complexity of full SGML, whose syntax allows many powerful but hard-to-program options on the other side.While HTML describes how data should be presented, XML describes the data itself. A number of industries and scientific disciplines-medical records and newspaper publishing among them-are already using XML to exchange information across platforms and applications. XML can be tailored to describe virtually any kind of information in a form that the recipient of the information can use in a variety of ways. It is specifically designed to support information exchange between systems that use fundamentally different forms of data representation, as for example between CAD and scheduling applications.Using XML with its powerful parsers and inherent robustness in terms of syntactic and semantic grammar is more advantageous than the conventional method of using a lexical analyzer and a validating parser (cf. Fig. 2, 7).The conventional method of analysis of program code requires a scanner (lexical analyser) which generates a set of terminal symbols (tokens) followed by a parser thatchecks the grammatical structure of the code and generates an object net. In the object net the internal structure of the program is represented by identified objects and the relations between them. Both the scanner and the parser to be used in this method are document oriented which implies that analysis of different types of documents requires rewriting the generated code for the scanner and the parser. An example of an application of this method can be found in 8.The most promising aspect of using XML instead is that XML and its complementary applications for transformations are standardized so as to provide maximum flexibility to its user.The XML based method is advantageous, since the lexical specification is an invariant component of XML; therefore the well-formedness is independent from the respective individual application.Hence, an XML-Parser also can transfer well-shaped XML documents in an abstract representation called Document Object Model (DOM) without using a grammar. DOM is an application programming interface (APII) for valid HTML and well-formed XML documents. It defines the logical structure of documents and the way a document is accessed and manipulated. In the DOM specification, the term document is used in a broad sense increasingly. XML is used as a way of representing many different kind of information that may be stored in diverse systems, and much of this would traditionally be seen as data rather than as documents. Nevertheless, XML presents this data as documents, and the DOM can be used to manage this data5.XSLT, the transformation language for XML is capable of transforming XML not only to another XML or HTML but to many other user-friendly formats. Before the advent of XSLT, the transformation of XML to any other format was only possible through custom applications developed in a procedural language such as C+, Visual Basic or, Java. This procedure lacked the generality with respect to the structural variation of XML documents. Capitalizing on the concept that the custom applications for the transformations are all very similar, XSLT evolved as a high-level declarative language 9. XSLT functions in two steps. In the first step, it performs a structural transformation so as to convert the XML into a structure that reflects the desired output. The second stage is formatting the new structure into the required format, such as HTML or PDF (cf. Fig. 3 ). The most important advantage of this transformation is that it allows a simple and easily-conceivable representation of the document or data structure embedded inside the well-structured but hard-to-understand XML to be produced. When HTML is chosen as the format of the transformed produce it is possible to use the extensive ability of HTML to produce an easily-conceivable and attractive visualization of a program.Every XML document has its own syntax and vocabulary. Therefore, in addition to being well-formed, the XML document needs to conform to a set of rules. According to W3C recommendations this set of rules has to be defined either through a Document Type Definition (DTD) or an XML Schema. The rules defined in a DTD or an XML Schema state the hierarchical and structural constraints of the XML document. The DTD is for defining the document grammars; more recently a number of alternative languages have been proposed. The W3C XML Schema language replicates the essential functionality of DTDs, and adds a number of features: the use of XML instance syntax rather than an ad hoc notation, clear relationships between schemas and namespaces, a systematic distinction between element types and data types, and a
收藏