【正文】
BFRAGE OB EMPFANG MOEGLICH 0006 0007 :SPB= MOOl 0008 0009 :A DB140 EMPFANGSFACH IST DB 140 OOOA :L KF+20 LAENGE DES DATENPAKETS oooc :T DLO OOOD :L KF+O ZIELNUMMER O=MASTER OOOF :T DRO 0010 0011 : FANGEN WIEDER ERLAUBEN 0012 :S 0013 MOOl :NOP 0 0014 0015 :BE BAUSTEIN ENDE 圖 1 西門子公司名單中 S5Z中 PLC的代碼的書面指示 程序轉(zhuǎn)換成為格式良好的 XML 由于 ASCII 格式 PLC 程序加上一個結(jié)構(gòu)與單獨列地址,標(biāo)簽,指示,運算和說明劃定的表格, XSLT的可以把它轉(zhuǎn)換為格式良好的 XML文件。通過這種轉(zhuǎn)變 獲得的 XML 文件是一個分層結(jié)構(gòu)的文件。 通過 XML 文件獲得改造的 PLC。 XML 文件是在結(jié)構(gòu)上的等級,其中的根元素是 ilcodeblock 是代表全 PLC 的代碼。每行的 PLC 代碼是包含在相應(yīng)的 ilrow元素,這是米呃子元素。注:結(jié)構(gòu)選擇的 XML 代表性的 IL 代碼是面向在工作的建議,該 plcopen。 驗證和 XML 架構(gòu) 由于前處理,除了正在完善被確認(rèn) XML 文件,可以驗證的使用驗證解析器取得的 XML,形成符合一套句法規(guī)則所界定的背景下的 PLC 編程語言。 這一步,可視化的 PLC程序在這個過程中使用 XML確保 XML文件將用于只包含有效可視化,可以用來變換,以及形成有效的另一個 XML,這是由于對鑒定指示擁有一個額外的屬性附加到指示標(biāo)記。此屬性通知是一個有效的指示,指示是否是有關(guān)的指令集。這個轉(zhuǎn)變的程序,也能指示附加屬性的標(biāo) 記,宣布一項分類的指示到預(yù)定義類。 轉(zhuǎn)換的 XML的指示識別的證明了 XML的語義是與 PLC的編程語言的操作類型相一致的。 在本節(jié)中的例子中,(參見圖 2),新的 XML包含額外的根據(jù)它所代表的類型分類指示的運作屬性。步驟指示分為 11不同類型的操作如合乎邏輯的,跳轉(zhuǎn),負(fù)載或轉(zhuǎn)讓的運作轉(zhuǎn)讓等等。 ?xml version= encOding=ISO88591 ? ILCodeBlock ILRow (Instruction instructionId=39。Logical Operation) U/Instruction /ILROW ILRow Instruction instructionId=Jump Operation SPB/Instruction Instruction instructionId= special Operation BE/Instruction /ILROW /ILRow 圖 2 XML 上述所產(chǎn)生的兩種 XML文件可轉(zhuǎn)化為 HTML或在 XSL的幫助下轉(zhuǎn)換為其他可讀的文件。一個巧妙的 XSL可以被設(shè)計用來產(chǎn)生一個可以容易想象的轉(zhuǎn)達(dá) PLC程序的邏輯或者其他特征的 HTML文件。此外, DOM的結(jié)構(gòu)在嵌入在 XML中,也可讓使用者用一個簡單的方法瀏覽 PLC程序。 例如在 HTML中做的可視化程序。這可視化已經(jīng)完成 XML的轉(zhuǎn)換,他作為一個表中的子元素去驗證的語法。 指示鑒定后的 XML被轉(zhuǎn)化成使用 XSL轉(zhuǎn)化,取得那里的指示和身份指示后,根據(jù)該行動的類型提取的 XML在 HTML表載列了兩欄(指示,指令編號)是在可視化的。 HTML結(jié)構(gòu)的建議,這不是唯一的可能性,其中的 XML可以可視化,但他們提供一個很容易的切實可 行的方案,那就是為用戶把握的 PLC代碼。 六 結(jié)論和展望 重新設(shè)計的 PLC程序需要一個正式的辦法加以發(fā)展。在本文章中,是來解決這個任務(wù)一個方法的介紹。在給出了書面指示 PLC程序的基礎(chǔ)上,在清單的通過一個明確步驟轉(zhuǎn)型為被建議的正式代表。由于這個過程不會完全自動,有必要采取靈活的可視化中間步驟。 XML是作為一種靈活的,標(biāo)準(zhǔn)化的手段來充當(dāng)數(shù)據(jù)格式來描述的 PLC代碼。相應(yīng)的 XSL轉(zhuǎn)換和文檔對象模型的技術(shù)是作為工具,在重整過程為各種定制可視化任務(wù)。 基于 XML的描述 PLC程序的進(jìn)一步轉(zhuǎn)變,將適用于最后得出一個完全 形式化描述原 PLC的代碼。這將是在成立一個有限自動機。在這個計劃過程中,他們通過一個知識庫確定共同的介素的結(jié)構(gòu)和正規(guī)化, 七 致謝 我們想感謝萊茵蘭 普法爾茨飛行情報區(qū)的創(chuàng)新,為辦學(xué)我們的工作下,項目編號 616。 附件 2:外文原文 Visualization of PLC Programs using XML M. Bani Younis and G. Frey Abstract Due to the growing plexity 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 reengineering 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. INTRODUCTION Programmable Logic Controllers (PLCs) are a special type of puters 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 plexity from a simple panel to operate the lights and motorized window shades in a conference room to pletely automated manufacturing lines. With the widening of their application horizon, PLC programs are being subject to increased plexity and high quality demands especially for safetycritical applications. The growing plexity of the applications within the pliance 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 Reverseengineering [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 bating the plexity of PLC programs, Reverse Engineering is supposed to receive increased importance in the ing 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 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 611313 standard is given. In Section Ⅲ an approach for Reengineering based on formalization of PLC programs is introduced. The transformation of