<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE article  PUBLIC "-//NLM//DTD Journal Publishing DTD v3.0 20080202//EN" "http://dtd.nlm.nih.gov/publishing/3.0/journalpublishing3.dtd"><article xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink" dtd-version="3.0" xml:lang="en" article-type="research article"><front><journal-meta><journal-id journal-id-type="publisher-id">ICA</journal-id><journal-title-group><journal-title>Intelligent Control and Automation</journal-title></journal-title-group><issn pub-type="epub">2153-0653</issn><publisher><publisher-name>Scientific Research Publishing</publisher-name></publisher></journal-meta><article-meta><article-id pub-id-type="doi">10.4236/ica.2015.61007</article-id><article-id pub-id-type="publisher-id">ICA-53320</article-id><article-categories><subj-group subj-group-type="heading"><subject>Articles</subject></subj-group><subj-group subj-group-type="Discipline-v2"><subject>Computer Science&amp;Communications</subject></subj-group></article-categories><title-group><article-title>
 
 
  On the Analysis of PLC Programs: Software Quality and Code Dynamics
 
</article-title></title-group><contrib-group><contrib contrib-type="author" xlink:type="simple"><name name-style="western"><surname>ohammed</surname><given-names>Bani Younis</given-names></name><xref ref-type="aff" rid="aff1"><sub>1</sub></xref><xref ref-type="corresp" rid="cor1"><sup>*</sup></xref></contrib></contrib-group><aff id="aff1"><label>1</label><addr-line>Faculty of Engineering, Philadelphia University, Amman, Jordan</addr-line></aff><author-notes><corresp id="cor1">* E-mail:<email>mbaniyounis@philadelphia.edu.jo</email></corresp></author-notes><pub-date pub-type="epub"><day>13</day><month>01</month><year>2015</year></pub-date><volume>06</volume><issue>01</issue><fpage>55</fpage><lpage>63</lpage><history><date date-type="received"><day>23</day>	<month>December</month>	<year>2014</year></date><date date-type="rev-recd"><day>accepted</day>	<month>6</month>	<year>January</year>	</date><date date-type="accepted"><day>19</day>	<month>January</month>	<year>2015</year></date></history><permissions><copyright-statement>&#169; Copyright  2014 by authors and Scientific Research Publishing Inc. </copyright-statement><copyright-year>2014</copyright-year><license><license-p>This work is licensed under the Creative Commons Attribution International License (CC BY). http://creativecommons.org/licenses/by/4.0/</license-p></license></permissions><abstract><p>
 
 
  As a result of sudden failure in the Programmable Logic Control (PLC) controlled process, the need of diagnosis arises. Diagnosis problem plays an important role to monitor failures in PLC, used to control the whole process. Nowadays and due to the lack of the needed tools availability to perform this action automatically, it is accomplished manually. Usually, the time consuming method is used by back-tracking the failure on an actuator due to the corresponding sensors. This paper analyzes the software quality metrics and their application on the PLC programs. Aiming to implement metrics that gives predictive information about diagnosability of an Instruction List (IL) PLC programs, this could minimize the needed effort to check the program in case of mistakes. Furthermore, to get a better prediction about diagnosability, new metrics are introduced which are able to give more information about the semantics of a program. But they are not yet fully developed and have to be analyzed.
 
