1、Visualization of PLC Programs using XML M. Bani Younis and G. Frey Juniorprofessorship Agentenbased Automation University of Kaiserslautem P. 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 for
2、mal 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 .The
3、re 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 visual
4、ization 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. INTRODUCTION Programmable Logic Controllers (PLCs) are a spe
5、cial 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 PLC
6、s 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 compl
7、etely 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 ti
8、me 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 fo
9、r 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 th
10、e 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 environments Visualization of existing PLC programs is an important intermediate step of Reve
11、rse 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 cor
12、responding 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 proce
13、ss. 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
14、gives an outlook on future work in this ongoing project. PLC AND IEC 61131 Since 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 ap
15、plication, 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 Contr
16、ollers. 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
17、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 b
18、e 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 ver
19、y 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 c
20、ontrollers 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 organiza
21、tion 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 sing
22、le 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
23、PLC project. . RE-ENGINEERING APPROACH The 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 i
24、f 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, simulati
25、on, 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 diffe
26、rent 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 VISUALIZATION XML (extens
27、ible 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 documen
28、t 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 i
29、ndustries 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.