Cleaning Up and Optimizing CFC Runtime Groups in SIMATIC PCS 7 - Empty Group Removal and OB Execution Sequence
To efficiently clean up accumulated empty runtime groups and duplicate indexed groups (e.g., ChartName(1), ChartName(2)) in SIMATIC PCS 7 CFC, use the automated maintenance tools in the CFC Run Sequence window. In CFC Editor, click 'Edit Run Sequence' (or press Ctrl+F5) to open the execution hierarchy, then select 'Options > Delete Empty Runtime Groups'. This automatically purges all unused runtime groups across all cyclic interrupt OBs (OB30–OB38) in a single operation. To eliminate duplicated fragmented groups and minimize inter-block dead time, execute 'Options > Optimize Run Sequence...', which reorganizes block calls strictly according to process data flow, consolidating execution and reducing CPU cycle jitter.
Table of Contents
- Mechanics of CFC Runtime Groups: Why Duplicate Indexed Groups Accumulate
- Automated Removal of Empty Runtime Groups in the Run Sequence Editor
- Optimizing Run Sequences: Algorithm, Data Flow, and Cycle Delay Reduction
- Risks and Critical Considerations Before Executing Run Sequence Optimization
- Comparative Feature Matrix: Manual Cleanup vs Optimize Run Sequence
- Step-by-Step Procedure to Clean Up and Standardize Runtime Groups
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Mechanics of CFC Runtime Groups: Why Duplicate Indexed Groups Accumulate
In SIMATIC PCS 7 CFC (Continuous Function Chart), block execution is organized hierarchically within Organization Blocks (OBs) using Runtime Groups. When an engineer places a function block into a CFC chart, PCS 7 automatically creates a runtime group carrying the name of the CFC chart and assigns it to a default cyclic interrupt OB (typically OB35 with a 100 ms scan cycle).
Over extensive project lifecycles, copy-paste operations, and mass imports, engineers frequently notice the accumulation of duplicated group names with parenthetical suffixes, such as Drive101(1), Drive101(2), or Tank_Logic(1):
-
Chart Copying and Pasting: When a CFC chart is copied to create a new equipment unit and subsequently renamed, blocks moved between charts or pasted with existing runtime groups generate indexed copies to prevent name collisions in the underlying OB directory.
-
Import/Export Assistant (IEA) and Process Object View (POV): Instantiating multiple chart copies from master typicals creates independent runtime groups. If blocks within a chart are assigned to different OBs (e.g., an alarm block in OB35 and a fast drive block in OB32), multiple groups are spawned for that single chart.
-
Block Deletions: When blocks are deleted from a chart, their associated runtime group often remains empty within the OB sequence rather than being purged automatically.
Automated Removal of Empty Runtime Groups in the Run Sequence Editor
Manually searching through hundreds of runtime groups across OB30 to OB38 to find and delete empty groups is tedious and prone to accidental deletion of active groups. PCS 7 provides a dedicated automated purge mechanism:
- Open any CFC chart and launch the Run Sequence Editor (Ctrl+F5 or icon on the toolbar).
- In the Run Sequence window, select the top-level S7 Program node or any specific OB branch.
- Click menu Options > Delete Empty Runtime Groups (or right-click the OB and select the option).
- The CFC compiler immediately parses every runtime group in the project. Any runtime group containing zero function block calls is instantly removed from the OB directory.
This action is completely non-destructive: it removes empty structural containers without altering any active block calls, parameter interconnections, or download states.
Optimizing Run Sequences: Algorithm, Data Flow, and Cycle Delay Reduction
Beyond deleting empty groups, projects often suffer from sub-optimal block execution sequences where downstream calculation blocks execute before upstream sensor channel drivers. This introduces an unwanted one-cycle dead time (100 ms in OB35) while the downstream block waits for the next scan cycle to receive updated data.
The 'Optimize Run Sequence' tool resolves this:
-
Data Flow Analysis: The algorithm traces the interconnected signal paths from inputs (analog channel drivers like
FbAnIn) through technological logic (MonAnL,PIDConL) to outputs (FbAnOu,VlvL). -
Re-Ordering: The tool re-sequences the runtime groups and individual block calls within each OB so that every block executes after the blocks that supply its input data.
-
Consolidation: Fragmented runtime groups belonging to the same chart are brought into logical alignment.
Risks and Critical Considerations Before Executing Run Sequence Optimization
While 'Optimize Run Sequence' dramatically enhances deterministic closed-loop performance, engineers must understand its operational risks:
-
Altered Feedback Loops: In closed-loop systems with deliberate one-scan delay registers (e.g., flip-flop latches or edge-detection pulse registers), re-ordering execution sequence can change the scan cycle in which a pulse is detected.
-
PID Controller Tuning: Shifting a
PIDConLblock relative to its channel driver reduces loop dead time. While theoretically advantageous, it can slightly shift process dynamics in aggressively tuned, fast-responding control loops. -
CPU Stop Download Risk: Running 'Optimize Run Sequence' alters the execution order of blocks. In most cases, these changes can be downloaded in RUN mode (Changes Download). However, in massive charts with thousands of moved pointers, memory fragmentation in the CPU work memory can occasionally exceed the online download reserve, necessitating a planned controller restart.
Comparative Feature Matrix: Manual Cleanup vs Optimize Run Sequence
The following table compares manual runtime group editing against automated optimization tools in SIMATIC PCS 7 CFC:
| Feature / Metric | Manual Reorganization | Delete Empty Runtime Groups | Optimize Run Sequence Tool |
|---|---|---|---|---|
| Execution Scope | Single Group / Block | Entire S7 Program (All OBs) | Entire S7 Program or Selected OB |
| Operator Effort | Extremely High (Hours/Days) | One Click (Seconds) | One Click (Seconds) |
| Risk of Human Error | High (Accidental Deletions) | Zero (Only Empty Groups Removed) | Low to Moderate (Altered Sequence) |
| Cycle Dead Time Reduction | Manual Tracing Required | None (Containers Only) | Automated Maximum Dead Time Reduction |
| Impact on CPU Execution Order | User Controlled | None | Algorithmically Deterministic |
| Online Download Capability | Changes Download in RUN | Changes Download in RUN | Changes Download in RUN (99% cases) |
Step-by-Step Procedure to Clean Up and Standardize Runtime Groups
Follow this engineering procedure to clean up and optimize the CFC runtime execution structure:
-
Archive the Project:
- Before performing structural reorganizations, create a complete project archive in SIMATIC Manager (File > Archive). -
Open Run Sequence Editor:
- In CFC, click the Run Sequence icon or press Ctrl+F5.
- The window displays the execution tree showing task branches (OB100,OB32,OB35, etc.). -
Purge Empty Runtime Groups:
- Click menu Options > Delete Empty Runtime Groups.
- The editor scans the tree and removes all empty folders immediately. -
Run Optimization Algorithm:
- Click menu Options > Optimize Run Sequence...
- A warning dialog informs you that the execution order of blocks within runtime groups will be rearranged according to data flow.
- Click OK to proceed.
- The progress bar completes the structural sort. -
Reconcile Duplicate Group Names (Optional):
- If duplicate names likeMotor(1)remain because blocks are split across OBs, inspect their properties.
- If both groups are in the same OB, drag the blocks fromMotor(1)intoMotorand delete the empty container. -
Compile and Download Changes:
- In CFC, run CFC > Compile > Changes only.
- Download changes to the target CPU in RUN mode.
Verification
Verify the clean runtime sequence through the following checks:
- Open the Run Sequence Editor. Expand
OB35and verify that no empty runtime group folders exist. - Check that the total count of runtime groups is substantially reduced and aligns with the active CFC chart count.
- Perform a CFC Compile (Changes only). Verify that compilation finishes with 0 errors.
- In SIMATIC Manager, open Module Information for the CPU (
Ctrl+D) and check the Scan Cycle Time tab. Verify that the maximum and current cycle times remain stable within expected engineering boundaries. - Monitor critical analog control loops in CFC Test Mode to confirm that sensor inputs update actuator outputs smoothly without phase lag.
Limitations and Operational Precautions
- SFC Chart Interactions: Sequential Function Charts (SFC) have their own runtime groups in OB35. 'Optimize Run Sequence' respects SFC interfaces, but engineers should avoid manually moving SFC internal blocks.
- Driver Generator Blocks: The PCS 7 Driver Generator automatically creates module driver runtime groups prefixed with
@. Never manually rename, delete, or relocate@-prefixed runtime groups, as the compiler will regenerate them during the next compile. - Redundant S7-400H Controllers: In high-availability configurations, performing large-scale runtime sequence optimizations during critical production runs is discouraged; schedule sequence optimizations during planned maintenance windows.
Engineer FAQ
Why are runtime group names appended with (1) or (2)?
When a chart has blocks assigned to different OBs (for example, some blocks in OB35 and others in OB32), PCS 7 creates an indexed runtime group in each OB using the chart name. Indexing also occurs if an existing runtime group name already exists in that OB.
Can I rename a runtime group without affecting the CFC chart?
Yes. Runtime groups are internal execution containers. Renaming a runtime group in the Run Sequence editor does not rename the parent CFC chart or break tag interconnections.
What does 'Delete Empty Runtime Groups' do to blocks inside disabled groups?
Nothing. If a runtime group contains blocks—even if the group itself has its 'Active' attribute disabled—it is not empty, so it will not be deleted.
Does optimizing the run sequence change the cycle time of the OB?
No. The cyclic interrupt interval of the OB (e.g., 100 ms for OB35) is fixed in Hardware Configuration. Optimization only changes the internal order in which blocks execute within that 100 ms window.
Can I lock specific blocks from being moved during optimization?
Yes. In the runtime group properties, you can uncheck the option 'Optimization of run sequence' to protect specific custom groups from being re-ordered by the automated algorithm.
Technical References
- SIMATIC Process Control System PCS 7 CFC for S7 (V8.2 / V9.0) Manual - Chapter 6: Runtime Attributes and Run Sequence
- Siemens Industry Online Support (SIOS) Entry ID 180462 - How to cleanup the Runtime group
- SIMATIC PCS 7 CPU 410-5H Process Automation System Manual - Section 5: Task Scheduling and Interrupt Organization Blocks
- Siemens Industrial Automation Engineering Guidelines - Optimizing CFC Signal Processing Sequences
Related Articles
- Migrating CFC Runtime Groups Between Cyclic Interrupt OBs - OB35 to OB37 Execution Rules
- Troubleshooting S7-400 CPU Scan Cycle Overruns and OB Execution Sequences
- Understanding AS-OS Compile Mechanics and Tag Deletion Rules in SIMATIC PCS 7
- Mastering the Process Object View (POV) in SIMATIC PCS 7 - Bulk Parameterization
Related Tags
- CFC
- Runtime Groups
- Run Sequence
- OB35
- Optimization
- Cycle Time
- AS Engineering