
Bachelor Degree Project Priority automation engineering Evaluating a tool for automatic code generation and configuration of PLC-Applications 2018/09/15 Author: Christofer Nguyen Supervisor: Welf Löwe Examiner: Jesper ANDERSSON Semester: HT 2018 Subject: Computer Science Abstract This research explores the Automation Interface created by Beckhoff through intro- ducing a compiler solution. Today machine builders have to be able to build ma- chines or plants in different sizes and provide many variations of the machine or plant types. Automatic code generation can be used in the aspect to reuse code that has been tested and is configurable to match the desired functionality. Additionally, the use of a pre-existing API could potentially result in less engineering resources wasted in developing automatic code generation. This thesis aims to evaluate the Automation Interface (AI) tool created by Beckhoff. This is accomplished through means of incorporating the API functions into a compiler solution. The solution is designed to export the information required through an XML-file to generate PLC- applications. The generated PLC-code will be in Structured Text. In order to cre- ate a functional PLC-application, the construction of software requirements and test cases are established. The solution is then validated by means of generating a data- logger to illustrate the usage. The exploratory research revealed both the benefits and cons of using AI to a compiler solution. The evaluation indicated that the Au- tomation Interface can reduce engineering effort to produce a compiler solution, but the learning curve of understanding the underlying components that work with the API required a great deal of effort. Keywords: PLC, Structured Text, Industrial Controllers, Beckhoff, TwinCat, Automation, Automatic Code Generation, Compiler, Visual Studio, API, Eval- uation Preface The thesis is conducted at the Nuremberg Campus of Technology – Research Cooperation of University of Erlangen-Nürnberg and Nuremberg Tech. I would like to thank the fol- lowing people for guiding me throughout the experience of doing my bachelor research abroad. Welf Löwe who has been my supervisor, provided me with very helpful sessions, in both discussion and feedback, even though at the time of this research I was in Ger- many which makes the communication a lot more difficult to handle. Michael Dietz who had been my researcher who provided me with the bachelor topic. Throughout the whole research, both Michael Dietz and I have been discussing and working together. He has been very supportive and open during the time I have spent in the research institute. Contents 1 Introduction1 1.1 Related work................................1 1.2 Problem formulation............................1 1.3 Motivation..................................2 1.4 Expected Result...............................2 1.5 Scope/Limitation..............................3 1.6 Target group.................................3 1.7 Outline...................................3 2 Method4 2.1 Design Science...............................4 2.1.1 Creating awareness of the problem.................5 2.1.2 Suggestion of a solution to the problem..............5 2.1.3 Developing the artifact.......................6 2.1.4 Evaluation.............................6 3 Background7 4 Tentative Design 12 4.1 User requirement.............................. 12 4.2 Software Requirement Specification.................... 13 4.3 Design Strategy............................... 14 4.4 Design Pattern................................ 14 4.5 Constraints................................. 15 4.6 Testing Requirement............................ 15 5 Artifact 16 6 Artifact 16 6.1 Caliburn Micro - MVVM Framework................... 16 6.2 Model - Business logic........................... 17 6.2.1 TCProjectModel.......................... 17 6.2.2 UtilityModel............................ 22 6.3 View – GUI................................. 23 6.4 View Model - UI Data........................... 26 6.4.1 TCProjectViewModel....................... 26 6.5 System Testing............................... 26 6.5.1 Test Cases.............................. 26 6.5.2 Test Process............................. 27 6.6 Summary.................................. 28 7 Evaluation and Analysis 29 7.1 Compiler Solution.............................. 29 7.1.1 Estimated Amount of Time..................... 29 7.1.2 Data Logger............................ 30 7.2 Beckhoff Automation Interface....................... 32 7.2.1 Advantages and Disadvantages................... 32 7.3 Research Questions............................. 33 8 Conclusion 35 8.1 Future work................................. 35 References 36 A Appendix 1A A.1 Work flows.................................A A.2 Functional and Non-Functional Requirements...............B A.3 Test Cases..................................D A.4 Test Result.................................H A.5 API Guideline................................H A.6 XML Rules.................................I A.7 Time Log..................................K 1 Introduction Industrial control systems are used to control physical devices through control logics. This is achieved through using programmable logic controllers (PLC), dedicated I/O devices, and communication systems. Today many of the automated manufacturing systems use PLCs as control units. The success in PLCs has made it widely used for control and automation of machines and processes. This also means that the quality of the PLC- code has a direct impact on the production efficiency. The PLC-code is becoming more sophisticated and changing rapidly. Automatic code generation can be applied to meet the challenges of generating PLC-applications. Creating such a solution, however, can require a lot of engineering effort and be resource demanding. The main contribution of this thesis is to evaluate a tool for automatic code generation known as the "Automation Interface" (AI). 1.1 Related work Simulink is one of the more renown tools within the field of automation. By using the PLC coder in Simulink it can generate IEC 61131-3 structured text from Simulink models or stateflow charts, that are compatible with most PLC environments [1]. The disadvan- tage of using the Simulink models for generating ST code according to [1] is the loss of the graphical structure of the model during conversion. When it comes to using stateflow charts according to [2] the semantics are complex and hard to understand, it is not adapted for PLC domains. Another approach for the generation of PLC code is through a general purpose modeling language. Vogel-Heuser [3] researched UML models to produce auto- matic code generation for IEC 61131-3 ST. The downside stated by [3] is its applicability in real practice and lack of backpropagation. From another perspective, Daniel Darvas et al. [2] tried implementing the automatic generation of ST code using the formal lan- guage PLCspecif. According to the research, the implementation is yet to be finished. The concept of utilizing code generation in the PLC-world is nothing new, there are many variations and different approaches to automatic code generation of PLC-applications. However, many of the research works are dedicated towards evaluating finished code generators, and not much is devoted to evaluating the engineering tools, which are used to develop the solutions. This is where this study will differ, as the focus is on evaluating the Automation Interface. 1.2 Problem formulation The development of PLC applications can be time-consuming and highly resource-demanding. To help this, PLC applications could be generated from high-level descriptions. There are few tools available in the PLC-world to help developers to create such PLC code gen- erators. The present thesis introduces such a tool known as Automation Interface as a possible solution to decrease the development effort of creating automatic code genera- tion. It contains a variety of functionalities that can be applied to automatically create and manipulate PLC-applications that can be executed in the TwinCAT simulation environ- ment. In addition, to hide the complexity of the Automation Interface, the study suggest to introduce a compiler solution that can generate PLC applications from a high-level architectural and application description in the form of an XML data-format. It rests on an application programming interface (API) that the Automation Interface provides. 1 The purpose of this project is to reveal whether applying the Automation Interface, that will be wrapped with the compiler solution, could reduce development efforts without hampering the PLC-users experience or even improving the experience. While this ques- tion generally applies for PLC development, the present thesis only assesses a vendor- specific toolchain, the TwinCAT environment, the Automation Interface, and the compiler solution. The target PLC language used in this research will be IEC 61131-3 ST. To achieve the purpose, the following research questions will be answered: • R1 - How useful will the Automation Interface prove to be in the compiler solution? • R2 - Will the proposed solution help to improve the PLC experience, in terms of simplicity and ease of use, while retaining flexibility? 1.3 Motivation The Industrial PLCs are designed so that engineers with little background knowledge within computer programming can operate them [4]. There are not many PLC users who have a computer science background. According to [5] in real practice much of the PLC programs
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages56 Page
-
File Size-