Virtual Commissioning Explained: PLC Software-in-the-Loop, Hardware-in-the-Loop and Emulation Digital Twins

Virtual Commissioning Explained: PLC Software-in-the-Loop, Hardware-in-the-Loop and Emulation Digital Twins

Virtual Commissioning Explained: PLC Software-in-the-Loop, Hardware-in-the-Loop and Emulation Digital Twins

Most automation projects still debug their PLC code in the worst possible place: on the shop floor, weeks before start of production, with a millwright waiting and a customer counting days. Virtual commissioning moves that debugging earlier. You run the real control program against an emulated plant, a digital twin that answers actuator commands with realistic sensor signals, so sequence bugs, interlock gaps and mapping errors show up on a laptop instead of on a conveyor. The topic is back in the headlines. At Automation Fair 2026 in Boston on 17 November, Rockwell Automation showed AI agents chaining Emulate3D simulation runs, but only inside “validation zones” that the twin has earned evidence for. That rule is the right frame for the whole discipline: an emulation is only as useful as the claims you have validated it for. This guide covers how virtual commissioning works, the in-the-loop levels, model fidelity, coupling and timing, test design, the ROI evidence, and how to let agents use it safely.

What this covers: MIL, SIL, HIL and reality-in-the-loop; logic, kinematic and physics fidelity; the 2026 tool landscape; OPC UA, FMI, shared memory and fieldbus coupling; cycle synchronization; IO mapping; test-case design; ROI studies; a runnable Python asyncua test harness; and a validation-envelope pattern for AI agents.

Context and Background

Commissioning is the phase where mechanical, electrical and software work meet for the first time. It is notoriously expensive because every defect found there is found late. Reinhart and Wünsch, in a 2007 Production Engineering paper that is still the most cited quantitative source on the subject, noted that commissioning can consume up to 25 percent of total project time, with software debugging as the dominant consumer. Other sources put the software-fix share at close to two-thirds of commissioning effort. The pattern holds across industries: the code is written against a mental model of the machine, and the machine disagrees.

Aerospace and automotive have used hardware-in-the-loop rigs for decades. Factory automation adopted virtual commissioning more slowly because plant models were expensive and PLC simulation hooks were weak. That changed in the 2010s. Siemens shipped S7-PLCSIM Advanced as a programmable virtual S7-1500 controller, Rockwell offered Studio 5000 Logix Emulate and later FactoryTalk Logix Echo, and 3D emulation tools such as Emulate3D, Process Simulate, NX Mechatronics Concept Designer, Visual Components and ISG-virtuos matured.

Germany formalized the vocabulary early. The VDI/VDE 3693 guideline series covers virtual commissioning, and its Part 1, “Model types, terms, and definitions”, was reissued in May 2025, replacing the 2016 edition. The DIN Media listing for VDI/VDE 3693 Blatt 1 says the revision adds material on basic test configurations, test methods, required model types and simulation configurations. Part 2 addresses introducing virtual commissioning into companies.

Virtual commissioning is also a specific case of a broader question: when can a model stand in for a physical test? That is a credibility question, and it has a rigorous answer framework. Our guide to digital twin verification and validation with ASME V&V 40 credibility evidence covers that framework in depth. This post applies the same thinking to the commissioning bench, where the “context of use” is narrow and concrete: does this PLC program do the right thing with this machine?

How Virtual Commissioning Works: The Closed Loop

Virtual commissioning is the practice of testing unchanged PLC, robot and HMI software against a simulated plant model before physical startup. The controller writes outputs, the emulation model turns them into motion and sensor changes, and the resulting inputs flow back to the controller every cycle. Defects are found and fixed before hardware arrives.

Virtual commissioning closed loop architecture with virtual PLC, coupling layer and plant emulation model

Figure 1: The virtual commissioning loop. The control side runs unchanged code, the coupling layer maps and transports IO, and the plant emulation model returns sensor states. A test runner injects faults and asserts outcomes.

Figure 1 shows the three blocks every setup shares. On the left, the control side: a PLC project downloaded into a virtual controller or a real one, plus HMI and SCADA screens that operators will use. In the middle, the coupling layer: a tag map that pairs each PLC input and output with a model signal, and a transport that moves values each cycle. On the right, the plant emulation model, which may be pure logic, kinematic, or physics-based. A test runner sits across the loop, injecting faults and checking results. The key design property is that the control code is not modified for the test. If you have to add simulation branches to the PLC program, you are testing a different program.

The controller never knows it is being tested

The core contract is transparency. From the controller’s point of view, an emulated proximity switch must look identical to a real one: same address, same data type, same timing envelope. ISG states this goal directly for ISG-virtuos coupled to Beckhoff TwinCAT, where all fieldbus components are mapped as real EtherCAT participants and “from the control’s point of view, there is no difference between real and virtual components,” according to the Beckhoff Information System application note on ISG.

