Application of software engineering tools and techniques to PLC programming : innovation report
Waters, Matthew, 1980- (2009) Application of software engineering tools and techniques to PLC programming : innovation report. EngD thesis, University of Warwick.Full text not available from this repository.
Official URL: http://webcat.warwick.ac.uk/record=b2521802~S15
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
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.
|Item Type:||Thesis or Dissertation (EngD)|
|Subjects:||Q Science > QA Mathematics > QA76 Electronic computers. Computer science. Computer software|
|Library of Congress Subject Headings (LCSH):||Logic design -- Computer programs, Logic programming languages, Software measurement|
|Official Date:||September 2009|
|Institution:||University of Warwick|
|Theses Department:||School of Engineering|
|Supervisor(s)/Advisor:||Young, Ken W.|
|Extent:||xiv, 156 leaves : ill., charts|
Actions (login required)
Downloads per month over past year