When being in an early phase of a project, it’s common to use “latest and greatest” of the dependencies that your software relies on. In the beginning of a project, it’s usually low risk to built your system on the latest of everything as you’ve got plenty of time to make sure everything works as expected. I guess that’s one of the many joys of starting a new project, you are more free and can experiment more. But as you get closer and closer to the delivery of the project, it’s usually a good idea to start and “freeze” parts of the software. This includes everything from own developed libraries, TwinCAT supplied libraries, drivers, TwinCAT runtime and even the operating system on the target device (which anyways doesn’t change too often). Twenty years from now, I want to be able to compile and build the exact same executable binary that is running on that nice expensive machine right now. When I was close to delivery of a TwinCAT project, I got some problems related to this topic.
If you’ve done development in TwinCAT for some time, you’ve most likely come across at least one of the OSCAT libraries. These are open source libraries developed in accordance to the IEC61131-3 standard. They provide a total of three different libraries; OSCAT-Basic, OSCAT-Building and OSCAT-Network. I’ve so far only used the OSCAT-Basic library, which provides function blocks and functions for engineering, mathematics, string handling, time/date and much more. There is only a small problem with using the OSCAT-Basic library in TwinCAT – there is a broken reference in it! What follows is a guide on how you can fix this so that you can fully utilize this library in TwinCAT.