Overview: Hardware-in-the-Loop vs Software-in-the-Loop for SIMATIC and SIMOTION
Hardware-in-the-Loop (HiL) is a virtual commissioning technique where a real programmable logic controller (PLC) executes the user program against a simulated plant, while software-in-the-loop (SiL) executes the entire controller virtually on a PC. Siemens documents both flows in entry 109758739 – "Application Example: SIMATIC/SIMOTION Virtual Commissioning with Hardware in the Loop". The reference example uses a real SIMOTION D controller and a SIMIT Unit as the only physical hardware; all other devices (drives, I/O, mechatronic components) are simulated inside SIMIT and the Mechatronics Concept Designer (MCD).
The same flow applies to a SIMATIC S7-1500 or S7-1200 controller. Siemens does not ship a TIA Portal reference project for HiL with SIMATIC; the recommended path for SIMATIC users is PLCSIM Advanced combined with SiL. This reference consolidates the published procedure, the underlying component contracts, and field-proven commissioning checks into a single engineering document.
HiL Architecture and Component Topology
The published HiL topology couples a real controller, a real SIMIT Unit, and virtual models running on engineering workstations. The signal flow is shown below.
Key contracts between blocks:
- Real controller ↔ SIMIT Unit: standard PROFINET or PROFIBUS DP. The SIMIT Unit terminates the fieldbus and exchanges I/O images with the SIMIT runtime on the engineering PC.
- SIMIT ↔ MCD: Functional Mock-up Unit (FMU 2.0) export from NX MCD loaded as a SIMIT-coupled model, or shared-memory coupling through the SIMIT MCD plugin.
- SIMIT runtime: simulates SINAMICS drives, SIMATIC I/O, third-party PROFINET devices, and software PLCs that act as slaves to the real controller.
Prerequisites: Software, Firmware, and Licensing
Match the installed component versions to those validated by Siemens for entry 109758739. A mismatch in the SIMIT version is the single most common source of coupling errors.
| Component | Validated Version | License / Notes |
|---|---|---|
| SIMIT | SIMIT 9.0 or later (SP updates applied) | SIMIT Base + Virtual Commissioning option |
| SIMIT Unit | 6AT8007-1AA10-0AA0 (PN/IE) | Mounted on DIN rail, 24 V DC supply, ships with firmware ≥ V1.4 |
| SIMOTION D | D4x5-2 / D4x5 / D410 | Firmware V4.4 or V5.x; SCOUT ≥ V5.2 |
| SIMATIC S7-1500 (alternative) | CPU 1515-2 PN, 1516-3 PN/DP, 1517-3 PN/DP, 1518-4 PN/DP | Firmware V2.5 or later; TIA Portal V15.1 or later |
| PLCSIM Advanced (SiL alternative) | PLCSIM Advanced V2.0 SP1 or later | Replaces HiL for code-only validation |
| NX MCD | NX 12 / 1847 / 1872 / 1899 | Export model as FMU 2.0 (Co-Simulation) |
| Engineering PC | Windows 10 64-bit, 16 GB RAM minimum, 100 GB SSD | Disable Hyper-V sleep; real-time class NIC for PROFINET |
Step-by-Step: HiL Commissioning with SIMOTION D and SIMIT Unit
The procedure mirrors the published example. Each step lists the engineering tool, the action, and the verification check.
Step 1 – Wire the SIMIT Unit to the controller
- Mount the SIMIT Unit (6AT8007-1AA10-0AA0) on a DIN rail next to the SIMOTION D rack.
- Connect X1 (PROFINET channel 1) of the SIMIT Unit to PROFINET port X150 of the SIMOTION D using a Cat-6 / Cat-7 patch cord, both ends terminated in TIA standard pinout (green pair on pins 3/6).
- Connect X2 (PROFINET channel 2) of the SIMIT Unit to the engineering PC; assign this NIC a static IP in the 192.168.0.0/16 range, separate from the controller subnet.
- Apply 24 V DC (range 19.2–28.8 V) to terminals L+ / M on the SIMIT Unit. The RDY LED transitions from green flashing to solid green within 30 s.
Step 2 – Assign IP addresses in SCOUT / TIA Portal
Configure three IP subnets. Document the assignments in the project configuration report so commissioning engineers can re-create the bench.
| Device | Subnet | IP Address | Subnet Mask |
|---|---|---|---|
| SIMOTION D / S7-1500 | Plant PROFINET | 192.168.0.10 | 255.255.255.0 |
| SIMIT Unit X1 | Plant PROFINET | 192.168.0.20 | 255.255.255.0 |
| SIMIT Unit X2 | Engineering | 192.168.1.20 | 255.255.255.0 |
| Engineering PC NIC | Engineering | 192.168.1.100 | 255.255.255.0 |
Step 3 – Build the SIMIT virtual plant
- Start SIMIT and create a new project. The project folder is the runtime container for all virtual components and the coupling configuration.
- Import the GSDML file of the SINAMICS drives and the SIMOTION D into the SIMIT device library. The GSDML version must match the firmware; mismatches produce diagnostic code
SF (red LED)on the SIMIT Unit. - Drop the SINAMICS S120 template, the SIMOTION D IO template, and the MCD coupling template onto the PROFINET subnet.
- Bind the I/O addresses: in SCOUT, assign the SINAMICS telegram 105 to logical address 256..271; in SIMIT, map the same telegram to the SIMIT-side SINAMICS instance.
- For MCD: in NX, select File → Export → Functional Mock-up Unit, set type to Co-Simulation 2.0, and tick SIMIT Compatible. Save the FMU and load it into the SIMIT project through the MCD coupling component.
Step 4 – Configure coupling in SIMIT
Open the SIMIT coupling editor and bind the SIMIT Unit X1 to the SIMIT runtime:
- Couplings → PROFINET: select the SIMIT Unit from the discovered devices (the SIMIT Unit advertises itself with vendor ID 0x002A and device ID 0x0501). Set the watchdog time to 3000 ms for commissioning; lower to 200 ms only after stability is proven.
- Couplings → MCD: point to the exported FMU file. The default step size is 1 ms; for kinematic models containing continuous collision detection, raise to 4 ms to keep the SIMIT cycle time below 80% of the PROFINET update time.
- Compile the SIMIT project. The compiler reports unused tags as warnings; missing signals abort the compile and write the affected address in the build log.
Step 5 – Download the user program to the real controller
- In SCOUT, connect online to the SIMOTION D over PROFINET (X150). Perform a full download (HW Config + user program + technology packages).
- Set the CPU to RUN. The SIMOTION D issues PROFINET AR (Application Relationship) to the SIMIT Unit; the SIMIT Unit logs the AR establishment in its web interface (https://192.168.0.20).
- Open the SIMIT online view. All simulated devices must show the green "connected" icon within 5 s of the controller going to RUN.
Step 6 – Execute tests and record results
- Use SCOUT trace or TIA Portal trace to record real signals on the real controller. The trace timestamp is the controller clock – do not rely on SIMIT-side time for sequence validation.
- For reproducible tests, drive the MCD model from a SIMIT test sequencer (.seq file). Sequences support WaitUntil, SetTag, CompareTag, and LogMessage primitives.
- Export the trace as CSV for diff comparison against the FAT (Factory Acceptance Test) protocol.
Alternative: HiL with SIMATIC S7-1500
Siemens does not publish a TIA Portal reference project for SIMATIC HiL. The official guidance is to switch to SiL with PLCSIM Advanced when the goal is controller code validation. If a real SIMATIC CPU must be exercised against a virtual plant, the configuration is structurally identical to the SIMOTION flow above:
- Install the same SIMIT version, the same SIMIT Unit, and the same Virtual Commissioning license.
- In TIA Portal, configure the S7-1500 PROFINET interface identically – same IP, same device name, same I/O addresses.
- Compile and download the S7-1500 user program. The PROFINET AR terminates at the SIMIT Unit; from the S7-1500 perspective the SIMIT Unit appears as a real PROFINET IO device.
- Validate that no GSDML version skew exists. The S7-1500 PROFINET stack rejects an AR whose GSDML major version differs from what the project expects; this surfaces as SF on the controller and a PROFINET IO controller diagnostic entry
Channel diagnosis - Error appears 1: Channel-specific diagnostics, channel 0.
Alternative: SiL with PLCSIM Advanced
For pure controller code validation, the recommended path is PLCSIM Advanced V2.0 SP1 or later. PLCSIM Advanced virtualises the S7-1500 / ET 200SP CPU and exposes a TCP-based API (default port 102 for ISO-on-TCP) so SIMIT can couple to the virtual instance.
- Install PLCSIM Advanced and start the PLCSIM Advanced Manager. Create a virtual instance with the same article number as the target CPU (e.g. 6ES7516-3AN02-0AB0 for 1516-3 PN/DP).
- Set the instance to Power on with the option Enable OPC UA server if OPC UA coupling to SIMIT is desired.
- In TIA Portal, set the PG/PC interface to PLCSIM Advanced TCP/IP and download the project. The download transport runs over the local TCP socket, not PROFINET.
- In SIMIT, use the PLCSIM coupling instead of the PROFINET coupling. The PLCSIM coupling transfers tag values via shared memory; cycle times are typically 10–50 ms, sufficient for PLC code but not for high-dynamic drive commissioning.
Verification Checklist
Run this checklist after the first RUN transition and again before each test sequence release. Any failed item blocks the next milestone.
| # | Check | Pass Criteria | Tool |
|---|---|---|---|
| 1 | SIMIT Unit RDY LED | Solid green | Visual |
| 2 | PROFINET AR established | No SF LED on controller; SIMIT online view shows all devices green | SCOUT / TIA Portal / SIMIT |
| 3 | Watchdog margin | SIMIT cycle time < 80% of configured watchdog | SIMIT statistics |
| 4 | I/O round-trip latency | Tag update latency < 2× PROFINET update time | SCOUT / TIA trace |
| 5 | MCD step time | Maximum MCD solver time < configured SIMIT step size | SIMIT log |
| 6 | Drive telegram validity | SIMOTION D / S7-1500 status word ZSW1 = 0x4xx (Ready / Operation enabled) | Watch table |
| 7 | Time synchronisation | Controller and SIMIT NTP offset < 50 ms | NTP query |
| 8 | Test sequence repeatability | Same MCD initial state + same tag initial state yields identical trace within 1 sample period | Trace diff |
Troubleshooting Matrix
Most HiL bench failures fall into one of the categories below. Use the table as a triage guide; the controller-side diagnostic buffer and the SIMIT Unit web interface provide the corroborating evidence.
| Symptom | Likely Root Cause | Diagnostic Path | Fix |
|---|---|---|---|
| Controller SF LED, SIMIT Unit shows AR aborted | GSDML version mismatch | Web interface → Diagnostics → PROFINET → Last AR-Reason | Match GSDML major version to the device firmware |
| Watchdog trips during MCD step | MCD solver exceeds SIMIT step time | SIMIT log → Coupling → MCD → Solver time | Raise SIMIT step to 4 ms; reduce MCD mesh complexity |
| Sinamics in SIMIT reports F08501 (PROFIdrive comms fault) | Telegram length mismatch | SCOUT address configuration vs SIMIT telegram mapping | Re-map telegram to match SCOUT logical address |
| SIMIT Unit boots, X1 link down | Subnets crossed (X1 on plant, X2 on engineering) | ipconfig /all on engineering PC | Reconnect patch cord to the correct port |
| PLCSIM Advanced does not see instance | PLCSIM Advanced service not started | services.msc → "PLCSIM Advanced Service" | Start service, set startup type to Automatic (Delayed Start) |
| MCD FMU import fails | FMU exported as Model Exchange instead of Co-Simulation | unzip FMU; check modelDescription.xml for "fmiModelType" | Re-export from NX as Co-Simulation 2.0 |
| OPC UA tags not visible in SIMIT | PLCSIM Advanced security policy mismatch | UaExpert session log | Set PLCSIM Advanced OPC UA security to None for bench; restrict in production |
| Trace records no data from virtual drives | SIMIT project not started | SIMIT status bar | Click Start; verify "Running" indicator |
Performance Sizing and Cycle Time Math
The HiL bench is real-time only inside bounded windows. Use the formulas below to size the bench before commissioning.
PROFINET IRT update time tPN is set in TIA Portal / SCOUT under PROFINET interface → Real-time settings → Send clock. Default is 1 ms.
SIMIT cycle time tSIMIT should be a submultiple of tPN:
t_SIMIT = t_PN / n, n ∈ {2, 4, 5, 10}
The SIMIT Unit buffers one PROFINET cycle. The maximum tolerable coupling latency is:
L_max = t_PN + 2 · t_SIMIT + t_MCD
where tMCD is the MCD solver step. For a 1 ms PROFINET cycle, 0.5 ms SIMIT cycle, and 4 ms MCD step:
L_max = 1 ms + 2 · 0.5 ms + 4 ms = 6 ms
This satisfies the SINAMICS S120 PROFINET watchdog default of 12 ms. If a tighter drive cycle is required, lower tMCD by simplifying the MCD kinematic chain (fewer collision bodies, lower mesh density).
Migration Notes: From SiL to HiL
Migrating an existing PLCSIM Advanced SiL bench to a real-controller HiL bench requires three changes:
- Replace the PLCSIM coupling in SIMIT with the PROFINET coupling pointing at the SIMIT Unit X1.
- Download the project to the real controller instead of the virtual instance. The user program and tag list remain unchanged.
- Update the FAT test protocol to indicate that the bench is now HiL – the trace timestamps are wall-clock from the controller, not from the SIMIT runtime, and the trace CSV header must be updated accordingly.
FAQ
Is there an official TIA Portal reference project for SIMATIC HiL?
No. Siemens states that no TIA Portal reference project for SIMATIC HiL is planned. Use the published SIMOTION D example (entry 109758739) as the structural reference and adapt it to the S7-1500 project. For code-only validation, use PLCSIM Advanced and SiL.
Which SIMIT Unit article number is required for HiL with a SIMOTION D?
Use 6AT8007-1AA10-0AA0 (SIMIT Unit PN/IE). It provides two PROFINET interfaces – X1 to the controller, X2 to the engineering PC – and is licensed through the SIMIT Virtual Commissioning option (6AV2 102-0AA07-0AA0).
Can I commission an F-CPU in HiL?
Only partially. PROFIsafe requires hard-real-time guarantees that the SIMIT Unit can only approximate, so PROFIsafe slot diagnostics should be validated against real safety I/O. Standard and failsafe user code logic can be exercised, but the safety acceptance test must remain on real hardware.
What is the maximum number of PROFINET devices SIMIT can simulate?
SIMIT 9.0 supports up to 256 PROFINET IO devices per coupling, subject to the SIMIT Unit firmware. For larger plants, split the project into multiple SIMIT Units and use the SIMIT distributed simulation option. Watchdog time must be re-validated for each SIMIT Unit after a split.
How do I export an NX MCD model for SIMIT?
In NX, open the MCD assembly, then File → Export → Functional Mock-up Unit. Select Co-Simulation 2.0, tick "SIMIT Compatible", and confirm the step size matches the SIMIT coupling step (1 ms or 4 ms). Load the resulting .fmu file into the SIMIT MCD coupling component; model-exchange FMUs are rejected at import time.