Object-oriented programming

TwinCAT 3 supports object-oriented programming (OOP) and provides the following functionalities and objects for this purpose:

Basic idea of object-oriented programming

In object-oriented programming, the software is divided into objects. All descriptions relating to an object are combined in one element (a function block, for example). The descriptions include the data and the procedures associated with the object. In addition, an access interface to the object can be defined via methods and properties.

As a result, this programming approach develops objects that can be reused autonomously and independent of specific conditions. The elements can be used without modification in one or many applications.

Advantages of object-oriented programming

Object-oriented programming method offers many advantages.

By dividing the software into objects, a clear, well structured application can be developed. Thus, the application and the individual elements are easily understandable and easy to expand. The reusability of programming objects saves time and costs in the development and maintenance of applications.

General notes/recommendations

OOP and UML

Does object-oriented programming (OOP) and UML always have to be used together?

What are the benefits of using OOP and UML together?

See also: