Units of values are very important, but also easy to screw up. The F# programming language found a nice solution to this problem. Because units are all over the place in an average PLC project, I started to think about how to replicate this behavior in TwinCAT. Eventually I found a method which gives compiler errors if the wrong units are used.
When you’re developing PLC code it can be difficult to test the behavior of the whole code, due to all the disconnected in and outputs. A colleague of mine found a nice solution how you can create a digital twin of the real machine. The digital twin then simulates the behavior of the real one. In this article I’ll show you how you can do this with a simple oven project.
My parents bought a new fridge a few years ago. After the first year the energy bill came in and it was drastically lower then the year before. A large part of the energy saving came from the new fridge. As I started to look into the savings, I learned some interesting developments in the household appliances sector.
A lukewarm semi-fresh, semi-fried summer starter dish.
Source control is essential when you’re developing software. However, there is little information online on how to do it properly for TwinCAT projects. In this post I’ll share some tips and tricks I picked up along the way. The main focus will be git, but many points apply to other source control systems as well.
I was wondering if overloading functions in TwinCAT was possible, but I found out that this is not the case. I did however realize that overloading is possible using a few work-arounds. In this article I’ll show how to mimic this behavior with extended structs.
Use this easy wok sauce to make a quick (vegan) meal which tastes great!
The other day I answered a question on StackOverflow on how to unit test code from a separate project. To increase its exposure I also added it here.
I don’t eat too much meat these days and one of the things I really miss is a good bolognese sauce. Since bolognese revolves so much around meat, it is not easy to veganize. However, I now found a really great alternative, mostly based on a recipe by J. Kenji López-Alt.
Recently I was coding up a new function block and passed another function block by reference to it. Somewhere I forgot to check if the reference was valid before using it and 💥 Page Fault! After some thinking I came up with a few solutions how this can be prevented and even how you could catch mistakes like this at compile time instead of during run time. Let me show you what I did.
Let’s be real, tofu on its own is the not most exciting thing. Recently however, we made a recipe where the tofu was really good! Let me share it with you.
Not many things can beat the taste and smell of a freshly baked bread. Unfortunately this fresh-bake taste quickly disappears and the texture becomes worse with time. After day two, the bread is nothing like it was when you bought it. Luckily you can bring it back to (almost) its new state with a simple trick!
In an earlier article I introduced the PLC part of the TwinCAT EventLogger and showed some useful features. In this article I will go into the details on how to visualize the events using TwinCAT’s web-based HMI (TE2000).
Mijn moeder noemde het altijd slaap, mijn vriendin kladjes en een vriend kwam laatst met oogpitjes. Om erachter te komen of er nog meer woorden voor waren, plaatste ik een oproep op Reddit. Ik was verbaasd over de grote verscheidenheid aan termen voor dit fenomeen!
Keeping track of all the things which are happening on your machine can be a daunting task. Whether it’s expected events or unexpected warnings and errors of which you want to inform the user. Luckily Beckhoff provides us with a tool which can help with that, namely the EventLogger. In this article I will introduce the PLC part of the EventLogger and show some useful features (code: PlcPart). A second article will show how to visualize the events using TwinCAT’s web-based HMI (TE2000) (code: HmiPart).
During the first Corona wave in March-April 2020 I noticed that was very little cloud cover in Switzerland and the Netherlands. Then I remembered this article where they saw similar effects after 9/11. So I collected weather data and crunched the numbers to see if it was just me or if it really was more sunny than usual.
In this article I want to highlight a useful and relatively new TwinCAT feature: Stand-alone PLC projects. As usual, Beckhoff’s InfoSys provides a good explanation on how to set-up and run such a project from scratch. However, there is relatively little information on why the separation might be a good idea, how to separate an existing project and some of the pitfalls you might encounter.
Recently I came across an article where the authors used a relatively simple model to forecast the total installed wind and solar power. I decided to do a similar analyses for the electric vehicle market.