CFC vs SFC for Pumping Station Change-Over Logic in PCS 7

David Krause13 min read
Best PracticesHMI ProgrammingSiemens
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

CFC vs SFC for Pumping Station Change-Over Logic in PCS 7

Continuous-duty pumping stations present a classic control-engineering problem: two (or more) pumps must share load with a defined working/reserve relationship, and the reserve must take over within bounded time when the running pump faults, trips on interlock, or fails its feedback. In a Siemens PCS 7 environment, the implementer is immediately faced with a language choice: write the change-over as a Continuous Function Chart (CFC) that polls every cycle, or model it as a Sequential Function Chart (SFC) that walks through steps and transitions. This reference compares both approaches for 24/7 pump change-over, documents the dedicated Siemens add-on libraries (CIS_CK Pump Manager, Industry Library APL aggregates), and shows the field-proven pattern that combines both languages when each is used for what it does best.

Scope. The guidance here applies to PCS 7 V8.x and V9.0 (SIMATIC PCS 7 / S7-400 AS stations, WinCC Comfort/Professional HMI). The CFC/SFC editor and the add-on libraries referenced are part of the standard engineering toolset. Verify exact catalog numbers and bundle availability against the current Siemens Industry Online Support portal before procurement.

1. Application Context: Working/Reserve Pump Architecture

A pumping station's redundancy strategy is not a programming decision, it is a process decision that the program must mirror. The driver below is mechanical wear and process availability:

  • Working pump (W): Selected at runtime to meet current flow demand.
  • Reserve pump (R): Stands ready, normally un-driven, but eligible to start within a defined change-over time.
  • Interlocks: Suction pressure, discharge pressure, motor overload, vibration, bearing temperature, low NPSH, ESD signal, valve-end-switch feedback.
  • Change-over trigger: Trip of the working pump, sustained feedback mismatch (e.g., contactor pulled in but no flow proves), operator-forced duty swap, scheduled run-hour rotation.

Process requirement: detect the misoperation, de-energize the failed pump, start the reserve, and confirm the corresponding suction/discharge valve motion. The control cycle has to be deterministic and must not depend on operator initiation, because the requirement is 24/7 unattended operation. The cycle time of a typical S7-400 OB1 with PCS 7 CFC charts is in the 100-1000 ms range; the pump trip-to-start window must fit comfortably inside that cycle budget. For a 50 ms AS cycle the change-over reaction is bounded by 1 AS cycle + 1 valve actuation time + 1 drive ramp time, so a well-designed CFC chart delivers a sub-second response from fault to reserve-start command.

2. CFC vs SFC: Selection Criteria

Both CFC and SFC are IEC 61131-3 languages, but their execution semantics are fundamentally different and that difference drives the choice.

Attribute CFC SFC
Execution model Cyclic polling - every block runs on the configured OB/task and is re-evaluated each scan. Step/transition graph - active step persists until a transition evaluates TRUE.
State persistence Implicit in tag values (flip-flops, latches, run-time flags). Explicit via the active step number and per-step actions.
Best fit Continuous regulation, interlocks, mode selection, equipment-arbitration. Recipe/procedure execution, batch phases, start-up/shutdown sequences with strict ordering.
Fault handling Inline: each fault path is a branch on the same chart. Sequencer: faults map to fault steps; recovery is a separate sub-chart.
Restart behavior Idempotent - re-runs of the same scan produce the same result. Active step survives a hot restart; cold restart must reset to initial step.
Maintenance burden Low - the chart reads like a process & instrument diagram. Higher - step graph must be reasoned through end-to-end before any edit.

For a working/reserve change-over that must react to any of N fault sources at any moment, the polling model of CFC is the natural fit. SFC is the right tool when the work has a definite start, ordered phases, and a defined end - for example, the sequenced start of a pump (pre-lube → cooling-water prove → discharge-valve open → VFD ramp → flow prove → run).

Field rule of thumb. Use CFC for "what is the right state right now?" Use SFC for "what should happen next, in what order?". Most working pumping stations use CFC for the change-over arbitration and SFC for the per-pump start/stop sequence.