Transparency matters because the bugs you want to find live at the boundary. A sensor wired normally-closed but programmed as normally-open. A REAL speed setpoint sent to a drive that expects an INT. An interlock that assumes the clamp sensor arrives before the part-present sensor, when the mechanics deliver them in the opposite order. None of these appear in a unit test of the logic alone. All of them appear in a closed loop with a credible plant.

The emulation model is a behaviour contract, not a picture

People often equate virtual commissioning with an impressive 3D scene, but the controller cannot see it. What the controller sees is a stream of input values. So the model’s real job is to answer one question correctly for every relevant scenario: given these actuator commands, what sensor values appear, and when?

That reframing tells you where to spend effort. A pneumatic cylinder model needs extend and retract times, end-position sensors and perhaps a stall condition. It rarely needs fluid dynamics. A conveyor model needs belt speed, part spacing and photo-eye blocking. It rarely needs belt friction coefficients, unless you are testing accumulation or product tipping. Fidelity in virtual commissioning is a budget, and you spend it on the behaviours your test cases depend on.

Three fidelity tiers: logic, kinematic and physics

Practitioners commonly describe emulation models in three tiers. The labels vary by vendor and by guideline, so treat these as working categories rather than standardized names.

A logic model reproduces signal behaviour with timers and state machines. A valve opens, and after 300 ms the open feedback goes true. These models are cheap to build, run far faster than real time, and catch most sequence and interlock bugs. They cannot catch anything geometric.

A kinematic model adds geometry and motion without forces. Axes move along defined paths at commanded speeds, robots follow joint trajectories, and collision checks are geometric. Kinematic models catch reach problems, interference between robots, and sensor placement errors. Siemens Process Simulate, used heavily for robotic lines, works largely at this level.

A physics model adds rigid-body dynamics, gravity, friction and contact. Parts slide, tip, jam and accumulate. Physics models catch problems such as boxes rotating on a transfer, bottles toppling at high conveyor speed, or a gripper dropping a part during a fast move. Emulate3D and NX Mechatronics Concept Designer both include physics engines. The cost is setup time, compute and the need to calibrate parameters against real behaviour.

The Rockwell demo at Automation Fair 2026 shows why physics fidelity sometimes matters. One agent workflow used finite element analysis to compute bottle deformation and centre of gravity, then used Emulate3D to test whether bottles toppled on the conveyor at a given speed. That question has no answer in a logic model. A sequence-interlock question, by contrast, gains nothing from physics.

What a typical model contains

Concretely, an emulation model for a small assembly cell might contain a few dozen smart components: conveyors with photo-eyes, a pick-and-place unit with end-position sensors, a clamp, a vision station returning pass or fail, a safety door switch, and a stack light. Each component exposes a signal interface. The Siemens SCE “Digital Twin at Education” training material for NX MCD with PLCSIM Advanced shows a representative mapping: sensor and limit-switch signals on inputs %I0.0 to %I0.4, actuator signals on outputs %Q0.0 to %Q0.7, and two REAL speed setpoints on %QD64 and %QD68. Small as it is, that table is the heart of the project. Every row is a promise that the model and the program agree on meaning, polarity and units.

The In-the-Loop Levels: MIL, SIL, HIL and Reality-in-the-Loop

The “X-in-the-loop” terms describe how much of the real system is present in the test. Each level moves one more element from virtual to physical. Each also finds a different class of defect, which is why mature programmes use more than one.

Progression of virtual commissioning levels from model in the loop to hardware in the loop and reality in the loop

Figure 2: The in-the-loop progression. Each stage validates something the next stage relies on, and each finds a different defect class before physical commissioning.

Figure 2 lays out the progression. The 2024 review by Korpai, Szántó and Csapó in the Journal of Manufacturing and Materials Processing (DOI 10.3390/jmmp8040165) describes the same ladder, ordering the stages by the ratio of physical to virtual assets.

Model-in-the-loop (MIL)

In MIL, the control logic itself exists only as a model, perhaps a state chart or a Simulink design, and runs against a plant model in one simulation environment. MIL is valuable early, when you are choosing a control concept. It is less common in discrete factory automation, where engineers typically write IEC 61131-3 code directly. Its main weakness is that it tests the design, not the implementation that will actually run.

PLC software-in-the-loop (SIL)

In PLC software-in-the-loop, the real PLC program runs in a software controller emulator, and the plant runs as an emulation model, often on the same PC. No hardware is needed. This is where most virtual commissioning value is created, because the program under test is the one you will download to the real CPU.

The emulators differ in important ways. Siemens S7-PLCSIM Advanced simulates S7-1500 controllers, including C, T, F, R, H, Soft, Open and Drive variants, plus the ET 200SP CPU family, according to Siemens’ product page. The V6.0 function manual lists up to 16 instances on one machine, a local “Softbus” interface that cannot reach real hardware, and TCP/IP adapter modes that can. It also exposes a Runtime API with operating modes for single-step and time-synchronized execution, which matters for timing, as discussed below. Rockwell offers Studio 5000 Logix Emulate for Logix 5000 applications and FactoryTalk Logix Echo, which Rockwell describes as emulation software for ControlLogix 5580 controllers. Beckhoff’s approach is different again: TwinCAT runs on a standard PC, so the “virtual PLC” is often the real runtime on an engineering machine.

