Resolving Blocks Appearing Twice in CFC Run Sequence (OB1 and MAIN_TASK in CEMAT and PCS 7 V8.2)
When copying charts from a library or another project in PCS 7 V8.2 with the CEMAT Minerals add-on and finding that blocks appear duplicated in the run sequence (appearing twice under OB1 / MAIN_TASK), the root cause is a known sequencing defect in early CFC V8.2 releases when handling single-OB CEMAT block types. In standard PCS 7 APL, blocks insert into both OB100 and an interrupt OB (OB30-OB38). Because CEMAT blocks execute exclusively in OB1 (MAIN_TASK), the CFC insertion engine improperly creates duplicate runtime instances. Updating to CFC V8.2 Upd1 (or higher) and AS-OS-Engineering hotfixes permanently resolves this defect.
Table of Contents
- Execution Order Concepts: Standard APL vs CEMAT MAIN_TASK
- Mechanics of the Block Duplication Defect in CFC V8.2
- How CFC 'Predecessor for Inserted Position' Operates
- Step-by-Step Remediation: Software Updates and Runtime Sequence Cleanup
- APL vs CEMAT Task Execution Architecture Comparison
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Execution Order Concepts: Standard APL vs CEMAT MAIN_TASK
In standard SIMATIC PCS 7 Advanced Process Library (APL), blocks are designed around a dual-OB execution paradigm: every control block is automatically inserted into OB100 (Complete Restart) to initialize internal parameters, and into a Cyclic Interrupt OB (OB30 to OB38) for ongoing process execution.
The CEMAT (Minerals & Mining) library adheres to a fundamentally different operational philosophy. Due to the high speed and strict chronological sequencing required by cement conveyor lines, kilns, and ball mills, almost all CEMAT blocks (C_DRV_1D, C_DRV_2D, C_DAMPER, C_VALVE) are designed to execute strictly in OB1 (Free Cycle / MAIN_TASK). CEMAT manages its own internal startup routines and does not populate OB100.
Mechanics of the Block Duplication Defect in CFC V8.2
In SIMATIC PCS 7 V8.1 and the initial release of V8.2, Siemens modified the internal CFC chart insertion algorithm. When a chart is copied from a template library into a project, the insertion engine automatically scans the chart blocks and generates two insertion slots based on the assumed APL paradigm (one in startup, one in cyclic execution).
When handling CEMAT blocks where OB1 is defined as MAIN_TASK and no cyclic interrupt OB is specified, the unpatched CFC V8.2 compiler attempts to resolve the dual insertion slots by placing the block into MAIN_TASK twice:
OB1\MAIN_TASK\M01_MotorOB1\MAIN_TASK\M01_Motor(1)
This duplication causes blocks to execute twice per PLC cycle, doubling CPU scan time, corrupting edge-detection flags, and causing intermittent command toggling.
How CFC 'Predecessor for Inserted Position' Operates
In CFC, the Predecessor for inserted position determines where newly added blocks are placed in the execution order:
- In APL, clicking 'Predecessor for inserted position' displays two targets:
OB35\Block_XandOB100\Block_X(1). - In CEMAT projects exhibiting the bug, the predecessor dialog displays only
MAIN_TASK, and selecting it inserts duplicate runtime groups into OB1.
Siemens confirmed this behavior as a software bug in CFC V8.2, addressed under internal tracking notes and resolved through subsequent software updates.
Step-by-Step Remediation: Software Updates and Runtime Sequence Cleanup
To permanently eliminate block duplication and clean up affected charts:
- Install CFC Update: Download and install SIMATIC CFC V8.2 Upd1 (or the latest CFC update for your PCS 7 release) along with the corresponding AS-OS-Engineering update from SIOS.
- Open CFC Runtime Editor: Open any CFC chart and press Ctrl+R (or Options > Runtime Groups).
- Audit OB1 (MAIN_TASK): Expand
OB1in the tree. Look for duplicate block entries marked with(1). - Delete Duplicate Runtime Groups: Select the duplicate block instances (the ones ending in
(1)) and delete them. Do NOT delete the block from the CFC chart; delete only the duplicate insertion pointer in the Runtime Editor. - Recompile CFC Program: Execute Charts > Compile > Entire Program with 'Generate Module Drivers'.
- Verify Single Execution: Check the compiled program to ensure each CEMAT drive executes exactly once per cycle.
APL vs CEMAT Task Execution Architecture Comparison
The following table compares execution characteristics between standard PCS 7 APL and CEMAT libraries:
| Architectural Dimension | SIMATIC PCS 7 APL | SIMATIC PCS 7 CEMAT |
|---|---|---|---|
| Primary Execution OB | Cyclic Interrupts (OB30 to OB38) | Free Cycle (OB1 / MAIN_TASK) |
| Startup Initialization OB | OB100 (Mandatory dual insertion) | None (Handled internally in OB1) |
| Typical Execution Frequency | Fixed equidistant time (e.g., 100 ms) | As fast as possible (every CPU cycle) |
| Runtime Group Naming | OB3x\ChartName & OB100\ChartName(1) | OB1\MAIN_TASK\ChartName |
| CFC V8.2 Unpatched Behavior | Clean insertion into OB3x and OB100 | Erroneously duplicates into MAIN_TASK(1) |
| Recommended Patch Level | Standard PCS 7 V8.2 Base | CFC V8.2 Upd1+ and AS-OS-Eng Upd1+ |
Verification
Verify single execution and sequencing integrity through the following steps:
- Open a newly copied CEMAT chart in CFC. Right-click any block and select Predecessor for inserted position.
- Confirm that only a single runtime group target in
MAIN_TASKis displayed, without duplicate secondary slots. - Open the Runtime Editor (Ctrl+R). Confirm that each block appears exactly once under
OB1. - Connect online to the AS. Verify that drive command pulses, fault latches, and runtime hours increment at the expected rate.
- Confirm that the CPU cycle time in Module Information is not inflated by duplicate execution passes.
Limitations and Operational Precautions
Consider these operational rules when managing CEMAT run sequences:
-
Never Execute CEMAT Drives in Fast Interrupt OBs: Placing CEMAT blocks into OB35 violates CEMAT interlocking philosophy, as downstream conveyor group coordination expects cyclic execution in OB1.
-
Delta Download Safety: Deleting duplicate runtime insertion pointers in the Runtime Editor can be downloaded via Delta Download in RUN without stopping the AS.
-
Chart Copy Best Practice: When copying charts between multiprojects, ensure that both engineering stations run identical software update levels to prevent introducing obsolete insertion behaviors.
Engineer FAQ
What is the consequence of a block executing twice in one cycle?
Executing twice corrupts one-shot pulse timers, doubles CPU scan time overhead, and can cause erratic contactor command chatter.
How do I safely delete the duplicate entry without deleting the block?
Open the CFC Runtime Editor (Ctrl+R), expand OB1, select only the entry ending in (1), and press Delete. Do not delete the block from the CFC drawing sheet.
Can I use both APL and CEMAT blocks in the same CPU?
Yes, but APL blocks should execute in cyclic interrupt OBs (OB30-OB38) while CEMAT blocks should remain in OB1 (MAIN_TASK).
Technical References
- SIMATIC PCS 7 CEMAT V8.0 / V8.1 / V8.2 Engineering Manual (Entry ID: 109780813)
- SIMATIC Process Control System PCS 7 CFC for S7 / S7-400 Manual
- Siemens Industry Online Support: Updates for SIMATIC PCS 7 V8.2 and CFC V8.2
- CEMAT Minerals Object Description and Runtime Sequence Guidelines
Related Articles
- Connecting CEMAT C_DRV_1D Instance Data Blocks to WinCC Diagnostic Faceplates
- Configuring Direction-Dependent Interlocks for CEMAT Bi-Directional Drive C_DRV_2D
- Troubleshooting S7-400 High CPU Load (95%) and Emergency Operation
Related Tags
- CEMAT
- Run Sequence
- MAIN_TASK
- OB1
- CFC V8.2
- Duplicate Blocks