Reading Simulation Step Time in SIMIT Component Type Editor (CTE): Numerical Integration and Differentiation Techniques
In the SIMIT Component Type Editor (CTE), you can obtain the simulation cycle time and step size using the built-in simulation environment variable DELTA_TIME (or by evaluating the time slice execution period dt). SIMIT provides native environment variables that reflect the active time slice frequency (e.g. 100 ms for Slice 2). In CTE behavioral code, you use DELTA_TIME to perform discrete numerical integration (e.g., Forward Euler: y = y_old + x * DELTA_TIME) or numerical differentiation (e.g., dy_dt = (x - x_old) / DELTA_TIME) directly within your custom simulation component.
Table of Contents
- Component Type Editor (CTE) Modeling Architecture in SIMIT
- Accessing Simulation Step Time: DELTA_TIME and Simulation Time
- Time Slices and Execution Frequencies in SIMIT
- Numerical Integration and Differentiation Algorithms in SIMIT CTE
- SIMIT CTE Environment Variables and Execution Characteristic Matrix
- Step-by-Step Implementation of a Custom Integrator Component
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Component Type Editor (CTE) Modeling Architecture in SIMIT
SIMIT Simulation Platform allows automation engineers to validate PCS 7 control logic against dynamic virtual process models prior to site commissioning. While the standard SIMIT library provides ready-to-use valves, drives, and transmitters, specialized chemical reactors, conveyors, or thermodynamics frequently require proprietary behavioral equations created in the Component Type Editor (CTE).
In CTE, components are modeled using high-level behavioral programming that defines inputs, outputs, state variables, and topological links. To model physical phenomena like liquid level accumulation, temperature heating curves, or acceleration, the component algorithm must know the exact physical elapsed time per calculation step.
Accessing Simulation Step Time: DELTA_TIME and Simulation Time
SIMIT provides predefined, implicit system variables accessible within the behavioral section of any CTE component:
-
DELTA_TIME: Represents the duration of the current calculation cycle (step size) expressed in seconds (Data Type:DOUBLE). If the component executes in Time Slice 2 configured for 100 ms,DELTA_TIMEevaluates to0.100. -
SIMULATION_TIME: Represents the total continuous simulated elapsed time since simulation start in seconds. -
CYCLE_COUNT: An integer incrementing by 1 on every executed simulation slice step.
By querying DELTA_TIME, mathematical equations automatically scale accurately even if the user speeds up, slows down, or freezes the simulation clock.
Time Slices and Execution Frequencies in SIMIT
SIMIT organizes model execution into up to eight discrete Time Slices:
- Time Slice 1: High-speed dynamics (typically 10 ms to 20 ms), suitable for fast electrical drives or pressure surges.
- Time Slice 2: Standard process dynamics (typically 100 ms), matching standard PCS 7 cyclic interrupt OB35.
- Time Slice 3 to 8: Slow thermal dynamics or mass balancing (typically 500 ms to 2000 ms).
When a CTE component is placed into a simulation chart, its execution time slice dictates the value populated into DELTA_TIME.
Numerical Integration and Differentiation Algorithms in SIMIT CTE
Implementing discrete calculus in CTE is straightforward:
-
Euler Integration (Accumulation):
Output = Output + Input * DELTA_TIME;
With upper/lower clamping:Output = MAX(MinLimit, MIN(MaxLimit, Output)); -
First-Order Lag (PT1 Filter):
Output = Output + (Input - Output) * (DELTA_TIME / TimeConstant); -
Numerical Differentiation (Rate of Change):
Derivative = (Input - Previous_Input) / DELTA_TIME;
Previous_Input = Input;
SIMIT CTE Environment Variables and Execution Characteristic Matrix
The following table summarizes SIMIT CTE environment parameters and their operational specifications:
DELTA_TIMEDOUBLESIMULATION_TIMEDOUBLECYCLE_COUNTINTEGERINITIAL_RUNBOOLEANStep-by-Step Implementation of a Custom Integrator Component
Follow this procedure to build an integrator component in SIMIT CTE:
- Launch Component Type Editor: In SIMIT, open CTE from the Tools menu.
- Define Interface: Create a new component
Custom_Integrator. In the interface table, define:
- InputIn(DOUBLE)
- InputReset(BOOLEAN)
- OutputOut(DOUBLE)
- State VariableAccumulator(DOUBLE) - Write Behavioral Equations: In the Behavior tab, write:
text if (Reset) { Accumulator = 0.0; } else { Accumulator = Accumulator + In * DELTA_TIME; } Out = Accumulator; - Build Component: Click Build Component. Verify 0 syntax errors.
- Instantiate in Simulation Chart: Drag
Custom_Integratoronto a SIMIT diagram and assign it to Time Slice 2 (100 ms). - Execute and Validate: Start SIMIT simulation; feed a constant rate of 10.0 and verify
Outrises by exactly 10.0 every second.
Verification
Verify component timing accuracy using these steps:
- Trend Recording: In SIMIT, attach a Trend recorder to
OutandSIMULATION_TIME. - Time Base Audit: Ensure that with an input of 1.0, the accumulator reaches 60.0 after exactly 60 seconds of simulation time.
- Slice Independence: Change the component's Time Slice from 100 ms to 50 ms. Confirm that the integration slope remains identical because
DELTA_TIMEhalved automatically. - Freeze / Pause Test: Pause simulation and verify integration ceases instantly without numerical drift.
Limitations and Operational Precautions
Keep these numerical limitations in mind:
-
Division by Zero in Differentiators: Always guard against zero
DELTA_TIMEduring simulation initialization:if (DELTA_TIME > 0.0) { ... }. -
Euler Integration Instability: For stiff differential equations with very small time constants, simple Euler integration can become unstable if the time slice is too large. Reduce the slice period or use Runge-Kutta formulations.
-
Commercial Accuracy Disclaimer: Software order numbers (MLFBs), package structures, and hardware capacity prerequisites vary across PCS 7 versions and hardware platforms. System integrators must confirm exact software entitlements and licensing requirements against the official Siemens Catalog CA 01 and obtain an authorized Siemens distributor quotation prior to purchasing.
Engineer FAQ
What unit of measurement does DELTA_TIME use in CTE?
DELTA_TIME is strictly evaluated in floating-point seconds (e.g., 0.100 s for 100 ms).
Can CTE components access variables from other components directly?
CTE components communicate via topological connectors and input/output pins, preserving modularity and avoiding memory pointer dependencies.
Is a separate license required to use the Component Type Editor in SIMIT?
Yes. The Component Type Editor (CTE) requires the SIMIT CTE license option or SIMIT Professional/Ultimate package.
Technical References
- SIMATIC SIMIT Simulation Platform Component Type Editor Manual (Entry ID: 109746516)
- SIMIT V9.0 / V10.0 Simulation Platform System Manual (Entry ID: 109746517)
- Siemens Industry Online Support (SIOS) Application Example: Modeling Custom Components in SIMIT CTE (Entry ID: 109740190)
- SIMATIC PCS 7 Virtual Commissioning with SIMIT Guide (Entry ID: 109751825)
Related Articles
- SIMIT Simulation OPC UA Coupling to Controller - Resolving BadConfigurationError and Application Certificate Faults
- Resolving CFC Test Mode Error 0xFFDF_011E (DATABASE_DISCONNECTED) with S7-PLCSIM in SIMATIC PCS 7
- Simulating SIMATIC PCS 7 Advanced Process Functions (APF) with S7-PLCSIM
Related Tags
- SIMIT
- Component Type Editor
- CTE
- DELTA_TIME
- Simulation Step
- Virtual Commissioning
- Numerical Integration