AI and a Unity-based digital twin jointly test PLC software for machinery
Public- 03 Dec, 2026

Danish engineering firm neexo, a Unity Registered Service Partner, develops PLC software, HMI, AI solutions and digital twins for machine builders. The company has outlined a workflow in which AI writes and adjusts code for Programmable Logic Controllers (PLCs), while a Unity-based digital twin tests that code against a model of the machine's behavior. Unity serves as the real-time 3D and physics runtime. The aim is to get broader feedback on machine software, and to get it earlier, before integration errors surface on the shop floor and force site visits or a delayed Factory Acceptance Test (FAT).
The foundation is virtual commissioning, an established practice that neexo has used for several years across multiple PLC platforms. Real PLC logic is connected to a digital model built from data the machine builder already has: CAD, signals and machine behavior. Sequences, faults, changeovers and HMI behavior are then exercised virtually. The AI angle addresses a known weakness: generated PLC code can look correct yet fail, and no model can tell whether a conveyor jams or a product handover deadlocks until something actually tests it.
Testing runs in two stages within an automated cycle: code changes, verification, simulation, evaluation. In Stage 1, a dedicated agent works against the PLC code repository and checks that the code compiles, meets defined requirements, stays within permitted limits, doesn't break anything that already worked, and that sequences and processes are correct. Once these checks pass, Stage 2 begins: working with the Unity twin. The AI receives signals, events, measurements and a test report from Unity and evaluates them against predefined acceptance criteria. This shows how PLC-controlled sequences interact with the simulated physics of the machine and the product.
Engineers keep control. They define the acceptance criteria and the limits within which the AI may change code, based on machine requirements and mechanical constraints. The AI cannot modify the Unity model, only suggest changes, and an engineer must approve the software before it reaches the physical machine. An illustrative example, not yet backed by measurements, is a lift where a product catches on a mechanical part: either the lift height is too low, or the product behaves in a way that changes the clearance as it rises. The twin will catch this error only if the model captures that behavior.
To decouple the hardware from the simulation, neexo built the neexo Gateway: project-specific interface software lives in it rather than inside the Unity model. If the PLC is replaced, the new protocol and I/O mapping are configured in the gateway, and no new version of the model is needed. The twin is also useful beyond testing, for visualization, sales and training: customers can see a machine before it is built, operators can rehearse sequences and fault scenarios without halting production, and equipment builders can sell the model as a training or service product.
Expected benefits include shorter commissioning, fewer issues at FAT, less engineer time spent on repetitive tests and adjustments, and more complete coverage of physical interactions, though no measurements exist yet. Virtual tests do not replace the real machine: real tolerances, material behavior, sensor performance, safety and actual operating conditions still have to be verified physically, and a physical FAT remains necessary. The recommended starting point is a single sequence or challenge, not an entire factory.