</p></abstract><kwd-group><kwd>PLC Programs</kwd><kwd> Diagnosability</kwd><kwd> Dependency</kwd><kwd> Program Slicing Component</kwd></kwd-group></article-meta></front><body><sec id="s1"><title>1. Introduction</title><p>Programmable Logic Controllers (PLCs) are special type of computer with a cyclic behavior used for controlling machines and process. PLC is a good example of discrete event system or logic control with extensions to be able to implement and control analog controllers and deal with continuous signals like PID control algorithms.</p><p>The cycle of the PLC starts by reading the sensor values from the controlled process or machine then processing the control algorithm and finally controlling the actuators according to the given specifications.</p><p>To maintain the efficiency of the PLC in manufacturing and production, it is necessary in case of modernizations and re-structuring of machines to modernize the PLC to meet these requirements. Another important task related to PLC is the possibility to diagnose the PLC in case of errors or mistaken behavior. Diagnosis is aimed at finding the source of a failure in a system. Many research ideas tackling this problem with advanced methods for failure diagnosis for discrete event systems are available in (‎ [<xref ref-type="bibr" rid="scirp.53320-ref1">1</xref>] - [<xref ref-type="bibr" rid="scirp.53320-ref4">4</xref>] ). Although these methods are rich of research ideas have not yet found wide acceptance in industry.</p><p>The standard approach in industry is still manual diagnosis. This is usually performed in case unexpected situation in the manufacturing process. In this case the diagnosis obviously starts by checking the actuator responsible for the missing action. If this actuator is found to function properly, the next step is to back track the reasons through the PLC. The reasons behind this unusual behavior can be because of the non proper or broken sensors. It is generally justified due to the absence of errors in the algorithms implemented on the PLC. Hence, the task is to track back the dependency of the output signal corresponding to the failing actuator―possibly over several internal variables of the PLC―to the corresponding input signals. After these are found, the respective sensors have to be checked for failures. This issue can in turn be very costly and time consuming in case of complex and huge PLC applications.</p><p>Fault diagnosis and fault tolerance are important aspects of maintenance which improve the system reliability. These important issues can be implemented in different ways. The main PLCs have self-diagnostic capabilities in order to detect internal failure. Power supply failure is generally shown with a led.</p><p>A fault on input/output (units, connecting cable, terminal,…) can be diagnosed with led indicators that show the signal logic value or run specific diagnosis routines.</p><p>A run fault (system program termination due to some anomalous operations) is also normally shown with a led.</p><p>A complete diagnostic tool within one whole package with the PLC machines or systems is preferable by many testing engineers. However, there’re several tools available, such as:</p><p> Profibus diagnostic tools;</p><p> BT200 diagnostic tools from Siemens;</p><p> xEPI for Ethernet, Profibus, Interface system.</p><p>A fault on the application program is more difficult to check, and different solutions have been proposed but not mature. The aim of the presented work is to investigate how to use known software quality measures to determine the connections inside a PLC program. This allows a better understanding of the program and hence the effort for manual diagnosis. The PLC programs under consideration are assumed to be given in Instruction List language (IL). This PLC language is used for the application of the approach because it is the most commonly used PLC language in Europe.</p><p>Since IL is a special form of Assembly language, for several metrics to be applied, it is necessary to transform the program to a higher level description. To this end, the presented method utilizes a reverse engineering approach for IL programs presented in ‎ [<xref ref-type="bibr" rid="scirp.53320-ref4">4</xref>] . During the calculation of the metrics graphical representations of dependency relations are derived. These can be used as an aid for the engineer in the actual diagnosis process.</p><p>The paper is structured as follows. Section 2 discusses software quality to measure the structure of the PLC program. New methods related to the measures of the dynamic and semantic of a given PLC program are presented in Section ‎3. Section ‎4 concludes this paper and gives and outlook on future work.</p></sec><sec id="s2"><title>2. Software Quality and Diagnosis (Former Works)</title><p>In the Software Engineering community, the field of measures or metrics to measure software characteristics is maturing, see e.g. ‎ [<xref ref-type="bibr" rid="scirp.53320-ref5">5</xref>] and ‎ [<xref ref-type="bibr" rid="scirp.53320-ref6">6</xref>] for overviews. Some of the best-known software measures were already date back to the late seventies (‎ [<xref ref-type="bibr" rid="scirp.53320-ref7">7</xref>] [<xref ref-type="bibr" rid="scirp.53320-ref8">8</xref>] ). However, in the area of PLC programs software quality is rarely studied. Frey ‎ [<xref ref-type="bibr" rid="scirp.53320-ref9">9</xref>] introduced the concept of Transparency to measure the understandability of PLC programs described by a special form of Petri Net. Dandachi et al. [<xref ref-type="bibr" rid="scirp.53320-ref10">10</xref>] provided similar metrics to be applied to PLC programs given in Sequential Function Chart language. A different application of software measures is presented by Lucas and Tilbury in ‎ [<xref ref-type="bibr" rid="scirp.53320-ref11">11</xref>] . There, the complexity of solutions to the same problem described with different PLC languages is measured and compared. A systemic method dedicated through the modeling of PLC system architecture and PLC features as components was proposed in [<xref ref-type="bibr" rid="scirp.53320-ref12">12</xref>] and [<xref ref-type="bibr" rid="scirp.53320-ref13">13</xref>] . This model is used for the construction of verification model.</p><p>There are many measures which are normally used nowadays to determine the quality of software were applied to investigate the software quality of the PLC programs as Presented in [<xref ref-type="bibr" rid="scirp.53320-ref13">13</xref>] . Most measures presented concentrate more on the program’s structure than on the contents. The size measure belongs to the most often used measures, namely the LOC (Lines of Code) and the Halstead measure with which the software will be measured in terms of the operators and operands. Another classical complexity measure shows the “Cyclomatic Complexity” from McCabe which refers to the flow chart of the code. A measure which determines the complexity of a program by the investigation of its graph is the “Tree Impurity” ‎ [<xref ref-type="bibr" rid="scirp.53320-ref6">6</xref>] .</p><p>The following table briefly summarizes the evaluation of the measures presented above and shows their applicability to IL PLC programs (cf. <xref ref-type="table" rid="table1">Table 1</xref>) ‎ [<xref ref-type="bibr" rid="scirp.53320-ref13">13</xref>] .</p></sec><sec id="s3"><title>3. Code Dynamic and Semantic Measures</title><sec id="s3_1"><title>3.1. Algorithm to Establish Formulas from IL</title><p>The code is perused from above where the first line of code is processed and the individual conditions according to their operations are recorded. The brackets in the specified conditions are also registered in case available. Each condition has a set, reset or an assignment “i.e.:=”.</p><p>IL of the form</p><disp-formula id="scirp.53320-formula157"><graphic  xlink:href="http://html.scirp.org/file/7-7900375x5.png"  xlink:type="simple"/></disp-formula><p>The resulting formulas:</p><disp-formula id="scirp.53320-formula158"><label>(1)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/7-7900375x6.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.53320-formula159"><label>(2)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/7-7900375x7.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.53320-formula160"><label>(3)</label><graphic position="anchor" xlink:href="http://html.scirp.org/file/7-7900375x8.png"  xlink:type="simple"/></disp-formula><p>The resulting formulas in case of set and reset, for X to be set to 1, the condition to set has to be fulfilled or X</p><p>was set to 1 in the previous cycle<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/7-7900375x9.png" xlink:type="simple"/></inline-formula>. To keep X in this state the condition for resetting is not allowed to be fulfilled or X was 0 in the previous cycle<inline-formula><inline-graphic xlink:href="http://html.scirp.org/file/7-7900375x10.png" xlink:type="simple"/></inline-formula>. These formulas are used to set X to</p><p>1 in case the condition is true otherwise it will be reset to 0.</p><p>Set and reset the variable used in the formulas is necessary because by setting a variable it is stored as value 1 or True until the conditions for resetting are met. This can, however, be an advantage to check the programming. When in the formula (i.e. only an X is appeared) which means that for X, the conditions for set or reset is missing. By the assignment operation the processing is different, because no storage for the variable takes place. And the previous state of the variable is not known, this justifies the non-appearance of Y in the formulas.</p><p>Once the individual formulas for each variable are constructed, these formulas are substituted into each other and an overall expression for the variables is formulated. If this total expression met, the output variable is set to 1, otherwise it is zero. The above described formulas are expressed with the help of finite state machines (cf. <xref ref-type="fig" rid="fig1">Figure 1</xref> for the first formula, <xref ref-type="fig" rid="fig2">Figure 2</xref> for the second formula, and <xref ref-type="fig" rid="fig3">Figure 3</xref> after the merging of both formulas).</p><table-wrap id="table1" ><label><xref ref-type="table" rid="table1">Table 1</xref></label><caption><title> Evaluation of the discussed measures (+ = good; 0 = fair, − = bad)</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Measure</th><th align="center" valign="middle" >Software feasibility</th><th align="center" valign="middle" >Applicability to IL</th><th align="center" valign="middle" >Significance for diagnosability</th></tr></thead><tr><td align="center" valign="middle" >Size</td><td align="center" valign="middle" >++</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >− (Serves for the coarse appraisal)</td></tr><tr><td align="center" valign="middle" >Halstead</td><td align="center" valign="middle" >++</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >0 (Overview about operators and operands)</td></tr><tr><td align="center" valign="middle" >McCabe</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >− (Graph is necessary)</td><td align="center" valign="middle" >− (Information about conditional jumps)</td></tr><tr><td align="center" valign="middle" >Tree Impurity</td><td align="center" valign="middle" >0</td><td align="center" valign="middle" >0 (Graph is necessary)</td><td align="center" valign="middle" >+ (Blocks invoke by other blocks )</td></tr></tbody></table></table-wrap><fig id="fig1"  position="float"><label><xref ref-type="fig" rid="fig1">Figure 1</xref></label><caption><title> First formula</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x11.png"/></fig><fig id="fig2"  position="float"><label><xref ref-type="fig" rid="fig2">Figure 2</xref></label><caption><title> Second formula</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x12.png"/></fig><fig id="fig3"  position="float"><label><xref ref-type="fig" rid="fig3">Figure 3</xref></label><caption><title> Formula resulting from the merge of both formulas</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x13.png"/></fig><p>One recognizes here the correctness of the formula, because no matter how many times the loop is executed, the correct output appears accordingly as long as the conditions do not change.</p><p>This formula can now be used to determine the software quality of the program. Once you have set all the variables that are represented in the formula for the output calculation, all the variables of which this output depends are obtained. In the formula not only the input variables are yielded, but also it shows which variables are used, such as Merker (used as Flags in Step 5 from Siemens) or other outputs are used to deliver this output. In case outputs or merker from other networks or other function blocks are used, these should be noted using brackets in the used formula. This allows expressing the dependency between the distinct modules. For the software quality, these formulas are used to count the number of outputs and merker. This gives a measure of how far dependency on the individual outputs from each other (cf. Example shown in <xref ref-type="fig" rid="fig4">Figure 4</xref>).</p><fig id="fig4"  position="float"><label><xref ref-type="fig" rid="fig4">Figure 4</xref></label><caption><title> Program example</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x14.png"/></fig><p>Network 1:</p><disp-formula id="scirp.53320-formula161"><graphic  xlink:href="http://html.scirp.org/file/7-7900375x15.png"  xlink:type="simple"/></disp-formula><p>Network 2:</p><disp-formula id="scirp.53320-formula162"><graphic  xlink:href="http://html.scirp.org/file/7-7900375x16.png"  xlink:type="simple"/></disp-formula><disp-formula id="scirp.53320-formula163"><graphic  xlink:href="http://html.scirp.org/file/7-7900375x17.png"  xlink:type="simple"/></disp-formula><p>After the replacement of A2.5 in A2.4 and A2.6 the Formula for A2.4 become as follows. From the Formula of A2.4 it shows that the output depends on the input variables E6.1; E6.0; E0.2. It is clear that network 2 depends on network 1. The output A2.6 is expressed only one time in the formula which means that the reset condition is not available for this output.</p><disp-formula id="scirp.53320-formula164"><graphic  xlink:href="http://html.scirp.org/file/7-7900375x18.png"  xlink:type="simple"/></disp-formula></sec><sec id="s3_2"><title>3.2. Dependency Analysis through Program Slicing</title><p>In order to prove properties in a program, it is useful to look at only the part of the program i.e. slice, which causes these properties. This slice is then converted into a model in a type of dependency graph ‎ [<xref ref-type="bibr" rid="scirp.53320-ref14">14</xref>] . This graph corresponds to the data flow graph, which additionally edges for paths of all conditions to directly controlled instructions whose execution depends directly on the evaluation of the considered condition inserted [<xref ref-type="bibr" rid="scirp.53320-ref13">13</xref>] - [<xref ref-type="bibr" rid="scirp.53320-ref15">15</xref>] . This provides information on cause-effect relationships in an observed section of the program.</p><p>There are two types of a slicing along a dependency graph. The backward slicing, which describes the instructions influence a value under consideration. In a dependency graph all paths that refer to a variable and enter the node are considered. Through this method, irrelevant parts of the program can be hidden during debugging. The forward slicing, describes which instructions are influenced by an observed value. In a dependency graph, all the paths that define a variable in out of a node are considered. Through this slice method the consequence modifications of the program can be estimated ‎ [<xref ref-type="bibr" rid="scirp.53320-ref16">16</xref>] and [<xref ref-type="bibr" rid="scirp.53320-ref17">17</xref>] .</p><p>The following summarizes the information available when applying the slicing method:</p><p> Instructions, which may affect the value of a variable at a certain location under consideration;</p><p> Involved variables and data flows;</p><p> Control influences ‎ [<xref ref-type="bibr" rid="scirp.53320-ref6">6</xref>] .</p><p>This method shows the dependence of variables has been already transferred to the ladder diagram of PLC in [<xref ref-type="bibr" rid="scirp.53320-ref18">18</xref>] . In this work an algorithm is used to translate the program step by step into a time-machine model by which each conditional statement are assigned to two transitions. The first time automata represent the fulfillment of the condition, which then leads to the next instruction. Other transition is required, if the condition is not satisfied, a negative transition. This then leads directly to the final state of the automaton.</p><p>As an application of slicing, data dependency and control can be analyzed on the PLC program. Data dependence and control dependence are known in the literature in terms of the Control Flow Graph (CFG) of a program. CFG is a representation using graph notation which contains nodes representing a basic block without jumps and control predicate in the program, an edge connecting two nodes together which represents the possible flow from former node to another ‎ [<xref ref-type="bibr" rid="scirp.53320-ref19">19</xref>] . Special nodes are used in the CFG to represent the starting and the end of the program labeled START and STOP respectively. The sets of the DEF (i) and REF(i) are used to represent the sets of defined and referenced variables. CFG is used to express several types of dependencies, i.e. flow dependence, control dependence, output dependence and etc. Flow dependence takes place when an instruction depends on the previous instruction, while control dependence occurs when an instruction depends on a preceding instruction to be executed or not.</p><p>Program Dependence Graph (PDG) [<xref ref-type="bibr" rid="scirp.53320-ref20">20</xref>] [<xref ref-type="bibr" rid="scirp.53320-ref21">21</xref>] as a slicing methods is used for the reachability. This method can be also applied on the PLC program. PDG is a directed graph with vertices corresponding to statements and control predicates, and edges corresponding to flow and control dependences.</p><p>To be able to use these methods of dependency on the PLC program, it should be written on a high level language i.e. Structured Text (ST). Otherwise, if the program is written in IL or any other low level language the Program has to be abstracted first. The abstraction can be applied using the methods and algorithms introduced in ‎ [<xref ref-type="bibr" rid="scirp.53320-ref22">22</xref>] and ‎ [<xref ref-type="bibr" rid="scirp.53320-ref23">23</xref>] . The depicted code in <xref ref-type="fig" rid="fig5">Figure 5</xref> is used to apply the slicing dependency. The program is abstracted using the methods introduced in ‎ [<xref ref-type="bibr" rid="scirp.53320-ref22">22</xref>] and ‎[<xref ref-type="bibr" rid="scirp.53320-ref23">23</xref>] (cf. <xref ref-type="fig" rid="fig6">Figure 6</xref>). <xref ref-type="fig" rid="fig7">Figure 7</xref> expresses the CFG, where the edges from the IF conditions to the successive nodes are control dependent, whereas the remaining edges in the figure are flow dependent. <xref ref-type="fig" rid="fig8">Figure 8</xref> elucidates the PDG where thick edges represent control dependence and thin edges represent flow dependencies.</p><p>The following table briefly summarizes the evaluation of the measures presented above and shows their applicability to IL PLC programs (cf. <xref ref-type="table" rid="table2">Table 2</xref>).</p><fig id="fig5"  position="float"><label><xref ref-type="fig" rid="fig5">Figure 5</xref></label><caption><title> PB program as IL in Step 5</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x19.png"/></fig><fig id="fig6"  position="float"><label><xref ref-type="fig" rid="fig6">Figure 6</xref></label><caption><title> Abstraction of the PB program</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x20.png"/></fig><fig id="fig7"  position="float"><label><xref ref-type="fig" rid="fig7">Figure 7</xref></label><caption><title> Control flow diagram</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x21.png"/></fig><table-wrap id="table2" ><label><xref ref-type="table" rid="table2">Table 2</xref></label><caption><title> Evaluation of the dynamic and semantic measures (+ = good; 0 = fair, − = bad)</title></caption><table><tbody><thead><tr><th align="center" valign="middle" >Measure</th><th align="center" valign="middle" >Software feasibility</th><th align="center" valign="middle" >Applicability to IL</th><th align="center" valign="middle" >Significance for diagnosability</th></tr></thead><tr><td align="center" valign="middle" >Formulas</td><td align="center" valign="middle" >0</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >++ (Depending on the variables)</td></tr><tr><td align="center" valign="middle" >Slicing</td><td align="center" valign="middle" >-</td><td align="center" valign="middle" >+</td><td align="center" valign="middle" >+ (Depending on the state of the variables)</td></tr></tbody></table></table-wrap><fig id="fig8"  position="float"><label><xref ref-type="fig" rid="fig8">Figure 8</xref></label><caption><title> Program flow diagram</title></caption><graphic mimetype="image"   position="float"  xlink:type="simple"  xlink:href="http://html.scirp.org/file/7-7900375x22.png"/></fig></sec></sec><sec id="s4"><title>4. Conclusions and Outlook</title><p>To allow easy diagnosis in the case of failures in a production system automated by PLCs, the quality of the PLC software considered is a crucial factor. As a by-product of the measures calculation several dependence relations can by visualized. It is expected that this will help an engineer in performing the diagnosis task.</p><p>The metrics most commonly used nowadays only examine the structure of a program, where it eases the application to the respective programs, as well as on the PLC IL program. They can be implemented directly and provide a rough guideline for the quality of the program. However, the significance of the diagnostic capability with respect to a program could be considered a drawback. It is very difficult, for example, from the length of the code to infer the degree of difficulty of the code.</p><p>It is quite different with metrics that focus on the code dynamics. These try to present the relations between individual modules or variables, and thereby find out the complexity of a program. Applying for example the formulas on the PLC, the dependence of the variable, or better expressed: the dependence of the output are determined by the inputs. This gives a better indication than standard metrics, but this is much more difficult to accomplish, because of the effort needed to express the formulas.</p><p>The semantic metrics dedicated through the building of the formulas which represent the dependency between the outputs and the inputs in the PLC are investigated. After the building and structuring of all formulas these can be merged together to allow finding the final expressions related to the PLC outputs.</p><p>The dependency analysis as a new metric was performed and presented. This analysis explained the best way the variables are changed in a program. In this metric, the dependencies of the entire program were formed. However, these were devoid of information content.</p><p>In the next steps, especially the dependency analysis should be further investigated and implemented since through them the best statements about the diagnosability of PLC IL program could be made. Here the focus should be mainly on the slicing, which represents a simplification of the dependence graph by considering only relevant variables for the problem. Once there is an appropriate implementation of the algorithms, it is important to investigate how these models can be used by the inclusion of data models of real plant data for online diagnosis.</p></sec></body><back><ref-list><title>References</title><ref id="scirp.53320-ref1"><label>1</label><mixed-citation publication-type="other" xlink:type="simple">Lunze, J. and Schr&amp;oumlder, J. (2001) State Observation and Diagnosis of Discrete-Event Systems Described by Automata. Discrete Event Dynamic Systems—Theory and Applications, 11, 319-396.</mixed-citation></ref><ref id="scirp.53320-ref2"><label>2</label><mixed-citation publication-type="other" xlink:type="simple">Papadopoulus, Y. and McDermid, J. (2001) Automated Safety Monitoring: A Review and Classification of Methods. International Journal of Condition Monitoring and Diagnostic Engineering Management, 4, 14-32.</mixed-citation></ref><ref id="scirp.53320-ref3"><label>3</label><mixed-citation publication-type="other" xlink:type="simple">Sampath, M., Sengutpa, R., Lafortune, S., Sinnamohideen, K. and Tenekeztis, D. (1996) Failure Diagnosis Using Discrete Event Models. IEEE Transactions on Control Systems Technology, 4, 105-124.  
http://dx.doi.org/10.1109/87.486338</mixed-citation></ref><ref id="scirp.53320-ref4"><label>4</label><mixed-citation publication-type="other" xlink:type="simple">Bani Younis, M. (2006) Re-Engineering Approach for PLC Programs Based on Formal Methods. Dissertation, University of Kaiserslautern, Kaiserslautern.</mixed-citation></ref><ref id="scirp.53320-ref5"><label>5</label><mixed-citation publication-type="other" xlink:type="simple">H&amp;oumlcker, H., Itzfeld, W.D., Schmidt, M. and Timm, M. (1994) Comparative Descriptions of Software Quality Metrics. GMD-Studien Nr. 81, GMD, Bonn.</mixed-citation></ref><ref id="scirp.53320-ref6"><label>6</label><mixed-citation publication-type="other" xlink:type="simple">Kann, S.H. (2003) Metrics and Models in Software Quality Engineering. 2nd Edition, Addison Wesley Professional.</mixed-citation></ref><ref id="scirp.53320-ref7"><label>7</label><mixed-citation publication-type="other" xlink:type="simple">Halstead, M.H. (1977) Elements of Software Science. Elsevier, New York.</mixed-citation></ref><ref id="scirp.53320-ref8"><label>8</label><mixed-citation publication-type="other" xlink:type="simple">McCabe, T. (1976) A Complexity Measure. IEEE Transactions on Software Engineering, SE-2, 308-320.  
http://dx.doi.org/10.1109/TSE.1976.233837</mixed-citation></ref><ref id="scirp.53320-ref9"><label>9</label><mixed-citation publication-type="other" xlink:type="simple">Frey, G. (2002) Software Quality in Logic Controller Design. Proceedings of the IEEE SMC 2002, Tunisia, 6-9 October 2002, 515-520.</mixed-citation></ref><ref id="scirp.53320-ref10"><label>10</label><mixed-citation publication-type="other" xlink:type="simple">Dandachi, A., Lohmann, S. and Engell, S. (2007) Complexity of Logic Controllers. Preprints of 1st IFAC Workshop on Dependable Control of Discrete Systems, Cachan, 13-15 June 2007, 279-284.</mixed-citation></ref><ref id="scirp.53320-ref11"><label>11</label><mixed-citation publication-type="other" xlink:type="simple">Lucas, M. and Tilbury, D. (2002) Quantitative and Qualitative Comparisons of Plc Programs for a Small Testbed. Proceeding of the American Control Conference, Alaska, 8-10 May 2002, 4165-4171.</mixed-citation></ref><ref id="scirp.53320-ref12"><label>12</label><mixed-citation publication-type="other" xlink:type="simple">Wang, R., et al. (2013) Component-Based Formal Modeling of PLC Systems. Journal of Applied Mathematics, 2013, Article ID: 721624.</mixed-citation></ref><ref id="scirp.53320-ref13"><label>13</label><mixed-citation publication-type="other" xlink:type="simple">Bani Younis, M. and Frey, G. (2007) Software Quality Measures to Determine the Diagnosability of PLC Applications. Proceedings of the of the 12th IEEE International Conference on Emerging Technologies and Factory Automation, Patras, 25-28 September, 368-375.</mixed-citation></ref><ref id="scirp.53320-ref14"><label>14</label><mixed-citation publication-type="other" xlink:type="simple">Horwitz, S., Reps, T. and Binkley, D. (1990) Interprocedural Slicing Using Dependence Graphs. ACM Transactions on Programming Languages and Systems, 12, 26-60. http://dx.doi.org/10.1145/77606.77608</mixed-citation></ref><ref id="scirp.53320-ref15"><label>15</label><mixed-citation publication-type="other" xlink:type="simple">Weiser, M. (1979) Program Slices: Formal, Psychological, and Practical Investigations of an Automatic Program Abstraction Method. Ph.D. Thesis, University of Michigan, Ann Arbor.</mixed-citation></ref><ref id="scirp.53320-ref16"><label>16</label><mixed-citation publication-type="other" xlink:type="simple">Weiser, M. (1982) Programmers Use Slices When Debugging. Communications of the ACM, 25, 446-452.  
http://dx.doi.org/10.1145/358557.358577</mixed-citation></ref><ref id="scirp.53320-ref17"><label>17</label><mixed-citation publication-type="other" xlink:type="simple">Weiser, M. (1984) Program Slicing. IEEE Transactions on Software Engineering, 10, 352-357.  
http://dx.doi.org/10.1109/TSE.1984.5010248</mixed-citation></ref><ref id="scirp.53320-ref18"><label>18</label><mixed-citation publication-type="other" xlink:type="simple">Zoubek, B., Roussel, J.-M. and Kwiatkowska, M. (2003) Towards Automatic Verification of Ladder Logic Programs. Proceedings of IMACS-IEEE CESA’03 Computational, Engineering in Systems Applications, Lille, 9-11 July 2003, 6 p.</mixed-citation></ref><ref id="scirp.53320-ref19"><label>19</label><mixed-citation publication-type="other" xlink:type="simple">Tip, F. (1994) A Survey of Program Slicing Techniques. Journal of Programming Languages—JPL, 3.</mixed-citation></ref><ref id="scirp.53320-ref20"><label>20</label><mixed-citation publication-type="other" xlink:type="simple">Kuck, D.J., Kuhn, R.H., Padua, D.A., Leasure, B. and Wolfe, M. (1981) Dependence Graphs and Compiler Optimizations. Conference Record of the 8th ACM Symposium on Principles of Programming Languages, New York, 207-218.</mixed-citation></ref><ref id="scirp.53320-ref21"><label>21</label><mixed-citation publication-type="other" xlink:type="simple">Ferrante, J., Ottenstein, K.J. and Warren, J.D. (1987) The Program Dependence Graph and Its Use in Optimization. ACM Transactions on Programming Languages and Systems, 9, 319-349. http://dx.doi.org/10.1145/24039.24041</mixed-citation></ref><ref id="scirp.53320-ref22"><label>22</label><mixed-citation publication-type="other" xlink:type="simple">Bani Younis, M. and Frey, G. (2005) Formalization and Visualization of Non-Binary PLC Programs. Proceedings of the 44th IEEE Conference on Decision and Control (CDC 2005) and European Control Conference (ECC 2005), Seville, 12-15 December 2005, 8367-8372.</mixed-citation></ref><ref id="scirp.53320-ref23"><label>23</label><mixed-citation publication-type="other" xlink:type="simple">Frey, G. and Bani Younis, M. (2004) A Re-Engineering Approach for PLC Programs using Finite Automata and UML. Proceedings of 2004 IEEE International Conference on Information Reuse and Integration, IRI-2004, Las Vegas, 8-10 November, 24-29.</mixed-citation></ref></ref-list></back></article>