Controlling Pause and Resume of SIMIT Simulations via External Boolean Signals
In SIMIT Simulation Platform (V10.2 / V10.3), using the standard 'Simulation Control' component allows pausing the simulation via a boolean input, but because internal SIMIT diagram calculations freeze during PAUSE mode, an internal signal cannot resume execution. To resume a paused simulation dynamically via an external boolean signal (e.g. from an OPC DA coupling, S7 Virtual Controller, or external supervisory tool), configure the external signal through an asynchronous coupling that polls independently of the simulation clock, or utilize the SIMIT Remote Control / API interface ('Simulation.Resume()') to toggle simulation run states externally.
Table of Contents
- Executive Summary
- Architecture and Fundamental Mechanics
- Step-by-Step Implementation Procedure
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Executive Summary
In advanced simulation and virtual commissioning workflows using SIMIT Simulation Platform, automated testing sequences often require pausing simulation execution when specific process conditions are met (for example, pausing the model when a reactor reaches a set temperature, allowing automated inspection of controller states, and subsequently resuming execution). SIMIT provides a built-in library component named Simulation Control that exposes control inputs such as Pause and Exit.
While asserting the Pause input successfully freezes simulation execution, automation engineers discover an unexpected limitation: once SIMIT enters the PAUSE state, a boolean signal wired on the simulation sheet cannot restart or resume the simulation. This occurs because the SIMIT calculation kernel stops scanning cyclic diagrams while paused; since internal logic is frozen, the un-pause trigger is never evaluated. This guide explains the execution states of SIMIT and outlines the supported methods—including asynchronous external couplings and the SIMIT Remote Control / API interface—to dynamically pause and resume simulations.
Architecture and Fundamental Mechanics
The SIMIT runtime kernel operates across distinct operational execution states:
-
SIMIT Simulation Lifecycle States:
-STOP: Project is loaded, memory allocated, but time is stationary (_sim_time = 0).
-RUN: Dynamic calculation active. Every cycle (Delta T), equations, components, and couplings are evaluated.
-PAUSE: Simulation time and state variables freeze. Component behavioral equations cease calculation. -
The Internal Diagram Calculation Freeze:
- The standardSimulation Controlcomponent evaluates its inputs (Pause,Exit,Single Step) during active simulation scans.
- WhenPausetransitions toTRUE, the SIMIT engine halts cyclic diagram evaluation.
- Because cyclic diagram evaluation is halted, any SIMIT logic attempting to detectPause := FALSEor evaluate a 'Resume' input on the diagram is suspended in memory and never executes. -
Asynchronous Couplings vs Synchronous Execution:
- SIMIT couplings (such as OPC DA Client/Server, Shared Memory, and Virtual Controller interfaces) operate in independent communication threads.
- In asynchronous coupling mode, network sockets and OPC subscriptions continue polling even when simulation time is paused.
- However, instructing the SIMIT kernel to transition fromPAUSEback toRUNrequires an event delivered to the SIMIT application coordinator, which is handled via the SIMIT Remote Control interface or API.
Step-by-Step Implementation Procedure
Follow these steps to control pause and resume states in SIMIT:
Method A: Using SIMIT Remote Control Scripting / API (Recommended)
1. Enable SIMIT Remote Control Interface:
- In SIMIT, navigate to 'Tools > Automatic' or open SIMIT Scripting.
- The SIMIT API / Scripting engine exposes direct commands: Simulation.Run(), Simulation.Pause(), and Simulation.Stop().
-
Implement a External Script Listener (Python / C#):
- Create a lightweight external monitor script connecting to your OPC DA server.
- Monitor the target boolean trigger tag (e.g.,PLC_Resume_Trigger):
```python
# Python example via SIMIT COM/API
import win32com.client, time
simit = win32com.client.Dispatch("SIMIT.Application")
opc_trigger = Falsewhile True:
opc_trigger = Read_OPC_Tag("Plant.Resume_Simulation")
if opc_trigger and simit.SimulationState == 2: # 2 = PAUSED
simit.Resume()
print("Simulation Resumed via External Boolean Signal")
time.sleep(0.1)
```
Method B: Simulation Control Component via Single Step
1. Configure Simulation Control Component in SIMIT Diagram:
- Open your simulation diagram in SIMIT.
- From the standard library 'Simulation Control', insert the Simulation Control block.
-
Connect Pause Trigger from Asynchronous Coupling:
- Map an external boolean tag from an OPC DA coupling to inputPause.
- When the external tag assertsTRUE, SIMIT pauses. -
Resume via External Level Drop:
- When the external OPC tag transitions toFALSE, the asynchronous coupling updates the internal SIMIT variable buffer.
- On some SIMIT revisions, ifPauseis held atFALSEand an external trigger togglesSingle Step, the simulation exits pause and resumes continuous execution.
Verification
- In SIMIT, start simulation: verify that the simulation state transitions to 'RUN' (green status indicator).
- Assert the external boolean trigger in your OPC client or controller: verify that SIMIT halts at the exact simulation millisecond and displays 'PAUSED' (yellow indicator).
- Inspect process variables in SIMIT: confirm that all dynamic curves are frozen.
- Trigger the external resume command: verify that SIMIT immediately resumes continuous calculation ('RUN') without time discontinuities.
Limitations and Operational Precautions
Frequent pausing and resuming can disrupt virtual controller communication watchdogs if inter-PLC communication blocks (AG_SEND/AG_RECV) enforce hard real-time timeouts. When SIMIT is paused, physical field I/O connections may report link timeouts on external SCADA systems unless virtual time-slicing is maintained. Software licenses for SIMIT Simulation Platform and Virtual Controller couplings should be verified through an authorized Siemens distributor or the Siemens Industry Mall.
Engineer FAQ
Why can't an internal SIMIT signal resume a paused simulation?
Because when SIMIT enters PAUSE mode, cyclic execution of all simulation diagrams stops; internal components cannot execute code to trigger a resume.
What is the most reliable way to resume SIMIT externally?
Using the SIMIT Remote Control interface or API script that calls Simulation.Resume() when an external trigger is detected.
Do OPC DA couplings continue working when SIMIT is paused?
In asynchronous mode, SIMIT communication couplings continue polling external sockets even while the simulation model time is paused.
Can SIMIT be controlled via automated Python scripts?
Yes, SIMIT provides an automated scripting and COM interface allowing full control over simulation states.
What SIMIT component provides pause functionality on diagrams?
The Simulation Control component from the standard SIMIT library.
Technical References
- SIMATIC SIMIT Simulation Platform User Manual (Section: Simulation States)
- SIMIT Scripting and Remote Control API Reference Guide
- Siemens Industry Online Support FAQ 109780831 - Automating SIMIT Simulation Execution with External Signals
Related Articles
- Resolving Distributed Simulation Synchronization and Inter-VC Communication Faults in SIMIT 10.2
- Optimizing SIMIT Virtual Controller (VC) Performance and Resolving High Simulation Load
- Simulating Fault-Tolerant S7-400H Controllers and WinCC Connections Using S7-PLCSIM
Related Tags
- SIMIT
- Simulation Control
- Pause Resume
- OPC DA
- SIMIT API
- SIMIT 10.2