Fareed Mohmed← EngineeringDigital Twin series

Digital Twin Series · Part 4

PLC-in-the-Loop vs Hardware-in-the-Loop

How much of the machine can you test before it exists, and how real does the test need to be?

Before a machine reaches the factory floor, its control program can be tested against a virtual copy of the machine. There are three common levels. In software-only simulation (SIL) everything is virtual. In PLC-in-the-loop (PIL) a real PLC runs the real program against a virtual machine. In hardware-in-the-loop (HIL) the real PLC and its real I/O modules are wired to a real-time simulator, and real drives or robots can be added. Each level costs more and finds more. This page shows what is real at each level, helps you pick the test you need, estimates the payback, and lists the signals, project phases and tools.

0Key takeaways
1The three levels: what is real and what is virtual

Select a level. Solid gold outline means real hardware. Dashed blue outline means virtual (software). A grey dotted outline means not present. Names of products are examples only.

2Which test do I need?

Tick everything you want to test. The result is the lowest level that covers all of it. Higher levels also cover everything below them, but cost more to set up.

3Comparison table
AspectSIL
software only
PIL
PLC-in-the-loop
HIL
hardware-in-the-loop

Cost and fidelity are relative. Real values depend on the platform, the number of I/O points and the machine.

4Signals in a HIL test

In HIL the simulator has real I/O cards that produce and read the same electrical signals as the field devices, so the PLC cannot tell the difference. Ranges shown are common industrial values.

5Is it worth it? Time and cost estimator

An indicative model, not a measurement. The share of on-site problems found early and the set-up costs are assumptions: replace them with figures from your own projects. Net benefit is the on-site saving minus the set-up cost.

6Typical project phases
7Tools and platforms
CategoryExamplesUsed for

Examples only, not a recommendation or a complete list. In this context PIL means a real PLC in the loop. In embedded and model-based design the same letters often mean processor-in-the-loop, a different test, so check the meaning when reading other sources.

8Where to go next
9Sources

Figures and product names are indicative. Check the current documentation of each vendor before you plan a project.