TwinCAT meets Project Euler

During the latest COVID lock down, scrolling randomly through the internet, I stumbled on Project Euler, a series of mathematical/computer programming problems. So I thought it would be fun to try a few challenges with Structured Text. After completing the first 2 challenges it occurred to me that it might be fun to publish a repo on Github with this project, to see if I can get more people to solve challenges and on the fly creating a lot of mathematical Structured Text example code.

Read More

The ABSTRACT keyword

It was already available in CODESYS, but with the release of TwinCAT 4024 it’s now available in TwinCAT as well: the ABSTRACT keyword. Abstraction and the use of the abstract keyword is common practice in OOP and many higher level languages as C# support this.  It’s often considered as the fourth pillar of OOP. In this post i’ll explain how to use the ABSTRACT keyword in TwinCAT with some practical examples.

Read More

The three pillars of OOP – Inheritance

Pillars

With the object orientated options we’ve got available with IEC 61131-3 last years the time has come to talk about design patterns and best practices in the world of PLC programming. In this series of three posts ‘The three pillars of OOP’ I will explain the concepts of: Encapsulation, Inheritance  and Polymorphism with some examples in TwinCAT. This post is about the second pillar ‘Inheritance’.

Read More

The three pillars of OOP – Encapsulation

Pillars

With the object orientated options we’ve got available with IEC 61131-3 last years the time has come to talk about design patterns and best practices in the world of PLC programming. In this series of three posts ‘The three pillars of OOP’ I will explain the concepts of: Encapsulation, Inheritance  and Polymorphism with some examples in TwinCAT. This post is about the first pillar ‘Encapsulation’.

Read More