3. SFC Fundamentals: Per-Pump Start/Stop Sequence

An SFC for a single pump models the lifecycle as steps and transitions. The minimum useful sequence for a fixed-speed pump on a PCS 7 AS is:

  1. Step 1: Idle - drive commanded OFF, valve commanded closed, wait for start request.
  2. Step 2: Pre-start check - confirm discharge valve closed, suction pressure above low-low setpoint, no ESD, no trip latch.
  3. Step 3: Start command - close contactor (or VFD run forward), start change-over timer T_START (typical 5-10 s).
  4. Step 4: Run prove - wait for current feedback > I_RUN_MIN and discharge pressure rise. If T_START elapses without proof → transition to Step 6 (fault).
  5. Step 5: Running - monitor interlocks continuously. Any trip → Step 6. Stop request → Step 7.
  6. Step 6: Faulted - latch trip, raise alarm, wait for operator reset (or auto-reset timer).
  7. Step 7: Coasting - drop run command, start T_COAST (typical 10-30 s), then open discharge valve if process requires.

Each step holds an output that drives the actuator; transitions evaluate the conditions for moving to the next step. Because the active step persists across scans, the SFC handles the time-out behavior (T_START, T_COAST) cleanly via timers attached to the step.

4. CFC Fundamentals: Continuous Change-Over Arbitration

The change-over chart in CFC is a continuous arbitration between two (or more) pumps. The minimum logical elements are:

  • Per-pump status block: Ready, Running, Faulted, Run hours, Last-start timestamp.
  • Duty selector: picks which pump is currently in the Working role.
  • Change-over trigger: OR of all fault signals on the currently-working pump.
  • Change-over timer: debounce window (typical 2-5 s) to avoid flapping on transient feedback loss.
  • Reserve validation: confirm the reserve pump is Ready (no fault, no local-locked, no maintenance override).

Because the chart runs cyclically, a fault on the working pump is observed in the same scan it is signalled, the change-over timer is started, and on the next scan (or after the debounce window) the role swaps and the reserve SFC is allowed to start. The driving CFC chart is typically scheduled on OB35 (100 ms) or OB1 (the basic cyclic task) so that the polling budget matches the change-over requirement.

5. PCS 7 CIS_CK AddOn Library: Pump Manager Block

Siemens ships a dedicated add-on for the water-industry vertical called CIS_CK (formerly CIS/CK, now branded PCS 7 Water Library). The library exposes a pre-engineered Pump Manager block that encapsulates the working/reserve arbitration that would otherwise have to be written by hand in CFC. The block exposes inputs for the pump status (Ready, Running, Fault), the duty request, and the role of the pump (Working, Reserve, Standby, Out-of-Service). It produces the start/stop commands and a generated duty-swap signal for the partner pump.

Input Type Purpose
READY BOOL No fault, no local-lock, interlock chain closed.
RUNNING_FB BOOL Contactor closed or VFD run feedback.
FAULT BOOL Overload, trip, vibration, thermal, NPSH low.
Output Type Purpose
START_CMD BOOL Drives the pump SFC start step.
STOP_CMD BOOL Drives the pump SFC stop step.
ROLE INT 0=Out, 1=Reserve, 2=Working.
SWAP_REQUEST BOOL To the partner pump manager.
Library access. CIS_CK is delivered as a PCS 7 AddOn DVD and requires a license key registered against the AS station in the SIMATIC Manager / PCS 7 Engineering. The block set and faceplates are installed into the master data library and become available in the CFC catalog. Confirm the exact part number and current revision with Siemens Industry Online Support before ordering.

6. PCS 7 Industry Library: APL Aggregates

For users without the CIS_CK license, the standard PCS 7 Industry Library (also referenced as the Advanced Process Library, APL) ships a family of aggregate blocks - MotSpeed, MotRev, ValveAn, ValveMo - and the higher-level Aggregate blocks that wrap a motor plus its associated interlock chain. The aggregate blocks expose a LIOP (Local Interlock Override Pushbutton) input and a Permit chain that integrates cleanly with the change-over chart. For a working/reserve pair you instantiate two Motor blocks and wire the change-over logic in a small CFC that selects which one receives the duty start command.

