Recently a user on the LinkedIn TwinCAT forum shared and example how to use the RowClassesProvider. When I tried the example and went looking for the documentation, there was none to be found! On the whole internet, there is one (1!) example which sort of shows the function. In this post I will show what the RowClassesProvider does and how you can use it to dynamically color data grids.
Over the years I’ve come across some features of TwinCAT or programming in general which can improve your code or your coding experience. Read on to level up your TwinCAT game in 2022!
Since a few years it is a tradition under programmers and puzzle enthusiasts to take part in Advent of Code. Puzzles are posted each day from the 1st of December until the 25th of December. The people of the internet try to solve them as quick as possible and their times are published. In this post I compare the time it took the top 100 to solve the puzzles over the years.
When I was a teenager I tracked my body length on the side of my wardrobe. When the wardrobe got trashed, I copied the length markings over on a piece of paper. Recently I found this paper again and decided it would be nice to plot the data. The data processing actually took me on an interesting journey which involved data interpolation and polynomial regression.
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 an essential tool when you’re developing software. Yet, there is little information online on how to do it for TwinCAT projects. In this post, I share some tips and tricks I picked up along the way. The main focus is 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 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.