The limitation of SIL is timing realism. A software emulator running on Windows does not reproduce the real CPU’s cycle time, jitter or communication load. Logic that only works because of a race condition may pass in SIL and fail on hardware, or the reverse. Our explainer on the PLC scan cycle, determinism and jitter covers why those details change behaviour.

Hardware-in-the-loop PLC testing (HIL)

In hardware-in-the-loop PLC testing, the real controller, often the exact CPU and firmware destined for the machine, runs the program and talks over its real fieldbus to a simulator that impersonates the field devices. The simulator must answer within the bus cycle, so it needs a real-time operating system or dedicated hardware.

Beckhoff’s TE1111 TwinCAT 3 EtherCAT Simulation is a clear example. A simulation PC emulates a set of EtherCAT slaves, including distributed clocks and the CoE and SoE mailbox protocols, so that the machine controller’s EtherCAT cable can be plugged into the simulation PC “without the need for reconfiguration,” per Beckhoff’s TE1111 page. ISG-virtuos offers deterministic real-time coupling over common fieldbuses and quotes a guaranteed response time of, for example, 1 ms. Siemens’ SIMIT platform, with its SIMIT Unit hardware, plays the equivalent role for PROFIBUS and PROFINET device emulation in Siemens-centric HIL rigs.

HIL catches what SIL cannot: real bus timing, watchdogs on the network, device configuration mismatches, and the CPU load of the real program. It costs more, because you need the controller hardware, a real-time simulator and someone who understands both.

Reality-in-the-loop and hybrid commissioning

The last stage mixes real and virtual devices. You start in HIL, then swap virtual components for real ones as they arrive: first the drives, then the robot, then the conveyors. Korpai and colleagues, citing Dominka et al. from 2007, call this hybrid commissioning or reality-in-the-loop. It is particularly useful when long-lead items arrive late. The line can be partially commissioned with the missing units still emulated, which keeps the schedule moving.

Choosing the right level

Use the cheapest level that can expose the defect class you care about. Sequence bugs, interlocks and HMI workflows belong in SIL; bus timing, safety-network behaviour and CPU load belong in HIL; mechanical fit and real friction belong in reality-in-the-loop or on the floor. A virtual commissioning plan that names the level for each defect class avoids both overspending and blind spots.

The 2026 Virtual Commissioning Tool Landscape

No single product does everything. A working virtual commissioning stack combines a controller emulator, a plant emulation tool and a coupling method, and the right combination depends mostly on which PLC family you run. The table below summarizes the main options. Capabilities are taken from vendor documentation; where a vendor page did not state a detail, the table says so rather than guessing.

Tool Vendor Role in the loop Coupling noted in vendor docs Typical fit
S7-PLCSIM Advanced Siemens Virtual S7-1500 and ET 200SP controller, SIL Softbus, TCP/IP adapters, OPC UA via TCP/IP, Runtime API Siemens PLC projects, coupled to NX MCD, Process Simulate or SIMIT
Process Simulate Siemens Kinematic robotics and line emulation Couples to Siemens virtual or real controllers Automotive body and assembly lines with many robots
NX Mechatronics Concept Designer Siemens Physics-based machine emulation Signal mapping to PLCSIM Advanced Machine builders designing new mechatronics
SIMIT Siemens Signal and device-level plant simulation, SIL and HIL PLCSIM coupling, TCP and UDP coupling, SIMIT Unit for fieldbus HIL Process plants, operator training, PROFINET HIL
Emulate3D Rockwell Automation Physics-based 3D emulation, from machine to factory Logix Emulate, Logix Echo, others not detailed here Material handling, packaging, Logix sites
Studio 5000 Logix Emulate / FactoryTalk Logix Echo Rockwell Automation Virtual Logix controllers, SIL Links to simulation and training systems ControlLogix and Logix 5000 code testing
TwinCAT 3 with TE1111 EtherCAT Simulation Beckhoff Real runtime on PC; simulated EtherCAT slaves for HIL EtherCAT, including distributed clocks, CoE and SoE Beckhoff machines, low-cost HIL
ISG-virtuos ISG Real-time plant simulation for MIL, SIL and HIL Real fieldbus participants, e.g. EtherCAT Machine tools, CNC, deterministic HIL
Visual Components Visual Components 3D layout and emulation OPC UA, Beckhoff ADS and Siemens S7 plugins (version 4.9 docs) Robot cells and line layout with mixed vendors

Two observations about virtual commissioning tooling follow from this table. First, the controller vendor usually pulls the emulation choice along with it, because the tightest timing coupling is vendor-specific. Second, OPC UA appears almost everywhere as the lowest common denominator. That makes it the natural coupling for mixed-vendor sites and for scripted test automation, at the cost of timing determinism.