7. Implementation Pattern: Combined CFC + SFC

The field-proven pattern for a two-pump change-over is hybrid:

  1. One CFC chart per pump (or one shared chart with two instances) - implements the change-over arbitration: who is Working, who is Reserve, when to swap. Uses the CIS_CK Pump Manager or a hand-rolled duty-selector built from RS flip-flops and a TON debounce.
  2. One SFC per pump - implements the per-pump start/stop lifecycle (Idle → Pre-start → Start → Run → Coasting → Idle).
  3. One CFC chart per associated valve - the valve's open/close command follows the pump's start/stop SFC outputs; the valve's end-switch feedback is fed back into the pump's RUNNING_FB prove logic.

The change-over CFC issues START_CMD to the reserve SFC. The reserve SFC walks through its start sequence. If the SFC cannot complete the start prove (e.g., T_START elapses with no current feedback), it transitions to the Faulted step and the CFC raises a START_FAILED alarm, which in turn fires a second-level change-over to a third pump if the station is configured with N+1 redundancy.

8. Drive-Level Interlock Integration

For variable-speed pumps the change-over CFC must command the VFD into a defined state before swapping. Recommended sequence:

  1. Working pump fault detected.
  2. CFC issues STOP_CMD to working SFC.
  3. Working SFC ramps speed reference to 0 (typical 5-10 s ramp), drops run enable, then signals STOPPED.
  4. CFC waits for STOPPED confirmation plus a configurable interlock-purge time (typical 2-3 s) to allow the DC bus to discharge.
  5. CFC issues START_CMD to reserve SFC. The reserve SFC closes its breaker, ramps the VFD to the setpoint inherited from the working pump's last reference, and proves flow.

Hardwired permissives (emergency stop, motor protection relay) must remain in series with the contactor/VFD enable and must not be implemented in software alone. The CFC reads them as PERMIT on the APL Motor block and the SFC will not advance from Idle to Start if the permit is absent.

9. Valve Sequencing and Feedback Handling

