I’ve been using TwinCAT 3 more or less since it was released, and since then it has become such an integrated part of my daily work that it’s my main software development platform. I like to develop software using TwinCAT 3, but I’ve come to the conclusion that there are some features I miss. I’m not the only person that uses TwinCAT 3, and this video is made in collaboration with someone that has vastly more experience in industrial automation than me – Peter Kurhajec. As we both work with TwinCAT 3 on a daily basis, we decided to do a video with the title “4 things we want in TwinCAT 4”. Consider this as a wish list for a future version of TwinCAT, so some kind of dream session.
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!
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!
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.
The user base for TcUnit, the free open-source PLC/TwinCAT unit testing framework, has grown enormously. Current estimates are that there are over 100 installations of TcUnit worldwide. Running an open-source project has for some moments taken all my spare-time to maintain the framework, and answer all the questions from the users (I’ve added an FAQ since). The most asked-for functionality of TcUnit that was missing was the possibility to run unit tests in a sequence/in order. Up to now, all tests defined in TcUnit were running in parallel, while in many use cases it was desirable to run the tests in sequence. Thanks to several fantastic contributors from the TcUnit community on GitHub, this is now available in TcUnit starting from version 1.2.
Oh no! The PLC has crashed, and we might even see the classical blue screen of death (BSOD). We’ve all been there, and there are many reasons for why we got there. TwinCAT is generally good at handling exceptions, and most of the time it is possible to analyze exceptions during development of software for a machine. On a few occasions though, I’ve been in the situation where the machine has crashed, and I have not been connected to it at the moment of the crash and without any possibility to see what caused it. In the latest version of TwinCAT (3.1.4024.11), Beckhoff have included a tool to aid with this type of problems.
I have been using TwinCAT for quite some time now, and since I started developing software with TwinCAT it has changed almost everything for me as a software engineer, both as a profession and as a hobby. This includes the programming language, development environment, software development processes, hardware, communication protocols and much more. I have recently philosophized about how my life as a software developer has changed compared prior to doing automation software. Overall, I would say that I can do tremendously more things (in a reasonable amount of time) with TwinCAT by myself, than I could do before when I was developing software in the “standard” programming languages. It has given me opportunities to work with insanely fun projects that I would never have worked with if I didn’t start with PLC software development. What I would want to share with you is a list of five things that I think Beckhoff have done right, and five things that they could improve.