The landscape is moving toward larger scope and better rendering. Rockwell announced at Automation Fair 2026 that it will build NVIDIA Omniverse, RTX rendering and OpenUSD into Emulate3D to extend simulation from single machines to whole plants; reporting by Automation.com and MarketScale gave no availability date or pricing. Rockwell’s own Emulate3D page already describes Emulate3D Factory Test as integrated with Omniverse APIs and OpenUSD, with full-factory visualization “initially available via private preview.” Siemens is pursuing a similar OpenUSD and Omniverse direction for its own digital twin portfolio.

Coupling Interfaces: How Signals Cross the Boundary

In virtual commissioning, the coupling layer decides how fast, how deterministic and how portable your virtual commissioning setup will be. There are four common mechanisms, and serious projects often use two of them at once.

Vendor runtime APIs and shared memory

The fastest coupling is in-process or shared-memory access to the emulated controller’s process image. PLCSIM Advanced’s Runtime API, for example, lets a simulation read and write signals by name in bulk, register for a “sync point reached” event at the end of each cycle, and step the controller in virtual time. Shared memory keeps latency in the microsecond range on one machine, and API-level stepping gives you lockstep execution. The downside is lock-in: the coupling code is specific to one emulator.

OPC UA

OPC UA is the portable option. Almost every modern controller and emulator exposes an OPC UA server, and every serious emulation tool has an OPC UA client. The PLCSIM Advanced V6.0 manual notes that its OPC UA server works over the TCP/IP interface but not over the local Softbus, which is a common configuration trap.

OPC UA’s weakness for virtual commissioning is timing. Client-server reads and writes, or subscriptions with publishing intervals, are not synchronized to the PLC scan. A sensor change written by the model might land early in one cycle and late in another. For most logic tests that is fine, provided the plant itself tolerates it. For high-speed motion, registration marks or tight handshakes, it is not. Security also matters if the emulation network ever touches a plant network, so apply the same certificate and policy hardening you would use in production.

FMI and FMUs

The Functional Mock-up Interface packages a model as a Functional Mock-up Unit (FMU), a zip of compiled code and an XML description, which any FMI-compliant master can execute. FMI 3.0 was released on 10 May 2022 by the Modelica Association, according to the FMI standard news page, adding features such as clocks and scheduled execution that suit controller co-simulation. FMI is valuable when a component model, for example a hydraulic press or a thermal oven, comes from a different tool or supplier. It does not by itself connect a PLC. You still need a master that steps the FMU and exchanges signals with the controller. When several FMUs and a controller share one loop, the master algorithm, its step size and its handling of algebraic loops determine accuracy; our deep dive on co-simulation master algorithms, Jacobi vs Gauss-Seidel, and SSP explains the trade-offs.

Fieldbus emulation

For HIL, the coupling is the real fieldbus. The simulator impersonates the devices on PROFINET, EtherCAT or EtherNet/IP, answering cyclic data frames within the bus cycle. Beckhoff’s TE1111, ISG-virtuos and Siemens SIMIT with SIMIT Unit hardware are examples. Fieldbus emulation is the only way to test bus configuration, device parameterization over acyclic channels and network-level watchdogs. It is also the most expensive coupling to build, because every device needs a credible emulated profile.

Real-Time and Cycle Synchronization

Timing is where virtual commissioning results most often mislead. The controller runs in cycles, often 1 to 10 ms for machine tasks. The emulation model runs in solver steps, which for a physics engine might be a few milliseconds. The coupling transports values at its own rate. If these three clocks drift relative to each other, the test result depends on scheduling luck.

Virtual commissioning cycle synchronization sequence between test runner, virtual PLC, coupling and plant emulation model

Figure 3: Lockstep synchronization in virtual time. The PLC freezes at each sync point, the model integrates one step, inputs are written, and only then does the next scan run.

Figure 3 shows the lockstep pattern. The test runner holds the virtual PLC at a sync point. The PLC’s outputs from the last cycle are read and applied to the model. The model integrates one step and returns sensor values, which are written into the PLC’s inputs. Then the runner releases the PLC for exactly one cycle, or one span of virtual time, and waits for the next sync event. Every run is reproducible because nothing depends on wall-clock scheduling.

PLCSIM Advanced supports this pattern directly. Its Runtime API documents RunToNextSyncPoint() for single-step modes, StartProcessing(minimalTimeToRun_ns) for a time-span-synchronized mode in which the controller runs for at least the requested virtual time and then freezes at the next cycle control point, and a ScaleFactor property that sets the ratio of virtual to wall-clock time, with valid values from 0 to 1000 and a default of 1.0, per the Siemens developer API reference.

Free-running versus lockstep

There are two broad modes. In free-running mode, the PLC and model each run in real time and exchange values asynchronously. This is simple, works with any OPC UA connection, and feels natural for operator training. Its weakness is non-determinism: run the same test twice and the PLC may see a sensor edge one cycle apart. In lockstep mode, a master advances the PLC and model in coordinated steps of virtual time. Results are repeatable and you can run faster or slower than real time. The cost is that you need API-level control of the emulator, and you can no longer test anything that depends on true wall-clock timing, such as communication with external systems that do not share the virtual clock.

