Hardware-in-the-loop workflow
Developing and commissioning PLC code against the twin instead of the machine.
The payoff of everything in this section: run your real PLC program, on real hardware or a soft PLC, and watch it drive the virtual machine. Sequence bugs, wrong directions, off-by-a-revolution cam phasing: all visible on screen, before the machine exists or without occupying it.
The setup
- Build the twin in Simulation mode first. Model the machine, dress the mechanisms, verify motion with simulated masters. This is your reference for "what correct looks like."
- Map the PLC-owned variables. Axis actual positions and key status bits, via From Connection. Everything derived stays computed in the twin.
- Switch to Online. The PLC program now animates the machine.
What you can validate
- Sequence logic, steps fire in order, interlocks hold, nothing moves before its guard condition.
- Motion coordination, cam phasing and synchronization windows: if the twin's flying shear cuts mid-product, so will the machine's.
- Directions and offsets, wrong sign conventions and home offsets are embarrassing on site and free to find on screen.
- HMI/operator flow, walk an operator through the virtual machine's behaviour before FAT.
What a twin does not validate
Machinery Twin visualizes what the PLC reports, it does not simulate physics back to the controller. Axis loads, collision forces, cycle-time-under-load and drive tuning still need the machine (or a physics-grade HIL rig). The twin's sweet spot is logic and kinematic commissioning, which is most of the schedule risk anyway.
Practical tips
- Run PLC and twin against a soft PLC on the same laptop (PLCSIM or a local TwinCAT runtime) for a fully portable commissioning rig.
- Keep a state machine animating product flow in the twin, driven by the PLC's tracking flags, products appearing and disappearing on cue is the fastest way to see tracking bugs.
- Save the project once mapping is complete; the same file remains your monitoring dashboard after commissioning.