Use this URL to cite or link to this record in EThOS:
Title: Application of software engineering tools and techniques to PLC programming : innovation report
Author: Waters, Matthew
ISNI:       0000 0004 2706 9702
Awarding Body: University of Warwick
Current Institution: University of Warwick
Date of Award: 2009
Availability of Full Text:
Access from EThOS:
Full text unavailable from EThOS. Restricted access.
Access from Institution:
The software engineering tools and techniques available for use in traditional information systems industries are far more advanced than in the manufacturing and production industries. Consequently there is a paucity of ladder logic programming support tools. These tools can be used to improve the way in which ladder logic programs are written, to increase the quality and robustness of the code produced and minimise the risk of software related downtime. To establish current practice and to ascertain the needs of industry a literature review and a series of interviews with industrial automation professionals were conducted. Two opportunities for radical improvement were identified; a tool to measure software metrics for code written in ladder logic and a tool to detect cloned code within a ladder program. Software metrics quantify various aspects of code and can be used to assess code quality, measure programmer productivity, identify weak code and develop accurate costing models with respect to code. They are quicker, easier and cheaper than alternative code reviewing strategies such as peer review and allow organisations to make evidence based decisions with respect to code. Code clones occur because reuse of copied and pasted code increases programmer productivity in the short term, but make programs artificially large and can spread bugs. Cloned code can be removed with no loss of functionality, dramatically reducing the the size of a program. To implement these tools, a compiler front end for ladder logic was first constructed. This included a lexer with 24 lexical modes, 71 macro definitions and 663 token definitions as well as a 729 grammar rule parser. The software metrics tool and clone detection tool perform analyses on an abstract sytax tree, the output from the compiler. The tools have been designed to be as user friendly as possible. Metrics results are compiled in XML reports that can be imported into spreadsheet applications, and the clone detector generates easily navigable HTML reports for each clone as well as an index file of all clones that contains hyperlinks to all clone reports. Both tools were demonstrated by analysing real factory code from a Jaguar Land Rover body in white line. The metrics tool analysed over 1.5 million lines of ladder logic code contained within 23 files and 8466 routines. The results identified those routines that are abnormally complex in addition to routines that are excessively large. These routines are a likely source of problems in future and action to improve them immediately is recommended. The clone detector analysed 59K lines from a manufacturing cell. The results of this analysis proved that the code could be reduced in volume by 43.9% and found previously undetected bugs. By removing clones for all factory code, the code would be reduced in size by so much that it could run on as much as 25% fewer PLCs, yielding a significant saving on hardware costs alone. De-cloned code is also easier to make modifications to, so this process goes some way towards future-proofing the code.
Supervisor: Not available Sponsor: Not available
Qualification Name: Thesis (D.Eng.) Qualification Level: Doctoral
EThOS ID:  DOI: Not available
Keywords: QA76 Electronic computers. Computer science. Computer software