2 Simple machine

This "UML class diagram" sample illustrates the basic functionality of the UML class diagram based on a machine with object-oriented programming.

2 Simple machine 1:

Note that the modules have not been functionally implemented. The sample is designed to describe the functionalities of the UML class diagram and to demonstrate them using an exemplary program structure.

With the help of the class diagram, the structure of a PLC program can be created, extended and modified.
In addition, as in this sample, the structure of a PLC program can be documented with the help of the class diagram and easily understood on the basis of this graphic.

Sample project: TF1910_UmlCD_Sample2_SimpleMachine.zip

Machine modules

The application has the following levels and modules.

Machine level: machine (FB_Machine)

Subsystem level: ejection (FB_Ejector)

Submodule level: cylinder with or without hardware feedback signal (FB_Cylinder, FB_CylinderFeedback)

Inheritance

Since all these function blocks have common features (common data and functionalities), a base class is provided where these common features are implemented once for all function blocks. These implementations are passed on to the subclasses via the inheritance mechanism offered by object-oriented programming.

Furthermore, the cylinder with feedback functionality represents an extension of the cylinder without this functionality. Therefore, inheritance is also used here.

Interface

To define the requirements for different cylinder types, the basic methods and properties that a cylinder must provide are defined in an interface.

Instantiation