what is PLC (SFC) Sequential Function Chart?

What is PLC Sequential Function Chart (SFC)?

Sequential Function Chart (SFC) structures sequential operations in PLC programs through steps, transitions and actions. Within IEC 61131-3, it is defined for organising the internal structure of programs and function blocks. It is useful for filling, assembly and packaging automation. SFC goes beyond an ordinary flow drawing by defining active steps and transition rules.

What are the main elements? A step represents a process state, a transition defines a condition for advancing, and an action contains associated control operations. Directed connections describe their relationships. Labels such as START, INPUT, PROCEDURE or GROUP END should not be presented as a universal SFC instruction set.

The initial step: The initial step establishes the chart's first active state and is shown with a double border in many editors. It can organise a preparation or waiting state. An active initial step does not require the machine to move automatically; starting conditions are defined separately.

How does a transition work? A transition evaluates to a BOOL result. In a simple sequence, the next step becomes active when the preceding step is active and the transition condition is TRUE; the preceding step becomes inactive. A TRUE condition differs from rising-edge detection. Check that a confirmation left TRUE from an earlier operation cannot advance the new operation incorrectly.

What does an action do? An action can generate commands, calculate values, prepare data or call a function block. Supported environments allow actions written in Structured Text, Ladder Diagram or FBD. SFC organises the sequence; the action's code defines the work to perform. Make it clear which variables each action writes.

Action qualifiers: N denotes a non-stored action tied to step activity; S denotes a stored action that can remain active until reset; R resets the associated action. Timed qualifiers such as L and D may also be available. A qualifier determines an action's activation behaviour. Check supported qualifiers and activation/deactivation execution details for the platform.

Does leaving a step turn an output off? Writing ValveRequest := TRUE; in an action does not establish that the variable automatically becomes FALSE when the step ends on every platform. Stopping an action and clearing the value it wrote are separate operations. Output commands can be explicitly calculated from active steps and permissions, or managed with appropriate reset logic. Prevent different actions from writing conflicting values to the same output.

When does SFC execute? The PLC CPU runs the SFC program through a configured task or call. Task scheduling and cycle time affect when conditions are evaluated. Action/transition processing order and how far the chart advances within a call depend on the environment. A chart connection does not imply an immediate physical-device response.

Alternative branches: These select one sequence path according to different conditions. For example, normal operation and a fault path can be separated. If several transitions can be TRUE together, define the selection or priority rule explicitly. Do not rely solely on drawing position for fault priority; design normal-transition conditions accordingly.

Parallel branches: Steps in several sequence paths can be active concurrently. A joining transition advances when its preceding steps are active and its transition condition is satisfied. Concurrent activity does not mean CPU instructions or two physical devices operate at exactly the same instant.

Example — Waiting and filling: In a simple tank sequence, S0: Waiting advances to S1: Filling when there is a new start request, process permission and empty-tank confirmation. The fill request is derived from this step's activity; full-tank confirmation enables the next transition. In this example, fill, mix and drain requests are calculated on every call from their respective active steps and permissions.

Example — Mixing and draining: S2: Mixing generates a mixing request. A ten-second timing interval started with motor-running confirmation must complete before advancing to S3: Draining. Empty-tank confirmation returns the sequence to S0. Define timer starting, resetting and regular calls explicitly; require a new start request for the next cycle.

Timeouts and successful completion: If filling confirmation does not arrive within the allowed time, define the fault state and required output response. Handle the possibility of normal and fault transitions becoming true together. Elapsed time does not establish successful completion; distinguish a timeout from normal completion.

Reset and startup after power loss: Consider active steps, stored actions, timers and command variables together when resetting. Retentive memory settings can affect behaviour after power returns. Resetting the chart does not return the physical process to its initial conditions. Check tank level, mechanism position and permission to restart.

Feedback and hardware: Interpret sensor confirmation, I/O mapping and motor-drive status correctly. Remote I/O and communication updates also affect response time. A transmitted command differs from confirmation that movement or processing has finished. Define the actual completion criteria used in transitions.

Can SFC work with PID? SFC can select a setpoint or operating request according to the process phase, while PID control regulates the relevant variable. Sequence management and regulating control have different roles. Preserve an appropriate sampling interval and call arrangement for the PID block. Define whether PID continues, stops or restarts when leaving a phase.

What should be monitored while debugging? During debugging, inspect active steps, transition results, action activity, timing and output commands together. Use meaningful step and alarm names on HMI or SCADA. A missing confirmation and a confirmation stuck TRUE need separate investigation. Forcing the chart to advance does not resolve a missing process condition.

Does every PLC support SFC? Check support in the PLC programming environment, CPU and required licences. An SFC editor in the programming software does not establish compatibility with every target device. Execution options can differ between CODESYS and other environments. Validate the project on the selected target. Recheck action, timing and reset behaviour when transferring a chart.

Are SFC and GRAFCET identical? SFC structures programs within IEC 61131-3; GRAFCET is a specification language for sequential control behaviour defined in IEC 60848. They use related step and transition concepts. When implementing a GRAFCET design in a PLC's SFC editor, do not assume identical execution and action rules.

Machine safety: SFC can implement fault handling or a stopping sequence, but using a graphical chart does not establish a validated safety function. Safety design requires appropriate hardware, control architecture and verification. A normal transition, action reset or CPU STOP state alone should not be treated as a safe stop.