Worked example: when sample timing breaks a test

Consider a conveyor running at 1.0 m/s carrying parts that are 50 mm long. A photo-eye is blocked for 50 ms as each part passes. The PLC task runs every 10 ms, so a real controller sees the beam blocked for about five scans. Now suppose a free-running OPC UA coupling refreshes the model’s sensor values every 50 ms. Depending on phase, the PLC may see the beam blocked for anywhere from zero to about ten scans. A part counter that requires two consecutive blocked scans will intermittently miss parts.

The sampling theorem gives a rule of thumb. The coupling must update at least twice as fast as the shortest pulse the logic must detect, and in practice four or more times faster to tolerate jitter. At 1.0 m/s with 50 mm parts, that means a coupling period of 12.5 ms or less, not 50 ms. If your coupling cannot achieve that, either slow the virtual time scale, switch to lockstep, or emulate the counter’s input with an edge-preserving mechanism. The numbers here are illustrative, but the arithmetic applies to any fast discrete signal.

Virtual time scaling

Lockstep and time scaling unlock two uses that real hardware cannot offer. Scaling below 1.0 lets a slow physics model keep pace with a fast PLC task; scaling above 1.0 compresses a long soak test, such as an eight-hour shift of a material-flow system, into a shorter run. Both depend on the controller’s timers honouring virtual time. If the program reads a real-time clock directly, for example for a timestamp in a recipe log, it will behave differently under scaling, and the test must account for that.

IO Mapping: The Unglamorous Core

Every virtual commissioning project lives or dies on its IO map. The map pairs each PLC input and output with a model signal and records the data type, polarity, scaling and units. For a mid-size line, that is easily hundreds or thousands of rows, and errors are easy to make.

Four practices keep the map honest. First, generate it rather than typing it. The IO list in the electrical CAD system, the PLC hardware configuration and the model’s signal list should be reconciled by a script, not by eye. ISG-virtuos generates its fieldbus structure automatically from the TwinCAT project, which is the right pattern. Second, encode polarity explicitly. A safety door switch is often wired normally-closed, so “door closed” means the input is TRUE; the model must agree. Third, carry engineering units and scaling. An analog pressure input scaled 0 to 27648 for 0 to 10 bar must be scaled the same way in the model. Fourth, version the map with the PLC project. When an electrician moves a sensor to a different terminal, both the program and the map must change together.

A subtle point concerns who owns each signal. In the emulation, the model owns inputs and the PLC owns outputs. If a test harness also writes inputs, for example to inject a fault, there must be a clear arbitration rule. Otherwise the model and the harness overwrite each other and the test result is meaningless. Many teams add an explicit “force” layer in the coupling, with a log of every forced value.

Designing Virtual Commissioning Test Cases

In virtual commissioning, the emulation model is infrastructure and the test cases are the product. A good test suite derives directly from the functional specification and the risk assessment, and it is written before anyone opens the 3D view.

Start with the nominal sequences: start-up, automatic cycle, controlled stop, and recipe change. Each test drives the inputs that the plant would produce and asserts states, outputs and cycle times. Then add fault reactions: a sensor that never arrives, a sensor that arrives too early, a drive fault, an emergency stop mid-cycle, a lost network connection. Fault reactions are where virtual commissioning beats physical testing outright, because you can inject faults that would be dangerous, destructive or simply tedious on real equipment. Finally, add operator scenarios covering HMI actions, mode changes, manual jogging and recovery after a fault, which catch the workflow bugs that operators find on day one.

Each test case should have an identifier, preconditions, stimulus, expected response and an explicit time tolerance. The time tolerance matters. “The PLC must fault within 2 seconds” is testable; “the PLC must fault” is not. Store results in a structured format so that regression runs after every code change are cheap. This is the point where virtual commissioning becomes continuous: the same suite runs every night against the latest PLC program.

A runnable PLC software-in-the-loop test with Python asyncua

The script below is a minimal SIL test harness. It connects to an OPC UA server exposed by the virtual controller or its emulation gateway, drives simulated inputs, and asserts that the PLC’s state machine responds within specified times. It uses the open-source asyncua library; we tested it with version 2.1.0 against a local mock controller implementing the same state machine. The cell is illustrative: a start command, a part-present sensor, a clamp command and a clamp-closed sensor, with a 2-second clamp watchdog.

"""Virtual-commissioning smoke test: drive simulated I/O over OPC UA and
assert that the PLC state machine reacts as specified.
Requires: pip install asyncua==2.1.0
"""
import asyncio
import time
from asyncua import Client, ua

ENDPOINT = "opc.tcp://127.0.0.1:4840/vc/"
NS_URI = "urn:example:vc-demo"   # resolve the index at runtime, never hard-code it

