Font Size: a A A

A Tool Of Specification Guiding And PLC Program Generation Based On Real-time Specification Patterns System

Posted on:2020-12-12Degree:MasterType:Thesis
Country:ChinaCandidate:H B XuFull Text:PDF
GTID:2428330620955830Subject:Software engineering
Abstract/Summary:PDF Full Text Request
Programmable Logic Controller(PLC)is a kind of reactive systems widely used in the field of industrial control.At present,practitioners mainly write PLC programs based on personal experience.It is difficult to avoid the requirement and code errors.To solve this problem,this paper tries to improve the reliability of reactive systems from two aspects: system specification description and automatic code generation.Using formal natural language to describe system requirements can greatly improve the readability and accuracy of requirements in the development process.Specification Patterns System(SPS)proposed by Matthew B.Dwyer et al.analyses and summarizes common scenarios in reactive systems,extracts specification patterns,and describes scenarios in a form close to natural language.SPS has a strong ability in temporal property expression.However,current researches on PLC with real-time properties are still not perfect and lack practical value.In the field of PLC code generation,most of the existing methods require the system to be manual modeled beforehand,which makes it difficult for PLC practitioners who do not have relevant experience.In some other methods,although PLC program can be automatically generated according to the formal specifications by model checking and game theory,the program is exponential in scale,and does not conform to the development habits of PLC practitioners,can hardly be understood and maintained.It has poor practical value.This paper analyses and summarizes practical cases of PLC system,extracts the patterns appearing in real-time control,modifies and expands SPS with them,and proposes a new protocol mode system SPS4PLC(Specification Patterns System for PLC).SPS4 PLC uses nearly natural language and has the ability to describe specifications of the PLC systems containing real-time control requirements.In this paper,the grammatical definition,semantic interpretation of SPS4 PLC are given,and a Question Tree is provided to guide users to choose the correct pattern interactively.This paper presents a method of code generation from SPS4 PLC specifications to PLC program.In view of each mode of SPS4 PLC,this paper presents a program generation rule which comforms to the habit of PLC practitioners,and is used to generate a PLC program fragment of a single specification.Then,through combination rules,complex states,the dependencies relationship,conflict and priorities of specifications are processed to generate a complete PLC program that meets the system requirements.For the generation and combination rules of PLC program,this paper gives the proof of correctness.This paper designs and implements SpsToPlc,a tool for PLC program generation.Based on SPS4 PLC specifications,it can generate PLC instruction list code,eliminate conflicts in the process of generating,and provide guidance for specification writing.Through the analysis of control requirements in a large number of practical cases,we find that SPS4 PLC has good expressive ability in practical application.Through appropriate pattern selection and use of combination state,it can express the typical cases of Boolean quantity control and real-time control in the PLC textbooks we refer to.The IL code generated by SpsToPlc,a tool for generating PLC programs,meets the requirements of the system described in the specifications,and conforms to the writing habits of PLC practitioners,so it has strong practicability.
Keywords/Search Tags:Programmable Logic Controller, Specification Patterns System, code generation, realtime, specification guiding
PDF Full Text Request
Related items