Overview
UML: general information
Unified Modeling Language (UML) is a graphical language that can be used for software analysis, design and documentation. UML is particularly suitable for object-oriented implementations. The unified modelling of the PLC application creates an easy-to-follow software documentation that can also be analyzed and discussed by departments other than the Software Development Dept.
Diagram categories
Some of the UML diagrams can be categorized as structure diagrams, others as behavior diagrams. Structure diagram are mainly used for static modelling and analysis, since they represent the software architecture schematically. Behavior diagrams are used for dynamic modelling. They are executable models, from which program code can be generated directly.
UML in TwinCAT 3.1 PLC
With the integration of UML (Unified Modelling Language) in TwinCAT 3.1, two additional editors for modelling of PLC software are available. The existing TwinCAT PLC programming languages are extended by the UML classes and the UML Statechart.
- : the functionality of the object UML class diagram
- : Programming a POU in the implementation language UML Statechart
UML class diagram
The UML class diagram belongs to the group of UML structure diagrams and can be used for schematic representation of the software architecture. In this way it is possible to represent object classes and the elements contained within them, as well as object relationships in a transparent manner.
UML Statechart
The UML Statechart is part of the UML behavior diagrams and is used for dynamic software modeling. It can be used for a graphic specification of the dynamic response or the state-dependent system behavior. Compilation of the statechart generates program code, so that the state machine can be executed directly. The development process is supported by an online debugging option.
Advantages
There are many advantages to using UML diagrams for the analysis, design and/or documentation of software. The essential aspects are covered in the following points:
- First of all, a graphic illustration that doesn't focus on technical details offers a good overview with which to check software requirements before the implementation. This avoids an incomplete or erroneous implementation of the application.
- The development of a well-conceived software architecture is greatly supported by the graphic illustration of the control code. Such an architecture forms the basis for the simple and goal-oriented implementation of even complex systems or requirements. Furthermore, a well-conceived software architecture can contribute towards the development of autonomous modules that can be reused, saving time and costs. In general, a well-planned software leads as a rule to fewer programming errors and thus to a higher code quality.
- Graphic access to the software facilitates maintenance and debugging.
- An generally understandable documentation of the software is usually created with the help of UML diagrams. On the one hand this can be used as a coordination tool in the development team, for example to exchange ideas and concepts or to define requirements. On the other, UML diagrams can be used to illustrate the control application to other technology specialists, for example mechanical engineers or process technicians.