# State codes from the PLC function specification (illustrative cell)
IDLE, WAIT_PART, CLAMPING, PROCESS, FAULT = 0, 10, 20, 30, 90


class Cell:
    def __init__(self, client: Client, ns: int):
        n = lambda name: client.get_node(ua.NodeId(f"Cell01.{name}", ns))
        # inputs the emulation model owns (sensors, operator buttons)
        self.start, self.part = n("StartCmd"), n("PartPresent")
        self.clamp_closed, self.reset = n("ClampClosed"), n("ResetCmd")
        # outputs the PLC owns (actuators, state)
        self.clamp_cmd, self.state = n("ClampCmd"), n("State")

    async def set(self, node, value: bool):
        await node.write_value(ua.DataValue(ua.Variant(value, ua.VariantType.Boolean)))

    async def wait_for(self, node, expected, timeout_s: float, poll_s: float = 0.02):
        """Poll until node == expected; return elapsed seconds or raise."""
        t0 = time.monotonic()
        while True:
            value = await node.read_value()
            if value == expected:
                return time.monotonic() - t0
            if time.monotonic() - t0 > timeout_s:
                name = (await node.read_browse_name()).Name
                raise AssertionError(f"{name}={value!r}, expected {expected!r} "
                                     f"within {timeout_s}s")
            await asyncio.sleep(poll_s)

    async def reset_to_idle(self):
        for node in (self.start, self.part, self.clamp_closed):
            await self.set(node, False)
        await self.set(self.reset, True)
        await self.wait_for(self.state, IDLE, 2.0)
        await self.set(self.reset, False)


async def tc_happy_path(cell: Cell):
    """TC-01: start -> part arrives -> clamp closes -> PROCESS."""
    await cell.set(cell.start, True)
    await cell.wait_for(cell.state, WAIT_PART, 1.0)
    await cell.set(cell.part, True)
    await cell.wait_for(cell.clamp_cmd, True, 0.5)      # PLC must command clamp
    await cell.set(cell.clamp_closed, True)              # emulated sensor feedback
    dt = await cell.wait_for(cell.state, PROCESS, 0.5)
    print(f"TC-01 pass: PROCESS reached {dt*1000:.0f} ms after clamp feedback")


async def tc_clamp_timeout(cell: Cell):
    """TC-02: clamp sensor never arrives -> PLC must fault inside its 2 s watchdog."""
    await cell.set(cell.start, True)
    await cell.wait_for(cell.state, WAIT_PART, 1.0)
    await cell.set(cell.part, True)                      # never set ClampClosed
    dt = await cell.wait_for(cell.state, FAULT, 3.0)
    assert 1.8 <= dt <= 2.6, f"watchdog fired after {dt:.2f}s, spec says 2.0s"
    print(f"TC-02 pass: FAULT after {dt:.2f} s")


async def main():
    async with Client(url=ENDPOINT, timeout=4) as client:
        ns = await client.get_namespace_index(NS_URI)
        cell = Cell(client, ns)
        for tc in (tc_happy_path, tc_clamp_timeout):
            await cell.reset_to_idle()
            await tc(cell)

if __name__ == "__main__":
    asyncio.run(main())

Against our mock controller, the run printed “TC-01 pass: PROCESS reached 21 ms after clamp feedback” and “TC-02 pass: FAULT after 2.12 s”. Those timings describe the mock on a development PC, not any real controller.

Several choices carry over to real virtual commissioning projects. The namespace index is resolved from its URI, because servers can renumber namespaces. Every wait has a timeout tied to the specification, and each test starts from a known state, so test order cannot hide a bug. TC-02’s tolerance band reflects polling latency: with a 20 ms poll and free-running coupling, you cannot assert timing tighter than a few tens of milliseconds. For tighter assertions, use subscriptions with server timestamps or a lockstep runner.

On a real Siemens target, the node identifiers would follow the controller’s OPC UA naming for data blocks and tags, and inputs would usually be written into a simulation data block or through the Runtime API rather than directly into the process image. Writing directly to physical input addresses over OPC UA is typically blocked, for good reason. Treat the tag names here as placeholders to replace with your own map.

What the ROI Evidence Actually Says

Vendors routinely promise large savings from virtual commissioning, so it pays to separate measured results from marketing. The best-known quantitative study remains Reinhart and Wünsch, “Economic application of virtual commissioning to mechatronic production systems,” Production Engineering, 2007, volume 1, issue 4, pages 371 to 379. In a controlled comparison on a small PLC-controlled system with 17 sensors and 10 actuators, they reported that software quality, defined as fulfilment of requirements, rose from 37 percent to 84 percent, real commissioning time fell by 75 percent, and total time-to-market fell by 15 percent. Visual Components summarizes the same figures in its blog on control software quality.

Those numbers are real, but read them carefully. The test system was small, the comparison was a single study, and the 15 percent time-to-market gain is far more modest than the 75 percent headline. The commissioning time saving moves effort forward rather than eliminating it: someone still has to build and validate the model. The 2024 Korpai review makes this point from its own case study, reporting that virtual commissioning shortened lead time but increased total work hours.

