plc

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.

Read more

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.

Read more

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.

Read more

When I develop software I mostly do the testing on my development computer. It is after all one of the big strengths of being able to run your code on a PC platform – it should more or less work the same on a PC based PLC. But then there is only so much testing you can do in your development machine, at some point you still end up needing to have the real hardware. I’ve already ended up with having some EtherCAT-slaves connected to the development computer so I decided I’ll go for a PLC to split the development computer and run-time environment completely. As Beckhoff has released PLCs from their embedded line with Windows 10 IoT Enterprise LTSB I though that was another reason good enough to buy one and experiment with it. Ended up with a CX5140 with 4gb of RAM and 32GB of flash-storage. Works like a charm out of the box, and I’ve already noticed some changes compared with running a controller with Windows 7 embedded. Since Windows 8 embedded, Microsoft have apparently replaced the FBWF (File-Based Write Filter) with the new UWF (Unified Write Filter). I’ll continue running/testing all my code on this controller, and will be posting new content to this blog as often as I can.

Read more

3S-Smart Software Solutions has since pretty long had a Raspberry Pi (RPI) target image available for their CODESYS runtime. The intention was to create something that you could buy very cheap, primarily for students and such to learn how to program 61131-3.

As I’m primarily working with TwinCAT3, which is based on CODESYS, I’ve been thinking about building a really cheap 61131-3 compatible PLC based on the RPI and the CODESYS target. I didn’t just want it to be one board laying around in my home, but I also wanted it to have the “industrial” feeling, and luckily I found a perfect development board + case for me to initialize the project. Now that it’s finished, I have a PLC running an EtherCAT master in the CODESYS runtime for almost no money at all.

Read more

Webpage is up! Here I’m going to have various information about different PLC programming tutorials. This will mostly be in the TwinCAT 3 and CODESYS environment. I’ve found out that there aren’t too many blogs/resources on TwinCAT 3 development. As I’m working with mostly TwinCAT-development every day at my job I thought it would be a good idea to share some of the knowledge I’ve aquired during as time has passed. Stay tuned!

Read more