This is great stuff! Even better, thanks to the bridged networking functionality in VirtualBox, I can have the Linux machine do network communications with the TwinCAT runtime on the Windows host. So apparently it is possible to run TwinCAT on a hyperthreading CPU. Doing a “Read from Target” in TwinCAT3 on my machine confirmed this: My development machine is running a Intel Core i7-8550U CPU, and according to the datasheet it has four physical CPU cores (eight running with Hyper-Threading). Theory is one thing, time to do some experiments. If the host OS did not have access to the CPU core(s), then neither would any virtual machines running in the host have it and all should be fine. If we could make sure to remove one (or more) CPU-cores from the host operating system, thus allowing only TwinCAT to have access to it. This warning message suggests that the problem occurs when you’re trying to run a TwinCAT task on a CPU-core that is also used on the virtual machine. I didn’t like the first suggestion, which is just another way of saying “just give up”.
At this point I had no access to any physical PLC, which meant I needed to run the TwinCAT code on my Windows 10 developer machine. What I needed was to run a client on a Linux machine, talking to a TwinCAT3 PLC through the ADS protocol.
Developing software for different operating systemsĭuring a project a requirement came up in where I needed to develop some software that was supposed to run on a Linux machine, but communicating to a TwinCAT runtime.Have different toolchains for development.Doing a temporary test of a certain functionality without messing up the main PC.There can be many reasons for wanting to use a virtual machine while doing TwinCAT development, a few of them being: Working for several projects with various requirements, but where a Beckhoff PLC/TwinCAT was the common delimiter, made me ask myself “How much use of virtualization can I do for TwinCAT software development?” Nevertheless, there are still advantages. Software development for PLCs in a virtual environment is often overlooked, since PLC development is so close to the hardware. Most people who have developed software have at some point or another used virtualization technology.