Vendor figures belong in a separate bucket. Siemens markets its SINUMERIK virtual commissioning services as shortening real commissioning time by “up to 70%.” That is a marketing upper bound, not a measured average, and it should be labelled as such in any business case.

A defensible virtual commissioning ROI model therefore counts three things. The cost is model building, tooling licences and engineering time for test design. The direct saving is reduced on-site commissioning time, including travel, overtime and idle installation crews. The risk reduction is the expected cost of defects that would otherwise reach the floor, such as crashes, scrap, delayed start of production and contractual penalties. Risk reduction is often the largest term and the hardest to estimate. As an illustrative example only: if a line’s late start costs a plant a given amount per day, and historical projects slip by an average of five days in commissioning, then avoiding even two of those days can pay for a modest emulation effort. Plug in your own numbers; do not borrow someone else’s.

Reuse changes the economics of virtual commissioning most. A machine builder shipping the same machine type many times amortizes one emulation model across every order, while a one-off line must justify the model on a single project.

AI Agents and the Validation Envelope

The newest question in virtual commissioning is whether AI agents can run the simulations. The Automation Fair 2026 session “Building Trustworthy Agents for Digital Twin Engineering,” presented by Rockwell’s Chelsea Barnes and Franklin Lufkin II, gave a careful answer, as reported by MarketScale on 19 November 2026.

The core idea is a validation envelope with three zones. In the green zone, the twin is validated well enough that virtual tests can replace physical ones. In the yellow zone, virtual tests can reduce physical tests but not eliminate them. In the red zone, the task lies outside what the model supports, so virtual results get no weight. Agents receive only validated tasks, such as running models and converting or summarizing results. Each agent has a “job description” that limits its data and input ranges, and when the physical line or product changes, the model is updated and revalidated before anything reaches the floor.

AI agent validation envelope for digital twin commissioning with green, yellow and red zones

Figure 4: A validation envelope for agent-driven digital twin commissioning. Requests pass a scope check, then are classified by the evidence available for that task type. Change control forces revalidation.

Figure 4 turns that description into an architecture. An agent request first passes a job-description check: is this tool and this input range permitted? If not, it is refused or escalated. In-scope requests are then classified against the validation evidence for that task type. Green results are accepted with full logging of inputs and outputs. Yellow results are flagged to an engineer and paired with a scheduled physical check. Red requests are refused. A change-control path invalidates evidence whenever the physical system changes.

Why the envelope is the right abstraction

The envelope encodes what this post has argued throughout: a model’s fidelity is not a global property. A logic model can be green for interlock testing and red for cycle-time prediction. A physics model calibrated for 500 mm cartons can be green for those cartons and red for a new, taller SKU. The envelope makes those boundaries explicit and machine-checkable. That is the same “context of use” principle that credibility frameworks such as ASME V&V 40 formalize.

It also gives agents a useful job without authority. Rockwell’s demos had agents chaining finite element analysis into an Emulate3D toppling test, and feeding Emulate3D synthetic images into an inspection model. Those multi-tool runs are a real bottleneck: MarketScale reported roughly ten people waiting on each simulation engineer. A complementary rule, attributed in the same report to Airsup founder Konstantin Saifoulline, is that agents may prepare options and flag contradictory inputs, but must not release robot programs, change safety-rated procedures or approve purchases.

Implementing an envelope today

You do not need a vendor agent platform to apply the idea to virtual commissioning. Represent each validated task type as a record holding model version, validated input ranges, evidence references and zone. Wrap the simulation tools behind an API that checks every request against those records and logs every run. Tie the records to change management, so a mechanical change downgrades affected tasks until someone revalidates. The wrapper protects human users too.

The safety boundary deserves one more sentence. Generated or agent-modified PLC code must never skip human review, regardless of how many virtual tests pass. Our analysis of IEC 61131-3 PLC code generation with LLMs and safety verification explains why simulation evidence complements, but does not replace, formal review and functional safety processes.

Trade-offs, Gotchas, and What Goes Wrong

Virtual commissioning fails in predictable ways. Most failures come from trusting the model further than its evidence.

Validating the model against the program. If the same engineer writes the PLC code and the emulation model from the same misunderstanding of the machine, both will agree and both will be wrong. Build the model from mechanical and supplier data, and have a different person own it where possible.

Polarity and scaling drift. A changed sensor type, from PNP normally-open to normally-closed, silently invalidates the IO map. Regenerate and diff the map on every electrical change.

Timing false confidence. A test that passes in free-running SIL proves little about timing. If cycle time, handshakes or high-speed counting matter, move those tests to lockstep or HIL.

Over-modelling. Virtual commissioning teams sometimes burn months building photorealistic physics for a line whose risks are in sequence logic. Match fidelity to the test cases, and grow the model only when a test needs it.