For a pump with a non-return valve on the discharge, the change-over can be simplified: the non-return valve prevents back-flow, so the reserve pump can start as soon as its own suction valve is open and its own discharge valve is open (the failed pump's discharge NRV will close on depressurization). For a pump with a motorised discharge valve that must be commanded, the CFC must include the valve open-end-switch in the RUNNING_FB prove chain and must treat a stuck valve as a separate fault that does not trigger a duty swap (because the reserve will encounter the same stuck valve).

10. Testing and Verification Procedures

Before commissioning, validate the change-over logic on the AS test rack (S7-PLCSIM or a hardware simulator) and then on the real plant. The minimum test matrix is:

Test ID Trigger Expected Result
CT-01 Force motor overload on Working pump. Reserve starts within T_DEBOUNCE + 1 AS cycle, alarm raised, duty registers swap.
CT-02 Force RUNNING_FB = FALSE while run command is TRUE (simulated contactor fail). After T_RUN_PROVE the pump is declared failed, reserve starts.
CT-03 Operator duty-swap from WinCC faceplate. Working stops via normal coast, reserve starts, both transition alarms logged.
CT-04 Reserve pump placed in Local-Lock. Change-over does not start the locked pump, second-level alarm raised.
CT-05 ESD pushbutton pressed. All pumps stop, valves fail-safe, change-over disabled until ESD reset.
CT-06 AS hot restart. Working/Reserve roles restored from last persisted state, no spurious start.
CT-07 AS cold restart. Initial step of all SFCs is Idle, no pump starts without operator initiation.

Verify in the CFC online view that the change-over timer (TON block) is reset on every successful swap. Verify in the SFC online view that after a swap the previously-working SFC is in Idle (not stuck in Coasting or Faulted). Cross-check the WinCC alarm log for spurious PUMP_FAULT messages caused by the CFC debounce window being too short.

11. Troubleshooting Matrix

Symptom Likely Root Cause Diagnostic Step Corrective Action
Reserve never starts after working trip. Reserve READY is FALSE (fault latch, local-lock, permit open). Online view: inspect READY input on reserve Pump Manager / Motor block. Clear fault, unlock local, close permit chain.
Reserve starts then immediately stops (chatter). Debounce timer T_DEBOUNCE too short, or shared interlock drops when both pumps draw. Trend T_DEBOUNCE and the interlock tag simultaneously. Increase T_DEBOUNCE; review simultaneous-start lockout.
Change-over fires but the new pump trips on start. Reserve SFC start-prove timer too short for the mechanical run-up. Check T_START value vs. pump run-up curve. Raise T_START to allow full mechanical run-up; if too long, add intermediate prove (current > 30%).
Working and Reserve both running simultaneously. Race condition: working stop command and reserve start command are not interlocked. Online view: observe run commands of both SFCs. Add mutual-exclusion logic in the change-over CFC; enforce stop-confirm-wait before reserve start.
Duty swap on every scan (flickering). RUNNING_FB is taken from a non-debounced auxiliary contact. Trace RUNNING_FB on the trend. Insert a TON debounce of at least 1 s on the RUNNING_FB input before feeding the SFC.
SFC will not advance from Idle after AS restart. Start condition depends on a one-shot rising edge that was lost during restart. Check start-request edge generation. Use persistent request + acknowledge, not rising-edge detection, for the start interlock.
Alarms raised for both pumps after a single trip. Fault signal is wired to both the pump SFC and the change-over CFC, and both raise an alarm. Inspect alarm routing in WinCC. Suppress the change-over CFC alarm for the working pump; only the SFC alarm should fire on the failed pump.

12. Library Sourcing and Documentation

For the most current catalog numbers, license terms, and engineering notes, consult Siemens Industry Online Support. The CIS_CK add-on has been rebranded under the PCS 7 Water Library naming in recent PCS 7 versions; the underlying block set and the Pump Manager faceplate remain functionally equivalent. The Industry Library (APL) is part of the standard PCS 7 delivery and is documented in the PCS 7 Engineering System help set. Search the Siemens support portal for "PCS 7 Water Library", "CIS_CK Pump Manager", and "APL Motor block" for the latest engineering manuals and example projects.

Should I use CFC or SFC for a 24/7 pumping station change-over?

Use CFC for the change-over arbitration (the working/reserve role selection and the fault-driven swap). Use SFC for the per-pump start/stop lifecycle (Idle → Pre-start → Start → Run → Coasting). The polling model of CFC matches the "detect fault and respond this cycle" requirement, while the SFC handles the time-out and ordered-step behavior of an individual pump start.

What is the CIS_CK / PCS 7 Water Library Pump Manager block?

It is a pre-engineered CFC block delivered with the Siemens PCS 7 CIS_CK AddOn (now marketed as the PCS 7 Water Library) that encapsulates working/reserve pump arbitration. It exposes READY, RUNNING_FB, FAULT inputs and produces START_CMD, STOP_CMD, and a SWAP_REQUEST to the partner pump. It is licensed separately and installed into the CFC catalog.

How do I implement working/reserve logic without the CIS_CK library?

Use the PCS 7 Industry Library (APL) Motor aggregate blocks - one per pump - and a small hand-written CFC chart that implements a duty selector (RS flip-flops holding the Working/Reserve roles), a debounce timer (TON, 2-5 s) on the fault OR, and a reserve-Ready validation gate before the duty swap is committed. The same logic structure that CIS_CK automates can be reproduced in roughly 8-12 CFC blocks per pair.

What debounce time should I set on the change-over trigger?

For a 50-100 ms AS cycle, a debounce of 2-5 s on the OR of the working-pump fault signals is typical. Shorter values risk flapping on transient feedback loss; longer values delay the response to a real trip. Tune by trending the fault tag and the change-over output, and validate against the start-prove time of the reserve SFC.

How does the SFC interact with the change-over CFC?

The CFC owns the duty decision and writes START_CMD and STOP_CMD to the SFC. The SFC owns the lifecycle of the individual pump and writes back RUNNING, FAULTED, and STOPPED status flags. The CFC reads those flags to decide whether the next swap is permitted (a pump in FAULTED state must not be promoted to Working on the next swap).

Back to blog