Dear existing & future PLC software developers, I have published part 11 of my free PLC programming using TwinCAT 3 tutorial.

When you start to develop PLC software and you’ve worked for a few projects, you will come to a point where you will notice that certain parts of the software, like function blocks, will be copied between the projects. You’ll either do it by simple rewriting the same functions or function blocks again, or you will simply copy and paste it from one project to another. Also, once a project gets big enough, you will want to utilize something called libraries. With this we can achieve code re-use.

Read more

If you want to write TwinCAT 3 software and run it, it’s not obvious how to get TwinCAT 3 to run on your desktop machine, be it directly on the machine or inside a virtual machine. The primary reason for this is because TwinCAT 3 is running in something called kernel space. While I was bored recently on a late afternoon, I discovered that Beckhoff had quietly added some files in the TwinCAT 3 folder in one of the newer releases of TwinCAT 3, that might change all of this.

How you may wonder? Let’s find out!

Read more

Dear existing & future PLC software developers, I have published part 10 of my free PLC programming using TwinCAT 3 tutorial.

When designing and building a control system you will eventually want the control system to actuate something, be it a relay, a motor, a pneumatic system or maybe a complete 6-axis robot. To get feedback of the actuation, sensors are needed. In this part we will cover how we communicate with the environment using inputs and outputs.

Read more

Dear developers,

this year there have been a lot of changes, and I guess the end of the year is a time for reflection. This year I have (once again) moved from Sweden to Germany for new opportunities. Every opportunity usually brings its challenges. Moving abroad is always a challenge, and I wouldn’t be honest if I didn’t say that I miss Sweden every day. This blog and my YouTube channel have been one way for me to think of something else than home.

Read more

One of the most anticipated products that Beckhoff has released this year is TwinCAT/BSD, which is Beckhoff’s new operating system which is an alternative to Windows for the PLCs. Did you ever want to play around/learn TwinCAT/BSD, but don’t want to spend the money to buy a PLC with it pre-installed? No worries, it’s entirely possible to run it fully virtualized in a virtual machine. Not only that, it’s also possible to run your TwinCAT 3 software in that virtual machine! I’ve created a step-by-step tutorial where I will show how you can run it locally on your PC. Start the video to join me on an adventure & let’s have some fun!

Read more

One of the things that have annoyed me ever since I started using TwinCAT is the fact that if you create an enumeration, it will automatically have a global scope. It will be accessible from all functions and function blocks. What’s even worse is that if you create a library project with an enumeration and include that library in another project, the enumeration will be visible there, too. This pollutes the namespace by creating unnecessary types. But no more.

Read more

Dear existing & future PLC software developers, I have published part 9 of my free PLC programming using TwinCAT 3 tutorial.
In this part we’ll learn how to use one of the most used Beckhoff libraries for various purposes. We’ll learn how to measure execution time of PLC code, how to use a FIFO buffer and how to combine the power of using a TwinCAT real-time program with an application running in user-space (Windows).

Read more

Dear existing & future PLC software developers, I have published part 8 of my free PLC programming using TwinCAT 3 tutorial.

As TwinCAT 3 conforms to the IEC61131-3 standard, there are certain things it has to be able to do. The Tc2_Standard library has many of the standard IEC functions such as timers and triggers, which we will look into in this part of the tutorial.

Read more

Although I mostly use this blog to post TwinCAT-related stuff, I sometimes make exceptions. This blog post is such an exception.

I was recently on vacation in the Stockholm archipelago on the island Utö. Together with my wife I stayed there during the nights of the Perseid meteor shower. The Perseids are a meteor shower associated with the comet Swift-Tuttle. The peak of the Perseids happened during the night between 12th and 13th of August. Utö is an ideal location for this as it’s quite remote and far from bigger cities and thus has a very dark sky. This year there was no moon that interrupted either so conditions were fantastic. We spent several nights under the stars and saw many Perseids. I brought my DSLR camera and a small tripod with me, so during these nights I made sure to take lots of photos to create a time lapse, which you can see below. Note that the moving light streaks in the movie are not Perseids. These are airplanes and satellites. The Perseids are only visible during one frame at a time in the time lapse so they just flicker by. In the movie you can see one Perseid which I’ve explicitly prepared so that you can see it in slow motion.

Being out for a couple of nights with perfect conditions made me realize how much I’ve missed the stars 💔.

Read more