Model rot. The virtual commissioning model is accurate at factory acceptance and drifts as the real line is modified. Without change control, the twin becomes a liability for the next retrofit. Treat the model as a controlled engineering artefact with an owner and a revision history.

Safety logic misconceptions. Emulated safety devices can exercise safety programs, and PLCSIM Advanced simulates F-CPUs. However, a passed virtual test is not a safety validation under IEC 62061 or ISO 13849. Physical verification of safety functions remains mandatory.

Network and security leakage. Emulation PCs often bridge office and controls networks. Keep virtual controllers on the Softbus or an isolated adapter unless a test needs TCP/IP, and never let an emulation instance download to a real CPU by accident.

Practical Recommendations

Start virtual commissioning small and grow by evidence. Pick one machine or cell with a well-understood sequence and a history of commissioning pain. Build a logic-level model first, write ten to twenty test cases from the functional specification, and run them in SIL against the real PLC program. Measure how many defects you find and how long the effort took. That data, not a vendor brochure, is your business case for going further.

Choose virtual commissioning tools by controller family first, then by the fidelity your risks require. Use OPC UA for portability and scripted regression, and vendor APIs or fieldbus emulation where timing matters. Write down the validation envelope for every model: what it is validated for, with what evidence, and what it must not be used for. Then let both people and agents work inside it.

A short checklist:

  • Generate the IO map from electrical CAD and the PLC hardware configuration; diff it on every change.
  • Write test cases with IDs, stimulus, expected response and time tolerance before building the 3D view.
  • Run SIL nightly against the latest PLC program; keep results as structured data.
  • Use lockstep or HIL for any test that depends on cycle timing, bus behaviour or fast signals.
  • Record a green, yellow or red zone for each task type and revalidate on every mechanical change.
  • Keep safety validation physical, and keep agent output behind human review.

For material-flow-heavy sites, pair the commissioning model with a throughput model; our warehouse digital twin architecture with discrete-event simulation and WMS integration shows how the two levels relate. For a hands-on, low-cost way to learn controller-side coupling, an OpenPLC v3 controller over Modbus TCP makes a capable lab target.

Frequently Asked Questions

What is virtual commissioning in simple terms?

Virtual commissioning means testing the real control software of a machine or production line against a simulated version of that machine before the physical equipment is installed. The PLC program sends actuator commands to an emulation model, the model responds with realistic sensor signals, and engineers check that sequences, interlocks, alarms and HMI screens behave correctly. Bugs found this way are fixed on a desk rather than on the shop floor. The physical machine still needs commissioning, but far fewer problems should remain when it starts.

What is the difference between SIL and HIL in PLC testing?

In PLC software-in-the-loop testing, both the controller and the plant run in software, typically on one PC using an emulator such as S7-PLCSIM Advanced or Logix Emulate. No hardware is needed, so it is cheap and fast. In hardware-in-the-loop testing, the real PLC hardware runs the program and talks over its real fieldbus to a real-time simulator that impersonates field devices. HIL reproduces genuine cycle timing, bus behaviour and CPU load, so it catches defects SIL misses, but it costs more.

Is virtual commissioning the same as a digital twin?

Not exactly. A digital twin is a broad term for a virtual representation synchronized with a physical asset throughout its life. Virtual commissioning uses a specific kind of twin, an emulation model focused on control behaviour, at a specific stage, before startup. The same model can later support operator training, retrofits and what-if studies, which is when it starts to behave like a lifecycle twin. Without change control, however, the commissioning model drifts from the real machine and loses that value.

How much time does virtual commissioning save?

The most cited study, Reinhart and Wünsch in 2007, measured a 75 percent cut in real commissioning time and a 15 percent cut in total time-to-market on a small system with 17 sensors and 10 actuators. Software quality rose from 37 to 84 percent. Vendor claims such as “up to 70 percent” are upper bounds. Results depend heavily on model reuse, team skill and how much of your commissioning pain is software. Measure your own pilot before committing to a figure.

Which software is used for virtual commissioning?

The common stacks pair a controller emulator with a plant emulation tool. Siemens users typically combine S7-PLCSIM Advanced with Process Simulate, NX Mechatronics Concept Designer or SIMIT. Rockwell users pair Studio 5000 Logix Emulate or FactoryTalk Logix Echo with Emulate3D. Beckhoff users run TwinCAT on a PC and add TE1111 EtherCAT Simulation for HIL. Vendor-neutral options include Visual Components and ISG-virtuos, which couple via OPC UA, ADS or fieldbus. Choose by controller family first.

Can AI agents run virtual commissioning tests safely?

They can, if the twin defines where its results are trustworthy. Rockwell’s approach at Automation Fair 2026 sorts tasks into green zones, where virtual tests can replace physical ones, yellow zones, where they only reduce physical tests, and red zones, where results get no weight. Agents receive only validated tasks within a defined job description and input range. They should prepare options and run studies, but never release robot programs, change safety procedures or bypass human review of control code.

Further Reading

By Riju — about

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *