Resolving SIMATIC BATCH Forever 'Closing' State Caused by Inactive WinCC Alarm Logging Runtime

Resolving SIMATIC BATCH Forever 'Closing' State Caused by Inactive WinCC Alarm Logging Runtime

In SIMATIC BATCH, completed batches becoming permanently stuck in the 'Closing' state within the Batch Control Center (BatchCC) is frequently caused by the WinCC 'Alarm Logging Runtime' service not running on the connected OS Server. SIMATIC BATCH relies on WinCC Alarm Logging to receive, process, and acknowledge system messages, phase transition events, and batch completion telegrams. When a recipe completes, the Batch Server sends a batch termination notification to WinCC Alarm Logging and halts state transition until Alarm Logging acknowledges the archived records. If Alarm Logging Runtime is disabled in the WinCC Computer Startup properties or has crashed, the acknowledgment is never returned, leaving the batch in 'Closing'. To resolve this, enable 'Alarm Logging Runtime' in WinCC Computer Properties, restart WinCC Runtime, and trigger a batch status update.

Table of Contents

Executive Summary

SIMATIC BATCH provides ISA-88 compliant batch execution and automated recipe control for SIMATIC PCS 7. A critical operational failure occurs when production batches successfully finish their final recipe phase but remain stuck indefinitely in the 'Closing' state within BatchCC, preventing automatic archiving, report generation, and unit release. While engineers often suspect database corruption in SBDatabase, the underlying fault frequently lies within the WinCC Alarm Logging runtime engine. The SIMATIC BATCH Server (bfsrvx.exe) requires a mandatory message handshake with WinCC Alarm Logging (CCAlgRtServer.exe) to validate that all batch alarms and step messages are committed to the SQL database before transitioning the batch state to 'Closed'. Re-enabling Alarm Logging Runtime resolves the condition.

Architecture and Fundamental Mechanics

The lifecycle of a batch in SIMATIC BATCH transitions through discrete operational states defined by ISA-88: Planned -> Released -> Ready to start -> Running -> Completed -> Closing -> Closed -> Archived:

  1. The 'Closing' Transition Mechanics:
    * When the recipe execution logic in the AS (Equipment Phases / BPC blocks) completes the final step, SIMATIC BATCH transitions the batch status from 'Running' to 'Completed'.
    * The Batch Server then initiates the 'Closing' sequence: it collects final process values, aggregates recipe execution steps, and flushes all pending event telegrams to the WinCC message subsystem (BFC - Batch Flow Control / WinCC Alarm Logging).
  2. The Alarm Logging Handshake Dependency:
    * WinCC Alarm Logging runtime (CCAlgRtServer.exe) receives batch event messages (message numbers allocated to SIMATIC BATCH, typically blocks EVENT, BATCH_MSG) and inserts them into the WinCC SQL archive database (<ProjectName>ALG.mdf).
    * Once the messages are written and committed, WinCC Alarm Logging dispatches a return receipt (acknowledgment telegram) back to the Batch Server via local inter-process communication.
    * Upon receipt of this confirmation, the Batch Server writes the final batch record into the local Batch database (SBDatabase.mdf), releases the unit allocation lock, and promotes the batch status to 'Closed'.
  3. Why Inactive Alarm Logging Causes a Deadlock:
    * If 'Alarm Logging Runtime' is unchecked in the WinCC Computer Properties Startup tab (common in simulation, testing environments, or after manual commissioning), or if the alarm server crashed, no process is listening to receive or acknowledge batch messages.
    * The Batch Server enters an indefinite waiting state. Because the required acknowledgment never arrives, the batch remains stuck in 'Closing'. Units allocated to the batch cannot be re-allocated to new recipes, halting continuous production.

Step-by-Step Implementation Procedure

Follow these diagnostic and configuration steps to resolve batches stuck in the 'Closing' state:

  1. Verify Alarm Logging Runtime in WinCC Explorer:
    * On the active OS Server hosting the SIMATIC BATCH communication interface, open WinCC Explorer.
    * In the left tree, right-click Computer and select Properties.
    * Select the local computer name in the right pane and click Properties.
    * Navigate to the Startup tab.
    * Inspect the list of runtime applications. Verify that Alarm Logging Runtime is checked.
    * If unchecked, check Alarm Logging Runtime, click OK, and prepare to restart runtime.
  2. Check the Status of CCAlgRtServer.exe:
    * While WinCC Runtime is active, press Ctrl + Shift + Esc to open Windows Task Manager.
    * Navigate to the Details tab.
    * Look for the executable CCAlgRtServer.exe.
    * If the process is absent or shows 0% CPU with memory errors, Alarm Logging has failed to initialize.
  3. Restart WinCC Runtime and Batch Services:
    * Deactivate WinCC Runtime cleanly using the Deactivate button in WinCC Explorer.
    * Open the SIMATIC BATCH Launch Coordinator (or Windows Services services.msc).
    * Stop the SIMATIC BATCH Server service (BFAgent, BFServer).
    * Activate WinCC Runtime and wait until all startup components—including Alarm Logging—initialize completely.
    * Start the SIMATIC BATCH Server service.
  4. Force Batch State Transition in BatchCC:
    * Open SIMATIC Batch Control Center (BatchCC).
    * Locate the batch stuck in 'Closing'.
    * Right-click the batch and select Update or Properties.
    * If the batch does not transition immediately to 'Closed', select Batch > Terminate or Close batch manually (if configured with administrative authorization).
    * Confirm that the status updates to 'Closed'.
  5. Compile and Download SIMATIC BATCH (If Recurrent):
    * In SIMATIC Manager, select Options > SIMATIC BATCH.
    * Execute Compile and perform a Download of the batch data to ensure message assignments match the current WinCC project.

Verification

After enabling Alarm Logging Runtime and restarting WinCC, execute a short test recipe in BatchCC. Monitor the batch lifecycle as it reaches the final phase. Verify that the status transitions seamlessly from 'Completed' through 'Closing' to 'Closed' within 5 to 15 seconds. Confirm that the batch report generates without missing message records and that the allocated unit is released for subsequent recipes.

Limitations and Operational Precautions

Never kill WinCC or SIMATIC BATCH processes forcibly via Task Manager during an active batch closing sequence, as this can corrupt the SBDatabase transaction log or leave dangling locks in SQL Server. If manual batch intervention is required, use BatchCC administrative tools. Ensure adequate disk space is available for the WinCC Alarm Logging database segment.

Engineer FAQ

Why did the batch execute all steps if Alarm Logging was off?

Phase execution and recipe control logic occur directly inside the AS controller (via SFC/BPC blocks). Alarm Logging is only required for message recording, operator event tracking, and the final completion handshake.

Can I close the batch if the OS Server is completely offline?

No. The Batch Server requires communication with the OS Server message subsystem to complete the ISA-88 compliant batch closure and archive record generation.

What happens to unit allocation while a batch is stuck in 'Closing'?

The equipment unit remains locked to the stuck batch, preventing any new batch from reserving or executing operations on that unit.

Does SIMATIC BATCH require Alarm Logging on OS Clients?

No. Alarm Logging Runtime must run on the OS Servers where the SIMATIC BATCH communication interface and message archive databases reside.

Technical References

Related Articles

Related Tags

  • SIMATIC BATCH
  • BatchCC
  • Closing State
  • Alarm Logging
  • CCAlgRtServer
  • WinCC Runtime
20 respuestas