Decoding and Commanding PCS 7 SFCs via the SFC_CONTROL Interface Word
In SIMATIC PCS 7, controlling Sequential Function Charts (SFC charts and SFC types) from external systems, custom CFC logic, or third-party HMIs without using the proprietary WinCC SFC Visualization ActiveX control is achieved via the 32-bit input control word SFC_CONTROL. Paired with the status output word SFC_STATE, SFC_CONTROL accepts bit-encoded command pulses that execute sequential state machine transitions (such as Start, Hold, Resume, Abort, Stop, and Reset) and operating mode changes (Manual vs Automatic). To execute a command, the target command bit must be pulsed high for at least one execution cycle while the SFC is in a valid receptive operating state.
Table of Contents
- Architecture of SFC External Control Interfaces
- Bitmask Decoding and Command Mapping for SFC_CONTROL
- Coordinating Commands with SFC_STATE Status Monitoring
- CFC and Third-Party HMI Implementation Guidelines
- Verification
- Limitations and Operational Precautions
- Engineer FAQ
- Technical References
- Related Articles
- Related Tags
Architecture of SFC External Control Interfaces
In SIMATIC PCS 7, Sequential Function Charts (SFC) provide structured sequential and batch phase execution following the ISA-88 / NAMUR state model. While standard PCS 7 operator stations interact with SFCs via the pre-built WinCC SFC Visualization package, engineering projects frequently require controlling SFC sequences through alternative channels:
- Autonomous inter-controller handshakes across S7 or Modbus connections.
- Third-party local operator panels (such as SIMATIC Basic Panels or third-party SCADA systems).
- Advanced supervisory coordinating charts in CFC.
To support external programmatic control, the SFC runtime system (FB246 / SFC Type instances) exposes two standardized 32-bit interface words: SFC_CONTROL (inputs from control authority) and SFC_STATE (outputs indicating active state and operating mode).
Bitmask Decoding and Command Mapping for SFC_CONTROL
The SFC_CONTROL input is a 32-bit DWORD where individual bits trigger discrete state transitions. Because official documentation provides limited parameter descriptions, the table below provides the verified bitmask mapping:
16#00000001START16#00000002HOLD16#00000004RESUME16#00000008PAUSE16#00000010CONT16#00000020ABORT16#00000040STOP16#00000080RESTART16#00000100RESET16#00010000MANUAL16#00020000AUTOAll command bits operate on rising-edge or single-cycle pulse evaluation. Writing a static 1 without resetting the bit will lock that command active, preventing subsequent state transitions.
Coordinating Commands with SFC_STATE Status Monitoring
Before asserting a command on SFC_CONTROL, the supervising program or HMI script must inspect SFC_STATE to confirm that the state machine is in a receptive condition:
- Idle (State 1): Accepts
START(Bit 0). - Running (State 3): Accepts
HOLD(Bit 1),PAUSE(Bit 3),STOP(Bit 6), orABORT(Bit 5). - Held (State 5): Accepts
RESUME(Bit 2) orABORT(Bit 5). - Completed (State 11): Accepts
RESET(Bit 8).
Attempting to issue RESUME while the SFC is actively Running or issuing START while in Aborting will be rejected by the internal SFC sequencer.
CFC and Third-Party HMI Implementation Guidelines
To command an SFC from a third-party HMI or external CFC logic:
- Pulse Logic: In CFC, utilize pulse generation blocks (such as
PulseorR_TRIG) to ensure that command bits are asserted for exactly one execution cycle (e.g., 100 ms in OB35). - Third-Party HMI Pushbuttons: In WinCC Comfort or third-party SCADA:
- Configure button events using 'SetBitInTag' on button press, and 'ResetBitInTag' on button release.
- Alternatively, write a brief VBS script that readsSFC_CONTROL, performs a bitwise OR with the command mask, waits 200 ms, and performs a bitwise AND with the inverted mask to reset the bit. - Operating Mode Interlocks: Ensure that the SFC is switched to Manual mode (
Bit 16 = 1) if manual operator stepping or external commands are required, or configure the SFC instance parameterENASTART = 1.
Verification
To verify SFC control via SFC_CONTROL:
1. In CFC Editor, open the chart containing the SFC instance in online test mode.
2. In the SFC window, verify the state is Idle (SFC_STATE = 1).
3. Using CFC online forcing or an HMI button, pulse SFC_CONTROL = 16#00000001 (Start command).
4. Verify that the SFC transitions immediately to Starting -> Running, and that step timers begin advancing.
5. Pulse SFC_CONTROL = 16#00000002 (Hold command); verify that the SFC halts at the current step and reports status Held.
Limitations and Operational Precautions
Never write multiple conflicting command bits simultaneously to SFC_CONTROL (e.g., asserting START and STOP in the same word). If conflicting bits are written, the SFC priority logic executes the highest safety priority command (typically ABORT or STOP). Ensure safety-critical emergency stops are hardwired or routed through dedicated safety interlock pins (INTLOCK), rather than relying solely on software SFC_CONTROL words.
Engineer FAQ
Can SFC_CONTROL be used while the SFC is in Automatic mode?
Certain commands (like ABORT or STOP) can execute in Automatic mode depending on configured permissions, but operational stepping and manual starts typically require switching to Manual mode (Bit 16 = 1).
Why did my Start command fail to start the SFC?
The SFC may have unsatisfied start interlocks (ENASTART = 0), or the previous batch execution may not have been reset (RESET command Bit 8 required to return Completed SFCs to Idle).
What block handles SFC type instance execution in S7-400?
SFC types are executed by compiled function blocks generated from the SFC Editor, typically utilizing system runtime FB246.
Technical References
- SIMATIC Process Control System PCS 7 SFC for SIMATIC S7 Manual (A5E33814031)
- SIMATIC SFC Visualization for PCS 7 Manual (A5E33814032)
- SIMATIC PCS 7 Advanced Process Library Manual (A5E33814036)
Related Articles
- Troubleshooting Severe SFC Visualization Opening Delays and Freezes in PCS 7 WinCC
- Preventing Premature Termination of Endless Looping PCS 7 SFCs
- Resolving Conversion Error During SFC Type Changes Download in PCS 7
Related Tags
- SFC_CONTROL
- SFC_STATE
- Sequential Function Chart
- Third-Party HMI
- Command Word